Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2016-09-19 17:23:04 -0400
committerAngel Avila2016-10-04 21:35:36 -0400
commite27a07a8e43291a71e0e47124baf751f41252069 (patch)
treef34661741bc0dd3815c219d277efd51460c4ca94
parent50eeb9f3fed12dcc0faa9850861521316f98072c (diff)
downloadorg.eclipse.osee-e27a07a8e43291a71e0e47124baf751f41252069.tar.gz
org.eclipse.osee-e27a07a8e43291a71e0e47124baf751f41252069.tar.xz
org.eclipse.osee-e27a07a8e43291a71e0e47124baf751f41252069.zip
bug[ats_ATS315063]: Added transaction to server side word render
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java20
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java3
2 files changed, 18 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java
index 5dd4609ea08..a42b60ba734 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordTemplateContentRendererHandler.java
@@ -14,6 +14,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.define.report.api.ReportConstants;
import org.eclipse.osee.define.report.api.WordTemplateContentData;
+import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.jdk.core.type.Pair;
@@ -26,20 +27,31 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
public class WordTemplateContentRendererHandler {
public static final String PGNUMTYPE_START_1 = "<w:pgNumType [^>]*w:start=\"1\"/>";
- private OrcsApi orcsApi;
+ private final OrcsApi orcsApi;
public WordTemplateContentRendererHandler(OrcsApi orcsApi) {
this.orcsApi = orcsApi;
}
public Pair<String, Set<String>> renderWordML(WordTemplateContentData wtcData) {
- ArtifactReadable artifact = orcsApi.getQueryFactory().fromBranch(wtcData.getBranchId()).andUuid(
- wtcData.getArtId()).includeDeletedArtifacts().includeDeletedAttributes().getResults().getAtMostOneOrNull();
+ TransactionId txId = wtcData.getTxId();
+ if (txId == null) {
+ txId = TransactionId.SENTINEL;
+ }
+ ArtifactReadable artifact = null;
+ if (txId.equals(TransactionId.SENTINEL)) {
+ artifact = orcsApi.getQueryFactory().fromBranch(wtcData.getBranchId()).andUuid(
+ wtcData.getArtId()).includeDeletedArtifacts().includeDeletedAttributes().getResults().getAtMostOneOrNull();
+ } else {
+ artifact = orcsApi.getQueryFactory().fromBranch(wtcData.getBranchId()).fromTransaction(txId).andUuid(
+ wtcData.getArtId()).includeDeletedArtifacts().includeDeletedAttributes().getResults().getAtMostOneOrNull();
+ }
if (artifact != null) {
Set<String> unknownGuids = new HashSet<>();
- String data = artifact.getSoleAttributeValue(CoreAttributeTypes.WordTemplateContent, DeletionFlag.INCLUDE_DELETED, null);
+ String data =
+ artifact.getSoleAttributeValue(CoreAttributeTypes.WordTemplateContent, DeletionFlag.INCLUDE_DELETED, null);
if (data == null && wtcData.getIsEdit()) {
data = orcsApi.getOrcsTypes().getAttributeTypes().getDefaultValue(CoreAttributeTypes.WordTemplateContent);
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 73381476588..7959db2983c 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
@@ -236,10 +236,11 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
template.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo);
if (templateRelatedArtifacts != null) {
+
if (templateRelatedArtifacts.size() == 1) {
templateStyles = templateRelatedArtifacts.get(0).getSoleAttributeValueAsString(
CoreAttributeTypes.WholeWordContent, "");
- } else {
+ } else if (templateRelatedArtifacts.size() > 1) {
OseeLog.log(this.getClass(), Level.INFO,
"More than one style relation currently not supported. Defaulting to styles defined in the template.");
}

Back to the top