Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2014-08-04 20:06:25 +0000
committerRoberto E. Escobar2014-09-29 22:54:58 +0000
commit402a8fd52714cb8abdc65340a1f39d1f09d9742b (patch)
treef44ef94d2b9e8de1da3d11efec8936203bd4d089
parent973913c112d5b2ec363b141a93a6038ef91845ca (diff)
downloadorg.eclipse.osee-402a8fd52714cb8abdc65340a1f39d1f09d9742b.tar.gz
org.eclipse.osee-402a8fd52714cb8abdc65340a1f39d1f09d9742b.tar.xz
org.eclipse.osee-402a8fd52714cb8abdc65340a1f39d1f09d9742b.zip
feature[ats_ATS72580]: Make Dispo configurable
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoConfig.java77
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java10
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetDescriptorData.java17
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/OSGI-INF/resolution.validator.service.xml1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/build.properties3
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java22
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoResolutionValidator.java7
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java8
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java4
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee10
13 files changed, 158 insertions, 8 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoConfig.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoConfig.java
new file mode 100644
index 00000000000..ee00495b30d
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoConfig.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.disposition.model;
+
+/**
+ * @author Angel Avila
+ */
+
+public class DispoConfig {
+
+ private String type;
+ private String name;
+ private String resolutionType;
+ private String resolutionTitle;
+ private String peerNotes;
+ private String customerNotes;
+
+ public DispoConfig() {
+
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getResolutionType() {
+ return resolutionType;
+ }
+
+ public String getResolutionTitle() {
+ return resolutionTitle;
+ }
+
+ public String getPeerNotes() {
+ return peerNotes;
+ }
+
+ public String getCustomerNotes() {
+ return customerNotes;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setResolutionType(String resolutionType) {
+ this.resolutionType = resolutionType;
+ }
+
+ public void setResolutionTitle(String resolutionTitle) {
+ this.resolutionTitle = resolutionTitle;
+ }
+
+ public void setPeerNotes(String peerNotes) {
+ this.peerNotes = peerNotes;
+ }
+
+ public void setCustomerNotes(String customerNotes) {
+ this.customerNotes = customerNotes;
+ }
+}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
index 995e0933f3a..8846e5a3164 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
@@ -25,4 +25,6 @@ public interface DispoSet extends Identifiable<String> {
JSONArray getNotesList();
String getImportState();
+
+ DispoConfig getDispoConfig();
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
index 2a7b923c2e0..e777a013e03 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
@@ -26,6 +26,7 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
private String operation;
private JSONArray notesList;
private String importState;
+ private DispoConfig dispoConfig;
public DispoSetData() {
@@ -52,6 +53,10 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
this.notesList = notesList;
}
+ public void setDispoConfig(DispoConfig dispoConfig) {
+ this.dispoConfig = dispoConfig;
+ }
+
@Override
public JSONArray getNotesList() {
return notesList;
@@ -75,4 +80,9 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
}
return false;
}
+
+ @Override
+ public DispoConfig getDispoConfig() {
+ return dispoConfig;
+ }
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetDescriptorData.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetDescriptorData.java
index 3f1f90170d9..d73c8ff031f 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetDescriptorData.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetDescriptorData.java
@@ -22,21 +22,30 @@ public class DispoSetDescriptorData {
private String name;
private String importPath;
+ private String dispoType;
public String getName() {
return name;
}
- public void setName(String name) {
- this.name = name;
- }
-
public String getImportPath() {
return importPath;
}
+ public String getDispoType() {
+ return dispoType;
+ }
+
public void setImportPath(String importPath) {
this.importPath = importPath;
}
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setDispoType(String dispoType) {
+ this.dispoType = dispoType;
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
index b0e6363b128..95c85aed9ab 100644
--- a/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: OSEE Disposition REST (Incubation)
-Bundle-SymbolicName: org.eclipse.osee.disposition.rest
+Bundle-SymbolicName: org.eclipse.osee.disposition.rest;singleton:=true
Bundle-Version: 0.19.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Eclipse Open System Engineering Environment
@@ -9,6 +9,7 @@ Service-Component: OSGI-INF/*.xml
Import-Package:
com.google.common.collect,
com.google.common.io,
+ com.google.gson;version="2.1.0",
javax.ws.rs,
javax.ws.rs.core,
javax.ws.rs.ext,
@@ -30,3 +31,4 @@ Import-Package:
org.eclipse.osee.orcs.utility,
org.eclipse.osee.template.engine,
org.json
+Require-Bundle: org.eclipse.equinox.http.registry
diff --git a/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/resolution.validator.service.xml b/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/resolution.validator.service.xml
index 70a334d0ac9..b6e3c8fd6d4 100644
--- a/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/resolution.validator.service.xml
+++ b/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/resolution.validator.service.xml
@@ -5,4 +5,5 @@
<provide interface="org.eclipse.osee.disposition.rest.internal.DispoResolutionValidator"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+ <property name="TestScriptResolution" type="String" value="^[a-zA-Z]\d+$"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.disposition.rest/build.properties b/plugins/org.eclipse.osee.disposition.rest/build.properties
index 2bfa2292450..98767f60359 100644
--- a/plugins/org.eclipse.osee.disposition.rest/build.properties
+++ b/plugins/org.eclipse.osee.disposition.rest/build.properties
@@ -2,5 +2,6 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- OSGI-INF/
+ OSGI-INF/,\
+ plugin.xml
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
index a3adcbb4f8e..9d3e1a4c833 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
@@ -25,6 +25,7 @@ public final class DispoConstants {
public static final IArtifactType DispoSet = TokenFactory.createArtifactType(0x0000000000000327, "Disposition Set");
public static final IArtifactType DispoItem = TokenFactory.createArtifactType(0x0000000000000328, "Dispositionable Item");
+ public static final IAttributeType DispoConfig= TokenFactory.createAttributeType(0x1000000000000395L, "dispo.Dispo Config");
public static final IAttributeType ImportPath= TokenFactory.createAttributeType(0x1000000000000389L, "dispo.Import Path");
public static final IAttributeType ImportState= TokenFactory.createAttributeType(0x3000000000000196L, "dispo.Import State");
public static final IAttributeType DispoAnnotationsJson = TokenFactory.createAttributeType(0x1000000000000386L, "dispo.Annotations JSON");
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java
index d1b0797f321..284354348a9 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java
@@ -12,6 +12,7 @@
package org.eclipse.osee.disposition.rest.internal;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
+import org.eclipse.osee.disposition.model.DispoConfig;
import org.eclipse.osee.disposition.model.DispoItem;
import org.eclipse.osee.disposition.model.DispoItemData;
import org.eclipse.osee.disposition.model.DispoSetData;
@@ -55,10 +56,31 @@ public class DispoDataFactory {
newSet.setImportPath(descriptor.getImportPath());
newSet.setImportState("NONE");
newSet.setNotesList(new JSONArray());
+ newSet.setDispoConfig(buildDispoConfigFromType(descriptor.getDispoType()));
return newSet;
}
+ private DispoConfig buildDispoConfigFromType(String dispoType) {
+ DispoConfig toReturn = new DispoConfig();
+ if (dispoType.equalsIgnoreCase("testScript")) {
+ toReturn.setName("Test Script");
+ toReturn.setPeerNotes("Develop Notes");
+ toReturn.setCustomerNotes("Customer Notes");
+ toReturn.setResolutionTitle("PCR");
+ toReturn.setResolutionType("PCR Type");
+ toReturn.setType("");
+ } else {
+ toReturn.setName("Code Method");
+ toReturn.setPeerNotes("Develop Notes");
+ toReturn.setCustomerNotes("Customer Notes");
+ toReturn.setResolutionTitle("Coverage Method Type");
+ toReturn.setResolutionType("Coverage Method");
+ toReturn.setType("");
+ }
+ return toReturn;
+ }
+
public void initDispoItem(DispoItemData itemToInit) {
itemToInit.setAnnotationsList(new JSONArray());
if (itemToInit.getDiscrepanciesList() == null) {
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoResolutionValidator.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoResolutionValidator.java
index 1c998badd70..98ee1d2a1a3 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoResolutionValidator.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoResolutionValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.disposition.rest.internal;
+import java.util.Map;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
import org.eclipse.osee.logger.Log;
@@ -19,12 +20,14 @@ import org.eclipse.osee.logger.Log;
public class DispoResolutionValidator {
private Log logger;
+ private String resolutionRegex;
public void setLogger(Log logger) {
this.logger = logger;
}
- public void start() {
+ public void start(Map<String, Object> properties) {
+ resolutionRegex = (String) properties.get("TestScriptResolution");
logger.trace("Starting ResolutionValidator...");
}
@@ -35,7 +38,7 @@ public class DispoResolutionValidator {
public boolean validate(DispoAnnotationData annotation) {
String pcr = annotation.getResolution().toUpperCase().trim();
boolean isValid = false;
- if (pcr.matches("^\\s*[a-zA-Z]{1,}\\s*\\d{1,}$")) {
+ if (pcr.matches(resolutionRegex)) {
isValid = true;
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
index caa8b896931..5cdc76d1be6 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.disposition.rest.internal;
+import org.eclipse.osee.disposition.model.DispoConfig;
import org.eclipse.osee.disposition.model.DispoSet;
import org.eclipse.osee.disposition.rest.DispoConstants;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
@@ -18,6 +19,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.json.JSONArray;
import org.json.JSONException;
+import com.google.gson.Gson;
/**
* @author Angel Avila
@@ -68,4 +70,10 @@ public class DispoSetArtifact extends BaseIdentity<String> implements DispoSet,
public String getImportState() {
return artifact.getSoleAttributeAsString(DispoConstants.ImportState, "NOT_SET");
}
+
+ @Override
+ public DispoConfig getDispoConfig() {
+ Gson gson = new Gson();
+ return gson.fromJson(artifact.getSoleAttributeAsString(DispoConstants.DispoConfig, "{}"), DispoConfig.class);
+ }
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
index 882c744290d..c2b9c453997 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
@@ -50,6 +50,7 @@ import org.eclipse.osee.orcs.transaction.TransactionBuilder;
import org.eclipse.osee.orcs.transaction.TransactionFactory;
import org.json.JSONArray;
import org.json.JSONObject;
+import com.google.gson.Gson;
/**
* @author Angel Avila
@@ -205,10 +206,13 @@ public class OrcsStorageImpl implements Storage {
@Override
public Identifiable<String> createDispoSet(ArtifactReadable author, DispoProgram program, DispoSet descriptor) {
+ Gson gson = new Gson();
TransactionBuilder tx = getTxFactory().createTransaction(program.getUuid(), author, "Create Dispo Set");
ArtifactId creatdArtId = tx.createArtifact(DispoConstants.DispoSet, descriptor.getName());
tx.setSoleAttributeFromString(creatdArtId, DispoConstants.ImportPath, descriptor.getImportPath());
tx.setSoleAttributeFromString(creatdArtId, DispoConstants.ImportState, descriptor.getImportState());
+ String dispoConfigJson = gson.toJson(descriptor.getDispoConfig());
+ tx.setSoleAttributeFromString(creatdArtId, DispoConstants.DispoConfig, dispoConfigJson);
tx.setSoleAttributeFromString(creatdArtId, DispoConstants.DispoNotesJson, descriptor.getNotesList().toString());
tx.commit();
return creatdArtId;
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
index 1a7a8502254..b90183b1587 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
@@ -9,6 +9,7 @@ artifactType "Disposition Set" extends "Artifact" {
attribute "dispo.Date Created"
attribute "dispo.Import State"
attribute "dispo.Summary Count"
+ attribute "dispo.Dispo Config"
}
artifactType "dispo.Dispositionable Item" extends "Artifact" {
@@ -59,6 +60,15 @@ attributeType "dispo.Notes JSON" extends StringAttribute {
}
+attributeType "dispo.Dispo Config" extends StringAttribute {
+ uuid 0x1000000000000395
+ dataProvider DefaultAttributeDataProvider
+ min 0
+ max 1
+ fileExtension "txt"
+ mediaType "text/plain"
+}
+
attributeType "dispo.Import Path" extends StringAttribute {
uuid 0x1000000000000389
dataProvider DefaultAttributeDataProvider

Back to the top