Class AssetTagLocalServiceUtil
com.liferay.portlet.asset.service.impl.AssetTagLocalServiceImpl and
is an access point for service operations in application layer code running
on the local server. Methods of this service will not have security checks
based on the propagated JAAS credentials because this service can only be
accessed from within the same VM.- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddAssetEntryAssetTag(long entryId, long tagId) static booleanaddAssetEntryAssetTag(long entryId, AssetTag assetTag) static booleanaddAssetEntryAssetTags(long entryId, long[] tagIds) static booleanaddAssetEntryAssetTags(long entryId, List<AssetTag> assetTags) static AssetTagaddAssetTag(AssetTag assetTag) Adds the asset tag to the database.static AssetTagaddTag(String externalReferenceCode, long userId, long groupId, String name, ServiceContext serviceContext) Adds an asset tag.Returns the asset tags matching the group and names, creating new asset tags matching the names if the group doesn't already have them.Returns the asset tags matching the group and names, creating new asset tags matching the names if the group doesn't already have them.static voidclearAssetEntryAssetTags(long entryId) static AssetTagcreateAssetTag(long tagId) Creates a new asset tag with the primary key.static PersistedModelcreatePersistedModel(Serializable primaryKeyObj) static AssetTagdecrementAssetCount(long tagId, long classNameId) Decrements the number of assets to which the asset tag has been applied.static voiddeleteAssetEntryAssetTag(long entryId, long tagId) static voiddeleteAssetEntryAssetTag(long entryId, AssetTag assetTag) static voiddeleteAssetEntryAssetTags(long entryId, long[] tagIds) static voiddeleteAssetEntryAssetTags(long entryId, List<AssetTag> assetTags) static AssetTagdeleteAssetTag(long tagId) Deletes the asset tag with the primary key from the database.static AssetTagdeleteAssetTag(AssetTag assetTag) Deletes the asset tag from the database.static voiddeleteGroupTags(long groupId) Deletes all asset tags in the group.static PersistedModeldeletePersistedModel(PersistedModel persistedModel) static voiddeleteTag(long tagId) Deletes the asset tag.static voidDeletes the asset tag.static <T> TdslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static intdslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static DynamicQuerystatic <T> List<T>dynamicQuery(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.static <T> List<T>dynamicQuery(DynamicQuery dynamicQuery, int start, int end) Performs a dynamic query on the database and returns a range of the matching rows.static <T> List<T>dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.static longdynamicQueryCount(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.static longdynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.static AssetTagfetchAssetTag(long tagId) static AssetTagfetchAssetTagByExternalReferenceCode(String externalReferenceCode, long groupId) static AssetTagfetchAssetTagByUuidAndGroupId(String uuid, long groupId) Returns the asset tag matching the UUID and group.static AssetTagReturns the asset tag with the name in the group.static ActionableDynamicQuerygetAssetEntryAssetTags(long entryId) getAssetEntryAssetTags(long entryId, int start, int end) getAssetEntryAssetTags(long entryId, int start, int end, OrderByComparator<AssetTag> orderByComparator) static intgetAssetEntryAssetTagsCount(long entryId) static long[]getAssetEntryPrimaryKeys(long tagId) Returns the entryIds of the asset entries associated with the asset tag.static AssetTaggetAssetTag(long tagId) Returns the asset tag with the primary key.static AssetTaggetAssetTagByExternalReferenceCode(String externalReferenceCode, long groupId) static AssetTaggetAssetTagByUuidAndGroupId(String uuid, long groupId) Returns the asset tag matching the UUID and group.getAssetTags(int start, int end) Returns a range of all the asset tags.getAssetTagsByUuidAndCompanyId(String uuid, long companyId) Returns all the asset tags matching the UUID and company.getAssetTagsByUuidAndCompanyId(String uuid, long companyId, int start, int end, OrderByComparator<AssetTag> orderByComparator) Returns a range of asset tags matching the UUID and company.static intReturns the number of asset tags.getEntryTags(long entryId) Returns the asset tags of the asset entry.static ExportActionableDynamicQuerygetExportActionableDynamicQuery(PortletDataContext portletDataContext) getGroupsTags(long[] groupIds) Returns the asset tags in the groups.getGroupTags(long groupId) Returns the asset tags in the group.getGroupTags(long groupId, int start, int end) Returns a range of all the asset tags in the group.getGroupTags(long groupId, int start, int end, OrderByComparator<AssetTag> orderByComparator) Returns a range of all the asset tags in the group.static intgetGroupTagsCount(long groupId) Returns the number of asset tags in the group.static StringReturns the OSGi service identifier.static PersistedModelgetPersistedModel(Serializable primaryKeyObj) static AssetTagLocalServicestatic AssetTaggetTag(long tagId) Returns the asset tag with the primary key.static AssetTagReturns the asset tag with the name in the group.static long[]Returns the primary keys of the asset tags with the name in the groups.static long[]Returns the primary keys of the asset tags with the names in the groups.static long[]Returns the primary keys of the asset tags with the names in the group.static long[]Returns the primary keys of the asset tags with the names.static String[]Returns the names of all the asset tags.static String[]getTagNames(long classNameId, long classPK) Returns the names of the asset tags of the entity.static String[]getTagNames(String className, long classPK) Returns the names of the asset tags of the entitygetTags()Returns all the asset tags.getTags(long classNameId, long classPK) Returns the asset tags of the entity.Returns the asset tags of the entity.static intgetTagsSize(long groupId, long classNameId, String name) static booleanhasAssetEntryAssetTag(long entryId, long tagId) static booleanhasAssetEntryAssetTags(long entryId) static booleanReturnstrueif the group contains an asset tag with the name.static AssetTagincrementAssetCount(long tagId, long classNameId) Increments the number of assets to which the asset tag has been applied.static voidmergeTags(long fromTagId, long toTagId) Replaces all occurrences of the first asset tag with the second asset tag and deletes the first asset tag.Returns the asset tags in the groups whose names match the pattern.Returns the asset tags in the group whose names match the pattern.static BaseModelSearchResult<AssetTag>searchTags(long[] groupIds, String name, int start, int end, Sort sort) static voidsetAssetEntryAssetTags(long entryId, long[] tagIds) static voidsetService(AssetTagLocalService service) static voidsubscribeTag(long userId, long groupId, long tagId) static voidunsubscribeTag(long userId, long tagId) static AssetTagupdateAssetTag(AssetTag assetTag) Updates the asset tag in the database or adds it if it does not yet exist.static AssetTagupdateTag(String externalReferenceCode, long userId, long tagId, String name, ServiceContext serviceContext)
-
Constructor Details
-
AssetTagLocalServiceUtil
public AssetTagLocalServiceUtil()
-
-
Method Details
-
addAssetEntryAssetTag
-
addAssetEntryAssetTag
public static boolean addAssetEntryAssetTag(long entryId, long tagId) -
addAssetEntryAssetTags
-
addAssetEntryAssetTags
public static boolean addAssetEntryAssetTags(long entryId, long[] tagIds) -
addAssetTag
Adds the asset tag to the database. Also notifies the appropriate model listeners.Important: Inspect AssetTagLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
assetTag- the asset tag- Returns:
- the asset tag that was added
-
addTag
public static AssetTag addTag(String externalReferenceCode, long userId, long groupId, String name, ServiceContext serviceContext) throws 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:
PortalException
-
checkTags
public static List<AssetTag> checkTags(long userId, Group group, String[] names) throws 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:
PortalException
-
checkTags
public static List<AssetTag> checkTags(long userId, long groupId, String[] names) throws 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:
PortalException
-
clearAssetEntryAssetTags
public static void clearAssetEntryAssetTags(long entryId) -
createAssetTag
Creates a new asset tag with the primary key. Does not add the asset tag to the database.- Parameters:
tagId- the primary key for the new asset tag- Returns:
- the new asset tag
-
createPersistedModel
public static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException - Throws:
PortalException
-
decrementAssetCount
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:
PortalException
-
deleteAssetEntryAssetTag
-
deleteAssetEntryAssetTag
public static void deleteAssetEntryAssetTag(long entryId, long tagId) -
deleteAssetEntryAssetTags
-
deleteAssetEntryAssetTags
public static void deleteAssetEntryAssetTags(long entryId, long[] tagIds) -
deleteAssetTag
Deletes the asset tag from the database. Also notifies the appropriate model listeners.Important: Inspect AssetTagLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
assetTag- the asset tag- Returns:
- the asset tag that was removed
-
deleteAssetTag
Deletes the asset tag with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect AssetTagLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
tagId- the primary key of the asset tag- Returns:
- the asset tag that was removed
- Throws:
PortalException- if a asset tag with the primary key could not be found
-
deleteGroupTags
Deletes all asset tags in the group.- Parameters:
groupId- the primary key of the group in which to delete all asset tags- Throws:
PortalException
-
deletePersistedModel
public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException - Throws:
PortalException
-
deleteTag
Deletes the asset tag.- Parameters:
tag- the asset tag to be deleted- Throws:
PortalException
-
deleteTag
Deletes the asset tag.- Parameters:
tagId- the primary key of the asset tag- Throws:
PortalException
-
dslQuery
public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dslQueryCount
public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dynamicQuery
-
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
Performs a dynamic query on the database and returns a range of the matching rows.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portlet.asset.model.impl.AssetTagModelImpl.- Parameters:
dynamicQuery- the dynamic querystart- the lower bound of the range of model instancesend- the upper bound of the range of model instances (not inclusive)- Returns:
- the range of matching rows
-
dynamicQuery
public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portlet.asset.model.impl.AssetTagModelImpl.- Parameters:
dynamicQuery- the dynamic querystart- the lower bound of the range of model instancesend- the upper bound of the range of model instances (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery- the dynamic queryprojection- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchAssetTag
-
fetchAssetTagByExternalReferenceCode
-
fetchAssetTagByUuidAndGroupId
Returns the asset tag matching the UUID and group.- Parameters:
uuid- the asset tag's UUIDgroupId- the primary key of the group- Returns:
- the matching asset tag, or
nullif a matching asset tag could not be found
-
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
nullif it could not be found
-
getActionableDynamicQuery
-
getAssetEntryAssetTags
-
getAssetEntryAssetTags
-
getAssetEntryAssetTags
public static List<AssetTag> getAssetEntryAssetTags(long entryId, int start, int end, OrderByComparator<AssetTag> orderByComparator) -
getAssetEntryAssetTagsCount
public static int getAssetEntryAssetTagsCount(long entryId) -
getAssetEntryPrimaryKeys
public static long[] getAssetEntryPrimaryKeys(long tagId) Returns the entryIds of the asset entries associated with the asset tag.- Parameters:
tagId- the tagId of the asset tag- Returns:
- long[] the entryIds of asset entries associated with the asset tag
-
getAssetTag
Returns the asset tag with the primary key.- Parameters:
tagId- the primary key of the asset tag- Returns:
- the asset tag
- Throws:
PortalException- if a asset tag with the primary key could not be found
-
getAssetTagByExternalReferenceCode
public static AssetTag getAssetTagByExternalReferenceCode(String externalReferenceCode, long groupId) throws PortalException - Throws:
PortalException
-
getAssetTagByUuidAndGroupId
public static AssetTag getAssetTagByUuidAndGroupId(String uuid, long groupId) throws PortalException Returns the asset tag matching the UUID and group.- Parameters:
uuid- the asset tag's UUIDgroupId- the primary key of the group- Returns:
- the matching asset tag
- Throws:
PortalException- if a matching asset tag could not be found
-
getAssetTags
Returns a range of all the asset tags.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portlet.asset.model.impl.AssetTagModelImpl.- Parameters:
start- the lower bound of the range of asset tagsend- the upper bound of the range of asset tags (not inclusive)- Returns:
- the range of asset tags
-
getAssetTagsByUuidAndCompanyId
Returns all the asset tags matching the UUID and company.- Parameters:
uuid- the UUID of the asset tagscompanyId- the primary key of the company- Returns:
- the matching asset tags, or an empty list if no matches were found
-
getAssetTagsByUuidAndCompanyId
public static List<AssetTag> getAssetTagsByUuidAndCompanyId(String uuid, long companyId, int start, int end, OrderByComparator<AssetTag> orderByComparator) Returns a range of asset tags matching the UUID and company.- Parameters:
uuid- the UUID of the asset tagscompanyId- the primary key of the companystart- 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 results by (optionallynull)- Returns:
- the range of matching asset tags, or an empty list if no matches were found
-
getAssetTagsCount
public static int getAssetTagsCount()Returns the number of asset tags.- Returns:
- the number of asset tags
-
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
-
getExportActionableDynamicQuery
public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext) -
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 static List<AssetTag> getGroupTags(long groupId, int start, int end, OrderByComparator<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 static 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
-
getIndexableActionableDynamicQuery
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
- Throws:
PortalException
-
getTag
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:
PortalException
-
getTag
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:
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
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
-
hasAssetEntryAssetTag
public static boolean hasAssetEntryAssetTag(long entryId, long tagId) -
hasAssetEntryAssetTags
public static boolean hasAssetEntryAssetTags(long entryId) -
hasTag
Returnstrueif the group contains an asset tag with the name.- Parameters:
groupId- the primary key of the groupname- the name of the asset tag- Returns:
trueif the group contains an asset tag with the name;falseotherwise.
-
incrementAssetCount
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:
PortalException
-
mergeTags
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:
PortalException
-
search
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
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 static BaseModelSearchResult<AssetTag> searchTags(long[] groupIds, String name, int start, int end, Sort sort) throws PortalException - Throws:
PortalException
-
setAssetEntryAssetTags
public static void setAssetEntryAssetTags(long entryId, long[] tagIds) -
subscribeTag
- Throws:
PortalException
-
unsubscribeTag
- Throws:
PortalException
-
updateAssetTag
Updates the asset tag in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect AssetTagLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
assetTag- the asset tag- Returns:
- the asset tag that was updated
-
updateTag
public static AssetTag updateTag(String externalReferenceCode, long userId, long tagId, String name, ServiceContext serviceContext) throws PortalException - Throws:
PortalException
-
getService
-
setService
-