|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portal.service.BaseLocalServiceImpl com.liferay.portlet.asset.service.base.AssetLinkLocalServiceBaseImpl com.liferay.portlet.asset.service.impl.AssetLinkLocalServiceImpl
public class AssetLinkLocalServiceImpl
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 |
---|
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. |
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.portal.service.BaseLocalServiceImpl |
---|
getClassLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AssetLinkLocalServiceImpl()
Method Detail |
---|
public AssetLink addLink(long userId, long entryId1, long entryId2, int type, int weight) throws PortalException, SystemException
userId
- the primary key of the link's creatorentryId1
- the primary key of the first asset entryentryId2
- the primary key of the second asset entrytype
- 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
PortalException
- if the user could not be found
SystemException
- if a system exception occurredpublic void deleteLink(AssetLink link) throws SystemException
link
- the asset link
SystemException
- if a system exception occurredpublic void deleteLink(long linkId) throws PortalException, SystemException
linkId
- the primary key of the asset link
PortalException
- if the asset link could not be found
SystemException
- if a system exception occurredpublic void deleteLinks(long entryId) throws SystemException
entryId
- the primary key of the asset entry
SystemException
- if a system exception occurredpublic void deleteLinks(long entryId1, long entryId2) throws SystemException
entryId1
- the primary key of the first asset entryentryId2
- the primary key of the second asset entry
SystemException
- if a system exception occurredpublic List<AssetLink> getDirectLinks(long entryId) throws SystemException
entryId
- the primary key of the asset entry
SystemException
- if a system exception occurredpublic List<AssetLink> getDirectLinks(long entryId, int typeId) throws SystemException
entryId
- the primary key of the asset entrytypeId
- 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
SystemException
- if a system exception occurredpublic List<AssetLink> getLinks(long entryId) throws SystemException
entryId
- the primary key of the asset entry
SystemException
- if a system exception occurredpublic List<AssetLink> getLinks(long entryId, int typeId) throws SystemException
entryId
- the primary key of the asset entrytypeId
- 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
SystemException
- if a system exception occurredpublic List<AssetLink> getReverseLinks(long entryId, int typeId) throws SystemException
entryId
- the primary key of the asset entrytypeId
- 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
SystemException
- if a system exception occurredpublic void updateLinks(long userId, long entryId, long[] linkEntryIds, int typeId) throws PortalException, SystemException
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.
userId
- the primary key of the user updating the linksentryId
- the primary key of the asset entry to be managedlinkEntryIds
- the primary keys of the asset entries to be linked
with the asset entry to be managedtypeId
- 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
PortalException
- if the user could not be found
SystemException
- if a system exception occurred
|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |