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

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


    private DispatchServiceHandler executor = new DefaultDispatchServiceExecutor();

    @Override
    public DispatchServiceResultContainer executeAction(Action action) throws ActionExecutionException, PermissionDeniedException {
        UserId userId = getUserInSession();
        HttpServletRequest request = getThreadLocalRequest();
        HttpSession session = request.getSession();
        final RequestContext requestContext = new RequestContext(userId, session);
        final ExecutionContext executionContext = new ExecutionContext(userId);
        return executor.execute(action, requestContext, executionContext);
View Full Code Here


    }


    private void updateStatus() {
        noteHeaderView.setStatus(Optional.of(currentNoteStatus));
        final UserId userId = Application.get().getUserId();
        noteHeaderView.setResolveOptionVisible(!userId.isGuest() && userId.equals(note.getAuthor()));
    }
View Full Code Here

                    watch = new EntityFrameWatch(entity);
                }
                else {
                    watch = new HierarchyBranchWatch(entity);
                }
                final UserId userId = UserId.getUserId(userName);
                if(opName.equals(Operation.ADD.name())) {
                    insertWatch(watch, userId);
                }
                else {
                    uninsertWatch(watch, userId);
View Full Code Here

    public NoteActionPresenter(NoteActionView noteActionView) {
        this.view = noteActionView;
    }

    public void setNote(Note note, DiscussionThread context) {
        UserId userId = Application.get().getUserId();
        view.setReplyToNoteHandler(new ReplyToNoteHandlerImpl(note.getNoteId()));
        view.setCanReply(!userId.isGuest());
        view.setDeleteNoteHandler(new DeleteNoteHandlerImpl(note.getNoteId()));
        view.setCanDelete(!context.hasReplies(note.getNoteId()) && note.getAuthor().equals(userId));
    }
View Full Code Here

                }
                OpenIdServiceManager.getInstance().isOpenIdInSessForAddNewOpenId(new AsyncCallback<UserData>() {

                    public void onSuccess(UserData userData) {
                        if (!userData.getUserId().isGuest()) { //open id URL is already associated
                            UserId userId = userData.getUserId();
                            MessageBox.alert("Open Id already associated with WebProtege user '" + userId.getUserName() + "'.");
                            timer.cancel();
                        }
                        else { // associate open id to current user
                            UserId name = Application.get().getUserId();

                            OpenIdServiceManager.getInstance().assocNewOpenIdToUser(name.getUserName(), new AsyncCallback<OpenIdData>() {

                                public void onSuccess(OpenIdData result) {
                                    OpenIdUtil opIdUtil = new OpenIdUtil();
                                    opIdUtil.displayUsersOpenIdList(result, editProfileTable, win, true, windowBaseHt);
                                }
View Full Code Here

    private boolean isAuthenticateWithOpenId() {
        return WebProtegeProperties.get().isOpenIdAuthenticationEnabled();
    }

    public UserData validateUserAndAddInSession(String name, String password) {
        UserId userId = UserId.getUserId(name);

        HttpServletRequest request = this.getThreadLocalRequest();
        HttpSession session = request.getSession();
        session.setAttribute(AuthenticationConstants.LOGIN_METHOD, AuthenticationConstants.LOGIN_METHOD_WEBPROTEGE_ACCOUNT);
View Full Code Here

    }

    public Note parseNoteFromOntology(NoteId noteId) throws MalformedNoteException {
        NoteId inReplyToId = parseInReplyToIdFromOntology(noteId);
        long createdAt = parseCreatedAtFromOntology(noteId);
        UserId authoredBy = parseAuthoredByFromOntology(noteId);
        NoteType noteType = parseNoteTypeFromOntology(noteId);
        Optional<String> subject = parseSubjectFromOntology(noteId);
        String body = parseBodyFromOntology(noteId);
        return Note.createNote(noteId, Optional.fromNullable(inReplyToId), createdAt, authoredBy, noteType, subject, body);
    }
View Full Code Here

    public void setLastModifiedBy(ProjectId projectId, UserId userId) {
//        setPropertyValue(projectId, LAST_MODIFIED_BY_PROPERTY_NAME, userId.getUserName());
    }

    public List<UserId> getOwners(ProjectId projectId) {
        final UserId userId = getOwner(projectId);
        return Arrays.asList(userId);
    }
View Full Code Here

    }

    public ProjectDetails getProjectDetails(ProjectId projectId) {
        String displayName = getDisplayName(projectId);
        String description = getDescription(projectId);
        UserId owner = getOwner(projectId);
        boolean inTrash = isInTrash(projectId);
        return new ProjectDetails(projectId, displayName, description, owner, inTrash);
    }
View Full Code Here

    private Map<SharingSetting, Set<User>> createUsersBySharingSettingMap(HttpServletRequest request, ProjectSharingSettings projectSharingSettings, MetaProject metaProject) {
        Map<SharingSetting, Set<User>> usersBySharingSetting = createSharingSettingMap();

        for (UserSharingSetting userSharingSetting : projectSharingSettings.getSharingSettings()) {
            UserId userId = userSharingSetting.getUserId();
            if (!userId.isGuest()) {
                User user = getUserFromUserId(metaProject, userId);
                if (user != null) {
                    usersBySharingSetting.get(userSharingSetting.getSharingSetting()).add(user);
                }
                else {
                    if(userId.getUserName().contains("@")) {
                        // Assume it's an email invitation
                        sendEmailInvitation(request, projectSharingSettings, userSharingSetting);
                        User freshUser = getUserFromUserId(metaProject, userId);
                        usersBySharingSetting.get(userSharingSetting.getSharingSetting()).add(freshUser);
                    }
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.