Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan E. Cook2017-07-03 16:38:33 -0400
committerMorgan Cook2017-08-02 18:15:20 -0400
commit0d1f68053c13669ec4480fa52e019317af162a4b (patch)
treeaed0a65e4c1a9816e334857949133863f08c4ed9
parentf171a53bfd51b1c42dc2cd6840a87864a3b60e65 (diff)
downloadorg.eclipse.osee-0d1f68053c13669ec4480fa52e019317af162a4b.tar.gz
org.eclipse.osee-0d1f68053c13669ec4480fa52e019317af162a4b.tar.xz
org.eclipse.osee-0d1f68053c13669ec4480fa52e019317af162a4b.zip
refactor: Consolidate renderer options
Signed-off-by: Morgan E. Cook <morgan.e.cook@boeing.com> Change-Id: I1b92f0faab10f6c3290e287f2b874f559d1d5a52 Signed-off-by: Morgan E. Cook <morgan.e.cook@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWERenderer.java34
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorRenderer.java33
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java21
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java20
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefConfigRenderer.java19
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorRenderer.java33
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java4
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/PreviewAndMultiPreviewTest.java20
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java14
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateProcessorTest.java16
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java213
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java147
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java20
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java17
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/OptionType.java (renamed from plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AbstractAtsRenderer.java)27
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/RendererOption.java91
-rw-r--r--plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/GraphitiRenderer.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/GeneralPurposeRendererHandler.java30
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java120
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DiffUsingRenderer.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java12
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/HTMLRenderer.java15
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java43
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java28
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/JavaRenderer.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/NativeRenderer.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenOfficeWriterRenderer.java20
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenUsingRenderer.java15
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/PlainTextRenderer.java19
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java139
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RenderingUtil.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/TisRenderer.java21
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WholeWordRenderer.java17
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordRenderer.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java72
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/ArtifactDeltaToFileConverter.java14
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java38
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java114
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/ThreeWayWordMergeOperation.java18
49 files changed, 1025 insertions, 597 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java
index 192b9720ab..5f9d3bffdc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
@@ -28,6 +29,7 @@ import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.world.AtsWorldEditorRenderer;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -55,7 +57,7 @@ public class WorkflowPortingBlam extends AbstractBlam {
List<Artifact> destinationWorkflows = createDestinationWorkflows(changes, actionableItems);
changes.execute();
- AtsWorldEditorRenderer renderer = new AtsWorldEditorRenderer();
+ AtsWorldEditorRenderer renderer = new AtsWorldEditorRenderer(new HashMap<RendererOption, Object>());
renderer.open(destinationWorkflows, PresentationType.SPECIALIZED_EDIT);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWERenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWERenderer.java
index af281ccb17..76b9a5fb2c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWERenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWERenderer.java
@@ -14,29 +14,39 @@ import static org.eclipse.osee.framework.core.enums.PresentationType.GENERALIZED
import static org.eclipse.osee.framework.core.enums.PresentationType.PRODUCE_ATTRIBUTE;
import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED_EDIT;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.AtsOpenOption;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.enums.PresentationType;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.render.DefaultArtifactRenderer;
/**
* @author Ryan D. Brooks
*/
-public class AtsWERenderer extends AbstractAtsRenderer {
+public class AtsWERenderer extends DefaultArtifactRenderer {
private static final String Option_WORKFLOW_EDITOR = "workflow.editor.option";
+ public AtsWERenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public AtsWERenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
@Override
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact) {
commands.add(new MenuCmdDef(CommandGroup.EDIT, SPECIALIZED_EDIT, "ATS Workflow Editor", AtsImage.ACTION,
- OPEN_OPTION, Option_WORKFLOW_EDITOR));
+ RendererOption.OPEN_OPTION.getKey(), Option_WORKFLOW_EDITOR));
}
@Override
@@ -50,16 +60,20 @@ public class AtsWERenderer extends AbstractAtsRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
- VariableMap options = new VariableMap();
- options.setValues(objects);
+ public AtsWERenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new AtsWERenderer(rendererOptions);
+ }
+
+ @Override
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (!artifact.isHistorical() && !presentationType.matches(GENERALIZED_EDIT,
PRODUCE_ATTRIBUTE) && artifact.isOfType(AtsArtifactTypes.AtsArtifact)) {
- if (Option_WORKFLOW_EDITOR.equals(options.getString(OPEN_OPTION)) && !UserManager.getBooleanSetting(
- UserManager.DOUBLE_CLICK_SETTING_KEY_EDIT) && !UserManager.getBooleanSetting(
- UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT)) {
+ if (Option_WORKFLOW_EDITOR.equals(
+ rendererOptions.get(RendererOption.OPEN_OPTION)) && !UserManager.getBooleanSetting(
+ UserManager.DOUBLE_CLICK_SETTING_KEY_EDIT) && !UserManager.getBooleanSetting(
+ UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT)) {
return SPECIALIZED_MATCH;
} else {
return PRESENTATION_SUBTYPE_MATCH;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
index 06a054eb70..8c546d3474 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
@@ -10,15 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.ats.operation;
-import static org.eclipse.osee.framework.ui.skynet.render.IRenderer.NO_DISPLAY;
-import static org.eclipse.osee.framework.ui.skynet.render.IRenderer.OVERRIDE_DATA_RIGHTS_OPTION;
-import static org.eclipse.osee.framework.ui.skynet.render.IRenderer.SKIP_DIALOGS;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -38,6 +36,7 @@ import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.OperationLogger;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
@@ -130,8 +129,12 @@ public final class ExportChangeReportOperation extends AbstractOperation {
continue;
}
- RendererManager.diff(collector, artifactDeltas, prefix, NO_DISPLAY, true, SKIP_DIALOGS, true,
- OVERRIDE_DATA_RIGHTS_OPTION, overrideDataRightsClassification);
+ HashMap<RendererOption, Object> rendererOptions = new HashMap<>();
+ rendererOptions.put(RendererOption.NO_DISPLAY, true);
+ rendererOptions.put(RendererOption.SKIP_DIALOGS, true);
+ rendererOptions.put(RendererOption.OVERRIDE_DATA_RIGHTS, overrideDataRightsClassification);
+
+ RendererManager.diff(collector, artifactDeltas, prefix, rendererOptions);
}
String artIdsAsString = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",", artIds);
try {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorRenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorRenderer.java
index c40777a4ba..ddd3ebda69 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorRenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorRenderer.java
@@ -13,22 +13,33 @@ package org.eclipse.osee.ats.task;
import static org.eclipse.osee.framework.core.enums.PresentationType.GENERALIZED_EDIT;
import static org.eclipse.osee.framework.core.enums.PresentationType.PRODUCE_ATTRIBUTE;
import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED_EDIT;
+import static org.eclipse.osee.framework.core.util.RendererOption.OPEN_OPTION;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.editor.renderer.AbstractAtsRenderer;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.render.DefaultArtifactRenderer;
/**
* @author Jeff C. Phillips
*/
-public class AtsTaskEditorRenderer extends AbstractAtsRenderer {
+public class AtsTaskEditorRenderer extends DefaultArtifactRenderer {
+
+ public AtsTaskEditorRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public AtsTaskEditorRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
private static final String Option_TASK_WORLD_EDITOR = "task.world.editor.option";
@@ -38,13 +49,10 @@ public class AtsTaskEditorRenderer extends AbstractAtsRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
- VariableMap options = new VariableMap();
- options.setValues(objects);
-
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (artifact.isOfType(AtsArtifactTypes.Task) && !artifact.isHistorical() && !presentationType.matches(
GENERALIZED_EDIT, PRODUCE_ATTRIBUTE)) {
- if (Option_TASK_WORLD_EDITOR.equals(options.getString(OPEN_OPTION))) {
+ if (Option_TASK_WORLD_EDITOR.equals(rendererOptions.get(OPEN_OPTION))) {
return SPECIALIZED_KEY_MATCH;
} else {
return PRESENTATION_SUBTYPE_MATCH;
@@ -55,8 +63,8 @@ public class AtsTaskEditorRenderer extends AbstractAtsRenderer {
@Override
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact) {
- commands.add(new MenuCmdDef(CommandGroup.EDIT, SPECIALIZED_EDIT, "ATS Task Editor", AtsImage.TASK, OPEN_OPTION,
- Option_TASK_WORLD_EDITOR));
+ commands.add(new MenuCmdDef(CommandGroup.EDIT, SPECIALIZED_EDIT, "ATS Task Editor", AtsImage.TASK,
+ OPEN_OPTION.getKey(), Option_TASK_WORLD_EDITOR));
}
@Override
@@ -65,6 +73,11 @@ public class AtsTaskEditorRenderer extends AbstractAtsRenderer {
}
@Override
+ public AtsTaskEditorRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new AtsTaskEditorRenderer(rendererOptions);
+ }
+
+ @Override
public void open(List<Artifact> artifacts, PresentationType presentationType) throws OseeCoreException {
AtsUtil.openInAtsTaskEditor("Tasks", artifacts);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java
index 559ed4e1e6..0dcd7716d9 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java
@@ -18,19 +18,21 @@ import java.io.File;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.util.RendererOption;
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.util.Lib;
@@ -54,6 +56,14 @@ import org.eclipse.ui.ide.IDE;
*/
public final class AtsRuleDefinitionDslRenderer extends FileSystemRenderer {
+ public AtsRuleDefinitionDslRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public AtsRuleDefinitionDslRenderer() {
+ super(new HashMap<RendererOption, Object>());
+ }
+
@Override
public String getName() {
return "ATS Rule Definition DSL Editor";
@@ -61,11 +71,16 @@ public final class AtsRuleDefinitionDslRenderer extends FileSystemRenderer {
@Override
public DefaultArtifactRenderer newInstance() {
- return new AtsRuleDefinitionDslRenderer();
+ return new AtsRuleDefinitionDslRenderer(new HashMap<RendererOption, Object>());
+ }
+
+ @Override
+ public DefaultArtifactRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new AtsRuleDefinitionDslRenderer(rendererOptions);
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (artifact.isOfType(AtsArtifactTypes.RuleDefinition) && presentationType != GENERALIZED_EDIT) {
return PRESENTATION_SUBTYPE_MATCH;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java
index 413d149ec3..8749db8024 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java
@@ -19,7 +19,9 @@ import java.io.File;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.AtsImage;
@@ -32,6 +34,7 @@ import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.util.RendererOption;
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.util.Lib;
@@ -55,6 +58,14 @@ import org.eclipse.ui.ide.IDE;
*/
public final class AtsWorkDefinitionDslRenderer extends FileSystemRenderer {
+ public AtsWorkDefinitionDslRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public AtsWorkDefinitionDslRenderer() {
+ super(new HashMap<RendererOption, Object>());
+ }
+
@Override
public String getName() {
return "ATS Work Definition DSL Editor";
@@ -62,11 +73,16 @@ public final class AtsWorkDefinitionDslRenderer extends FileSystemRenderer {
@Override
public DefaultArtifactRenderer newInstance() {
- return new AtsWorkDefinitionDslRenderer();
+ return new AtsWorkDefinitionDslRenderer(new HashMap<RendererOption, Object>());
+ }
+
+ @Override
+ public DefaultArtifactRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new AtsWorkDefinitionDslRenderer(rendererOptions);
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (artifact.isOfType(
AtsArtifactTypes.WorkDefinition) && !presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED)) {
return SUBTYPE_TYPE_MATCH;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefConfigRenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefConfigRenderer.java
index c843a3490a..b8db2dbd92 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefConfigRenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefConfigRenderer.java
@@ -13,14 +13,16 @@ package org.eclipse.osee.ats.workdef.viewer;
import static org.eclipse.osee.framework.core.enums.PresentationType.GENERALIZED_EDIT;
import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED_EDIT;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.enums.PresentationType;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -37,6 +39,14 @@ import org.eclipse.ui.IEditorInput;
*/
public class AtsWorkDefConfigRenderer extends DefaultArtifactRenderer {
+ public AtsWorkDefConfigRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public AtsWorkDefConfigRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
public Image getImage(Artifact artifact) {
return ImageManager.getImage(AtsImage.WORKFLOW_CONFIG);
}
@@ -58,7 +68,12 @@ public class AtsWorkDefConfigRenderer extends DefaultArtifactRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public AtsWorkDefConfigRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new AtsWorkDefConfigRenderer(rendererOptions);
+ }
+
+ @Override
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (artifact.isOfType(AtsArtifactTypes.WorkDefinition) && presentationType != GENERALIZED_EDIT) {
return ARTIFACT_TYPE_MATCH;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorRenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorRenderer.java
index 6b58d4b295..bca2fa0f01 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorRenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorRenderer.java
@@ -13,37 +13,45 @@ package org.eclipse.osee.ats.world;
import static org.eclipse.osee.framework.core.enums.PresentationType.GENERALIZED_EDIT;
import static org.eclipse.osee.framework.core.enums.PresentationType.PRODUCE_ATTRIBUTE;
import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED_EDIT;
+import static org.eclipse.osee.framework.core.util.RendererOption.OPEN_OPTION;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.editor.renderer.AbstractAtsRenderer;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.render.DefaultArtifactRenderer;
/**
* @author Jeff C. Phillips
*/
-public class AtsWorldEditorRenderer extends AbstractAtsRenderer {
+public class AtsWorldEditorRenderer extends DefaultArtifactRenderer {
private static final String Option_WORLD_EDITOR = "world.editor.option";
+ public AtsWorldEditorRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public AtsWorldEditorRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (artifact.isHistorical() || presentationType.matches(GENERALIZED_EDIT, PRODUCE_ATTRIBUTE)) {
return NO_MATCH;
}
- VariableMap options = new VariableMap();
- options.setValues(objects);
if (artifact.isOfType(AtsArtifactTypes.AtsArtifact)) {
- if (Option_WORLD_EDITOR.equals(options.getString(OPEN_OPTION))) {
+ if (Option_WORLD_EDITOR.equals(rendererOptions.get(OPEN_OPTION))) {
return SPECIALIZED_KEY_MATCH;
} else {
return PRESENTATION_SUBTYPE_MATCH;
@@ -65,8 +73,8 @@ public class AtsWorldEditorRenderer extends AbstractAtsRenderer {
@Override
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact) {
- commands.add(new MenuCmdDef(CommandGroup.EDIT, SPECIALIZED_EDIT, "ATS World Editor", AtsImage.GLOBE, OPEN_OPTION,
- Option_WORLD_EDITOR));
+ commands.add(new MenuCmdDef(CommandGroup.EDIT, SPECIALIZED_EDIT, "ATS World Editor", AtsImage.GLOBE,
+ OPEN_OPTION.getKey(), Option_WORLD_EDITOR));
}
@Override
@@ -80,6 +88,11 @@ public class AtsWorldEditorRenderer extends AbstractAtsRenderer {
}
@Override
+ public AtsWorldEditorRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new AtsWorldEditorRenderer(rendererOptions);
+ }
+
+ @Override
public void open(List<Artifact> artifacts, PresentationType presentationType) {
AtsUtil.openInAtsWorldEditor("ATS", artifacts);
}
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java
index e8648f1608..ba5b7a9d21 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java
@@ -14,6 +14,7 @@ import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
@@ -25,6 +26,7 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -77,7 +79,7 @@ public class HtmlRendererTest {
public void setUp() throws OseeCoreException {
Artifact Folder;
Artifact htmlArtifact;
- renderer = new HTMLRenderer();
+ renderer = new HTMLRenderer(new HashMap<RendererOption, Object>());
// create example artifact
theArtifacts = new ArrayList<>();
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/PreviewAndMultiPreviewTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/PreviewAndMultiPreviewTest.java
index 1e1beb6337..ec409de22a 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/PreviewAndMultiPreviewTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/PreviewAndMultiPreviewTest.java
@@ -14,7 +14,9 @@ import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.framework.core.data.BranchId;
@@ -22,11 +24,11 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts;
-import org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.skynet.render.WholeWordRenderer;
import org.eclipse.osee.framework.ui.skynet.render.WordTemplateRenderer;
@@ -68,7 +70,7 @@ public class PreviewAndMultiPreviewTest {
parentArtifact.persist(getClass().getSimpleName());
- WordTemplateRenderer renderer = new WordTemplateRenderer();
+ WordTemplateRenderer renderer = new WordTemplateRenderer(new HashMap<RendererOption, Object>());
renderer.open(Arrays.asList(parentArtifact), PresentationType.PREVIEW);
}
@@ -82,7 +84,7 @@ public class PreviewAndMultiPreviewTest {
parentArtifact.persist(getClass().getSimpleName());
- RendererManager.openInJob(Arrays.asList(parentArtifact), PresentationType.PREVIEW);
+ RendererManager.openInJob(parentArtifact, PresentationType.PREVIEW);
}
/*
@@ -98,8 +100,10 @@ public class PreviewAndMultiPreviewTest {
parentArtifact.persist(getClass().getSimpleName());
- RendererManager.open(parentArtifact, PresentationType.PREVIEW,
- ITemplateRenderer.PREVIEW_WITH_RECURSE_OPTION_PAIR);
+ Map<RendererOption, Object> rendererOptions = new HashMap<>();
+ rendererOptions.put(RendererOption.TEMPLATE_OPTION, RendererOption.PREVIEW_WITH_RECURSE_VALUE.getKey());
+
+ RendererManager.open(parentArtifact, PresentationType.PREVIEW, rendererOptions);
}
@Test
@@ -112,7 +116,7 @@ public class PreviewAndMultiPreviewTest {
parentArtifact.persist(getClass().getSimpleName());
- RendererManager.openInJob(Arrays.asList(parentArtifact), PresentationType.PREVIEW);
+ RendererManager.openInJob(parentArtifact, PresentationType.PREVIEW);
}
/*
@@ -128,7 +132,7 @@ public class PreviewAndMultiPreviewTest {
parentArtifact.persist(getClass().getSimpleName());
- RendererManager.openInJob(Arrays.asList(parentArtifact), PresentationType.PREVIEW);
+ RendererManager.openInJob(parentArtifact, PresentationType.PREVIEW);
}
/*
@@ -182,7 +186,7 @@ public class PreviewAndMultiPreviewTest {
public void testWholeWordPreviewUsingRendererManager() throws Exception {
Artifact art = createArtifact(CoreArtifactTypes.TestProcedureWML, SAW_Bld_1, addPrefix("4h"));
art.persist(String.format("%s, persist on %s", PreviewAndMultiPreviewTest.class.getSimpleName(), SAW_Bld_1));
- RendererManager.openInJob(Arrays.asList(art), PresentationType.PREVIEW);
+ RendererManager.openInJob(art, PresentationType.PREVIEW);
}
private Artifact createArtifact(IArtifactType type, BranchId branch, String name) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java
index 82315dd68a..4fb48d6a12 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java
@@ -19,7 +19,9 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.core.resources.IFolder;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
@@ -31,6 +33,7 @@ import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.model.TransactionDelta;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -38,7 +41,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta;
import org.eclipse.osee.framework.skynet.core.change.Change;
import org.eclipse.osee.framework.skynet.core.revision.ChangeManager;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
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.compare.CompareData;
@@ -61,11 +63,14 @@ public final class ViewWordChangeAndDiffTest {
private IFolder renderFolder;
private BranchId branch;
+ private Map<RendererOption, Object> rendererOptions;
@Before
public void setUp() throws Exception {
renderFolder = RenderingUtil.ensureRenderFolderExists(PresentationType.DIFF);
branch = SAW_Bld_2;
+ rendererOptions = new HashMap<>();
+ rendererOptions.put(RendererOption.NO_DISPLAY, true);
}
@Test
@@ -88,8 +93,7 @@ public final class ViewWordChangeAndDiffTest {
}
};
- RendererManager.diff(collector, new ArtifactDelta(txDelta, baseArtifact, newerArtifact), "", IRenderer.NO_DISPLAY,
- true);
+ RendererManager.diff(collector, new ArtifactDelta(txDelta, baseArtifact, newerArtifact), "", rendererOptions);
sleep(2000);
@@ -119,7 +123,7 @@ public final class ViewWordChangeAndDiffTest {
checkPermissions(asArtifacts(changes));
Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes);
- RendererManager.diff(artifactDeltas, "testDiff", IRenderer.NO_DISPLAY, true);
+ RendererManager.diff(artifactDeltas, "testDiff", rendererOptions);
verifyRenderFolderExists();
}
@@ -131,7 +135,7 @@ public final class ViewWordChangeAndDiffTest {
checkPermissions(Collections.singletonList(artifact));
Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes);
- RendererManager.diff(artifactDeltas, "", IRenderer.NO_DISPLAY, true);
+ RendererManager.diff(artifactDeltas, "", rendererOptions);
verifyRenderFolderExists();
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateProcessorTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateProcessorTest.java
index 7c180494c0..b36daaecd0 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateProcessorTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateProcessorTest.java
@@ -13,17 +13,19 @@ package org.eclipse.osee.client.integration.tests.integration.ui.skynet;
import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
-import static org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer.PREVIEW_WITH_RECURSE_OPTION_PAIR;
import java.io.File;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.client.test.framework.TestInfo;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -64,6 +66,8 @@ public class WordTemplateProcessorTest {
private static String F_WITH_PUBLISH_INLINE;
private static String F_WITHOUT_PUBLISH_INLINE;
+ ArtifactId recurseTemplate;
+
@BeforeClass
public static void loadTestFiles() throws Exception {
C_WITH_PUBLISH_INLINE = getResourceData("wordtemplate_c_with_publish_inline.xml");
@@ -83,6 +87,8 @@ public class WordTemplateProcessorTest {
branch = IOseeBranch.create(method.getQualifiedTestName());
BranchManager.createWorkingBranch(SAW_Bld_1, branch);
+
+ recurseTemplate = ArtifactId.valueOf(200007L);
myRootArtifact =
ArtifactTypeManager.addArtifact(CoreArtifactTypes.Requirement, branch, "WordTemplateProcessorTest_Root");
@@ -164,8 +170,10 @@ public class WordTemplateProcessorTest {
}
private void checkPreviewContents(Artifact artifact, String expected, String notExpected) throws OseeCoreException, IOException {
- String filePath =
- RendererManager.open(myRootArtifact, PresentationType.PREVIEW, PREVIEW_WITH_RECURSE_OPTION_PAIR);
+ Map<RendererOption, Object> rendererOptions = new HashMap<>();
+
+ rendererOptions.put(RendererOption.TEMPLATE_ARTIFACT, recurseTemplate);
+ String filePath = RendererManager.open(myRootArtifact, PresentationType.PREVIEW, rendererOptions);
String fileContents = Lib.fileToString(new File(filePath));
Assert.assertTrue(String.format(ERROR_MESSAGE, artifact, true), fileContents.contains(expected));
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 c1d95e63fa..6b1a0f92cd 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
@@ -12,11 +12,28 @@ package org.eclipse.osee.client.integration.tests.integration.ui.skynet;
import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO;
import static org.eclipse.osee.framework.core.enums.RelationSorter.USER_DEFINED;
+import static org.eclipse.osee.framework.core.util.RendererOption.BRANCH;
+import static org.eclipse.osee.framework.core.util.RendererOption.COMPARE_BRANCH;
+import static org.eclipse.osee.framework.core.util.RendererOption.EXCLUDE_ARTIFACT_TYPES;
+import static org.eclipse.osee.framework.core.util.RendererOption.EXCLUDE_FOLDERS;
+import static org.eclipse.osee.framework.core.util.RendererOption.FIRST_TIME;
+import static org.eclipse.osee.framework.core.util.RendererOption.LINK_TYPE;
+import static org.eclipse.osee.framework.core.util.RendererOption.MAINTAIN_ORDER;
+import static org.eclipse.osee.framework.core.util.RendererOption.NO_DISPLAY;
+import static org.eclipse.osee.framework.core.util.RendererOption.PUBLISH_DIFF;
+import static org.eclipse.osee.framework.core.util.RendererOption.RECURSE_ON_LOAD;
+import static org.eclipse.osee.framework.core.util.RendererOption.RESULT_PATH_RETURN;
+import static org.eclipse.osee.framework.core.util.RendererOption.SKIP_ERRORS;
+import static org.eclipse.osee.framework.core.util.RendererOption.TRANSACTION_OPTION;
+import static org.eclipse.osee.framework.core.util.RendererOption.UPDATE_PARAGRAPH_NUMBERS;
+import static org.eclipse.osee.framework.core.util.RendererOption.USE_TEMPLATE_ONCE;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
@@ -29,6 +46,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -42,8 +60,6 @@ import org.eclipse.osee.framework.skynet.core.linking.LinkType;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.skynet.preferences.MsWordPreferencePage;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer;
import org.eclipse.osee.framework.ui.skynet.render.WordTemplateRenderer;
import org.junit.After;
import org.junit.Assert;
@@ -115,8 +131,7 @@ public class WordTemplateRendererTest {
private Artifact masterTemplate_idAndName;
private Artifact slaveTemplate;
- private final WordTemplateRenderer renderer = new WordTemplateRenderer();
- private Object[] options;
+ private WordTemplateRenderer renderer;
@BeforeClass
public static void loadTemplateInfo() throws Exception {
@@ -132,35 +147,23 @@ public class WordTemplateRendererTest {
@Before
public void setUp() throws OseeCoreException {
// Establish default option settings
- options = new Object[] {
- "Branch",
- null,
- "compareBranch",
- null,
- "Publish As Diff",
- true,
- "linkType",
- LinkType.INTERNAL_DOC_REFERENCE_USE_NAME,
- WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION,
- false,
- ITemplateRenderer.TRANSACTION_OPTION,
- null,
- IRenderer.SKIP_ERRORS,
- true,
- "Exclude Folders",
- true,
- "EXCLUDE ARTIFACT TYPES",
- new ArrayList<IArtifactType>(),
- "Recurse On Load",
- true,
- "Maintain Order",
- true,
- ITemplateRenderer.USE_TEMPLATE_ONCE,
- true,
- WordTemplateRenderer.FIRST_TIME,
- true,
- IRenderer.NO_DISPLAY,
- true};
+ HashMap<RendererOption, Object> rendererOptionsMap = new HashMap<>();
+ rendererOptionsMap.put(BRANCH, null);
+ rendererOptionsMap.put(COMPARE_BRANCH, null);
+ 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>());
+ rendererOptionsMap.put(RECURSE_ON_LOAD, true);
+ rendererOptionsMap.put(MAINTAIN_ORDER, true);
+ rendererOptionsMap.put(USE_TEMPLATE_ONCE, true);
+ rendererOptionsMap.put(FIRST_TIME, true);
+ rendererOptionsMap.put(NO_DISPLAY, true);
+
+ renderer = new WordTemplateRenderer(rendererOptionsMap);
String branchName = method.getQualifiedTestName();
rootBranch = BranchManager.createTopLevelBranch(branchName);
@@ -226,13 +229,13 @@ public class WordTemplateRendererTest {
BranchId childBr = BranchManager.createWorkingBranch(middleBr, "Child Branch");
vol4 = ArtifactQuery.getArtifactFromId(vol4.getGuid(), childBr);
- modifyOption("Branch", childBr);
- modifyOption("Publish As Diff", true);
- modifyOption("compareBranch", rootBr);
+ modifyOption(BRANCH, childBr);
+ modifyOption(PUBLISH_DIFF, true);
+ modifyOption(COMPARE_BRANCH, rootBr);
- renderer.publish(singleTemplate, null, Collections.singletonList(vol4), options);
+ renderer.publish(singleTemplate, null, Collections.singletonList(vol4));
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
try {
@@ -256,13 +259,13 @@ public class WordTemplateRendererTest {
@Test
public void testPublishWithoutDiff() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", false);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, false);
List<Artifact> artifacts = new ArrayList<>();
artifacts.add(docFolder);
- renderer.publish(singleTemplate, null, artifacts, options);
+ renderer.publish(singleTemplate, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
try {
@@ -275,14 +278,14 @@ public class WordTemplateRendererTest {
@Test
public void testPublishWithDiff() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", true);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, true);
List<Artifact> artifacts = new ArrayList<>();
Artifact updateDoc = ArtifactQuery.getArtifactFromId(docFolder, updateBranch);
artifacts.add(updateDoc);
- renderer.publish(singleTemplate, null, artifacts, options);
+ renderer.publish(singleTemplate, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
try {
@@ -295,13 +298,13 @@ public class WordTemplateRendererTest {
@Test
public void testPublishWithoutDiffRecurseTemplate() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", false);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, false);
List<Artifact> artifacts = new ArrayList<>();
artifacts.add(docFolder);
- renderer.publish(recurseTemplate, null, artifacts, options);
+ renderer.publish(recurseTemplate, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
try {
@@ -314,14 +317,14 @@ public class WordTemplateRendererTest {
@Test
public void testPublishWithDiffRecurseTemplate() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", true);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, true);
List<Artifact> artifacts = new ArrayList<>();
Artifact updateDoc = ArtifactQuery.getArtifactFromId(docFolder, updateBranch);
artifacts.add(updateDoc);
- renderer.publish(recurseTemplate, null, artifacts, options);
+ renderer.publish(recurseTemplate, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
try {
@@ -334,16 +337,16 @@ public class WordTemplateRendererTest {
@Test
public void testPublishWithDiffMerge() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", true);
- modifyOption("compareBranch", rootBranch);
- modifyOption("linkType", LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, true);
+ modifyOption(COMPARE_BRANCH, rootBranch);
+ modifyOption(LINK_TYPE, LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER);
List<Artifact> artifacts = new ArrayList<>();
Artifact updateDoc = ArtifactQuery.getArtifactFromId(docFolder, updateBranch);
artifacts.add(updateDoc);
- renderer.publish(singleTemplate, null, artifacts, options);
+ renderer.publish(singleTemplate, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
String contents;
@@ -368,16 +371,16 @@ public class WordTemplateRendererTest {
@Test
public void testPublishWithDiffLinks() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", true);
- modifyOption("compareBranch", null);
- modifyOption("linkType", LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER_AND_NAME);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, true);
+ modifyOption(COMPARE_BRANCH, null);
+ modifyOption(LINK_TYPE, LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER_AND_NAME);
List<Artifact> artifacts = new ArrayList<>();
Artifact updateDoc = ArtifactQuery.getArtifactFromId(docFolder, updateBranch);
artifacts.add(updateDoc);
- renderer.publish(singleTemplateAttrib, null, artifacts, options);
+ renderer.publish(singleTemplateAttrib, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
String contents;
@@ -422,17 +425,17 @@ public class WordTemplateRendererTest {
public void testPublishWithoutDiffUpdateParagraphNumbers() throws OseeCoreException {
SkynetTransaction transaction =
TransactionManager.createTransaction(updateBranch, String.format("%s", method.getQualifiedTestName()));
- modifyOption("Branch", updateBranch);
- modifyOption(ITemplateRenderer.TRANSACTION_OPTION, transaction);
- modifyOption("Publish As Diff", false);
- modifyOption("linkType", LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER_AND_NAME);
- modifyOption(WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION, true);
+ 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, options);
+ renderer.publish(singleTemplateAttrib, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
String contents;
@@ -458,16 +461,16 @@ public class WordTemplateRendererTest {
@Test
public void testPublishWithDiffDontUseTemplateOnce() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", true);
- modifyOption("linkType", LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER_AND_NAME);
- modifyOption(ITemplateRenderer.USE_TEMPLATE_ONCE, false);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, true);
+ modifyOption(LINK_TYPE, LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER_AND_NAME);
+ modifyOption(USE_TEMPLATE_ONCE, false);
List<Artifact> artifacts = new ArrayList<>();
Artifact updateDoc = ArtifactQuery.getArtifactFromId(docFolder, updateBranch);
artifacts.add(updateDoc);
- renderer.publish(singleTemplateAttrib, null, artifacts, options);
+ renderer.publish(singleTemplateAttrib, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
String contents;
@@ -488,13 +491,13 @@ public class WordTemplateRendererTest {
@Test
public void testPublishSoftwareRequirements() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", false);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, false);
List<Artifact> artifacts = new ArrayList<>();
artifacts.add(swReqFolder);
- renderer.publish(masterTemplate, slaveTemplate, artifacts, options);
+ renderer.publish(masterTemplate, slaveTemplate, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
String contents;
@@ -520,13 +523,13 @@ public class WordTemplateRendererTest {
@Test
public void testPublishUsingIds() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", false);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, false);
List<Artifact> artifacts = new ArrayList<>();
artifacts.add(swReqFolder);
- renderer.publish(masterTemplate_idOnly, slaveTemplate, artifacts, options);
+ renderer.publish(masterTemplate_idOnly, slaveTemplate, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
String contents;
@@ -552,13 +555,13 @@ public class WordTemplateRendererTest {
@Test
public void testPublishUsingIdAndName() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", false);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, false);
List<Artifact> artifacts = new ArrayList<>();
artifacts.add(swReqFolder);
- renderer.publish(masterTemplate_idAndName, slaveTemplate, artifacts, options);
+ renderer.publish(masterTemplate_idAndName, slaveTemplate, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
String contents;
@@ -584,15 +587,15 @@ public class WordTemplateRendererTest {
@Test
public void testPublishDiffWithFieldCodes() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", true);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, true);
List<Artifact> artifacts = new ArrayList<>();
setupFieldCodeChange();
Artifact updateDoc = ArtifactQuery.getArtifactFromId(docFolder, updateBranch);
artifacts.add(updateDoc);
- renderer.publish(singleTemplate, null, artifacts, options);
+ renderer.publish(singleTemplate, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
try {
@@ -607,16 +610,16 @@ public class WordTemplateRendererTest {
@Test
public void testPublishDiffWithOutFieldCodes() throws OseeCoreException {
- modifyOption("Branch", updateBranch);
- modifyOption("Publish As Diff", true);
+ modifyOption(BRANCH, updateBranch);
+ modifyOption(PUBLISH_DIFF, true);
List<Artifact> artifacts = new ArrayList<>();
setupFieldCodeChange();
UserManager.setSetting(MsWordPreferencePage.IGNORE_FIELD_CODE_CHANGES, "true");
Artifact updateDoc = ArtifactQuery.getArtifactFromId(docFolder, updateBranch);
artifacts.add(updateDoc);
- renderer.publish(singleTemplate, null, artifacts, options);
+ renderer.publish(singleTemplate, null, artifacts);
- String resultPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ String resultPath = (String) renderer.getRendererOptionValue(RESULT_PATH_RETURN);
Assert.assertNotEquals(String.format("%s Published Doc not found", method.getQualifiedTestName()), resultPath,
null);
try {
@@ -866,13 +869,11 @@ public class WordTemplateRendererTest {
return retStr;
}
- private void modifyOption(String optName, Object optValue) {
- for (int i = 0; i < options.length; i += 2) {
- if (optName.equals(options[i])) {
- options[i + 1] = optValue;
- break;
- }
- }
+ private void modifyOption(RendererOption optName, Object optValue) {
+ Map<RendererOption, Object> rendererOptions = renderer.getRendererOptions();
+ rendererOptions.put(optName, optValue);
+
+ renderer.updateOptions(rendererOptions);
}
private void basicDocumentCheck(String document, String pubString, boolean merge, boolean fieldcode) {
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 a07a6ad2c8..596c4f52fa 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
@@ -11,12 +11,30 @@
package org.eclipse.osee.define.blam.operation;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
+import static org.eclipse.osee.framework.core.util.RendererOption.BRANCH;
+import static org.eclipse.osee.framework.core.util.RendererOption.COMPARE_BRANCH;
+import static org.eclipse.osee.framework.core.util.RendererOption.EXCLUDE_ARTIFACT_TYPES;
+import static org.eclipse.osee.framework.core.util.RendererOption.EXCLUDE_FOLDERS;
+import static org.eclipse.osee.framework.core.util.RendererOption.FIRST_TIME;
+import static org.eclipse.osee.framework.core.util.RendererOption.INCLUDE_UUIDS;
+import static org.eclipse.osee.framework.core.util.RendererOption.LINK_TYPE;
+import static org.eclipse.osee.framework.core.util.RendererOption.MAINTAIN_ORDER;
+import static org.eclipse.osee.framework.core.util.RendererOption.PROGRESS_MONITOR;
+import static org.eclipse.osee.framework.core.util.RendererOption.PUBLISH_DIFF;
+import static org.eclipse.osee.framework.core.util.RendererOption.RECURSE;
+import static org.eclipse.osee.framework.core.util.RendererOption.SKIP_ERRORS;
+import static org.eclipse.osee.framework.core.util.RendererOption.TRANSACTION_OPTION;
+import static org.eclipse.osee.framework.core.util.RendererOption.UPDATE_PARAGRAPH_NUMBERS;
+import static org.eclipse.osee.framework.core.util.RendererOption.USE_TEMPLATE_ONCE;
+import static org.eclipse.osee.framework.core.util.RendererOption.VIEW;
+import static org.eclipse.osee.framework.core.util.RendererOption.WAS_BRANCH;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -28,6 +46,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -40,8 +59,6 @@ import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.branch.ViewApplicabilityUtil;
import org.eclipse.osee.framework.ui.skynet.internal.ServiceUtil;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer;
import org.eclipse.osee.framework.ui.skynet.render.WordTemplateRenderer;
import org.eclipse.osee.framework.ui.skynet.templates.TemplateManager;
import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget;
@@ -68,6 +85,11 @@ import org.json.JSONObject;
* @author Theron Virgin
*/
public class PublishWithSpecifiedTemplate extends AbstractBlam {
+
+ private static String ARTIFACTS = "Artifacts";
+ private static String MASTER_TEMPLATE = "Master Template";
+ private static String SLAVE_TEMPLATE = "Slave Template";
+
private List<Artifact> templates;
private BranchId branch;
private Map<Long, String> branchViews;
@@ -77,18 +99,6 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
private XDslEditorWidget orcsQueryWidget;
private XCombo branchViewWidget;
private XListDropViewer artifactsWidget;
- private final String USE_ARTIFACT_NAMES = "Use Artifact Names";
- private final String USE_PARAGRAPH_NUMBERS = "Use Paragraph Numbers";
- private final String UPDATE_PARAGRAPH_NUMBERS = "Update Paragraph Numbers (If authorized)";
- private final String EXCLUDE_ARTIFACT_TYPES = "Exclude Artifact Types";
- private final String MASTER_TEMPLATE = "Master Template";
- private final String SLAVE_TEMPLATE = "Slave Template";
- private final String IS_ARTIFACTS = "IS Artifacts";
- private final String PUBLISH_AS_DIFF = "Publish As Diff";
- private final String WAS_BRANCH = "WAS Branch";
- private final String INCLUDE_ARTIFACT_UUIDS = "Include Artifact UUIDs";
- private final String ORCS_QUERY = "Orcs Query";
- private final String VIEW = "Branch View (For IS Artifacts)";
@Override
public String getName() {
@@ -99,9 +109,8 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
populateTemplateList();
- boolean useArtifactNameInLinks = variableMap.getBoolean(USE_ARTIFACT_NAMES);
- boolean useParagraphNumbersInLinks = variableMap.getBoolean(USE_PARAGRAPH_NUMBERS);
- variableMap.getBoolean(INCLUDE_ARTIFACT_UUIDS);
+ boolean useArtifactNameInLinks = variableMap.getBoolean(RendererOption.USE_ARTIFACT_NAMES.getKey());
+ boolean useParagraphNumbersInLinks = variableMap.getBoolean(RendererOption.USE_PARAGRAPH_NUMBERS.getKey());
if (!useParagraphNumbersInLinks && !useArtifactNameInLinks) {
throw new OseeArgumentException("Please select at least one Document Link Format");
@@ -124,7 +133,7 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
List<Artifact> artifacts = null;
try {
if (orcsQueryWidget.getText().isEmpty()) {
- artifacts = variableMap.getArtifacts(IS_ARTIFACTS);
+ artifacts = variableMap.getArtifacts(ARTIFACTS);
} else {
artifacts = getArtifactsFromOrcsQuery();
}
@@ -142,7 +151,10 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
throw new OseeArgumentException("Cannot determine IS branch.");
}
- Object view = variableMap.getValue(VIEW);
+ SkynetTransaction transaction =
+ TransactionManager.createTransaction(branch, "BLAM: Publish with specified template");
+
+ Object view = variableMap.getValue(RendererOption.VIEW.getKey());
ArtifactId viewId = ArtifactId.SENTINEL;
for (Entry<Long, String> entry : branchViews.entrySet()) {
if (entry.getValue().equals(view)) {
@@ -150,45 +162,28 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
}
}
- WordTemplateRenderer renderer = new WordTemplateRenderer();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(branch, "BLAM: Publish with specified template");
+ HashMap<RendererOption, Object> rendererOptionsMap = new HashMap<>();
+ rendererOptionsMap.put(BRANCH, branch);
+ rendererOptionsMap.put(COMPARE_BRANCH, variableMap.getValue(WAS_BRANCH.getKey()));
+ rendererOptionsMap.put(INCLUDE_UUIDS, variableMap.getValue(INCLUDE_UUIDS.getKey()));
+ 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);
+ rendererOptionsMap.put(MAINTAIN_ORDER, true);
+ rendererOptionsMap.put(PROGRESS_MONITOR, true);
+ rendererOptionsMap.put(USE_TEMPLATE_ONCE, true);
+ rendererOptionsMap.put(FIRST_TIME, true);
+ rendererOptionsMap.put(PUBLISH_DIFF, variableMap.getValue(PUBLISH_DIFF.getKey()));
+ rendererOptionsMap.put(VIEW, viewId);
+
+ WordTemplateRenderer renderer = new WordTemplateRenderer(rendererOptionsMap);
+
+ Boolean isDiff = (Boolean) rendererOptionsMap.get(PUBLISH_DIFF);
- Object[] options = new Object[] {
- "Branch",
- branch,
- "compareBranch",
- variableMap.getBranch(WAS_BRANCH),
- "Publish As Diff",
- variableMap.getValue(PUBLISH_AS_DIFF),
- "INCLUDE UUIDS",
- variableMap.getValue(INCLUDE_ARTIFACT_UUIDS),
- "linkType",
- linkType,
- WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION,
- variableMap.getBoolean(UPDATE_PARAGRAPH_NUMBERS),
- "EXCLUDE ARTIFACT TYPES",
- variableMap.getArtifactTypes(EXCLUDE_ARTIFACT_TYPES),
- ITemplateRenderer.TRANSACTION_OPTION,
- transaction,
- IRenderer.SKIP_ERRORS,
- true,
- "Exclude Folders",
- true,
- "Recurse On Load",
- true,
- "Maintain Order",
- true,
- "Progress Monitor",
- monitor,
- ITemplateRenderer.USE_TEMPLATE_ONCE,
- true,
- WordTemplateRenderer.FIRST_TIME,
- true,
- "ViewId",
- viewId};
-
- Boolean isDiff = (Boolean) variableMap.getValue(PUBLISH_AS_DIFF);
int toProcessSize = 0;
if (isDiff) {
for (Artifact art : artifacts) {
@@ -218,7 +213,7 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
});
if (result.get()) {
- renderer.publish(master, slave, artifacts, options);
+ renderer.publish(master, slave, artifacts);
transaction.execute();
monitor.done();
}
@@ -286,21 +281,21 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
StringBuilder builder = new StringBuilder();
builder.append(String.format(
"<xWidgets><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"%s\" />",
- UPDATE_PARAGRAPH_NUMBERS));
+ RendererOption.UPDATE_PARAGRAPH_NUMBERS.getKey()));
builder.append(String.format(
"<XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"%s\" />",
- INCLUDE_ARTIFACT_UUIDS));
+ RendererOption.INCLUDE_UUIDS.getKey()));
builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Document Link Format:\"/>");
builder.append(String.format(
"<XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"%s\" defaultValue=\"true\"/>",
- USE_ARTIFACT_NAMES));
+ RendererOption.USE_ARTIFACT_NAMES.getKey()));
builder.append(String.format(
"<XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"%s\" />",
- USE_PARAGRAPH_NUMBERS));
+ RendererOption.USE_PARAGRAPH_NUMBERS.getKey()));
builder.append(String.format(
"<XWidget xwidgetType=\"XArtifactTypeMultiChoiceSelect\" displayName=\"Exclude Artifact Types\" />",
- EXCLUDE_ARTIFACT_TYPES));
+ RendererOption.EXCLUDE_ARTIFACT_TYPES.getKey()));
builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\" \" /><XWidget xwidgetType=\"XCombo(");
for (Artifact art : templates) {
@@ -316,21 +311,24 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
builder.append(String.format(
")\" displayName=\"%s\" horizontalLabel=\"true\"/><XWidget xwidgetType=\"XLabel\" displayName=\" \" />",
+
SLAVE_TEMPLATE));
- builder.append(String.format("<XWidget xwidgetType=\"XListDropViewer\" displayName=\"%s\" />", IS_ARTIFACTS));
+ builder.append(String.format("<XWidget xwidgetType=\"XListDropViewer\" displayName=\"%s\" />", ARTIFACTS));
builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\" \" /><XWidget xwidgetType=\"XCombo(");
- builder.append(String.format(")\" displayName=\"%s\" horizontalLabel=\"true\"/>", VIEW));
+ builder.append(String.format(")\" displayName=\"%s\" horizontalLabel=\"true\"/>", RendererOption.VIEW.getKey()));
+
+ builder.append(String.format("<XWidget xwidgetType=\"XDslEditorWidget\" displayName=\"%s\" defaultValue=\"",
+ RendererOption.ORCS_QUERY.getKey()));
- builder.append(
- String.format("<XWidget xwidgetType=\"XDslEditorWidget\" displayName=\"%s\" defaultValue=\"", ORCS_QUERY));
builder.append("orcs");
builder.append("\" fill=\"vertically\"/>");
builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Generate Differences:\"/>");
builder.append(String.format(
"<XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"%s\" />",
- PUBLISH_AS_DIFF));
- builder.append(String.format("<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"%s\"/>", WAS_BRANCH));
+ RendererOption.PUBLISH_DIFF.getKey()));
+ builder.append(String.format("<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"%s\"/>",
+ RendererOption.WAS_BRANCH.getKey()));
builder.append(
"<XWidget xwidgetType=\"XLabel\" displayName=\"Note: If a WAS branch is selected, diffs will be between selected IS artifacts and current version on WAS branch\"/>");
builder.append(
@@ -343,10 +341,10 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
@Override
public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, modListener, isEditable);
- if (xWidget.getLabel().equals(WAS_BRANCH)) {
+ if (xWidget.getLabel().equals(RendererOption.WAS_BRANCH.getKey())) {
branchWidget = (XBranchSelectWidget) xWidget;
branchWidget.setEditable(false);
- } else if (xWidget.getLabel().equals(PUBLISH_AS_DIFF)) {
+ } else if (xWidget.getLabel().equals(RendererOption.PUBLISH_DIFF.getKey())) {
final XCheckBox checkBox = (XCheckBox) xWidget;
checkBox.addSelectionListener(new SelectionAdapter() {
@@ -388,7 +386,7 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
} else if (xWidget.getLabel().equals(SLAVE_TEMPLATE)) {
slaveWidget = (XCombo) xWidget;
slaveWidget.setEnabled(false);
- } else if (xWidget.getLabel().equals(IS_ARTIFACTS)) {
+ } else if (xWidget.getLabel().equals(ARTIFACTS)) {
artifactsWidget = (XListDropViewer) xWidget;
artifactsWidget.setEditable(true);
@@ -414,10 +412,11 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
}
});
- } else if (xWidget.getLabel().equals(ORCS_QUERY)) {
+ } else if (xWidget.getLabel().equals(RendererOption.ORCS_QUERY.getKey())) {
+
orcsQueryWidget = (XDslEditorWidget) xWidget;
orcsQueryWidget.setEditable(true);
- } else if (xWidget.getLabel().equals(VIEW)) {
+ } else if (xWidget.getLabel().equals(RendererOption.VIEW.getKey())) {
branchViewWidget = (XCombo) xWidget;
branchViewWidget.setEditable(false);
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
index 9566b3a668..3743ec5650 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
@@ -17,7 +17,9 @@ import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.framework.core.data.BranchId;
@@ -25,6 +27,7 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.dsl.ui.integration.internal.DslUiIntegrationConstants;
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.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -44,6 +47,15 @@ import org.eclipse.ui.part.FileEditorInput;
* @author Jonathan E. Jensen
*/
public abstract class AbstractDslRenderer extends FileSystemRenderer {
+
+ public AbstractDslRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public AbstractDslRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
private static final String DEFAULT_EDITOR_ID = "org.eclipse.osee.framework.core.dsl.OseeDsl";
/**
@@ -59,6 +71,12 @@ public abstract class AbstractDslRenderer extends FileSystemRenderer {
public abstract DefaultArtifactRenderer newInstance();
/**
+ * Provides an instance of the concrete class.
+ */
+ @Override
+ public abstract DefaultArtifactRenderer newInstance(Map<RendererOption, Object> rendererOptions);
+
+ /**
* Provides a list of the artifact types that the renderer supports.
*
* @return a list of the artifact types that the renderer supports
@@ -104,7 +122,7 @@ public abstract class AbstractDslRenderer extends FileSystemRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (!presentationType.matches(GENERALIZED_EDIT, PRODUCE_ATTRIBUTE) && !artifact.isHistorical()) {
if (artifact.isOfType(getArtifactTypeMatches())) {
return ARTIFACT_TYPE_MATCH;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java
index ccd86be1bb..5b2d72ac2f 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java
@@ -14,7 +14,9 @@ import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.dsl.integration.util.OseeDslSegmentParser;
@@ -23,6 +25,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
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.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.render.DefaultArtifactRenderer;
@@ -32,6 +35,7 @@ import org.eclipse.osee.framework.ui.skynet.render.FileToAttributeUpdateOperatio
* @author Roberto E. Escobar
*/
public final class OseeDslRenderer extends AbstractDslRenderer {
+
private static final IArtifactType[] MATCHING_ARTIFACT_TYPES = {
CoreArtifactTypes.AccessControlModel,
CoreArtifactTypes.OseeTypeDefinition,
@@ -39,12 +43,25 @@ public final class OseeDslRenderer extends AbstractDslRenderer {
private static final OseeDslSegmentParser parser = new OseeDslSegmentParser();
+ public OseeDslRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public OseeDslRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
@Override
public String getName() {
return "OseeDsl Editor";
}
@Override
+ public DefaultArtifactRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new OseeDslRenderer(rendererOptions);
+ }
+
+ @Override
public DefaultArtifactRenderer newInstance() {
return new OseeDslRenderer();
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AbstractAtsRenderer.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/OptionType.java
index b17195633e..53bd50e388 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AbstractAtsRenderer.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/OptionType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Boeing.
+ * 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
@@ -8,19 +8,16 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.editor.renderer;
+package org.eclipse.osee.framework.core.util;
-import org.eclipse.osee.framework.ui.skynet.render.DefaultArtifactRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
-
-public abstract class AbstractAtsRenderer extends DefaultArtifactRenderer {
-
- protected AbstractAtsRenderer() {
- super();
- }
-
- @Override
- public int minimumRanking() {
- return IRenderer.GENERAL_MATCH;
- }
+public enum OptionType {
+ Artifact,
+ ArtifactId,
+ ArtifactType,
+ Boolean,
+ BranchId,
+ LinkType,
+ ProgressMonitor,
+ String,
+ Transaction;
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/RendererOption.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/RendererOption.java
new file mode 100644
index 0000000000..6d75338336
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/RendererOption.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.framework.core.util;
+
+public enum RendererOption {
+ // Boolean
+ PUBLISH_DIFF("Publish Diff", OptionType.Boolean),
+ ORIG_PUBLISH_AS_DIFF("Orig Publish As Diff", OptionType.Boolean),
+ ADD_MERGE_TAG("Add Merge Tag", OptionType.Boolean),
+ INCLUDE_UUIDS("Include Uuids", OptionType.Boolean),
+ UPDATE_PARAGRAPH_NUMBERS("Update Paragraph Numbers", OptionType.Boolean),
+ USE_PARAGRAPH_NUMBERS("Use Paragraph Numbers", OptionType.Boolean),
+ SKIP_ERRORS("Skip Errors", OptionType.Boolean),
+ EXCLUDE_FOLDERS("Exclude Folders", OptionType.Boolean),
+ USE_TEMPLATE_ONCE("Use Template Once", OptionType.Boolean),
+ RECURSE("Recurse", OptionType.Boolean),
+ RECURSE_ON_LOAD("Recurse On Load", OptionType.Boolean),
+ USE_ARTIFACT_NAMES("Use Artifact Names", OptionType.Boolean),
+ ALL_ATTRIBUTES("All Attributes", OptionType.Boolean),
+ MAINTAIN_ORDER("Maintain Order", OptionType.Boolean),
+ NO_DISPLAY("No Display", OptionType.Boolean),
+ SKIP_DIALOGS("Skip Dialogs", OptionType.Boolean),
+ FIRST_TIME("First Time", OptionType.Boolean),
+ SECOND_TIME("SecondTime", OptionType.Boolean),
+ TEMPLATE_ONLY("Template Only", OptionType.Boolean),
+ IN_PUBLISH_MODE("In Publish Mode", OptionType.Boolean),
+
+ // BranchId
+ BRANCH("Branch", OptionType.BranchId),
+ COMPARE_BRANCH("Compare Branch", OptionType.BranchId),
+ WAS_BRANCH("Was Branch", OptionType.BranchId),
+
+ // Artifact
+ VIEW("View", OptionType.ArtifactId),
+ TEMPLATE_ARTIFACT("Template Artifact", OptionType.ArtifactId),
+
+ // LinkType
+ LINK_TYPE("linkType", OptionType.LinkType),
+
+ // ArtifactType
+ EXCLUDE_ARTIFACT_TYPES("Exclude Artifact Types", OptionType.ArtifactType),
+
+ // ProgressMonitor
+ PROGRESS_MONITOR("Progress Monitor", OptionType.ProgressMonitor),
+
+ // SkynetTransaction
+ TRANSACTION_OPTION("Transaction Option", OptionType.Transaction),
+
+ // String
+ ORCS_QUERY("Orcs Query", OptionType.String),
+ OVERRIDE_DATA_RIGHTS("Override Data Rights", OptionType.String),
+ ATTRIBUTE_NAME("Attribute Name", OptionType.String),
+ PARAGRAPH_NUMBER("Paragraph Number", OptionType.String),
+ OUTLINE_TYPE("Outline Type", OptionType.String),
+ RESULT_PATH_RETURN("resultPath", OptionType.String),
+ OPEN_OPTION("open.option", OptionType.String),
+ EXECUTE_VB_SCRIPT("execute.vb.script", OptionType.String),
+ TEMPLATE_OPTION("Template", OptionType.String),
+ PREVIEW_WITH_RECURSE_VALUE("PREVIEW_WITH_RECURSE", OptionType.String),
+ PREVIEW_WITH_RECURSE_NO_ATTRIBUTES_VALUE("PREVIEW_WITH_RECURSE_NO_ATTRIBUTES", OptionType.String),
+ DIFF_VALUE("DIFF", OptionType.String),
+ DIFF_NO_ATTRIBUTES_VALUE("DIFF_NO_ATTRIBUTES", OptionType.String),
+ THREE_WAY_MERGE("THREE_WAY_MERGE", OptionType.String),
+ ID("Id", OptionType.String),
+ NAME("Name", OptionType.String);
+
+ private final String key;
+ private final OptionType type;
+
+ RendererOption(String key, OptionType type) {
+ this.key = key;
+ this.type = type;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public OptionType getType() {
+ return type;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF
index c0f1f57fe2..6da821886f 100644
--- a/plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.ui.data.model.editor/META-INF/MANIFEST.MF
@@ -38,6 +38,7 @@ Import-Package: org.eclipse.core.commands,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.model,
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,
diff --git a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/GraphitiRenderer.java b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/GraphitiRenderer.java
index da01556262..e4afc035c5 100644
--- a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/GraphitiRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/GraphitiRenderer.java
@@ -17,11 +17,14 @@ import static org.eclipse.osee.framework.core.enums.PresentationType.RENDER_AS_H
import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED_EDIT;
import static org.eclipse.osee.framework.ui.data.model.editor.GraphitiImage.GRAPHITI_DIAGRAM;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.emf.common.util.URI;
import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -38,6 +41,19 @@ import org.eclipse.ui.IWorkbenchPage;
*/
public class GraphitiRenderer extends DefaultArtifactRenderer {
+ public GraphitiRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public GraphitiRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
+ @Override
+ public GraphitiRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new GraphitiRenderer(rendererOptions);
+ }
+
@Override
public GraphitiRenderer newInstance() {
return new GraphitiRenderer();
@@ -49,7 +65,7 @@ public class GraphitiRenderer extends DefaultArtifactRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
int rating = IRenderer.NO_MATCH;
if (artifact.getArtifactType().inheritsFrom(CoreArtifactTypes.ModelDiagram)) {
if (presentationType.matches(RENDER_AS_HUMAN_READABLE_TEXT, PREVIEW, DEFAULT_OPEN, SPECIALIZED_EDIT)) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml b/plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml
index 38f583e2e4..d6b38d2d31 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/plugin.xml
@@ -1616,7 +1616,7 @@
optional="false">
</commandParameter>
<commandParameter
- id="template"
+ id="Template"
name="Template"
optional="true">
</commandParameter>
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 b366b17f2b..6aad6f442a 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
@@ -12,10 +12,13 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.change;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta;
@@ -23,7 +26,6 @@ import org.eclipse.osee.framework.skynet.core.change.Change;
import org.eclipse.osee.framework.skynet.core.revision.ChangeManager;
import org.eclipse.osee.framework.ui.plugin.util.CommandHandler;
import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.skynet.render.RenderingUtil;
@@ -47,7 +49,10 @@ public class SingleNativeDiffHandler extends CommandHandler {
public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException {
Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes);
String pathPrefix = RenderingUtil.getAssociatedArtifactName(changes);
- RendererManager.diffInJob(artifactDeltas, pathPrefix, IRenderer.VIEW_ID, Handlers.getViewId());
+ Map<RendererOption, Object> rendererOptions = new HashMap<>();
+ 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/commandHandlers/change/ViewWordChangeReportHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java
index 2bc185dbb6..02000627ef 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java
@@ -17,6 +17,7 @@ import java.util.List;
import java.util.Set;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta;
@@ -25,7 +26,6 @@ import org.eclipse.osee.framework.skynet.core.revision.ChangeManager;
import org.eclipse.osee.framework.ui.plugin.util.CommandHandler;
import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers;
import org.eclipse.osee.framework.ui.skynet.render.ArtifactGuis;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
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;
@@ -53,8 +53,8 @@ public class ViewWordChangeReportHandler extends CommandHandler {
if (ArtifactGuis.checkDeletedOnParent(artifacts)) {
String pathPrefix = RenderingUtil.getAssociatedArtifactName(localChanges);
- IRenderer preferredRenderer = new WordTemplateRenderer();
- preferredRenderer.setOption(IRenderer.VIEW_ID, Handlers.getViewId());
+ WordTemplateRenderer preferredRenderer = new WordTemplateRenderer();
+ preferredRenderer.updateOption(RendererOption.VIEW, Handlers.getViewId());
RendererManager.diffInJobWithPreferedRenderer(artifactDeltas, pathPrefix, preferredRenderer);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/GeneralPurposeRendererHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/GeneralPurposeRendererHandler.java
index cf8fc4ff90..eba4dacf1a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/GeneralPurposeRendererHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/GeneralPurposeRendererHandler.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers;
-import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
/**
@@ -29,27 +29,27 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
public class GeneralPurposeRendererHandler extends AbstractEditorHandler {
@Override
public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) {
- ArrayList<Object> options = new ArrayList<>(6);
+
+ Map<RendererOption, Object> rendererOptions = new HashMap<>();
+
String presentationTypeStr = event.getParameter(PresentationType.class.getSimpleName());
- String template = event.getParameter(ITemplateRenderer.TEMPLATE_OPTION);
- String openOption = event.getParameter(IRenderer.OPEN_OPTION);
- ArtifactId viewId = Handlers.getViewId();
+ String template = event.getParameter(RendererOption.TEMPLATE_OPTION.getKey());
+ String openOption = event.getParameter(RendererOption.OPEN_OPTION.getKey());
+ ArtifactId view = Handlers.getViewId();
+
PresentationType presentationType = PresentationType.valueOf(presentationTypeStr);
if (template != null) {
- options.add(ITemplateRenderer.TEMPLATE_OPTION);
- options.add(template);
+ rendererOptions.put(RendererOption.TEMPLATE_OPTION, template);
}
if (openOption != null) {
- options.add(IRenderer.OPEN_OPTION);
- options.add(openOption);
+ rendererOptions.put(RendererOption.OPEN_OPTION, openOption);
}
- if (!viewId.equals(ArtifactId.SENTINEL)) {
- options.add(IRenderer.VIEW_ID);
- options.add(viewId);
+ if (!view.equals(ArtifactId.SENTINEL)) {
+ rendererOptions.put(RendererOption.VIEW, view);
}
- RendererManager.openInJob(artifacts, presentationType, options.toArray());
+ RendererManager.openInJob(artifacts, presentationType, rendererOptions);
return null;
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java
index 4f9bc62444..ab77b43fee 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java
@@ -10,11 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers;
+import java.util.HashMap;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -42,7 +44,7 @@ public class OtherEditorHandler extends AbstractEditorHandler {
new EditorSelectionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
dialog.setMessage(String.format("Choose the editor for opening %s", artifacts));
- NativeRenderer renderer = new NativeRenderer();
+ NativeRenderer renderer = new NativeRenderer(new HashMap<RendererOption, Object>());
if (dialog.open() == Window.OK) {
IEditorDescriptor editor = dialog.getSelectedEditor();
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 61d288ead1..96cc8b05f6 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
@@ -20,15 +20,17 @@ import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
-import java.util.logging.Level;
+import java.util.Map;
+import org.eclipse.osee.framework.core.data.ArtifactId;
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.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
-import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
+import org.eclipse.osee.framework.core.util.OptionType;
+import org.eclipse.osee.framework.core.util.RendererOption;
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;
@@ -44,7 +46,6 @@ import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
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.blam.VariableMap;
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;
@@ -68,33 +69,50 @@ public class DefaultArtifactRenderer implements IRenderer {
private static final String OPEN_IN_HISTORY = "open.with.resource.history";
private static final String OPEN_IN_EXPLORER = "open.with.artifact.explorer";
- private final VariableMap options = new VariableMap();
+ private Map<RendererOption, Object> rendererOptions;
- @Override
- public String getName() {
- return "Artifact Editor";
+ public DefaultArtifactRenderer(Map<RendererOption, Object> rendererOptions) {
+ this.rendererOptions = rendererOptions;
}
- @Override
- public boolean supportsCompare() {
- return false;
+ public DefaultArtifactRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
+ public Map<RendererOption, Object> getRendererOptions() {
+ return rendererOptions;
+ }
+
+ public Object getRendererOptionValue(RendererOption key) {
+ if (rendererOptions.containsKey(key)) {
+ return rendererOptions.get(key);
+ } else if (key.getType().equals(OptionType.Boolean)) {
+ return false;
+ } else if (key.getType().equals(OptionType.ArtifactId)) {
+ return ArtifactId.SENTINEL;
+ } else if (key.getType().equals(OptionType.BranchId)) {
+ return BranchId.SENTINEL;
+ }
+
+ return null;
+ }
+
+ // TODO: will remove. Do not like this.
+ public void updateOptions(Map<RendererOption, Object> rendererOptions) {
+ this.rendererOptions = rendererOptions;
}
- @Deprecated
- public Object[] getValues() {
- return options.getValues();
+ public void updateOption(RendererOption key, Object value) {
+ rendererOptions.put(key, value);
}
@Override
- public String getStringOption(String key) throws OseeArgumentException {
- return options == null ? null : options.getString(key);
+ public String getName() {
+ return "Artifact Editor";
}
@Override
- public boolean getBooleanOption(String key) throws OseeArgumentException {
- if (options != null) {
- return options.getBoolean(key);
- }
+ public boolean supportsCompare() {
return false;
}
@@ -104,7 +122,12 @@ public class DefaultArtifactRenderer implements IRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... options) throws OseeCoreException {
+ public IRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new DefaultArtifactRenderer(rendererOptions);
+ }
+
+ @Override
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED, PRODUCE_ATTRIBUTE)) {
return PRESENTATION_TYPE;
}
@@ -126,7 +149,7 @@ public class DefaultArtifactRenderer implements IRenderer {
public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, AttributeElement attributeElement, String footer) throws OseeCoreException {
WordMLProducer wordMl = (WordMLProducer) producer;
String format = attributeElement.getFormatPre();
- boolean allAttrs = getBooleanOption("allAttrs");
+ boolean allAttrs = (boolean) rendererOptions.get(RendererOption.ALL_ATTRIBUTES);
wordMl.startParagraph();
@@ -217,7 +240,11 @@ public class DefaultArtifactRenderer implements IRenderer {
Displays.ensureInDisplayThread(new Runnable() {
@Override
public void run() {
- String openOption = getStringOption(OPEN_OPTION);
+ String openOption = "";
+ if (rendererOptions.containsKey(RendererOption.OPEN_OPTION)) {
+ openOption = (String) rendererOptions.get(RendererOption.OPEN_OPTION);
+ }
+
if (OPEN_IN_GRAPH.equals(openOption)) {
for (Artifact artifact : artifacts) {
SkyWalkerView.exploreArtifact(artifact);
@@ -249,57 +276,18 @@ public class DefaultArtifactRenderer implements IRenderer {
});
}
- protected boolean isRenderOption(String value) {
- boolean result = false;
- try {
- result = getBooleanOption(value);
- } catch (OseeArgumentException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- return result;
- }
-
- @Override
- public Object getOption(String key) {
- return options.getValue(key);
- }
-
- @Override
- public BranchId getBranchOption(String key) throws OseeArgumentException {
- return options.getBranch(key);
- }
-
- @Override
- public void setOption(String optionName, Object value) {
- options.setValue(optionName, value);
- }
-
- @Override
- public void setOptions(Object... options) throws OseeArgumentException {
- this.options.setValues(options);
- }
-
- @Override
- public List<Artifact> getArtifactsOption(String key) throws OseeArgumentException {
- return options.getArtifacts(key);
- }
-
@Override
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact) {
commands.add(
new MenuCmdDef(CommandGroup.SHOW, GENERALIZED_EDIT, "Artifact Editor", FrameworkImage.ARTIFACT_EDITOR));
commands.add(new MenuCmdDef(CommandGroup.SHOW, GENERALIZED_EDIT, "Mass Editor",
- FrameworkImage.ARTIFACT_MASS_EDITOR, OPEN_OPTION, OPEN_IN_TABLE_EDITOR));
+ FrameworkImage.ARTIFACT_MASS_EDITOR, RendererOption.OPEN_OPTION.getKey(), OPEN_IN_TABLE_EDITOR));
commands.add(new MenuCmdDef(CommandGroup.SHOW, GENERALIZED_EDIT, "Artifact Explorer",
- FrameworkImage.ARTIFACT_EXPLORER, OPEN_OPTION, OPEN_IN_EXPLORER));
+ FrameworkImage.ARTIFACT_EXPLORER, RendererOption.OPEN_OPTION.getKey(), OPEN_IN_EXPLORER));
commands.add(new MenuCmdDef(CommandGroup.SHOW, GENERALIZED_EDIT, "Resource History", FrameworkImage.DB_ICON_BLUE,
- OPEN_OPTION, OPEN_IN_HISTORY));
+ RendererOption.OPEN_OPTION.getKey(), OPEN_IN_HISTORY));
commands.add(new MenuCmdDef(CommandGroup.SHOW, GENERALIZED_EDIT, "Sky Walker", FrameworkImage.SKYWALKER,
- OPEN_OPTION, OPEN_IN_GRAPH));
+ RendererOption.OPEN_OPTION.getKey(), OPEN_IN_GRAPH));
}
- @Override
- public List<IArtifactType> getArtifactTypesOption(String key) throws OseeArgumentException {
- return options.getArtifactTypes(key);
- }
} \ No newline at end of file
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 49d61f7523..e2cd271189 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
@@ -13,8 +13,10 @@ package org.eclipse.osee.framework.ui.skynet.render;
import static org.eclipse.osee.framework.core.enums.PresentationType.DIFF;
import java.util.Collection;
import java.util.Collections;
+import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
@@ -23,27 +25,27 @@ import org.eclipse.osee.framework.ui.skynet.render.compare.IComparator;
public final class DiffUsingRenderer extends AbstractOperation {
- private final Object[] options;
+ private final Map<RendererOption, Object> rendererOptions;
private final Collection<ArtifactDelta> artifactDeltas;
private final String pathPrefix;
private final CompareDataCollector collector;
private final IRenderer preferedRenderer;
- public DiffUsingRenderer(CompareDataCollector collector, Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferedRenderer, Object... options) {
+ public DiffUsingRenderer(CompareDataCollector collector, Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferedRenderer, Map<RendererOption, Object> rendererOptions) {
super(generateOperationName(artifactDeltas), Activator.PLUGIN_ID);
this.artifactDeltas = artifactDeltas;
this.pathPrefix = pathPrefix;
- this.options = options;
+ this.rendererOptions = rendererOptions;
this.collector = collector;
this.preferedRenderer = preferedRenderer;
}
- public DiffUsingRenderer(CompareDataCollector collector, Collection<ArtifactDelta> artifactDeltas, String pathPrefix, Object... options) {
- this(collector, artifactDeltas, pathPrefix, null, options);
+ public DiffUsingRenderer(CompareDataCollector collector, Collection<ArtifactDelta> artifactDeltas, String pathPrefix, Map<RendererOption, Object> rendererOptions) {
+ this(collector, artifactDeltas, pathPrefix, null, rendererOptions);
}
- public DiffUsingRenderer(CompareDataCollector collector, ArtifactDelta artifactDelta, String diffPrefix, Object... options) {
- this(collector, Collections.singletonList(artifactDelta), diffPrefix, options);
+ public DiffUsingRenderer(CompareDataCollector collector, ArtifactDelta artifactDelta, String diffPrefix, Map<RendererOption, Object> rendererOptions) {
+ this(collector, Collections.singletonList(artifactDelta), diffPrefix, rendererOptions);
}
private static String generateOperationName(Collection<ArtifactDelta> artifactDeltas) {
@@ -67,7 +69,7 @@ public final class DiffUsingRenderer extends AbstractOperation {
IRenderer renderer = preferedRenderer;
if (preferedRenderer == null) {
- renderer = RendererManager.getBestRenderer(DIFF, sampleArtifact, options);
+ renderer = RendererManager.getBestRenderer(DIFF, sampleArtifact, rendererOptions);
}
IComparator comparator = renderer.getComparator();
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 930e2a7164..73bb0c3b1f 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
@@ -16,13 +16,16 @@ import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED
import java.io.File;
import java.io.InputStream;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.logging.Level;
import org.eclipse.core.resources.IFile;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
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.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -42,8 +45,17 @@ import org.eclipse.ui.part.FileEditorInput;
* @author Jeff C. Phillips
*/
public abstract class FileSystemRenderer extends DefaultArtifactRenderer {
+
private static final ArtifactFileMonitor monitor = new ArtifactFileMonitor();
+ public FileSystemRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public FileSystemRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
public IFile renderToFile(Artifact artifact, IOseeBranch branch, PresentationType presentationType) throws OseeCoreException {
List<Artifact> artifacts;
if (artifact == null) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/HTMLRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/HTMLRenderer.java
index a65e18481b..4dd83ca913 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/HTMLRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/HTMLRenderer.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.util.RendererOption;
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.util.Lib;
@@ -50,10 +51,15 @@ public class HTMLRenderer extends FileSystemRenderer {
private final IComparator comparator;
- public HTMLRenderer() {
+ public HTMLRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
this.comparator = new HTMLDiffRenderer();
}
+ public HTMLRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
@Override
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact) {
ImageDescriptor icon = ImageManager.getProgramImageDescriptor("htm");
@@ -97,7 +103,7 @@ public class HTMLRenderer extends FileSystemRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
int toReturn = NO_MATCH;
if (artifact.isAttributeTypeValid(CoreAttributeTypes.HTMLContent)) {
if (presentationType.matches(PresentationType.PREVIEW, PresentationType.DIFF)) {
@@ -128,6 +134,11 @@ public class HTMLRenderer extends FileSystemRenderer {
}
@Override
+ public HTMLRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new HTMLRenderer(rendererOptions);
+ }
+
+ @Override
public IComparator getComparator() {
return comparator;
}
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 b23f38a62b..74014f579b 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
@@ -13,13 +13,11 @@ package org.eclipse.osee.framework.ui.skynet.render;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
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.enums.PresentationType;
-import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.core.util.RendererOption;
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;
@@ -41,15 +39,6 @@ public interface IRenderer {
public static final int BASE_MATCH = 5;
public static final int NO_MATCH = -1;
- public static final String RESULT_PATH_RETURN = "resultPath";
- public static final String NO_DISPLAY = "noDisplay";
- public static final String SKIP_ERRORS = "skipErrors";
- public static final String SKIP_DIALOGS = "skipDialogs";
- public static final String OPEN_OPTION = "open.option";
- public static final String EXECUTE_VB_SCRIPT = "execute.vb.script";
- public static final String OVERRIDE_DATA_RIGHTS_OPTION = "overrideDataRights";
- public static final String VIEW_ID = "ViewId";
-
public static enum DataRightsClassification {
governmentPurposeRights("Government Purpose Rights"),
limitedRights("Limited Rights"),
@@ -111,35 +100,21 @@ public interface IRenderer {
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact);
- public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, AttributeElement attributeElement, String footer) throws OseeCoreException;
+ public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, AttributeElement attributeElement, String footer);
- public String renderAttributeAsString(AttributeTypeId attributeType, Artifact artifact, PresentationType presentationType, String defaultValue) throws OseeCoreException;
+ public String renderAttributeAsString(AttributeTypeId attributeType, Artifact artifact, PresentationType presentationType, String defaultValue);
- public int minimumRanking() throws OseeCoreException;
+ public int minimumRanking();
- public void open(List<Artifact> artifacts, PresentationType presentationType) throws OseeCoreException;
+ public void open(List<Artifact> artifacts, PresentationType presentationType);
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException;
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions);
public String getName();
- public void setOptions(Object... options) throws OseeArgumentException;
-
- public void setOption(String optionName, Object value);
-
- public String getStringOption(String key) throws OseeArgumentException;
-
- public Object getOption(String key) throws OseeArgumentException;
-
- public List<Artifact> getArtifactsOption(String key) throws OseeArgumentException;
-
- public List<IArtifactType> getArtifactTypesOption(String key) throws OseeArgumentException;
-
- public boolean getBooleanOption(String key) throws OseeArgumentException;
-
- public BranchId getBranchOption(String key) throws OseeArgumentException;
+ public IRenderer newInstance(Map<RendererOption, Object> rendererOptions);
- public IRenderer newInstance() throws OseeCoreException;
+ public IRenderer newInstance();
public boolean supportsCompare();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java
deleted file mode 100644
index c1858f9bf1..0000000000
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet.render;
-
-/**
- * @author Ryan D. Brooks
- */
-public interface ITemplateRenderer extends IRenderer {
- public static final String TEMPLATE_OPTION = "template";
- public static final String USE_TEMPLATE_ONCE = "use once";
- public static final String ADD_MERGE_TAG = "Add Merge Tag";
- public static final String TRANSACTION_OPTION = "skynetTransaction";
- public static final String PREVIEW_WITH_RECURSE_VALUE = "PREVIEW_WITH_RECURSE";
- public static final String PREVIEW_WITH_RECURSE_NO_ATTRIBUTES_VALUE = "PREVIEW_WITH_RECURSE_NO_ATTRIBUTES";
- public static final String DIFF_VALUE = "DIFF";
- public static final String DIFF_NO_ATTRIBUTES_VALUE = "DIFF_NO_ATTRIBUTES";
- public static final String THREE_WAY_MERGE = "THREE_WAY_MERGE";
- public static final Object[] PREVIEW_WITH_RECURSE_OPTION_PAIR =
- new String[] {TEMPLATE_OPTION, PREVIEW_WITH_RECURSE_VALUE};
-}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/JavaRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/JavaRenderer.java
index 39c0da1fa9..8d871443eb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/JavaRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/JavaRenderer.java
@@ -16,8 +16,10 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.IFileSystem;
@@ -32,6 +34,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.util.RendererOption;
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.util.Collections;
@@ -54,6 +57,14 @@ import org.eclipse.ui.ide.IDE;
*/
public class JavaRenderer extends FileSystemRenderer {
+ public JavaRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public JavaRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
@Override
public String getName() {
return "Java Editor";
@@ -65,7 +76,12 @@ public class JavaRenderer extends FileSystemRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public DefaultArtifactRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new JavaRenderer(rendererOptions);
+ }
+
+ @Override
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
int toReturn = NO_MATCH;
if (artifact.isOfType(CoreArtifactTypes.TestCase)) {
if (presentationType.matches(PresentationType.SPECIALIZED_EDIT, PresentationType.DEFAULT_OPEN)) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/NativeRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/NativeRenderer.java
index 5b875dd867..6409b42ace 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/NativeRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/NativeRenderer.java
@@ -17,13 +17,16 @@ import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.logging.Level;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
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.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -41,6 +44,14 @@ import org.eclipse.swt.program.Program;
*/
public class NativeRenderer extends FileSystemRenderer {
+ public NativeRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public NativeRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
@Override
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact) {
ImageDescriptor imageDescriptor = null;
@@ -68,7 +79,12 @@ public class NativeRenderer extends FileSystemRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public NativeRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new NativeRenderer(rendererOptions);
+ }
+
+ @Override
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (artifact.isAttributeTypeValid(CoreAttributeTypes.NativeContent)) {
if (presentationType.matches(SPECIALIZED_EDIT, PREVIEW, DEFAULT_OPEN)) {
return PRESENTATION_SUBTYPE_MATCH;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenOfficeWriterRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenOfficeWriterRenderer.java
index f915aac48b..51dfaf0d73 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenOfficeWriterRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenOfficeWriterRenderer.java
@@ -12,17 +12,28 @@ package org.eclipse.osee.framework.ui.skynet.render;
import java.io.File;
import java.io.InputStream;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.framework.core.data.BranchId;
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.skynet.core.artifact.Artifact;
import org.eclipse.swt.program.Program;
/**
* @author Ryan D. Brooks
*/
-public class OpenOfficeWriterRenderer extends FileSystemRenderer implements ITemplateRenderer {
+public class OpenOfficeWriterRenderer extends FileSystemRenderer {
+
+ public OpenOfficeWriterRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public OpenOfficeWriterRenderer() {
+ super(new HashMap<RendererOption, Object>());
+ }
@Override
public OpenOfficeWriterRenderer newInstance() {
@@ -30,6 +41,11 @@ public class OpenOfficeWriterRenderer extends FileSystemRenderer implements ITem
}
@Override
+ public OpenOfficeWriterRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new OpenOfficeWriterRenderer(rendererOptions);
+ }
+
+ @Override
public String getAssociatedExtension(Artifact artifact) {
return "odt";
}
@@ -45,7 +61,7 @@ public class OpenOfficeWriterRenderer extends FileSystemRenderer implements ITem
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
return NO_MATCH;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenUsingRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenUsingRenderer.java
index 353ff46048..952d4ceb13 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenUsingRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/OpenUsingRenderer.java
@@ -13,9 +13,11 @@ package org.eclipse.osee.framework.ui.skynet.render;
import static org.eclipse.osee.framework.core.enums.PresentationType.SPECIALIZED_EDIT;
import java.util.Collection;
import java.util.LinkedList;
+import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
@@ -25,14 +27,14 @@ import org.eclipse.osee.framework.ui.skynet.internal.Activator;
*/
public final class OpenUsingRenderer extends AbstractOperation {
private final Collection<Artifact> artifacts;
- private final Object[] options;
+ private final Map<RendererOption, Object> rendererOptions;
private final PresentationType presentationType;
private String resutPath;
- public OpenUsingRenderer(Collection<Artifact> artifacts, PresentationType presentationType, Object... options) {
+ public OpenUsingRenderer(Collection<Artifact> artifacts, PresentationType presentationType, Map<RendererOption, Object> rendererOptions) {
super(String.format("Open for %s using renderer", presentationType), Activator.PLUGIN_ID);
this.artifacts = artifacts;
- this.options = options;
+ this.rendererOptions = rendererOptions;
this.presentationType = presentationType;
}
@@ -42,11 +44,14 @@ public final class OpenUsingRenderer extends AbstractOperation {
return;
}
HashCollection<IRenderer, Artifact> rendererArtifactMap =
- RendererManager.createRenderMap(presentationType, artifacts, options);
+ RendererManager.createRenderMap(presentationType, artifacts, rendererOptions);
for (IRenderer renderer : rendererArtifactMap.keySet()) {
renderer.open((LinkedList<Artifact>) rendererArtifactMap.getValues(renderer), presentationType);
- resutPath = renderer.getStringOption(IRenderer.RESULT_PATH_RETURN);
+ if (renderer instanceof DefaultArtifactRenderer) {
+ resutPath =
+ (String) ((DefaultArtifactRenderer) renderer).getRendererOptionValue(RendererOption.RESULT_PATH_RETURN);
+ }
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/PlainTextRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/PlainTextRenderer.java
index 78952af561..b24e33ff6e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/PlainTextRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/PlainTextRenderer.java
@@ -20,12 +20,15 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
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.WordCoreUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -47,10 +50,15 @@ public class PlainTextRenderer extends FileSystemRenderer {
private final IComparator comparator;
- public PlainTextRenderer() {
+ public PlainTextRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
this.comparator = new PlainTextDiffRenderer();
}
+ public PlainTextRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
@Override
public boolean supportsCompare() {
return true;
@@ -96,7 +104,7 @@ public class PlainTextRenderer extends FileSystemRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (artifact.isAttributeTypeValid(CoreAttributeTypes.PlainTextContent)) {
if (presentationType.matches(SPECIALIZED_EDIT, PREVIEW, DEFAULT_OPEN, PRODUCE_ATTRIBUTE, DIFF)) {
return PRESENTATION_SUBTYPE_MATCH;
@@ -122,7 +130,12 @@ public class PlainTextRenderer extends FileSystemRenderer {
@Override
public PlainTextRenderer newInstance() {
- return new PlainTextRenderer();
+ return new PlainTextRenderer(new HashMap<RendererOption, Object>());
+ }
+
+ @Override
+ public PlainTextRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new PlainTextRenderer(rendererOptions);
}
@Override
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 f06e392a99..740e944e97 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
@@ -17,9 +17,11 @@ import static org.eclipse.osee.framework.core.enums.PresentationType.PRODUCE_ATT
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -27,6 +29,7 @@ import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
@@ -55,8 +58,8 @@ public final class RendererManager {
/**
* @return Returns the intersection of renderers applicable for all of the artifacts
*/
- public static List<IRenderer> getCommonRenderers(Collection<Artifact> artifacts, PresentationType presentationType, Object... data) throws OseeCoreException {
- List<IRenderer> commonRenders = getApplicableRenderers(presentationType, artifacts.iterator().next(), data);
+ public static List<IRenderer> getCommonRenderers(Collection<Artifact> artifacts, PresentationType presentationType) throws OseeCoreException {
+ List<IRenderer> commonRenders = getApplicableRenderers(presentationType, artifacts.iterator().next());
for (Artifact artifact : artifacts) {
List<IRenderer> applicableRenders = getApplicableRenderers(presentationType, artifact);
@@ -99,13 +102,17 @@ public final class RendererManager {
}
}
- public static IRenderer getBestRenderer(PresentationType presentationType, Artifact artifact, Object... options) throws OseeCoreException {
- IRenderer bestRenderer = getBestRendererPrototype(presentationType, artifact, options).newInstance();
- bestRenderer.setOptions(options);
+ public static IRenderer getBestRenderer(PresentationType presentationType, Artifact artifact) {
+ return getBestRenderer(presentationType, artifact, new HashMap<RendererOption, Object>());
+ }
+
+ public static IRenderer getBestRenderer(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
+ IRenderer bestRenderer =
+ getBestRendererPrototype(presentationType, artifact, rendererOptions).newInstance(rendererOptions);
return bestRenderer;
}
- private static IRenderer getBestRendererPrototype(PresentationType presentationType, Artifact artifact, Object... options) throws OseeCoreException {
+ private static IRenderer getBestRendererPrototype(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) throws OseeCoreException {
if (presentationType == DEFAULT_OPEN && UserManager.getBooleanSetting(
UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT)) {
presentationType = GENERAL_REQUESTED;
@@ -114,8 +121,8 @@ public final class RendererManager {
int bestRating = IRenderer.NO_MATCH;
ensurePopulated();
for (IRenderer renderer : renderers) {
- renderer.setOptions(options);
- int rating = renderer.getApplicabilityRating(presentationType, artifact, options);
+ int rating = renderer.getApplicabilityRating(presentationType, artifact, rendererOptions);
+
if (rating > bestRating) {
bestRendererPrototype = renderer;
bestRating = rating;
@@ -128,26 +135,29 @@ public final class RendererManager {
return bestRendererPrototype;
}
- public static void renderAttribute(AttributeTypeToken attributeType, PresentationType presentationType, Artifact artifact, Producer producer, AttributeElement attributeElement, String footer, Object... options) throws OseeCoreException {
- getBestRenderer(PRODUCE_ATTRIBUTE, artifact, options).renderAttribute(attributeType, artifact, presentationType,
- producer, attributeElement, footer);
+ public static void renderAttribute(AttributeTypeToken attributeType, PresentationType presentationType, Artifact artifact, Producer producer, AttributeElement attributeElement, String footer, Map<RendererOption, Object> rendererOptions) throws OseeCoreException {
+ getBestRenderer(PRODUCE_ATTRIBUTE, artifact, rendererOptions).renderAttribute(attributeType, artifact,
+ presentationType, producer, attributeElement, footer);
}
public static Collection<AttributeTypeToken> getAttributeTypeOrderList(Artifact artifact) throws OseeCoreException {
- return getBestRenderer(PresentationType.PRODUCE_ATTRIBUTE, artifact).getOrderedAttributeTypes(artifact,
- artifact.getAttributeTypes());
+ return getBestRenderer(PresentationType.PRODUCE_ATTRIBUTE, artifact,
+ new HashMap<RendererOption, Object>()).getOrderedAttributeTypes(artifact, artifact.getAttributeTypes());
}
private static List<IRenderer> getApplicableRenderers(PresentationType presentationType, Artifact artifact, Object... data) throws OseeCoreException {
ArrayList<IRenderer> applicableRenderers = new ArrayList<>();
- IRenderer bestRenderer = getBestRenderer(presentationType, artifact, data);
+
+ IRenderer bestRenderer = getBestRenderer(presentationType, artifact, new HashMap<RendererOption, Object>());
+
int rendererMinimumRanking = bestRenderer.minimumRanking();
int minimumRank = Math.max(rendererMinimumRanking, IRenderer.BASE_MATCH);
for (IRenderer prototypeRenderer : renderers) {
// Add Catch Exception Code --
- int rating = prototypeRenderer.getApplicabilityRating(presentationType, artifact);
+ int rating =
+ prototypeRenderer.getApplicabilityRating(presentationType, artifact, new HashMap<RendererOption, Object>());
if (rating >= minimumRank) {
IRenderer renderer = prototypeRenderer.newInstance();
applicableRenderers.add(renderer);
@@ -156,11 +166,11 @@ public final class RendererManager {
return applicableRenderers;
}
- public static HashCollection<IRenderer, Artifact> createRenderMap(PresentationType presentationType, Collection<Artifact> artifacts, Object... options) throws OseeCoreException {
+ public static HashCollection<IRenderer, Artifact> createRenderMap(PresentationType presentationType, Collection<Artifact> artifacts, Map<RendererOption, Object> rendererOptions) {
HashCollection<IRenderer, Artifact> prototypeRendererArtifactMap =
new HashCollection<IRenderer, Artifact>(false, LinkedList.class);
for (Artifact artifact : artifacts) {
- IRenderer renderer = getBestRendererPrototype(presentationType, artifact, options);
+ IRenderer renderer = getBestRendererPrototype(presentationType, artifact, rendererOptions);
prototypeRendererArtifactMap.put(renderer, artifact);
}
@@ -168,99 +178,116 @@ public final class RendererManager {
HashCollection<IRenderer, Artifact> rendererArtifactMap =
new HashCollection<IRenderer, Artifact>(false, LinkedList.class);
for (IRenderer prototypeRenderer : prototypeRendererArtifactMap.keySet()) {
- IRenderer renderer = prototypeRenderer.newInstance();
- renderer.setOptions(options);
+ IRenderer renderer = prototypeRenderer.newInstance(rendererOptions);
rendererArtifactMap.put(renderer, prototypeRendererArtifactMap.getValues(prototypeRenderer));
}
return rendererArtifactMap;
}
public static void openInJob(Artifact artifact, PresentationType presentationType) {
- openInJob(Collections.singletonList(artifact), presentationType);
+ openInJob(Collections.singletonList(artifact), presentationType, new HashMap<RendererOption, Object>());
}
- public static void openInJob(Collection<Artifact> artifacts, PresentationType presentationType, Object... options) {
- Operations.executeAsJob(new OpenUsingRenderer(artifacts, presentationType, options), true);
+ public static void openInJob(Collection<Artifact> artifacts, PresentationType presentationType) {
+ openInJob(artifacts, presentationType, new HashMap<RendererOption, Object>());
}
- public static String open(Collection<Artifact> artifacts, PresentationType presentationType, IProgressMonitor monitor, Object... options) throws OseeCoreException {
- OpenUsingRenderer operation = new OpenUsingRenderer(artifacts, presentationType, options);
+ public static void openInJob(Collection<Artifact> artifacts, PresentationType presentationType, Map<RendererOption, Object> rendererOptions) {
+ Operations.executeAsJob(new OpenUsingRenderer(artifacts, presentationType, rendererOptions), true);
+ }
+
+ public static String open(Collection<Artifact> artifacts, PresentationType presentationType, IProgressMonitor monitor, Map<RendererOption, Object> rendererOptions) throws OseeCoreException {
+ OpenUsingRenderer operation = new OpenUsingRenderer(artifacts, presentationType, rendererOptions);
Operations.executeWorkAndCheckStatus(operation, monitor);
return operation.getResultPath();
}
public static String open(Collection<Artifact> artifacts, PresentationType presentationType) throws OseeCoreException {
- return open(artifacts, presentationType, new NullProgressMonitor());
+ return open(artifacts, presentationType, new NullProgressMonitor(), new HashMap<RendererOption, Object>());
}
- public static String open(Artifact artifact, PresentationType presentationType, Object... options) throws OseeCoreException {
- return open(Collections.singletonList(artifact), presentationType, new NullProgressMonitor(), options);
+ public static String open(Artifact artifact, PresentationType presentationType, Map<RendererOption, Object> rendererOptions) throws OseeCoreException {
+ return open(Collections.singletonList(artifact), presentationType, new NullProgressMonitor(), rendererOptions);
}
public static String open(Artifact artifact, PresentationType presentationType, IProgressMonitor monitor) throws OseeCoreException {
- return open(Collections.singletonList(artifact), presentationType, monitor);
+ return open(Collections.singletonList(artifact), presentationType, monitor, new HashMap<RendererOption, Object>());
}
public static String open(Artifact artifact, PresentationType presentationType) throws OseeCoreException {
return open(Collections.singletonList(artifact), presentationType);
}
- public static void merge(CompareDataCollector collector, Artifact baseVersion, Artifact newerVersion, IFile baseFile, IFile newerFile, String pathPrefix, Object... options) throws OseeCoreException {
- IRenderer renderer = getBestRenderer(PresentationType.MERGE, baseVersion, options);
+ public static void merge(CompareDataCollector collector, Artifact baseVersion, Artifact newerVersion, IFile baseFile, IFile newerFile, String pathPrefix, Map<RendererOption, Object> rendererOptions) throws OseeCoreException {
+ IRenderer renderer = getBestRenderer(PresentationType.MERGE, baseVersion, rendererOptions);
IComparator comparator = renderer.getComparator();
comparator.compare(collector, baseVersion, newerVersion, baseFile, newerFile, PresentationType.MERGE, pathPrefix);
}
- public static void diffInJob(ArtifactDelta artifactDelta, String pathPrefix, Object... options) {
+ public static void diffInJob(ArtifactDelta artifactDelta, String pathPrefix) {
+ diffInJob(artifactDelta, pathPrefix, new HashMap<RendererOption, Object>());
+ }
+
+ public static void diffInJob(ArtifactDelta artifactDelta, String pathPrefix, Map<RendererOption, Object> rendererOptions) {
CompareDataCollector collector = new NoOpCompareDataCollector();
- Operations.executeAsJob(new DiffUsingRenderer(collector, artifactDelta, pathPrefix, options), true);
+ Operations.executeAsJob(new DiffUsingRenderer(collector, artifactDelta, pathPrefix, rendererOptions), true);
}
- public static void diff(CompareDataCollector collector, Collection<ArtifactDelta> artifactDelta, String pathPrefix, Object... options) {
- IRenderer renderer = new WordTemplateRenderer();
- renderer.setOptions(options);
- DiffUsingRenderer operation = new DiffUsingRenderer(collector, artifactDelta, pathPrefix, renderer, options);
+ public static void diff(CompareDataCollector collector, Collection<ArtifactDelta> artifactDelta, String pathPrefix, Map<RendererOption, Object> rendererOptions) {
+ IRenderer renderer = new WordTemplateRenderer(rendererOptions);
+ DiffUsingRenderer operation =
+ new DiffUsingRenderer(collector, artifactDelta, pathPrefix, renderer, rendererOptions);
Operations.executeWork(operation);
}
- public static void diff(CompareDataCollector collector, ArtifactDelta artifactDelta, String pathPrefix, Object... options) {
- DiffUsingRenderer operation = new DiffUsingRenderer(collector, artifactDelta, pathPrefix, options);
+ public static void diff(CompareDataCollector collector, ArtifactDelta artifactDelta, String pathPrefix, Map<RendererOption, Object> rendererOptions) {
+ DiffUsingRenderer operation = new DiffUsingRenderer(collector, artifactDelta, pathPrefix, rendererOptions);
Operations.executeWork(operation);
}
- public static void diffInJobWithPreferedRenderer(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferedRenderer, Object... options) {
+ public static void diffInJobWithPreferedRenderer(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferedRenderer) {
+ diffInJobWithPreferedRenderer(artifactDeltas, pathPrefix, preferedRenderer, new HashMap<RendererOption, Object>());
+ }
+
+ public static void diffInJobWithPreferedRenderer(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferedRenderer, Map<RendererOption, Object> rendererOptions) {
CompareDataCollector collector = new NoOpCompareDataCollector();
- IOperation operation = new DiffUsingRenderer(collector, artifactDeltas, pathPrefix, preferedRenderer, options);
+ IOperation operation =
+ new DiffUsingRenderer(collector, artifactDeltas, pathPrefix, preferedRenderer, rendererOptions);
Operations.executeAsJob(operation, true);
}
- public static void diffInJob(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, Object... options) {
- diffInJobWithPreferedRenderer(artifactDeltas, pathPrefix, null, options);
+ public static void diffInJob(Collection<ArtifactDelta> artifactDeltas, String pathPrefix) {
+ diffInJob(artifactDeltas, pathPrefix, new HashMap<RendererOption, Object>());
+ }
+
+ public static void diffInJob(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, Map<RendererOption, Object> rendererOptions) {
+ diffInJobWithPreferedRenderer(artifactDeltas, pathPrefix, null, rendererOptions);
}
- public static void diff(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, Object... options) {
+ public static void diff(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, Map<RendererOption, Object> rendererOptions) {
CompareDataCollector collector = new NoOpCompareDataCollector();
- IOperation operation = new DiffUsingRenderer(collector, artifactDeltas, pathPrefix, options);
+ IOperation operation = new DiffUsingRenderer(collector, artifactDeltas, pathPrefix, rendererOptions);
IProgressMonitor monitor = null;
- for (int i = 0; i < options.length; i += 2) {
- if (((String) options[i]).equals("Progress Monitor")) {
- monitor = (IProgressMonitor) options[i + 1];
- break;
- }
+ if (rendererOptions.containsKey(RendererOption.PROGRESS_MONITOR)) {
+ monitor = (IProgressMonitor) rendererOptions.get(RendererOption.PROGRESS_MONITOR);
}
+
Operations.executeWork(operation, monitor);
}
- public static void diffWithRenderer(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferredRenderer, Object... options) {
+ public static void diffWithRenderer(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferredRenderer) {
+ diffWithRenderer(artifactDeltas, pathPrefix, preferredRenderer, new HashMap<RendererOption, Object>());
+ }
+
+ public static void diffWithRenderer(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferredRenderer, Map<RendererOption, Object> rendererOptions) {
CompareDataCollector collector = new NoOpCompareDataCollector();
- IOperation operation = new DiffUsingRenderer(collector, artifactDeltas, pathPrefix, preferredRenderer, options);
+ IOperation operation =
+ new DiffUsingRenderer(collector, artifactDeltas, pathPrefix, preferredRenderer, rendererOptions);
IProgressMonitor monitor = null;
- for (int i = 0; i < options.length; i += 2) {
- if (((String) options[i]).equals("Progress Monitor")) {
- monitor = (IProgressMonitor) options[i + 1];
- break;
- }
+ if (rendererOptions.containsKey(RendererOption.PROGRESS_MONITOR)) {
+ monitor = (IProgressMonitor) rendererOptions.get(RendererOption.PROGRESS_MONITOR);
}
+
Operations.executeWork(operation, monitor);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RenderingUtil.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RenderingUtil.java
index df615ea732..f2c7f4bd26 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RenderingUtil.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RenderingUtil.java
@@ -25,6 +25,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.model.TransactionDelta;
+import org.eclipse.osee.framework.core.util.RendererOption;
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.util.Lib;
@@ -174,7 +175,8 @@ public final class RenderingUtil {
renderFolder.create(true, true, null);
}
IFile file = renderFolder.getFile(fileName);
- renderer.setOption(IRenderer.RESULT_PATH_RETURN, file.getLocation().toOSString());
+ ((DefaultArtifactRenderer) renderer).updateOption(RendererOption.RESULT_PATH_RETURN,
+ file.getLocation().toOSString());
return file;
} catch (CoreException ex) {
throw OseeCoreException.wrap(ex);
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 3994f919c9..0947dc24da 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
@@ -16,11 +16,14 @@ import static org.eclipse.osee.framework.core.enums.PresentationType.PREVIEW;
import java.io.InputStream;
import java.nio.charset.CharacterCodingException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.io.CharBackedInputStream;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -39,13 +42,26 @@ import org.eclipse.osee.framework.ui.swt.ImageManager;
*/
public class TisRenderer extends WordTemplateRenderer {
+ public TisRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public TisRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
+ @Override
+ public TisRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new TisRenderer(rendererOptions);
+ }
+
@Override
public TisRenderer newInstance() {
return new TisRenderer();
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (artifact.getArtifactType().inheritsFrom(CoreArtifactTypes.TestInformationSheet) && presentationType.matches(
DEFAULT_OPEN, PREVIEW)) {
return SPECIALIZED_MATCH;
@@ -81,7 +97,8 @@ public class TisRenderer extends WordTemplateRenderer {
handlers.add(new TISAttributeHandler());
handlers.add(new WordAttributeTypeAttributeHandler());
handlers.add(new BasicTemplateAttributeHandler());
- WordTemplateManager wtm = new WordTemplateManager(template.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent), handlers);
+ WordTemplateManager wtm =
+ new WordTemplateManager(template.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent), handlers);
CharBackedInputStream charBak = null;
try {
charBak = new CharBackedInputStream();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java
index 919b0b9962..497545fcbe 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java
@@ -17,8 +17,11 @@ import static org.eclipse.osee.framework.core.enums.PresentationType.GENERALIZED
import static org.eclipse.osee.framework.core.enums.PresentationType.GENERAL_REQUESTED;
import static org.eclipse.osee.framework.core.enums.PresentationType.WEB_PREVIEW;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -33,6 +36,19 @@ import org.eclipse.swt.program.Program;
*/
public class UrlRenderer extends DefaultArtifactRenderer {
+ public UrlRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public UrlRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
+ @Override
+ public UrlRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new UrlRenderer(rendererOptions);
+ }
+
@Override
public UrlRenderer newInstance() {
return new UrlRenderer();
@@ -44,7 +60,7 @@ public class UrlRenderer extends DefaultArtifactRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (!presentationType.matches(GENERALIZED_EDIT,
GENERAL_REQUESTED) && artifact.getAttributeCount(ContentUrl) > 0) {
if (presentationType.equals(WEB_PREVIEW)) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WholeWordRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WholeWordRenderer.java
index da7991a7f3..394b56a492 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WholeWordRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WholeWordRenderer.java
@@ -21,8 +21,10 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -34,6 +36,7 @@ import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
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.WordCoreUtil;
import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -63,10 +66,20 @@ public class WholeWordRenderer extends WordRenderer {
private static final Pattern END_PATTERN = Pattern.compile(FTR_END_TAG);
private final IComparator comparator;
- public WholeWordRenderer() {
+ public WholeWordRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
this.comparator = new WholeWordCompare(this);
}
+ public WholeWordRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
+ @Override
+ public WholeWordRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new WholeWordRenderer(rendererOptions);
+ }
+
@Override
public WholeWordRenderer newInstance() {
return new WholeWordRenderer();
@@ -80,7 +93,7 @@ public class WholeWordRenderer extends WordRenderer {
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
if (!presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED,
PRODUCE_ATTRIBUTE) && artifact.isAttributeTypeValid(WholeWordContent)) {
return PRESENTATION_SUBTYPE_MATCH;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordRenderer.java
index 1509549048..4b3508ae4c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordRenderer.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.render;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -20,6 +23,14 @@ import org.eclipse.swt.program.Program;
*/
public abstract class WordRenderer extends FileSystemRenderer {
+ public WordRenderer(Map<RendererOption, Object> rendererOptions) {
+ super(rendererOptions);
+ }
+
+ public WordRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
// We need MS Word, so look for the program that is for .doc files
private static final Program wordApp = Program.findProgram("doc");
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 081f4e0a0b..9145554623 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
@@ -23,8 +23,10 @@ import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
+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 javax.xml.stream.XMLOutputFactory;
@@ -38,15 +40,18 @@ 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.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.operation.IOperation;
+import org.eclipse.osee.framework.core.util.RendererOption;
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.Jaxp;
import org.eclipse.osee.framework.logging.OseeLog;
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;
@@ -70,34 +75,39 @@ import org.w3c.dom.Element;
*
* @author Jeff C. Phillips
*/
-public class WordTemplateRenderer extends WordRenderer implements ITemplateRenderer {
+public class WordTemplateRenderer extends WordRenderer {
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>";
private static final String STYLES_END = "</w:styles>";
private static final String OLE_START = "<w:docOleData>";
private static final String OLE_END = "</w:docOleData>";
- public static final String UPDATE_PARAGRAPH_NUMBER_OPTION = "updateParagraphNumber";
- public static final String FIRST_TIME = "FirstTime";
- public static final String SECOND_TIME = "SecondTime";
private final WordTemplateProcessor templateProcessor;
-
private final IComparator comparator;
- public WordTemplateRenderer() {
+ public WordTemplateRenderer(Map<RendererOption, Object> options) {
+ super(options);
this.comparator = new WordTemplateCompare(this);
DataRightProvider provider = new DataRightProviderImpl();
this.templateProcessor = new WordTemplateProcessor(this, provider);
}
+ public WordTemplateRenderer() {
+ this(new HashMap<RendererOption, Object>());
+ }
+
@Override
public WordTemplateRenderer newInstance() {
- return new WordTemplateRenderer();
+ return new WordTemplateRenderer(new HashMap<RendererOption, Object>());
+ }
+
+ @Override
+ public WordTemplateRenderer newInstance(Map<RendererOption, Object> rendererOptions) {
+ return new WordTemplateRenderer(rendererOptions);
}
- public void publish(Artifact masterTemplateArtifact, Artifact slaveTemplateArtifact, List<Artifact> artifacts, Object... options) throws OseeCoreException {
- setOptions(options);
+ public void publish(Artifact masterTemplateArtifact, Artifact slaveTemplateArtifact, List<Artifact> artifacts) throws OseeCoreException {
templateProcessor.publishWithNestedTemplates(masterTemplateArtifact, slaveTemplateArtifact, artifacts);
}
@@ -134,7 +144,7 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
}
@Override
- public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException {
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Map<RendererOption, Object> rendererOptions) {
int rating = NO_MATCH;
if (!presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED)) {
if (artifact.isAttributeTypeValid(CoreAttributeTypes.WordTemplateContent)) {
@@ -160,7 +170,7 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
if (attributeType.equals(CoreAttributeTypes.WordTemplateContent)) {
String data = null;
- LinkType linkType = (LinkType) getOption("linkType");
+ LinkType linkType = (LinkType) getRendererOptionValue(RendererOption.LINK_TYPE);
if (attributeElement.getLabel().length() > 0) {
wordMl.addParagraph(attributeElement.getLabel());
@@ -184,7 +194,7 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
wtcData.setTxId(txId);
wtcData.setSessionId(ClientSessionManager.getSessionId());
wtcData.setOseeLink(oseeLink);
- ArtifactId view = (ArtifactId) getOption(IRenderer.VIEW_ID);
+ ArtifactId view = (ArtifactId) getRendererOptionValue(RendererOption.VIEW);
wtcData.setViewId(view == null ? ArtifactId.SENTINEL : view);
Pair<String, Set<String>> content = null;
@@ -294,35 +304,45 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
templateContent = WordUtil.removeGUIDFromTemplate(templateContent);
return templateProcessor.applyTemplate(artifacts, templateContent, templateOptions, templateStyles, null, null,
- getStringOption("outlineType"), presentationType);
+ (String) getRendererOptionValue(RendererOption.OUTLINE_TYPE), presentationType);
}
protected Artifact getTemplate(Artifact artifact, PresentationType presentationType) throws OseeCoreException {
// if USE_TEMPLATE_ONCE then only the first two artifacts will use the whole template (since they are diff'd with each other)
// The settings from the template are stored previously and will be used, just not the content of the Word template
- boolean useTemplateOnce = getBooleanOption(USE_TEMPLATE_ONCE);
- boolean firstTime = getBooleanOption(FIRST_TIME);
- boolean secondTime = getBooleanOption(SECOND_TIME);
- Object option = getOption(TEMPLATE_OPTION);
- if (option instanceof Artifact && (!useTemplateOnce || useTemplateOnce && (firstTime || secondTime))) {
- Artifact template = (Artifact) option;
+ boolean useTemplateOnce = (boolean) getRendererOptionValue(RendererOption.USE_TEMPLATE_ONCE);
+ boolean firstTime = (boolean) getRendererOptionValue(RendererOption.FIRST_TIME);
+ boolean secondTime = (boolean) getRendererOptionValue(RendererOption.SECOND_TIME);
+ String option = (String) getRendererOptionValue(RendererOption.TEMPLATE_OPTION);
+ ArtifactId templateArt = (ArtifactId) getRendererOptionValue(RendererOption.TEMPLATE_ARTIFACT);
+
+ if (option != null && option.toString().isEmpty()) {
+ option = null;
+ }
+
+ if (templateArt != null && templateArt.isValid() && (!useTemplateOnce || useTemplateOnce && (firstTime || secondTime))) {
if (useTemplateOnce) {
if (secondTime) {
- setOption(SECOND_TIME, false);
+ updateOption(RendererOption.SECOND_TIME, false);
}
if (firstTime) {
- setOption(FIRST_TIME, false);
- setOption(SECOND_TIME, true);
+ updateOption(RendererOption.FIRST_TIME, false);
+ updateOption(RendererOption.SECOND_TIME, true);
}
}
- return template;
- } else if ((option == null || option instanceof String) || (useTemplateOnce && !firstTime)) {
+ if (templateArt instanceof Artifact) {
+ return (Artifact) templateArt;
+ } else {
+ return ArtifactQuery.getArtifactFromId(templateArt, CoreBranches.COMMON);
+ }
+
+ } else if (option == null || (useTemplateOnce && !firstTime)) {
if (useTemplateOnce && !firstTime && !secondTime) {
option = null;
}
- Artifact templateArtifact = TemplateManager.getTemplate(this, artifact, presentationType, (String) option);
+ Artifact templateArtifact = TemplateManager.getTemplate(this, artifact, presentationType, option);
return templateArtifact;
}
return null;
@@ -344,7 +364,7 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
commands.add(new MenuCmdDef(CommandGroup.EDIT, SPECIALIZED_EDIT, "MS Word Edit", imageDescriptor));
commands.add(new MenuCmdDef(CommandGroup.PREVIEW, PREVIEW, "MS Word Preview", imageDescriptor));
commands.add(new MenuCmdDef(CommandGroup.PREVIEW, PREVIEW, "MS Word Preview with children", imageDescriptor,
- TEMPLATE_OPTION, PREVIEW_WITH_RECURSE_VALUE));
+ RendererOption.TEMPLATE_OPTION.getKey(), RendererOption.PREVIEW_WITH_RECURSE_VALUE.getKey()));
}
}
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 1ad89579c4..dc6d30316e 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
@@ -26,6 +26,7 @@ import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.exception.OperationTimedoutException;
+import org.eclipse.osee.framework.core.util.RendererOption;
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.Lib;
@@ -53,8 +54,6 @@ public abstract class AbstractWordCompare implements IComparator {
private final ArtifactDeltaToFileConverter converter;
private final List<AttributeTypeId> wordAttributeType = new ArrayList<>();
protected boolean skipDialogs;
- private static final Pattern authorPattern =
- Pattern.compile("aml:author=\".*?\"", Pattern.CASE_INSENSITIVE | Pattern.DOTALL | Pattern.MULTILINE);
public AbstractWordCompare(FileSystemRenderer renderer, AttributeTypeId... wordAttributeType) {
this.renderer = renderer;
@@ -67,10 +66,11 @@ public abstract class AbstractWordCompare implements IComparator {
}
protected IVbaDiffGenerator createGenerator(List<Artifact> artifacts, BranchId branch, PresentationType presentationType) throws OseeCoreException {
- boolean show = !getRenderer().getBooleanOption(IRenderer.NO_DISPLAY);
+ boolean show = !((boolean) renderer.getRendererOptionValue(RendererOption.NO_DISPLAY));
boolean executeVbScript = System.getProperty("os.name").contains("Windows");
- boolean skipErrors = !getRenderer().getBooleanOption(IRenderer.SKIP_ERRORS);
- skipDialogs = !getRenderer().getBooleanOption(IRenderer.SKIP_DIALOGS);
+ boolean skipErrors = !((boolean) renderer.getRendererOptionValue(RendererOption.SKIP_ERRORS));
+ skipDialogs = !((boolean) renderer.getRendererOptionValue(RendererOption.SKIP_DIALOGS));
+
boolean diffFieldCodes = !UserManager.getBooleanSetting(MsWordPreferencePage.IGNORE_FIELD_CODE_CHANGES);
IVbaDiffGenerator diffGenerator = WordUiUtil.createScriptGenerator(presentationType == PresentationType.MERGE,
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/ArtifactDeltaToFileConverter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/ArtifactDeltaToFileConverter.java
index ae02b7c1fb..9af265544f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/ArtifactDeltaToFileConverter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/ArtifactDeltaToFileConverter.java
@@ -10,19 +10,19 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.render.compare;
-import static org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer.TEMPLATE_OPTION;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.PresentationType;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
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.change.ArtifactDelta;
import org.eclipse.osee.framework.ui.skynet.render.FileSystemRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
public class ArtifactDeltaToFileConverter {
@@ -58,8 +58,12 @@ public class ArtifactDeltaToFileConverter {
outputFiles.add(AIFile.constructIFile(data.getOutputPath()));
}
};
+ Map<RendererOption, Object> rendererOptions = new HashMap<>();
+ rendererOptions.put(RendererOption.NO_DISPLAY, true);
+ rendererOptions.put(RendererOption.TEMPLATE_OPTION, RendererOption.DIFF_NO_ATTRIBUTES_VALUE.getKey());
+ rendererOptions.put(RendererOption.ADD_MERGE_TAG, true);
// Set ADD MERGE TAG as an option so resulting document will indicate a merge section
- RendererManager.diff(colletor, artifactDelta, "", IRenderer.NO_DISPLAY, true, TEMPLATE_OPTION,
- ITemplateRenderer.DIFF_NO_ATTRIBUTES_VALUE, ITemplateRenderer.ADD_MERGE_TAG, true);
+
+ RendererManager.diff(colletor, artifactDelta, "", rendererOptions);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
index aa4ac18af5..bf178a885a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.exception.OperationTimedoutException;
import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -28,7 +29,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
import org.eclipse.osee.framework.ui.skynet.render.FileSystemRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
import org.eclipse.osee.framework.ui.skynet.render.RenderingUtil;
import org.eclipse.osee.framework.ui.skynet.util.IVbaDiffGenerator;
@@ -75,7 +75,7 @@ public class WordTemplateCompare extends AbstractWordCompare {
}
}
- getRenderer().setOption(IRenderer.RESULT_PATH_RETURN, resultPath);
+ getRenderer().updateOption(RendererOption.RESULT_PATH_RETURN, resultPath);
collector.onCompare(data);
}
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 740ef7c7ca..f640cb0875 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
@@ -17,6 +17,7 @@ import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -24,6 +25,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.model.TransactionDelta;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -50,21 +52,24 @@ public final class WordTemplateFileDiffer {
}
public void generateFileDifferences(List<Artifact> endArtifacts, String diffPrefix, String nextParagraphNumber, String outlineType, boolean recurseChildren) throws OseeArgumentException, OseeCoreException {
- renderer.setOption("artifacts", endArtifacts);
- renderer.setOption("paragraphNumber", nextParagraphNumber);
- renderer.setOption("outlineType", outlineType);
- renderer.setOption("Publish With Attributes", true);
- renderer.setOption("Use Artifact Names", true);
- renderer.setOption("inPublishMode", true);
+ Map<RendererOption, Object> rendererOptions = renderer.getRendererOptions();
+ rendererOptions.put(RendererOption.PARAGRAPH_NUMBER, nextParagraphNumber);
+ rendererOptions.put(RendererOption.OUTLINE_TYPE, outlineType);
+ rendererOptions.put(RendererOption.ALL_ATTRIBUTES, true);
+ rendererOptions.put(RendererOption.USE_ARTIFACT_NAMES, true);
+ rendererOptions.put(RendererOption.IN_PUBLISH_MODE, true);
// need to keep original value as well as reseting to false
- renderer.setOption("Orig Publish As Diff", renderer.getBooleanOption(WordTemplateProcessor.PUBLISH_AS_DIFF));
- renderer.setOption(WordTemplateProcessor.PUBLISH_AS_DIFF, false);
- renderer.setOption("RecurseChildren", recurseChildren);
+ rendererOptions.put(RendererOption.ORIG_PUBLISH_AS_DIFF, renderer.getRendererOptionValue(RendererOption.PUBLISH_DIFF));
+ rendererOptions.put(RendererOption.PUBLISH_DIFF, false);
- BranchId endBranch = renderer.getBranchOption("Branch");
- renderer.setOption("Diff Branch", endBranch);
+ rendererOptions.put(RendererOption.RECURSE, recurseChildren);
+ // can use this as "diff branch?"
+ BranchId endBranch = (BranchId) renderer.getRendererOptionValue(RendererOption.BRANCH);
+ rendererOptions.put(RendererOption.WAS_BRANCH, endBranch);
- BranchId compareBranch = renderer.getBranchOption("compareBranch");
+ BranchId compareBranch = (BranchId) renderer.getRendererOptionValue(RendererOption.COMPARE_BRANCH);
+
+ renderer.updateOptions(rendererOptions);
TransactionToken startTransaction;
@@ -78,7 +83,7 @@ public final class WordTemplateFileDiffer {
TransactionToken endTransaction = TransactionManager.getHeadTransaction(endBranch);
TransactionDelta txDelta;
- boolean maintainOrder = renderer.getBooleanOption("Maintain Order");
+ boolean maintainOrder = (boolean) renderer.getRendererOptionValue(RendererOption.MAINTAIN_ORDER);
if (startTransaction.getId() < endTransaction.getId() || maintainOrder) {
if (compareBranch.equals(endBranch)) {
txDelta = new TransactionDelta(startTransaction, endTransaction);
@@ -89,11 +94,12 @@ public final class WordTemplateFileDiffer {
txDelta = new TransactionDelta(startTransaction, endTransaction);
}
- boolean recurseOnLoad = renderer.getBooleanOption(WordTemplateProcessor.RECURSE_ON_LOAD);
+ boolean recurseOnLoad = (boolean) renderer.getRendererOptionValue(RendererOption.RECURSE_ON_LOAD);
Collection<Artifact> toProcess = recurseChildren || recurseOnLoad ? getAllArtifacts(endArtifacts) : endArtifacts;
List<Change> changes = new LinkedList<>();
ChangeDataLoader changeLoader = new ChangeDataLoader(changes, txDelta);
- IProgressMonitor monitor = (IProgressMonitor) renderer.getOption("Progress Monitor");
+ IProgressMonitor monitor =
+ (IProgressMonitor) renderer.getRendererOptionValue(RendererOption.PROGRESS_MONITOR);
if (monitor == null) {
monitor = new NullProgressMonitor();
}
@@ -151,7 +157,7 @@ public final class WordTemplateFileDiffer {
}
if (!artifactDeltas.isEmpty()) {
- RendererManager.diffWithRenderer(artifactDeltas, diffPrefix, renderer, renderer.getValues());
+ RendererManager.diffWithRenderer(artifactDeltas, diffPrefix, renderer, renderer.getRendererOptions());
}
}
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.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
index b47788625a..25f090aa2d 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.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
@@ -26,6 +26,7 @@ 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.Set;
@@ -57,6 +58,7 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
+import org.eclipse.osee.framework.core.util.RendererOption;
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.util.Strings;
@@ -73,7 +75,6 @@ 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.DataRightProvider;
import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer;
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;
@@ -112,11 +113,6 @@ public class WordTemplateProcessor {
Pattern.CASE_INSENSITIVE | Pattern.DOTALL | Pattern.MULTILINE);
private static final Program wordApp = Program.findProgram("doc");
- public static final String ATTRIBUTE_NAME = "AttributeName";
- public static final String ALL_ATTRIBUTES = "AllAttributes";
- public static final String RECURSE_ON_LOAD = "Recurse On Load";
- public static final String RECURSE_CHILDREN = "RecurseChildren";
- public static final String PUBLISH_AS_DIFF = "Publish As Diff";
private String slaveTemplate;
private String slaveTemplateOptions;
@@ -184,12 +180,12 @@ public class WordTemplateProcessor {
masterTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.RendererOptions, "");
slaveTemplate = "";
slaveTemplateOptions = "";
- isDiff = renderer.getBooleanOption(PUBLISH_AS_DIFF);
- renderer.setOption(ITemplateRenderer.TEMPLATE_OPTION, masterTemplateArtifact);
+ isDiff = (boolean) renderer.getRendererOptionValue(RendererOption.PUBLISH_DIFF);
+ renderer.updateOption(RendererOption.TEMPLATE_ARTIFACT, masterTemplateArtifact);
slaveTemplateStyles = "";
if (slaveTemplateArtifact != null) {
- renderer.setOption(ITemplateRenderer.TEMPLATE_OPTION, slaveTemplateArtifact);
+ renderer.updateOption(RendererOption.TEMPLATE_ARTIFACT, slaveTemplateArtifact);
slaveTemplate = slaveTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, "");
slaveTemplateOptions =
slaveTemplateArtifact.getSoleAttributeValueAsString(CoreAttributeTypes.RendererOptions, "");
@@ -223,11 +219,11 @@ 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.setOption(ALL_ATTRIBUTES, false);
+ renderer.updateOption(RendererOption.ALL_ATTRIBUTES, false);
if (attributeElements.size() == 1) {
String attributeName = attributeElements.get(0).getAttributeName();
if (attributeName.equals("*")) {
- renderer.setOption(ALL_ATTRIBUTES, true);
+ renderer.updateOption(RendererOption.ALL_ATTRIBUTES, true);
}
}
List<Artifact> masterTemplateRelatedArtifacts =
@@ -244,18 +240,42 @@ public class WordTemplateProcessor {
}
}
- excludeArtifactTypes = renderer.getArtifactTypesOption("EXCLUDE ARTIFACT TYPES").toArray(new IArtifactType[0]);
+ getExcludeArtifactTypes();
+
IFile file =
RenderingUtil.getRenderFile(renderer, COMMON, PREVIEW, "/", masterTemplateArtifact.getSafeName(), ".xml");
+
AIFile.writeToFile(file, applyTemplate(artifacts, masterTemplate, masterTemplateOptions, masterTemplateStyles,
file.getParent(), null, null, PREVIEW));
- if (!renderer.getBooleanOption(IRenderer.NO_DISPLAY) && !isDiff) {
+ if (!((boolean) renderer.getRendererOptionValue(RendererOption.NO_DISPLAY)) && !isDiff) {
RenderingUtil.ensureFilenameLimit(file);
wordApp.execute(file.getLocation().toFile().getAbsolutePath());
}
}
+ 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++;
+ }
+ }
+
+ }
+
+ return excludeArtifactTypes;
+ }
+
/**
* Parse through template to find xml defining artifact sets and replace it with the result of publishing those
* artifacts. Only used by Publish SRS
@@ -265,8 +285,9 @@ public class WordTemplateProcessor {
* @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 {
- excludeFolders = renderer.getBooleanOption("Exclude Folders");
- ArtifactId view = (ArtifactId) renderer.getOption(IRenderer.VIEW_ID);
+
+ ArtifactId view = (ArtifactId) renderer.getRendererOptionValue(RendererOption.VIEW);
+ excludeFolders = (boolean) renderer.getRendererOptionValue(RendererOption.EXCLUDE_FOLDERS);
artifactsToExclude = getNonApplicableArtifacts(artifacts, view == null ? ArtifactId.SENTINEL : view);
if (!artifacts.isEmpty()) {
@@ -309,15 +330,13 @@ public class WordTemplateProcessor {
if (elementType.equals(ARTIFACT)) {
parseOutliningOptions(templateOptions);
- if (artifacts == null) {
- artifacts = renderer.getArtifactsOption(artifactName);
- }
+
if (presentationType == PresentationType.SPECIALIZED_EDIT && artifacts.size() == 1) {
// for single edit override outlining options
outlining = false;
}
processArtifactSet(templateOptions, artifacts, wordMl, outlineType, presentationType,
- (ArtifactId) renderer.getOption(IRenderer.VIEW_ID));
+ (ArtifactId) renderer.getRendererOptionValue(RendererOption.VIEW));
} else if (elementType.equals(NESTED_TEMPLATE)) {
parseNestedTemplateOptions(templateOptions, folder, wordMl, presentationType);
} else {
@@ -357,14 +376,16 @@ public class WordTemplateProcessor {
sectionNumber = options.getString("SectionNumber");
subDocName = options.getString("SubDocName");
key = options.getString("Key");
+ // rendererOption is either ID or NAME
+ RendererOption rendererOption = RendererOption.valueOf(key.toUpperCase());
value = options.getString("Value");
- renderer.setOption(key, value);
+ renderer.updateOption(rendererOption, value);
- String artifactName = renderer.getStringOption("Name");
- String artifactId = renderer.getStringOption("Id");
- String orcsQuery = renderer.getStringOption("OrcsQuery");
- BranchId branch = renderer.getBranchOption("Branch");
+ 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;
if (Strings.isValid(artifactId)) {
@@ -522,7 +543,7 @@ public class WordTemplateProcessor {
private void processArtifactSet(String templateOptions, List<Artifact> artifacts, WordMLProducer wordMl, String outlineType, PresentationType presentationType, ArtifactId viewId) throws OseeCoreException {
nonTemplateArtifacts.clear();
- renderer.setOption(IRenderer.VIEW_ID, viewId == null ? ArtifactId.SENTINEL : viewId);
+ renderer.updateOption(RendererOption.VIEW, viewId == null ? ArtifactId.SENTINEL : viewId);
if (Strings.isValid(outlineNumber)) {
wordMl.setNextParagraphNumberTo(outlineNumber);
@@ -537,7 +558,7 @@ public class WordTemplateProcessor {
parseMetadataOptions(templateOptions);
}
- if (renderer.getBooleanOption(PUBLISH_AS_DIFF)) {
+ if (((boolean) renderer.getRendererOptionValue(RendererOption.PUBLISH_DIFF))) {
WordTemplateFileDiffer templateFileDiffer = new WordTemplateFileDiffer(renderer);
templateFileDiffer.generateFileDifferences(artifacts, "/results/", outlineNumber, outlineType,
recurseChildren);
@@ -584,8 +605,8 @@ public class WordTemplateProcessor {
boolean ignoreArtType = excludeArtifactTypes != null && artifact.isOfType(excludeArtifactTypes);
boolean publishInline = artifact.getSoleAttributeValue(CoreAttributeTypes.PublishInline, false);
boolean startedSection = false;
- boolean templateOnly = renderer.getBooleanOption("TEMPLATE ONLY");
- boolean includeUUIDs = renderer.getBooleanOption("INCLUDE UUIDS");
+ boolean templateOnly = (boolean) renderer.getRendererOptionValue(RendererOption.TEMPLATE_ONLY);
+ boolean includeUUIDs = (boolean) renderer.getRendererOptionValue(RendererOption.INCLUDE_UUIDS);
if (!ignoreArtifact && !ignoreArtType) {
if (outlining && !templateOnly) {
@@ -596,7 +617,7 @@ public class WordTemplateProcessor {
headingText = headingText.concat(UUIDtext);
}
- Boolean mergeTag = (Boolean) renderer.getOption(ITemplateRenderer.ADD_MERGE_TAG);
+ Boolean mergeTag = (Boolean) renderer.getRendererOptionValue(RendererOption.ADD_MERGE_TAG);
if (mergeTag != null && mergeTag) {
headingText = headingText.concat(" [MERGED]");
}
@@ -611,13 +632,13 @@ public class WordTemplateProcessor {
startedSection = true;
}
- if (renderer.getBooleanOption(
- WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION) && !publishInline) {
+ if (((boolean) renderer.getRendererOptionValue(
+ RendererOption.UPDATE_PARAGRAPH_NUMBERS)) && !publishInline) {
if (artifact.isAttributeTypeValid(CoreAttributeTypes.ParagraphNumber)) {
artifact.setSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, paragraphNumber.toString());
SkynetTransaction transaction =
- (SkynetTransaction) renderer.getOption(ITemplateRenderer.TRANSACTION_OPTION);
+ (SkynetTransaction) renderer.getRendererOptionValue(RendererOption.TRANSACTION_OPTION);
if (transaction != null) {
artifact.persist(transaction);
} else {
@@ -635,9 +656,10 @@ public class WordTemplateProcessor {
}
// Check for option that may have been set from Publish with Diff BLAM to recurse
- if (recurseChildren && !renderer.getBooleanOption(RECURSE_ON_LOAD) || renderer.getBooleanOption(
- RECURSE_ON_LOAD) && !renderer.getBooleanOption("Orig Publish As Diff")) {
+ boolean recurse = ((boolean) renderer.getRendererOptionValue(RendererOption.RECURSE_ON_LOAD));
+ boolean origDiff = ((boolean) renderer.getRendererOptionValue(RendererOption.ORIG_PUBLISH_AS_DIFF));
+ if (recurseChildren && !recurse || (recurse && !origDiff)) {
for (Artifact childArtifact : artifact.getChildren()) {
processObjectArtifact(childArtifact, wordMl, outlineType, presentationType, data);
}
@@ -656,8 +678,10 @@ public class WordTemplateProcessor {
private void populateRequest(List<Artifact> artifacts, DataRightInput request) {
if (request.isEmpty()) {
List<Artifact> allArtifacts = new ArrayList<>();
- if (recurseChildren || (renderer.getBooleanOption(
- RECURSE_ON_LOAD) && !renderer.getBooleanOption("Orig Publish As Diff"))) {
+ boolean recurseOnLoad = (boolean) renderer.getRendererOptionValue(RendererOption.RECURSE_ON_LOAD);
+ boolean publishAsDiff = (boolean) renderer.getRendererOptionValue(RendererOption.ORIG_PUBLISH_AS_DIFF);
+
+ if (recurseChildren || (recurseOnLoad && !publishAsDiff)) {
for (Artifact art : artifacts) {
allArtifacts.add(art);
if (!art.isHistorical()) {
@@ -669,12 +693,11 @@ public class WordTemplateProcessor {
}
int index = 0;
- String overrideClassification = (String) renderer.getOption(IRenderer.OVERRIDE_DATA_RIGHTS_OPTION);
+ String overrideClassification = (String) renderer.getRendererOptionValue(RendererOption.OVERRIDE_DATA_RIGHTS);
for (Artifact artifact : allArtifacts) {
String classification = null;
- if (overrideClassification != null && ITemplateRenderer.DataRightsClassification.isValid(
- overrideClassification)) {
+ if (overrideClassification != null && IRenderer.DataRightsClassification.isValid(overrideClassification)) {
classification = overrideClassification;
} else {
classification = artifact.getSoleAttributeValueAsString(CoreAttributeTypes.DataRightsClassification, "");
@@ -697,7 +720,7 @@ public class WordTemplateProcessor {
for (AttributeElement attributeElement : attributeElements) {
String attributeName = attributeElement.getAttributeName();
- if (renderer.getBooleanOption(ALL_ATTRIBUTES) || attributeName.equals("*")) {
+ if (((boolean) renderer.getRendererOptionValue(RendererOption.ALL_ATTRIBUTES)) || attributeName.equals("*")) {
for (AttributeTypeToken attributeType : RendererManager.getAttributeTypeOrderList(artifact)) {
if (!outlining || !attributeType.equals(headingAttributeType)) {
processAttribute(artifact, wordMl, attributeElement, attributeType, true, presentationType,
@@ -735,7 +758,7 @@ public class WordTemplateProcessor {
}
private void processAttribute(Artifact artifact, WordMLProducer wordMl, AttributeElement attributeElement, AttributeTypeToken attributeType, boolean allAttrs, PresentationType presentationType, boolean publishInLine, String footer) throws OseeCoreException {
- renderer.setOption("allAttrs", allAttrs);
+ renderer.updateOption(RendererOption.ALL_ATTRIBUTES, allAttrs);
// This is for SRS Publishing. Do not publish unspecified attributes
if (!allAttrs && attributeType.matches(Partition, SeverityCategory)) {
if (artifact.isAttributeTypeValid(Partition)) {
@@ -746,7 +769,7 @@ public class WordTemplateProcessor {
}
}
}
- boolean templateOnly = renderer.getBooleanOption("TEMPLATE ONLY");
+ boolean templateOnly = (boolean) renderer.getRendererOptionValue(RendererOption.TEMPLATE_ONLY);
if (templateOnly && attributeType.notEqual(WordTemplateContent)) {
return;
}
@@ -764,18 +787,19 @@ public class WordTemplateProcessor {
}
// Do not publish relation order during publishing
- if (renderer.getBooleanOption("inPublishMode") && CoreAttributeTypes.RelationOrder.equals(attributeType)) {
+ if (((boolean) renderer.getRendererOptionValue(
+ RendererOption.IN_PUBLISH_MODE)) && CoreAttributeTypes.RelationOrder.equals(attributeType)) {
return;
}
if (!(publishInLine && artifact.isAttributeTypeValid(WordTemplateContent)) || attributeType.equals(
WordTemplateContent)) {
RendererManager.renderAttribute(attributeType, presentationType, artifact, wordMl, attributeElement, footer,
- renderer.getValues());
+ renderer.getRendererOptions());
}
} else if (attributeType.equals(WordTemplateContent)) {
RendererManager.renderAttribute(attributeType, presentationType, artifact, wordMl, attributeElement, footer,
- renderer.getValues());
+ renderer.getRendererOptions());
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/ThreeWayWordMergeOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/ThreeWayWordMergeOperation.java
index 94c49c21dd..7107093282 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/ThreeWayWordMergeOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/ThreeWayWordMergeOperation.java
@@ -10,13 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets.xmerge;
-import static org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer.TEMPLATE_OPTION;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.resources.IFile;
@@ -25,6 +26,7 @@ import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -34,8 +36,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta;
import org.eclipse.osee.framework.skynet.core.conflict.AttributeConflict;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer;
-import org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.skynet.render.UpdateArtifactOperation;
import org.eclipse.osee.framework.ui.skynet.render.compare.CompareData;
@@ -110,8 +110,11 @@ public class ThreeWayWordMergeOperation extends AbstractOperation {
RendererManager.openInJob(mergeArtifact, PresentationType.SPECIALIZED_EDIT);
}
};
+ Map<RendererOption, Object> rendererOptions = new HashMap<>();
+ rendererOptions.put(RendererOption.NO_DISPLAY, true);
+
RendererManager.merge(colletor, mergeArtifact, null, sourceChangeFile, destChangeFile, "Source_Dest_Merge",
- IRenderer.NO_DISPLAY, true);
+ rendererOptions);
}
private static void createMergeDiffFile(final Collection<IFile> outputFiles, Artifact baseVersion, Artifact newerVersion) throws Exception {
@@ -123,8 +126,11 @@ public class ThreeWayWordMergeOperation extends AbstractOperation {
outputFiles.add(AIFile.constructIFile(data.getOutputPath()));
}
};
- RendererManager.diff(colletor, artifactDelta, "", IRenderer.NO_DISPLAY, true, TEMPLATE_OPTION,
- ITemplateRenderer.THREE_WAY_MERGE);
+ Map<RendererOption, Object> rendererOptions = new HashMap<>();
+ rendererOptions.put(RendererOption.NO_DISPLAY, true);
+ rendererOptions.put(RendererOption.TEMPLATE_OPTION, RendererOption.THREE_WAY_MERGE.getKey());
+
+ RendererManager.diff(colletor, artifactDelta, "", rendererOptions);
}
private static void changeAuthorinWord(String newAuthor, IFile iFile, int revisionNumber, String rsidNumber, String baselineRsid) throws Exception {

Back to the top