Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan E. Cook2017-09-06 15:55:49 -0400
committerMorgan E. Cook2017-09-08 17:15:21 -0400
commit212dbdd1c8f1b9c80b9c8d93127e26145ccd37ab (patch)
tree7a517155bea66cff4af81b0ed3f914a4a6e61490
parent5b5d434c6db6cd2bb22851fc341482177788788d (diff)
downloadorg.eclipse.osee-212dbdd1c8f1b9c80b9c8d93127e26145ccd37ab.tar.gz
org.eclipse.osee-212dbdd1c8f1b9c80b9c8d93127e26145ccd37ab.tar.xz
org.eclipse.osee-212dbdd1c8f1b9c80b9c8d93127e26145ccd37ab.zip
refactor: server
Signed-off-by: Morgan E. Cook <morgan.e.cook@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java13
-rw-r--r--plugins/org.eclipse.osee.define.report.api/.project5
-rw-r--r--plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.osee.define.report.api/OSGI-INF/renderer.class.registry.xml8
-rw-r--r--plugins/org.eclipse.osee.define.report.api/OSGI-INF/word.renderer.provider.xml7
-rw-r--r--plugins/org.eclipse.osee.define.report.api/build.properties3
-rw-r--r--plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/DefaultWordRenderer.java171
-rw-r--r--plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordEndpoint.java16
-rw-r--r--plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordOperations.java13
-rw-r--r--plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/NestedTemplateData.java81
-rw-r--r--plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/Renderer.java36
-rw-r--r--plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/RendererClassRegistry.java63
-rw-r--r--plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/TemplateData.java134
-rw-r--r--plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/DefineApiImpl.java3
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordEndpointImpl.java19
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordOperationsImpl.java37
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java3
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateProcessor.java (renamed from plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java)597
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java18
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/WordCoreUtil.java17
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/HttpWordUpdateRequest.java7
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java51
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DiffUsingRenderer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/TisRenderer.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java202
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClient.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java5
-rw-r--r--plugins/org.eclipse.osee.orcs/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/renderer/AttributeElement.java58
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/renderer/MetadataElement.java (renamed from plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/MetadataElement.java)2
40 files changed, 1228 insertions, 395 deletions
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java
index 6b1a0f92cd..e6d81cc4f6 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java
@@ -44,6 +44,7 @@ import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.util.RendererOption;
@@ -153,7 +154,6 @@ public class WordTemplateRendererTest {
rendererOptionsMap.put(PUBLISH_DIFF, true);
rendererOptionsMap.put(LINK_TYPE, LinkType.INTERNAL_DOC_REFERENCE_USE_NAME);
rendererOptionsMap.put(UPDATE_PARAGRAPH_NUMBERS, false);
- rendererOptionsMap.put(TRANSACTION_OPTION, null);
rendererOptionsMap.put(SKIP_ERRORS, true);
rendererOptionsMap.put(EXCLUDE_FOLDERS, true);
rendererOptionsMap.put(EXCLUDE_ARTIFACT_TYPES, new ArrayList<IArtifactType>());
@@ -171,16 +171,17 @@ public class WordTemplateRendererTest {
PermissionEnum.FULLACCESS);
Artifact programRoot = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(rootBranch);
+ Artifact commonRoot = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(CoreBranches.COMMON);
- templateFolder = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, rootBranch, "Templates");
+ templateFolder = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, CoreBranches.COMMON, "Templates");
swReqFolder = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, rootBranch, "Software Requirements");
docFolder = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, rootBranch, "Document Folder");
programRoot.addChild(docFolder);
- programRoot.addChild(templateFolder);
+ commonRoot.addChild(templateFolder);
programRoot.addChild(swReqFolder);
- setupTemplates(templateFolder, rootBranch);
+ setupTemplates(templateFolder, CoreBranches.COMMON); //rootbranch
templateFolder.persist("TEMPLATE FOLDER SETUP");
setUpDocFolder(docFolder, rootBranch);
@@ -423,16 +424,14 @@ public class WordTemplateRendererTest {
@Test
public void testPublishWithoutDiffUpdateParagraphNumbers() throws OseeCoreException {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(updateBranch, String.format("%s", method.getQualifiedTestName()));
modifyOption(BRANCH, updateBranch);
- modifyOption(TRANSACTION_OPTION, transaction);
modifyOption(PUBLISH_DIFF, false);
modifyOption(LINK_TYPE, LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER_AND_NAME);
modifyOption(UPDATE_PARAGRAPH_NUMBERS, true);
List<Artifact> artifacts = new ArrayList<>();
Artifact updateDoc = ArtifactQuery.getArtifactFromId(docFolder, updateBranch);
artifacts.add(updateDoc);
+
renderer.publish(singleTemplateAttrib, null, artifacts);
String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
diff --git a/plugins/org.eclipse.osee.define.report.api/.project b/plugins/org.eclipse.osee.define.report.api/.project
index b48cbd58b0..7420074391 100644
--- a/plugins/org.eclipse.osee.define.report.api/.project
+++ b/plugins/org.eclipse.osee.define.report.api/.project
@@ -20,6 +20,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
diff --git a/plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF
index 09d31ad6fe..63575e95ef 100644
--- a/plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF
@@ -8,14 +8,16 @@ Bundle-Vendor: Eclipse Open System Engineering Environment
Export-Package: org.eclipse.osee.define.report.api
Import-Package: javax.ws.rs,
javax.ws.rs.core,
+ org.eclipse.core.resources,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.model.datarights,
org.eclipse.osee.framework.core.model.type,
+ org.eclipse.osee.framework.core.util,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
- org.eclipse.osee.framework.jdk.core.util.xml,
org.eclipse.osee.framework.logging,
org.eclipse.osee.orcs,
+ org.eclipse.osee.framework.jdk.core.util.xml,
org.eclipse.osee.orcs.data,
org.json
diff --git a/plugins/org.eclipse.osee.define.report.api/OSGI-INF/renderer.class.registry.xml b/plugins/org.eclipse.osee.define.report.api/OSGI-INF/renderer.class.registry.xml
new file mode 100644
index 0000000000..5252027ad6
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.report.api/OSGI-INF/renderer.class.registry.xml
@@ -0,0 +1,8 @@
+<?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.define.report.api.RendererClassRegistry">
+ <implementation class="org.eclipse.osee.define.report.api.RendererClassRegistry"/>
+ <service>
+ <provide interface="org.eclipse.osee.define.report.api.RendererClassRegistry"/>
+ </service>
+ <reference bind="addProvider" cardinality="1..n" interface="org.eclipse.osee.define.report.api.Renderer" name="Renderer" policy="dynamic" unbind="removeProvider"/>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.define.report.api/OSGI-INF/word.renderer.provider.xml b/plugins/org.eclipse.osee.define.report.api/OSGI-INF/word.renderer.provider.xml
new file mode 100644
index 0000000000..2109fb4a43
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.report.api/OSGI-INF/word.renderer.provider.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.define.report.api.DefaultWordRenderer">
+ <implementation class="org.eclipse.osee.define.report.api.DefaultWordRenderer"/>
+ <service>
+ <provide interface="org.eclipse.osee.define.report.api.Renderer"/>
+ </service>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.define.report.api/build.properties b/plugins/org.eclipse.osee.define.report.api/build.properties
index 34d2e4d2da..c58ea2178c 100644
--- a/plugins/org.eclipse.osee.define.report.api/build.properties
+++ b/plugins/org.eclipse.osee.define.report.api/build.properties
@@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ OSGI-INF/
diff --git a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/DefaultWordRenderer.java b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/DefaultWordRenderer.java
new file mode 100644
index 0000000000..91164987ff
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/DefaultWordRenderer.java
@@ -0,0 +1,171 @@
+/*
+ * Created on Aug 31, 2017
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.define.report.api;
+
+import static org.eclipse.osee.framework.core.enums.PresentationType.DEFAULT_OPEN;
+import static org.eclipse.osee.framework.core.enums.PresentationType.GENERALIZED_EDIT;
+import static org.eclipse.osee.framework.core.enums.PresentationType.GENERAL_REQUESTED;
+import static org.eclipse.osee.framework.core.enums.PresentationType.PREVIEW;
+import static org.eclipse.osee.framework.core.enums.PresentationType.PRODUCE_ATTRIBUTE;
+import static org.eclipse.osee.framework.core.enums.PresentationType.RENDER_AS_HUMAN_READABLE_TEXT;
+import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED_EDIT;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.model.type.LinkType;
+import org.eclipse.osee.framework.core.util.RendererOption;
+import org.eclipse.osee.framework.core.util.WordMLProducer;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public class DefaultWordRenderer implements Renderer {
+
+ private final OrcsApi orcsApi;
+ private final DefineApi defineApi;
+ private final String sessionId;
+
+ public DefaultWordRenderer(OrcsApi orcsApi, DefineApi defineApi, String sessionId) {
+ this.orcsApi = orcsApi;
+ this.defineApi = defineApi;
+ this.sessionId = sessionId;
+ }
+
+ @Override
+ public void renderAttribute(AttributeTypeToken attributeType, ArtifactReadable artifact, PresentationType presentationType, WordMLProducer producer, String format, String label, String footer, Map<RendererOption, Object> rendererOptions) {
+ if (attributeType.equals(CoreAttributeTypes.WordTemplateContent)) {
+ String data = null;
+ LinkType linkType = rendererOptions.get(RendererOption.LINK_TYPE) == null ? null : LinkType.valueOf(
+ (String) rendererOptions.get(RendererOption.LINK_TYPE));
+
+ if (label.length() > 0) {
+ producer.addParagraph(label);
+ }
+
+ TransactionId txId = null;
+ if (artifact.isHistorical()) {
+ txId = artifact.getTransaction();
+ } else {
+ txId = TransactionId.SENTINEL;
+ }
+
+ String oseeLink = ArtifactURL.getOpenInOseeLink(artifact, presentationType, sessionId, orcsApi).toString();
+
+ WordTemplateContentData wtcData = new WordTemplateContentData();
+ wtcData.setArtId(artifact.getUuid());
+ wtcData.setBranch(artifact.getBranch());
+ wtcData.setFooter(footer);
+ wtcData.setIsEdit(presentationType == PresentationType.SPECIALIZED_EDIT);
+ wtcData.setLinkType(linkType != null ? linkType.toString() : null);
+ wtcData.setTxId(txId);
+ wtcData.setSessionId(sessionId);
+ wtcData.setOseeLink(oseeLink);
+ ArtifactId view = rendererOptions.get(
+ RendererOption.VIEW) == null ? ArtifactId.SENTINEL : (ArtifactId) rendererOptions.get(RendererOption.VIEW);
+ wtcData.setViewId(view == null ? ArtifactId.SENTINEL : view);
+
+ Pair<String, Set<String>> content = null;
+ try {
+ content = defineApi.getMSWordOperations().renderWordTemplateContent(wtcData);
+ } catch (Exception e) {
+ throw new OseeCoreException(e);
+ }
+
+ if (content != null) {
+ data = content.getFirst();
+ }
+
+ if (presentationType == PresentationType.SPECIALIZED_EDIT) {
+ OseeLinkBuilder linkBuilder = new OseeLinkBuilder();
+ producer.addEditParagraphNoEscape(linkBuilder.getStartEditImage(artifact.getGuid()));
+ producer.addWordMl(data);
+ producer.addEditParagraphNoEscape(linkBuilder.getEndEditImage(artifact.getGuid()));
+
+ } else if (data != null) {
+ producer.addWordMl(data);
+ }
+ producer.resetListValue();
+ } else {
+ boolean allAttrs = (boolean) rendererOptions.get(RendererOption.ALL_ATTRIBUTES);
+
+ producer.startParagraph();
+
+ if (allAttrs) {
+ if (!attributeType.matches(CoreAttributeTypes.PlainTextContent)) {
+ producer.addWordMl("<w:r><w:t> " + Xml.escape(attributeType.getName()) + ": </w:t></w:r>");
+ } else {
+ producer.addWordMl("<w:r><w:t> </w:t></w:r>");
+ }
+ } else {
+ // assumption: the label is of the form <w:r><w:t> text </w:t></w:r>
+ producer.addWordMl(label);
+ }
+
+ if (attributeType.equals(CoreAttributeTypes.RelationOrder)) {
+ // Do nothing. Relation Order will not be an attribute moving forward
+ } else {
+ String valueList = artifact.getAttributes(attributeType).toString();
+ if (format.contains(">x<")) {
+ producer.addWordMl(format.replace(">x<", ">" + Xml.escape(valueList).toString() + "<"));
+ } else {
+ producer.addTextInsideParagraph(valueList);
+ }
+ producer.endParagraph();
+ }
+ }
+ }
+
+ @Override
+ public int minimumRanking() {
+ return NO_MATCH;
+ }
+
+ @Override
+ public int getApplicabilityRating(PresentationType presentationType, ArtifactReadable artifact) {
+ if (presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED, PRODUCE_ATTRIBUTE)) {
+ return PRESENTATION_TYPE;
+ }
+ if (presentationType.matches(SPECIALIZED_EDIT, DEFAULT_OPEN)) {
+ return GENERAL_MATCH;
+ }
+ if (presentationType.matches(PREVIEW, RENDER_AS_HUMAN_READABLE_TEXT)) {
+ return BASE_MATCH;
+ }
+ return NO_MATCH;
+ }
+
+ @Override
+ public List<AttributeTypeToken> getOrderedAttributeTypes(ArtifactReadable artifact, Collection<? extends AttributeTypeToken> attributeTypes) {
+ ArrayList<AttributeTypeToken> orderedAttributeTypes = new ArrayList<>(attributeTypes.size());
+ AttributeTypeToken contentType = null;
+
+ for (AttributeTypeToken attributeType : attributeTypes) {
+ if (attributeType.matches(CoreAttributeTypes.WholeWordContent, CoreAttributeTypes.WordTemplateContent,
+ CoreAttributeTypes.PlainTextContent)) {
+ contentType = attributeType;
+ } else {
+ orderedAttributeTypes.add(attributeType);
+ }
+ }
+
+ Collections.sort(orderedAttributeTypes);
+ if (contentType != null) {
+ orderedAttributeTypes.add(contentType);
+ }
+ return orderedAttributeTypes;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordEndpoint.java b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordEndpoint.java
index 076d831c3d..63fd59be01 100644
--- a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordEndpoint.java
+++ b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordEndpoint.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.define.report.api;
+import java.io.InputStream;
import java.util.Set;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
@@ -33,6 +34,19 @@ public interface MSWordEndpoint {
@POST
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
- @Path("render")
+ @Path("render-applicability")
Pair<String, Set<String>> renderWordTemplateContent(WordTemplateContentData data) throws OseeCoreException;
+
+ @POST
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ @Path("template")
+ InputStream applyTemplate(TemplateData data);
+
+ @POST
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ @Path("nested-templates")
+ InputStream applyNestedTemplates(NestedTemplateData data);
+
}
diff --git a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordOperations.java b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordOperations.java
index 50860ec91b..0c733b4026 100644
--- a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordOperations.java
+++ b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/MSWordOperations.java
@@ -10,7 +10,16 @@
*******************************************************************************/
package org.eclipse.osee.define.report.api;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.UserId;
+import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.Pair;
public interface MSWordOperations {
@@ -19,4 +28,8 @@ public interface MSWordOperations {
public Pair<String, Set<String>> renderWordTemplateContent(WordTemplateContentData data);
+ InputStream applyTemplate(List<ArtifactId> artifacts, BranchId branch, UserId user, String sessionId, String templateContent, String templateOptions, String templateStyles, IContainer folder, String outlineNumber, String outlineType, PresentationType presentationType, Map<RendererOption, Object> rendererOptions);
+
+ InputStream applyNestedTemplates(ArtifactId masterTemplateArtifact, ArtifactId slaveTemplateArtifact, List<ArtifactId> artifacts, BranchId branch, UserId user, String sessionId, Map<RendererOption, Object> rendererOptions);
+
}
diff --git a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/NestedTemplateData.java b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/NestedTemplateData.java
new file mode 100644
index 0000000000..2e79b5a7ef
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/NestedTemplateData.java
@@ -0,0 +1,81 @@
+/*
+ * Created on Aug 31, 2017
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.define.report.api;
+
+import java.util.List;
+import java.util.Map;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.UserId;
+import org.eclipse.osee.framework.core.util.RendererOption;
+
+public class NestedTemplateData {
+
+ List<ArtifactId> artifacts;
+ BranchId branch;
+ UserId user;
+ String sessionId;
+ ArtifactId masterTemplate;
+ ArtifactId slaveTemplate;
+ Map<RendererOption, Object> rendererOptions;
+
+ public void setArtifacts(List<ArtifactId> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ public List<ArtifactId> getArtifacts() {
+ return artifacts;
+ }
+
+ public void setBranch(BranchId branch) {
+ this.branch = branch;
+ }
+
+ public BranchId getBranch() {
+ return branch;
+ }
+
+ public void setUser(UserId user) {
+ this.user = user;
+ }
+
+ public UserId getUser() {
+ return user;
+ }
+
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ public void setMasterTemplate(ArtifactId masterTemplate) {
+ this.masterTemplate = masterTemplate;
+ }
+
+ public ArtifactId getMasterTemplate() {
+ return masterTemplate;
+ }
+
+ public void setSlaveTemplate(ArtifactId slaveTemplate) {
+ this.slaveTemplate = slaveTemplate;
+ }
+
+ public ArtifactId getSlaveTemplate() {
+ return slaveTemplate;
+ }
+
+ public void setRendererOptions(Map<RendererOption, Object> rendererOptions) {
+ this.rendererOptions = rendererOptions;
+ }
+
+ public Map<RendererOption, Object> getRendererOptions() {
+ return rendererOptions;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/Renderer.java b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/Renderer.java
new file mode 100644
index 0000000000..18e76fd21e
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/Renderer.java
@@ -0,0 +1,36 @@
+/*
+ * Created on Aug 31, 2017
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.define.report.api;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
+import org.eclipse.osee.framework.core.util.WordMLProducer;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public interface Renderer {
+
+ public static final int SPECIALIZED_KEY_MATCH = 70;
+ public static final int SPECIALIZED_MATCH = 60;
+ public static final int PRESENTATION_SUBTYPE_MATCH = 50;
+ public static final int PRESENTATION_TYPE = 40;
+ public static final int SUBTYPE_TYPE_MATCH = 30;
+ public static final int ARTIFACT_TYPE_MATCH = 20;
+ public static final int GENERAL_MATCH = 10;
+ public static final int BASE_MATCH = 5;
+ public static final int NO_MATCH = -1;
+
+ public void renderAttribute(AttributeTypeToken attributeType, ArtifactReadable artifact, PresentationType presentationType, WordMLProducer producer, String format, String label, String footer, Map<RendererOption, Object> rendererOptions);
+
+ public int minimumRanking();
+
+ public int getApplicabilityRating(PresentationType presentationType, ArtifactReadable artifact);
+
+ public List<AttributeTypeToken> getOrderedAttributeTypes(ArtifactReadable artifact, Collection<? extends AttributeTypeToken> attributeTypes);
+}
diff --git a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/RendererClassRegistry.java b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/RendererClassRegistry.java
new file mode 100644
index 0000000000..f34fa58f71
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/RendererClassRegistry.java
@@ -0,0 +1,63 @@
+/*
+ * Created on Sep 5, 2017
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.define.report.api;
+
+import static org.eclipse.osee.framework.core.enums.PresentationType.DEFAULT_OPEN;
+import static org.eclipse.osee.framework.core.enums.PresentationType.GENERAL_REQUESTED;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public class RendererClassRegistry {
+
+ // TODO: Look at better option instead of CopyOnWriteArray
+ private final List<Renderer> list = new CopyOnWriteArrayList<Renderer>();
+
+ public void start() {
+ //
+
+ System.out.println("test");
+ }
+
+ public void stop() {
+ //
+ }
+
+ public void addProvider(Renderer provider) {
+ list.add(provider);
+ }
+
+ public void removeProvider(Renderer provider) {
+ list.remove(provider);
+ }
+
+ // add get best renderer method
+ public Renderer getBestRenderer(PresentationType presentationType, ArtifactReadable artifact) {
+ // TODO: how to do on server - UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT)
+ if (presentationType == DEFAULT_OPEN) {
+ presentationType = GENERAL_REQUESTED;
+ }
+
+ Renderer bestRendererPrototype = null;
+ int bestRating = Renderer.NO_MATCH;
+
+ for (Renderer renderer : list) {
+
+ int rating = renderer.getApplicabilityRating(presentationType, artifact);
+ if (rating > bestRating) {
+ bestRendererPrototype = renderer;
+ bestRating = rating;
+ }
+ }
+ if (bestRendererPrototype == null) {
+ throw new OseeStateException("No renderer configured for %s of %s", presentationType, artifact);
+ }
+
+ return bestRendererPrototype;
+ }
+}
diff --git a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/TemplateData.java b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/TemplateData.java
new file mode 100644
index 0000000000..59bc5d91b4
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/TemplateData.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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.define.report.api;
+
+import java.util.List;
+import java.util.Map;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.UserId;
+import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
+
+public class TemplateData {
+
+ List<ArtifactId> artifacts;
+ BranchId branch;
+ UserId user;
+ String sessionId;
+ String templateContent;
+ String templateOptions;
+ String templateStyles;
+ IContainer folder;
+ String outlineNumber;
+ String outlineType;
+ PresentationType presentationType;
+ Map<RendererOption, Object> rendererOptions;
+
+ public List<ArtifactId> getArtifacts() {
+ return artifacts;
+ }
+
+ public void setArtifacts(List<ArtifactId> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ public BranchId getBranch() {
+ return branch;
+ }
+
+ public void setBranch(BranchId branch) {
+ this.branch = branch;
+ }
+
+ public void setUser(UserId user) {
+ this.user = user;
+ }
+
+ public UserId getUser() {
+ return user;
+ }
+
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ public String getTemplateContent() {
+ return templateContent;
+ }
+
+ public void setTemplateContent(String templateContent) {
+ this.templateContent = templateContent;
+ }
+
+ public String getTemplateOptions() {
+ return templateOptions;
+ }
+
+ public void setTemplateOptions(String templateOptions) {
+ this.templateOptions = templateOptions;
+ }
+
+ public String getTemplateStyles() {
+ return templateStyles;
+ }
+
+ public void setTemplateStyles(String templateStyles) {
+ this.templateStyles = templateStyles;
+ }
+
+ public IContainer getFolder() {
+ return folder;
+ }
+
+ public void setFolder(IContainer folder) {
+ this.folder = folder;
+ }
+
+ public String getOutlineNumber() {
+ return outlineNumber;
+ }
+
+ public void setOutlineNumber(String outlineNumber) {
+ this.outlineNumber = outlineNumber;
+ }
+
+ public String getOutlineType() {
+ return outlineType;
+ }
+
+ public void setOutlineType(String outlineType) {
+ this.outlineType = outlineType;
+ }
+
+ public PresentationType getPresentationType() {
+ return presentationType;
+ }
+
+ public void setPresentationType(PresentationType presentationType) {
+ this.presentationType = presentationType;
+ }
+
+ public Map<RendererOption, Object> getRendererOptions() {
+ return rendererOptions;
+ }
+
+ public void setRendererOptions(Map<RendererOption, Object> rendererOptions) {
+ this.rendererOptions = rendererOptions;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF
index c7b93b646d..b10eb26f15 100644
--- a/plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.define.report/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Import-Package: com.google.common.base;version="15.0.0",
org.antlr.runtime.tree,
org.codehaus.jackson;version="1.9.13",
org.codehaus.jackson.map;version="1.9.13",
+ org.eclipse.core.resources,
org.eclipse.osee.app,
org.eclipse.osee.ats.core.config,
org.eclipse.osee.ats.core.users,
@@ -34,6 +35,7 @@ Import-Package: com.google.common.base;version="15.0.0",
org.eclipse.osee.framework.jdk.core.text.change,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
+ org.eclipse.osee.framework.jdk.core.util.io,
org.eclipse.osee.framework.jdk.core.util.io.xml,
org.eclipse.osee.framework.jdk.core.util.xml,
org.eclipse.osee.framework.logging,
@@ -41,12 +43,15 @@ Import-Package: com.google.common.base;version="15.0.0",
org.eclipse.osee.logger,
org.eclipse.osee.orcs,
org.eclipse.osee.orcs.data,
+ org.eclipse.osee.orcs.renderer,
org.eclipse.osee.orcs.rest.model,
org.eclipse.osee.orcs.search,
org.eclipse.osee.orcs.transaction,
org.eclipse.osee.template.engine,
+ org.eclipse.swt.program,
org.json,
org.osgi.service.event
Bundle-Vendor: Eclipse Open System Engineering Environment
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.osee.ats.api
+Require-Bundle: org.eclipse.osee.ats.api,
+ org.eclipse.core.runtime
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/DefineApiImpl.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/DefineApiImpl.java
index 2d0f0baa45..96b3326d12 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/DefineApiImpl.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/DefineApiImpl.java
@@ -44,9 +44,10 @@ public class DefineApiImpl implements DefineApi {
}
public void start() {
- wordOperations = new MSWordOperationsImpl(orcsApi, logger, eventAdmin);
+
dataRightsOperations = new DataRightsOperationsImpl(orcsApi);
traceabilityOperations = new TraceabilityOperationsImpl(orcsApi);
+ wordOperations = new MSWordOperationsImpl(orcsApi, logger, eventAdmin, dataRightsOperations);
}
@Override
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordEndpointImpl.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordEndpointImpl.java
index 1401cc805b..95ecc8680e 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordEndpointImpl.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordEndpointImpl.java
@@ -10,12 +10,15 @@
*******************************************************************************/
package org.eclipse.osee.define.report;
+import java.io.InputStream;
import java.util.Set;
import org.eclipse.osee.define.report.api.DefineApi;
+import org.eclipse.osee.define.report.api.MSWordEndpoint;
+import org.eclipse.osee.define.report.api.NestedTemplateData;
+import org.eclipse.osee.define.report.api.TemplateData;
import org.eclipse.osee.define.report.api.WordTemplateContentData;
import org.eclipse.osee.define.report.api.WordUpdateChange;
import org.eclipse.osee.define.report.api.WordUpdateData;
-import org.eclipse.osee.define.report.api.MSWordEndpoint;
import org.eclipse.osee.framework.jdk.core.type.Pair;
/**
@@ -38,4 +41,18 @@ public final class MSWordEndpointImpl implements MSWordEndpoint {
public Pair<String, Set<String>> renderWordTemplateContent(WordTemplateContentData data) {
return defineApi.getMSWordOperations().renderWordTemplateContent(data);
}
+
+ @Override
+ public InputStream applyTemplate(TemplateData data) {
+ return defineApi.getMSWordOperations().applyTemplate(data.getArtifacts(), data.getBranch(), data.getUser(), data.getSessionId(),
+ data.getTemplateContent(), data.getTemplateOptions(), data.getTemplateStyles(), data.getFolder(),
+ data.getOutlineNumber(), data.getOutlineType(), data.getPresentationType(), data.getRendererOptions());
+ }
+
+ @Override
+ public InputStream applyNestedTemplates(NestedTemplateData data) {
+ return defineApi.getMSWordOperations().applyNestedTemplates(data.getMasterTemplate(), data.getSlaveTemplate(),
+ data.getArtifacts(), data.getBranch(), data.getUser(), data.getSessionId(), data.getRendererOptions());
+
+ }
}
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordOperationsImpl.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordOperationsImpl.java
index 4828402e98..0138001e95 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordOperationsImpl.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/MSWordOperationsImpl.java
@@ -10,16 +10,28 @@
*******************************************************************************/
package org.eclipse.osee.define.report;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.osee.define.report.api.DataRightsOperations;
import org.eclipse.osee.define.report.api.MSWordOperations;
import org.eclipse.osee.define.report.api.WordTemplateContentData;
import org.eclipse.osee.define.report.api.WordUpdateChange;
import org.eclipse.osee.define.report.api.WordUpdateData;
import org.eclipse.osee.define.report.internal.wordupdate.WordTemplateContentRendererHandler;
+import org.eclipse.osee.define.report.internal.wordupdate.WordTemplateProcessor;
import org.eclipse.osee.define.report.internal.wordupdate.WordUpdateArtifact;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.UserId;
+import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.osgi.service.event.EventAdmin;
public class MSWordOperationsImpl implements MSWordOperations {
@@ -27,23 +39,42 @@ public class MSWordOperationsImpl implements MSWordOperations {
private final OrcsApi orcsApi;
private final Log logger;
private final EventAdmin eventAdmin;
+ private final DataRightsOperations dataRights;
- public MSWordOperationsImpl(OrcsApi orcsApi, Log logger, EventAdmin eventAdmin) {
+ public MSWordOperationsImpl(OrcsApi orcsApi, Log logger, EventAdmin eventAdmin, DataRightsOperations dataRights) {
this.orcsApi = orcsApi;
this.logger = logger;
this.eventAdmin = eventAdmin;
+ this.dataRights = dataRights;
}
@Override
public Pair<String, Set<String>> renderWordTemplateContent(WordTemplateContentData data) {
- WordTemplateContentRendererHandler wordRendererHandler = new WordTemplateContentRendererHandler(orcsApi, logger);
+ WordTemplateContentRendererHandler wordRendererHandler = new WordTemplateContentRendererHandler(orcsApi);
return wordRendererHandler.renderWordML(data);
}
@Override
public WordUpdateChange updateWordArtifacts(WordUpdateData data) {
- WordUpdateArtifact updateArt = new WordUpdateArtifact(logger, orcsApi, eventAdmin);
+ WordUpdateArtifact updateArt = new WordUpdateArtifact(orcsApi, eventAdmin);
return updateArt.updateArtifacts(data);
}
+
+ @Override
+ public InputStream applyTemplate(List<ArtifactId> artifacts, BranchId branch, UserId user, String sessionId, String templateContent, String templateOptions, String templateStyles, IContainer folder, String outlineNumber, String outlineType, PresentationType presentationType, Map<RendererOption, Object> rendererOptions) {
+ WordTemplateProcessor wtp = new WordTemplateProcessor(orcsApi, dataRights, user, sessionId, this);
+ List<ArtifactReadable> artifactReadables =
+ orcsApi.getQueryFactory().fromBranch(branch).andIds(artifacts).getResults().getList();
+
+ return wtp.applyTemplate(artifactReadables, templateContent, templateOptions, templateStyles, folder,
+ outlineNumber, outlineType, presentationType, rendererOptions);
+ }
+
+ @Override
+ public InputStream applyNestedTemplates(ArtifactId masterTemplateArtifact, ArtifactId slaveTemplateArtifact, List<ArtifactId> artifacts, BranchId branch, UserId user, String sessionId, Map<RendererOption, Object> rendererOptions) {
+ WordTemplateProcessor wtp = new WordTemplateProcessor(orcsApi, dataRights, user, sessionId, this);
+ return wtp.applyNestedTemplates(masterTemplateArtifact, slaveTemplateArtifact, artifacts, branch,
+ rendererOptions);
+ }
}
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java
index 71ae6d9f0a..796019fffe 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java
@@ -44,9 +44,8 @@ public class WordTemplateContentRendererHandler {
private WordMLApplicabilityHandler applicHandler;
- public WordTemplateContentRendererHandler(OrcsApi orcsApi, Log logger) {
+ public WordTemplateContentRendererHandler(OrcsApi orcsApi) {
this.orcsApi = orcsApi;
- this.logger = logger;
}
public Pair<String, Set<String>> renderWordML(WordTemplateContentData wtcData) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateProcessor.java
index b74828c0e9..447ee07ee0 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateProcessor.java
@@ -9,39 +9,41 @@
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet.render.word;
+package org.eclipse.osee.define.report.internal.wordupdate;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Partition;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.SeverityCategory;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.WordTemplateContent;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import static org.eclipse.osee.framework.core.enums.PresentationType.PREVIEW;
import java.io.InputStream;
import java.io.StringWriter;
-import java.io.Writer;
import java.nio.charset.CharacterCodingException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
-import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import javax.ws.rs.core.MediaType;
+import javax.script.ScriptContext;
+import javax.script.ScriptException;
+import javax.script.SimpleScriptContext;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.define.report.api.DataRightsOperations;
+import org.eclipse.osee.define.report.api.MSWordOperations;
+import org.eclipse.osee.define.report.api.Renderer;
+import org.eclipse.osee.define.report.api.RendererClassRegistry;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
import org.eclipse.osee.framework.core.data.ArtifactId;
@@ -49,12 +51,15 @@ import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.model.datarights.DataRightResult;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
+import org.eclipse.osee.framework.core.util.OsgiUtil;
import org.eclipse.osee.framework.core.util.PageOrientation;
import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.core.util.RendererUtil;
@@ -62,25 +67,17 @@ import org.eclipse.osee.framework.core.util.ReportConstants;
import org.eclipse.osee.framework.core.util.WordMLProducer;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.jdk.core.util.io.CharBackedInputStream;
import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.util.AIFile;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactLoader;
-import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.skynet.internal.ServiceUtil;
-import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
-import org.eclipse.osee.framework.ui.skynet.render.RenderingUtil;
-import org.eclipse.osee.framework.ui.skynet.render.WordTemplateRenderer;
-import org.eclipse.osee.framework.ui.skynet.util.WordUiUtil;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.osee.orcs.rest.client.OseeClient;
-import org.eclipse.osee.orcs.rest.model.ApplicabilityEndpoint;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+import org.eclipse.osee.orcs.data.AttributeReadable;
+import org.eclipse.osee.orcs.renderer.AttributeElement;
+import org.eclipse.osee.orcs.renderer.MetadataElement;
+import org.eclipse.osee.orcs.search.QueryFactory;
+import org.eclipse.osee.orcs.transaction.TransactionBuilder;
import org.eclipse.swt.program.Program;
import org.json.JSONArray;
import org.json.JSONException;
@@ -95,8 +92,6 @@ import org.json.JSONObject;
*/
public class WordTemplateProcessor {
- private static final String LOAD_EXCLUDED_ARTIFACTIDS =
- "select art_id from osee_artifact art, osee_txs txs where art.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.tx_current = 1 and not exists (select null from osee_tuple2 t2, osee_txs txsP where tuple_type = 2 and e1 = ? and t2.gamma_id = txsP.gamma_id and txsP.branch_id = ? and txsP.tx_current = 1 and e2 = txs.app_id)";
private static final String ARTIFACT = "Artifact";
private static final String ARTIFACT_TYPE = "Artifact Type";
private static final Object ARTIFACT_ID = "Artifact Id";
@@ -149,55 +144,70 @@ public class WordTemplateProcessor {
private final List<AttributeElement> attributeElements = new LinkedList<>();
private final List<MetadataElement> metadataElements = new LinkedList<>();
- final List<Artifact> nonTemplateArtifacts = new LinkedList<>();
+ final List<ArtifactId> nonTemplateArtifacts = new LinkedList<>();
private final Set<String> ignoreAttributeExtensions = new HashSet<>();
- private final Set<Artifact> processedArtifacts = new HashSet<>();
- private final WordTemplateRenderer renderer;
- private boolean isDiff;
+ private final Set<ArtifactId> processedArtifacts = new HashSet<>();
+
private boolean excludeFolders;
private CharSequence paragraphNumber = null;
private IArtifactType[] excludeArtifactTypes;
private HashMap<ApplicabilityId, ApplicabilityToken> applicabilityTokens;
- private HashMap<ArtifactId, ArtifactId> artifactsToExclude;
-
- public WordTemplateProcessor(WordTemplateRenderer renderer) {
- this.renderer = renderer;
+ private Set<ArtifactId> artifactsToExclude;
+
+ // Needed as global
+ private final OrcsApi orcsApi;
+ private final DataRightsOperations dataRightsOperations;
+ private final MSWordOperations msWordOperations;
+ private final QueryFactory queryFactory;
+ private Map<RendererOption, Object> rendererOptions;
+ private final UserId user;
+ private final String sessionId;
+
+ public WordTemplateProcessor(OrcsApi orcsApi, DataRightsOperations dataRightsOperations, UserId user, String sessionId, MSWordOperations msWordOperations) {
loadIgnoreAttributeExtensions();
- artifactsToExclude = new HashMap<>();
+ artifactsToExclude = new HashSet<>();
+ this.user = user;
+ this.sessionId = sessionId;
+ this.orcsApi = orcsApi;
+ this.dataRightsOperations = dataRightsOperations;
+ this.msWordOperations = msWordOperations;
+ queryFactory = orcsApi.getQueryFactory();
}
/**
* Parse through template to find xml defining artifact sets and replace it with the result of publishing those
* artifacts Only used by Publish SRS
*/
- public void publishWithNestedTemplates(Artifact masterTemplateArtifact, Artifact slaveTemplateArtifact, List<Artifact> artifacts) throws OseeCoreException {
+ public InputStream applyNestedTemplates(ArtifactId masterTemplateArtifact, ArtifactId slaveTemplateArtifact, List<ArtifactId> artifacts, BranchId branch, Map<RendererOption, Object> rendererOptions) {
+ this.rendererOptions = rendererOptions;
nestedCount = 0;
- String masterTemplate = masterTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, "");
+ ArtifactReadable masterTemplateReadable =
+ queryFactory.fromBranch(CoreBranches.COMMON).andId(masterTemplateArtifact).getResults().getOneOrNull();
+ String masterTemplate = masterTemplateReadable.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, "");
+
String masterTemplateOptions =
- masterTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.RendererOptions, "");
+ masterTemplateReadable.getSoleAttributeValue(CoreAttributeTypes.RendererOptions, "");
+
slaveTemplate = "";
slaveTemplateOptions = "";
- isDiff = (boolean) renderer.getRendererOptionValue(RendererOption.PUBLISH_DIFF);
- renderer.updateOption(RendererOption.TEMPLATE_ARTIFACT, masterTemplateArtifact);
+
+ this.rendererOptions.put(RendererOption.TEMPLATE_OPTION, masterTemplateArtifact);
slaveTemplateStyles = "";
if (slaveTemplateArtifact != null) {
- renderer.updateOption(RendererOption.TEMPLATE_ARTIFACT, slaveTemplateArtifact);
- slaveTemplate = slaveTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, "");
- slaveTemplateOptions =
- slaveTemplateArtifact.getSoleAttributeValueAsString(CoreAttributeTypes.RendererOptions, "");
+ ArtifactReadable slaveTemplateReadable =
+ queryFactory.fromBranch(CoreBranches.COMMON).andId(masterTemplateArtifact).getResults().getOneOrNull();
+
+ this.rendererOptions.put(RendererOption.TEMPLATE_OPTION, slaveTemplateArtifact);
+ slaveTemplate = slaveTemplateReadable.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, "");
+ slaveTemplateOptions = slaveTemplateReadable.getSoleAttributeValue(CoreAttributeTypes.RendererOptions, "");
- List<Artifact> slaveTemplateRelatedArtifacts =
- slaveTemplateArtifact.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo);
+ ArtifactReadable slaveTemplateRelatedArtifacts =
+ slaveTemplateReadable.getRelated(CoreRelationTypes.SupportingInfo_SupportingInfo).getAtMostOneOrNull();
if (slaveTemplateRelatedArtifacts != null) {
- if (slaveTemplateRelatedArtifacts.size() == 1) {
- slaveTemplateStyles += slaveTemplateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
- CoreAttributeTypes.WholeWordContent, "");
- } else {
- OseeLog.log(this.getClass(), Level.INFO,
- "More than one style relation currently not supported. Defaulting to styles defined in the template.");
- }
+ slaveTemplateStyles +=
+ slaveTemplateRelatedArtifacts.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, "");
}
}
@@ -216,58 +226,68 @@ public class WordTemplateProcessor {
}
// Need to check if all attributes will be published. If so set the AllAttributes option.
// Assumes that all (*) will not be used when other attributes are specified
- renderer.updateOption(RendererOption.ALL_ATTRIBUTES, false);
+ this.rendererOptions.put(RendererOption.ALL_ATTRIBUTES, false);
if (attributeElements.size() == 1) {
String attributeName = attributeElements.get(0).getAttributeName();
if (attributeName.equals("*")) {
- renderer.updateOption(RendererOption.ALL_ATTRIBUTES, true);
+ rendererOptions.put(RendererOption.ALL_ATTRIBUTES, true);
+
}
}
- List<Artifact> masterTemplateRelatedArtifacts =
- masterTemplateArtifact.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo);
+ ArtifactReadable masterTemplateRelatedArtifacts =
+ masterTemplateReadable.getRelated(CoreRelationTypes.SupportingInfo_SupportingInfo).getOneOrNull();
+
String masterTemplateStyles = "";
if (masterTemplateRelatedArtifacts != null) {
- if (masterTemplateRelatedArtifacts.size() == 1) {
- masterTemplateStyles += masterTemplateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
- CoreAttributeTypes.WholeWordContent, "");
- } else {
- OseeLog.log(this.getClass(), Level.INFO,
- "More than one style relation currently not supported. Defaulting to styles defined in the template.");
- }
+ masterTemplateStyles +=
+ masterTemplateRelatedArtifacts.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, "");
+
}
getExcludeArtifactTypes();
- IFile file = RendererUtil.getRenderFile(COMMON, PREVIEW, "/", masterTemplateArtifact.getSafeName(), ".xml");
- renderer.updateOption(RendererOption.RESULT_PATH_RETURN, file.getLocation().toOSString());
+ IFile file = RendererUtil.getRenderFile(COMMON, PREVIEW, "/", masterTemplateReadable.getName(), ".xml");
+ this.rendererOptions.put(RendererOption.RESULT_PATH_RETURN, file.getLocation().toOSString());
+
+ List<ArtifactReadable> artifactReadables =
+ queryFactory.fromBranch(branch).andIds(artifacts).getResults().getList();
+
+ //TODO: return input stream
+ // AIFile.writeToFile(file, applyTemplate(artifactReadables, masterTemplate, masterTemplateOptions,
+ // masterTemplateStyles, file.getParent(), null, null, PREVIEW, this.rendererOptions));
- AIFile.writeToFile(file, applyTemplate(artifacts, masterTemplate, masterTemplateOptions, masterTemplateStyles,
- file.getParent(), null, null, PREVIEW));
+ boolean noDisplay = this.rendererOptions.get(
+ RendererOption.NO_DISPLAY) == null ? false : (boolean) this.rendererOptions.get(RendererOption.NO_DISPLAY);
+ boolean pubDiff = this.rendererOptions.get(
+ RendererOption.PUBLISH_DIFF) == null ? false : (boolean) this.rendererOptions.get(RendererOption.PUBLISH_DIFF);
- if (!((boolean) renderer.getRendererOptionValue(RendererOption.NO_DISPLAY)) && !isDiff) {
- RenderingUtil.ensureFilenameLimit(file);
+ if (!noDisplay && !pubDiff) {
+ RendererUtil.ensureFilenameLimit(file);
wordApp.execute(file.getLocation().toFile().getAbsolutePath());
}
+
+ return null;
}
private IArtifactType[] getExcludeArtifactTypes() {
excludeArtifactTypes = null;
-
- Object o = renderer.getRendererOptionValue(RendererOption.EXCLUDE_ARTIFACT_TYPES);
- if (o instanceof Collection<?>) {
- Collection<?> coll = (Collection<?>) o;
- excludeArtifactTypes = new IArtifactType[coll.size()];
- int i = 0;
- Iterator<?> iterator = coll.iterator();
- while (iterator.hasNext()) {
- Object next = iterator.next();
- if (next instanceof IArtifactType) {
- excludeArtifactTypes[i] = (IArtifactType) next;
- i++;
+ if (rendererOptions.get(RendererOption.EXCLUDE_ARTIFACT_TYPES) != null) {
+ Object o = rendererOptions.get(RendererOption.EXCLUDE_ARTIFACT_TYPES);
+ if (o instanceof Collection<?>) {
+ Collection<?> coll = (Collection<?>) o;
+ excludeArtifactTypes = new IArtifactType[coll.size()];
+ int i = 0;
+ Iterator<?> iterator = coll.iterator();
+ while (iterator.hasNext()) {
+ Object next = iterator.next();
+ if (next instanceof IArtifactType) {
+ excludeArtifactTypes[i] = (IArtifactType) next;
+ i++;
+ }
}
- }
+ }
}
return excludeArtifactTypes;
@@ -277,26 +297,25 @@ public class WordTemplateProcessor {
* Parse through template to find xml defining artifact sets and replace it with the result of publishing those
* artifacts. Only used by Publish SRS
*
- * @param artifacts = null if the template defines the artifacts to be used in the publishing
* @param folder = null when not using an extension template
* @param outlineNumber if null will find based on first artifact
*/
- public InputStream applyTemplate(List<Artifact> artifacts, String templateContent, String templateOptions, String templateStyles, IContainer folder, String outlineNumber, String outlineType, PresentationType presentationType) throws OseeCoreException {
-
- overrideClassification = (String) renderer.getRendererOptionValue(RendererOption.OVERRIDE_DATA_RIGHTS);
- if (overrideClassification == null) {
- overrideClassification = "invalid";
- }
- excludeFolders = (boolean) renderer.getRendererOptionValue(RendererOption.EXCLUDE_FOLDERS);
+ public InputStream applyTemplate(List<ArtifactReadable> artifacts, String templateContent, String templateOptions, String templateStyles, IContainer folder, String outlineNumber, String outlineType, PresentationType presentationType, Map<RendererOption, Object> rendererOptions) {
+ this.rendererOptions = rendererOptions;
+ excludeFolders =
+ rendererOptions.get(RendererOption.EXCLUDE_FOLDERS) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.EXCLUDE_FOLDERS);
+ ArtifactId view = (ArtifactId) rendererOptions.get(RendererOption.VIEW);
if (!artifacts.isEmpty()) {
branch = artifacts.get(0).getBranch();
- ApplicabilityEndpoint applEndpoint = ServiceUtil.getOseeClient().getApplicabilityEndpoint(branch);
-
applicabilityTokens = new HashMap<>();
- Collection<ApplicabilityToken> appTokens = applEndpoint.getApplicabilityTokens();
+
+ Collection<ApplicabilityToken> appTokens =
+ orcsApi.getQueryFactory().applicabilityQuery().getApplicabilityTokens(branch).values();
+
for (ApplicabilityToken token : appTokens) {
applicabilityTokens.put(token, token);
}
@@ -304,8 +323,7 @@ public class WordTemplateProcessor {
branch = BranchId.SENTINEL;
}
- ArtifactId view = (ArtifactId) renderer.getRendererOptionValue(RendererOption.VIEW);
- artifactsToExclude = getNonApplicableArtifacts(artifacts, view == null ? ArtifactId.SENTINEL : view);
+ artifactsToExclude = getExcludedArtifacts(artifacts, view == null ? ArtifactId.SENTINEL : view);
WordMLProducer wordMl = null;
CharBackedInputStream charBak = null;
@@ -342,7 +360,8 @@ public class WordTemplateProcessor {
outlining = false;
}
processArtifactSet(templateOptions, artifacts, wordMl, outlineType, presentationType,
- (ArtifactId) renderer.getRendererOptionValue(RendererOption.VIEW));
+ (ArtifactId) rendererOptions.get(RendererOption.VIEW));
+
} else if (elementType.equals(NESTED_TEMPLATE)) {
parseNestedTemplateOptions(templateOptions, folder, wordMl, presentationType);
} else {
@@ -354,8 +373,8 @@ public class WordTemplateProcessor {
// Write out the last of the template
wordMl.addWordMl(updateFooter(endOfTemplate));
- displayNonTemplateArtifacts(nonTemplateArtifacts,
- "Only artifacts of type Word Template Content are supported in this case.");
+ // displayNonTemplateArtifacts(nonTemplateArtifacts,
+ // "Only artifacts of type Word Template Content are supported in this case.");
} catch (CharacterCodingException ex) {
OseeCoreException.wrapAndThrow(ex);
@@ -386,36 +405,50 @@ public class WordTemplateProcessor {
RendererOption rendererOption = RendererOption.valueOf(key.toUpperCase());
value = options.getString("Value");
- renderer.updateOption(rendererOption, value);
+ rendererOptions.put(rendererOption, value);
- String artifactName = (String) renderer.getRendererOptionValue(RendererOption.NAME);
- String artifactId = (String) renderer.getRendererOptionValue(RendererOption.ID);
- String orcsQuery = (String) renderer.getRendererOptionValue(RendererOption.ORCS_QUERY);
- BranchId branch = (BranchId) renderer.getRendererOptionValue(RendererOption.BRANCH);
- List<Artifact> artifacts = null;
+ String artifactName = (String) rendererOptions.get("Name");
+ String artifactId = (String) rendererOptions.get("Id");
+ String orcsQuery = (String) rendererOptions.get("OrcsQuery");
+ BranchId branch = (BranchId) rendererOptions.get("Branch");
+ List<ArtifactReadable> artifacts = null;
if (Strings.isValid(artifactId)) {
- List<ArtifactId> artIds = Arrays.asList(ArtifactId.valueOf(artifactId));
- artifacts = ArtifactQuery.getArtifactListFrom(artIds, branch, EXCLUDE_DELETED);
+ artifacts = queryFactory.fromBranch(branch).andId(
+ ArtifactId.valueOf(Long.valueOf(artifactId))).excludeDeleted().getResults().getList();
} else if (Strings.isValid(artifactName)) {
- artifacts = ArtifactQuery.getArtifactListFromName(artifactName, branch, EXCLUDE_DELETED);
+ artifacts =
+ queryFactory.fromBranch(branch).andNameEquals(artifactName).excludeDeleted().getResults().getList();
+
} else if (Strings.isValid(orcsQuery)) {
- Writer writer = new StringWriter();
- OseeClient oseeClient = ServiceUtil.getOseeClient();
- oseeClient.executeScript(orcsQuery, null, false, MediaType.APPLICATION_JSON_TYPE, writer);
- artifacts = parseOrcsQueryResult(writer.toString(), branch);
+ StringWriter writer = new StringWriter();
+ ScriptContext context = new SimpleScriptContext();
+ context.setWriter(writer);
+ context.setErrorWriter(writer);
+ try {
+ orcsApi.getScriptEngine().eval(orcsQuery, context);
+
+ artifacts = parseOrcsQueryResult(writer.toString(), branch);
+ } catch (ScriptException ex) {
+ throw new OseeCoreException(ex);
+ }
}
String subDocFileName = subDocName + ".xml";
+ boolean isDiff =
+ rendererOptions.get(RendererOption.PUBLISH_DIFF) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.PUBLISH_DIFF);
if (isDiff) {
- WordTemplateFileDiffer templateFileDiffer = new WordTemplateFileDiffer(renderer);
- templateFileDiffer.generateFileDifferences(artifacts, "/results/" + subDocFileName, sectionNumber,
- outlineType, recurseChildren);
+ // TODO: keep on client
+ // WordTemplateFileDiffer templateFileDiffer = new WordTemplateFileDiffer(renderer);
+ // templateFileDiffer.generateFileDifferences(artifacts, "/results/" + subDocFileName, sectionNumber,
+ // outlineType, recurseChildren);
} else {
- IFile file = folder.getFile(new Path(subDocFileName));
- AIFile.writeToFile(file, applyTemplate(artifacts, slaveTemplate, slaveTemplateOptions,
- slaveTemplateStyles, folder, sectionNumber, outlineType, presentationType));
+ // TODO: return inputstream
+ // IFile file = folder.getFile(new Path(subDocFileName));
+ // AIFile.writeToFile(file, applyTemplate(artifacts, slaveTemplate, slaveTemplateOptions,
+ // slaveTemplateStyles, folder, sectionNumber, outlineType, presentationType, rendererOptions));
}
wordMl.createHyperLinkDoc(subDocFileName);
}
@@ -425,8 +458,8 @@ public class WordTemplateProcessor {
}
}
- private List<Artifact> parseOrcsQueryResult(String result, BranchId branch) {
- ArrayList<Artifact> artifacts = new ArrayList<Artifact>();
+ private List<ArtifactReadable> parseOrcsQueryResult(String result, BranchId branch) {
+ ArrayList<ArtifactReadable> artifacts = new ArrayList<>();
try {
JSONObject jsonObject = new JSONObject(result);
JSONArray results = jsonObject.getJSONArray("results");
@@ -435,8 +468,10 @@ public class WordTemplateProcessor {
JSONObject id = null;
for (int i = 0; i < artifactIds.length(); i++) {
id = artifactIds.getJSONObject(i);
- ArtifactId artifactId = ArtifactId.valueOf(id.getLong("id"));
- Artifact artifact = ArtifactQuery.getArtifactFromId(artifactId, branch, EXCLUDE_DELETED);
+ Long artifactId = id.getLong("id");
+ ArtifactReadable artifact = queryFactory.fromBranch(branch).andId(
+ ArtifactId.valueOf(artifactId)).excludeDeleted().getResults().getOneOrNull();
+
artifacts.add(artifact);
}
}
@@ -463,8 +498,9 @@ public class WordTemplateProcessor {
formatPost = options.getString("FormatPost");
AttributeElement attrElement = new AttributeElement();
+ AttributeTypeId attributeTypeId = orcsApi.getOrcsTypes().getAttributeTypes().getByName(attributeType);
- if (attributeType.equals("*") || AttributeTypeManager.typeExists(attributeType)) {
+ if (attributeType.equals("*") || attributeTypeId != null) {
attrElement.setElements(attributeType, attributeLabel, formatPre, formatPost);
attributeElements.add(attrElement);
}
@@ -484,7 +520,8 @@ public class WordTemplateProcessor {
outlining = options.getBoolean("Outlining");
recurseChildren = options.getBoolean("RecurseChildren");
String headingAttrType = options.getString("HeadingAttributeType");
- headingAttributeType = AttributeTypeManager.getType(headingAttrType);
+ headingAttributeType = orcsApi.getOrcsTypes().getAttributeTypes().getByName(headingAttrType);
+
artifactName = options.getString("ArtifactName");
} catch (JSONException ex) {
@@ -525,7 +562,7 @@ public class WordTemplateProcessor {
return endOfTemplate;
}
- protected String peekAtFirstArtifactToGetParagraphNumber(String template, String nextParagraphNumber, List<Artifact> artifacts) throws OseeCoreException {
+ protected String peekAtFirstArtifactToGetParagraphNumber(String template, String nextParagraphNumber, List<ArtifactReadable> artifacts) {
String startParagraphNumber = "1";
if (artifacts != null) {
Matcher matcher = headElementsPattern.matcher(template);
@@ -534,7 +571,7 @@ public class WordTemplateProcessor {
String elementType = matcher.group(0);
if (elementType != null && elementType.equals(INSERT_ARTIFACT_HERE) && !artifacts.isEmpty()) {
- Artifact artifact = artifacts.iterator().next();
+ ArtifactReadable artifact = artifacts.iterator().next();
if (artifact.isAttributeTypeValid(CoreAttributeTypes.ParagraphNumber)) {
String paragraphNum = artifact.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, "");
if (Strings.isValid(paragraphNum)) {
@@ -547,9 +584,9 @@ public class WordTemplateProcessor {
return startParagraphNumber;
}
- private void processArtifactSet(String templateOptions, List<Artifact> artifacts, WordMLProducer wordMl, String outlineType, PresentationType presentationType, ArtifactId viewId) throws OseeCoreException {
+ private void processArtifactSet(String templateOptions, List<ArtifactReadable> artifacts, WordMLProducer wordMl, String outlineType, PresentationType presentationType, ArtifactId view) {
nonTemplateArtifacts.clear();
- renderer.updateOption(RendererOption.VIEW, viewId == null ? ArtifactId.SENTINEL : viewId);
+ rendererOptions.put(RendererOption.VIEW, view == null ? ArtifactId.SENTINEL : view);
if (Strings.isValid(outlineNumber)) {
wordMl.setNextParagraphNumberTo(outlineNumber);
@@ -564,19 +601,31 @@ public class WordTemplateProcessor {
parseMetadataOptions(templateOptions);
}
- if (((boolean) renderer.getRendererOptionValue(RendererOption.PUBLISH_DIFF))) {
- WordTemplateFileDiffer templateFileDiffer = new WordTemplateFileDiffer(renderer);
- templateFileDiffer.generateFileDifferences(artifacts, "/results/", outlineNumber, outlineType,
- recurseChildren);
- } else {
+ boolean diff = rendererOptions.get(RendererOption.PUBLISH_DIFF) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.PUBLISH_DIFF);
+ if (diff) {
+ // TODO: keep on client
+ // WordTemplateFileDiffer templateFileDiffer = new WordTemplateFileDiffer(null, null);
+ // templateFileDiffer.generateFileDifferences(artifacts, "/results/", outlineNumber, outlineType,
+ // recurseChildren);
+ } else {
List<ArtifactId> allArtifacts = new ArrayList<>();
- if (recurseChildren || (((boolean) renderer.getRendererOptionValue(
- RendererOption.RECURSE_ON_LOAD)) && !((boolean) renderer.getRendererOptionValue(
- RendererOption.ORIG_PUBLISH_AS_DIFF)))) {
- for (Artifact art : artifacts) {
+ boolean recurseOnLoad =
+ rendererOptions.get(RendererOption.RECURSE_ON_LOAD) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.RECURSE_ON_LOAD);
+ boolean origPublishDiff =
+ rendererOptions.get(RendererOption.ORIG_PUBLISH_AS_DIFF) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.ORIG_PUBLISH_AS_DIFF);
+
+ if (recurseChildren || (recurseOnLoad && !origPublishDiff)) {
+ for (ArtifactReadable art : artifacts) {
+
allArtifacts.add(art);
- if (!art.isHistorical()) {
+ // Is this valid for isHistorical?
+ TransactionId tx = art.getTransaction();
+ TransactionId modTx = art.getLastModifiedTransaction();
+ if (!tx.isLessThan(modTx)) {
allArtifacts.addAll(art.getDescendants());
}
}
@@ -584,11 +633,11 @@ public class WordTemplateProcessor {
allArtifacts.addAll(artifacts);
}
- DataRightResult response = ServiceUtil.getOseeClient().getDataRightsEndpoint().getDataRights(allArtifacts,
- branch, overrideClassification);
+ DataRightResult dataRightResult =
+ dataRightsOperations.getDataRights(allArtifacts, branch, overrideClassification);
- for (Artifact artifact : artifacts) {
- processObjectArtifact(artifact, wordMl, outlineType, presentationType, response);
+ for (ArtifactReadable artifact : artifacts) {
+ processObjectArtifact(artifact, wordMl, outlineType, presentationType, dataRightResult);
}
}
// maintain a list of artifacts that have been processed so we do not
@@ -596,47 +645,47 @@ public class WordTemplateProcessor {
processedArtifacts.clear();
}
- private HashMap<ArtifactId, ArtifactId> getNonApplicableArtifacts(List<Artifact> artifacts, ArtifactId view) {
- HashMap<ArtifactId, ArtifactId> toReturn = new HashMap<>();
-
- if (artifacts != null && !artifacts.isEmpty()) {
- Object[] objs = {branch, view, branch};
-
- List<ArtifactId> excludedArtifacts = ArtifactLoader.selectArtifactIds(LOAD_EXCLUDED_ARTIFACTIDS, objs, 300);
- for (ArtifactId artId : excludedArtifacts) {
- toReturn.put(artId, artId);
- }
+ private Set<ArtifactId> getExcludedArtifacts(List<ArtifactReadable> artifacts, ArtifactId view) {
+ if (artifacts != null && !artifacts.isEmpty() && view.isValid()) {
+ return orcsApi.getQueryFactory().applicabilityQuery().getExcludedArtifacts(branch, view);
}
- return toReturn;
+ return new HashSet<>();
}
- private void processObjectArtifact(Artifact artifact, WordMLProducer wordMl, String outlineType, PresentationType presentationType, DataRightResult data) throws OseeCoreException {
+ private void processObjectArtifact(ArtifactReadable artifact, WordMLProducer wordMl, String outlineType, PresentationType presentationType, DataRightResult dataRightResult) {
if (!artifact.isAttributeTypeValid(CoreAttributeTypes.WholeWordContent) && !artifact.isAttributeTypeValid(
CoreAttributeTypes.NativeContent)) {
// If the artifact has not been processed
if (!processedArtifacts.contains(artifact)) {
boolean ignoreArtifact = excludeFolders && artifact.isOfType(
- CoreArtifactTypes.Folder) && !artifactsToExclude.containsKey(artifact.getId());
+ CoreArtifactTypes.Folder) && !artifactsToExclude.contains(artifact.getId());
boolean ignoreArtType = excludeArtifactTypes != null && artifact.isOfType(excludeArtifactTypes);
boolean publishInline = artifact.getSoleAttributeValue(CoreAttributeTypes.PublishInline, false);
boolean startedSection = false;
- boolean templateOnly = (boolean) renderer.getRendererOptionValue(RendererOption.TEMPLATE_ONLY);
- boolean includeUUIDs = (boolean) renderer.getRendererOptionValue(RendererOption.INCLUDE_UUIDS);
+ boolean templateOnly =
+ rendererOptions.get(RendererOption.TEMPLATE_ONLY) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.TEMPLATE_ONLY);
+ boolean includeUUIDs =
+ rendererOptions.get(RendererOption.INCLUDE_UUIDS) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.INCLUDE_UUIDS);
if (!ignoreArtifact && !ignoreArtType) {
if (outlining && !templateOnly) {
String headingText = artifact.getSoleAttributeValue(headingAttributeType, "");
if (includeUUIDs) {
- String UUIDtext = String.format(" <UUID = %s>", artifact.getArtId());
+ String UUIDtext = String.format(" <UUID = %s>", artifact.getId());
headingText = headingText.concat(UUIDtext);
}
- Boolean mergeTag = (Boolean) renderer.getRendererOptionValue(RendererOption.ADD_MERGE_TAG);
- if (mergeTag != null && mergeTag) {
+ boolean mergeTag =
+ rendererOptions.get(RendererOption.ADD_MERGE_TAG) == null ? false : (Boolean) rendererOptions.get(
+ RendererOption.ADD_MERGE_TAG);
+
+ if (mergeTag) {
headingText = headingText.concat(" [MERGED]");
}
@@ -650,23 +699,24 @@ public class WordTemplateProcessor {
startedSection = true;
}
- if (((boolean) renderer.getRendererOptionValue(
- RendererOption.UPDATE_PARAGRAPH_NUMBERS)) && !publishInline) {
+ boolean updateParagraphNumbers = rendererOptions.get(
+ RendererOption.UPDATE_PARAGRAPH_NUMBERS) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.UPDATE_PARAGRAPH_NUMBERS);
+
+ if (updateParagraphNumbers && !publishInline) {
if (artifact.isAttributeTypeValid(CoreAttributeTypes.ParagraphNumber)) {
- artifact.setSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, paragraphNumber.toString());
-
- SkynetTransaction transaction =
- (SkynetTransaction) renderer.getRendererOptionValue(RendererOption.TRANSACTION_OPTION);
- if (transaction != null) {
- artifact.persist(transaction);
- } else {
- artifact.persist(getClass().getSimpleName());
- }
+ TransactionBuilder tx =
+ orcsApi.getTransactionFactory().createTransaction(branch, user, "Update Paragraph Number");
+ tx.setSoleAttributeValue(artifact, CoreAttributeTypes.ParagraphNumber,
+ paragraphNumber.toString());
+ tx.commit();
}
}
}
- PageOrientation orientation = WordRendererUtil.getPageOrientation(artifact);
- String footer = data.getContent(artifact.getId(), orientation);
+
+ String pageType = artifact.getSoleAttributeAsString(CoreAttributeTypes.PageType, "Portrait");
+ PageOrientation orientation = PageOrientation.fromString(pageType);
+ String footer = dataRightResult.getContent(artifact.getId(), orientation);
processMetadata(artifact, wordMl);
@@ -674,12 +724,17 @@ public class WordTemplateProcessor {
}
// Check for option that may have been set from Publish with Diff BLAM to recurse
- boolean recurse = ((boolean) renderer.getRendererOptionValue(RendererOption.RECURSE_ON_LOAD));
- boolean origDiff = ((boolean) renderer.getRendererOptionValue(RendererOption.ORIG_PUBLISH_AS_DIFF));
+
+ boolean recurse =
+ rendererOptions.get(RendererOption.RECURSE_ON_LOAD) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.RECURSE_ON_LOAD);
+ boolean origDiff =
+ rendererOptions.get(RendererOption.ORIG_PUBLISH_AS_DIFF) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.ORIG_PUBLISH_AS_DIFF);
if (recurseChildren && !recurse || (recurse && !origDiff)) {
- for (Artifact childArtifact : artifact.getChildren()) {
- processObjectArtifact(childArtifact, wordMl, outlineType, presentationType, data);
+ for (ArtifactReadable childArtifact : artifact.getChildren()) {
+ processObjectArtifact(childArtifact, wordMl, outlineType, presentationType, dataRightResult);
}
}
@@ -693,42 +748,77 @@ public class WordTemplateProcessor {
}
}
- private void processMetadata(Artifact artifact, WordMLProducer wordMl) {
+ private void processMetadata(ArtifactReadable artifact, WordMLProducer wordMl) {
for (MetadataElement metadataElement : metadataElements) {
processMetadata(artifact, wordMl, metadataElement.getType(), metadataElement.getFormat());
}
}
- private void processAttributes(Artifact artifact, WordMLProducer wordMl, PresentationType presentationType, boolean publishInLine, String footer) throws OseeCoreException {
+ private void processAttributes(ArtifactReadable artifact, WordMLProducer wordMl, PresentationType presentationType, boolean publishInLine, String footer) throws OseeCoreException {
+ Renderer bestRenderer =
+ OsgiUtil.getService(this.getClass(), RendererClassRegistry.class).getBestRenderer(presentationType, artifact);
+
for (AttributeElement attributeElement : attributeElements) {
String attributeName = attributeElement.getAttributeName();
- if (((boolean) renderer.getRendererOptionValue(RendererOption.ALL_ATTRIBUTES)) || attributeName.equals("*")) {
- for (AttributeTypeToken attributeType : RendererManager.getAttributeTypeOrderList(artifact)) {
- if (!outlining || attributeType.notEqual(headingAttributeType)) {
+ boolean allAttrs =
+ rendererOptions.get(RendererOption.ALL_ATTRIBUTES) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.ALL_ATTRIBUTES);
+
+ if (allAttrs || attributeName.equals("*")) {
+
+ for (AttributeTypeToken attributeType : getAttributeTypeOrderList(artifact, bestRenderer)) {
+
+ if (!outlining || !attributeType.equals(headingAttributeType)) {
processAttribute(artifact, wordMl, attributeElement, attributeType, true, presentationType,
- publishInLine, footer);
+ publishInLine, footer, bestRenderer);
}
}
} else {
- AttributeType attributeType = AttributeTypeManager.getType(attributeName);
+ AttributeTypeId attributeType = orcsApi.getOrcsTypes().getAttributeTypes().getByName(attributeName);
+
if (artifact.isAttributeTypeValid(attributeType)) {
- processAttribute(artifact, wordMl, attributeElement, attributeType, false, presentationType,
- publishInLine, footer);
+ processAttribute(artifact, wordMl, attributeElement,
+ AttributeTypeToken.valueOf(attributeType.getId(), attributeName), false, presentationType,
+ publishInLine, footer, bestRenderer);
}
}
}
}
- private void processMetadata(Artifact artifact, WordMLProducer wordMl, String name, String format) {
+ // TODO: DisplayLogicAttribute, RdtAttributes, and RdtTableAttributes have override method
+ // Update - they will have their own wordml rendered stored in db as wordtemplatecontent
+ private List<AttributeTypeToken> getAttributeTypeOrderList(ArtifactReadable artifact, Renderer bestRenderer) {
+ AttributeTypeToken contentType = null;
+ Collection<AttributeTypeToken> attributeTypes = artifact.getValidAttributeTypes();
+ return bestRenderer.getOrderedAttributeTypes(artifact, attributeTypes);
+ // ArrayList<AttributeTypeToken> orderedAttributeTypes = new ArrayList<>(attributes.size());
+ //
+ // for (AttributeTypeToken attribute : attributes) {
+ // if (attribute.matches(CoreAttributeTypes.WholeWordContent, CoreAttributeTypes.WordTemplateContent,
+ // CoreAttributeTypes.PlainTextContent)) {
+ // contentType = attribute;
+ // } else {
+ // orderedAttributeTypes.add(attribute);
+ // }
+ // }
+ // Collections.sort(orderedAttributeTypes);
+ // if (contentType != null) {
+ // orderedAttributeTypes.add(contentType);
+ // }
+
+ // return orderedAttributeTypes;
+ }
+
+ private void processMetadata(ArtifactReadable artifact, WordMLProducer wordMl, String name, String format) {
wordMl.startParagraph();
String value = "";
if (name.equals(APPLICABILITY)) {
- ApplicabilityToken applicabilityToken = applicabilityTokens.get(artifact.getApplicablityId());
+ ApplicabilityToken applicabilityToken = applicabilityTokens.get(artifact.getApplicability());
value = applicabilityToken.getName();
} else if (name.equals(ARTIFACT_TYPE)) {
- value = artifact.getArtifactTypeName();
+ value = artifact.getArtifactType().getName();
} else if (name.equals(ARTIFACT_ID)) {
value = artifact.getIdString();
}
@@ -740,19 +830,22 @@ public class WordTemplateProcessor {
wordMl.endParagraph();
}
- private void processAttribute(Artifact artifact, WordMLProducer wordMl, AttributeElement attributeElement, AttributeTypeToken attributeType, boolean allAttrs, PresentationType presentationType, boolean publishInLine, String footer) throws OseeCoreException {
- renderer.updateOption(RendererOption.ALL_ATTRIBUTES, allAttrs);
+ private void processAttribute(ArtifactReadable artifact, WordMLProducer wordMl, AttributeElement attributeElement, AttributeTypeToken attributeType, boolean allAttrs, PresentationType presentationType, boolean publishInLine, String footer, Renderer bestRenderer) throws OseeCoreException {
+ rendererOptions.put(RendererOption.ALL_ATTRIBUTES, allAttrs);
// This is for SRS Publishing. Do not publish unspecified attributes
if (!allAttrs && attributeType.matches(Partition, SeverityCategory)) {
if (artifact.isAttributeTypeValid(Partition)) {
- for (Attribute<?> partition : artifact.getAttributes(Partition)) {
+ for (AttributeReadable<Object> partition : artifact.getAttributes(Partition)) {
if (partition == null || partition.getValue() == null || partition.getValue().equals("Unspecified")) {
return;
}
}
}
}
- boolean templateOnly = (boolean) renderer.getRendererOptionValue(RendererOption.TEMPLATE_ONLY);
+
+ boolean templateOnly = rendererOptions.get(
+ RendererOption.TEMPLATE_ONLY) == null ? false : (boolean) rendererOptions.get(RendererOption.TEMPLATE_ONLY);
+
if (templateOnly && attributeType.notEqual(WordTemplateContent)) {
return;
}
@@ -761,7 +854,7 @@ public class WordTemplateProcessor {
* In some cases this returns no attributes at all, including no wordTemplateContent, even though it exists This
* happens when wordTemplateContent is blank, so the else if condition takes this into account.
*/
- Collection<Attribute<Object>> attributes = artifact.getAttributes(attributeType);
+ ResultSet<? extends AttributeReadable<Object>> attributes = artifact.getAttributes(attributeType);
if (!attributes.isEmpty()) {
// check if the attribute descriptor name is in the ignore list.
@@ -770,22 +863,113 @@ public class WordTemplateProcessor {
}
// Do not publish relation order during publishing
- if (((boolean) renderer.getRendererOptionValue(
- RendererOption.IN_PUBLISH_MODE)) && CoreAttributeTypes.RelationOrder.equals(attributeType)) {
+ boolean inPubMode =
+ rendererOptions.get(RendererOption.IN_PUBLISH_MODE) == null ? false : (boolean) rendererOptions.get(
+ RendererOption.IN_PUBLISH_MODE);
+
+ if (inPubMode && CoreAttributeTypes.RelationOrder.equals(attributeType)) {
return;
}
if (!(publishInLine && artifact.isAttributeTypeValid(WordTemplateContent)) || attributeType.equals(
WordTemplateContent)) {
- RendererManager.renderAttribute(attributeType, presentationType, artifact, wordMl,
- attributeElement.getFormat(), attributeElement.getLabel(), footer, renderer.getRendererOptions());
+ renderAttribute(attributeType, presentationType, artifact, wordMl, attributeElement.getFormat(),
+ attributeElement.getLabel(), footer, rendererOptions, bestRenderer);
}
} else if (attributeType.equals(WordTemplateContent)) {
- RendererManager.renderAttribute(attributeType, presentationType, artifact, wordMl,
- attributeElement.getFormat(), attributeElement.getLabel(), footer, renderer.getRendererOptions());
+ renderAttribute(attributeType, presentationType, artifact, wordMl, attributeElement.getFormat(),
+ attributeElement.getLabel(), footer, rendererOptions, bestRenderer);
}
}
+ // TODO: DisplayLogicRequirement - csidRequirementAttribute, ButtonRequirmentArtifact - RdtAttributes, PageTableArtifact - Display table has override method,
+ private void renderAttribute(AttributeTypeToken attributeType, PresentationType presentationType, ArtifactReadable artifact, WordMLProducer wordMl, String format, String label, String footer, Map<RendererOption, Object> rendererOptions, Renderer bestRenderer) {
+ bestRenderer.renderAttribute(attributeType, artifact, presentationType, wordMl, format, label, footer,
+ rendererOptions);
+ // if (attributeType.equals(CoreAttributeTypes.WordTemplateContent)) {
+ // String data = null;
+ // LinkType linkType = rendererOptions.get(RendererOption.LINK_TYPE) == null ? null : LinkType.valueOf(
+ // (String) rendererOptions.get(RendererOption.LINK_TYPE));
+ //
+ // if (label.length() > 0) {
+ // wordMl.addParagraph(label);
+ // }
+ //
+ // TransactionId txId = null;
+ // if (artifact.isHistorical()) {
+ // txId = artifact.getTransaction();
+ // } else {
+ // txId = TransactionId.SENTINEL;
+ // }
+ //
+ // String oseeLink = ArtifactURL.getOpenInOseeLink(artifact, presentationType, sessionId, orcsApi).toString();
+ //
+ // WordTemplateContentData wtcData = new WordTemplateContentData();
+ // wtcData.setArtId(artifact.getUuid());
+ // wtcData.setBranch(artifact.getBranch());
+ // wtcData.setFooter(footer);
+ // wtcData.setIsEdit(presentationType == PresentationType.SPECIALIZED_EDIT);
+ // wtcData.setLinkType(linkType != null ? linkType.toString() : null);
+ // wtcData.setTxId(txId);
+ // wtcData.setSessionId(sessionId);
+ // wtcData.setOseeLink(oseeLink);
+ // ArtifactId view = rendererOptions.get(
+ // RendererOption.VIEW) == null ? ArtifactId.SENTINEL : (ArtifactId) rendererOptions.get(RendererOption.VIEW);
+ // wtcData.setViewId(view == null ? ArtifactId.SENTINEL : view);
+ //
+ // Pair<String, Set<String>> content = null;
+ // try {
+ // content = msWordOperations.renderWordTemplateContent(wtcData);
+ // } catch (Exception e) {
+ // throw new OseeCoreException(e);
+ // }
+ //
+ // if (content != null) {
+ // data = content.getFirst();
+ // }
+ //
+ // if (presentationType == PresentationType.SPECIALIZED_EDIT) {
+ // OseeLinkBuilder linkBuilder = new OseeLinkBuilder();
+ // wordMl.addEditParagraphNoEscape(linkBuilder.getStartEditImage(artifact.getGuid()));
+ // wordMl.addWordMl(data);
+ // wordMl.addEditParagraphNoEscape(linkBuilder.getEndEditImage(artifact.getGuid()));
+ //
+ // } else if (data != null) {
+ // wordMl.addWordMl(data);
+ // }
+ // wordMl.resetListValue();
+ // } else {
+ // boolean allAttrs =
+ // rendererOptions.get(RendererOption.ALL_ATTRIBUTES) == null ? false : (boolean) rendererOptions.get(
+ // RendererOption.ALL_ATTRIBUTES);
+ //
+ // wordMl.startParagraph();
+ //
+ // if (allAttrs) {
+ // if (!attributeType.matches(CoreAttributeTypes.PlainTextContent)) {
+ // wordMl.addWordMl("<w:r><w:t> " + Xml.escape(attributeType.getName()) + ": </w:t></w:r>");
+ // } else {
+ // wordMl.addWordMl("<w:r><w:t> </w:t></w:r>");
+ // }
+ // } else {
+ // // assumption: the label is of the form <w:r><w:t> text </w:t></w:r>
+ // wordMl.addWordMl(label);
+ // }
+ //
+ // if (attributeType.equals(CoreAttributeTypes.RelationOrder)) {
+ // // Do nothing. Relation Order will not be an attribute moving forward
+ // } else {
+ // String valueList = artifact.getAttributes(attributeType).toString();
+ // if (format.contains(">x<")) {
+ // wordMl.addWordMl(format.replace(">x<", ">" + Xml.escape(valueList).toString() + "<"));
+ // } else {
+ // wordMl.addTextInsideParagraph(valueList);
+ // }
+ // wordMl.endParagraph();
+ // }
+ // }
+ }
+
private void loadIgnoreAttributeExtensions() {
IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
if (extensionRegistry != null) {
@@ -803,17 +987,4 @@ public class WordTemplateProcessor {
}
}
- private void displayNonTemplateArtifacts(final Collection<Artifact> artifacts, final String warningString) {
- if (!artifacts.isEmpty()) {
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- ArrayList<Artifact> nonTempArtifacts = new ArrayList<>(artifacts.size());
- nonTempArtifacts.addAll(artifacts);
- WordUiUtil.displayUnhandledArtifacts(artifacts, warningString);
- }
- });
- }
- }
}
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
index 2a9b1cc404..5730e24c0e 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
@@ -60,13 +60,11 @@ import org.xml.sax.SAXException;
public class WordUpdateArtifact {
private final OrcsApi orcsApi;
private final QueryFactory queryFactory;
- private final Log logger;
private final EventAdmin eventAdmin;
- public WordUpdateArtifact(Log logger, OrcsApi orcsApi, EventAdmin eventAdmin) {
+ public WordUpdateArtifact(OrcsApi orcsApi, EventAdmin eventAdmin) {
this.orcsApi = orcsApi;
this.queryFactory = orcsApi.getQueryFactory();
- this.logger = logger;
this.eventAdmin = eventAdmin;
}
@@ -214,15 +212,11 @@ public class WordUpdateArtifact {
updateChange.setTx(tx);
updateChange.setBranch(tx.getBranch());
if (updateChange.hasSafetyRelatedArtifactChange()) {
- try {
- HashMap<String, Object> properties = new HashMap<String, Object>();
- properties.put(SafetyWorkflowEventHandler.SAFETY_EVENT_BRANCH_ID, tx.getBranch());
- properties.put(SafetyWorkflowEventHandler.SAFETY_EVENT_USER_ART, account);
- Event event = new Event(SafetyWorkflowEventHandler.SAFETY_EVENT_TOPIC, properties);
- eventAdmin.postEvent(event);
- } catch (Exception ex) {
- logger.error(ex, "Could not create safety workflow");
- }
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(SafetyWorkflowEventHandler.SAFETY_EVENT_BRANCH_ID, tx.getBranch());
+ properties.put(SafetyWorkflowEventHandler.SAFETY_EVENT_USER_ART, account);
+ Event event = new Event(SafetyWorkflowEventHandler.SAFETY_EVENT_TOPIC, properties);
+ eventAdmin.postEvent(event);
}
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
index 45e6282944..58ad7494b1 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
@@ -169,7 +169,6 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
rendererOptionsMap.put(LINK_TYPE, linkType);
rendererOptionsMap.put(UPDATE_PARAGRAPH_NUMBERS, variableMap.getBoolean(UPDATE_PARAGRAPH_NUMBERS.getKey()));
rendererOptionsMap.put(EXCLUDE_ARTIFACT_TYPES, variableMap.getArtifactTypes(EXCLUDE_ARTIFACT_TYPES.getKey()));
- rendererOptionsMap.put(TRANSACTION_OPTION, transaction);
rendererOptionsMap.put(SKIP_ERRORS, true);
rendererOptionsMap.put(EXCLUDE_FOLDERS, true);
rendererOptionsMap.put(RECURSE, true);
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java
index a9a27c0290..e34e35ba7f 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java
@@ -69,4 +69,8 @@ public enum ChangeIgnoreType {
public boolean isInvalid() {
return !isValid();
}
+
+ public boolean isAllowableChange() {
+ return isNone() || isResurrected() || isDeletedOnDestAndNotResurrected() || isDeletedOnDestination();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/WordCoreUtil.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/WordCoreUtil.java
index 3706fce328..6712726914 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/WordCoreUtil.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/WordCoreUtil.java
@@ -34,6 +34,9 @@ import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
*/
public class WordCoreUtil {
+ public static final String BEFORE_GUID_STRING = "/BeforeGUID/PrePend";
+ public static final String AFTER_GUID_STRING = "/AfterGUID";
+
public static String FEATUREAPP = "feature";
public static String CONFIGAPP = "configuration";
@@ -300,4 +303,18 @@ public class WordCoreUtil {
return toReturn;
}
+
+ public static String removeGuidFromTemplate(String templateContent) {
+ String newTemplate = "";
+
+ String[] splitsBeforeAndAfter = templateContent.split(BEFORE_GUID_STRING + "|" + AFTER_GUID_STRING);
+
+ if (splitsBeforeAndAfter.length == 3) {
+ newTemplate = splitsBeforeAndAfter[0] + " " + splitsBeforeAndAfter[2];
+ } else {
+ newTemplate = templateContent;
+ }
+
+ return newTemplate;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/HttpWordUpdateRequest.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/HttpWordUpdateRequest.java
index 0f50e91183..41c1224253 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/HttpWordUpdateRequest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/HttpWordUpdateRequest.java
@@ -12,10 +12,10 @@ package org.eclipse.osee.framework.skynet.core.httpRequests;
import java.util.Set;
import javax.ws.rs.core.Response.Status;
+import org.eclipse.osee.define.report.api.MSWordEndpoint;
import org.eclipse.osee.define.report.api.WordTemplateContentData;
import org.eclipse.osee.define.report.api.WordUpdateChange;
import org.eclipse.osee.define.report.api.WordUpdateData;
-import org.eclipse.osee.define.report.api.MSWordEndpoint;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.skynet.core.internal.ServiceUtil;
@@ -26,7 +26,8 @@ import org.eclipse.osee.jaxrs.OseeWebApplicationException;
*/
public class HttpWordUpdateRequest {
public static WordUpdateChange updateWordArtifacts(WordUpdateData wud) {
- MSWordEndpoint endpoint = ServiceUtil.getOseeClient().getWordUpdateEndpoint();
+ MSWordEndpoint endpoint = ServiceUtil.getOseeClient().getMSWordEndpoint();
+
try {
return endpoint.updateWordArtifacts(wud);
} catch (Exception ex) {
@@ -35,7 +36,7 @@ public class HttpWordUpdateRequest {
}
public static Pair<String, Set<String>> renderWordTemplateContent(WordTemplateContentData data) throws OseeCoreException {
- MSWordEndpoint endpoint = ServiceUtil.getOseeClient().getWordUpdateEndpoint();
+ MSWordEndpoint endpoint = ServiceUtil.getOseeClient().getMSWordEndpoint();
return endpoint.renderWordTemplateContent(data);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
index 791032ccac..e5f9f8f85f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
@@ -30,7 +30,6 @@ import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.data.TupleTypeId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.TransactionDelta;
-import org.eclipse.osee.framework.core.model.change.ChangeIgnoreType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeItemUtil;
import org.eclipse.osee.framework.core.model.change.ChangeVersion;
@@ -365,7 +364,7 @@ public class ChangeDataLoader extends AbstractOperation {
CompareResults results = proxy.compareTxs(txDelta.getStartTx(), txDelta.getEndTx());
List<ChangeItem> changes = new ArrayList<>();
for (ChangeItem item : results.getChanges()) {
- if (isAllowableChange(item.getIgnoreType())) {
+ if (item.getIgnoreType().isAllowableChange()) {
changes.add(item);
}
}
@@ -376,11 +375,5 @@ public class ChangeDataLoader extends AbstractOperation {
}
}
- private static boolean isAllowableChange(ChangeIgnoreType ignoreType) {
- return //
- ignoreType.isNone() || //
- ignoreType.isResurrected() || //
- ignoreType.isDeletedOnDestAndNotResurrected() || //
- ignoreType.isDeletedOnDestination();
- }
+
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java
index 6aad6f442a..09bd8a2171 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java
@@ -53,6 +53,7 @@ public class SingleNativeDiffHandler extends CommandHandler {
rendererOptions.put(RendererOption.VIEW, Handlers.getViewId());
RendererManager.diffInJob(artifactDeltas, pathPrefix, rendererOptions);
+
return null;
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java
index 574dcdcdab..740ba02fe7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java
@@ -32,16 +32,11 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.util.OptionType;
import org.eclipse.osee.framework.core.util.RendererOption;
-import org.eclipse.osee.framework.core.util.WordMLProducer;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.skynet.core.linking.OseeLinkBuilder;
-import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
-import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderData;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
@@ -50,7 +45,6 @@ import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput;
import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.explorer.ArtifactExplorer;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
-import org.eclipse.osee.framework.ui.skynet.internal.ServiceUtil;
import org.eclipse.osee.framework.ui.skynet.render.compare.DefaultArtifactCompare;
import org.eclipse.osee.framework.ui.skynet.render.compare.IComparator;
import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView;
@@ -145,39 +139,6 @@ public class DefaultArtifactRenderer implements IRenderer {
}
@Override
- public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, WordMLProducer producer, String format, String label, String footer) throws OseeCoreException {
- WordMLProducer wordMl = producer;
- boolean allAttrs = (boolean) rendererOptions.get(RendererOption.ALL_ATTRIBUTES);
-
- wordMl.startParagraph();
-
- if (allAttrs) {
- if (!attributeType.matches(CoreAttributeTypes.PlainTextContent)) {
- wordMl.addWordMl("<w:r><w:t> " + Xml.escape(attributeType.getName()) + ": </w:t></w:r>");
- } else {
- wordMl.addWordMl("<w:r><w:t> </w:t></w:r>");
- }
- } else {
- // assumption: the label is of the form <w:r><w:t> text </w:t></w:r>
- wordMl.addWordMl(label);
- }
-
- if (attributeType.equals(CoreAttributeTypes.RelationOrder)) {
- wordMl.endParagraph();
- String data = renderRelationOrder(artifact);
- wordMl.addWordMl(data);
- } else {
- String valueList = artifact.getAttributesToString(attributeType);
- if (format.contains(">x<")) {
- wordMl.addWordMl(format.replace(">x<", ">" + Xml.escape(valueList).toString() + "<"));
- } else {
- wordMl.addTextInsideParagraph(valueList);
- }
- wordMl.endParagraph();
- }
- }
-
- @Override
public String renderAttributeAsString(AttributeTypeId attributeType, Artifact artifact, PresentationType presentationType, final String defaultValue) throws OseeCoreException {
String returnValue = defaultValue;
if (presentationType.matches(RENDER_AS_HUMAN_READABLE_TEXT)) {
@@ -195,18 +156,6 @@ public class DefaultArtifactRenderer implements IRenderer {
return returnValue;
}
- private String renderRelationOrder(Artifact artifact) throws OseeCoreException {
- StringBuilder builder = new StringBuilder();
- ArtifactGuidToWordML guidResolver = new ArtifactGuidToWordML(new OseeLinkBuilder());
- RelationOrderRenderer renderer =
- new RelationOrderRenderer(ServiceUtil.getOseeCacheService().getRelationTypeCache(), guidResolver);
-
- WordMLProducer producer = new WordMLProducer(builder);
- RelationOrderData relationOrderData = RelationManager.createRelationOrderData(artifact);
- renderer.toWordML(producer, artifact.getBranch(), relationOrderData);
- return builder.toString();
- }
-
@Override
public IComparator getComparator() {
return DEFAULT_COMPARATOR;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DiffUsingRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DiffUsingRenderer.java
index e2cd271189..d908d32ccc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DiffUsingRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DiffUsingRenderer.java
@@ -73,6 +73,9 @@ public final class DiffUsingRenderer extends AbstractOperation {
}
IComparator comparator = renderer.getComparator();
+ if (renderer instanceof DefaultArtifactRenderer) {
+ ((DefaultArtifactRenderer) renderer).updateOption(RendererOption.PUBLISH_DIFF, true);
+ }
if (artifactDeltas.size() == 1) {
comparator.compare(monitor, collector, DIFF, firstDelta, pathPrefix);
} else {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java
index 73bb0c3b1f..48c9c74207 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java
@@ -98,6 +98,7 @@ public abstract class FileSystemRenderer extends DefaultArtifactRenderer {
public abstract InputStream getRenderInputStream(PresentationType presentationType, List<Artifact> artifacts) throws OseeCoreException;
public InputStream getRenderInputStream(PresentationType presentationType, IOseeBranch branch, List<Artifact> artifacts) throws OseeCoreException {
+ updateOption(RendererOption.BRANCH, branch);
return getRenderInputStream(presentationType, artifacts);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java
index 8d50e1e7eb..9151604080 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.util.RendererOption;
-import org.eclipse.osee.framework.core.util.WordMLProducer;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
import org.eclipse.osee.framework.ui.skynet.render.compare.IComparator;
@@ -40,8 +39,6 @@ public interface IRenderer {
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact);
- public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, WordMLProducer producer, String format, String label, String footer);
-
public String renderAttributeAsString(AttributeTypeId attributeType, Artifact artifact, PresentationType presentationType, String defaultValue);
public int minimumRanking();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
index ed75d587a0..39258206e8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
@@ -134,11 +134,6 @@ public final class RendererManager {
return bestRendererPrototype;
}
- public static void renderAttribute(AttributeTypeToken attributeType, PresentationType presentationType, Artifact artifact, WordMLProducer producer, String format, String label, String footer, Map<RendererOption, Object> rendererOptions) throws OseeCoreException {
- getBestRenderer(PRODUCE_ATTRIBUTE, artifact, rendererOptions).renderAttribute(attributeType, artifact,
- presentationType, producer, format, label, footer);
- }
-
public static Collection<AttributeTypeToken> getAttributeTypeOrderList(Artifact artifact) throws OseeCoreException {
return getBestRenderer(PresentationType.PRODUCE_ATTRIBUTE, artifact,
new HashMap<RendererOption, Object>()).getOrderedAttributeTypes(artifact, artifact.getAttributeTypes());
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/TisRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/TisRenderer.java
index 551f5cfdab..935a7430a4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/TisRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/TisRenderer.java
@@ -104,6 +104,7 @@ public class TisRenderer extends WordTemplateRenderer {
try {
charBak = new CharBackedInputStream();
WordMLProducer wordMl = new WordMLProducer(charBak);
+ //TODO: Move to server
wtm.processArtifacts(wordMl, artifacts);
} catch (CharacterCodingException ex) {
OseeCoreException.wrapAndThrow(ex);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
index e9a72bbf38..0dd33da618 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
@@ -12,6 +12,7 @@
package org.eclipse.osee.framework.ui.skynet.render;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.WordTemplateContent;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.PresentationType.DEFAULT_OPEN;
import static org.eclipse.osee.framework.core.enums.PresentationType.DIFF;
import static org.eclipse.osee.framework.core.enums.PresentationType.GENERALIZED_EDIT;
@@ -27,18 +28,20 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.logging.Level;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
+import org.eclipse.core.resources.IFile;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.define.report.api.WordTemplateContentData;
+import org.eclipse.osee.define.report.api.NestedTemplateData;
+import org.eclipse.osee.define.report.api.TemplateData;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.core.enums.CommandGroup;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
@@ -46,22 +49,20 @@ import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.util.RendererOption;
-import org.eclipse.osee.framework.core.util.WordMLProducer;
+import org.eclipse.osee.framework.core.util.RendererUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.jdk.core.util.io.CharBackedInputStream;
import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactURL;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.httpRequests.HttpWordUpdateRequest;
-import org.eclipse.osee.framework.skynet.core.linking.LinkType;
-import org.eclipse.osee.framework.skynet.core.linking.OseeLinkBuilder;
import org.eclipse.osee.framework.skynet.core.word.WordUtil;
import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
+import org.eclipse.osee.framework.ui.skynet.internal.ServiceUtil;
import org.eclipse.osee.framework.ui.skynet.render.compare.IComparator;
import org.eclipse.osee.framework.ui.skynet.render.compare.WordTemplateCompare;
-import org.eclipse.osee.framework.ui.skynet.render.word.WordTemplateProcessor;
import org.eclipse.osee.framework.ui.skynet.templates.TemplateManager;
import org.eclipse.osee.framework.ui.skynet.util.WordUiUtil;
import org.eclipse.osee.framework.ui.swt.Displays;
@@ -74,6 +75,13 @@ import org.w3c.dom.Element;
* @author Jeff C. Phillips
*/
public class WordTemplateRenderer extends WordRenderer {
+ private static final String INSERT_LINK = "INSERT_LINK_HERE";
+ private static final String INSERT_ARTIFACT_HERE = "INSERT_ARTIFACT_HERE";
+
+ private static final Pattern headElementsPattern =
+ Pattern.compile("(" + INSERT_ARTIFACT_HERE + ")" + "|" + INSERT_LINK,
+ Pattern.CASE_INSENSITIVE | Pattern.DOTALL | Pattern.MULTILINE);
+
private static final String EMBEDDED_OBJECT_NO = "w:embeddedObjPresent=\"no\"";
private static final String EMBEDDED_OBJECT_YES = "w:embeddedObjPresent=\"yes\"";
private static final String STYLES = "<w:styles>.*?</w:styles>";
@@ -81,13 +89,11 @@ public class WordTemplateRenderer extends WordRenderer {
private static final String OLE_START = "<w:docOleData>";
private static final String OLE_END = "</w:docOleData>";
- private final WordTemplateProcessor templateProcessor;
private final IComparator comparator;
public WordTemplateRenderer(Map<RendererOption, Object> options) {
super(options);
this.comparator = new WordTemplateCompare(this);
- this.templateProcessor = new WordTemplateProcessor(this);
}
public WordTemplateRenderer() {
@@ -105,7 +111,25 @@ public class WordTemplateRenderer extends WordRenderer {
}
public void publish(Artifact masterTemplateArtifact, Artifact slaveTemplateArtifact, List<Artifact> artifacts) throws OseeCoreException {
- templateProcessor.publishWithNestedTemplates(masterTemplateArtifact, slaveTemplateArtifact, artifacts);
+ List<ArtifactId> artifactTokens = new ArrayList<>();
+ artifactTokens.addAll(artifacts);
+
+ Map<RendererOption, Object> rendererOptions = getRendererOptions();
+
+ BranchId branch = artifacts.iterator().next().getBranch();
+ NestedTemplateData data = new NestedTemplateData();
+ data.setArtifacts(artifactTokens);
+ data.setBranch(branch);
+ data.setMasterTemplate(masterTemplateArtifact);
+ data.setSlaveTemplate(slaveTemplateArtifact);
+ data.setRendererOptions(rendererOptions);
+ data.setUser(UserId.valueOf(UserManager.getUser().getId()));
+ data.setSessionId(ClientSessionManager.getSessionId());
+
+ IFile file = RendererUtil.getRenderFile(COMMON, PREVIEW, "/", masterTemplateArtifact.getName(), ".xml");
+ rendererOptions.put(RendererOption.RESULT_PATH_RETURN, file.getLocation().toOSString());
+
+ ServiceUtil.getOseeClient().getMSWordEndpoint().applyNestedTemplates(data);
}
/**
@@ -162,67 +186,6 @@ public class WordTemplateRenderer extends WordRenderer {
}
@Override
- public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, WordMLProducer producer, String format, String label, String footer) throws OseeCoreException {
- WordMLProducer wordMl = producer;
-
- if (attributeType.equals(CoreAttributeTypes.WordTemplateContent)) {
- String data = null;
- LinkType linkType = (LinkType) getRendererOptionValue(RendererOption.LINK_TYPE);
-
- if (label.length() > 0) {
- wordMl.addParagraph(label);
- }
-
- TransactionId txId = null;
- if (artifact.isHistorical()) {
- txId = artifact.getTransaction();
- } else {
- txId = TransactionId.SENTINEL;
- }
-
- String oseeLink = ArtifactURL.getOpenInOseeLink(artifact, presentationType).toString();
-
- WordTemplateContentData wtcData = new WordTemplateContentData();
- wtcData.setArtId(artifact.getUuid());
- wtcData.setBranch(artifact.getBranch());
- wtcData.setFooter(footer);
- wtcData.setIsEdit(presentationType == PresentationType.SPECIALIZED_EDIT);
- wtcData.setLinkType(linkType != null ? linkType.toString() : null);
- wtcData.setTxId(txId);
- wtcData.setSessionId(ClientSessionManager.getSessionId());
- wtcData.setOseeLink(oseeLink);
- ArtifactId view = (ArtifactId) getRendererOptionValue(RendererOption.VIEW);
- wtcData.setViewId(view == null ? ArtifactId.SENTINEL : view);
-
- Pair<String, Set<String>> content = null;
- try {
- content = HttpWordUpdateRequest.renderWordTemplateContent(wtcData);
- } catch (Exception e) {
- WordUiUtil.displayErrorMessage(e.toString());
- }
-
- if (content != null) {
- data = content.getFirst();
- WordUiUtil.displayUnknownGuids(artifact, content.getSecond());
- }
-
- if (presentationType == PresentationType.SPECIALIZED_EDIT) {
- OseeLinkBuilder linkBuilder = new OseeLinkBuilder();
- wordMl.addEditParagraphNoEscape(linkBuilder.getStartEditImage(artifact.getGuid()));
- wordMl.addWordMl(data);
- wordMl.addEditParagraphNoEscape(linkBuilder.getEndEditImage(artifact.getGuid()));
-
- } else if (data != null) {
- wordMl.addWordMl(data);
- }
- wordMl.resetListValue();
- } else {
- super.renderAttribute(attributeType, artifact, PresentationType.SPECIALIZED_EDIT, wordMl, format, label,
- footer);
- }
- }
-
- @Override
public InputStream getRenderInputStream(PresentationType presentationType, List<Artifact> artifacts) throws OseeCoreException {
final List<Artifact> notMultiEditableArtifacts = new LinkedList<>();
Artifact template;
@@ -301,8 +264,93 @@ public class WordTemplateRenderer extends WordRenderer {
templateContent = WordUtil.removeGUIDFromTemplate(templateContent);
- return templateProcessor.applyTemplate(artifacts, templateContent, templateOptions, templateStyles, null, null,
- (String) getRendererOptionValue(RendererOption.OUTLINE_TYPE), presentationType);
+ List<ArtifactId> artifactTokens = new ArrayList<>();
+ artifactTokens.addAll(artifacts);
+ BranchId branch = artifacts.iterator().next().getBranch();
+ // TODO: CHECK HERE FOR DIFF? - how will this work?
+ Map<RendererOption, Object> rendererOptions = getRendererOptions();
+ String outlineNumber = (String) getRendererOptionValue(RendererOption.OUTLINE_TYPE);
+ String outlineType = null;
+ boolean recurseChildren = (boolean) getRendererOptionValue(RendererOption.RECURSE);
+
+ CharBackedInputStream charBak = null;
+ // if ((boolean) rendererOptions.get(PUBLISH_DIFF) || (boolean) rendererOptions.get(ORIG_PUBLISH_AS_DIFF)) {
+ // try {
+ // charBak = new CharBackedInputStream();
+ //
+ // WordMLProducer wordMl = new WordMLProducer(charBak);
+ // outlineNumber = peekAtFirstArtifactToGetParagraphNumber(templateContent, null, artifacts);
+ // //set heading numbers for wordml using templatecontent
+ // templateContent = wordMl.setHeadingNumbers(outlineNumber, templateContent, outlineType);
+ //
+ // Matcher matcher = headElementsPattern.matcher(templateContent);
+ //
+ // int lastEndIndex = 0;
+ // // add wordml from template content based on matcher
+ // if (matcher.find()) {
+ // wordMl.addWordMl(templateContent.substring(lastEndIndex, matcher.start()));
+ // lastEndIndex = matcher.end();
+ // }
+ //
+ // // set next paragraph number
+ // if (Strings.isValid(outlineNumber)) {
+ // wordMl.setNextParagraphNumberTo(outlineNumber);
+ // }
+ //
+ // WordTemplateFileDiffer templateFileDiffer = new WordTemplateFileDiffer(this);
+ // templateFileDiffer.generateFileDifferences(artifacts, "/results/", outlineNumber, outlineType,
+ // recurseChildren);
+ //
+ // String endOfTemplate = templateContent.substring(lastEndIndex);
+ //
+ // wordMl.addWordMl(updateFooter(endOfTemplate));
+ //
+ // } catch (Exception ex) {
+ // // throw
+ // throw new OseeCoreException(ex);
+ // }
+ //
+ // return charBak;
+ // } else {
+
+ TemplateData data = new TemplateData();
+ data.setArtifacts(artifactTokens);
+ data.setBranch(branch);
+ data.setTemplateContent(templateContent);
+ data.setTemplateOptions(templateOptions);
+ data.setTemplateStyles(templateStyles);
+ data.setFolder(null);
+ data.setOutlineNumber(null);
+ data.setOutlineType((String) rendererOptions.get(RendererOption.OUTLINE_TYPE));
+ data.setPresentationType(presentationType);
+ data.setRendererOptions(getRendererOptions());
+ data.setUser(UserId.valueOf(UserManager.getUser().getId()));
+ data.setSessionId(ClientSessionManager.getSessionId());
+
+ return ServiceUtil.getOseeClient().getMSWordEndpoint().applyTemplate(data);
+ // }
+ }
+
+ protected String peekAtFirstArtifactToGetParagraphNumber(String template, String nextParagraphNumber, List<Artifact> artifacts) throws OseeCoreException {
+ String startParagraphNumber = "1";
+ if (artifacts != null) {
+ Matcher matcher = headElementsPattern.matcher(template);
+
+ if (matcher.find()) {
+ String elementType = matcher.group(0);
+
+ if (elementType != null && elementType.equals(INSERT_ARTIFACT_HERE) && !artifacts.isEmpty()) {
+ Artifact artifact = artifacts.iterator().next();
+ if (artifact.isAttributeTypeValid(CoreAttributeTypes.ParagraphNumber)) {
+ String paragraphNum = artifact.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, "");
+ if (Strings.isValid(paragraphNum)) {
+ startParagraphNumber = paragraphNum;
+ }
+ }
+ }
+ }
+ }
+ return startParagraphNumber;
}
protected Artifact getTemplate(Artifact artifact, PresentationType presentationType) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java
index 518d855d71..cdc75e5c6f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java
@@ -185,7 +185,7 @@ public abstract class AbstractWordCompare implements IComparator {
"Preparing comparison for: " + (newerArtifact == null ? baseArtifact.getName() : newerArtifact.getName()));
Pair<IFile, IFile> compareFiles;
- if (artifactDelta.getStartArtifact() == artifactDelta.getBaseArtifact()) {
+ if (artifactDelta.getStartArtifact().equals(artifactDelta.getBaseArtifact())) {
compareFiles = converter.convertToFile(presentationType, artifactDelta);
} else {
// The artifactDelta is a 3 Way Merge
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java
index f640cb0875..fd41cd71de 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java
@@ -73,7 +73,7 @@ public final class WordTemplateFileDiffer {
TransactionToken startTransaction;
- if (compareBranch == null) {
+ if (compareBranch == null || compareBranch.isInvalid()) {
startTransaction = BranchManager.getBaseTransaction(endBranch);
compareBranch = endBranch;
} else {
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClient.java b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClient.java
index b89d548f14..9ca4bfad83 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClient.java
+++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClient.java
@@ -62,6 +62,8 @@ public interface OseeClient {
ActivityLogEndpoint getActivityLogEndpoint();
+ MSWordEndpoint getMSWordEndpoint();
+
boolean isLocalHost();
String getBaseUri();
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
index b263908ed4..cf0b1af7db 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
+++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
@@ -224,6 +224,11 @@ public class OseeClientImpl implements OseeClient, QueryExecutor {
}
@Override
+ public MSWordEndpoint getMSWordEndpoint() {
+ return client.targetProxy(defineUri, MSWordEndpoint.class);
+ }
+
+ @Override
public boolean isLocalHost() {
return orcsUri.toString().contains("localhost");
}
diff --git a/plugins/org.eclipse.osee.orcs/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs/META-INF/MANIFEST.MF
index 8d630fb4e3..c166fa5fa8 100644
--- a/plugins/org.eclipse.osee.orcs/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@ Import-Package: com.google.gson;version="2.1.0",
org.codehaus.jackson.map.annotate;version="1.9.13",
org.codehaus.jackson.map.ser;version="1.9.13",
org.codehaus.jackson.map.ser.std;version="1.9.13",
+ org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.osee.activity.api,
org.eclipse.osee.executor.admin,
@@ -19,15 +20,21 @@ Import-Package: com.google.gson;version="2.1.0",
org.eclipse.osee.framework.core.model,
org.eclipse.osee.framework.core.model.cache,
org.eclipse.osee.framework.core.model.change,
+ org.eclipse.osee.framework.core.model.datarights,
+ org.eclipse.osee.framework.core.model.type,
org.eclipse.osee.framework.core.util,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
+ org.eclipse.osee.framework.jdk.core.util.io,
org.eclipse.osee.framework.jdk.core.util.io.xml,
+ org.eclipse.osee.framework.jdk.core.util.xml,
+ org.eclipse.osee.framework.logging,
org.eclipse.osee.framework.resource.management,
org.eclipse.osee.orcs.rest.model,
org.json
Export-Package: org.eclipse.osee.orcs,
org.eclipse.osee.orcs.data,
+ org.eclipse.osee.orcs.renderer,
org.eclipse.osee.orcs.search,
org.eclipse.osee.orcs.statistics,
org.eclipse.osee.orcs.transaction,
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/renderer/AttributeElement.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/renderer/AttributeElement.java
new file mode 100644
index 0000000000..b133cd0ce6
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/renderer/AttributeElement.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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/eplv10.html
+ *
+ * Contributors:
+ * Boeing initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.renderer;
+
+/**
+ * @author Jeff C. Phillips
+ */
+public class AttributeElement {
+ private String label;
+ private String attributeType;
+ private String format;
+ private String formatPre;
+ private String formatPost;
+
+ public AttributeElement() {
+ this.label = "";
+ this.attributeType = "";
+ this.formatPre = "";
+ this.formatPost = "";
+ this.format = "";
+ }
+
+ public void setElements(String attributeType, String label, String formatPre, String formatPost) {
+ this.label = label;
+ this.attributeType = attributeType;
+ this.format = formatPre;
+ this.formatPre = formatPre;
+ this.formatPost = formatPost;
+ }
+
+ public String getAttributeName() {
+ return attributeType;
+ }
+
+ public String getFormat() {
+ return format;
+ }
+
+ public String getFormatPre() {
+ return formatPre;
+ }
+
+ public String getFormatPost() {
+ return formatPost;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/MetadataElement.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/renderer/MetadataElement.java
index 9e1fa05a83..09c027c1f4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/MetadataElement.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/renderer/MetadataElement.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet.render.word;
+package org.eclipse.osee.orcs.renderer;
/**
* @author Dominic A. Guss

Back to the top