Search in sources :

Example 1 with SObjectDefinition

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

the class PluginServiceImpl method getPluginObjectDefinition.

@Override
public SObjectDefinition getPluginObjectDefinition(Long oid) throws ServerException, UserException {
    if (oid == -1) {
        return null;
    }
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        PluginDescriptor pluginDescriptor = session.get(oid, OldQuery.getDefault());
        if (pluginDescriptor == null) {
            throw new UserException("No PluginDescriptor found with oid " + oid);
        }
        Plugin plugin = getBimServer().getPluginManager().getPlugin(pluginDescriptor.getPluginClassName(), false);
        if (plugin == null) {
            throw new UserException("No plugin with class name " + pluginDescriptor.getPluginClassName() + " found");
        }
        ObjectDefinition settingsDefinition = plugin.getSettingsDefinition();
        return getBimServer().getSConverter().convertToSObject(settingsDefinition);
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : SObjectIDMPluginDescriptor(org.bimserver.interfaces.objects.SObjectIDMPluginDescriptor) PluginDescriptor(org.bimserver.models.store.PluginDescriptor) SPluginDescriptor(org.bimserver.interfaces.objects.SPluginDescriptor) DatabaseSession(org.bimserver.database.DatabaseSession) SObjectDefinition(org.bimserver.interfaces.objects.SObjectDefinition) ObjectDefinition(org.bimserver.models.store.ObjectDefinition) UserException(org.bimserver.shared.exceptions.UserException) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) UserException(org.bimserver.shared.exceptions.UserException) ModelCheckerPlugin(org.bimserver.plugins.modelchecker.ModelCheckerPlugin) StreamingDeserializerPlugin(org.bimserver.plugins.deserializers.StreamingDeserializerPlugin) ModelComparePlugin(org.bimserver.plugins.modelcompare.ModelComparePlugin) ObjectIDMPlugin(org.bimserver.plugins.objectidms.ObjectIDMPlugin) DeserializerPlugin(org.bimserver.plugins.deserializers.DeserializerPlugin) ServicePlugin(org.bimserver.plugins.services.ServicePlugin) WebModulePlugin(org.bimserver.plugins.web.WebModulePlugin) RenderEnginePlugin(org.bimserver.plugins.renderengine.RenderEnginePlugin) StreamingSerializerPlugin(org.bimserver.plugins.serializers.StreamingSerializerPlugin) SerializerPlugin(org.bimserver.plugins.serializers.SerializerPlugin) QueryEnginePlugin(org.bimserver.plugins.queryengine.QueryEnginePlugin) ModelMergerPlugin(org.bimserver.plugins.modelmerger.ModelMergerPlugin) Plugin(org.bimserver.plugins.Plugin)

Aggregations

IOException (java.io.IOException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 SObjectDefinition (org.bimserver.interfaces.objects.SObjectDefinition)1 SObjectIDMPluginDescriptor (org.bimserver.interfaces.objects.SObjectIDMPluginDescriptor)1 SPluginDescriptor (org.bimserver.interfaces.objects.SPluginDescriptor)1 ObjectDefinition (org.bimserver.models.store.ObjectDefinition)1 PluginDescriptor (org.bimserver.models.store.PluginDescriptor)1 Plugin (org.bimserver.plugins.Plugin)1 DeserializerPlugin (org.bimserver.plugins.deserializers.DeserializerPlugin)1 StreamingDeserializerPlugin (org.bimserver.plugins.deserializers.StreamingDeserializerPlugin)1 ModelCheckerPlugin (org.bimserver.plugins.modelchecker.ModelCheckerPlugin)1 ModelComparePlugin (org.bimserver.plugins.modelcompare.ModelComparePlugin)1 ModelMergerPlugin (org.bimserver.plugins.modelmerger.ModelMergerPlugin)1 ObjectIDMPlugin (org.bimserver.plugins.objectidms.ObjectIDMPlugin)1 QueryEnginePlugin (org.bimserver.plugins.queryengine.QueryEnginePlugin)1 RenderEnginePlugin (org.bimserver.plugins.renderengine.RenderEnginePlugin)1 SerializerPlugin (org.bimserver.plugins.serializers.SerializerPlugin)1 StreamingSerializerPlugin (org.bimserver.plugins.serializers.StreamingSerializerPlugin)1 ServicePlugin (org.bimserver.plugins.services.ServicePlugin)1