Search in sources :

Example 1 with SPluginDescriptor

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

the class SerializerFactory method getAllServicePluginDescriptors.

public List<SPluginDescriptor> getAllServicePluginDescriptors() {
    List<SPluginDescriptor> descriptors = new ArrayList<SPluginDescriptor>();
    for (ServicePlugin servicePlugin : pluginManager.getAllServicePlugins(true).values()) {
        SPluginDescriptor descriptor = new SPluginDescriptor();
        descriptor.setPluginClassName(servicePlugin.getClass().getName());
        descriptors.add(descriptor);
    }
    return descriptors;
}
Also used : ServicePlugin(org.bimserver.plugins.services.ServicePlugin) SPluginDescriptor(org.bimserver.interfaces.objects.SPluginDescriptor) ArrayList(java.util.ArrayList)

Example 2 with SPluginDescriptor

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

the class ServiceImpl method getQueryEngineExampleKeys.

@Override
public List<String> getQueryEngineExampleKeys(Long qeid) throws ServerException, UserException {
    requireRealUserAuthentication();
    SQueryEnginePluginConfiguration queryEngineById = getQueryEngineById(qeid);
    SPluginDescriptor pluginDescriptor = getServiceMap().getPluginInterface().getPluginDescriptor(queryEngineById.getPluginDescriptorId());
    QueryEnginePlugin queryEngine = getBimServer().getPluginManager().getQueryEngine(pluginDescriptor.getPluginClassName(), true);
    return new ArrayList<String>(queryEngine.getExampleKeys());
}
Also used : SPluginDescriptor(org.bimserver.interfaces.objects.SPluginDescriptor) SQueryEnginePluginConfiguration(org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration) ArrayList(java.util.ArrayList) QueryEnginePlugin(org.bimserver.plugins.queryengine.QueryEnginePlugin)

Example 3 with SPluginDescriptor

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

the class ServiceImpl method getQueryEngineExample.

@Override
public String getQueryEngineExample(Long qeid, String key) throws ServerException, UserException {
    requireRealUserAuthentication();
    SQueryEnginePluginConfiguration queryEngineById = getQueryEngineById(qeid);
    SPluginDescriptor pluginDescriptor = getServiceMap().getPluginInterface().getPluginDescriptor(queryEngineById.getPluginDescriptorId());
    QueryEnginePlugin queryEngine = getBimServer().getPluginManager().getQueryEngine(pluginDescriptor.getPluginClassName(), true);
    return queryEngine.getExample(key);
}
Also used : SPluginDescriptor(org.bimserver.interfaces.objects.SPluginDescriptor) SQueryEnginePluginConfiguration(org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration) QueryEnginePlugin(org.bimserver.plugins.queryengine.QueryEnginePlugin)

Example 4 with SPluginDescriptor

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

the class AdminServiceImpl method getAllPlugins.

@Override
public List<SPluginDescriptor> getAllPlugins() throws UserException, ServerException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession(OperationType.READ_ONLY);
    try {
        List<SPluginDescriptor> convertToSListPluginDescriptor = getBimServer().getSConverter().convertToSListPluginDescriptor(session.getAllOfType(StorePackage.eINSTANCE.getPluginDescriptor(), PluginDescriptor.class, OldQuery.getDefault()));
        Collections.sort(convertToSListPluginDescriptor, new SPluginDescriptorComparator());
        return convertToSListPluginDescriptor;
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : SPluginDescriptor(org.bimserver.interfaces.objects.SPluginDescriptor) PluginDescriptor(org.bimserver.models.store.PluginDescriptor) SPluginDescriptor(org.bimserver.interfaces.objects.SPluginDescriptor) DatabaseSession(org.bimserver.database.DatabaseSession) SPluginDescriptorComparator(org.bimserver.webservices.SPluginDescriptorComparator) UserException(org.bimserver.shared.exceptions.UserException) BimBotsException(org.bimserver.bimbots.BimBotsException) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException)

Example 5 with SPluginDescriptor

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

the class GetAllPluginDescriptorsDatabaseAction method execute.

@Override
public List<SPluginDescriptor> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException, ServerException {
    IfcModelInterface allOfType = getDatabaseSession().getAllOfType(StorePackage.eINSTANCE.getPluginDescriptor(), OldQuery.getDefault());
    List<SPluginDescriptor> result = new ArrayList<SPluginDescriptor>();
    for (PluginDescriptor pluginDescriptor : allOfType.getAll(PluginDescriptor.class)) {
        SPluginType encounteredType = bimServer.getPluginManager().getPluginTypeFromClass(pluginDescriptor.getPluginInterfaceClassName());
        if (encounteredType.equals(pluginType)) {
            result.add(bimServer.getSConverter().convertToSObject(pluginDescriptor));
        }
    }
    return result;
}
Also used : SPluginDescriptor(org.bimserver.interfaces.objects.SPluginDescriptor) PluginDescriptor(org.bimserver.models.store.PluginDescriptor) SPluginDescriptor(org.bimserver.interfaces.objects.SPluginDescriptor) IfcModelInterface(org.bimserver.emf.IfcModelInterface) SPluginType(org.bimserver.interfaces.objects.SPluginType) ArrayList(java.util.ArrayList)

Aggregations

SPluginDescriptor (org.bimserver.interfaces.objects.SPluginDescriptor)6 ArrayList (java.util.ArrayList)3 IOException (java.io.IOException)2 SQueryEnginePluginConfiguration (org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration)2 PluginDescriptor (org.bimserver.models.store.PluginDescriptor)2 QueryEnginePlugin (org.bimserver.plugins.queryengine.QueryEnginePlugin)2 Path (java.nio.file.Path)1 BimServer (org.bimserver.BimServer)1 BimServerConfig (org.bimserver.BimServerConfig)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 BimBotsException (org.bimserver.bimbots.BimBotsException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 IfcModelInterface (org.bimserver.emf.IfcModelInterface)1 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)1 SPluginType (org.bimserver.interfaces.objects.SPluginType)1 SRenderEnginePluginConfiguration (org.bimserver.interfaces.objects.SRenderEnginePluginConfiguration)1 RenderEngineException (org.bimserver.plugins.renderengine.RenderEngineException)1 BimServerClientInterface (org.bimserver.plugins.services.BimServerClientInterface)1 ServicePlugin (org.bimserver.plugins.services.ServicePlugin)1 LocalDevelopmentResourceFetcher (org.bimserver.shared.LocalDevelopmentResourceFetcher)1