use of org.bimserver.database.actions.DownloadByNewJsonQueryDatabaseAction in project BIMserver by opensourceBIM.
the class LongDownloadAction method init.
public void init(Thread thread) {
super.init(thread);
if (getBimServer().getServerSettingsCache().getServerSettings().getCacheOutputFiles() && getBimServer().getDiskCacheManager().contains(downloadParameters)) {
return;
}
ObjectIDM objectIDM = null;
if (downloadParameters.getUseObjectIDM()) {
session = getBimServer().getDatabase().createSession();
try {
SerializerPluginConfiguration serializerPluginConfiguration = session.get(StorePackage.eINSTANCE.getSerializerPluginConfiguration(), downloadParameters.getSerializerOid(), OldQuery.getDefault());
if (serializerPluginConfiguration != null) {
ObjectIDMPluginConfiguration objectIdm = serializerPluginConfiguration.getObjectIDM();
if (objectIdm != null) {
ObjectIDMPlugin objectIDMPlugin = getBimServer().getPluginManager().getObjectIDMByName(objectIdm.getPluginDescriptor().getPluginClassName(), true);
if (objectIDMPlugin != null) {
objectIDM = objectIDMPlugin.getObjectIDM(new PluginConfiguration());
}
}
}
} catch (BimserverDatabaseException e) {
LOGGER.error("", e);
} finally {
session.close();
}
}
session = getBimServer().getDatabase().createSession();
switch(downloadParameters.getDownloadType()) {
case DOWNLOAD_BY_NEW_JSON_QUERY:
action = new DownloadByNewJsonQueryDatabaseAction(getBimServer(), session, accessMethod, downloadParameters.getRoids(), downloadParameters.getJsonQuery(), downloadParameters.getSerializerOid(), getAuthorization());
break;
case DOWNLOAD_PROJECTS:
action = new DownloadProjectsDatabaseAction(getBimServer(), session, accessMethod, downloadParameters.getRoids(), downloadParameters.getSerializerOid(), getAuthorization(), objectIDM);
break;
case DOWNLOAD_COMPARE:
action = new DownloadCompareDatabaseAction(getBimServer(), session, accessMethod, downloadParameters.getRoids(), downloadParameters.getModelCompareIdentifier(), downloadParameters.getCompareType(), getAuthorization(), objectIDM);
break;
}
action.addProgressListener(this);
}
Aggregations