Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-06-28 11:42:36 -0400
committerRyan D. Brooks2018-07-10 19:15:06 -0400
commit3f2d2e49a1e18af1dd9490f13b758ab10e2bf4f8 (patch)
tree333b6de66925017f1f25c244bb8f78a39cb45127
parentac244c0bc5e3c935a2e0c1d7f655f21278def2fd (diff)
downloadorg.eclipse.osee-3f2d2e49a1e18af1dd9490f13b758ab10e2bf4f8.tar.gz
org.eclipse.osee-3f2d2e49a1e18af1dd9490f13b758ab10e2bf4f8.tar.xz
org.eclipse.osee-3f2d2e49a1e18af1dd9490f13b758ab10e2bf4f8.zip
refactor: Use JSON with data rights REST
-rw-r--r--plugins/org.eclipse.osee.define.api/src/org/eclipse/osee/define/api/DataRightsEndpoint.java8
-rw-r--r--plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsEndpointImpl.java4
-rw-r--r--plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightEntry.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java32
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightInput.java5
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java8
-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
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java4
12 files changed, 16 insertions, 61 deletions
diff --git a/plugins/org.eclipse.osee.define.api/src/org/eclipse/osee/define/api/DataRightsEndpoint.java b/plugins/org.eclipse.osee.define.api/src/org/eclipse/osee/define/api/DataRightsEndpoint.java
index 088b82608b..5f79aee0ce 100644
--- a/plugins/org.eclipse.osee.define.api/src/org/eclipse/osee/define/api/DataRightsEndpoint.java
+++ b/plugins/org.eclipse.osee.define.api/src/org/eclipse/osee/define/api/DataRightsEndpoint.java
@@ -32,13 +32,13 @@ public interface DataRightsEndpoint {
@POST
@Path("artifacts/branch/{branch}/classification/{classification}")
@Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_XML)
- public DataRightResult getDataRights(List<ArtifactId> artifacts, @PathParam("branch") BranchId branch, @PathParam("classification") @DefaultValue("invalid") String overrideClassification);
+ @Produces(MediaType.APPLICATION_JSON)
+ public DataRightResult getDataRights(@PathParam("branch") BranchId branch, @PathParam("classification") @DefaultValue("invalid") String overrideClassification, List<ArtifactId> artifacts);
@POST
@Path("artifacts/branch/{branch}")
@Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_XML)
- public DataRightResult getDataRights(List<ArtifactId> artifacts, @PathParam("branch") BranchId branch);
+ @Produces(MediaType.APPLICATION_JSON)
+ public DataRightResult getDataRights(@PathParam("branch") BranchId branch, List<ArtifactId> artifacts);
}
diff --git a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsEndpointImpl.java b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsEndpointImpl.java
index 0d06b9b22b..96593e28fe 100644
--- a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsEndpointImpl.java
+++ b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsEndpointImpl.java
@@ -30,12 +30,12 @@ public class DataRightsEndpointImpl implements DataRightsEndpoint {
}
@Override
- public DataRightResult getDataRights(List<ArtifactId> artifacts, BranchId branch, String overrideClassification) {
+ public DataRightResult getDataRights(BranchId branch, String overrideClassification, List<ArtifactId> artifacts) {
return defineApi.getDataRightsOperations().getDataRights(artifacts, branch, overrideClassification);
}
@Override
- public DataRightResult getDataRights(List<ArtifactId> artifacts, BranchId branch) {
+ public DataRightResult getDataRights(BranchId branch, List<ArtifactId> artifacts) {
return defineApi.getDataRightsOperations().getDataRights(artifacts, branch);
}
diff --git a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java
index 82aa7a1ce5..030ae460b6 100644
--- a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java
+++ b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java
@@ -81,8 +81,7 @@ public class DataRightsOperationsImpl implements DataRightsOperations {
String classification = null;
String orientation = "Portrait";
- if (overrideClassification != null && !overrideClassification.isEmpty() && !overrideClassification.equals(
- "invalid") && DataRightsClassification.isValid(overrideClassification)) {
+ if (DataRightsClassification.isValid(overrideClassification)) {
classification = overrideClassification;
} else if (art != null) {
classification = art.getSoleAttributeAsString(CoreAttributeTypes.DataRightsClassification, "");
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java
index 0a59e5cd79..6a8d94d1ec 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java
@@ -10,12 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.datarights;
-import javax.xml.bind.annotation.XmlRootElement;
-
/**
* @author Angel Avila
*/
-@XmlRootElement
public class DataRight {
private DataRightId id;
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java
index 9ec9948a5f..746c4ea0ae 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java
@@ -10,12 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.datarights;
-import javax.xml.bind.annotation.XmlRootElement;
-
/**
* @author Angel Avila
*/
-@XmlRootElement
public class DataRightAnchor {
private Long id;
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightEntry.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightEntry.java
index fd128352d9..7c902e7937 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightEntry.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightEntry.java
@@ -10,14 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.datarights;
-import javax.xml.bind.annotation.XmlRootElement;
import org.eclipse.osee.framework.core.util.PageOrientation;
/**
* @author Angel Avila
*/
-
-@XmlRootElement
public class DataRightEntry {
private Long id;
private String classification;
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java
index f5c6d68be4..88edb599e1 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java
@@ -10,13 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.datarights;
-import javax.xml.bind.annotation.XmlRootElement;
-
/**
* @author Angel Avila
*/
-
-@XmlRootElement
public class DataRightId {
private String id;
@@ -31,37 +27,19 @@ public class DataRightId {
@Override
public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (id == null ? 0 : id.hashCode());
- return result;
+ return id.hashCode();
}
@Override
public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
+ if (obj instanceof DataRightId) {
+ return ((DataRightId) obj).id.equals(id);
}
- if (getClass() != obj.getClass()) {
- return false;
- }
- DataRightId other = (DataRightId) obj;
- if (id == null) {
- if (other.id != null) {
- return false;
- }
- } else if (!id.equals(other.id)) {
- return false;
- }
- return true;
+ return false;
}
@Override
public String toString() {
return "DataRightId [id=" + id + "]";
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightInput.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightInput.java
index 2753e3f7b9..5006e83cdb 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightInput.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightInput.java
@@ -13,17 +13,12 @@ package org.eclipse.osee.framework.core.model.datarights;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
import org.eclipse.osee.framework.core.util.PageOrientation;
/**
* @author Angel Avila
*/
-@XmlRootElement
public class DataRightInput implements Iterable<DataRightEntry> {
-
- @XmlTransient
private Set<DataRightEntry> data;
public Set<DataRightEntry> getData() {
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java
index e018cc5ee8..e94c744051 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java
@@ -15,9 +15,6 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
import org.eclipse.osee.framework.core.util.PageOrientation;
import org.eclipse.osee.framework.core.util.ReportConstants;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -25,23 +22,19 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Angel Avila
*/
-@XmlRootElement
public class DataRightResult {
public static final String UNSPECIFIED =
"<w:ftr w:type=\"odd\"><w:p><w:pPr><w:pStyle w:val=\"para8pt\"/><w:jc w:val=\"center\"/></w:pPr><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/></w:rPr><w:fldChar w:fldCharType=\"begin\"/></w:r><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/></w:rPr><w:instrText> PAGE </w:instrText></w:r><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/></w:rPr><w:fldChar w:fldCharType=\"separate\"/></w:r><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/><w:noProof/></w:rPr><w:t>5</w:t></w:r><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/></w:rPr><w:fldChar w:fldCharType=\"end\"/></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>UNSPECIFIED - PLEASE TAG WITH CORRECT DATA RIGHTS ATTRIBUTE!!!</w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>Contract No.: </w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>Contractor Name: The Boeing Company</w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>Contractor Address: 5000 E. McDowell Road; Mesa, AZ 85215-9797 </w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t></w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are restricted by paragraph (b)(3) of the Rights in Noncommercial Computer Software and Noncommercial Computer Software Documentation clause contained in the above identified contract. Any reproduction of computer software or portions thereof marked with this legend must also reproduce the markings. Any person, other than the Government, who has been provided access to such software must promptly notify the above named Contractor. </w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>Copyright (c) 2017 – The Boeing Company</w:t></w:r></w:p></w:ftr>";
- @XmlTransient
private List<DataRightAnchor> dataRightAnchors;
- @XmlTransient
private List<DataRight> dataRights;
private Map<DataRightId, DataRight> dataRightIdToDataRight;
private Map<Long, DataRightAnchor> idToAnchor;
- @XmlElement
public Collection<DataRightAnchor> getDataRightAnchors() {
if (dataRightAnchors == null) {
dataRightAnchors = new ArrayList<>();
@@ -53,7 +46,6 @@ public class DataRightResult {
this.dataRightAnchors = dataRightAnchors;
}
- @XmlElement
public Collection<DataRight> getDataRights() {
if (dataRights == null) {
dataRights = new ArrayList<>();
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 05beac4eac..b73390096a 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
@@ -159,7 +159,7 @@ public class WholeWordRenderer extends WordRenderer {
PageOrientation orientation = WordRendererUtil.getPageOrientation(artifact);
DataRightResult dataRights = ServiceUtil.getOseeClient().getDataRightsEndpoint().getDataRights(
- Collections.singletonList(ArtifactId.valueOf(artifact.getId())), artifact.getBranch(), classification);
+ artifact.getBranch(), classification, Collections.singletonList(ArtifactId.valueOf(artifact.getId())));
String footer = dataRights.getContent(artifact.getId(), orientation);
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 ba7805cc7d..0d28fbac42 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
@@ -263,7 +263,7 @@ public class WordTemplateRenderer extends WordRenderer {
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.");
}
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 d6ec1be40d..4bd55627a3 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
@@ -588,8 +588,8 @@ public class WordTemplateProcessor {
allArtifacts.addAll(artifacts);
}
- DataRightResult response = ServiceUtil.getOseeClient().getDataRightsEndpoint().getDataRights(allArtifacts,
- branch, overrideClassification);
+ DataRightResult response = ServiceUtil.getOseeClient().getDataRightsEndpoint().getDataRights(branch,
+ overrideClassification, allArtifacts);
for (Artifact artifact : artifacts) {
processObjectArtifact(artifact, wordMl, outlineType, presentationType, response);

Back to the top