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

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


* Date: 06/11/2013
*/
public class ChangeEmailAddressPresenter {

    public void changeEmail() {
        final UserId userId = Application.get().getUserId();
        if(userId.isGuest()) {
            MessageBox.showAlert("You must be logged in to change your email address");
            return;
        }
        ProgressMonitor.get().showProgressMonitor("Retrieving email address", "Please wait.");
        DispatchServiceManager.get().execute(new GetEmailAddressAction(userId), new AbstractWebProtegeAsyncCallback<GetEmailAddressResult>() {
View Full Code Here


            }
        });
    }

    private void showDialog(Optional<EmailAddress> emailAddress) {
        final UserId userId = Application.get().getUserId();
        ChangeEmailAddressDialogController controller = new ChangeEmailAddressDialogController();
        if (emailAddress.isPresent()) {
            controller.setValue(emailAddress.get());
        }
        controller.setDialogButtonHandler(DialogButton.OK, new WebProtegeDialogButtonHandler<Optional<EmailAddress>>() {
View Full Code Here

        return NullValidator.get();
    }

    @Override
    public GetAvailableProjectsResult execute(GetAvailableProjectsAction action, ExecutionContext executionContext) {
        UserId userId = executionContext.getUserId();
        MetaProjectManager mpm = MetaProjectManager.getManager();
        List<ProjectDetails> details = mpm.getListableReadableProjects(userId);
        Collections.sort(details);
        return new GetAvailableProjectsResult(details);
    }
View Full Code Here

        return NullValidator.get();
    }

    @Override
    public GetCurrentUserInSessionResult execute(GetCurrentUserInSessionAction action, ExecutionContext executionContext) {
        UserId userId = executionContext.getUserId();
        final UserDetails userDetails;
        final Set<GroupId> groups = new HashSet<GroupId>();
        if(userId.isGuest()) {
            userDetails = UserDetails.getGuestUserDetails();
        }
        else {
            final MetaProject metaProject = MetaProjectManager.getManager().getMetaProject();
            User user = metaProject.getUser(userId.getUserName());
            for(Group group : user.getGroups()) {
                groups.add(GroupId.get(group.getName()));
            }
            userDetails = UserDetails.getUserDetails(userId, userId.getUserName(), Optional.fromNullable(user.getEmail()));
        }

        return new GetCurrentUserInSessionResult(userDetails, groups);
    }
View Full Code Here



    private void convertToNotes(OWLAPINotesManager notesManager, CHAONoteData noteData, OWLEntity entity) {
        NoteContent content = NoteContent.builder().setSubject(noteData.getSubject()).setBody(noteData.getBody()).setNoteType(NoteType.COMMENT).build();
        final UserId author = UserId.getUserId(noteData.getAuthor());
        Note note = notesManager.addNoteToEntity(entity, content, author, noteData.getTimestamp());
        for(CHAONoteData reply : noteData.getReplies()) {
            convertToNotes(notesManager, reply, note.getNoteId());
        }
View Full Code Here

     * @param operationDescription A high level description of the change.
     * @return EntityData corresponding to the renamed entity.
     */
    public EntityData renameEntity(String projectName, String oldName, String newName, String user, String operationDescription) {
        OWLAPIProject project = getProject(projectName);
        UserId userId = getUserId(user);
        applyChanges(new RenameEntityChangeFactory(project, userId, operationDescription, oldName, newName));
        return getEntity(projectName, newName);

    }
View Full Code Here

    }

    public List<EntityData> moveCls(String projectName, String clsName, String oldParentName, String newParentName, boolean checkForCycles, String user, String operationDescription) {
        // Why check for cycles here and nowhere else?
        OWLAPIProject project = getProject(projectName);
        UserId userId = getUserId(user);
        MoveClassChangeFactory cf = new MoveClassChangeFactory(project, userId, operationDescription, clsName, oldParentName, newParentName, checkForCycles);
        applyChanges(cf);
        // Not sure what this is meant to return - the other impl returns null - return null.  Confirmation from Csongor null idicates no cycles.
        return null;
    }
View Full Code Here

        /// ????
        return "Parents HTML";
    }

    public List<Triple> getRelatedProperties(String projectName, String className) {
        UserId userId = getUserId();
        GetRelatedPropertiesStrategy strategy = new GetRelatedPropertiesStrategy(getProject(projectName), userId, className);
        return strategy.execute();
    }
View Full Code Here

    }


    public EntityData createInstance(String projectName, String instName, String typeName, String user, String operationDescription) {
        OWLAPIProject project = getProject(projectName);
        UserId userId = getUserId(user);
        applyChanges(new CreateInstanceChangeFactory(project, userId, operationDescription, instName, typeName));
        return getRenderingManager(projectName).getEntityData(instName, EntityType.NAMED_INDIVIDUAL);
    }
View Full Code Here

        return getRenderingManager(projectName).getEntityData(instName, EntityType.NAMED_INDIVIDUAL);
    }

    public EntityData createInstanceValue(String projectName, String instName, String typeName, String subjectEntity, String propertyEntity, String user, String operationDescription) {
        OWLAPIProject project = getProject(projectName);
        UserId userId = getUserId(user);
        if(instName == null) {
            // Not surprisingly it can be
            instName = "http://protege.stanford.edu/named-individuals/Individual-" + UUID.randomUUID().toString();
        }
        applyChanges(new CreateInstanceValueChangeFactory(project, userId, operationDescription, instName, typeName, subjectEntity, propertyEntity));
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.