mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-8055] Integrate endpoint for getting Legal Holds (#9771)
* ACS-8055 add listAssignedHolds API * ACS-8055 create legal-hold service * ACS-8055 add documentation * ACS-8055 fix imports * ACS-8055 clean up code * ACS-8055 fix interface typo * ACS-8055 add optional options and uodate nodes-api.service.md * ACS-8055 update interface * ACS-8055 add HoldPaging class and documentation * ACS-8055 add interface and fix test * ACS-8055 add documentation for legal hold service * ACS-8055 update legal-hold.service.md * ACS-8055 update legal-hold.service.md * ACS-8055 update readme file * ACS-8055 add translation --------- Co-authored-by: DaryaBalvanovich <darya.balvanovich1@hyland.com>
This commit is contained in:
@@ -21,6 +21,7 @@ Class | Method | HTTP request | Description
|
||||
*.GssitesApi* | [**deleteRMSite**](docs/GssitesApi.md#deleteRMSite) | **DELETE** /gs-sites/rm | Delete the Records Management (RM) site
|
||||
*.GssitesApi* | [**getRMSite**](docs/GssitesApi.md#getRMSite) | **GET** /gs-sites/rm | Get the Records Management (RM) site
|
||||
*.GssitesApi* | [**updateRMSite**](docs/GssitesApi.md#updateRMSite) | **PUT** /gs-sites/rm | Update the Records Management (RM) site
|
||||
*.LegalHoldApi* | [**getHolds**](docs/LegalHoldApi.md#getHolds) | **GET** /file-plans/{filePlanId}/holds | Get legal hold list
|
||||
*.RecordCategoriesApi* | [**createRecordCategoryChild**](docs/RecordCategoriesApi.md#createRecordCategoryChild) | **POST** /record-categories/{recordCategoryId}/children | Create a record category or a record folder
|
||||
*.RecordCategoriesApi* | [**deleteRecordCategory**](docs/RecordCategoriesApi.md#deleteRecordCategory) | **DELETE** /record-categories/{recordCategoryId} | Delete a record category
|
||||
*.RecordCategoriesApi* | [**getRecordCategory**](docs/RecordCategoriesApi.md#getRecordCategory) | **GET** /record-categories/{recordCategoryId} | Get a record category
|
||||
|
@@ -26,3 +26,4 @@ export * from './transferContainers.api';
|
||||
export * from './transfers.api';
|
||||
export * from './unfiledContainers.api';
|
||||
export * from './unfiledRecordFolders.api';
|
||||
export * from './legal-hold.api';
|
||||
|
55
lib/js-api/src/api/gs-core-rest-api/api/legal-hold.api.ts
Normal file
55
lib/js-api/src/api/gs-core-rest-api/api/legal-hold.api.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BaseApi } from './base.api';
|
||||
import { throwIfNotDefined } from '../../../assert';
|
||||
import { ContentPagingQuery } from '../../content-rest-api';
|
||||
import { HoldPaging } from '../model/holdPaging';
|
||||
|
||||
/**
|
||||
* Legal Holds service.
|
||||
*
|
||||
* @module LegalHoldApi
|
||||
*/
|
||||
export class LegalHoldApi extends BaseApi {
|
||||
/**
|
||||
* List of legal holds
|
||||
*
|
||||
* @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias.
|
||||
* @param options Optional parameters
|
||||
* @returns Promise<HoldPaging>
|
||||
*/
|
||||
getHolds(filePlanId = '-filePlan-', options?: ContentPagingQuery): Promise<HoldPaging> {
|
||||
throwIfNotDefined(filePlanId, 'filePlanId');
|
||||
|
||||
const pathParams = {
|
||||
filePlanId
|
||||
};
|
||||
|
||||
const queryParams = {
|
||||
skipCount: options?.skipCount,
|
||||
maxItems: options?.maxItems
|
||||
};
|
||||
|
||||
return this.get({
|
||||
path: '/file-plans/{filePlanId}/holds',
|
||||
pathParams,
|
||||
queryParams,
|
||||
returnType: HoldPaging
|
||||
});
|
||||
}
|
||||
}
|
22
lib/js-api/src/api/gs-core-rest-api/docs/Hold.md
Normal file
22
lib/js-api/src/api/gs-core-rest-api/docs/Hold.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Hold
|
||||
|
||||
## Basic usage
|
||||
|
||||
```ts
|
||||
export interface Hold {
|
||||
name: string;
|
||||
id?: string;
|
||||
reason?: string;
|
||||
description?: string;
|
||||
selected?: string;
|
||||
}
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Default value | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **string** | | Hold id
|
||||
**name** | **string** | | Hold name
|
||||
**reason** | **string** | | Hold reason
|
||||
**description** | **string** | | Additional information for a hold
|
6
lib/js-api/src/api/gs-core-rest-api/docs/HoldEntry.md
Normal file
6
lib/js-api/src/api/gs-core-rest-api/docs/HoldEntry.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# HoldEntry
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**entry** | [**Hold**](Hold.md) | | [default to null]
|
8
lib/js-api/src/api/gs-core-rest-api/docs/HoldPaging.md
Normal file
8
lib/js-api/src/api/gs-core-rest-api/docs/HoldPaging.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# HoldPaging
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**list** | [**HoldPagingList**](HoldPagingList.md) | | [optional] [default to null]
|
||||
|
||||
|
@@ -0,0 +1,7 @@
|
||||
# HoldPagingList
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null]
|
||||
**entries** | [**HoldEntry[]**](HoldEntry.md) | | [optional] [default to null]
|
50
lib/js-api/src/api/gs-core-rest-api/docs/LegalHoldApi.md
Normal file
50
lib/js-api/src/api/gs-core-rest-api/docs/LegalHoldApi.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# LegalHoldApi
|
||||
|
||||
All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**getHolds**](LegalHoldApi.md#getHolds) | **GET** /file-plans/{filePlanId}/holds | Get legal holds list
|
||||
|
||||
<a name="getHolds"></a>
|
||||
# **getHolds**
|
||||
> HoldPaging getHolds(filePlanId, opts)
|
||||
|
||||
Get legal holds list.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import LegalHoldApi from 'LegalHoldApi';
|
||||
import { AlfrescoApi } from '@alfresco/js-api';
|
||||
|
||||
this.alfrescoApi = new AlfrescoApi();
|
||||
this.alfrescoApi.setConfig({
|
||||
hostEcm: 'http://127.0.0.1:8080'
|
||||
});
|
||||
|
||||
let legalHoldApi = new LegalHoldApi(this.alfrescoApi);
|
||||
|
||||
let opts = {
|
||||
'skipCount': 56 // | The number of entities that exist in the collection before those included in this list.
|
||||
'maxItems': 56 // | The maximum number of items to return in the list.
|
||||
};
|
||||
|
||||
legalHoldApi.getHolds('-filePlan-', opts).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Default value | Description
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**filePlanId** | **string** | | The site details
|
||||
**skipCount** | **number**| `0` | The number of entities that exist in the collection before those included in this list. [optional]
|
||||
**maxItems** | **number**| `100` | The maximum number of items to return in the list. [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**HoldPaging**](HoldPaging.md)
|
24
lib/js-api/src/api/gs-core-rest-api/model/hold.ts
Normal file
24
lib/js-api/src/api/gs-core-rest-api/model/hold.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export interface Hold {
|
||||
name: string;
|
||||
id?: string;
|
||||
reason?: string;
|
||||
description?: string;
|
||||
selected?: boolean;
|
||||
}
|
28
lib/js-api/src/api/gs-core-rest-api/model/holdEntry.ts
Normal file
28
lib/js-api/src/api/gs-core-rest-api/model/holdEntry.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Hold } from './hold';
|
||||
|
||||
export class HoldEntry {
|
||||
entry: Hold;
|
||||
|
||||
constructor(input?: Partial<HoldEntry>) {
|
||||
if (input) {
|
||||
Object.assign(this, input);
|
||||
}
|
||||
}
|
||||
}
|
29
lib/js-api/src/api/gs-core-rest-api/model/holdPaging.ts
Normal file
29
lib/js-api/src/api/gs-core-rest-api/model/holdPaging.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { HoldPagingList } from './holdPagingList';
|
||||
|
||||
export class HoldPaging {
|
||||
list?: HoldPagingList;
|
||||
|
||||
constructor(input?: Partial<HoldPaging>) {
|
||||
if (input) {
|
||||
Object.assign(this, input);
|
||||
this.list = input.list ? new HoldPagingList(input.list) : undefined;
|
||||
}
|
||||
}
|
||||
}
|
34
lib/js-api/src/api/gs-core-rest-api/model/holdPagingList.ts
Normal file
34
lib/js-api/src/api/gs-core-rest-api/model/holdPagingList.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Pagination } from '../../content-rest-api';
|
||||
import { HoldEntry } from './holdEntry';
|
||||
|
||||
export class HoldPagingList {
|
||||
pagination?: Pagination;
|
||||
entries?: HoldEntry[];
|
||||
|
||||
constructor(input?: Partial<HoldPagingList>) {
|
||||
if (input) {
|
||||
Object.assign(this, input);
|
||||
this.pagination = input.pagination ? new Pagination(input.pagination) : undefined;
|
||||
if (input.entries) {
|
||||
this.entries = input.entries.map((item) => new HoldEntry(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -74,3 +74,7 @@ export * from './transferChildAssociation';
|
||||
export * from './transferContainerChildAssociation';
|
||||
export * from './unfiledContainerChildAssociation';
|
||||
export * from './unfiledRecordFolderChildAssociation';
|
||||
export * from './hold';
|
||||
export * from './holdEntry';
|
||||
export * from './holdPaging';
|
||||
export * from './holdPagingList';
|
||||
|
Reference in New Issue
Block a user