How to use the @alfresco/js-api.AlfrescoApiCompatibility 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 / scripts / clean-env.js View on Github external
async function main() {

    program
        .version('0.1.0')
        .option('--host [type]', 'Remote environment host adf.lab.com ')
        .option('-p, --password [type]', 'password RANCHER')
        .option('-u, --username [type]', 'username RANCHER')
        .parse(process.argv);

    this.alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility({
        provider: 'ECM',
        hostEcm: program.host
    });

    try {
        await this.alfrescoJsApi.login(program.username, program.password);
    } catch (error) {
        console.log(JSON.stringify(error));
    }

    console.log('====== Clean Root ======');
    await cleanRoot(this.alfrescoJsApi);

    console.log('====== Clean Sites ======');
    await deleteSite(this.alfrescoJsApi);
github Alfresco / alfresco-ng2-components / e2e / content-services / metadata / aspect-oriented-config.e2e.ts View on Github external
beforeAll(async () => {
        this.alfrescoJsApi = new AlfrescoApi({
            provider: 'ECM',
            hostEcm: browser.params.testConfig.adf_acs.host
        });
        uploadActions = new UploadActions(this.alfrescoJsApi);

        await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);

        try {
            await this.alfrescoJsApi.core.customModelApi.createCustomModel('ACTIVE', modelOneName, modelOneName, modelOneName, modelOneName);
        } catch (e) {
        }

        try {
            await this.alfrescoJsApi.core.customModelApi.createCustomAspect(modelOneName, emptyAspectName, null, emptyAspectName, emptyAspectName);
        } catch (e) {
        }
github Alfresco / alfresco-ng2-components / e2e / process-services / task-filters-sorting.e2e.ts View on Github external
beforeAll(async () => {
        const apps = new AppsActions();
        const users = new UsersActions();

        this.alfrescoJsApi = new AlfrescoApi({
            provider: 'BPM',
            hostBpm: browser.params.testConfig.adf_aps.host
        });

        await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);

        user = await users.createTenantAndUser(this.alfrescoJsApi);

        await this.alfrescoJsApi.login(user.email, user.password);

        importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);

        const appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions();

        appId = appDefinitions.data.find((currentApp) => {
            return currentApp.modelId === importedApp.id;
github Alfresco / alfresco-ng2-components / e2e / core / viewer / viewer-content-services-component.e2e.ts View on Github external
'name': browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_name
    });
    const mp4File = new FileModel({
        'location': browser.params.resources.Files.ADF_DOCUMENTS.MP4.file_location,
        'name': browser.params.resources.Files.ADF_DOCUMENTS.MP4.file_name
    });
    const unsupportedFile = new FileModel({
        'location': browser.params.resources.Files.ADF_DOCUMENTS.UNSUPPORTED.file_location,
        'name': browser.params.resources.Files.ADF_DOCUMENTS.UNSUPPORTED.file_name
    });
    const pptFile = new FileModel({
        'location': browser.params.resources.Files.ADF_DOCUMENTS.PPT.file_location,
        'name': browser.params.resources.Files.ADF_DOCUMENTS.PPT.file_name,
        'firstPageText': browser.params.resources.Files.ADF_DOCUMENTS.PPT.first_page_text
    });
    this.alfrescoJsApi = new AlfrescoApi({
            provider: 'ECM',
            hostEcm: browser.params.testConfig.adf_acs.host
        });
    const uploadActions = new UploadActions(this.alfrescoJsApi);

    beforeAll(async () => {

        await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);

        await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);

        await this.alfrescoJsApi.login(acsUser.id, acsUser.password);

        const pdfFileUploaded = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
        Object.assign(pdfFile, pdfFileUploaded.entry);
github Alfresco / alfresco-ng2-components / e2e / process-services / form-people-widget.e2e.ts View on Github external
beforeAll(async () => {
        const users = new UsersActions();
        const appsActions = new AppsActions();

        alfrescoJsApi = new AlfrescoApi({
            provider: 'BPM',
            hostBpm: browser.params.testConfig.adf_aps.host
        });

        await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);

        processUserModel = await users.createTenantAndUser(alfrescoJsApi);

        await alfrescoJsApi.login(processUserModel.email, processUserModel.password);

        appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, app.file_location);

        await loginPage.loginToProcessServicesUsingUserModel(processUserModel);

    });
github Alfresco / alfresco-ng2-components / e2e / process-services / task-details-no-form.e2e.ts View on Github external
beforeAll(async () => {
        const users = new UsersActions();

        this.alfrescoJsApi = new AlfrescoApi({
            provider: 'BPM',
            hostBpm: browser.params.testConfig.adf_aps.host
        });

        await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);

        const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant());

        processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id);

        await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);

        importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);

        await apps.startProcess(this.alfrescoJsApi, importedApp);
github Alfresco / alfresco-ng2-components / e2e / process-services / processlist-pagination.e2e.ts View on Github external
beforeAll(async () => {
            const apps = new AppsActions();

            this.alfrescoJsApi = new AlfrescoApi({
                provider: 'BPM',
                hostBpm: browser.params.testConfig.adf_aps.host
            });

            await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);

            for (let i = 0; i < nrOfProcesses; i++) {
                await apps.startProcess(this.alfrescoJsApi, deployedTestApp, processNameBase + (i < 10 ? `0${i}` : i));
            }

        });
github Alfresco / alfresco-ng2-components / e2e / content-services / upload / upload-dialog.e2e.ts View on Github external
describe('Upload component', () => {

    const contentServicesPage = new ContentServicesPage();
    const uploadDialog = new UploadDialog();
    const uploadToggles = new UploadToggles();
    const loginPage = new LoginPage();
    const acsUser = new AcsUserModel();
    const versionManagePage = new VersionManagePage();
    this.alfrescoJsApi = new AlfrescoApi({
        provider: 'ECM',
        hostEcm: browser.params.testConfig.adf_acs.host
    });
    const uploadActions = new UploadActions(this.alfrescoJsApi);

    const firstPdfFileModel = new FileModel({
        'name': browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
        'location': browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_location
    });
    const docxFileModel = new FileModel({
        'name': browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name,
        'location': browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_location
    });
    const pdfFileModel = new FileModel({
        'name': browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
        'location': browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_location
github Alfresco / alfresco-ng2-components / e2e / search / components / search-text.e2e.ts View on Github external
beforeAll(async () => {

        this.alfrescoJsApi = new AlfrescoApi({
            provider: 'ECM',
            hostEcm: browser.params.testConfig.adf_acs.host
        });

        await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);

        await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);

        await this.alfrescoJsApi.login(acsUser.id, acsUser.password);

        await this.alfrescoJsApi.nodes.addNode('-my-', {
            'name': newFolderModel.name,
            'nodeType': 'cm:folder',
            'properties':
                {
                    'cm:description': newFolderModel.description