Package edu.stanford.bmir.protege.web.client.rpc.data

Examples of edu.stanford.bmir.protege.web.client.rpc.data.SharingSetting


        MetaProject metaProject = mpm.getMetaProject();
        ProjectInstance projectInstance = metaProject.getProject(projectId.getId());
        Set<GroupOperation> groupOperations = projectInstance.getAllowedGroupOperations();
        List<UserSharingSetting> result = new ArrayList<UserSharingSetting>();
        Set<User> usersWithPermissionsOnProject = new HashSet<User>();
        SharingSetting defaultSharingSetting = SharingSetting.getDefaultSharingSetting();
        for (GroupOperation groupOperation : groupOperations) {
            if (!isWorld(groupOperation.getAllowedGroup())) {
                usersWithPermissionsOnProject.addAll(groupOperation.getAllowedGroup().getMembers());
            }
            else {
                defaultSharingSetting = getSharingSettingFromOperations(groupOperation.getAllowedOperations());
            }
        }
        for (User user : usersWithPermissionsOnProject) {
            Collection<Operation> operations = mpm.getAllowedOperations(projectId.getId(), user.getName());
            SharingSetting sharingSetting = getSharingSettingFromOperations(operations);
            UserSharingSetting userSharingSetting = new UserSharingSetting(UserId.getUserId(user.getName()), sharingSetting);
            result.add(userSharingSetting);
        }
        Collections.sort(result);
View Full Code Here


        return new ProjectSharingSettings(projectId, defaultSharingSetting, result);
    }

    private SharingSetting getSharingSettingFromOperations(Collection<Operation> operations) {
        SharingSetting sharingSetting;
        if (isWriteable(operations)) {
            sharingSetting = SharingSetting.EDIT;
        }
        else if (isCommentable(operations)) {
            sharingSetting = SharingSetting.COMMENT;
View Full Code Here

        AccessPolicyManager.get().createTemporaryAccountForInvitation(projectSharingSettings.getProjectId(), baseURL, invitations);
    }

    private void getWorldAllowedOperations(ProjectSharingSettings projectSharingSettings, MetaProject metaProject, Set<GroupOperation> allowedGroupOperations) {
        SharingSetting defaultSharingSetting = projectSharingSettings.getDefaultSharingSetting();
        Group worldGroup = getOrCreateGroup(metaProject, WORLD_GROUP_NAME);
        GroupOperation worldGroupOperation = metaProject.createGroupOperation();
        worldGroupOperation.setAllowedGroup(worldGroup);
        worldGroupOperation.setAllowedOperations(getOperationsForSharingSetting(metaProject, defaultSharingSetting));
        allowedGroupOperations.add(worldGroupOperation);
View Full Code Here

    }


    public ProjectSharingSettings getSharingSettingsListData() {
        SharingSetting defaultSharingSetting = defaultSharingSettingPanel.getDefaultSharingSetting();
        List<UserSharingSetting> sharingSettings = sharingSettingsList.getListData();
        return new ProjectSharingSettings(projectId, defaultSharingSetting, sharingSettings);
    }
View Full Code Here

        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);
            }
        });
       
View Full Code Here

TOP

Related Classes of edu.stanford.bmir.protege.web.client.rpc.data.SharingSetting

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.