Class AssetLinkLocalServiceUtil

java.lang.Object
com.liferay.asset.link.service.AssetLinkLocalServiceUtil

public class AssetLinkLocalServiceUtil extends Object
Provides the local service utility for AssetLink. This utility wraps com.liferay.asset.link.service.impl.AssetLinkLocalServiceImpl 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.
See Also:
Generated:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static AssetLink
    Adds the asset link to the database.
    static AssetLink
    addLink(long userId, long entryId1, long entryId2, int type, int weight)
    Adds a new asset link.
    static AssetLink
    createAssetLink(long linkId)
    Creates a new asset link with the primary key.
    static com.liferay.portal.kernel.model.PersistedModel
     
    static AssetLink
    deleteAssetLink(long linkId)
    Deletes the asset link with the primary key from the database.
    static AssetLink
    Deletes the asset link from the database.
    static void
    deleteGroupLinks(long groupId)
     
    static void
    deleteLink(long linkId)
    Deletes the asset link.
    static void
    Deletes the asset link.
    static void
    deleteLinks(long entryId)
    Deletes all links associated with the asset entry.
    static void
    deleteLinks(long entryId1, long entryId2)
    Delete all links that associate the two asset entries.
    static com.liferay.portal.kernel.model.PersistedModel
    deletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel)
     
    static <T> T
    dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
     
    static int
    dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
     
    static com.liferay.portal.kernel.dao.orm.DynamicQuery
     
    static <T> List<T>
    dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
    Performs a dynamic query on the database and returns the matching rows.
    static <T> List<T>
    dynamicQuery(com.liferay.portal.kernel.dao.orm.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(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator)
    Performs a dynamic query on the database and returns an ordered range of the matching rows.
    static long
    dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
    Returns the number of rows matching the dynamic query.
    static long
    dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection)
    Returns the number of rows matching the dynamic query.
    static AssetLink
    fetchAssetLink(long linkId)
     
    static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
     
    static AssetLink
    getAssetLink(long linkId)
    Returns the asset link with the primary key.
    static List<AssetLink>
    getAssetLinks(int start, int end)
    Returns a range of all the asset links.
    static int
    Returns the number of asset links.
    static List<AssetLink>
    getDirectLinks(long entryId)
    Returns all the asset links whose first entry ID is the given entry ID.
    static List<AssetLink>
    getDirectLinks(long entryId, boolean excludeInvisibleLinks)
     
    static 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.
    static List<AssetLink>
    getDirectLinks(long entryId, int typeId, boolean excludeInvisibleLinks)
     
    static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery
     
    static List<AssetLink>
    getLinks(long entryId)
    Returns all the asset links whose first or second entry ID is the given entry ID.
    static 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.
    static List<AssetLink>
    getLinks(long classNameId, long classPK)
    Returns all the asset links of an AssetEntry.
    static List<AssetLink>
    getLinks(long groupId, Date startDate, Date endDate, int start, int end)
     
    static String
    Returns the OSGi service identifier.
    static com.liferay.portal.kernel.model.PersistedModel
     
    static 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.
     
    static AssetLink
    Updates the asset link in the database or adds it if it does not yet exist.
    static AssetLink
    updateLink(long userId, long entryId1, long entryId2, int typeId, int weight)
     
    static 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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AssetLinkLocalServiceUtil

      public AssetLinkLocalServiceUtil()
  • Method Details

    • addAssetLink

      public static AssetLink addAssetLink(AssetLink assetLink)
      Adds the asset link to the database. Also notifies the appropriate model listeners.

      Important: Inspect AssetLinkLocalServiceImpl 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:
      assetLink - the asset link
      Returns:
      the asset link that was added
    • addLink

      public static AssetLink addLink(long userId, long entryId1, long entryId2, int type, int weight) throws com.liferay.portal.kernel.exception.PortalException
      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:
      com.liferay.portal.kernel.exception.PortalException
    • createAssetLink

      public static AssetLink createAssetLink(long linkId)
      Creates a new asset link with the primary key. Does not add the asset link to the database.
      Parameters:
      linkId - the primary key for the new asset link
      Returns:
      the new asset link
    • createPersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel createPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteAssetLink

      public static AssetLink deleteAssetLink(AssetLink assetLink)
      Deletes the asset link from the database. Also notifies the appropriate model listeners.

      Important: Inspect AssetLinkLocalServiceImpl 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:
      assetLink - the asset link
      Returns:
      the asset link that was removed
    • deleteAssetLink

      public static AssetLink deleteAssetLink(long linkId) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the asset link with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect AssetLinkLocalServiceImpl 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:
      linkId - the primary key of the asset link
      Returns:
      the asset link that was removed
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a asset link with the primary key could not be found
    • deleteGroupLinks

      public static void deleteGroupLinks(long groupId)
    • deleteLink

      public static void deleteLink(AssetLink link)
      Deletes the asset link.
      Parameters:
      link - the asset link
    • deleteLink

      public static void deleteLink(long linkId) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the asset link.
      Parameters:
      linkId - the primary key of the asset link
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteLinks

      public static void deleteLinks(long entryId)
      Deletes all links associated with the asset entry.
      Parameters:
      entryId - the primary key of the asset entry
    • deleteLinks

      public static void deleteLinks(long entryId1, long entryId2)
      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
    • deletePersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.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

      public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery()
    • dynamicQuery

      public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
      Performs a dynamic query on the database and returns a range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.asset.link.model.impl.AssetLinkModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      Returns:
      the range of matching rows
    • dynamicQuery

      public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.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 - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.asset.link.model.impl.AssetLinkModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchAssetLink

      public static AssetLink fetchAssetLink(long linkId)
    • getActionableDynamicQuery

      public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery()
    • getAssetLink

      public static AssetLink getAssetLink(long linkId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the asset link with the primary key.
      Parameters:
      linkId - the primary key of the asset link
      Returns:
      the asset link
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a asset link with the primary key could not be found
    • getAssetLinks

      public static List<AssetLink> getAssetLinks(int start, int end)
      Returns a range of all the asset links.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.asset.link.model.impl.AssetLinkModelImpl.

      Parameters:
      start - the lower bound of the range of asset links
      end - the upper bound of the range of asset links (not inclusive)
      Returns:
      the range of asset links
    • getAssetLinksCount

      public static int getAssetLinksCount()
      Returns the number of asset links.
      Returns:
      the number of asset links
    • getDirectLinks

      public static List<AssetLink> getDirectLinks(long entryId)
      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
    • getDirectLinks

      public static List<AssetLink> getDirectLinks(long entryId, boolean excludeInvisibleLinks)
    • getDirectLinks

      public static 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.
      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
    • getDirectLinks

      public static List<AssetLink> getDirectLinks(long entryId, int typeId, boolean excludeInvisibleLinks)
    • getIndexableActionableDynamicQuery

      public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getLinks

      public static List<AssetLink> getLinks(long entryId)
      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
    • getLinks

      public static List<AssetLink> getLinks(long groupId, Date startDate, Date endDate, int start, int end)
    • getLinks

      public static 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.
      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
    • getLinks

      public static List<AssetLink> getLinks(long classNameId, long classPK)
      Returns all the asset links of an AssetEntry.
      Parameters:
      classNameId - AssetEntry's classNameId
      classPK - AssetEntry's classPK
      Returns:
      the asset links of the given entry params
    • getOSGiServiceIdentifier

      public static String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Returns:
      the OSGi service identifier
    • getPersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getReverseLinks

      public static 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.
      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
    • updateAssetLink

      public static AssetLink updateAssetLink(AssetLink assetLink)
      Updates the asset link in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect AssetLinkLocalServiceImpl 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:
      assetLink - the asset link
      Returns:
      the asset link that was updated
    • updateLink

      public static AssetLink updateLink(long userId, long entryId1, long entryId2, int typeId, int weight) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateLinks

      public static void updateLinks(long userId, long entryId, long[] linkEntryIds, int typeId) throws com.liferay.portal.kernel.exception.PortalException
      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:
      com.liferay.portal.kernel.exception.PortalException
    • getService

      public static AssetLinkLocalService getService()