How to use the @alfresco/js-api.NodeBodyLock function in @alfresco/js-api

To help you get started, we’ve selected a few @alfresco/js-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Alfresco / alfresco-ng2-components / lib / content-services / src / lib / dialogs / node-lock.dialog.spec.ts View on Github external
it('should submit the form and lock the node', () => {
            spyOn(alfrescoApi.nodesApi, 'lockNode').and.returnValue(Promise.resolve({}));

            component.submit();

            expect(alfrescoApi.nodesApi.lockNode).toHaveBeenCalledWith(
                'node-id',
                new NodeBodyLock({
                    'timeToExpire': 60,
                    'type': 'ALLOW_OWNER_CHANGES',
                    'lifetime': 'PERSISTENT'
                })
            );
        });
github Alfresco / alfresco-ng2-components / lib / content-services / src / lib / dialogs / node-lock.dialog.ts View on Github external
private get nodeBodyLock(): NodeBodyLock {
        return new NodeBodyLock({
            'timeToExpire': this.lockTimeInSeconds,
            'type': this.form.value.allowOwner ? 'ALLOW_OWNER_CHANGES' : 'FULL',
            'lifetime': 'PERSISTENT'
        });
    }