Liferay 7.0-ga1 portal-impl

com.liferay.portlet.asset.service.impl
Class AssetTagLocalServiceImpl

java.lang.Object
  extended by com.liferay.portal.kernel.service.BaseLocalServiceImpl
      extended by com.liferay.portlet.asset.service.base.AssetTagLocalServiceBaseImpl
          extended by 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.PersistedModelLocalService

public class AssetTagLocalServiceImpl
extends AssetTagLocalServiceBaseImpl

Provides the local service for accessing, adding, checking, deleting, merging, and updating asset tags.


Field Summary
 
Fields inherited from class com.liferay.portlet.asset.service.base.AssetTagLocalServiceBaseImpl
assetEntryFinder, assetEntryLocalService, assetEntryPersistence, assetTagFinder, assetTagLocalService, assetTagPersistence, assetTagStatsLocalService, assetTagStatsPersistence, classNameLocalService, classNamePersistence, counterLocalService, groupFinder, groupLocalService, groupPersistence, persistedModelLocalServiceRegistry, resourceLocalService, userFinder, userLocalService, userPersistence
 
Constructor Summary
AssetTagLocalServiceImpl()
           
 
Method Summary
 com.liferay.asset.kernel.model.AssetTag addTag(long userId, long groupId, String name, com.liferay.portal.kernel.service.ServiceContext serviceContext)
          Adds an asset tag.
 List<com.liferay.asset.kernel.model.AssetTag> checkTags(long userId, com.liferay.portal.kernel.model.Group group, String[] names)
          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> checkTags(long userId, long groupId, String[] names)
          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(com.liferay.asset.kernel.model.AssetTag tag)
          Deletes the asset tag.
 void deleteTag(long tagId)
          Deletes the asset tag.
 com.liferay.asset.kernel.model.AssetTag fetchTag(long groupId, String name)
          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.
 int getGroupTagsCount(long groupId)
          Returns the number of asset tags in the group.
 List<com.liferay.asset.kernel.model.AssetTag> getSocialActivityCounterOffsetTags(long groupId, String socialActivityCounterName, int startOffset, int endOffset)
           
 List<com.liferay.asset.kernel.model.AssetTag> getSocialActivityCounterPeriodTags(long groupId, String socialActivityCounterName, int startPeriod, int endPeriod)
           
 com.liferay.asset.kernel.model.AssetTag getTag(long tagId)
          Returns the asset tag with the primary key.
 com.liferay.asset.kernel.model.AssetTag getTag(long groupId, String name)
          Returns the asset tag with the name in the group.
 long[] getTagIds(long[] groupIds, String name)
          Returns the primary keys of the asset tags with the name in the groups.
 long[] getTagIds(long[] groupIds, String[] names)
          Returns the primary keys of the asset tags with the names in the groups.
 long[] getTagIds(long groupId, String[] names)
          Returns the primary keys of the asset tags with the names in the group.
 String[] getTagNames()
          Returns the names of all the asset tags.
