Search in sources :

Example 1 with ModelComparePlugin

use of org.bimserver.plugins.modelcompare.ModelComparePlugin in project BIMserver by opensourceBIM.

the class DownloadCompareDatabaseAction method getModelCompare.

public org.bimserver.plugins.modelcompare.ModelCompare getModelCompare() throws ModelCompareException, BimserverDatabaseException {
    Revision revision1 = getDatabaseSession().get(roid1, OldQuery.getDefault());
    Revision revision2 = getDatabaseSession().get(roid2, OldQuery.getDefault());
    PackageMetaData packageMetaData = getBimServer().getMetaDataManager().getPackageMetaData(revision1.getProject().getSchema());
    if (revision1.getProject().getSchema().equals(revision2.getProject().getSchema())) {
        ModelComparePluginConfiguration modelCompareObject = getDatabaseSession().get(StorePackage.eINSTANCE.getModelComparePluginConfiguration(), mcid, OldQuery.getDefault());
        if (modelCompareObject != null) {
            ModelComparePlugin modelComparePlugin = getBimServer().getPluginManager().getModelComparePlugin(modelCompareObject.getPluginDescriptor().getPluginClassName(), true);
            if (modelComparePlugin != null) {
                org.bimserver.plugins.modelcompare.ModelCompare modelCompare = modelComparePlugin.createModelCompare(new PluginConfiguration(modelCompareObject.getSettings()), packageMetaData);
                return modelCompare;
            } else {
                throw new ModelCompareException("No Model Compare found " + modelCompareObject.getPluginDescriptor().getPluginClassName());
            }
        } else {
            throw new ModelCompareException("No configured Model Compare found");
        }
    } else {
        throw new ModelCompareException("Schemas not the same");
    }
}
Also used : ModelComparePlugin(org.bimserver.plugins.modelcompare.ModelComparePlugin) Revision(org.bimserver.models.store.Revision) PackageMetaData(org.bimserver.emf.PackageMetaData) ModelComparePluginConfiguration(org.bimserver.models.store.ModelComparePluginConfiguration) ModelComparePluginConfiguration(org.bimserver.models.store.ModelComparePluginConfiguration) PluginConfiguration(org.bimserver.plugins.PluginConfiguration) ModelCompareException(org.bimserver.plugins.modelcompare.ModelCompareException)

Example 2 with ModelComparePlugin

use of org.bimserver.plugins.modelcompare.ModelComparePlugin in project BIMserver by opensourceBIM.

the class CompareDatabaseAction method getModelCompare.

public org.bimserver.plugins.modelcompare.ModelCompare getModelCompare() throws ModelCompareException, BimserverDatabaseException {
    Revision revision1 = getDatabaseSession().get(roid1, OldQuery.getDefault());
    Revision revision2 = getDatabaseSession().get(roid2, OldQuery.getDefault());
    PackageMetaData packageMetaData = bimServer.getMetaDataManager().getPackageMetaData(revision1.getProject().getSchema());
    if (revision1.getProject().getSchema().equals(revision2.getProject().getSchema())) {
        ModelComparePluginConfiguration modelCompareObject = getDatabaseSession().get(StorePackage.eINSTANCE.getModelComparePluginConfiguration(), mcid, OldQuery.getDefault());
        if (modelCompareObject != null) {
            ModelComparePlugin modelComparePlugin = bimServer.getPluginManager().getModelComparePlugin(modelCompareObject.getPluginDescriptor().getPluginClassName(), true);
            if (modelComparePlugin != null) {
                org.bimserver.plugins.modelcompare.ModelCompare modelCompare = modelComparePlugin.createModelCompare(new PluginConfiguration(modelCompareObject.getSettings()), packageMetaData);
                return modelCompare;
            } else {
                throw new ModelCompareException("No Model Compare found " + modelCompareObject.getPluginDescriptor().getPluginClassName());
            }
        } else {
            throw new ModelCompareException("No configured Model Compare found");
        }
    } else {
        throw new ModelCompareException("Not the same schema");
    }
}
Also used : ModelComparePlugin(org.bimserver.plugins.modelcompare.ModelComparePlugin) Revision(org.bimserver.models.store.Revision) PackageMetaData(org.bimserver.emf.PackageMetaData) ModelComparePluginConfiguration(org.bimserver.models.store.ModelComparePluginConfiguration) ModelComparePluginConfiguration(org.bimserver.models.store.ModelComparePluginConfiguration) PluginConfiguration(org.bimserver.plugins.PluginConfiguration) ModelCompareException(org.bimserver.plugins.modelcompare.ModelCompareException)

Aggregations

PackageMetaData (org.bimserver.emf.PackageMetaData)2 ModelComparePluginConfiguration (org.bimserver.models.store.ModelComparePluginConfiguration)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