Package org.zanata.webtrans.shared.auth

Examples of org.zanata.webtrans.shared.auth.EditorClientId


        WorkspaceId workspaceId = action.getWorkspaceId();
        TranslationWorkspace workspace =
                translationWorkspaceManager.getOrRegisterWorkspace(workspaceId);
        String httpSessionId = getHttpSessionId();
        EditorClientId editorClientId =
                new EditorClientId(httpSessionId, generateEditorClientNum());
        workspace
                .addEditorClient(httpSessionId, editorClientId, person.getId());
        // Send EnterWorkspace event to clients
        EnterWorkspace event = new EnterWorkspace(editorClientId, person);
        workspace.publish(event);
View Full Code Here


        } else if (ServletContexts.instance().getRequest() != null) {

            String sessionId =
                    ServletContexts.instance().getRequest().getSession()
                            .getId();
            EditorClientId editorClientId = new EditorClientId(sessionId, -1);
            updated =
                    new TransUnitUpdated(updateInfo, editorClientId,
                            TransUnitUpdated.UpdateType.NonEditorSave);
        } else {
            updated =
                    new TransUnitUpdated(updateInfo, new EditorClientId(
                            "unknown", -1),
                            TransUnitUpdated.UpdateType.NonEditorSave);
        }
        if (Events.exists()) {
            Events.instance().raiseTransactionSuccessEvent(
View Full Code Here

        userManager.getUserActivityScheduler().addTimeoutListener(
                new UserTimeoutListener() {
                    @Override
                    public void onTimeout(UserInfo userInfo) {
                        String connectionId = userInfo.getUserId();
                        EditorClientId editorClientId =
                                connectionIdToEditorClientId
                                        .remove(connectionId);
                        if (editorClientId != null) {
                            log.info(
                                    "Timeout for GWTEventService connectionId {}; removing EditorClientId {} from workspace {}",
View Full Code Here

        addTranslator(event.getEditorClientId(), event.getPerson(), null, panel);
    }

    @Override
    public void onExitWorkspace(ExitWorkspaceEvent event) {
        EditorClientId editorClientId = event.getEditorClientId();
        UserPanelSessionItem item = getUserPanel(editorClientId);
        removeUser(editorClientId);

        workspaceUsersPresenter.removeUser(item.getPanel(), event.getPerson()
                .getId().toString());
View Full Code Here

    public void initUserList(
            Map<EditorClientId, PersonSessionDetails> translatorList) {
        for (Map.Entry<EditorClientId, PersonSessionDetails> entry : translatorList
                .entrySet()) {
            EditorClientId editorClientId = entry.getKey();
            PersonSessionDetails personSessionDetails = entry.getValue();
            HasManageUserPanel panel =
                    workspaceUsersPresenter.addNewUser(personSessionDetails
                            .getPerson());
            addTranslator(editorClientId, personSessionDetails.getPerson(),
View Full Code Here

    public void updateTranslator(TargetContentsDisplay display,
            TransUnitId currentTransUnitId) {
        for (Map.Entry<EditorClientId, UserPanelSessionItem> entry : sessionService
                .getUserSessionMap().entrySet()) {
            EditorClientId editorClientId = entry.getKey();
            UserPanelSessionItem panelSessionItem = entry.getValue();
            if (panelSessionItem.getSelectedId() != null) {
                updateEditorTranslatorList(display,
                        panelSessionItem.getSelectedId(),
                        panelSessionItem.getPerson(), editorClientId,
View Full Code Here

    @Test
    public void testExecute() throws Exception {
        GetTranslatorList action = GetTranslatorList.ACTION;
        WorkspaceId workspaceId = TestFixture.workspaceId();
        Person person = TestFixture.person();
        EditorClientId editorClientId = new EditorClientId("sid", 1);
        action.setWorkspaceId(workspaceId);
        when(translationWorkspaceManager.getOrRegisterWorkspace(workspaceId))
                .thenReturn(translationWorkspace);
        users.put(editorClientId, new PersonSessionDetails(person, null));
        when(translationWorkspace.getUsers()).thenReturn(users);
View Full Code Here

        Log.info("ENTER DummyGetTranslatorListCommand.execute()");

        HashMap<EditorClientId, PersonSessionDetails> translator =
                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"),
View Full Code Here

                        "Translator"), new HashMap<String, String>(),
                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 =
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

TOP

Related Classes of org.zanata.webtrans.shared.auth.EditorClientId

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.