use of org.bimserver.shared.exceptions.UserException in project BIMserver by opensourceBIM.
the class ServiceImpl method deleteProject.
@Override
public Boolean deleteProject(Long poid) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Boolean> action = new DeleteProjectDatabaseAction(getBimServer(), session, getInternalAccessMethod(), poid, getAuthorization());
return session.executeAndCommitAction(action);
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.shared.exceptions.UserException in project BIMserver by opensourceBIM.
the class ServiceImpl method getAllModelCheckersOfProject.
@Override
public List<SModelCheckerInstance> getAllModelCheckersOfProject(Long poid) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
Project project = session.get(poid, OldQuery.getDefault());
return getBimServer().getSConverter().convertToSListModelCheckerInstance(project.getModelCheckers());
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.shared.exceptions.UserException in project BIMserver by opensourceBIM.
the class ServiceImpl method removeNewServiceFromProject.
@Override
public void removeNewServiceFromProject(Long poid, Long serviceOid) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Boolean> action = new RemoveNewServiceFromProjectDatabaseAction(getBimServer(), session, getInternalAccessMethod(), serviceOid, poid, getAuthorization());
session.executeAndCommitAction(action);
} catch (Exception e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.shared.exceptions.UserException in project BIMserver by opensourceBIM.
the class ServiceImpl method addProjectAsSubProject.
@Override
public SProject addProjectAsSubProject(String projectName, Long parentPoid, String schema) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Project> action = new AddProjectDatabaseAction(getBimServer(), session, getInternalAccessMethod(), projectName, parentPoid, schema, getAuthorization());
return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.shared.exceptions.UserException in project BIMserver by opensourceBIM.
the class ServiceImpl method getAllServicesOfProject.
@Override
public List<org.bimserver.interfaces.objects.SService> getAllServicesOfProject(Long poid) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Set<org.bimserver.models.store.Service>> action = new GetAllServicesOfProjectDatabaseAction(session, getInternalAccessMethod(), poid);
List<org.bimserver.interfaces.objects.SService> convertToSListRevision = getBimServer().getSConverter().convertToSListService(session.executeAndCommitAction(action));
Collections.sort(convertToSListRevision, new SServiceComparator());
return convertToSListRevision;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations