Liferay 6.2-ce-ga5

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

java.lang.Object
  extended by com.liferay.portal.service.BaseLocalServiceImpl
      extended by com.liferay.portlet.asset.service.base.AssetLinkLocalServiceBaseImpl
          extended by com.liferay.portlet.asset.service.impl.AssetLinkLocalServiceImpl
All Implemented Interfaces:
IdentifiableBean, BaseLocalService, PersistedModelLocalService, AssetLinkLocalService

public class AssetLinkLocalServiceImpl
extends AssetLinkLocalServiceBaseImpl

This class implements the methods needed to handle AssetLinks, the entity that relates different assets in the portal. The basic information stored for every link includes both assets entry IDs, the userId, the link type and the link's weight.


Field Summary
 
Fields inherited from class com.liferay.portlet.asset.service.base.AssetLinkLocalServiceBaseImpl
assetCategoryFinder, assetCategoryLocalService, assetCategoryPersistence, assetCategoryPropertyFinder, assetCategoryPropertyLocalService, assetCategoryPropertyPersistence, assetCategoryPropertyService, assetCategoryService, assetEntryFinder, assetEntryLocalService, assetEntryPersistence, assetEntryService, assetLinkLocalService, assetLinkPersistence, assetTagFinder, assetTagLocalService, assetTagPersistence, assetTagPropertyFinder, assetTagPropertyKeyFinder, assetTagPropertyLocalService, assetTagPropertyPersistence, assetTagPropertyService, assetTagService, assetTagStatsLocalService, assetTagStatsPersistence, assetVocabularyFinder, assetVocabularyLocalService, assetVocabularyPersistence, assetVocabularyService, counterLocalService, persistedModelLocalServiceRegistry, resourceLocalService, userFinder, userLocalService, userPersistence, userService
 
Fields inherited from class com.liferay.portal.service.BaseLocalServiceImpl
layoutPersistence
 
Constructor Summary
AssetLinkLocalServiceImpl()
           
 
Method Summary
 AssetLink addLink(long userId, long entryId1, long entryId2, int type, int weight)
          Adds a new asset link.
 void deleteLink(AssetLink link)
          Deletes the asset link.
 void deleteLink(long linkId)
          Deletes the asset link.
 void deleteLinks(long entryId)
          Deletes all links associated with the asset entry.
 void deleteLinks(long entryId1, long entryId2)
          Delete all links that associate the two asset entries.
 List<AssetLink> getDirectLinks(long entryId)
          Returns all the asset links whose first entry ID is the given entry ID.
 List<AssetLink> getDirectLinks(long entryId, int typeId)
          Returns all the asset links of the given link type whose first entry ID is the given entry ID.
 List<AssetLink> getLinks(long entryId)
          Returns all the asset links whose first or second entry ID is the given entry ID.
 List<AssetLink> getLinks(long entryId, int typeId)
          Returns all the asset links of the given link type whose first or second entry ID is the given entry ID.
 List<AssetLink> getReverseLinks(long entryId, int typeId)
          Returns all the asset links of the given link type whose second entry ID is the given entry ID.
 AssetLink updateLink(long userId, long entryId1, long entryId2, int typeId, int weight)
           
 void updateLinks(long userId, long entryId, long[] linkEntryIds, int typeId)
          Updates all links of the asset entry, replacing them with links associating the asset entry with the asset entries of the given link entry IDs.
 
Methods inherited from class com.liferay.portlet.asset.service.base.AssetLinkLocalServiceBaseImpl
addAssetLink, afterPropertiesSet, createAssetLink, deleteAssetLink, deleteAssetLink, destroy, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, dynamicQueryCount, fetchAssetLink, getAssetCategoryFinder, getAssetCategoryLocalService, getAssetCategoryPersistence, getAssetCategoryPropertyFinder, getAssetCategoryPropertyLocalService, getAssetCategoryPropertyPersistence, getAssetCategoryPropertyService, getAssetCategoryService, getAssetEntryFinder, getAssetEntryLocalService, getAssetEntryPersistence, getAssetEntryService, getAssetLink, getAssetLinkLocalService, getAssetLinkPersistence, getAssetLinks, getAssetLinksCount, getAssetTagFinder, getAssetTagLocalService, getAssetTagPersistence, getAssetTagPropertyFinder, getAssetTagPropertyKeyFinder, getAssetTagPropertyLocalService, getAssetTagPropertyPersistence, getAssetTagPropertyService, getAssetTagService, getAssetTagStatsLocalService, getAssetTagStatsPersistence, getAssetVocabularyFinder, getAssetVocabularyLocalService, getAssetVocabularyPersistence, getAssetVocabularyService, getBeanIdentifier, getCounterLocalService, getModelClass, getModelClassName, getPersistedModel, getResourceLocalService, getUserFinder, getUserLocalService, getUserPersistence, getUserService, runSQL, setAssetCategoryFinder, setAssetCategoryLocalService, setAssetCategoryPersistence, setAssetCategoryPropertyFinder, setAssetCategoryPropertyLocalService, setAssetCategoryPropertyPersistence, setAssetCategoryPropertyService, setAssetCategoryService, setAssetEntryFinder, setAssetEntryLocalService, setAssetEntryPersistence, setAssetEntryService, setAssetLinkLocalService, setAssetLinkPersistence, setAssetTagFinder, setAssetTagLocalService, setAssetTagPersistence, setAssetTagPropertyFinder, setAssetTagPropertyKeyFinder, setAssetTagPropertyLocalService, setAssetTagPropertyPersistence, setAssetTagPropertyService, setAssetTagService, setAssetTagStatsLocalService, setAssetTagStatsPersistence, setAssetVocabularyFinder, setAssetVocabularyLocalService, setAssetVocabularyPersistence, setAssetVocabularyService, setBeanIdentifier, setCounterLocalService, setResourceLocalService, setUserFinder, setUserLocalService, setUserPersistence, setUserService, updateAssetLink
 
