use of org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration 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());
}
use of org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration in project BIMserver by opensourceBIM.
the class PluginServiceImpl method addQueryEngine.
@Override
public Long addQueryEngine(SQueryEnginePluginConfiguration queryEngine) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
QueryEnginePluginConfiguration convert = getBimServer().getSConverter().convertFromSObject(queryEngine, session);
return session.executeAndCommitAction(new AddQueryEngineDatabaseAction(session, getInternalAccessMethod(), getAuthorization(), convert));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getAllQueryEngines.
@Override
public List<SQueryEnginePluginConfiguration> getAllQueryEngines(Boolean onlyEnabled) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
List<SQueryEnginePluginConfiguration> queryEngines = getBimServer().getSConverter().convertToSListQueryEnginePluginConfiguration(userSettings.getQueryEngines());
Collections.sort(queryEngines, new SPluginConfigurationComparator());
return queryEngines;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration in project BIMserver by opensourceBIM.
the class PluginServiceImpl method updateQueryEngine.
@Override
public void updateQueryEngine(SQueryEnginePluginConfiguration queryEngine) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
QueryEnginePluginConfiguration convert = session.get(queryEngine.getOid(), OldQuery.getDefault());
getBimServer().getSConverter().convertFromSObject(queryEngine, convert, session);
session.executeAndCommitAction(new UpdateQueryEngineDatabaseAction(session, getInternalAccessMethod(), convert));
} catch (Exception e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration 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);
}
Aggregations