Package edu.stanford.smi.protege.server.metaproject

Examples of edu.stanford.smi.protege.server.metaproject.MetaProject


*/
public class UserProfileManagerServiceImpl extends WebProtegeRemoteServiceServlet implements UserProfileManagerService {

    public List<UserId> getUserIds() {
        MetaProjectManager mpm = MetaProjectManager.getManager();
        MetaProject mp = mpm.getMetaProject();
        List<UserId> result = new ArrayList<UserId>();
        for(User user : mp.getUsers()) {
            result.add(UserId.getUserId(user.getName()));
        }
        return result;
    }
View Full Code Here


        Log.getLogger(WebProtegeInitializer.class).info("WebProtege cleanly disposed");
    }


    private void warmupMetaProject() {
        MetaProject metaProject = LocalMetaProjectManager.getManager().getMetaProject();
        Set<ProjectInstance> projectInstances = metaProject.getProjects();
        int projectInstanceCount = projectInstances.size();
        WebProtegeLoggerManager.get(WebProtegeInitializer.class).info("Loaded meta-project.  There are %d project instances.", projectInstanceCount);
    }
View Full Code Here

        UserId userId = getUserInSession();
        if (userId.isGuest()) {
            return false;
        }
        MetaProjectManager mpm = getMetaProjectManager();
        MetaProject metaProject = mpm.getMetaProject();
        ProjectInstance project = metaProject.getProject(projectId.getId());
        if (project == null) {
            return false;
        }
        User owner = project.getOwner();
        return owner != null && userId.getUserName().equals(owner.getName());
View Full Code Here

        UserId userId = getUserInSession();
        if (userId.isGuest()) {
            return false;
        }
        MetaProjectManager mpm = getMetaProjectManager();
        MetaProject metaProject = mpm.getMetaProject();
        User user = metaProject.getUser(userId.getUserName());
        if (user == null) {
            return false;
        }
        for (Group group : user.getGroups()) {
            if (OntologyShareAccessConstants.ADMIN_GROUP.equals(group.getName())) {
View Full Code Here

    }

    public synchronized List<String> getProjectNames() {
        List<String> result = new ArrayList<String>();
        MetaProjectManager mpm = getMetaProjectManager();
        MetaProject mp = mpm.getMetaProject();
        for (ProjectInstance instance : mp.getProjects()) {
            String projectName = instance.getName();
            result.add(projectName);
        }
        return result;
    }
View Full Code Here

        if(userId.isGuest()) {
            return Collections.emptyList();
        }
        List<String> result = new ArrayList<String>();
        MetaProjectManager mpm = getMetaProjectManager();
        MetaProject mp = mpm.getMetaProject();
        for (ProjectInstance instance : mp.getProjects()) {
            User owner = instance.getOwner();
            if(owner != null && userId.getUserName().equals(owner.getName())) {
                String projectName = instance.getName();
                result.add(projectName);
            }
View Full Code Here

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

    protected boolean isUserAdmin(UserId userId) {
        if(userId.isGuest()) {
            return false;
        }
        MetaProjectManager mpm = MetaProjectManager.getManager();
        MetaProject metaProject = mpm.getMetaProject();
        User user = metaProject.getUser(userId.getUserName());
        if(user == null) {
            return false;
        }
        for(Group group : user.getGroups()) {
            if(OntologyShareAccessConstants.ADMIN_GROUP.equals(group.getName())) {
View Full Code Here

    // ProjectData
   
    public synchronized Set<ProjectId> getProjects() {
        try {
            READ_LOCK.lock();
            MetaProject metaProject = getMetaProject();
            Set<ProjectInstance> projectInstances = metaProject.getProjects();
            Set<ProjectId> result = new HashSet<ProjectId>(projectInstances.size());
            for(ProjectInstance pi : projectInstances) {
                String projectName = pi.getName();
                result.add(ProjectId.get(projectName));
            }
View Full Code Here

    private void setPropertyValue(ProjectId projectId, String propertyName, String propertyValue) {
        try {
            WRITE_LOCK.lock();
            ProjectInstance pi = getProjectInstance(projectId);
            MetaProject mp = getMetaProject();
            PropertyValue pv = mp.createPropertyValue(propertyName, propertyValue);
            Set<PropertyValue> propertyValues = new HashSet<PropertyValue>(pi.getPropertyValues());
            for(Iterator<PropertyValue> it = propertyValues.iterator(); it.hasNext(); ) {
                PropertyValue curPv = it.next();
                if(curPv.getPropertyName().equals(propertyName)) {
                    it.remove();
View Full Code Here

TOP

Related Classes of edu.stanford.smi.protege.server.metaproject.MetaProject

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.