Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorafinkbein2008-06-17 19:09:40 +0000
committerafinkbein2008-06-17 19:09:40 +0000
commitdc23a73d56cbeef933369a94fb5382e36e727ba9 (patch)
treeeb4509da05a8733d9ca47ceea3276b1381d45673
parentf49172380337c3689891fe9b835efc940db67043 (diff)
downloadorg.eclipse.osee-dc23a73d56cbeef933369a94fb5382e36e727ba9.tar.gz
org.eclipse.osee-dc23a73d56cbeef933369a94fb5382e36e727ba9.tar.xz
org.eclipse.osee-dc23a73d56cbeef933369a94fb5382e36e727ba9.zip
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/BasicTemplateAttributeHandler.java32
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TISAttributeHandler.java4
2 files changed, 25 insertions, 11 deletions
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/BasicTemplateAttributeHandler.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/BasicTemplateAttributeHandler.java
index a6b5ffddb5c..eb014796952 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/BasicTemplateAttributeHandler.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/BasicTemplateAttributeHandler.java
@@ -16,10 +16,13 @@ import java.sql.SQLException;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
+
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.attribute.Attribute;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeType;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+import org.eclipse.osee.framework.skynet.core.attribute.WordAttribute;
import org.eclipse.osee.framework.ui.skynet.render.word.WordMLProducer;
/**
@@ -41,11 +44,14 @@ public final class BasicTemplateAttributeHandler implements ITemplateAttributeHa
*/
@Override
public void process(WordMLProducer wordMl, Artifact artifact, TemplateAttribute templateAttribute) throws SQLException, IllegalStateException, IOException {
- Collection<Attribute<Object>> attributes = artifact.getAttributes(templateAttribute.getName());
- if (!attributes.isEmpty()) {
+ AttributeType attributeType = AttributeTypeManager.getTypeWithWordContentCheck(artifact,templateAttribute.getName());
+ Collection<Attribute<Object>> attributes = artifact.getAttributes(attributeType.getName());
+ if (!attributes.isEmpty()) {
Attribute<Object> attribute = attributes.iterator().next();
- AttributeType attributeType = attribute.getAttributeType();
+ attributeType = attribute.getAttributeType();
+
+
// check if the attribute descriptor name is in the ignore list.
if (ignoreAttributeExtensions.contains(attributeType.getName())) {
return;
@@ -63,15 +69,19 @@ public final class BasicTemplateAttributeHandler implements ITemplateAttributeHa
// if (templateAttribute.hasLabel()) {
// wordMl.addParagraph(templateAttribute.getLabel());
// }
- // }
-
- String valueList = Collections.toString(", ", artifact.getAttributes(templateAttribute.getName()));
- if (templateAttribute.hasFormatting()) {
- if (templateAttribute.getFormat().contains(">x<")) {
- wordMl.addWordMl(templateAttribute.getFormat().replace(">x<", ">" + valueList + "<"));
- }
+ //
+ String valueList;
+ if(attributeType.getName().equals(WordAttribute.WORD_TEMPLATE_CONTENT)){
+ wordMl.addWordMl((String)attribute.getValue());
} else {
- wordMl.addTextInsideParagraph(valueList);
+ valueList = Collections.toString(", ", artifact.getAttributes(templateAttribute.getName()));
+ if (templateAttribute.hasFormatting()) {
+ if (templateAttribute.getFormat().contains(">x<")) {
+ wordMl.addWordMl(templateAttribute.getFormat().replace(">x<", ">" + valueList + "<"));
+ }
+ } else {
+ wordMl.addTextInsideParagraph(valueList);
+ }
}
if (templateAttribute.isParagrapthWrap()) {
wordMl.endParagraph();
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TISAttributeHandler.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TISAttributeHandler.java
index c7d3f2d8c4b..4cda7a3246f 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TISAttributeHandler.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TISAttributeHandler.java
@@ -13,7 +13,9 @@ package org.eclipse.osee.framework.ui.skynet.render.word.template;
import java.io.IOException;
import java.sql.SQLException;
+
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.attribute.WordAttribute;
import org.eclipse.osee.framework.skynet.core.exception.AttributeDoesNotExist;
import org.eclipse.osee.framework.skynet.core.exception.MultipleAttributesExist;
import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
@@ -31,6 +33,8 @@ public class TISAttributeHandler implements ITemplateAttributeHandler {
public void process(WordMLProducer wordMl, Artifact artifact, TemplateAttribute attribute) throws SQLException, IllegalStateException, IOException, MultipleAttributesExist, AttributeDoesNotExist {
for (Artifact requirement : artifact.getRelatedArtifacts(CoreRelationEnumeration.Verification__Requirement)) {
wordMl.addParagraph(requirement.getSoleAttributeValue("Imported Paragraph Number") + "\t" + requirement.getDescriptiveName());
+ String str = requirement.getSoleAttributeValue(WordAttribute.WORD_TEMPLATE_CONTENT);
+ wordMl.addWordMl(str);
}
}

Back to the top