Class AssetCategoryLocalServiceUtil

Object
com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil

public class AssetCategoryLocalServiceUtil extends Object
Provides the local service utility for AssetCategory. This utility wraps com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl 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 Details

    • AssetCategoryLocalServiceUtil

      public AssetCategoryLocalServiceUtil()
  • Method Details

    • addAssetCategory

      public static AssetCategory addAssetCategory(AssetCategory assetCategory)
      Adds the asset category to the database. Also notifies the appropriate model listeners.

      Important: Inspect AssetCategoryLocalServiceImpl 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:
      assetCategory - the asset category
      Returns:
      the asset category that was added
    • addCategory

      public static AssetCategory addCategory(long userId, long groupId, String title, long vocabularyId, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • addCategory

      public static AssetCategory addCategory(String externalReferenceCode, long userId, long groupId, long parentCategoryId, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, long vocabularyId, String[] categoryProperties, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • addCategoryResources

      public static void addCategoryResources(AssetCategory category, boolean addGroupPermissions, boolean addGuestPermissions) throws PortalException
      Throws:
      PortalException
    • addCategoryResources

      public static void addCategoryResources(AssetCategory category, ModelPermissions modelPermissions) throws PortalException
      Throws:
      PortalException
    • createAssetCategory

      public static AssetCategory createAssetCategory(long categoryId)
      Creates a new asset category with the primary key. Does not add the asset category to the database.
      Parameters:
      categoryId - the primary key for the new asset category
      Returns:
      the new asset category
    • createPersistedModel

      public static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
      Throws:
      PortalException
    • deleteAssetCategory

      public static AssetCategory deleteAssetCategory(AssetCategory assetCategory)
      Deletes the asset category from the database. Also notifies the appropriate model listeners.

      Important: Inspect AssetCategoryLocalServiceImpl 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:
      assetCategory - the asset category
      Returns:
      the asset category that was removed
    • deleteAssetCategory

      public static AssetCategory deleteAssetCategory(long categoryId) throws PortalException
      Deletes the asset category with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect AssetCategoryLocalServiceImpl 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:
      categoryId - the primary key of the asset category
      Returns:
      the asset category that was removed
      Throws:
      PortalException - if a asset category with the primary key could not be found
    • deleteCategories

      public static void deleteCategories(List<AssetCategory> categories) throws PortalException
      Throws:
      PortalException
    • deleteCategories

      public static void deleteCategories(long[] categoryIds) throws PortalException
      Throws:
      PortalException
    • deleteCategory

      public static AssetCategory deleteCategory(AssetCategory category) throws PortalException
      Throws:
      PortalException
    • deleteCategory

      public static AssetCategory deleteCategory(AssetCategory category, boolean skipRebuildTree) throws PortalException
      Throws:
      PortalException
    • deleteCategory

      public static AssetCategory deleteCategory(long categoryId) throws PortalException
      Throws:
      PortalException
    • deletePersistedModel

      public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
      Throws:
      PortalException
    • deleteVocabularyCategories

      public static void deleteVocabularyCategories(long vocabularyId) throws PortalException
      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

      public static DynamicQuery dynamicQuery()
    • dynamicQuery

      public static <T> List<T> dynamicQuery(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(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.portlet.asset.model.impl.AssetCategoryModelImpl.

      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(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 - 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.portlet.asset.model.impl.AssetCategoryModelImpl.

      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(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(DynamicQuery dynamicQuery, 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
    • fetchAssetCategory

      public static AssetCategory fetchAssetCategory(long categoryId)
    • fetchAssetCategoryByExternalReferenceCode

      public static AssetCategory fetchAssetCategoryByExternalReferenceCode(String externalReferenceCode, long groupId)
    • fetchAssetCategoryByUuidAndGroupId

      public static AssetCategory fetchAssetCategoryByUuidAndGroupId(String uuid, long groupId)
      Returns the asset category matching the UUID and group.
      Parameters:
      uuid - the asset category's UUID
      groupId - the primary key of the group
      Returns:
      the matching asset category, or null if a matching asset category could not be found
    • fetchCategory

      public static AssetCategory fetchCategory(long categoryId)
    • fetchCategory

      public static AssetCategory fetchCategory(long groupId, long parentCategoryId, String name, long vocabularyId)
    • getActionableDynamicQuery

      public static ActionableDynamicQuery getActionableDynamicQuery()
    • getAssetCategories

      public static List<AssetCategory> getAssetCategories(int start, int end)
      Returns a range of all the asset categories.

      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.portlet.asset.model.impl.AssetCategoryModelImpl.

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

      public static List<AssetCategory> getAssetCategoriesByUuidAndCompanyId(String uuid, long companyId)
      Returns all the asset categories matching the UUID and company.
      Parameters:
      uuid - the UUID of the asset categories
      companyId - the primary key of the company
      Returns:
      the matching asset categories, or an empty list if no matches were found
    • getAssetCategoriesByUuidAndCompanyId

      public static List<AssetCategory> getAssetCategoriesByUuidAndCompanyId(String uuid, long companyId, int start, int end, OrderByComparator<AssetCategory> orderByComparator)
      Returns a range of asset categories matching the UUID and company.
      Parameters:
      uuid - the UUID of the asset categories
      companyId - the primary key of the company
      start - the lower bound of the range of asset categories
      end - the upper bound of the range of asset categories (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the range of matching asset categories, or an empty list if no matches were found
    • getAssetCategoriesCount

      public static int getAssetCategoriesCount()
      Returns the number of asset categories.
      Returns:
      the number of asset categories
    • getAssetCategory

      public static AssetCategory getAssetCategory(long categoryId) throws PortalException
      Returns the asset category with the primary key.
      Parameters:
      categoryId - the primary key of the asset category
      Returns:
      the asset category
      Throws:
      PortalException - if a asset category with the primary key could not be found
    • getAssetCategoryByExternalReferenceCode

      public static AssetCategory getAssetCategoryByExternalReferenceCode(String externalReferenceCode, long groupId) throws PortalException
      Throws:
      PortalException
    • getAssetCategoryByUuidAndGroupId

      public static AssetCategory getAssetCategoryByUuidAndGroupId(String uuid, long groupId) throws PortalException
      Returns the asset category matching the UUID and group.
      Parameters:
      uuid - the asset category's UUID
      groupId - the primary key of the group
      Returns:
      the matching asset category
      Throws:
      PortalException - if a matching asset category could not be found
    • getCategories

      public static List<AssetCategory> getCategories()
    • getCategories

      public static List<AssetCategory> getCategories(Hits hits) throws PortalException
      Throws:
      PortalException
    • getCategories

      public static List<AssetCategory> getCategories(long classNameId, long classPK)
    • getCategories

      public static List<AssetCategory> getCategories(long classNameId, long classPK, int start, int end)
    • getCategories

      public static List<AssetCategory> getCategories(String className, long classPK)
    • getCategoriesCount

      public static int getCategoriesCount(long classNameId, long classPK)
    • getCategory

      public static AssetCategory getCategory(long categoryId) throws PortalException
      Throws:
      PortalException
    • getCategory

      public static AssetCategory getCategory(String uuid, long groupId) throws PortalException
      Throws:
      PortalException
    • getCategoryIds

      public static long[] getCategoryIds(String className, long classPK)
    • getCategoryNames

      public static String[] getCategoryNames()
    • getCategoryNames

      public static String[] getCategoryNames(long classNameId, long classPK)
    • getCategoryNames

      public static String[] getCategoryNames(String className, long classPK)
    • getChildCategories

      public static List<AssetCategory> getChildCategories(long parentCategoryId)
    • getChildCategories

      public static List<AssetCategory> getChildCategories(long parentCategoryId, int start, int end, OrderByComparator<AssetCategory> orderByComparator)
    • getChildCategoriesCount

      public static int getChildCategoriesCount(long parentCategoryId)
    • getDescendantCategories

      public static List<AssetCategory> getDescendantCategories(AssetCategory category)
    • getEntryCategories

      public static List<AssetCategory> getEntryCategories(long entryId)
    • getExportActionableDynamicQuery

      public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
    • getIndexableActionableDynamicQuery

      public static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getOSGiServiceIdentifier

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

      public static PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      Throws:
      PortalException
    • getSubcategoryIds

      public static List<Long> getSubcategoryIds(long parentCategoryId)
    • getViewableCategoryIds

      public static long[] getViewableCategoryIds(String className, long classPK, long[] categoryIds) throws PortalException
      Throws:
      PortalException
    • getVocabularyCategories

      public static List<AssetCategory> getVocabularyCategories(long vocabularyId, int start, int end, OrderByComparator<AssetCategory> orderByComparator)
    • getVocabularyCategories

      public static List<AssetCategory> getVocabularyCategories(long parentCategoryId, long vocabularyId, int start, int end, OrderByComparator<AssetCategory> orderByComparator)
    • getVocabularyCategoriesCount

      public static int getVocabularyCategoriesCount(long vocabularyId)
    • getVocabularyRootCategories

      public static List<AssetCategory> getVocabularyRootCategories(long vocabularyId, int start, int end, OrderByComparator<AssetCategory> orderByComparator)
    • getVocabularyRootCategoriesCount

      public static int getVocabularyRootCategoriesCount(long vocabularyId)
    • mergeCategories

      public static AssetCategory mergeCategories(long fromCategoryId, long toCategoryId) throws PortalException
      Throws:
      PortalException
    • moveCategory

      public static AssetCategory moveCategory(long categoryId, long parentCategoryId, long vocabularyId, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • search

      public static List<AssetCategory> search(long groupId, String name, String[] categoryProperties, int start, int end)
    • searchCategories

      public static BaseModelSearchResult<AssetCategory> searchCategories(long companyId, long groupIds, String title, long vocabularyId, int start, int end) throws PortalException
      Throws:
      PortalException
    • searchCategories

      public static BaseModelSearchResult<AssetCategory> searchCategories(long companyId, long[] groupIds, String title, long[] vocabularyIds, int start, int end) throws PortalException
      Throws:
      PortalException
    • searchCategories

      public static BaseModelSearchResult<AssetCategory> searchCategories(long companyId, long[] groupIds, String title, long[] parentCategoryIds, long[] vocabularyIds, int start, int end) throws PortalException
      Throws:
      PortalException
    • searchCategories

      public static BaseModelSearchResult<AssetCategory> searchCategories(long companyId, long[] groupIds, String title, long[] vocabularyIds, long[] parentCategoryIds, int start, int end, Sort sort) throws PortalException
      Throws:
      PortalException
    • updateAssetCategory

      public static AssetCategory updateAssetCategory(AssetCategory assetCategory)
      Updates the asset category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect AssetCategoryLocalServiceImpl 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:
      assetCategory - the asset category
      Returns:
      the asset category that was updated
    • updateCategory

      public static AssetCategory updateCategory(long userId, long categoryId, long parentCategoryId, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, long vocabularyId, String[] categoryProperties, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • getService

      public static AssetCategoryLocalService getService()
    • setService

      public static void setService(AssetCategoryLocalService service)