Class AssetTagLocalServiceImpl
Object
com.liferay.portal.kernel.service.BaseLocalServiceImpl
com.liferay.portlet.asset.service.base.AssetTagLocalServiceBaseImpl
com.liferay.portlet.asset.service.impl.AssetTagLocalServiceImpl
- All Implemented Interfaces:
com.liferay.asset.kernel.service.AssetTagLocalService
,com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService
,com.liferay.portal.kernel.service.BaseLocalService
,com.liferay.portal.kernel.service.change.tracking.CTService<com.liferay.asset.kernel.model.AssetTag>
,com.liferay.portal.kernel.service.PersistedModelLocalService
Provides the local service for accessing, adding, checking, deleting,
merging, and updating asset tags.
- Author:
- Brian Wing Shun Chan, Alvaro del Castillo, Jorge Ferrer, Bruno Farache
-
Field Summary
Fields inherited from class com.liferay.portlet.asset.service.base.AssetTagLocalServiceBaseImpl
assetEntryPersistence, assetTagFinder, assetTagLocalService, assetTagPersistence, counterLocalService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.liferay.asset.kernel.model.AssetTag
addTag
(String externalReferenceCode, long userId, long groupId, String name, com.liferay.portal.kernel.service.ServiceContext serviceContext) Adds an asset tag.protected com.liferay.portal.kernel.search.SearchContext
buildSearchContext
(long companyId, long[] groupIds, String name, int start, int end, com.liferay.portal.kernel.search.Sort sort) List<com.liferay.asset.kernel.model.AssetTag>
Returns the asset tags matching the group and names, creating new asset tags matching the names if the group doesn't already have them.List<com.liferay.asset.kernel.model.AssetTag>
Returns the asset tags matching the group and names, creating new asset tags matching the names if the group doesn't already have them.com.liferay.asset.kernel.model.AssetTag
decrementAssetCount
(long tagId, long classNameId) Decrements the number of assets to which the asset tag has been applied.void
deleteGroupTags
(long groupId) Deletes all asset tags in the group.void
deleteTag
(long tagId) Deletes the asset tag.void
deleteTag
(com.liferay.asset.kernel.model.AssetTag tag) Deletes the asset tag.com.liferay.asset.kernel.model.AssetTag
Returns the asset tag with the name in the group.List<com.liferay.asset.kernel.model.AssetTag>
getEntryTags
(long entryId) Returns the asset tags of the asset entry.List<com.liferay.asset.kernel.model.AssetTag>
getGroupsTags
(long[] groupIds) Returns the asset tags in the groups.List<com.liferay.asset.kernel.model.AssetTag>
getGroupTags
(long groupId) Returns the asset tags in the group.List<com.liferay.asset.kernel.model.AssetTag>
getGroupTags
(long groupId, int start, int end) Returns a range of all the asset tags in the group.List<com.liferay.asset.kernel.model.AssetTag>
getGroupTags
(long groupId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.asset.kernel.model.AssetTag> orderByComparator) Returns a range of all the asset tags in the group.int
getGroupTagsCount
(long groupId) Returns the number of asset tags in the group.com.liferay.asset.kernel.model.AssetTag
getTag
(long tagId) Returns the asset tag with the primary key.com.liferay.asset.kernel.model.AssetTag
Returns the asset tag with the name in the group.long[]
Returns the primary keys of the asset tags with the name in the groups.long[]
Returns the primary keys of the asset tags with the names in the groups.long[]
Returns the primary keys of the asset tags with the names in the group.long[]
Returns the primary keys of the asset tags with the names.String[]
Returns the names of all the asset tags.String[]
getTagNames
(long classNameId, long classPK) Returns the names of the asset tags of the entity.String[]
getTagNames
(String className, long classPK) Returns the names of the asset tags of the entityprotected String[]
getTagNames
(List<com.liferay.asset.kernel.model.AssetTag> tags) List<com.liferay.asset.kernel.model.AssetTag>
getTags()
Returns all the asset tags.List<com.liferay.asset.kernel.model.AssetTag>
getTags
(long classNameId, long classPK) Returns the asset tags of the entity.List<com.liferay.asset.kernel.model.AssetTag>
List<com.liferay.asset.kernel.model.AssetTag>
protected List<com.liferay.asset.kernel.model.AssetTag>
getTags
(com.liferay.portal.kernel.search.Hits hits) List<com.liferay.asset.kernel.model.AssetTag>
Returns the asset tags of the entity.int
getTagsSize
(long groupId, long classNameId, String name) boolean
Returnstrue
if the group contains an asset tag with the name.com.liferay.asset.kernel.model.AssetTag
incrementAssetCount
(long tagId, long classNameId) Increments the number of assets to which the asset tag has been applied.void
mergeTags
(long fromTagId, long toTagId) Replaces all occurrences of the first asset tag with the second asset tag and deletes the first asset tag.List<com.liferay.asset.kernel.model.AssetTag>
Returns the asset tags in the groups whose names match the pattern.List<com.liferay.asset.kernel.model.AssetTag>
Returns the asset tags in the group whose names match the pattern.com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.asset.kernel.model.AssetTag>
searchTags
(long[] groupIds, String name, int start, int end, com.liferay.portal.kernel.search.Sort sort) protected com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.asset.kernel.model.AssetTag>
searchTags
(com.liferay.portal.kernel.search.SearchContext searchContext) void
subscribeTag
(long userId, long groupId, long tagId) void
unsubscribeTag
(long userId, long tagId) com.liferay.asset.kernel.model.AssetTag
updateTag
(String externalReferenceCode, long userId, long tagId, String name, com.liferay.portal.kernel.service.ServiceContext serviceContext) protected void
Methods inherited from class com.liferay.portlet.asset.service.base.AssetTagLocalServiceBaseImpl
addAssetEntryAssetTag, addAssetEntryAssetTag, addAssetEntryAssetTags, addAssetEntryAssetTags, addAssetTag, afterPropertiesSet, clearAssetEntryAssetTags, createAssetTag, createPersistedModel, deleteAssetEntryAssetTag, deleteAssetEntryAssetTag, deleteAssetEntryAssetTags, deleteAssetEntryAssetTags, deleteAssetTag, deleteAssetTag, deletePersistedModel, destroy, dslQuery, dslQueryCount, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, dynamicQueryCount, fetchAssetTag, fetchAssetTagByExternalReferenceCode, fetchAssetTagByUuidAndGroupId, getActionableDynamicQuery, getAssetEntryAssetTags, getAssetEntryAssetTags, getAssetEntryAssetTags, getAssetEntryAssetTagsCount, getAssetEntryPrimaryKeys, getAssetTag, getAssetTagByExternalReferenceCode, getAssetTagByUuidAndGroupId, getAssetTagFinder, getAssetTagLocalService, getAssetTagPersistence, getAssetTags, getAssetTagsByUuidAndCompanyId, getAssetTagsByUuidAndCompanyId, getAssetTagsCount, getBasePersistence, getCounterLocalService, getCTPersistence, getExportActionableDynamicQuery, getIndexableActionableDynamicQuery, getModelClass, getModelClassName, getOSGiServiceIdentifier, getPersistedModel, hasAssetEntryAssetTag, hasAssetEntryAssetTags, initActionableDynamicQuery, runSQL, setAssetEntryAssetTags, setAssetTagFinder, setAssetTagLocalService, setAssetTagPersistence, setCounterLocalService, updateAssetTag, updateWithUnsafeFunction
Methods inherited from class com.liferay.portal.kernel.service.BaseLocalServiceImpl
getClassLoader, getLocalizationMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.liferay.portal.kernel.service.PersistedModelLocalService
fetchPersistedModel
-
Constructor Details
-
AssetTagLocalServiceImpl
public AssetTagLocalServiceImpl()
-
-
Method Details
-
addTag
@Indexable(type=REINDEX) public com.liferay.asset.kernel.model.AssetTag addTag(String externalReferenceCode, long userId, long groupId, String name, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException Adds an asset tag.- Parameters:
externalReferenceCode
-userId
- the primary key of the user adding the asset taggroupId
- the primary key of the group in which the asset tag is to be addedname
- the asset tag's nameserviceContext
- the service context to be applied- Returns:
- the asset tag that was added
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
checkTags
public List<com.liferay.asset.kernel.model.AssetTag> checkTags(long userId, com.liferay.portal.kernel.model.Group group, String[] names) throws com.liferay.portal.kernel.exception.PortalException Returns the asset tags matching the group and names, creating new asset tags matching the names if the group doesn't already have them.For each name, if an asset tag with the name doesn't already exist in the group, this method creates a new asset tag with the name in the group.
- Parameters:
userId
- the primary key of the user checking the asset tagsgroup
- the group in which to check the asset tagsnames
- the asset tag names- Returns:
- the asset tags matching the group and names and new asset tags matching the names that don't already exist in the group
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
checkTags
public List<com.liferay.asset.kernel.model.AssetTag> checkTags(long userId, long groupId, String[] names) throws com.liferay.portal.kernel.exception.PortalException Returns the asset tags matching the group and names, creating new asset tags matching the names if the group doesn't already have them.- Parameters:
userId
- the primary key of the user checking the asset tagsgroupId
- the primary key of the group in which check the asset tagsnames
- the asset tag names- Returns:
- the asset tags matching the group and names and new asset tags matching the names that don't already exist in the group
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
decrementAssetCount
@Indexable(type=REINDEX) public com.liferay.asset.kernel.model.AssetTag decrementAssetCount(long tagId, long classNameId) throws com.liferay.portal.kernel.exception.PortalException Decrements the number of assets to which the asset tag has been applied.- Parameters:
tagId
- the primary key of the asset tagclassNameId
- the class name ID of the entity to which the asset tag had been applied- Returns:
- the asset tag
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteGroupTags
public void deleteGroupTags(long groupId) throws com.liferay.portal.kernel.exception.PortalException Deletes all asset tags in the group.- Parameters:
groupId
- the primary key of the group in which to delete all asset tags- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteTag
@SystemEvent(type=1) public void deleteTag(com.liferay.asset.kernel.model.AssetTag tag) throws com.liferay.portal.kernel.exception.PortalException Deletes the asset tag.- Parameters:
tag
- the asset tag to be deleted- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteTag
public void deleteTag(long tagId) throws com.liferay.portal.kernel.exception.PortalException Deletes the asset tag.- Parameters:
tagId
- the primary key of the asset tag- Throws:
com.liferay.portal.kernel.exception.PortalException
-
fetchTag
Returns the asset tag with the name in the group.- Parameters:
groupId
- the primary key of the groupname
- the asset tag's name- Returns:
- the asset tag with the name in the group or
null
if it could not be found
-
getEntryTags
Returns the asset tags of the asset entry.- Parameters:
entryId
- the primary key of the asset entry- Returns:
- the asset tags of the asset entry
-
getGroupsTags
Returns the asset tags in the groups.- Parameters:
groupIds
- the primary keys of the groups- Returns:
- the asset tags in the groups
-
getGroupTags
Returns the asset tags in the group.- Parameters:
groupId
- the primary key of the group- Returns:
- the asset tags in the group
-
getGroupTags
Returns a range of all the asset tags in the group.- Parameters:
groupId
- the primary key of the groupstart
- the lower bound of the range of asset tagsend
- the upper bound of the range of asset tags (not inclusive)- Returns:
- the range of matching asset tags
-
getGroupTags
public List<com.liferay.asset.kernel.model.AssetTag> getGroupTags(long groupId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.asset.kernel.model.AssetTag> orderByComparator) Returns a range of all the asset tags in the group.- Parameters:
groupId
- the primary key of the groupstart
- the lower bound of the range of asset tagsend
- the upper bound of the range of asset tags (not inclusive)orderByComparator
- the comparator to order the asset tags (optionallynull
)- Returns:
- the range of matching asset tags
-
getGroupTagsCount
public int getGroupTagsCount(long groupId) Returns the number of asset tags in the group.- Parameters:
groupId
- the primary key of the group- Returns:
- the number of asset tags in the group
-
getTag
public com.liferay.asset.kernel.model.AssetTag getTag(long tagId) throws com.liferay.portal.kernel.exception.PortalException Returns the asset tag with the primary key.- Parameters:
tagId
- the primary key of the asset tag- Returns:
- the asset tag with the primary key
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
getTag
public com.liferay.asset.kernel.model.AssetTag getTag(long groupId, String name) throws com.liferay.portal.kernel.exception.PortalException Returns the asset tag with the name in the group.- Parameters:
groupId
- the primary key of the groupname
- the name of the asset tag- Returns:
- the asset tag with the name in the group
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
getTagIds
Returns the primary keys of the asset tags with the names in the group.- Parameters:
groupId
- the primary key of the groupnames
- the names of the asset tags- Returns:
- the primary keys of the asset tags with the names in the group
-
getTagIds
Returns the primary keys of the asset tags with the name in the groups.- Parameters:
groupIds
- the primary keys of the groupsname
- the name of the asset tags- Returns:
- the primary keys of the asset tags with the name in the groups
-
getTagIds
Returns the primary keys of the asset tags with the names in the groups.- Parameters:
groupIds
- the primary keys of the groupsnames
- the names of the asset tags- Returns:
- the primary keys of the asset tags with the names in the groups
-
getTagIds
Returns the primary keys of the asset tags with the names.- Parameters:
name
- the name of the asset tags- Returns:
- the primary keys of the asset tags with the names
-
getTagNames
Returns the names of all the asset tags.- Returns:
- the names of all the asset tags
-
getTagNames
Returns the names of the asset tags of the entity.- Parameters:
classNameId
- the class name ID of the entityclassPK
- the primary key of the entity- Returns:
- the names of the asset tags of the entity
-
getTagNames
Returns the names of the asset tags of the entity- Parameters:
className
- the class name of the entityclassPK
- the primary key of the entity- Returns:
- the names of the asset tags of the entity
-
getTags
Returns all the asset tags.- Returns:
- the asset tags
-
getTags
Returns the asset tags of the entity.- Parameters:
classNameId
- the class name ID of the entityclassPK
- the primary key of the entity- Returns:
- the asset tags of the entity
-
getTags
-
getTags
-
getTags
@ThreadLocalCachable public List<com.liferay.asset.kernel.model.AssetTag> getTags(String className, long classPK) Returns the asset tags of the entity.- Parameters:
className
- the class name of the entityclassPK
- the primary key of the entity- Returns:
- the asset tags of the entity
-
getTagsSize
-
hasTag
Returnstrue
if the group contains an asset tag with the name.- Parameters:
groupId
- the primary key of the groupname
- the name of the asset tag- Returns:
true
if the group contains an asset tag with the name;false
otherwise.
-
incrementAssetCount
@BufferedIncrement(incrementClass=com.liferay.portal.kernel.increment.NumberIncrement.class) @Indexable(type=REINDEX) public com.liferay.asset.kernel.model.AssetTag incrementAssetCount(long tagId, long classNameId) throws com.liferay.portal.kernel.exception.PortalException Increments the number of assets to which the asset tag has been applied.- Parameters:
tagId
- the primary key of the asset tagclassNameId
- the class name ID of the entity to which the asset tag is being applied- Returns:
- the asset tag
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
mergeTags
public void mergeTags(long fromTagId, long toTagId) throws com.liferay.portal.kernel.exception.PortalException Replaces all occurrences of the first asset tag with the second asset tag and deletes the first asset tag.- Parameters:
fromTagId
- the primary key of the asset tag to be replacedtoTagId
- the primary key of the asset tag to apply to the asset entries of the other asset tag- Throws:
com.liferay.portal.kernel.exception.PortalException
-
search
public List<com.liferay.asset.kernel.model.AssetTag> search(long groupId, String name, int start, int end) Returns the asset tags in the group whose names match the pattern.- Parameters:
groupId
- the primary key of the groupname
- the pattern to matchstart
- the lower bound of the range of asset tagsend
- the upper bound of the range of asset tags (not inclusive)- Returns:
- the asset tags in the group whose names match the pattern
-
search
public List<com.liferay.asset.kernel.model.AssetTag> search(long[] groupIds, String name, int start, int end) Returns the asset tags in the groups whose names match the pattern.- Parameters:
groupIds
- the primary keys of the groupsname
- the pattern to matchstart
- the lower bound of the range of asset tagsend
- the upper bound of the range of asset tags (not inclusive)- Returns:
- the asset tags in the groups whose names match the pattern
-
searchTags
public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.asset.kernel.model.AssetTag> searchTags(long[] groupIds, String name, int start, int end, com.liferay.portal.kernel.search.Sort sort) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
subscribeTag
public void subscribeTag(long userId, long groupId, long tagId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
unsubscribeTag
public void unsubscribeTag(long userId, long tagId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
updateTag
@Indexable(type=REINDEX) public com.liferay.asset.kernel.model.AssetTag updateTag(String externalReferenceCode, long userId, long tagId, String name, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
buildSearchContext
protected com.liferay.portal.kernel.search.SearchContext buildSearchContext(long companyId, long[] groupIds, String name, int start, int end, com.liferay.portal.kernel.search.Sort sort) -
getTagNames
-
getTags
protected List<com.liferay.asset.kernel.model.AssetTag> getTags(com.liferay.portal.kernel.search.Hits hits) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
searchTags
protected com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.asset.kernel.model.AssetTag> searchTags(com.liferay.portal.kernel.search.SearchContext searchContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
validate
- Throws:
com.liferay.portal.kernel.exception.PortalException
-