protected  String[] getTagNames(List<com.liferay.asset.kernel.model.AssetTag> 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 entity
 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> getTags(long groupId, long classNameId, String name)
           
 List<com.liferay.asset.kernel.model.AssetTag> getTags(long groupId, long classNameId, String name, int start, int end)
           
 List<com.liferay.asset.kernel.model.AssetTag> getTags(String className, long classPK)
          Returns the asset tags of the entity.
 int getTagsSize(long groupId, long classNameId, String name)
           
 boolean hasTag(long groupId, String name)
          Returns true 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> search(long[] groupIds, String name, int start, int end)
          Returns the asset tags in the groups whose names match the pattern.
 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.
 com.liferay.asset.kernel.model.AssetTag updateTag(long userId, long tagId, String name, com.liferay.portal.kernel.service.ServiceContext serviceContext)
           
protected  void validate(String name)
           
 
Methods inherited from class com.liferay.portlet.asset.service.base.AssetTagLocalServiceBaseImpl
addAssetEntryAssetTag, addAssetEntryAssetTag, addAssetEntryAssetTags, addAssetEntryAssetTags, addAssetTag, afterPropertiesSet, clearAssetEntryAssetTags, createAssetTag, deleteAssetEntryAssetTag, deleteAssetEntryAssetTag, deleteAssetEntryAssetTags, deleteAssetEntryAssetTags, deleteAssetTag, deleteAssetTag, deletePersistedModel, destroy, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, dynamicQueryCount, fetchAssetTag, fetchAssetTagByUuidAndGroupId, getActionableDynamicQuery, getAssetEntryAssetTags, getAssetEntryAssetTags, getAssetEntryAssetTags, getAssetEntryAssetTagsCount, getAssetEntryFinder, getAssetEntryLocalService, getAssetEntryPersistence, getAssetEntryPrimaryKeys, getAssetTag, getAssetTagByUuidAndGroupId, getAssetTagFinder, getAssetTagLocalService, getAssetTagPersistence, getAssetTags, getAssetTagsByUuidAndCompanyId, getAssetTagsByUuidAndCompanyId, getAssetTagsCount, getAssetTagStatsLocalService, getAssetTagStatsPersistence, getClassNameLocalService, getClassNamePersistence, getCounterLocalService, getExportActionableDynamicQuery, getGroupFinder, getGroupLocalService, getGroupPersistence, getIndexableActionableDynamicQuery, getModelClass, getModelClassName, getOSGiServiceIdentifier, getPersistedModel, getResourceLocalService, getUserFinder, getUserLocalService, getUserPersistence, hasAssetEntryAssetTag, hasAssetEntryAssetTags, initActionableDynamicQuery, runSQL, setAssetEntryAssetTags, setAssetEntryFinder, setAssetEntryLocalService, setAssetEntryPersistence, setAssetTagFinder, setAssetTagLocalService, setAssetTagPersistence, setAssetTagStatsLocalService, setAssetTagStatsPersistence, setClassNameLocalService, setClassNamePersistence, setCounterLocalService, setGroupFinder, setGroupLocalService, setGroupPersistence, setResourceLocalService, setUserFinder, setUserLocalService, setUserPersistence, updateAssetTag
 
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
 

Constructor Detail

AssetTagLocalServiceImpl

public AssetTagLocalServiceImpl()
Method Detail

addTag

public com.liferay.asset.kernel.model.AssetTag addTag(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:
userId - the primary key of the user adding the asset tag
groupId - the primary key of the group in which the asset tag is to be added
name - the asset tag's name
serviceContext - 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 tags
group - the group in which to check the asset tags
names - 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 tags
groupId - the primary key of the group in which check the asset tags
names - 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

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 tag
classNameId - 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

public com.liferay.asset.kernel.model.AssetTag fetchTag(long groupId,
                                                        String name)
Returns the asset tag with the name in the group.

Parameters:
groupId - the primary key of the group
name - the asset tag's name
Returns:
the asset tag with the name in the group or null if it could not be found

getEntryTags

public List<com.liferay.asset.kernel.model.AssetTag> getEntryTags(long entryId)
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

public List<com.liferay.asset.kernel.model.AssetTag> getGroupsTags(long[] groupIds)
Returns the asset tags in the groups.

Parameters:
groupIds - the primary keys of the groups
Returns:
the asset tags in the groups

getGroupTags

public List<com.liferay.asset.kernel.model.AssetTag> getGroupTags(long groupId)
Returns the asset tags in the group.

Parameters:
groupId - the primary key of the group
Returns:
the asset tags in the group

getGroupTags

public 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.

Parameters:
groupId - the primary key of the group
start - the lower bound of the range of asset tags
end - the upper bound of the range of asset tags (not inclusive)
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

getSocialActivityCounterOffsetTags

public List<com.liferay.asset.kernel.model.AssetTag> getSocialActivityCounterOffsetTags(long groupId,
                                                                                        String socialActivityCounterName,
                                                                                        int startOffset,
                                                                                        int endOffset)

getSocialActivityCounterPeriodTags

public List<com.liferay.asset.kernel.model.AssetTag> getSocialActivityCounterPeriodTags(long groupId,
                                                                                        String socialActivityCounterName,
                                                                                        int startPeriod,
                                                                                        int endPeriod)

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 group
name - the name of the asset tag
Returns:
the asset tag with the name in the group
Throws:
com.liferay.portal.kernel.exception.PortalException

getTagIds

public long[] getTagIds(long groupId,
                        String[] names)
Returns the primary keys of the asset tags with the names in the group.

Parameters:
groupId - the primary key of the group
names - the names of the asset tags
Returns:
the primary keys of the asset tags with the names in the group

getTagIds

public long[] getTagIds(long[] groupIds,
                        String name)
Returns the primary keys of the asset tags with the name in the groups.

Parameters:
groupIds - the primary keys of the groups
name - the name of the asset tags
Returns:
the primary keys of the asset tags with the name in the groups

getTagIds

public long[] getTagIds(long[] groupIds,
                        String[] names)
Returns the primary keys of the asset tags with the names in the groups.

Parameters:
groupIds - the primary keys of the groups
names - the names of the asset tags
Returns:
the primary keys of the asset tags with the names in the groups

getTagNames

public String[] getTagNames()
Returns the names of all the asset tags.

Returns:
the names of all the asset tags

getTagNames

public String[] getTagNames(long classNameId,
                            long classPK)
Returns the names of the asset tags of the entity.

Parameters:
classNameId - the class name ID of the entity
classPK - the primary key of the entity
Returns:
the names of the asset tags of the entity

getTagNames

public String[] getTagNames(String className,
                            long classPK)
Returns the names of the asset tags of the entity

Parameters:
className - the class name of the entity
classPK - the primary key of the entity
Returns:
the names of the asset tags of the entity

getTags

public List<com.liferay.asset.kernel.model.AssetTag> getTags()
Returns all the asset tags.

Returns:
the asset tags

getTags

public List<com.liferay.asset.kernel.model.AssetTag> getTags(long classNameId,
                                                             long classPK)
Returns the asset tags of the entity.

Parameters:
classNameId - the class name ID of the entity
classPK - the primary key of the entity
Returns:
the asset tags of the entity

getTags

public List<com.liferay.asset.kernel.model.AssetTag> getTags(long groupId,
                                                             long classNameId,
                                                             String name)

getTags

public List<com.liferay.asset.kernel.model.AssetTag> getTags(long groupId,
                                                             long classNameId,
                                                             String name,
                                                             int start,
                                                             int end)

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 entity
classPK - the primary key of the entity
Returns:
the asset tags of the entity

getTagsSize

public int getTagsSize(long groupId,
                       long classNameId,
                       String name)

hasTag

public boolean hasTag(long groupId,
                      String name)
Returns true if the group contains an asset tag with the name.

Parameters:
groupId - the primary key of the group
name - the name of the asset tag
Returns:
true if the group contains an asset tag with the name; false otherwise.

incrementAssetCount

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 tag
classNameId - 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 replaced
toTagId - 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 group
name - the pattern to match
start - the lower bound of the range of asset tags
end - 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 groups
name - the pattern to match
start - the lower bound of the range of asset tags
end - the upper bound of the range of asset tags (not inclusive)
Returns:
the asset tags in the groups whose names match the pattern

updateTag

public com.liferay.asset.kernel.model.AssetTag updateTag(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

getTagNames

protected String[] getTagNames(List<com.liferay.asset.kernel.model.AssetTag> tags)

validate

protected void validate(String name)
                 throws com.liferay.portal.kernel.exception.PortalException
Throws:
com.liferay.portal.kernel.exception.PortalException

Liferay 7.0-ga1 portal-impl