AleksanderSklorz 7793aba89e
[ACS-6252] support disabling the tags and categories feature in the applications (#9106)
* ACS-6252 Added rules field to SearchCategory interface

* ACS-6252 Hide aspects related with tags and categories if tags and categories features  are disabled

* ACS-6252 Return from services information if tags and categories are disabled

* ACS-6252 Unit tests for changes in AspectListDialogComponent

* ACS-6252 Unit tests for changes for AspectListComponent

* ACS-6252 Unit tests for DialogAspectListService

* ACS-6252 Unit tests for changes for TagService and CategoryService

* ACS-6252 Updated documentation for changes

* ACS-6252 Fixed imports formatting

* ACS-6252 Fix after rebasing

* ACS-6252 Addressed PR comments

* ACS-6252 Excluded e2es
2023-11-28 11:41:32 +01:00

8.6 KiB

Title, Added, Status, Last reviewed
Title Added Status Last reviewed
Category service v6.0.0.0 Active 2023-01-25

Category service

Manages categories in Content Services.

Class members

Methods

  • getSubcategories(parentCategoryId: string, skipCount?: number, maxItems?: number): Observable<CategoryPaging>
    Gets subcategories of a given parent category.
    • parentCategoryId: string - Identifier of a parent category
    • skipCount: number - Number of top categories to skip
    • maxItems: number - Maximum number of subcategories returned from Observable
    • Returns Observable<CategoryPaging> - CategoryPaging object (defined in JS-API) with category paging list
  • getCategory(categoryId: string): Observable<CategoryEntry>
    Gets a specific category by categoryId.
    • categoryId: string - The identifier of a category
    • opts: any - Optional parameters
    • opts.fields string[] - A list of field names
    • opts.include string[] - Returns additional information about the category. The following optional fields can be requested: count, path
    • Returns Observable<CategoryEntry> - CategoryEntry object (defined in JS-API) containing information about the category.
  • createSubcategories(parentCategoryId: string, payload: CategoryBody[]): Observable<CategoryPaging | CategoryEntry>
    Creates subcategories under category with provided categoryId.
  • updateCategory(categoryId: string, payload: CategoryBody): Observable<CategoryEntry>
    Updates category.
    • categoryId: string - Identifier of a category
    • payload: CategoryBody - Created category body
    • Returns Observable<CategoryEntry> - CategoryEntry object (defined in JS-API) containing the category
  • deleteCategory(categoryId: string): Observable<void>
    Deletes category
  • searchCategories(name: string, skipCount: number = 0, maxItems?: number): Observable<ResultSetPaging>
    Searches categories by their name.
    • name: string - Value for name which should be used during searching categories.
    • skipCount: number - Specify how many first results should be skipped. Default 0.
    • maxItems: number - (Optional) Specify max number of returned categories. Default is specified by UserPreferencesService.
    • Returns Observable<ResultSetPaging> - Observable<ResultSetPaging> Found categories which name contains searched name.
  • updateCategory(categoryId: string, payload: CategoryBody): Observable<CategoryEntry>
    Updates category
    • categoryId: string - The identifier of a category.
    • payload: CategoryBody - Updated category body
    • Returns Observable<CategoryEntry> - Observable<CategoryEntry>
  • getCategoryLinksForNode(nodeId: string): Observable<CategoryPaging>
    Provides list of categories that node is linked to.
    • nodeId: string - Id of a node that is linked to categories
    • Returns Observable<CategoryPaging> - Found categories that node is linked to.
  • unlinkNodeFromCategory(nodeId: string, categoryId: string): Observable<void>
    Unlinks category from a node.
    • nodeId: string - The identifier of a node.
    • categoryId: string - The identifier of a category.
    • Returns Observable<void>
  • linkNodeToCategory(nodeId: string, categoryLinkBodyCreate: CategoryLinkBody[]): Observable<CategoryPaging|CategoryEntry>
    Links node to a category.
  • areCategoriesEnabled():boolean
    Checks if categories plugin is enabled.
    • Returns boolean - true if categories plugin is enabled, false otherwise.

Details

See the Categories API in the Alfresco JS API for more information about the types returned by Category service methods and for the implementation of the REST API the service is based on.