Package org.zanata.webtrans.shared.model

Examples of org.zanata.webtrans.shared.model.UserWorkspaceContext


        Identity identity = new Identity(editorClientId, person);
        workspace.getWorkspaceContext().getWorkspaceId()
                .getProjectIterationId()
                .setProjectType(projectIteration.getProjectType());
        UserWorkspaceContext userWorkspaceContext =
                new UserWorkspaceContext(workspace.getWorkspaceContext(),
                        workspaceRestrictions);
        return new ActivateWorkspaceResult(userWorkspaceContext, identity,
                loadOptsRes.getConfiguration(),
                validationRulesResult.getValidationRules());
    }
View Full Code Here


        WorkspaceContext context =
                new WorkspaceContext(action.getWorkspaceId(),
                        "Dummy Workspace", "Mock Sweedish");
        WorkspaceRestrictions workspaceRestrictions =
                new WorkspaceRestrictions(true, true, true, true, true);
        UserWorkspaceContext userWorkspaceContext =
                new UserWorkspaceContext(context, workspaceRestrictions);
        userWorkspaceContext.setSelectedDoc(new DocumentInfo(new DocumentId(
                new Long(1), "Dummy path/Dummy doc"), "Dummy doc",
                "Dummy path", LocaleId.EN_US, null, new AuditInfo(new Date(),
                        "Translator"), new HashMap<String, String>(),
                new AuditInfo(new Date(), "last translator")));
View Full Code Here

        ProjectIterationId projectIterationId =
                new ProjectIterationId(projectSlug, iterationSlug, projectType);
        WorkspaceRestrictions workspaceRestrictions =
                new WorkspaceRestrictions(projectActive, hasWriteAccess, true,
                        true, true);
        return new UserWorkspaceContext(new WorkspaceContext(new WorkspaceId(
                projectIterationId, LocaleId.EN_US), "workspaceName",
                LocaleId.EN_US.getId()), workspaceRestrictions);
    }
View Full Code Here

    public static UserWorkspaceContext userWorkspaceContext(
            boolean projectActive, boolean hasWriteAccess) {
        WorkspaceRestrictions workspaceRestrictions =
                new WorkspaceRestrictions(projectActive, hasWriteAccess, true,
                        true, true);
        return new UserWorkspaceContext(new WorkspaceContext(workspaceId(),
                "workspaceName", LocaleId.EN_US.getId()), workspaceRestrictions);
    }
View Full Code Here

        Identity userIdentity = result.getIdentity();
        assertThat(userIdentity.getPerson(), Matchers.equalTo(person));
        assertThat(userIdentity.getEditorClientId(),
                Matchers.equalTo(editorClientId));

        UserWorkspaceContext userWorkspaceContext =
                result.getUserWorkspaceContext();
        assertThat(userWorkspaceContext.getWorkspaceRestrictions()
                .isHasGlossaryUpdateAccess(), Matchers.equalTo(true));
        assertThat(userWorkspaceContext.getWorkspaceRestrictions()
                .isProjectActive(), Matchers.equalTo(true));
        assertThat(userWorkspaceContext.getWorkspaceRestrictions()
                .isHasEditTranslationAccess(), Matchers.equalTo(true));

        assertThat(result.getStoredUserConfiguration(),
                Matchers.sameInstance(optionsResult.getConfiguration()));
    }
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.model.UserWorkspaceContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.