Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-06-27 06:01:32 +0000
committerrbrooks2010-06-27 06:01:32 +0000
commitd60e8693680bcafee1d855eedde2afcba6f1a8d7 (patch)
treee709b60d7122c350b3d8dc5d4f0618fe511a3cc4
parentf745bd7fa350dcdea09f3c8dde8a2ffaa346b58d (diff)
downloadorg.eclipse.osee-d60e8693680bcafee1d855eedde2afcba6f1a8d7.tar.gz
org.eclipse.osee-d60e8693680bcafee1d855eedde2afcba6f1a8d7.tar.xz
org.eclipse.osee-d60e8693680bcafee1d855eedde2afcba6f1a8d7.zip
fixed exporter to use type guids rather than type ids
-rw-r--r--org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java6
-rw-r--r--org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/RelationalExportItem.java17
-rw-r--r--org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/PropertyStoreWriter.java13
3 files changed, 25 insertions, 11 deletions
diff --git a/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java b/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java
index 9f680137baa..2c75ea65baf 100644
--- a/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java
+++ b/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java
@@ -101,16 +101,16 @@ public class ExchangeDb {
"SELECT txs1.GAMMA_ID, txs1.TRANSACTION_ID, txs1.TX_CURRENT, txs1.MOD_TYPE FROM osee_txs txs1, osee_tx_details txd1, osee_join_export_import jex1 WHERE txs1.transaction_id = txd1.transaction_id AND txd1.branch_id = jex1.id1 AND jex1.query_id=? %s";
private static final String ARTIFACT_TABLE_QUERY =
- "SELECT DISTINCT (art1.art_id), art1.GUID, art1.HUMAN_READABLE_ID, art1.ART_TYPE_ID FROM osee_artifact art1, osee_artifact_version artv1, osee_txs txs1, osee_tx_details txd1, osee_join_export_import jex1 WHERE art1.art_id = artv1.art_id AND artv1.gamma_id = txs1.gamma_id AND txs1.transaction_id = txd1.transaction_id AND txd1.branch_id = jex1.id1 AND jex1.query_id=? %s";
+ "SELECT DISTINCT (art1.art_id), aty.art_type_guid, art1.GUID, art1.HUMAN_READABLE_ID, art1.ART_TYPE_ID FROM osee_artifact art1, osee_artifact_type aty, osee_artifact_version artv1, osee_txs txs1, osee_tx_details txd1, osee_join_export_import jex1 WHERE art1.art_id = artv1.art_id AND art1.art_type_id = aty.art_type_id AND artv1.gamma_id = txs1.gamma_id AND txs1.transaction_id = txd1.transaction_id AND txd1.branch_id = jex1.id1 AND jex1.query_id=? %s";
private static final String ARTIFACT_VERSION_QUERY =
"SELECT DISTINCT (artv1.GAMMA_ID), artv1.ART_ID FROM osee_artifact_version artv1, osee_txs txs1, osee_tx_details txd1, osee_join_export_import jex1 WHERE artv1.gamma_id = txs1.gamma_id AND txs1.transaction_id = txd1.transaction_id AND txd1.branch_id = jex1.id1 AND jex1.query_id=? %s";
private static final String ATTRIBUTE_TABLE_QUERY =
- "SELECT DISTINCT (attr1.GAMMA_ID), attr1.ATTR_ID, attr1.ART_ID, attr1.VALUE, attr1.ATTR_TYPE_ID, attr1.URI FROM osee_attribute attr1, osee_txs txs1, osee_tx_details txd1, osee_join_export_import jex1 WHERE attr1.gamma_id = txs1.gamma_id AND txs1.transaction_id = txd1.transaction_id AND txd1.branch_id = jex1.id1 AND jex1.query_id=? %s";
+ "SELECT DISTINCT (attr1.GAMMA_ID), attr1.ATTR_ID, attr1.ART_ID, attr1.VALUE, attr1.ATTR_TYPE_ID, attr1.URI, aty.attr_type_guid FROM osee_attribute attr1, osee_attribute_type aty, osee_txs txs1, osee_tx_details txd1, osee_join_export_import jex1 WHERE attr1.attr_type_id = aty.attr_type_id AND attr1.gamma_id = txs1.gamma_id AND txs1.transaction_id = txd1.transaction_id AND txd1.branch_id = jex1.id1 AND jex1.query_id=? %s";
private static final String RELATION_LINK_TABLE_QUERY =
- "SELECT DISTINCT (rel1.GAMMA_ID), rel1.REL_LINK_ID, rel1.B_ART_ID, rel1.A_ART_ID, rel1.RATIONALE, rel1.REL_LINK_TYPE_ID FROM osee_relation_link rel1, osee_txs txs1, osee_tx_details txd1, osee_join_export_import jex1 WHERE rel1.gamma_id = txs1.gamma_id AND txs1.transaction_id = txd1.transaction_id AND txd1.branch_id = jex1.id1 AND jex1.query_id=? %s";
+ "SELECT DISTINCT (rel1.GAMMA_ID), rel1.REL_LINK_ID, rel1.B_ART_ID, rel1.A_ART_ID, rel1.RATIONALE, rel1.REL_LINK_TYPE_ID, ry.rel_link_type_guid FROM osee_relation_link rel1, osee_txs txs1, osee_tx_details txd1, osee_join_export_import jex1, osee_relation_link_type ry WHERE rel1.rel_link_type_id = ry.rel_link_type_id AND rel1.gamma_id = txs1.gamma_id AND txs1.transaction_id = txd1.transaction_id AND txd1.branch_id = jex1.id1 AND jex1.query_id=? %s";
private static final String MERGE_TABLE_QUERY =
"SELECT om1.* FROM osee_merge om1, osee_join_export_import jex1 WHERE om1.merge_branch_id = jex1.id1 AND jex1.query_id=? %s";
diff --git a/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/RelationalExportItem.java b/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/RelationalExportItem.java
index 90156f63bf0..e320baf7b77 100644
--- a/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/RelationalExportItem.java
+++ b/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/export/RelationalExportItem.java
@@ -16,6 +16,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Timestamp;
import java.sql.Types;
+
import org.eclipse.osee.framework.branch.management.exchange.ExchangeDb;
import org.eclipse.osee.framework.branch.management.exchange.ExportImportXml;
import org.eclipse.osee.framework.branch.management.exchange.handler.ExportItem;
@@ -57,8 +58,7 @@ public class RelationalExportItem extends AbstractDbExportItem {
tempFolder.mkdirs();
}
- IResourceLocator locator =
- Activator.getInstance().getResourceLocatorManager().getResourceLocator(uriTarget);
+ IResourceLocator locator = Activator.getInstance().getResourceLocatorManager().getResourceLocator(uriTarget);
IResource resource = Activator.getInstance().getResourceManager().acquire(locator, new Options());
File target = new File(tempFolder, locator.getRawPath());
@@ -125,8 +125,15 @@ public class RelationalExportItem extends AbstractDbExportItem {
} else if (name.equals(ExportImportXml.RATIONALE)) {
handleStringContent(rationaleBuffer, getWriteLocation(), chStmt.getString(name),
ExportImportXml.RATIONALE);
- } else if (name.equals(ExportImportXml.ART_TYPE_ID) || name.equals(ExportImportXml.ATTR_TYPE_ID) || name.equals(ExportImportXml.REL_TYPE_ID)) {
- ExportImportXml.addXmlAttribute(appendable, ExportImportXml.TYPE_GUID, chStmt.getString(name));
+ } else if (name.equals(ExportImportXml.ART_TYPE_ID)) {
+ String guid = chStmt.getString("ART_TYPE_GUID");
+ ExportImportXml.addXmlAttribute(appendable, ExportImportXml.TYPE_GUID, guid);
+ } else if (name.equals(ExportImportXml.ATTR_TYPE_ID)) {
+ String guid = chStmt.getString("ATTR_TYPE_GUID");
+ ExportImportXml.addXmlAttribute(appendable, ExportImportXml.TYPE_GUID, guid);
+ } else if (name.equals(ExportImportXml.REL_TYPE_ID)) {
+ String guid = chStmt.getString("REL_LINK_TYPE_GUID");
+ ExportImportXml.addXmlAttribute(appendable, ExportImportXml.TYPE_GUID, guid);
} else {
switch (chStmt.getColumnType(columnIndex)) {
case Types.TIMESTAMP:
@@ -196,4 +203,4 @@ public class RelationalExportItem extends AbstractDbExportItem {
public void cleanUp() {
super.cleanUp();
}
-}
+} \ No newline at end of file
diff --git a/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/PropertyStoreWriter.java b/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/PropertyStoreWriter.java
index 5122eaf00b6..3d13feed09f 100644
--- a/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/PropertyStoreWriter.java
+++ b/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/PropertyStoreWriter.java
@@ -124,6 +124,8 @@ public class PropertyStoreWriter {
private String tagListKey;
private boolean isInTagList;
private final Stack<Pair<String, PropertyStore>> innerStoreStack;
+ private String name;
+ private String uri;
public XMLReader() {
isInTagList = false;
@@ -155,12 +157,12 @@ public class PropertyStoreWriter {
}
private void process(PropertyStore store, XMLStreamReader reader) {
- String name = reader.getLocalName();
- String uri = reader.getNamespaceURI();
int eventType = reader.getEventType();
switch (eventType) {
case XMLStreamConstants.START_ELEMENT:
+ name = reader.getLocalName();
+ uri = reader.getNamespaceURI();
if (TAG_SECTION.equals(name)) {
if (isInNestedStore()) {
getCurrentInnerStore().setId(reader.getAttributeValue(uri, TAG_NAME));
@@ -182,6 +184,8 @@ public class PropertyStoreWriter {
}
break;
case XMLStreamConstants.END_ELEMENT:
+ name = reader.getLocalName();
+ uri = reader.getNamespaceURI();
if (TAG_LIST.equals(name)) {
isInTagList = false;
if (Strings.isValid(tagListKey) && valueList != null && !valueList.isEmpty()) {
@@ -204,7 +208,10 @@ public class PropertyStoreWriter {
store.put(completedKey, completedStore);
}
}
-
+ break;
+ case XMLStreamConstants.ENTITY_REFERENCE:
+ name = reader.getLocalName();
+ uri = reader.getNamespaceURI();
break;
default:
break;

Back to the top