From 44cd1e9601a29d1ac6cf1460da0602ce42851643 Mon Sep 17 00:00:00 2001 From: donald.g.dunne Date: Fri, 21 Apr 2017 08:47:28 -0700 Subject: refinement: Add branch name to ArtifactResource Change-Id: I205913c44da7465cae2bc728067f2231f3231369 --- .../src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/org.eclipse.osee.orcs.rest') 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 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 types = artifact.getExistingAttributeTypes(); for (AttributeTypeToken type : types) { -- cgit v1.2.3