Package org.zanata.webtrans.shared.model

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


    protected Person retrievePerson() {
        HAccount authenticatedAccount =
                (HAccount) Contexts.getSessionContext().get(
                        JpaIdentityStore.AUTHENTICATED_USER);
        return new Person(new PersonId(authenticatedAccount.getUsername()),
                authenticatedAccount.getPerson().getName(),
                gravatarServiceImpl.getUserImageUrl(16, authenticatedAccount
                        .getPerson().getEmail()));
    }
View Full Code Here


        // Use AccountDAO to convert the PersonId to Person
        Map<EditorClientId, PersonSessionDetails> translators =
                new HashMap<EditorClientId, PersonSessionDetails>();
        for (Map.Entry<EditorClientId, PersonSessionDetails> entry : result
                .entrySet()) {
            PersonId personId = entry.getValue().getPerson().getId();

            HPerson person =
                    accountDAO.getByUsername(personId.toString()).getPerson();

            Person translator =
                    new Person(personId, person.getName(),
                            gravatarServiceImpl.getUserImageUrl(16,
                                    person.getEmail()));
View Full Code Here

                        new Object[] { username, editorClientId,
                                workspace.getWorkspaceContext() });
                // Send GWT Event to client to update the userlist
                ExitWorkspace event =
                        new ExitWorkspace(editorClientId, new Person(
                                new PersonId(username), personName,
                                getGravatarService().getUserImageUrl(16,
                                        personEmail)));
                workspace.publish(event);
            }
        }
View Full Code Here

                new HashMap<EditorClientId, PersonSessionDetails>();
        translator
                .put(new EditorClientId("dummySession", 1),
                        new PersonSessionDetails(
                                new Person(
                                        new PersonId("personID"),
                                        "Some Person with an Incredibly Long Name",
                                        "http://www.gravatar.com/avatar/longname@zanata.org?d=mm&s=16"),
                                null));
        callback.onSuccess(new GetTranslatorListResult(translator, translator
                .size()));
View Full Code Here

    @BeforeMethod
    public void beforeMethod() {
        MockitoAnnotations.initMocks(this);
        identity =
                new Identity(new EditorClientId("sessionId", 1), new Person(
                        new PersonId("pid"), "name", "url"));
        service = new TranslatorInteractionService(identity, dispatcher);
    }
View Full Code Here

                new AuditInfo(new Date(), "last translator")));

        Identity identity =
                new Identity(
                        new EditorClientId("123456", 1),
                        new Person(new PersonId("bob"), "Bob The Builder",
                                "http://www.gravatar.com/avatar/bob@zanata.org?d=mm&s=16"));

        ValidationFactory validationFactory = new ValidationFactory(null);
        Map<ValidationId, ValidationAction> validationMap =
                validationFactory.getAllValidationActions();
View Full Code Here

        return new WorkspaceId(new ProjectIterationId(projectSlug,
                iterationSlug, projectType), localeId);
    }

    public static Person person() {
        return new Person(new PersonId("pid"), "admin", null);
    }
View Full Code Here

    }

    @Test
    public void canGetUsers() {
        EditorClientId editorClientId = new EditorClientId("sessionId", 1);
        PersonId personId = new PersonId("personId");
        translationWorkspace.addEditorClient("sessionId", editorClientId,
                personId);

        Map<EditorClientId, PersonSessionDetails> users =
                translationWorkspace.getUsers();
View Full Code Here

    }

    @Test
    public void canRemoveClient() {
        EditorClientId editorClientId = new EditorClientId("sessionId", 1);
        PersonId personId = new PersonId("personId");
        translationWorkspace.addEditorClient("sessionId", editorClientId,
                personId);
        assertThat(translationWorkspace.getUsers(),
                Matchers.hasKey(editorClientId));
View Full Code Here

    public void canRemoveClientsWithSameSessionId() {
        // Given: 2 client share same http session id
        String httpSessionId = "sessionId";
        EditorClientId editorClientId1 = new EditorClientId(httpSessionId, 1);
        EditorClientId editorClientId2 = new EditorClientId(httpSessionId, 2);
        PersonId personId = new PersonId("personId");
        translationWorkspace.addEditorClient(httpSessionId, editorClientId1,
                personId);
        translationWorkspace.addEditorClient(httpSessionId, editorClientId2,
                personId);
        assertThat(translationWorkspace.getUsers().keySet(),
View Full Code Here

TOP

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

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.