Search in sources :

Example 11 with IsOfTypeCondition

use of org.bimserver.database.query.conditions.IsOfTypeCondition in project BIMserver by opensourceBIM.

the class GetAllModelMergersDatabaseAction method execute.

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

Aggregations

IsOfTypeCondition (org.bimserver.database.query.conditions.IsOfTypeCondition)11 Condition (org.bimserver.database.query.conditions.Condition)10 User (org.bimserver.models.store.User)3 AttributeCondition (org.bimserver.database.query.conditions.AttributeCondition)2 Not (org.bimserver.database.query.conditions.Not)2 EnumLiteral (org.bimserver.database.query.literals.EnumLiteral)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 AndCondition (org.bimserver.database.query.conditions.AndCondition)1 HasReferenceToCondition (org.bimserver.database.query.conditions.HasReferenceToCondition)1 StringLiteral (org.bimserver.database.query.literals.StringLiteral)1 LogAction (org.bimserver.models.log.LogAction)1 DeserializerPluginConfiguration (org.bimserver.models.store.DeserializerPluginConfiguration)1 ModelComparePluginConfiguration (org.bimserver.models.store.ModelComparePluginConfiguration)1 ModelMergerPluginConfiguration (org.bimserver.models.store.ModelMergerPluginConfiguration)1 ObjectIDMPluginConfiguration (org.bimserver.models.store.ObjectIDMPluginConfiguration)1 Project (org.bimserver.models.store.Project)1 QueryEnginePluginConfiguration (org.bimserver.models.store.QueryEnginePluginConfiguration)1 RenderEnginePluginConfiguration (org.bimserver.models.store.RenderEnginePluginConfiguration)1 SerializerPluginConfiguration (org.bimserver.models.store.SerializerPluginConfiguration)1