Class AssetCategoryLocalServiceUtil
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AssetCategory
addAssetCategory
(AssetCategory assetCategory) Adds the asset category to the database.static AssetCategory
addCategory
(long userId, long groupId, String title, long vocabularyId, ServiceContext serviceContext) 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) static void
addCategoryResources
(AssetCategory category, boolean addGroupPermissions, boolean addGuestPermissions) static void
addCategoryResources
(AssetCategory category, ModelPermissions modelPermissions) static AssetCategory
createAssetCategory
(long categoryId) Creates a new asset category with the primary key.static PersistedModel
createPersistedModel
(Serializable primaryKeyObj) static AssetCategory
deleteAssetCategory
(long categoryId) Deletes the asset category with the primary key from the database.static AssetCategory
deleteAssetCategory
(AssetCategory assetCategory) Deletes the asset category from the database.static void
deleteCategories
(long[] categoryIds) static void
deleteCategories
(List<AssetCategory> categories) static AssetCategory
deleteCategory
(long categoryId) static AssetCategory
deleteCategory
(AssetCategory category) static AssetCategory
deleteCategory
(AssetCategory category, boolean skipRebuildTree) static PersistedModel
deletePersistedModel
(PersistedModel persistedModel) static void
deleteVocabularyCategories
(long vocabularyId) static <T> T
dslQuery
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static int
dslQueryCount
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static DynamicQuery
static <T> List<T>
dynamicQuery
(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.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.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.static long
dynamicQueryCount
(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.static long
dynamicQueryCount
(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.static AssetCategory
fetchAssetCategory
(long categoryId) static AssetCategory
fetchAssetCategoryByExternalReferenceCode
(String externalReferenceCode, long groupId) static AssetCategory
fetchAssetCategoryByUuidAndGroupId
(String uuid, long groupId) Returns the asset category matching the UUID and group.static AssetCategory
fetchCategory
(long categoryId) static AssetCategory
fetchCategory
(long groupId, long parentCategoryId, String name, long vocabularyId) static ActionableDynamicQuery
static List<AssetCategory>
getAssetCategories
(int start, int end) Returns a range of all the asset categories.static List<AssetCategory>
getAssetCategoriesByUuidAndCompanyId
(String uuid, long companyId) Returns all the asset categories matching the UUID and company.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.static int
Returns the number of asset categories.static AssetCategory
getAssetCategory
(long categoryId) Returns the asset category with the primary key.static AssetCategory
getAssetCategoryByExternalReferenceCode
(String externalReferenceCode, long groupId) static AssetCategory
getAssetCategoryByUuidAndGroupId
(String uuid, long groupId) Returns the asset category matching the UUID and group.static List<AssetCategory>
static List<AssetCategory>
getCategories
(long classNameId, long classPK) static List<AssetCategory>
getCategories
(long classNameId, long classPK, int start, int end) static List<AssetCategory>
getCategories
(Hits hits) static List<AssetCategory>
getCategories
(String className, long classPK) static int
getCategoriesCount
(long classNameId, long classPK) static AssetCategory
getCategory
(long categoryId) static AssetCategory
getCategory
(String uuid, long groupId) static long[]
getCategoryIds
(String className, long classPK) static String[]
static String[]
getCategoryNames
(long classNameId, long classPK) static String[]
getCategoryNames
(String className, long classPK) static List<AssetCategory>
getChildCategories
(long parentCategoryId) static List<AssetCategory>
getChildCategories
(long parentCategoryId, int start, int end, OrderByComparator<AssetCategory> orderByComparator) static int
getChildCategoriesCount
(long parentCategoryId) static List<AssetCategory>
getDescendantCategories
(AssetCategory category) static List<AssetCategory>
getEntryCategories
(long entryId) static ExportActionableDynamicQuery
getExportActionableDynamicQuery
(PortletDataContext portletDataContext) static String
Returns the OSGi service identifier.static PersistedModel
getPersistedModel
(Serializable primaryKeyObj) static AssetCategoryLocalService
getSubcategoryIds
(long parentCategoryId) static long[]
getViewableCategoryIds
(String className, long classPK, long[] categoryIds) static List<AssetCategory>
getVocabularyCategories
(long vocabularyId, int start, int end, OrderByComparator<AssetCategory> orderByComparator) static List<AssetCategory>
getVocabularyCategories
(long parentCategoryId, long vocabularyId, int start, int end, OrderByComparator<AssetCategory> orderByComparator) static int
getVocabularyCategoriesCount
(long vocabularyId) static List<AssetCategory>
getVocabularyRootCategories
(long vocabularyId, int start, int end, OrderByComparator<AssetCategory> orderByComparator) static int
getVocabularyRootCategoriesCount
(long vocabularyId) static AssetCategory
mergeCategories
(long fromCategoryId, long toCategoryId) static AssetCategory
moveCategory
(long categoryId, long parentCategoryId, long vocabularyId, ServiceContext serviceContext) static List<AssetCategory>
static BaseModelSearchResult<AssetCategory>
searchCategories
(long companyId, long[] groupIds, String title, long[] vocabularyIds, int start, int end) static BaseModelSearchResult<AssetCategory>
searchCategories
(long companyId, long[] groupIds, String title, long[] parentCategoryIds, long[] vocabularyIds, int start, int end) static BaseModelSearchResult<AssetCategory>
searchCategories
(long companyId, long[] groupIds, String title, long[] vocabularyIds, long[] parentCategoryIds, int start, int end, Sort sort) static BaseModelSearchResult<AssetCategory>
searchCategories
(long companyId, long groupIds, String title, long vocabularyId, int start, int end) static void
setService
(AssetCategoryLocalService service) static AssetCategory
updateAssetCategory
(AssetCategory assetCategory) Updates the asset category in the database or adds it if it does not yet exist.static AssetCategory
updateCategory
(long userId, long categoryId, long parentCategoryId, Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, long vocabularyId, String[] categoryProperties, ServiceContext serviceContext)
-
Constructor Details
-
AssetCategoryLocalServiceUtil
public AssetCategoryLocalServiceUtil()
-
-
Method Details
-
addAssetCategory
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, throws PortalExceptionString> descriptionMap, long vocabularyId, String[] categoryProperties, ServiceContext serviceContext) - 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
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
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
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
- Throws:
PortalException
-
deleteCategories
- Throws:
PortalException
-
deleteCategory
- Throws:
PortalException
-
deleteCategory
public static AssetCategory deleteCategory(AssetCategory category, boolean skipRebuildTree) throws PortalException - Throws:
PortalException
-
deleteCategory
- Throws:
PortalException
-
deletePersistedModel
public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException - Throws:
PortalException
-
deleteVocabularyCategories
- 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
-
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
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
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portlet.asset.model.impl.AssetCategoryModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- 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
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portlet.asset.model.impl.AssetCategoryModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchAssetCategory
-
fetchAssetCategoryByExternalReferenceCode
public static AssetCategory fetchAssetCategoryByExternalReferenceCode(String externalReferenceCode, long groupId) -
fetchAssetCategoryByUuidAndGroupId
Returns the asset category matching the UUID and group.- Parameters:
uuid
- the asset category's UUIDgroupId
- the primary key of the group- Returns:
- the matching asset category, or
null
if a matching asset category could not be found
-
fetchCategory
-
fetchCategory
public static AssetCategory fetchCategory(long groupId, long parentCategoryId, String name, long vocabularyId) -
getActionableDynamicQuery
-
getAssetCategories
Returns a range of all the asset categories.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portlet.asset.model.impl.AssetCategoryModelImpl
.- Parameters:
start
- the lower bound of the range of asset categoriesend
- the upper bound of the range of asset categories (not inclusive)- Returns:
- the range of asset categories
-
getAssetCategoriesByUuidAndCompanyId
Returns all the asset categories matching the UUID and company.- Parameters:
uuid
- the UUID of the asset categoriescompanyId
- 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 categoriescompanyId
- the primary key of the companystart
- the lower bound of the range of asset categoriesend
- the upper bound of the range of asset categories (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- 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
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 UUIDgroupId
- the primary key of the group- Returns:
- the matching asset category
- Throws:
PortalException
- if a matching asset category could not be found
-
getCategories
-
getCategories
- Throws:
PortalException
-
getCategories
-
getCategories
-
getCategories
-
getCategoriesCount
public static int getCategoriesCount(long classNameId, long classPK) -
getCategory
- Throws:
PortalException
-
getCategory
- Throws:
PortalException
-
getCategoryIds
-
getCategoryNames
-
getCategoryNames
-
getCategoryNames
-
getChildCategories
-
getChildCategories
public static List<AssetCategory> getChildCategories(long parentCategoryId, int start, int end, OrderByComparator<AssetCategory> orderByComparator) -
getChildCategoriesCount
public static int getChildCategoriesCount(long parentCategoryId) -
getDescendantCategories
-
getEntryCategories
-
getExportActionableDynamicQuery
public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext) -
getIndexableActionableDynamicQuery
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
- Throws:
PortalException
-
getSubcategoryIds
-
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
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, throws PortalExceptionString> descriptionMap, long vocabularyId, String[] categoryProperties, ServiceContext serviceContext) - Throws:
PortalException
-
getService
-
setService
-