Search in sources :

Example 1 with ListWebModulesDatabaseAction

use of org.bimserver.database.actions.ListWebModulesDatabaseAction in project BIMserver by opensourceBIM.

the class PluginServiceImpl method listAllWebModules.

@Override
public List<SWebModulePluginConfiguration> listAllWebModules() throws ServerException, UserException {
    requireAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        List<SWebModulePluginConfiguration> list = getBimServer().getSConverter().convertToSListWebModulePluginConfiguration(session.executeAndCommitAction(new ListWebModulesDatabaseAction(session, getInternalAccessMethod())));
        Collections.sort(list, new Comparator<SWebModulePluginConfiguration>() {

            @Override
            public int compare(SWebModulePluginConfiguration o1, SWebModulePluginConfiguration o2) {
                return o1.getName().compareTo(o2.getName());
            }
        });
        return list;
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : DatabaseSession(org.bimserver.database.DatabaseSession) SWebModulePluginConfiguration(org.bimserver.interfaces.objects.SWebModulePluginConfiguration) ListWebModulesDatabaseAction(org.bimserver.database.actions.ListWebModulesDatabaseAction) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) UserException(org.bimserver.shared.exceptions.UserException)

Aggregations

IOException (java.io.IOException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 ListWebModulesDatabaseAction (org.bimserver.database.actions.ListWebModulesDatabaseAction)1 SWebModulePluginConfiguration (org.bimserver.interfaces.objects.SWebModulePluginConfiguration)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1