Methods inherited from class com.liferay.portal.service.BaseLocalServiceImpl
getClassLoader, getLayoutURL, getLayoutURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetLinkLocalServiceImpl

public AssetLinkLocalServiceImpl()
Method Detail

addLink

public AssetLink addLink(long userId,
                         long entryId1,
                         long entryId2,
                         int type,
                         int weight)
                  throws PortalException,
                         SystemException
Adds a new asset link.

Parameters:
userId - the primary key of the link's creator
entryId1 - the primary key of the first asset entry
entryId2 - the primary key of the second asset entry
type - the link type. Acceptable values include AssetLinkConstants.TYPE_RELATED which is a bidirectional relationship and AssetLinkConstants.TYPE_CHILD which is a unidirectional relationship. For more information see AssetLinkConstants
weight - the weight of the relationship, allowing precedence ordering of links
Returns:
the asset link
Throws:
PortalException - if the user could not be found
SystemException - if a system exception occurred

deleteLink

public void deleteLink(AssetLink link)
                throws SystemException
Deletes the asset link.

Parameters:
link - the asset link
Throws:
SystemException - if a system exception occurred

deleteLink

public void deleteLink(long linkId)
                throws PortalException,
                       SystemException
Deletes the asset link.

Parameters:
linkId - the primary key of the asset link
Throws:
PortalException - if the asset link could not be found
SystemException - if a system exception occurred

deleteLinks

public void deleteLinks(long entryId)
                 throws SystemException
Deletes all links associated with the asset entry.

Parameters:
entryId - the primary key of the asset entry
Throws:
SystemException - if a system exception occurred

deleteLinks

public void deleteLinks(long entryId1,
                        long entryId2)
                 throws SystemException
Delete all links that associate the two asset entries.

Parameters:
entryId1 - the primary key of the first asset entry
entryId2 - the primary key of the second asset entry
Throws:
SystemException - if a system exception occurred

getDirectLinks

public List<AssetLink> getDirectLinks(long entryId)
                               throws SystemException
Returns all the asset links whose first entry ID is the given entry ID.

Parameters:
entryId - the primary key of the asset entry
Returns:
the asset links whose first entry ID is the given entry ID
Throws:
SystemException - if a system exception occurred

getDirectLinks

public List<AssetLink> getDirectLinks(long entryId,
                                      int typeId)
                               throws SystemException
Returns all the asset links of the given link type whose first entry ID is the given entry ID.

Parameters:
entryId - the primary key of the asset entry
typeId - the link type. Acceptable values include AssetLinkConstants.TYPE_RELATED which is a bidirectional relationship and AssetLinkConstants.TYPE_CHILD which is a unidirectional relationship. For more information see AssetLinkConstants
Returns:
the asset links of the given link type whose first entry ID is the given entry ID
Throws:
SystemException - if a system exception occurred

getLinks

public List<AssetLink> getLinks(long entryId)
                         throws SystemException
Returns all the asset links whose first or second entry ID is the given entry ID.

Parameters:
entryId - the primary key of the asset entry
Returns:
the asset links whose first or second entry ID is the given entry ID
Throws:
SystemException - if a system exception occurred

getLinks

public List<AssetLink> getLinks(long entryId,
                                int typeId)
                         throws SystemException
Returns all the asset links of the given link type whose first or second entry ID is the given entry ID.

Parameters:
entryId - the primary key of the asset entry
typeId - the link type. Acceptable values include AssetLinkConstants.TYPE_RELATED which is a bidirectional relationship and AssetLinkConstants.TYPE_CHILD which is a unidirectional relationship. For more information see AssetLinkConstants
Returns:
the asset links of the given link type whose first or second entry ID is the given entry ID
Throws:
SystemException - if a system exception occurred

getReverseLinks

public List<AssetLink> getReverseLinks(long entryId,
                                       int typeId)
                                throws SystemException
Returns all the asset links of the given link type whose second entry ID is the given entry ID.

Parameters:
entryId - the primary key of the asset entry
typeId - the link type. Acceptable values include AssetLinkConstants.TYPE_RELATED which is a bidirectional relationship and AssetLinkConstants.TYPE_CHILD which is a unidirectional relationship. For more information see AssetLinkConstants
Returns:
the asset links of the given link type whose second entry ID is the given entry ID
Throws:
SystemException - if a system exception occurred

updateLink

public AssetLink updateLink(long userId,
                            long entryId1,
                            long entryId2,
                            int typeId,
                            int weight)
                     throws PortalException,
                            SystemException
Throws:
PortalException
SystemException

updateLinks

public void updateLinks(long userId,
                        long entryId,
                        long[] linkEntryIds,
                        int typeId)
                 throws PortalException,
                        SystemException
Updates all links of the asset entry, replacing them with links associating the asset entry with the asset entries of the given link entry IDs.

If no link exists with a given link entry ID, a new link is created associating the current asset entry with the asset entry of that link entry ID. An existing link is deleted if either of its entry IDs is not contained in the given link entry IDs.

Parameters:
userId - the primary key of the user updating the links
entryId - the primary key of the asset entry to be managed
linkEntryIds - the primary keys of the asset entries to be linked with the asset entry to be managed
typeId - the type of the asset links to be created. Acceptable values include AssetLinkConstants.TYPE_RELATED which is a bidirectional relationship and AssetLinkConstants.TYPE_CHILD which is a unidirectional relationship. For more information see AssetLinkConstants
Throws:
PortalException - if the user could not be found
SystemException - if a system exception occurred

Liferay 6.2-ce-ga5