use of org.bimserver.interfaces.objects.SProjectSmall in project BIMserver by opensourceBIM.
the class GetAllProjectsSmallDatabaseAction method execute.
@Override
public List<SProjectSmall> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
List<SProjectSmall> list = new ArrayList<SProjectSmall>();
User user = getUserByUoid(authorization.getUoid());
IfcModelInterface model = getDatabaseSession().getAllOfType(StorePackage.eINSTANCE.getProject(), OldQuery.getDefault());
List<Project> projects = model.getAll(Project.class);
for (Project project : projects) {
if (project.getParent() == null && !project.getName().equals(Database.STORE_PROJECT_NAME)) {
Project rootProject = getRootProject(project);
addProjects(list, rootProject, user);
}
}
return list;
}
use of org.bimserver.interfaces.objects.SProjectSmall in project BIMserver by opensourceBIM.
the class GetAllRelatedProjectsDatabaseAction method execute.
@Override
public List<SProjectSmall> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
List<SProjectSmall> list = new ArrayList<SProjectSmall>();
Project project = getDatabaseSession().get(StorePackage.eINSTANCE.getProject(), poid, OldQuery.getDefault());
Project rootProject = getRootProject(project);
User user = getUserByUoid(authorization.getUoid());
addProjects(list, rootProject, user);
return list;
}
use of org.bimserver.interfaces.objects.SProjectSmall in project BIMserver by opensourceBIM.
the class GetAllProjectsSmallDatabaseAction method createSmallProject.
public static SProjectSmall createSmallProject(Authorization authorization, BimServer bimServer, Project project, User user) {
SProjectSmall small = new SProjectSmall();
small.setName(project.getName());
small.setOid(project.getOid());
small.setLastRevisionId(project.getLastRevision() == null ? -1 : project.getLastRevision().getOid());
small.setNrRevisions(project.getRevisions().size());
small.setSchema(project.getSchema());
small.setNrSubProjects(project.getSubProjects().size());
small.setHasCheckinRights(authorization.hasRightsOnProject(user, project));
small.setState(bimServer.getSConverter().convertToSObject(project.getState()));
small.setParentId(project.getParent() == null ? -1 : project.getParent().getOid());
return small;
}
Aggregations