use of org.bimserver.database.actions.GetAllExtendedDataSchemasDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method getAllExtendedDataSchemas.
@Override
public List<SExtendedDataSchema> getAllExtendedDataSchemas() throws ServerException, UserException {
requireAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession(OperationType.READ_ONLY);
try {
List<SExtendedDataSchema> schemas = getBimServer().getSConverter().convertToSListExtendedDataSchema(session.executeAndCommitAction(new GetAllExtendedDataSchemasDatabaseAction(session, getInternalAccessMethod())));
Collections.sort(schemas, new Comparator<SExtendedDataSchema>() {
@Override
public int compare(SExtendedDataSchema o1, SExtendedDataSchema o2) {
return o1.getName().compareTo(o2.getName());
}
});
return schemas;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations