Search in sources :

Example 1 with SWebModulePluginConfiguration

use of org.bimserver.interfaces.objects.SWebModulePluginConfiguration in project BIMserver by opensourceBIM.

the class PluginServiceImpl method getAllWebModules.

@Override
public List<SWebModulePluginConfiguration> getAllWebModules(Boolean onlyEnabled) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        EList<WebModulePluginConfiguration> webModules = getBimServer().getServerSettingsCache().getServerSettings().getWebModules();
        List<SWebModulePluginConfiguration> serializers = getBimServer().getSConverter().convertToSListWebModulePluginConfiguration(webModules);
        Collections.sort(serializers, new SPluginConfigurationComparator());
        return serializers;
    } catch (Exception e) {
        handleException(e);
    } finally {
        session.close();
    }
    return null;
}
Also used : SPluginConfigurationComparator(org.bimserver.webservices.SPluginConfigurationComparator) DatabaseSession(org.bimserver.database.DatabaseSession) WebModulePluginConfiguration(org.bimserver.models.store.WebModulePluginConfiguration) SWebModulePluginConfiguration(org.bimserver.interfaces.objects.SWebModulePluginConfiguration) SWebModulePluginConfiguration(org.bimserver.interfaces.objects.SWebModulePluginConfiguration) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) UserException(org.bimserver.shared.exceptions.UserException)

Example 2 with SWebModulePluginConfiguration

use of org.bimserver.interfaces.objects.SWebModulePluginConfiguration in project BIMserver by opensourceBIM.

the class PluginServiceImpl method getDefaultWebModule.

public SWebModulePluginConfiguration getDefaultWebModule() throws ServerException, UserException {
    requireRealUserAuthentication();
    WebModulePluginConfiguration defaultWebModule = getBimServer().getServerSettingsCache().getServerSettings().getWebModule();
    return getBimServer().getSConverter().convertToSObject(defaultWebModule);
}
Also used : WebModulePluginConfiguration(org.bimserver.models.store.WebModulePluginConfiguration) SWebModulePluginConfiguration(org.bimserver.interfaces.objects.SWebModulePluginConfiguration)

Example 3 with SWebModulePluginConfiguration

use of org.bimserver.interfaces.objects.SWebModulePluginConfiguration 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

SWebModulePluginConfiguration (org.bimserver.interfaces.objects.SWebModulePluginConfiguration)3 IOException (java.io.IOException)2 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)2 DatabaseSession (org.bimserver.database.DatabaseSession)2 WebModulePluginConfiguration (org.bimserver.models.store.WebModulePluginConfiguration)2 ServerException (org.bimserver.shared.exceptions.ServerException)2 UserException (org.bimserver.shared.exceptions.UserException)2 ListWebModulesDatabaseAction (org.bimserver.database.actions.ListWebModulesDatabaseAction)1 SPluginConfigurationComparator (org.bimserver.webservices.SPluginConfigurationComparator)1