Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2011-08-30 17:42:01 +0000
committerRyan D. Brooks2011-08-30 17:42:01 +0000
commit9d0f67f0c52c0790c27a632c7e351d61538317b0 (patch)
tree683e24af39341c65ee847c50052fd97116e0ba7a
parent040f08378e0c33d022a8041c3f3e8dff3a659f93 (diff)
downloadorg.eclipse.osee-9d0f67f0c52c0790c27a632c7e351d61538317b0.tar.gz
org.eclipse.osee-9d0f67f0c52c0790c27a632c7e351d61538317b0.tar.xz
org.eclipse.osee-9d0f67f0c52c0790c27a632c7e351d61538317b0.zip
feature[ats_M1Y56]: Make typeGuid optional
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeToXtextOperation.java19
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl/src/org/eclipse/osee/framework/core/dsl/OseeDsl.xtext8
2 files changed, 11 insertions, 16 deletions
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.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeToXtextOperation.java
index 3c50e4d9cf1..97e1921bb90 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.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/OseeToXtextOperation.java
@@ -99,7 +99,6 @@ public class OseeToXtextOperation extends AbstractOperation {
modelType.setName(enumType.getName());
modelType.setUuid(HexUtil.toString(enumType.getGuid()));
- modelType.setTypeGuid(modelType.getUuid());
for (OseeEnumEntry entry : enumType.values()) {
checkForCancelledStatus(monitor);
@@ -126,7 +125,6 @@ public class OseeToXtextOperation extends AbstractOperation {
modelType.setName(attributeType.getName());
modelType.setUuid(HexUtil.toString(attributeType.getGuid()));
- modelType.setTypeGuid(modelType.getUuid());
modelType.setBaseAttributeType(asPrimitiveType(attributeType.getBaseAttributeTypeId()));
modelType.setDataProvider(asPrimitiveType(attributeType.getAttributeProviderId()));
@@ -139,7 +137,7 @@ public class OseeToXtextOperation extends AbstractOperation {
OseeEnumType oseeEnumType = attributeType.getOseeEnumType();
if (oseeEnumType != null) {
- XOseeEnumType enumType = toModelEnumType(model, oseeEnumType);
+ XOseeEnumType enumType = toModelEnumType(model, oseeEnumType.getGuid());
modelType.setEnumType(enumType);
}
}
@@ -158,7 +156,6 @@ public class OseeToXtextOperation extends AbstractOperation {
modelType.setName(artifactType.getName());
modelType.setUuid(HexUtil.toString(artifactType.getGuid()));
- modelType.setTypeGuid(modelType.getUuid());
}
monitor.worked(calculateWork(workPercentage));
}
@@ -229,7 +226,6 @@ public class OseeToXtextOperation extends AbstractOperation {
modelType.setName(relationType.getName());
modelType.setUuid(HexUtil.toString(relationType.getGuid()));
- modelType.setTypeGuid(modelType.getUuid());
modelType.setDefaultOrderType(OseeUtil.getRelationOrderType(relationType.getDefaultOrderTypeGuid()));
modelType.setMultiplicity(RelationMultiplicityEnum.getByName(relationType.getMultiplicity().name()));
@@ -243,31 +239,30 @@ public class OseeToXtextOperation extends AbstractOperation {
monitor.worked(calculateWork(workPercentage));
}
- private XArtifactType getArtifactType(OseeDsl model, Long guid) throws OseeCoreException {
+ private XArtifactType getArtifactType(OseeDsl model, Long uuid) throws OseeCoreException {
for (XArtifactType type : model.getArtifactTypes()) {
Long normalizedGuid = HexUtil.toLong(type.getUuid());
- if (guid.equals(normalizedGuid)) {
+ if (uuid.equals(normalizedGuid)) {
return type;
}
}
return null;
}
- private XAttributeType getAttributeType(OseeDsl model, Long guid) throws OseeCoreException {
+ private XAttributeType getAttributeType(OseeDsl model, Long uuid) throws OseeCoreException {
for (XAttributeType type : model.getAttributeTypes()) {
Long normalizedGuid = HexUtil.toLong(type.getUuid());
- if (guid.equals(normalizedGuid)) {
+ if (uuid.equals(normalizedGuid)) {
return type;
}
}
return null;
}
- private XOseeEnumType toModelEnumType(OseeDsl model, OseeEnumType oseeEnumType) throws OseeCoreException {
- Long guid = oseeEnumType.getGuid();
+ private XOseeEnumType toModelEnumType(OseeDsl model, Long uuid) throws OseeCoreException {
for (XOseeEnumType type : model.getEnumTypes()) {
Long normalizedGuid = HexUtil.toLong(type.getUuid());
- if (guid.equals(normalizedGuid)) {
+ if (uuid.equals(normalizedGuid)) {
return type;
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl/src/org/eclipse/osee/framework/core/dsl/OseeDsl.xtext b/plugins/org.eclipse.osee.framework.core.dsl/src/org/eclipse/osee/framework/core/dsl/OseeDsl.xtext
index c109962869f..64493cff28d 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl/src/org/eclipse/osee/framework/core/dsl/OseeDsl.xtext
+++ b/plugins/org.eclipse.osee.framework.core.dsl/src/org/eclipse/osee/framework/core/dsl/OseeDsl.xtext
@@ -36,7 +36,7 @@ OseeType:
XArtifactType:
(abstract?='abstract')? 'artifactType' name=STRING ('extends'
superArtifactTypes+=[XArtifactType|STRING] (','
- superArtifactTypes+=[XArtifactType|STRING])*)? '{' 'guid' typeGuid=STRING
+ superArtifactTypes+=[XArtifactType|STRING])*)? '{' ('guid' typeGuid=STRING)?
'uuid' uuid=HEX_INT
(validAttributeTypes+=XAttributeTypeRef)* '}';
@@ -45,7 +45,7 @@ XAttributeTypeRef:
XAttributeType:
'attributeType' name=STRING ('extends' baseAttributeType=AttributeBaseType) ('overrides'
- override=[XAttributeType|STRING])? '{' 'guid' typeGuid=STRING 'uuid' uuid=HEX_INT 'dataProvider'
+ override=[XAttributeType|STRING])? '{' ('guid' typeGuid=STRING)? 'uuid' uuid=HEX_INT 'dataProvider'
dataProvider=('DefaultAttributeDataProvider' | 'UriAttributeDataProvider' | QUALIFIED_NAME) 'min' min=WHOLE_NUM_STR
'max' max=(WHOLE_NUM_STR | 'unlimited') ('taggerId' taggerId=('DefaultAttributeTaggerProvider' | QUALIFIED_NAME))?
('enumType' enumType=[XOseeEnumType|STRING])? ('description' description=STRING)? ('defaultValue'
@@ -57,7 +57,7 @@ AttributeBaseType:
QUALIFIED_NAME;
XOseeEnumType:
- 'oseeEnumType' name=STRING '{' 'guid' typeGuid=STRING 'uuid' uuid=HEX_INT (enumEntries+=XOseeEnumEntry)* '}';
+ 'oseeEnumType' name=STRING '{' ('guid' typeGuid=STRING)? 'uuid' uuid=HEX_INT (enumEntries+=XOseeEnumEntry)* '}';
XOseeEnumEntry:
'entry' name=STRING (ordinal=WHOLE_NUM_STR)? ('entryGuid' entryGuid=STRING)?;
@@ -76,7 +76,7 @@ RemoveEnum:
'remove' enumEntry=[XOseeEnumEntry|STRING];
XRelationType:
- 'relationType' name=STRING '{' 'guid' typeGuid=STRING 'uuid' uuid=HEX_INT
+ 'relationType' name=STRING '{' ('guid' typeGuid=STRING)? 'uuid' uuid=HEX_INT
'sideAName' sideAName=STRING 'sideAArtifactType' sideAArtifactType=[XArtifactType|STRING]
'sideBName' sideBName=STRING 'sideBArtifactType' sideBArtifactType=[XArtifactType|STRING]
'defaultOrderType' defaultOrderType=RelationOrderType 'multiplicity' multiplicity=RelationMultiplicityEnum '}';

Back to the top