Search in sources :

Example 6 with ModelComparePluginConfiguration

use of org.bimserver.models.store.ModelComparePluginConfiguration in project BIMserver by opensourceBIM.

the class GetAllModelComparesDatabaseAction method execute.

@Override
public List<ModelComparePluginConfiguration> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
    Condition condition = new IsOfTypeCondition(StorePackage.eINSTANCE.getModelComparePluginConfiguration());
    Map<Long, ModelComparePluginConfiguration> result = getDatabaseSession().query(condition, ModelComparePluginConfiguration.class, OldQuery.getDefault());
    List<ModelComparePluginConfiguration> mapToList = CollectionUtils.mapToList(result);
    if (onlyEnabled) {
        Iterator<ModelComparePluginConfiguration> iterator = mapToList.iterator();
        while (iterator.hasNext()) {
            ModelComparePluginConfiguration modelCompare = iterator.next();
            if (!bimServer.getPluginManager().isEnabled(modelCompare.getPluginDescriptor().getPluginClassName()) || !modelCompare.getEnabled()) {
                iterator.remove();
            }
        }
    }
    return mapToList;
}
Also used : IsOfTypeCondition(org.bimserver.database.query.conditions.IsOfTypeCondition) Condition(org.bimserver.database.query.conditions.Condition) IsOfTypeCondition(org.bimserver.database.query.conditions.IsOfTypeCondition) ModelComparePluginConfiguration(org.bimserver.models.store.ModelComparePluginConfiguration)

Aggregations

ModelComparePluginConfiguration (org.bimserver.models.store.ModelComparePluginConfiguration)6 IOException (java.io.IOException)2 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)2 DatabaseSession (org.bimserver.database.DatabaseSession)2 PackageMetaData (org.bimserver.emf.PackageMetaData)2 SModelComparePluginConfiguration (org.bimserver.interfaces.objects.SModelComparePluginConfiguration)2 Revision (org.bimserver.models.store.Revision)2 PluginConfiguration (org.bimserver.plugins.PluginConfiguration)2 ModelCompareException (org.bimserver.plugins.modelcompare.ModelCompareException)2 ModelComparePlugin (org.bimserver.plugins.modelcompare.ModelComparePlugin)2 ServerException (org.bimserver.shared.exceptions.ServerException)2 UserException (org.bimserver.shared.exceptions.UserException)2 AddModelCompareDatabaseAction (org.bimserver.database.actions.AddModelCompareDatabaseAction)1 UpdateModelCompareDatabaseAction (org.bimserver.database.actions.UpdateModelCompareDatabaseAction)1 Condition (org.bimserver.database.query.conditions.Condition)1 IsOfTypeCondition (org.bimserver.database.query.conditions.IsOfTypeCondition)1 UserSettings (org.bimserver.models.store.UserSettings)1