Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactURL.java11
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/OseeLinkBuilder.java12
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java14
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/HTMLTransferFormatter.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WholeWordRenderer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java2
6 files changed, 31 insertions, 13 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactURL.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactURL.java
index d9d87c4cd6b..37d9a11c29f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactURL.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactURL.java
@@ -18,6 +18,7 @@ import java.util.logging.Level;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.client.server.HttpUrlBuilderClient;
import org.eclipse.osee.framework.core.data.OseeServerContext;
+import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.HttpUrlBuilder;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -30,16 +31,18 @@ import org.eclipse.osee.framework.skynet.core.utility.OseeInfo;
*/
public class ArtifactURL {
- public static URL getOpenInOseeLink(final Artifact artifact, String cmd) throws OseeCoreException {
+ public static URL getOpenInOseeLink(final Artifact artifact, String cmd, PresentationType presentationType) throws OseeCoreException {
Map<String, String> parameters = new HashMap<>();
parameters.put("sessionId", ClientSessionManager.getSessionId());
parameters.put("context", "osee/loopback");
parameters.put("guid", artifact.getGuid());
parameters.put("branchUuid", String.valueOf(artifact.getBranch().getGuid()));
parameters.put("isDeleted", String.valueOf(artifact.isDeleted()));
- if (artifact.isHistorical()) {
+
+ if (artifact.isHistorical() && presentationType != PresentationType.DIFF && presentationType != PresentationType.F5_DIFF) {
parameters.put("transactionId", String.valueOf(artifact.getTransaction()));
}
+
parameters.put("cmd", cmd);
String urlString = getPermanentLinkBaseUrl(OseeServerContext.CLIENT_LOOPBACK_CONTEXT, parameters);
URL url = null;
@@ -51,8 +54,8 @@ public class ArtifactURL {
return url;
}
- public static URL getOpenInOseeLink(final Artifact artifact) throws OseeCoreException {
- return getOpenInOseeLink(artifact, "open.artifact");
+ public static URL getOpenInOseeLink(final Artifact artifact, PresentationType presentationType) throws OseeCoreException {
+ return getOpenInOseeLink(artifact, "open.artifact", presentationType);
}
public static String getPermanentLinkBaseUrl(String context, Map<String, String> parameters) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/OseeLinkBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/OseeLinkBuilder.java
index 79e6b63b415..a504e799fec 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/OseeLinkBuilder.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/OseeLinkBuilder.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.skynet.core.linking;
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.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -102,10 +103,13 @@ public class OseeLinkBuilder {
public OseeLinkBuilder() {
super();
}
-
public String getWordMlLink(LinkType destLinkType, Artifact artifact) throws OseeCoreException {
+ return getWordMlLink(destLinkType, artifact, PresentationType.DEFAULT_OPEN);
+ }
+
+ public String getWordMlLink(LinkType destLinkType, Artifact artifact, PresentationType presentationType) throws OseeCoreException {
String linkFormat = getLinkFormat(destLinkType);
- String linkId = getLinkId(destLinkType, artifact);
+ String linkId = getLinkId(destLinkType, artifact, presentationType);
String linkText = getLinkText(destLinkType, artifact);
return String.format(linkFormat, linkId, linkText);
}
@@ -187,10 +191,10 @@ public class OseeLinkBuilder {
return escapeXml(builder.toString());
}
- private String getLinkId(LinkType destLinkType, Artifact artifact) throws OseeCoreException {
+ private String getLinkId(LinkType destLinkType, Artifact artifact, PresentationType presentationType) throws OseeCoreException {
String toReturn;
if (destLinkType == LinkType.OSEE_SERVER_LINK) {
- toReturn = escapeXml(ArtifactURL.getOpenInOseeLink(artifact).toString());
+ toReturn = escapeXml(ArtifactURL.getOpenInOseeLink(artifact, presentationType).toString());
} else {
toReturn = artifact.getGuid();
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java
index 4175dbf7bd5..0e16af9b083 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java
@@ -20,6 +20,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionToken;
+import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -117,6 +118,10 @@ public class WordMlLinkHandler {
* @return processed input
*/
public static String link(LinkType destLinkType, Artifact source, String content, Set<String> unknownGuids) throws OseeCoreException {
+ return link(destLinkType, source, content, unknownGuids, PresentationType.DEFAULT_OPEN);
+ }
+
+ public static String link(LinkType destLinkType, Artifact source, String content, Set<String> unknownGuids, PresentationType presentationType) throws OseeCoreException {
LinkType linkType = checkLinkType(destLinkType);
String modified = content;
@@ -133,7 +138,7 @@ public class WordMlLinkHandler {
}
OSEE_LINK_PATTERN.reset();
if (!matchMap.isEmpty()) {
- modified = modifiedContent(linkType, source, content, matchMap, false, unknownGuids);
+ modified = modifiedContent(linkType, source, content, matchMap, false, unknownGuids, presentationType);
}
if (linkType != LinkType.OSEE_SERVER_LINK) {
// Add a bookmark to the start of the content so internal links can link later
@@ -199,6 +204,11 @@ public class WordMlLinkHandler {
}
private static String modifiedContent(LinkType destLinkType, Artifact source, String original, HashCollection<String, MatchRange> matchMap, boolean isUnliking, Set<String> unknown) throws OseeCoreException {
+ return modifiedContent(destLinkType, source, original, matchMap, isUnliking, unknown,
+ PresentationType.DEFAULT_OPEN);
+ }
+
+ private static String modifiedContent(LinkType destLinkType, Artifact source, String original, HashCollection<String, MatchRange> matchMap, boolean isUnliking, Set<String> unknown, PresentationType presentationType) throws OseeCoreException {
BranchId branch = source.getBranch();
ChangeSet changeSet = new ChangeSet(original);
List<Artifact> artifactsFromSearch = null;
@@ -247,7 +257,7 @@ public class WordMlLinkHandler {
if (isUnliking) {
replaceWith = linkBuilder.getOseeLinkMarker(artifact.getGuid());
} else {
- replaceWith = linkBuilder.getWordMlLink(destLinkType, artifact);
+ replaceWith = linkBuilder.getWordMlLink(destLinkType, artifact, presentationType);
}
changeSet.replace(match.start(), match.end(), replaceWith);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/HTMLTransferFormatter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/HTMLTransferFormatter.java
index 600920fa94c..79530494805 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/HTMLTransferFormatter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/HTMLTransferFormatter.java
@@ -16,6 +16,7 @@ import java.util.logging.Level;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.osee.framework.core.client.CoreClientConstants;
+import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -60,7 +61,7 @@ public class HTMLTransferFormatter {
for (Artifact artifact : artifacts) {
String link = null;
try {
- link = ArtifactURL.getOpenInOseeLink(artifact).toString();
+ link = ArtifactURL.getOpenInOseeLink(artifact, PresentationType.SPECIALIZED_EDIT).toString();
} catch (OseeCoreException ex) {
link = String.format("guid:[%s] branch:[%s] gammaId:[%s]", artifact.getGuid(),
artifact.getBranch().getGuid(), artifact.getGammaId());
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 6f438503ad8..2d9fe40a4b7 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
@@ -107,7 +107,7 @@ public class WholeWordRenderer extends WordRenderer {
Set<String> unknownGuids = new HashSet<>();
LinkType linkType = LinkType.OSEE_SERVER_LINK;
- content = WordMlLinkHandler.link(linkType, artifact, content, unknownGuids);
+ content = WordMlLinkHandler.link(linkType, artifact, content, unknownGuids, presentationType);
WordUiUtil.displayUnknownGuids(artifact, unknownGuids);
String classification =
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 4868798a0ef..73381476588 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
@@ -162,7 +162,7 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
txId = TransactionId.SENTINEL;
}
- String oseeLink = ArtifactURL.getOpenInOseeLink(artifact).toString();
+ String oseeLink = ArtifactURL.getOpenInOseeLink(artifact, presentationType).toString();
WordTemplateContentData wtcData = new WordTemplateContentData();
wtcData.setArtId(artifact.getUuid());

Back to the top