use of org.bimserver.models.store.ObjectIDMPluginConfiguration in project BIMserver by opensourceBIM.
the class DeleteObjectIDMDatabaseAction method execute.
@Override
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
ObjectIDMPluginConfiguration object = getDatabaseSession().get(geteClass(), getOid(), OldQuery.getDefault());
UserSettings settings = object.getUserSettings();
settings.getObjectIDMs().remove(object);
getDatabaseSession().store(settings);
return super.execute();
}
use of org.bimserver.models.store.ObjectIDMPluginConfiguration in project BIMserver by opensourceBIM.
the class GetAllObjectIDMsDatabaseAction method execute.
public List<ObjectIDMPluginConfiguration> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
Condition condition = new IsOfTypeCondition(StorePackage.eINSTANCE.getObjectIDMPluginConfiguration());
Map<Long, ObjectIDMPluginConfiguration> result = getDatabaseSession().query(condition, ObjectIDMPluginConfiguration.class, OldQuery.getDefault());
List<ObjectIDMPluginConfiguration> mapToList = CollectionUtils.mapToList(result);
if (onlyEnabled) {
Iterator<ObjectIDMPluginConfiguration> iterator = mapToList.iterator();
while (iterator.hasNext()) {
ObjectIDMPluginConfiguration objectIdm = iterator.next();
if (!bimServer.getPluginManager().isEnabled(objectIdm.getPluginDescriptor().getPluginClassName()) || !objectIdm.getEnabled()) {
iterator.remove();
}
}
}
return mapToList;
}
use of org.bimserver.models.store.ObjectIDMPluginConfiguration 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