diff options
author | donald.g.dunne | 2017-04-21 15:47:28 +0000 |
---|---|---|
committer | Donald Dunne | 2017-04-21 17:58:56 +0000 |
commit | 44cd1e9601a29d1ac6cf1460da0602ce42851643 (patch) | |
tree | 78202162470d29c33c865ee25156282ca1bde5ca /plugins/org.eclipse.osee.orcs.rest | |
parent | a0af5ee5b8efab14724357d46280a17c85b2e6e9 (diff) | |
download | org.eclipse.osee-44cd1e9601a29d1ac6cf1460da0602ce42851643.tar.gz org.eclipse.osee-44cd1e9601a29d1ac6cf1460da0602ce42851643.tar.xz org.eclipse.osee-44cd1e9601a29d1ac6cf1460da0602ce42851643.zip |
refinement: Add branch name to ArtifactResource
Change-Id: I205913c44da7465cae2bc728067f2231f3231369
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.rest')
-rw-r--r-- | plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java index 42ec0afb578..b4e0a8f1e84 100644 --- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java +++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java @@ -20,6 +20,7 @@ import org.eclipse.osee.framework.core.data.AttributeTypeToken; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; +import org.eclipse.osee.framework.jdk.core.type.ResultSet; import org.eclipse.osee.orcs.data.ArtifactReadable; import org.eclipse.osee.orcs.data.AttributeReadable; import org.eclipse.osee.orcs.data.BranchReadable; @@ -80,6 +81,12 @@ public class HtmlWriter { data.put("Artifact Id", artifact.getUuid()); data.put("Tx Id", artifact.getTransaction()); Long branchId = artifact.getBranch().getId(); + String branchName = null; + ResultSet<BranchReadable> results = + OrcsApplication.getOrcsApi().getQueryFactory().branchQuery().andUuids(branchId).getResults(); + if (!results.isEmpty()) { + branchName = results.iterator().next().getName(); + } URI uri; if (isAtEndOfPath(uriInfo.getPath(), "artifact")) { @@ -87,7 +94,8 @@ public class HtmlWriter { } else { uri = uriInfo.getAbsolutePathBuilder().path("../../../{uuid}").build(branchId); } - data.put("Branch", asLink(uri.toASCIIString(), "Branch " + branchId)); + data.put("Branch Id", asLink(uri.toASCIIString(), branchId.toString())); + data.put("Branch Name", asLink(uri.toASCIIString(), branchName)); Collection<AttributeTypeToken> types = artifact.getExistingAttributeTypes(); for (AttributeTypeToken type : types) { |