Package edu.stanford.bmir.protege.web.shared.user

Examples of edu.stanford.bmir.protege.web.shared.user.UserId


        }
        return usersBySharingSetting;
    }

    private void sendEmailInvitation(HttpServletRequest request, ProjectSharingSettings projectSharingSettings, UserSharingSetting userSharingSetting) {
        UserId userId = userSharingSetting.getUserId();
        // Email invitation
        List<Invitation> invitations = new ArrayList<Invitation>();
        final Invitation invitation = new Invitation();
        invitation.setEmailId(userId.getUserName());
        invitation.setWriter(userSharingSetting.getSharingSetting() == SharingSetting.EDIT);
        invitations.add(invitation);
        String baseURL = request.getHeader("referer");

        AccessPolicyManager.get().createTemporaryAccountForInvitation(projectSharingSettings.getProjectId(), baseURL, invitations);
View Full Code Here


        view.setPostNewTopicHandler(new PostNewTopicHandlerImpl(Optional.fromNullable(currentTarget)));
    }

    public void setTarget(OWLEntity target) {
        currentTarget = target;
        UserId userId = Application.get().getUserId();
        view.setPostNewTopicEnabled(currentTarget != null && !userId.isGuest());
        view.setPostNewTopicHandler(new PostNewTopicHandlerImpl(Optional.fromNullable(currentTarget)));
        reload();
    }
View Full Code Here

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


    public Note getNoteForAnnotation(Annotation annotation, Optional<NoteId> inReplyTo) {
        UserId author = UserId.getUserId(annotation.getAuthor());
        String body = annotation.getBody() == null ? "" : annotation.getBody();
        long timestamp = annotation.getCreatedAt();
        Optional<String> subject = annotation.getSubject() == null ? Optional.<String>absent() : Optional.<String>of(annotation.getSubject());

        NoteId noteId = NoteId.createNoteIdFromLexicalForm(annotation.getId());
View Full Code Here

    private static ProjectDetails createProjectDetailsFromProjectInstance(ProjectInstance projectInstance) {
        final ProjectId projectId = ProjectId.get(projectInstance.getName());
        final String description = projectInstance.getDescription();
        final User projectOwner = projectInstance.getOwner();
        final UserId ownerId = projectOwner != null ? UserId.getUserId(projectOwner.getName()) : UserId.getGuest();
        final boolean inTrash = isInTrash(projectInstance);
        final Slot displayNameSlot = projectInstance.getProtegeInstance().getKnowledgeBase().getSlot("displayName");
        final String displayName = (String) projectInstance.getProtegeInstance().getOwnSlotValue(displayNameSlot);
        return new ProjectDetails(projectId, displayName, description, ownerId, inTrash);
    }
View Full Code Here

     */

    public PaginationData<ChangeData> getWatchedEntities(String projectName, String userName, int start, int limit, String sort, String dir) {
        OWLAPIProject project = getProject(projectName);
        OWLAPIChangeManager changeManager = project.getChangeManager();
        final UserId userId = UserId.getUserId(userName);
        Set<Watch<?>> watches = project.getWatchManager().getWatches(userId);
        List<ChangeData> data = changeManager.getChangeDataForWatches(watches);
        return PaginationServerUtil.pagedRecords(data, start, limit, sort, dir);
    }
View Full Code Here

    }

    private void addData(final UserSharingSetting listItem) {
        final int rowCount = flexTable.getRowCount();
        String userName = listItem.getUserId().getUserName();
        UserId userId = Application.get().getUserId();
        if (userName.equals(userId.getUserName())) {
            userName += " (you)";
        }
        flexTable.setText(rowCount, 0, userName);


        final SharingSettingsDropDown lb = new SharingSettingsDropDown();
        lb.setSelectedItem(listItem.getSharingSetting());
       
        lb.addValueChangeHandler(new ValueChangeHandler<SharingSetting>() {
            public void onValueChange(ValueChangeEvent<SharingSetting> valueChangeEvent) {
                SharingSetting value = valueChangeEvent.getValue();
                UserSharingSetting updatedType = new UserSharingSetting(listItem.getUserId(), value);
                displayedItems.set(rowCount, updatedType);
            }
        });
       
        flexTable.setWidget(rowCount, 1, lb);
        flexTable.getRowFormatter().addStyleName(rowCount, "web-protege-table-row");

        if (!userId.getUserName().equals(userName)) {
            DeleteButton deleteButton = new DeleteButton();
            deleteButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    displayedItems.remove(rowCount);
                    refill();
View Full Code Here

            }
        });
    }

    private void handleCreateNewProject(NewProjectInfo data) {
        UserId userId = Application.get().getUserId();
        if(userId.isGuest()) {
            throw new RuntimeException("User is guest.  Guest users are not allowed to create projects.");
        }
        NewProjectSettings newProjectSettings = new NewProjectSettings(userId, data.getProjectName(), data.getProjectDescription(), data.getProjectType());
        ProjectManagerServiceAsync projectManagerService = GWT.create(ProjectManagerService.class);
        projectManagerService.createNewProject(newProjectSettings, new AsyncCallback<ProjectDetails>() {
View Full Code Here

    }

    private void createProjectFromUpload(UploadFileInfo data, FileUploadResponse result) {
        UIUtil.showLoadProgessBar(PROGRESS_DIALOG_TITLE, "Creating project");
        ProjectManagerServiceAsync projectManagerService = GWT.create(ProjectManagerService.class);
        UserId userId = Application.get().getUserId();
        DocumentId documentId = result.getDocumentId();
        String projectName = data.getProjectSettings().getProjectName();
        String projectDescription = data.getProjectSettings().getProjectDescription();
        ProjectType projectType = data.getProjectSettings().getProjectType();
        NewProjectSettings newProjectSettings = new NewProjectSettings(userId, projectName, projectDescription, projectType, documentId);
View Full Code Here

        new GetEmailAddressAction(UserId.getGuest());
    }

    @Test
    public void getUserIdReturnsSuppliedUserId() {
        UserId userId = MockingUtils.mockUserId();
        GetEmailAddressAction action = new GetEmailAddressAction(userId);
        assertEquals(userId, action.getUserId());
    }
View Full Code Here

        assertEquals(userId, action.getUserId());
    }

    @Test
    public void equalsReturnsTrueForSameUserId() {
        UserId userId = MockingUtils.mockUserId();
        GetEmailAddressAction actionA = new GetEmailAddressAction(userId);
        GetEmailAddressAction actionB = new GetEmailAddressAction(userId);
        assertEquals(actionA, actionB);
    }
View Full Code Here

TOP

Related Classes of edu.stanford.bmir.protege.web.shared.user.UserId

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.