Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/InternalTestSuite.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtilTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtilTest.java)3
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/DslUtilTestSuite.java8
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml8
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/CreateOseeTypeChangesReportOperation.java142
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/EMFCompareOperation.java69
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactTypeRestrictionHandler.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandler.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java169
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtil.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtil.java)2
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandler.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtil.java76
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/operations/OseeTypesImportOperation.java25
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml1
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java19
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/legacy.cache.service.xml16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/build.properties3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/CachingService.java189
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java114
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/TypeLoaderImpl.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/OseeTypeModelExportItem.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/CacheServiceFactory.java (renamed from plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingServiceFactory.java)8
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/IOseeModelingService.java (renamed from plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeModelingService.java)7
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeModelingServiceImpl.java158
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeToXtextOperation.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeToXtextOperation.java)6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeTypeCache.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeTypeCache.java)2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeUtil.java36
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/XTextToOseeTypeOperation.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java)6
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java2
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsApi.java2
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java27
41 files changed, 407 insertions, 753 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/InternalTestSuite.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/InternalTestSuite.java
index d195059bd18..1cb62203133 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/InternalTestSuite.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/InternalTestSuite.java
@@ -23,7 +23,8 @@ import org.junit.runners.Suite;
ArtifactMatchRestrictionHandlerTest.class,
ArtifactTypeRestrictionHandlerTest.class,
AttributeTypeRestrictionHandlerTest.class,
- RelationTypeRestrictionHandlerTest.class})
+ RelationTypeRestrictionHandlerTest.class,
+ OseeUtilTest.class})
public class InternalTestSuite {
// Test Suite
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtilTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtilTest.java
index cdd3a92be7b..6baec2d4ce2 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtilTest.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtilTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration.util;
+package org.eclipse.osee.framework.core.dsl.integration.internal;
import java.util.HashMap;
import java.util.Map;
@@ -17,6 +17,7 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.Identity;
+import org.eclipse.osee.framework.core.dsl.integration.internal.OseeUtil;
import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessPermissionEnum;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDslFactory;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/DslUtilTestSuite.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/DslUtilTestSuite.java
index c9f65f4603d..5aa4601fcb2 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/DslUtilTestSuite.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/DslUtilTestSuite.java
@@ -17,13 +17,7 @@ import org.junit.runners.Suite;
* @author Roberto E. Escobar
*/
@RunWith(Suite.class)
-@Suite.SuiteClasses({
-//
- HexUtilTest.class, //
- ModelUtilTest.class, //
- OseeDslSegmentParserTest.class, //
- OseeUtilTest.class, //
-})
+@Suite.SuiteClasses({HexUtilTest.class, ModelUtilTest.class, OseeDslSegmentParserTest.class})
public class DslUtilTestSuite {
// Test Suite
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.core.dsl.integration/META-INF/MANIFEST.MF
index 544222ac408..5a79976d74c 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/META-INF/MANIFEST.MF
@@ -23,10 +23,7 @@ Import-Package: org.eclipse.osee.framework.core.data,
org.osgi.framework
Require-Bundle: org.eclipse.xtext,
org.eclipse.core.runtime,
- com.google.guava;bundle-version="10.0.1",
- org.eclipse.emf.compare,
- org.eclipse.emf.compare.diff,
- org.eclipse.emf.compare.match
+ com.google.guava;bundle-version="10.0.1"
Export-Package: org.eclipse.osee.framework.core.dsl.integration,
org.eclipse.osee.framework.core.dsl.integration.util
Service-Component: OSGI-INF/*.xml
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml b/plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml
deleted file mode 100644
index fd2d848456c..00000000000
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.framework.core.dsl.integration.internal.OseeModelingServiceImpl">
- <implementation class="org.eclipse.osee.framework.core.dsl.integration.internal.OseeModelingServiceImpl"/>
- <service>
- <provide interface="org.eclipse.osee.framework.core.services.IOseeModelingService"/>
- </service>
- <reference bind="setFactoryService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelFactoryService" name="IOseeModelFactoryService" policy="static"/>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/CreateOseeTypeChangesReportOperation.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/CreateOseeTypeChangesReportOperation.java
deleted file mode 100644
index 7687062ec9d..00000000000
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/CreateOseeTypeChangesReportOperation.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.dsl.integration.internal.DslIntegrationConstants;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.AbstractOseeType;
-import org.eclipse.osee.framework.core.model.OseeEnumEntry;
-import org.eclipse.osee.framework.core.model.TableData;
-import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.core.model.type.OseeEnumType;
-import org.eclipse.osee.framework.core.model.type.RelationType;
-import org.eclipse.osee.framework.core.operation.AbstractOperation;
-import org.eclipse.osee.framework.jdk.core.util.Collections;
-
-/**
- * @author Roberto E. Escobar
- */
-public class CreateOseeTypeChangesReportOperation extends AbstractOperation {
- private final OseeTypeCache cache;
- private final List<TableData> tabs;
-
- public CreateOseeTypeChangesReportOperation(OseeTypeCache cache, List<TableData> tabs) {
- super("Report Osee Type Changes", DslIntegrationConstants.PLUGIN_ID);
- this.cache = cache;
- this.tabs = tabs;
- }
-
- @Override
- protected void doWork(IProgressMonitor monitor) throws Exception {
- createOseeEnumTypeReport(tabs, cache.getEnumTypeCache().getAllDirty());
- createAttributeTypeReport(tabs, cache.getAttributeTypeCache().getAllDirty());
- createArtifactTypeReport(tabs, cache.getArtifactTypeCache());
- createRelationTypeReport(tabs, cache.getRelationTypeCache().getAllDirty());
- }
-
- private String[] getColumns(Collection<?> types) {
- List<String> columns = new ArrayList<String>();
- columns.add("Name");
- columns.add("StorageState");
- if (!types.isEmpty()) {
- AbstractOseeType<?> type = (AbstractOseeType<?>) types.iterator().next();
- columns.addAll(type.getFieldNames());
- }
- return columns.toArray(new String[columns.size()]);
- }
-
- private void createArtifactTypeReport(List<TableData> tabs, ArtifactTypeCache cache) throws OseeCoreException {
- List<String[]> rows = new ArrayList<String[]>();
- Collection<ArtifactType> types = cache.getAllDirty();
- String[] columns = getColumns(types);
- for (ArtifactType type : types) {
- List<String> data = new ArrayList<String>(columns.length);
- data.add(type.getName());
- data.add(type.getStorageState().name());
- for (String fieldName : type.getFieldNames()) {
- boolean isDirty = type.isFieldDirty(fieldName);
- if (isDirty && ArtifactType.ARTIFACT_INHERITANCE_FIELD_KEY.equals(fieldName)) {
- data.add(type.getSuperArtifactTypes().toString());
- } else if (isDirty && ArtifactType.ARTIFACT_TYPE_ATTRIBUTES_FIELD_KEY.equals(fieldName)) {
- data.add(type.getLocalAttributeTypes().toString());
- } else {
- data.add(String.valueOf(isDirty));
- }
- }
- rows.add(data.toArray(new String[data.size()]));
- }
- tabs.add(new TableData("Artifact Types", columns, rows));
- }
-
- private void createAttributeTypeReport(List<TableData> tabs, Collection<AttributeType> types) throws OseeCoreException {
- List<String[]> rows = new ArrayList<String[]>();
- String[] columns = getColumns(types);
- for (AttributeType type : types) {
- List<String> data = new ArrayList<String>();
- data.add(type.getName());
- data.add(type.getStorageState().name());
- for (String fieldName : type.getFieldNames()) {
- data.add(String.valueOf(type.isFieldDirty(fieldName)));
- }
- rows.add(data.toArray(new String[data.size()]));
- }
- tabs.add(new TableData("Attribute Types", columns, rows));
- }
-
- private void createRelationTypeReport(List<TableData> tabs, Collection<RelationType> types) throws OseeCoreException {
- List<String[]> rows = new ArrayList<String[]>();
- String[] columns = getColumns(types);
- for (RelationType type : types) {
- List<String> data = new ArrayList<String>();
- data.add(type.getName());
- data.add(type.getStorageState().name());
- for (String fieldName : type.getFieldNames()) {
- data.add(String.valueOf(type.isFieldDirty(fieldName)));
- }
- rows.add(data.toArray(new String[data.size()]));
- }
- tabs.add(new TableData("Relation Types", columns, rows));
- }
-
- private void createOseeEnumTypeReport(List<TableData> tabs, Collection<OseeEnumType> types) throws OseeCoreException {
- List<String[]> rows = new ArrayList<String[]>();
- String[] columns = getColumns(types);
- for (OseeEnumType type : types) {
- List<String> data = new ArrayList<String>();
- data.add(type.getName());
- data.add(type.getStorageState().name());
- for (String fieldName : type.getFieldNames()) {
- boolean isDirty = type.isFieldDirty(fieldName);
- if (isDirty && OseeEnumType.OSEE_ENUM_TYPE_ENTRIES_FIELD.equals(fieldName)) {
- List<String> dirtyItems = new ArrayList<String>();
- for (OseeEnumEntry entry : type.values()) {
- if (entry.isDirty()) {
- dirtyItems.add(String.format("*{%s}", entry.toString()));
- } else {
- dirtyItems.add(entry.toString());
- }
- }
- data.add(Collections.toString(",", dirtyItems));
- } else {
- data.add(String.valueOf(isDirty));
- }
- }
- rows.add(data.toArray(new String[data.size()]));
- }
- tabs.add(new TableData("OseeEnum Types", columns, rows));
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/EMFCompareOperation.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/EMFCompareOperation.java
deleted file mode 100644
index fd8d06f3c98..00000000000
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/EMFCompareOperation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration;
-
-import java.util.Calendar;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonResourceSnapshot;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.diff.service.DiffService;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.compare.match.service.MatchService;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
-import org.eclipse.osee.framework.core.dsl.OseeDslStandaloneSetup;
-import org.eclipse.osee.framework.core.operation.AbstractOperation;
-
-/**
- * @author Roberto E. Escobar
- */
-public class EMFCompareOperation extends AbstractOperation {
-
- private final EObject ancestor;
- private final EObject modified;
- private final ComparisonResourceSnapshot comparisonSnapshot;
-
- public EMFCompareOperation(EObject ancestor, EObject modified, ComparisonResourceSnapshot comparisonSnapshot) {
- super("Compare", EMFCompareOperation.class.getPackage().getName());
- this.ancestor = ancestor;
- this.modified = modified;
- this.comparisonSnapshot = comparisonSnapshot;
- }
-
- @Override
- protected void doWork(IProgressMonitor monitor) throws Exception {
- OseeDslStandaloneSetup.doSetup();
- URI uri = URI.createURI("http://org.eclipse/osee/types/oseetypecache2");
- // URI uri = URI.createURI("dummy:/ancestor.osee");
- // final ResourceSet resourceSet1 = new ResourceSetImpl();
- // Resource resource1 = resourceSet1.createResource(uri);
- Resource resource1 = new ResourceImpl(uri);
- resource1.getContents().add(ancestor);
-
- // final ResourceSet resourceSet2 = new ResourceSetImpl();
- // Resource resource2 = resourceSet2.createResource(uri);
- Resource resource2 = new ResourceImpl(uri);
- resource2.getContents().add(modified);
-
- final MatchModel match = MatchService.doMatch(ancestor, modified, ancestor, null);
- monitor.worked(calculateWork(0.40));
-
- final DiffModel diff = DiffService.doDiff(match, true);
- monitor.worked(calculateWork(0.40));
-
- comparisonSnapshot.setDate(Calendar.getInstance().getTime());
- comparisonSnapshot.setMatch(match);
- comparisonSnapshot.setDiff(diff);
- monitor.worked(calculateWork(0.20));
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java
index e578d559163..ad2847f8267 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.framework.core.dsl.integration.internal;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy;
import org.eclipse.osee.framework.core.dsl.integration.RestrictionHandler;
-import org.eclipse.osee.framework.core.dsl.integration.util.OseeUtil;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactMatchRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactMatcher;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactTypeRestrictionHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactTypeRestrictionHandler.java
index 61aa16aa32b..0b1c6b44a1e 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactTypeRestrictionHandler.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactTypeRestrictionHandler.java
@@ -13,7 +13,6 @@ package org.eclipse.osee.framework.core.dsl.integration.internal;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy;
import org.eclipse.osee.framework.core.dsl.integration.RestrictionHandler;
-import org.eclipse.osee.framework.core.dsl.integration.util.OseeUtil;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactTypeRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactType;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandler.java
index f94f2cc7cb5..273488c4b83 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandler.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandler.java
@@ -14,7 +14,6 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy;
import org.eclipse.osee.framework.core.dsl.integration.RestrictionHandler;
-import org.eclipse.osee.framework.core.dsl.integration.util.OseeUtil;
import org.eclipse.osee.framework.core.dsl.oseeDsl.AttributeTypeRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactType;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java
deleted file mode 100644
index e05227ef3a7..00000000000
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration.internal;
-
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonResourceSnapshot;
-import org.eclipse.emf.compare.diff.metamodel.DiffFactory;
-import org.eclipse.osee.framework.core.dsl.OseeDslResourceUtil;
-import org.eclipse.osee.framework.core.dsl.integration.CreateOseeTypeChangesReportOperation;
-import org.eclipse.osee.framework.core.dsl.integration.EMFCompareOperation;
-import org.eclipse.osee.framework.core.dsl.integration.OseeToXtextOperation;
-import org.eclipse.osee.framework.core.dsl.integration.OseeTypeCache;
-import org.eclipse.osee.framework.core.dsl.integration.XTextToOseeTypeOperation;
-import org.eclipse.osee.framework.core.dsl.integration.util.ModelUtil;
-import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDsl;
-import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDslFactory;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
-import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
-import org.eclipse.osee.framework.core.model.TableData;
-import org.eclipse.osee.framework.core.operation.CompositeOperation;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
-import org.eclipse.osee.framework.core.services.IOseeCachingServiceFactory;
-import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
-import org.eclipse.osee.framework.core.util.Conditions;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceReference;
-
-/**
- * @author Roberto E. Escobar
- */
-public class OseeModelingServiceImpl implements IOseeModelingService {
-
- private IOseeModelFactoryService modelFactoryService;
-
- private OseeDslFactory modelFactory;
-
- public void setFactoryService(IOseeModelFactoryService modelFactoryService) {
- this.modelFactoryService = modelFactoryService;
- }
-
- public void start() {
- modelFactory = OseeDslFactory.eINSTANCE;
- }
-
- public void stop() {
- modelFactory = null;
- }
-
- private static BundleContext getBundleContext() throws OseeCoreException {
- Bundle bundle = FrameworkUtil.getBundle(OseeModelingServiceImpl.class);
- Conditions.checkNotNull(bundle, "bundle");
- return bundle.getBundleContext();
- }
-
- private static <T> T getService(Class<T> clazz) throws OseeCoreException {
- BundleContext context = getBundleContext();
- Conditions.checkNotNull(context, "bundleContext");
- ServiceReference<T> reference = context.getServiceReference(clazz);
- Conditions.checkNotNull(reference, "serviceReference");
- T service = context.getService(reference);
- Conditions.checkNotNull(service, "service");
- return service;
- }
-
- @Override
- public void exportOseeTypes(IProgressMonitor monitor, OutputStream outputStream) throws OseeCoreException {
- IOseeCachingService caches = getService(IOseeCachingService.class);
- OseeTypeCache cache =
- new OseeTypeCache(caches.getArtifactTypeCache(), caches.getAttributeTypeCache(),
- caches.getRelationTypeCache(), caches.getEnumTypeCache());
-
- OseeDsl model = modelFactory.createOseeDsl();
-
- IOperation operation = new OseeToXtextOperation(cache, modelFactory, model);
- Operations.executeWorkAndCheckStatus(operation, monitor);
- try {
- OseeDslResourceUtil.saveModel(model, "osee:/oseeTypes_" + Lib.getDateTimeString() + ".osee", outputStream,
- false);
- } catch (Exception ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- @Override
- public void importOseeTypes(IProgressMonitor monitor, boolean isInitializing, OseeImportModelRequest request, OseeImportModelResponse response) throws OseeCoreException {
- String modelName = request.getModelName();
- if (!modelName.endsWith(".osee")) {
- modelName += ".osee";
- }
- OseeDsl inputModel = null;
- try {
- inputModel = OseeDslResourceUtil.loadModel("osee:/" + modelName, request.getModel()).getModel();
- } catch (Exception ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
-
- IOseeCachingService tempCacheService = getService(IOseeCachingServiceFactory.class).createCachingService(false);
- OseeTypeCache tempCache =
- new OseeTypeCache(tempCacheService.getArtifactTypeCache(), tempCacheService.getAttributeTypeCache(),
- tempCacheService.getRelationTypeCache(), tempCacheService.getEnumTypeCache());
-
- List<TableData> reportData = new ArrayList<TableData>();
- ComparisonResourceSnapshot comparisonSnapshot = DiffFactory.eINSTANCE.createComparisonResourceSnapshot();
- OseeDsl baseModel = modelFactory.createOseeDsl();
- OseeDsl modifiedModel = modelFactory.createOseeDsl();
-
- List<IOperation> ops = new ArrayList<IOperation>();
-
- ops.add(new XTextToOseeTypeOperation(modelFactoryService, tempCache, tempCacheService.getBranchCache(),
- inputModel));
- if (request.isCreateTypeChangeReport()) {
- ops.add(new CreateOseeTypeChangesReportOperation(tempCache, reportData));
- }
- if (request.isCreateCompareReport()) {
- ops.add(new OseeToXtextOperation(tempCache, modelFactory, baseModel));
- ops.add(new EMFCompareOperation(baseModel, modifiedModel, comparisonSnapshot));
- }
- IOperation operation = new CompositeOperation("Import Osee Types", DslIntegrationConstants.PLUGIN_ID, ops);
- Operations.executeWorkAndCheckStatus(operation, monitor);
-
- if (request.isPersistAllowed()) {
- IOseeCachingService caches = getService(IOseeCachingService.class);
-
- // TODO Make this call transaction based
- tempCache.storeAllModified();
- response.setPersisted(true);
- if (isInitializing) {
- caches.clearAll();
- }
- caches.getEnumTypeCache().cacheFrom(tempCache.getEnumTypeCache());
- caches.getAttributeTypeCache().cacheFrom(tempCache.getAttributeTypeCache());
- caches.getArtifactTypeCache().cacheFrom(tempCache.getArtifactTypeCache());
- caches.getRelationTypeCache().cacheFrom(tempCache.getRelationTypeCache());
-
- caches.reloadAll();
- } else {
- response.setPersisted(false);
- }
- response.setReportData(reportData);
-
- if (request.isCreateCompareReport()) {
- response.setComparisonSnapshotModelName("osee_compare.diff");
- String modelString =
- ModelUtil.modelToStringXML(comparisonSnapshot, "osee:/osee_compare.diff",
- Collections.<String, Boolean> emptyMap());
- response.setComparisonSnapshotModel(modelString);
- }
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtil.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtil.java
index 7061e0af2fc..abdfe9e7d6f 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtil.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtil.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration.util;
+package org.eclipse.osee.framework.core.dsl.integration.internal;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandler.java
index fd8c12c6ba7..66d8756acce 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandler.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandler.java
@@ -17,7 +17,6 @@ import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy;
import org.eclipse.osee.framework.core.dsl.integration.RestrictionHandler;
-import org.eclipse.osee.framework.core.dsl.integration.util.OseeUtil;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.RelationTypeArtifactPredicate;
import org.eclipse.osee.framework.core.dsl.oseeDsl.RelationTypeArtifactTypePredicate;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtil.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtil.java
deleted file mode 100644
index e002c5c98b3..00000000000
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtil.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Map;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonSnapshot;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class ModelUtil {
-
- private ModelUtil() {
- // Utility Class
- }
-
- private static void storeModel(Resource resource, OutputStream outputStream, EObject object, String uri, Map<String, Boolean> options) throws OseeCoreException {
- try {
- resource.setURI(URI.createURI(uri));
- resource.getContents().add(object);
- resource.save(outputStream, options);
- } catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- public static String modelToStringXML(EObject object, String uri, Map<String, Boolean> options) throws OseeCoreException {
- return modelToString(new XMLResourceImpl(), object, uri, options);
- }
-
- private static String modelToString(Resource resource, EObject object, String uri, Map<String, Boolean> options) throws OseeCoreException {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- storeModel(resource, outputStream, object, uri, options);
- try {
- return outputStream.toString("UTF-8");
- } catch (UnsupportedEncodingException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- public static ComparisonSnapshot loadComparisonSnapshot(String compareName, String compareData) throws OseeCoreException {
- ComparisonSnapshot snapshot = null;
- try {
- ResourceSet resourceSet = new ResourceSetImpl();
- Resource resource = resourceSet.createResource(URI.createURI(compareName));
- resource.load(new ByteArrayInputStream(compareData.getBytes("UTF-8")), resourceSet.getLoadOptions());
- snapshot = (ComparisonSnapshot) resource.getContents().get(0);
- } catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- return snapshot;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/operations/OseeTypesImportOperation.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/operations/OseeTypesImportOperation.java
index 5d33421dda0..c51606f9446 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/operations/OseeTypesImportOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/operations/OseeTypesImportOperation.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.core.dsl.ui.integration.operations;
import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
@@ -25,10 +26,14 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.emf.compare.diff.metamodel.ComparisonSnapshot;
import org.eclipse.emf.compare.ui.editor.ModelCompareEditorInput;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.osee.framework.core.data.OseeServerContext;
-import org.eclipse.osee.framework.core.dsl.integration.util.ModelUtil;
import org.eclipse.osee.framework.core.dsl.ui.integration.internal.DslUiIntegrationConstants;
import org.eclipse.osee.framework.core.enums.CoreTranslatorId;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
import org.eclipse.osee.framework.core.model.TableData;
@@ -108,12 +113,25 @@ public class OseeTypesImportOperation extends AbstractOperation {
String compareName = response.getComparisonSnapshotModelName();
String compareData = response.getComparisonSnapshotModel();
if (Strings.isValid(compareData) && Strings.isValid(compareName)) {
- ComparisonSnapshot snapshot = ModelUtil.loadComparisonSnapshot(compareName, compareData);
+ ComparisonSnapshot snapshot = loadComparisonSnapshot(compareName, compareData);
openCompareEditor(snapshot);
}
}
}
+ private static ComparisonSnapshot loadComparisonSnapshot(String compareName, String compareData) throws OseeCoreException {
+ ComparisonSnapshot snapshot = null;
+ try {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ Resource resource = resourceSet.createResource(org.eclipse.emf.common.util.URI.createURI(compareName));
+ resource.load(new ByteArrayInputStream(compareData.getBytes("UTF-8")), resourceSet.getLoadOptions());
+ snapshot = (ComparisonSnapshot) resource.getContents().get(0);
+ } catch (IOException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ return snapshot;
+ }
+
private void openCompareEditor(final ComparisonSnapshot snapshot) {
Job job = new UIJob("Open Compare") {
@@ -126,7 +144,8 @@ public class OseeTypesImportOperation extends AbstractOperation {
page.openEditor(input, "org.eclipse.compare.CompareEditor", true);
status = Status.OK_STATUS;
} catch (Exception ex) {
- status = new Status(IStatus.ERROR, DslUiIntegrationConstants.PLUGIN_ID, "Error opening compare editor", ex);
+ status =
+ new Status(IStatus.ERROR, DslUiIntegrationConstants.PLUGIN_ID, "Error opening compare editor", ex);
}
return status;
}
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml b/plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml
index 13ac614d6c6..b1d139b7f3e 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml
@@ -8,7 +8,6 @@
<reference bind="setServerLookup" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IApplicationServerLookup" name="IApplicationServerLookup" policy="static"/>
<reference bind="setAppServerManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IApplicationServerManager" name="IApplicationServerManager" policy="static"/>
<reference bind="setTranslationService" cardinality="1..1" interface="org.eclipse.osee.framework.core.translation.IDataTranslationService" name="IDataTranslationService" policy="static"/>
- <reference bind="setModeling" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelingService" name="IOseeModelingService" policy="static"/>
<reference bind="setCaching" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeCachingService" name="IOseeCachingService" policy="static"/>
<reference bind="setAuthenticationManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IAuthenticationManager" name="IAuthenticationManager" policy="static"/>
<reference bind="setFactoryService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelFactoryService" name="IOseeModelFactoryService" policy="static"/>
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java
index c99ecc8598c..4c2067cea0a 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java
@@ -20,13 +20,13 @@ import org.eclipse.osee.framework.core.enums.CoreTranslatorId;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
-import org.eclipse.osee.framework.core.operation.LogProgressMonitor;
import org.eclipse.osee.framework.core.server.ISessionManager;
import org.eclipse.osee.framework.core.server.SecureOseeHttpServlet;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.OrcsTypes;
/**
* @author Roberto E. Escobar
@@ -35,17 +35,17 @@ public class OseeModelServlet extends SecureOseeHttpServlet {
private static final long serialVersionUID = -2639113870500561780L;
- private final IOseeModelingService modelingService;
+ private final OrcsApi orcsApi;
private final IDataTranslationService dataTransalatorService;
- public OseeModelServlet(Log logger, ISessionManager sessionManager, IDataTranslationService dataTransalatorService, IOseeModelingService modelingService) {
+ public OseeModelServlet(Log logger, ISessionManager sessionManager, IDataTranslationService dataTransalatorService, OrcsApi orcsApi) {
super(logger, sessionManager);
this.dataTransalatorService = dataTransalatorService;
- this.modelingService = modelingService;
+ this.orcsApi = orcsApi;
}
- private IOseeModelingService getModelingService() {
- return modelingService;
+ private OrcsTypes getOrcsTypes() {
+ return orcsApi.getOrcsTypes(null);
}
@Override
@@ -69,7 +69,7 @@ public class OseeModelServlet extends SecureOseeHttpServlet {
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- getModelingService().exportOseeTypes(new LogProgressMonitor(), outputStream);
+ getOrcsTypes().exportOseeTypes(outputStream);
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
resp.setContentType("text/plain");
resp.setCharacterEncoding("UTF-8");
@@ -89,8 +89,7 @@ public class OseeModelServlet extends SecureOseeHttpServlet {
OseeImportModelResponse modelResponse = new OseeImportModelResponse();
- getModelingService().importOseeTypes(new LogProgressMonitor(), isInitializing(req), modelRequest,
- modelResponse);
+ getOrcsTypes().importOseeTypes(isInitializing(req), modelRequest, modelResponse);
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
resp.setContentType("text/xml");
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java
index 2be0a4aa472..f70ad8c9625 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java
@@ -20,7 +20,6 @@ import org.eclipse.osee.framework.core.server.ISessionManager;
import org.eclipse.osee.framework.core.server.OseeHttpServlet;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.manager.servlet.AdminServlet;
import org.eclipse.osee.framework.manager.servlet.ArtifactFileServlet;
@@ -56,7 +55,6 @@ public class ServletRegistrationHandler {
private IApplicationServerLookup serverLookup;
private IApplicationServerManager appServerManager;
private IDataTranslationService translationService;
- private IOseeModelingService modeling;
private IOseeCachingService caching;
private IAuthenticationManager authenticationManager;
private IOseeModelFactoryService factoryService;
@@ -81,10 +79,6 @@ public class ServletRegistrationHandler {
this.translationService = translationService;
}
- public void setModeling(IOseeModelingService modeling) {
- this.modeling = modeling;
- }
-
public void setCaching(IOseeCachingService caching) {
this.caching = caching;
}
@@ -147,7 +141,7 @@ public class ServletRegistrationHandler {
register(new SessionClientLoopbackServlet(logger, sessionManager), OseeServerContext.CLIENT_LOOPBACK_CONTEXT);
register(new OseeCacheServlet(logger, sessionManager, translationService, caching, factoryService),
OseeServerContext.CACHE_CONTEXT);
- register(new OseeModelServlet(logger, sessionManager, translationService, modeling),
+ register(new OseeModelServlet(logger, sessionManager, translationService, orcsApi),
OseeServerContext.OSEE_MODEL_CONTEXT);
register(new UnsubscribeServlet(logger, context, orcsApi), "osee/unsubscribe");
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java
index ea5ac2fb050..c2930d0bb3a 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.orcs.OrcsTypes;
+
/**
* @author Roberto E. Escobar
*/
-public interface OrcsDataStore {
+public interface OrcsDataStore extends OrcsTypes {
BranchDataStore getBranchDataStore();
@@ -26,4 +28,5 @@ public interface OrcsDataStore {
QueryEngine getQueryEngine();
QueryEngineIndexer getQueryEngineIndexer();
+
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
index 79d92e71fb6..59e433d0b07 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
@@ -27,6 +27,7 @@ import org.eclipse.osee.orcs.OrcsAdmin;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.OrcsBranch;
import org.eclipse.osee.orcs.OrcsPerformance;
+import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.SystemPreferences;
import org.eclipse.osee.orcs.core.ds.OrcsDataStore;
import org.eclipse.osee.orcs.core.internal.artifact.ArtifactBuilderFactoryImpl;
@@ -115,6 +116,7 @@ public class OrcsApiImpl implements OrcsApi {
indexerModule = new IndexerModule(logger, preferences, executorAdmin, dataStore.getQueryEngineIndexer());
indexerModule.start();
+
}
public void stop() {
@@ -208,4 +210,9 @@ public class OrcsApiImpl implements OrcsApi {
return new SessionContextImpl(sessionId);
}
+ @Override
+ public OrcsTypes getOrcsTypes(ApplicationContext context) {
+ return dataStore;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF
index 8b3216da90b..2f02af575ed 100644
--- a/plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF
@@ -7,11 +7,18 @@ Bundle-Vendor: Eclipse Open System Engineering Environment
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Service-Component: OSGI-INF/*.xml
Import-Package: com.google.common.collect,
+ org.eclipse.emf.common.notify,
+ org.eclipse.emf.common.util,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.util,
org.eclipse.osee.console.admin,
org.eclipse.osee.database.schema,
org.eclipse.osee.event,
org.eclipse.osee.executor.admin,
org.eclipse.osee.framework.core.data,
+ org.eclipse.osee.framework.core.dsl,
+ org.eclipse.osee.framework.core.dsl.oseeDsl,
+ org.eclipse.osee.framework.core.dsl.oseeDsl.util,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.model,
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/legacy.cache.service.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/legacy.cache.service.xml
deleted file mode 100644
index 8d51f3c60ef..00000000000
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/legacy.cache.service.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.orcs.db.internal.CachingService">
- <implementation class="org.eclipse.osee.orcs.db.internal.CachingService"/>
- <service>
- <provide interface="org.eclipse.osee.framework.core.services.IOseeCachingService"/>
- <provide interface="org.eclipse.osee.framework.core.services.IOseeCachingServiceFactory"/>
- </service>
- <reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
- <reference bind="setResourceManager" cardinality="1..1" interface="org.eclipse.osee.framework.resource.management.IResourceManager" name="IResourceManager" policy="static"/>
- <reference bind="setIdentityService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IdentityService" name="IdentityService" policy="static"/>
- <reference bind="setFactoryService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelFactoryService" name="IOseeModelFactoryService" policy="static"/>
- <reference bind="setEventService" cardinality="1..1" interface="org.eclipse.osee.event.EventService" name="EventService" policy="static"/>
- <reference bind="setExecutorAdmin" cardinality="1..1" interface="org.eclipse.osee.executor.admin.ExecutorAdmin" name="ExecutorAdmin" policy="static"/>
- <reference bind="setModelService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelingService" name="IOseeModelingService" policy="static"/>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
index d6296774b25..6cbc96dc2a0 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
@@ -3,15 +3,15 @@
<implementation class="org.eclipse.osee.orcs.db.internal.OrcsDataStoreImpl"/>
<service>
<provide interface="org.eclipse.osee.orcs.core.ds.OrcsDataStore"/>
+ <provide interface="org.eclipse.osee.framework.core.services.IOseeCachingService"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
<reference bind="setIdentityService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IdentityService" name="IdentityService" policy="static"/>
<reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
- <reference bind="setCachingService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeCachingService" name="IOseeCachingService" policy="static"/>
<reference bind="setExecutorAdmin" cardinality="1..1" interface="org.eclipse.osee.executor.admin.ExecutorAdmin" name="ExecutorAdmin" policy="static"/>
<reference bind="setResourceManager" cardinality="1..1" interface="org.eclipse.osee.framework.resource.management.IResourceManager" name="IResourceManager" policy="static"/>
<reference bind="setSystemPreferences" cardinality="1..1" interface="org.eclipse.osee.orcs.core.SystemPreferences" name="SystemPreferences" policy="static"/>
<reference bind="setDataProxyFactoryProvider" cardinality="1..1" interface="org.eclipse.osee.orcs.db.internal.loader.DataProxyFactoryProvider" name="DataProxyFactoryProvider" policy="static"/>
<reference bind="setModelFactory" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelFactoryService" name="IOseeModelFactoryService" policy="static"/>
- <reference bind="setTypeModelService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelingService" name="IOseeModelingService" policy="static"/>
+ <reference bind="setEventService" cardinality="1..1" interface="org.eclipse.osee.event.EventService" name="EventService" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/build.properties b/plugins/org.eclipse.osee.orcs.db/build.properties
index 2d2fa010adc..e4755fdb1db 100644
--- a/plugins/org.eclipse.osee.orcs.db/build.properties
+++ b/plugins/org.eclipse.osee.orcs.db/build.properties
@@ -15,4 +15,5 @@ additional.bundles = org.eclipse.osee.framework.database,\
org.eclipse.osee.event,\
org.eclipse.osee.executor.admin,\
org.eclipse.osee.database.schema,\
- org.eclipse.osee.console.admin
+ org.eclipse.osee.console.admin,\
+ org.eclipse.osee.framework.core.dsl
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/CachingService.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/CachingService.java
deleted file mode 100644
index cb6436a272d..00000000000
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/CachingService.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.orcs.db.internal;
-
-import java.util.Collection;
-import org.eclipse.osee.event.EventService;
-import org.eclipse.osee.executor.admin.ExecutorAdmin;
-import org.eclipse.osee.framework.core.enums.OseeCacheEnum;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.OseeCachingService;
-import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
-import org.eclipse.osee.framework.core.model.cache.AttributeTypeCache;
-import org.eclipse.osee.framework.core.model.cache.BranchCache;
-import org.eclipse.osee.framework.core.model.cache.IOseeCache;
-import org.eclipse.osee.framework.core.model.cache.OseeEnumTypeCache;
-import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
-import org.eclipse.osee.framework.core.model.cache.TransactionCache;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.core.model.type.OseeEnumType;
-import org.eclipse.osee.framework.core.model.type.RelationType;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
-import org.eclipse.osee.framework.core.services.IOseeCachingServiceFactory;
-import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
-import org.eclipse.osee.framework.core.services.IdentityService;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.resource.management.IResourceManager;
-import org.eclipse.osee.logger.Log;
-import org.eclipse.osee.orcs.db.internal.accessor.ArtifactTypeDataAccessor;
-import org.eclipse.osee.orcs.db.internal.accessor.DatabaseBranchAccessor;
-import org.eclipse.osee.orcs.db.internal.accessor.DatabaseTransactionRecordAccessor;
-import org.eclipse.osee.orcs.db.internal.accessor.TypeLoaderImpl;
-
-/**
- * @author Roberto E. Escobar
- */
-public class CachingService implements IOseeCachingService, IOseeCachingServiceFactory {
-
- private IOseeCachingService proxied;
-
- private IOseeDatabaseService dbService;
- private IResourceManager resourceManager;
- private IOseeModelFactoryService factoryService;
- private IOseeModelingService modelingService;
- private IdentityService identityService;
- private Log logger;
- private EventService eventService;
- private ExecutorAdmin executorAdmin;
-
- public void setDatabaseService(IOseeDatabaseService dbService) {
- this.dbService = dbService;
- }
-
- public void setResourceManager(IResourceManager resourceManager) {
- this.resourceManager = resourceManager;
- }
-
- public void setIdentityService(IdentityService identityService) {
- this.identityService = identityService;
- }
-
- public void setFactoryService(IOseeModelFactoryService factoryService) {
- this.factoryService = factoryService;
- }
-
- public void setEventService(EventService eventService) {
- this.eventService = eventService;
- }
-
- public void setExecutorAdmin(ExecutorAdmin executorAdmin) {
- this.executorAdmin = executorAdmin;
- }
-
- public void setModelService(IOseeModelingService modelingService) {
- this.modelingService = modelingService;
- }
-
- public void setLogger(Log logger) {
- this.logger = logger;
- }
-
- private Log getLogger() {
- return logger;
- }
-
- public void start() {
- proxied = createCachingService(true);
-
- getLogger().info("ORCS Cache - Created");
- }
-
- public void stop() {
- proxied = null;
- getLogger().info("ORCS Cache - Destroyed");
- }
-
- private IOseeCachingService getProxied() {
- return proxied;
- }
-
- @Override
- public BranchCache getBranchCache() {
- return getProxied().getBranchCache();
- }
-
- @Override
- public TransactionCache getTransactionCache() {
- return getProxied().getTransactionCache();
- }
-
- @Override
- public ArtifactTypeCache getArtifactTypeCache() {
- return getProxied().getArtifactTypeCache();
- }
-
- @Override
- public AttributeTypeCache getAttributeTypeCache() {
- return getProxied().getAttributeTypeCache();
- }
-
- @Override
- public RelationTypeCache getRelationTypeCache() {
- return getProxied().getRelationTypeCache();
- }
-
- @Override
- public OseeEnumTypeCache getEnumTypeCache() {
- return getProxied().getEnumTypeCache();
- }
-
- @Override
- public IdentityService getIdentityService() {
- return getProxied().getIdentityService();
- }
-
- @Override
- public Collection<?> getCaches() {
- return getProxied().getCaches();
- }
-
- @Override
- public IOseeCache<?, ?> getCache(OseeCacheEnum cacheId) throws OseeCoreException {
- return getProxied().getCache(cacheId);
- }
-
- @Override
- public void reloadAll() throws OseeCoreException {
- getProxied().reloadAll();
- }
-
- @Override
- public void clearAll() {
- getProxied().clearAll();
- }
-
- @Override
- public IOseeCachingService createCachingService(boolean needsPriming) {
- TransactionCache txCache = new TransactionCache();
- BranchCache branchCache =
- new BranchCache(new DatabaseBranchAccessor(logger, executorAdmin, eventService, dbService, txCache,
- factoryService.getBranchFactory()));
- txCache.setAccessor(new DatabaseTransactionRecordAccessor(dbService, branchCache,
- factoryService.getTransactionFactory()));
-
- TypeLoaderImpl loader =
- new TypeLoaderImpl(modelingService, identityService, dbService, resourceManager, branchCache, needsPriming);
-
- OseeEnumTypeCache oseeEnumTypeCache =
- new OseeEnumTypeCache(new ArtifactTypeDataAccessor<OseeEnumType>(identityService, loader));
- AttributeTypeCache attributeCache =
- new AttributeTypeCache(new ArtifactTypeDataAccessor<AttributeType>(identityService, loader));
- ArtifactTypeCache artifactCache =
- new ArtifactTypeCache(new ArtifactTypeDataAccessor<ArtifactType>(identityService, loader));
- RelationTypeCache relationCache =
- new RelationTypeCache(new ArtifactTypeDataAccessor<RelationType>(identityService, loader));
-
- return new OseeCachingService(branchCache, txCache, artifactCache, attributeCache, relationCache,
- oseeEnumTypeCache, identityService);
- }
-}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java
index a17a30f920b..6a036f1fc4c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java
@@ -10,10 +10,23 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal;
+import java.io.OutputStream;
+import java.util.Collection;
+import org.eclipse.osee.event.EventService;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
+import org.eclipse.osee.framework.core.enums.OseeCacheEnum;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
+import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
+import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
+import org.eclipse.osee.framework.core.model.cache.AttributeTypeCache;
+import org.eclipse.osee.framework.core.model.cache.BranchCache;
+import org.eclipse.osee.framework.core.model.cache.IOseeCache;
+import org.eclipse.osee.framework.core.model.cache.OseeEnumTypeCache;
+import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
+import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResourceManager;
@@ -35,28 +48,32 @@ import org.eclipse.osee.orcs.db.internal.loader.IdFactory;
import org.eclipse.osee.orcs.db.internal.loader.data.IdFactoryImpl;
import org.eclipse.osee.orcs.db.internal.search.QueryModuleFactory;
import org.eclipse.osee.orcs.db.internal.sql.StaticSqlProvider;
+import org.eclipse.osee.orcs.db.internal.types.OseeModelingServiceImpl;
+import org.osgi.framework.BundleContext;
/**
* @author Roberto E. Escobar
*/
-public class OrcsDataStoreImpl implements OrcsDataStore {
+public class OrcsDataStoreImpl implements OrcsDataStore, IOseeCachingService {
private Log logger;
private IOseeDatabaseService dbService;
private IdentityService identityService;
- private IOseeCachingService cacheService;
private SystemPreferences preferences;
private ExecutorAdmin executorAdmin;
private IResourceManager resourceManager;
private DataProxyFactoryProvider proxyProvider;
private IOseeModelFactoryService modelFactory;
- private IOseeModelingService typeModelService;
+ private EventService eventService;
private DataStoreAdmin dataStoreAdmin;
private BranchDataStore branchStore;
private DataModuleFactory dataModuleFactory;
private QueryModuleFactory queryModule;
+ private OseeModelingServiceImpl modelingService;
+ private IOseeCachingService cacheService;
+
public void setLogger(Log logger) {
this.logger = logger;
}
@@ -69,10 +86,6 @@ public class OrcsDataStoreImpl implements OrcsDataStore {
this.dbService = dbService;
}
- public void setCachingService(IOseeCachingService cacheService) {
- this.cacheService = cacheService;
- }
-
public void setExecutorAdmin(ExecutorAdmin executorAdmin) {
this.executorAdmin = executorAdmin;
}
@@ -93,11 +106,18 @@ public class OrcsDataStoreImpl implements OrcsDataStore {
this.modelFactory = modelFactory;
}
- public void setTypeModelService(IOseeModelingService typeModelService) {
- this.typeModelService = typeModelService;
+ public void setEventService(EventService eventService) {
+ this.eventService = eventService;
}
- public void start() {
+ public void start(BundleContext context) {
+
+ modelingService =
+ new OseeModelingServiceImpl(logger, dbService, identityService, executorAdmin, resourceManager, modelFactory,
+ eventService, this);
+
+ cacheService = modelingService.createCachingService(true);
+
StaticSqlProvider sqlProvider = new StaticSqlProvider();
sqlProvider.setLogger(logger);
sqlProvider.setPreferences(preferences);
@@ -112,7 +132,7 @@ public class OrcsDataStoreImpl implements OrcsDataStore {
branchStore =
new BranchDataStoreImpl(logger, dbService, identityService, cacheService, preferences, executorAdmin,
- resourceManager, modelFactory, typeModelService, idFactory, dataModuleFactory.getDataLoaderFactory(),
+ resourceManager, modelFactory, modelingService, idFactory, dataModuleFactory.getDataLoaderFactory(),
missingChangeItemFactory);
dataStoreAdmin = new DataStoreAdminImpl(logger, dbService, identityService, branchStore, preferences);
@@ -161,4 +181,74 @@ public class OrcsDataStoreImpl implements OrcsDataStore {
public QueryEngineIndexer getQueryEngineIndexer() {
return queryModule.getQueryIndexer();
}
+
+ @Override
+ public void importOseeTypes(boolean isInitializing, OseeImportModelRequest request, OseeImportModelResponse response) throws OseeCoreException {
+ modelingService.importOseeTypes(isInitializing, request, response);
+ }
+
+ @Override
+ public void exportOseeTypes(OutputStream outputStream) throws OseeCoreException {
+ modelingService.exportOseeTypes(outputStream);
+ }
+
+ private IOseeCachingService getProxied() {
+ return cacheService;
+ }
+
+ @Override
+ public BranchCache getBranchCache() {
+ return getProxied().getBranchCache();
+ }
+
+ @Override
+ public TransactionCache getTransactionCache() {
+ return getProxied().getTransactionCache();
+ }
+
+ @Override
+ public ArtifactTypeCache getArtifactTypeCache() {
+ return getProxied().getArtifactTypeCache();
+ }
+
+ @Override
+ public AttributeTypeCache getAttributeTypeCache() {
+ return getProxied().getAttributeTypeCache();
+ }
+
+ @Override
+ public RelationTypeCache getRelationTypeCache() {
+ return getProxied().getRelationTypeCache();
+ }
+
+ @Override
+ public OseeEnumTypeCache getEnumTypeCache() {
+ return getProxied().getEnumTypeCache();
+ }
+
+ @Override
+ public IdentityService getIdentityService() {
+ return getProxied().getIdentityService();
+ }
+
+ @Override
+ public Collection<?> getCaches() {
+ return getProxied().getCaches();
+ }
+
+ @Override
+ public IOseeCache<?, ?> getCache(OseeCacheEnum cacheId) throws OseeCoreException {
+ return getProxied().getCache(cacheId);
+ }
+
+ @Override
+ public void reloadAll() throws OseeCoreException {
+ getProxied().reloadAll();
+ }
+
+ @Override
+ public void clearAll() {
+ getProxied().clearAll();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/TypeLoaderImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/TypeLoaderImpl.java
index 9286796383d..88d0fee58f1 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/TypeLoaderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/TypeLoaderImpl.java
@@ -16,7 +16,6 @@ import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
@@ -27,7 +26,6 @@ import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IOseeStatement;
@@ -38,6 +36,7 @@ import org.eclipse.osee.framework.resource.management.IResourceLocator;
import org.eclipse.osee.framework.resource.management.IResourceManager;
import org.eclipse.osee.framework.resource.management.StandardOptions;
import org.eclipse.osee.orcs.db.internal.accessor.ArtifactTypeDataAccessor.TypeLoader;
+import org.eclipse.osee.orcs.db.internal.types.IOseeModelingService;
public class TypeLoaderImpl implements TypeLoader {
private static final String LOAD_OSEE_TYPE_DEF_URIS =
@@ -81,7 +80,7 @@ public class TypeLoaderImpl implements TypeLoader {
String modelName = String.format("osee.types.%s.osee", Lib.getDateTimeString());
OseeImportModelRequest request = new OseeImportModelRequest(modelName, modelData, false, false, true);
OseeImportModelResponse response = new OseeImportModelResponse();
- modelingService.importOseeTypes(new NullProgressMonitor(), true, request, response);
+ modelingService.importOseeTypes(true, request, response);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java
index 4b526c8e20f..37e3d68e7b1 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
@@ -55,6 +54,7 @@ import org.eclipse.osee.orcs.db.internal.transaction.TransactionCheck;
import org.eclipse.osee.orcs.db.internal.transaction.TransactionWriter;
import org.eclipse.osee.orcs.db.internal.transaction.TxSqlBuilderImpl;
import org.eclipse.osee.orcs.db.internal.transaction.UnsubscribeTransaction;
+import org.eclipse.osee.orcs.db.internal.types.IOseeModelingService;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java
index 583d1f00660..7e68e416fa4 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java
@@ -18,7 +18,6 @@ import java.sql.Timestamp;
import java.util.Collection;
import java.util.Date;
import java.util.List;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.database.schema.DatabaseCallable;
import org.eclipse.osee.database.schema.DatabaseTxCallable;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -30,7 +29,6 @@ import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
import org.eclipse.osee.framework.core.operation.OperationLogger;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.OseeConnection;
@@ -60,6 +58,7 @@ import org.eclipse.osee.orcs.db.internal.exchange.transform.ExchangeTransformPro
import org.eclipse.osee.orcs.db.internal.exchange.transform.ExchangeTransformer;
import org.eclipse.osee.orcs.db.internal.exchange.transform.IExchangeTransformProvider;
import org.eclipse.osee.orcs.db.internal.resource.ResourceConstants;
+import org.eclipse.osee.orcs.db.internal.types.IOseeModelingService;
/**
* @author Roberto E. Escobar
@@ -287,7 +286,7 @@ public class ImportBranchDatabaseCallable extends DatabaseCallable<URI> {
OseeImportModelResponse response = new OseeImportModelResponse();
getLogger().info("Updating Type Model with [%s]", model);
- typeModelService.importOseeTypes(new NullProgressMonitor(), true, modelRequest, response);
+ typeModelService.importOseeTypes(true, modelRequest, response);
getLogger().info("Type Model Import complete");
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
index 3753449b7bf..06995c0808e 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
@@ -17,7 +17,6 @@ import java.util.Random;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IOseeSequence;
import org.eclipse.osee.framework.database.core.OseeConnection;
@@ -32,6 +31,7 @@ import org.eclipse.osee.orcs.db.internal.exchange.export.ManifestExportItem;
import org.eclipse.osee.orcs.db.internal.exchange.export.MetadataExportItem;
import org.eclipse.osee.orcs.db.internal.exchange.export.OseeTypeModelExportItem;
import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
+import org.eclipse.osee.orcs.db.internal.types.IOseeModelingService;
public class ExportItemFactory {
private static final String GET_MAX_TX =
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/OseeTypeModelExportItem.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/OseeTypeModelExportItem.java
index 981e27c9ab9..6fefec6dad7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/OseeTypeModelExportItem.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/OseeTypeModelExportItem.java
@@ -13,11 +13,10 @@ package org.eclipse.osee.orcs.db.internal.exchange.export;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
+import org.eclipse.osee.orcs.db.internal.types.IOseeModelingService;
/**
* @author Roberto E. Escobar
@@ -36,7 +35,7 @@ public class OseeTypeModelExportItem extends AbstractExportItem {
OutputStream outputStream = null;
try {
outputStream = new FileOutputStream(outputFile);
- modelingService.exportOseeTypes(new NullProgressMonitor(), outputStream);
+ modelingService.exportOseeTypes(outputStream);
} finally {
Lib.close(outputStream);
}
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingServiceFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/CacheServiceFactory.java
index 8bb63c28ea5..7205e0a2140 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingServiceFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/CacheServiceFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
+ * Copyright (c) 2013 Boeing.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,14 +8,16 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.services;
+package org.eclipse.osee.orcs.db.internal.types;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.services.IOseeCachingService;
/**
* @author Roberto E. Escobar
*/
-public interface IOseeCachingServiceFactory {
+public interface CacheServiceFactory {
IOseeCachingService createCachingService(boolean needsPriming) throws OseeCoreException;
+
}
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeModelingService.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/IOseeModelingService.java
index 683388b5668..9fb24b6502e 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeModelingService.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/IOseeModelingService.java
@@ -8,10 +8,9 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.services;
+package org.eclipse.osee.orcs.db.internal.types;
import java.io.OutputStream;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
@@ -21,8 +20,8 @@ import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
*/
public interface IOseeModelingService {
- void importOseeTypes(IProgressMonitor monitor, boolean isInitializing, OseeImportModelRequest request, OseeImportModelResponse response) throws OseeCoreException;
+ void importOseeTypes(boolean isInitializing, OseeImportModelRequest request, OseeImportModelResponse response) throws OseeCoreException;
- void exportOseeTypes(IProgressMonitor monitor, OutputStream outputStream) throws OseeCoreException;
+ void exportOseeTypes(OutputStream outputStream) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeModelingServiceImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeModelingServiceImpl.java
new file mode 100644
index 00000000000..077f601f108
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeModelingServiceImpl.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.db.internal.types;
+
+import java.io.OutputStream;
+import org.eclipse.osee.event.EventService;
+import org.eclipse.osee.executor.admin.ExecutorAdmin;
+import org.eclipse.osee.framework.core.dsl.OseeDslResource;
+import org.eclipse.osee.framework.core.dsl.OseeDslResourceUtil;
+import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDsl;
+import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDslFactory;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.eclipse.osee.framework.core.model.OseeCachingService;
+import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
+import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
+import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
+import org.eclipse.osee.framework.core.model.cache.AttributeTypeCache;
+import org.eclipse.osee.framework.core.model.cache.BranchCache;
+import org.eclipse.osee.framework.core.model.cache.OseeEnumTypeCache;
+import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
+import org.eclipse.osee.framework.core.model.cache.TransactionCache;
+import org.eclipse.osee.framework.core.model.type.ArtifactType;
+import org.eclipse.osee.framework.core.model.type.AttributeType;
+import org.eclipse.osee.framework.core.model.type.OseeEnumType;
+import org.eclipse.osee.framework.core.model.type.RelationType;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
+import org.eclipse.osee.framework.core.services.IdentityService;
+import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.db.internal.accessor.ArtifactTypeDataAccessor;
+import org.eclipse.osee.orcs.db.internal.accessor.DatabaseBranchAccessor;
+import org.eclipse.osee.orcs.db.internal.accessor.DatabaseTransactionRecordAccessor;
+import org.eclipse.osee.orcs.db.internal.accessor.TypeLoaderImpl;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class OseeModelingServiceImpl implements IOseeModelingService {
+
+ private final Log logger;
+ private final IOseeDatabaseService dbService;
+ private final IdentityService identityService;
+ private final ExecutorAdmin executorAdmin;
+ private final IResourceManager resourceManager;
+ private final IOseeModelFactoryService modelFactoryService;
+ private final IOseeCachingService caches;
+ private final EventService eventService;
+
+ public OseeModelingServiceImpl(Log logger, IOseeDatabaseService dbService, IdentityService identityService, ExecutorAdmin executorAdmin, IResourceManager resourceManager, IOseeModelFactoryService modelFactoryService, EventService eventService, IOseeCachingService caches) {
+ super();
+ this.logger = logger;
+ this.dbService = dbService;
+ this.identityService = identityService;
+ this.executorAdmin = executorAdmin;
+ this.resourceManager = resourceManager;
+ this.modelFactoryService = modelFactoryService;
+ this.caches = caches;
+ this.eventService = eventService;
+ }
+
+ @Override
+ public void exportOseeTypes(OutputStream outputStream) throws OseeCoreException {
+ OseeTypeCache cache =
+ new OseeTypeCache(caches.getArtifactTypeCache(), caches.getAttributeTypeCache(),
+ caches.getRelationTypeCache(), caches.getEnumTypeCache());
+
+ OseeDslFactory modelFactory = OseeDslFactory.eINSTANCE;
+ OseeDsl model = modelFactory.createOseeDsl();
+
+ IOperation operation = new OseeToXtextOperation(cache, modelFactory, model);
+ Operations.executeWorkAndCheckStatus(operation, null);
+ try {
+ OseeDslResourceUtil.saveModel(model, "osee:/oseeTypes_" + Lib.getDateTimeString() + ".osee", outputStream,
+ false);
+ } catch (Exception ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ }
+
+ @Override
+ public void importOseeTypes(boolean isInitializing, OseeImportModelRequest request, OseeImportModelResponse response) throws OseeCoreException {
+ String modelName = request.getModelName();
+ if (!modelName.endsWith(".osee")) {
+ modelName += ".osee";
+ }
+
+ OseeDsl inputModel = null;
+ try {
+ OseeDslResource dslResource = OseeDslResourceUtil.loadModel("osee:/" + modelName, request.getModel());
+ inputModel = dslResource.getModel();
+ } catch (Exception ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+
+ IOseeCachingService tempCacheService = createCachingService(false);
+ OseeTypeCache tempCache =
+ new OseeTypeCache(tempCacheService.getArtifactTypeCache(), tempCacheService.getAttributeTypeCache(),
+ tempCacheService.getRelationTypeCache(), tempCacheService.getEnumTypeCache());
+
+ IOperation operation =
+ new XTextToOseeTypeOperation(modelFactoryService, tempCache, tempCacheService.getBranchCache(), inputModel);
+ Operations.executeWorkAndCheckStatus(operation);
+
+ if (request.isPersistAllowed()) {
+ tempCache.storeAllModified();
+ response.setPersisted(true);
+ if (isInitializing) {
+ caches.clearAll();
+ }
+ caches.getEnumTypeCache().cacheFrom(tempCache.getEnumTypeCache());
+ caches.getAttributeTypeCache().cacheFrom(tempCache.getAttributeTypeCache());
+ caches.getArtifactTypeCache().cacheFrom(tempCache.getArtifactTypeCache());
+ caches.getRelationTypeCache().cacheFrom(tempCache.getRelationTypeCache());
+
+ caches.reloadAll();
+ } else {
+ response.setPersisted(false);
+ }
+ }
+
+ public IOseeCachingService createCachingService(boolean needsPriming) {
+ TransactionCache txCache = new TransactionCache();
+ BranchCache branchCache =
+ new BranchCache(new DatabaseBranchAccessor(logger, executorAdmin, eventService, dbService, txCache,
+ modelFactoryService.getBranchFactory()));
+ txCache.setAccessor(new DatabaseTransactionRecordAccessor(dbService, branchCache,
+ modelFactoryService.getTransactionFactory()));
+
+ TypeLoaderImpl loader =
+ new TypeLoaderImpl(this, identityService, dbService, resourceManager, branchCache, needsPriming);
+
+ OseeEnumTypeCache oseeEnumTypeCache =
+ new OseeEnumTypeCache(new ArtifactTypeDataAccessor<OseeEnumType>(identityService, loader));
+ AttributeTypeCache attributeCache =
+ new AttributeTypeCache(new ArtifactTypeDataAccessor<AttributeType>(identityService, loader));
+ ArtifactTypeCache artifactCache =
+ new ArtifactTypeCache(new ArtifactTypeDataAccessor<ArtifactType>(identityService, loader));
+ RelationTypeCache relationCache =
+ new RelationTypeCache(new ArtifactTypeDataAccessor<RelationType>(identityService, loader));
+
+ return new OseeCachingService(branchCache, txCache, artifactCache, attributeCache, relationCache,
+ oseeEnumTypeCache, identityService);
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeToXtextOperation.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeToXtextOperation.java
index ad7c9b90052..d71b9cf5bc8 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeToXtextOperation.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeToXtextOperation.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration;
+package org.eclipse.osee.orcs.db.internal.types;
import java.util.ArrayList;
import java.util.Collection;
@@ -17,8 +17,6 @@ import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.dsl.integration.internal.DslIntegrationConstants;
-import org.eclipse.osee.framework.core.dsl.integration.util.OseeUtil;
import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDsl;
import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDslFactory;
import org.eclipse.osee.framework.core.dsl.oseeDsl.RelationMultiplicityEnum;
@@ -48,7 +46,7 @@ public class OseeToXtextOperation extends AbstractOperation {
private final OseeTypeCache cache;
public OseeToXtextOperation(OseeTypeCache cache, OseeDslFactory factory, OseeDsl oseeModel) {
- super("OSEE to Text Model", DslIntegrationConstants.PLUGIN_ID);
+ super("OSEE to Text Model", "");
this.oseeModel = oseeModel;
this.factory = factory;
this.cache = cache;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeTypeCache.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeTypeCache.java
index 6a91dec2a11..16de7572eaa 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeTypeCache.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeTypeCache.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration;
+package org.eclipse.osee.orcs.db.internal.types;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeUtil.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeUtil.java
new file mode 100644
index 00000000000..a619dad205e
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/OseeUtil.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.db.internal.types;
+
+import org.eclipse.osee.framework.core.data.IRelationSorterId;
+import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.util.Conditions;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class OseeUtil {
+
+ private OseeUtil() {
+ // Utility Class
+ }
+
+ public static String getRelationOrderType(String guid) throws OseeCoreException {
+ IRelationSorterId type = RelationOrderBaseTypes.getFromGuid(guid);
+ return type.getName().replaceAll(" ", "_");
+ }
+
+ public static String orderTypeNameToGuid(String orderTypeName) throws OseeCoreException {
+ Conditions.checkNotNull(orderTypeName, "orderTypeName");
+ return RelationOrderBaseTypes.getFromOrderTypeName(orderTypeName.replaceAll("_", " ")).getGuid();
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/XTextToOseeTypeOperation.java
index c28ca7f9d25..234130aef8e 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/XTextToOseeTypeOperation.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.integration;
+package org.eclipse.osee.orcs.db.internal.types;
import java.util.ArrayList;
import java.util.Collection;
@@ -22,8 +22,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.EList;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.TokenFactory;
-import org.eclipse.osee.framework.core.dsl.integration.internal.DslIntegrationConstants;
-import org.eclipse.osee.framework.core.dsl.integration.util.OseeUtil;
import org.eclipse.osee.framework.core.dsl.oseeDsl.AddAttribute;
import org.eclipse.osee.framework.core.dsl.oseeDsl.AddEnum;
import org.eclipse.osee.framework.core.dsl.oseeDsl.AttributeOverrideOption;
@@ -67,7 +65,7 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
private final BranchCache branchCache;
public XTextToOseeTypeOperation(IOseeModelFactoryService provider, OseeTypeCache typeCache, BranchCache branchCache, OseeDsl model) {
- super("OSEE Text Model to OSEE", DslIntegrationConstants.PLUGIN_ID);
+ super("OSEE Text Model to OSEE", "");
this.provider = provider;
this.typeCache = typeCache;
this.branchCache = branchCache;
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java
index b3f0dbb6673..c15857c581b 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java
@@ -14,7 +14,6 @@ import org.eclipse.osee.event.EventService;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.core.services.IOseeModelingService;
import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.logger.Log;
@@ -41,7 +40,6 @@ public class OrcsIntegrationRule extends OsgiRule {
@OsgiService public IOseeDatabaseService dbService;
@OsgiService public IOseeModelFactoryService modelFactory;
@OsgiService public IOseeCachingService cachingService;
- @OsgiService public IOseeModelingService modelService;
// @formatter:on
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsApi.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsApi.java
index 339e6efa507..65137cb43e3 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsApi.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsApi.java
@@ -37,6 +37,8 @@ public interface OrcsApi {
OrcsPerformance getOrcsPerformance(ApplicationContext context);
+ OrcsTypes getOrcsTypes(ApplicationContext context);
+
// TODO remove this call
BranchCache getBranchCache();
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java
new file mode 100644
index 00000000000..0c81e672f3c
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs;
+
+import java.io.OutputStream;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.OseeImportModelRequest;
+import org.eclipse.osee.framework.core.model.OseeImportModelResponse;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface OrcsTypes {
+
+ void importOseeTypes(boolean isInitializing, OseeImportModelRequest request, OseeImportModelResponse response) throws OseeCoreException;
+
+ void exportOseeTypes(OutputStream outputStream) throws OseeCoreException;
+
+}

Back to the top