alfresco-js-api
Version:
JavaScript client library for the Alfresco REST API
258 lines (176 loc) • 19.4 kB
Markdown
# AlfrescoGovernanceServicesRestApi.RecordCategoriesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createRecordCategoryChild**](RecordCategoriesApi.md#createRecordCategoryChild) | **POST** /record-categories/{recordCategoryId}/children | Create a record category or a record folder
[**deleteRecordCategory**](RecordCategoriesApi.md#deleteRecordCategory) | **DELETE** /record-categories/{recordCategoryId} | Delete a record category
[**getRecordCategory**](RecordCategoriesApi.md#getRecordCategory) | **GET** /record-categories/{recordCategoryId} | Get a record category
[**listRecordCategoryChildren**](RecordCategoriesApi.md#listRecordCategoryChildren) | **GET** /record-categories/{recordCategoryId}/children | List record category's children
[**updateRecordCategory**](RecordCategoriesApi.md#updateRecordCategory) | **PUT** /record-categories/{recordCategoryId} | Update a record category
<a name="createRecordCategoryChild"></a>
# **createRecordCategoryChild**
> RecordCategoryChildEntry createRecordCategoryChild(recordCategoryId, nodeBodyCreate, opts)
Create a record category or a record folder
Create a record category or a record folder as a primary child of **recordCategoryId**. You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then the API method tries to create a unique name using an integer suffix. This API method also supports record category or record folder creation using application/json. You must specify at least a **name** and **nodeType**. You can create a category like this: ```JSON { \"name\":\"My Record Category\", \"nodeType\":\"rma:recordCategory\" } ``` You can create a record folder like this: ```JSON { \"name\":\"My Record Folder\", \"nodeType\":\"rma:recordFolder\" } ``` You can create a record folder inside a container hierarchy (applies to record categories as well): ```JSON { \"name\":\"My Fileplan Component\", \"nodeType\":\"rma:recordFolder\", \"relativePath\":\"X/Y/Z\" } ``` The **relativePath** specifies the container structure to create relative to the node (record category or record folder). Containers in the **relativePath** that do not exist are created before the node is created. The container type is decided considering the type of the parent container and the type of the node to be created. You can set properties when creating a record category (applies to record folders as well): ```JSON { \"name\":\"My Record Category\", \"nodeType\":\"rma:recordCategory\", \"properties\": { \"rma:vitalRecordIndicator\":\"true\", \"rma:reviewPeriod\":\"month|1\" } } ``` Any missing aspects are applied automatically. You can set aspects explicitly, if needed, using an **aspectNames** field. **Note:** You can create more than one child by specifying a list of nodes in the JSON body. For example, the following JSON body creates a record category and a record folder inside the specified **categoryId**: ```JSON [ { \"name\":\"My Record Category\", \"nodeType\":\"rma:recordCategory\" }, { \"name\":\"My Record Folder\", \"nodeType\":\"rma:recordFolder\" } ] ``` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: ```JSON { \"list\": { \"pagination\": { \"count\": 2, \"hasMoreItems\": false, \"totalItems\": 2, \"skipCount\": 0, \"maxItems\": 100 }, \"entries\": [ { \"entry\": { ... } }, { \"entry\": { ... } } ] } } ```
### Example
```javascript
var recordCategoryId = "recordCategoryId_example"; // String | The identifier of a record category.
var nodeBodyCreate = new AlfrescoGovernanceServicesRestApi.RMNodeBodyCreateWithRelativePath(); // RMNodeBodyCreateWithRelativePath | The node information to create.
var opts = {
'autoRename': true, // Boolean | If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix.
'include': ["include_example"], // [String] | Returns additional information about the record category. Any optional field from the response model can be requested. For example: * allowableOperations * hasRetentionSchedule * path
'fields': ["fields_example"] // [String] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.
};
this.alfrescoJsApi.gsCore.recordCategoriesApi.createRecordCategoryChild(recordCategoryId, nodeBodyCreate, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**recordCategoryId** | **String**| The identifier of a record category. |
**nodeBodyCreate** | [**RMNodeBodyCreateWithRelativePath**](RMNodeBodyCreateWithRelativePath.md)| The node information to create. |
**autoRename** | **Boolean**| If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. | [optional]
**include** | [**[String]**](String.md)| Returns additional information about the record category. Any optional field from the response model can be requested. For example: * allowableOperations * hasRetentionSchedule * path | [optional]
**fields** | [**[String]**](String.md)| A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | [optional]
### Return type
[**RecordCategoryChildEntry**](RecordCategoryChildEntry.md)
### Authorization
[basicAuth](../README.md#basicAuth)
### HTTP request headers
- **Content-Type**: application/json, multipart/form-data
- **Accept**: application/json
<a name="deleteRecordCategory"></a>
# **deleteRecordCategory**
> deleteRecordCategory(recordCategoryId, )
Delete a record category
Deletes record category **recordCategoryId**.
### Example
```javascript
var recordCategoryId = "recordCategoryId_example"; // String | The identifier of a record category.
this.alfrescoJsApi.gsCore.recordCategoriesApi.deleteRecordCategory(recordCategoryId, ).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**recordCategoryId** | **String**| The identifier of a record category. |
### Return type
null (empty response body)
### Authorization
[basicAuth](../README.md#basicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="getRecordCategory"></a>
# **getRecordCategory**
> RecordCategoryEntry getRecordCategory(recordCategoryId, , opts)
Get a record category
Gets information for record category **recordCategoryId** Mandatory fields and the record category's aspects and properties are returned by default. You can use the **include** parameter (include=allowableOperations) to return additional information.
### Example
```javascript
var recordCategoryId = "recordCategoryId_example"; // String | The identifier of a record category.
var opts = {
'include': ["include_example"], // [String] | Returns additional information about the record category. Any optional field from the response model can be requested. For example: * allowableOperations * hasRetentionSchedule * path
'relativePath': "relativePath_example", // String | Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**.
'fields': ["fields_example"] // [String] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.
};
this.alfrescoJsApi.gsCore.recordCategoriesApi.getRecordCategory(recordCategoryId, , opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**recordCategoryId** | **String**| The identifier of a record category. |
**include** | [**[String]**](String.md)| Returns additional information about the record category. Any optional field from the response model can be requested. For example: * allowableOperations * hasRetentionSchedule * path | [optional]
**relativePath** | **String**| Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**. | [optional]
**fields** | [**[String]**](String.md)| A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | [optional]
### Return type
[**RecordCategoryEntry**](RecordCategoryEntry.md)
### Authorization
[basicAuth](../README.md#basicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="listRecordCategoryChildren"></a>
# **listRecordCategoryChildren**
> RecordCategoryChildPaging listRecordCategoryChildren(recordCategoryId, , opts)
List record category's children
Returns a list of record categories and/or record folders. Minimal information for each child is returned by default. You can use the **include** parameter (include=allowableOperations) to return additional information. The list of child nodes includes primary children and secondary children, if there are any.
### Example
```javascript
var recordCategoryId = "recordCategoryId_example"; // String | The identifier of a record category.
var opts = {
'skipCount': 56, // Number | The number of entities that exist in the collection before those included in this list.
'maxItems': 56, // Number | The maximum number of items to return in the list.
'where': "where_example", // String | Optionally filter the list. Here are some examples: * ```where=(nodeType='rma:recordFolder')``` * ```where=(nodeType='rma:recordCategory')``` * ```where=(isRecordFolder=true AND isClosed=false)```
'include': ["include_example"], // [String] | Returns additional information about the record category child. Any optional field from the response model can be requested. For example: * allowableOperations * aspectNames * hasRetentionSchedule * isClosed * isRecordCategory * isRecordFolder * path * properties
'relativePath': "relativePath_example", // String | Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**.
'includeSource': true, // Boolean | Also include **source** (in addition to **entries**) with folder information on the parent node – either the specified parent **recordCategoryId**, or as resolved by **relativePath**.
'fields': ["fields_example"] // [String] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.
};
this.alfrescoJsApi.gsCore.recordCategoriesApi.listRecordCategoryChildren(recordCategoryId, , opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**recordCategoryId** | **String**| The identifier of a record category. |
**skipCount** | **Number**| The number of entities that exist in the collection before those included in this list. | [optional]
**maxItems** | **Number**| The maximum number of items to return in the list. | [optional]
**where** | **String**| Optionally filter the list. Here are some examples: * ```where=(nodeType='rma:recordFolder')``` * ```where=(nodeType='rma:recordCategory')``` * ```where=(isRecordFolder=true AND isClosed=false)``` | [optional]
**include** | [**[String]**](String.md)| Returns additional information about the record category child. Any optional field from the response model can be requested. For example: * allowableOperations * aspectNames * hasRetentionSchedule * isClosed * isRecordCategory * isRecordFolder * path * properties | [optional]
**relativePath** | **String**| Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**. | [optional]
**includeSource** | **Boolean**| Also include **source** (in addition to **entries**) with folder information on the parent node – either the specified parent **recordCategoryId**, or as resolved by **relativePath**. | [optional]
**fields** | [**[String]**](String.md)| A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | [optional]
### Return type
[**RecordCategoryChildPaging**](RecordCategoryChildPaging.md)
### Authorization
[basicAuth](../README.md#basicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="updateRecordCategory"></a>
# **updateRecordCategory**
> RecordCategoryEntry updateRecordCategory(recordCategoryId, recordCategoryBodyUpdate, opts)
Update a record category
Updates record category **recordCategoryId**. For example, you can rename a record category: ```JSON { \"name\":\"My new name\" } ``` You can also set or update one or more properties: ```JSON { \"properties\": { \"rma:vitalRecordIndicator\": true, \"rma:reviewPeriod\":\"month|6\" } } ``` **Note:** If you want to add or remove aspects, then you must use **GET /record-categories/{recordCategoryId}** first to get the complete set of *aspectNames*. **Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order.
### Example
```javascript
var recordCategoryId = "recordCategoryId_example"; // String | The identifier of a record category.
var recordCategoryBodyUpdate = new AlfrescoGovernanceServicesRestApi.FilePlanComponentBodyUpdate(); // FilePlanComponentBodyUpdate | The record category information to update.
var opts = {
'include': ["include_example"], // [String] | Returns additional information about the record category. Any optional field from the response model can be requested. For example: * allowableOperations * hasRetentionSchedule * path
'fields': ["fields_example"] // [String] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.
};
this.alfrescoJsApi.gsCore.recordCategoriesApi.updateRecordCategory(recordCategoryId, recordCategoryBodyUpdate, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**recordCategoryId** | **String**| The identifier of a record category. |
**recordCategoryBodyUpdate** | [**FilePlanComponentBodyUpdate**](FilePlanComponentBodyUpdate.md)| The record category information to update. |
**include** | [**[String]**](String.md)| Returns additional information about the record category. Any optional field from the response model can be requested. For example: * allowableOperations * hasRetentionSchedule * path | [optional]
**fields** | [**[String]**](String.md)| A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | [optional]
### Return type
[**RecordCategoryEntry**](RecordCategoryEntry.md)
### Authorization
[basicAuth](../README.md#basicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json