Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2014-08-11 18:02:24 +0000
committerRoberto E. Escobar2014-09-29 22:55:06 +0000
commitc84876b8e5780609b29ca64aeaf6572bb9d47b18 (patch)
treebc8e6217618f0ea62a7d2aa6e48143329c38af66
parent118d50b87fab3db2615d2f23a5d9b7ff8642ecfc (diff)
downloadorg.eclipse.osee-c84876b8e5780609b29ca64aeaf6572bb9d47b18.tar.gz
org.eclipse.osee-c84876b8e5780609b29ca64aeaf6572bb9d47b18.tar.xz
org.eclipse.osee-c84876b8e5780609b29ca64aeaf6572bb9d47b18.zip
feature[ats_ATS40040]: Update Dispo page with AngularJS
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/internal/DispoApiTest.java36
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/AnnotationResourceTest.java28
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoItemResourceTest.java31
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResourceTest.java19
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoSetResourceTest.java27
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/build.properties3
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/plugin.xml12
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java51
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetDataCleaner.java77
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java37
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/AnnotationResource.java24
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java4
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoItemResource.java31
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java35
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoReportResource.java3
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoSetResource.java70
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java44
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/html/dispo.html905
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/html/dispoAdmin.html580
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/admin.html71
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/css/admin.css30
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/css/user.css183
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/js/adminController.js195
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/js/dispoApp.js111
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/js/mainController.js16
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/js/resizer.js61
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/js/userController.js333
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/main.html63
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/user.html69
30 files changed, 1450 insertions, 1701 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/internal/DispoApiTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/internal/DispoApiTest.java
index 1fa31247935..685dfb64b83 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/internal/DispoApiTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/internal/DispoApiTest.java
@@ -360,38 +360,44 @@ public class DispoApiTest {
// mocks for data util translation
when(jsonObject.has("id")).thenReturn(true);
when(jsonObject.getString("id")).thenReturn(expectedId);
+ when(jsonObject.has("locationRefs")).thenReturn(true);
+ when(jsonObject.getString("locationRefs")).thenReturn("5-10");
+ when(jsonObject.has("resolution")).thenReturn(true);
+ when(jsonObject.getString("resolution")).thenReturn("resOrig");
when(jsonObject.has("index")).thenReturn(false);
- when(jsonObject.has("locationRefs")).thenReturn(false);
when(jsonObject.has("idsOfCoveredDiscrepancies")).thenReturn(false);
when(jsonObject.has("notesList")).thenReturn(false);
+ when(jsonObject.has("resolutionType")).thenReturn(true);
+ when(jsonObject.getString("resolutionType")).thenReturn("CODE");
when(jsonObject.has("isResolutionValid")).thenReturn(true);
when(jsonObject.getBoolean("isResolutionValid")).thenReturn(true); // We'll have the old annotation have a valid resolution to start
+
// end
- newAnnotation.setLocationRefs("1-10");
+ // First with location refs, resolution type and resolution the same
+ newAnnotation.setLocationRefs("5-10");
+ newAnnotation.setResolution("resOrig");
+ newAnnotation.setResolutionType("CODE");
boolean actual = dispoApi.editDispoAnnotation(program, itemId.getGuid(), expectedId, newAnnotation, "name");
assertTrue(actual);
- // reset loc ref to null and set new (invalid) resolution
- newAnnotation.setLocationRefs(null);
- when(validator.validate(Matchers.any(DispoAnnotationData.class))).thenReturn(true);
- newAnnotation.setResolution("CPCR 13");
+ // Now change Location Refs, disconnector should be called
+ newAnnotation.setLocationRefs("1-10");
+ when(validator.validate(Matchers.any(DispoAnnotationData.class))).thenReturn(false);
actual = dispoApi.editDispoAnnotation(program, itemId.getGuid(), expectedId, newAnnotation, "name");
assertTrue(actual);
- // reset the resolution and change just the resolution type
- newAnnotation.setLocationRefs(null);
+ // reset the resolution and change just the resolution type, disconnector and should be called
+ newAnnotation.setLocationRefs("5-10");
+ newAnnotation.setResolutionType("TEST");
when(validator.validate(Matchers.any(DispoAnnotationData.class))).thenReturn(true);
- newAnnotation.setResolution(null);
- newAnnotation.setResolutionType("None");
actual = dispoApi.editDispoAnnotation(program, itemId.getGuid(), expectedId, newAnnotation, "name");
assertTrue(actual);
- // notes are the only thing being modified, no need to disconnect or connect
- newAnnotation.setLocationRefs(null);
- newAnnotation.setResolution(null);
- newAnnotation.setResolutionType(null);
- newAnnotation.setDeveloperNotes("");
+ // Reset resolution type, only change to resolution, disconnector is called
+ newAnnotation.setResolutionType("CODE");
+ newAnnotation.setResolution("NEW");
+ when(validator.validate(Matchers.any(DispoAnnotationData.class))).thenReturn(true);
actual = dispoApi.editDispoAnnotation(program, itemId.getGuid(), expectedId, newAnnotation, "name");
assertTrue(actual);
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/AnnotationResourceTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/AnnotationResourceTest.java
index b10086a3a3b..d6a42577756 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/AnnotationResourceTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/AnnotationResourceTest.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.disposition.rest.resources;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.Response;
@@ -22,8 +21,10 @@ import org.eclipse.osee.disposition.model.DispoMessages;
import org.eclipse.osee.disposition.model.DispoProgram;
import org.eclipse.osee.disposition.model.DispoStrings;
import org.eclipse.osee.disposition.rest.DispoApi;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -39,8 +40,6 @@ public class AnnotationResourceTest {
@Mock
private DispoItemData dispoItem;
@Mock
- private DispoHtmlWriter htmlWriter;
- @Mock
private Identifiable<String> id1;
@Mock
private Identifiable<String> id2;
@@ -53,7 +52,7 @@ public class AnnotationResourceTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- resource = new AnnotationResource(dispositionApi, htmlWriter, program, "setId", "itemId");
+ resource = new AnnotationResource(dispositionApi, program, "setId", "itemId");
when(id1.getGuid()).thenReturn("abcdef");
when(id2.getGuid()).thenReturn("fedcba");
}
@@ -91,27 +90,19 @@ public class AnnotationResourceTest {
}
@Test
- public void testGetAllAsHtml() throws IOException {
- // No Annotations
- List<DispoAnnotationData> emptyResultSet = new ArrayList<DispoAnnotationData>();
- when(dispositionApi.getDispoAnnotations(program, "itemId")).thenReturn(emptyResultSet);
- when(htmlWriter.createSubTable(emptyResultSet)).thenReturn("htmlFromWriter");
- Response noAnnotationsReponse = resource.getAllDispoAnnotations();
- assertEquals(Response.Status.OK.getStatusCode(), noAnnotationsReponse.getStatus());
- String html = (String) noAnnotationsReponse.getEntity();
- assertEquals("htmlFromWriter", html);
-
+ public void testGetAll() throws JSONException {
DispoAnnotationData annotation = new DispoAnnotationData();
annotation.setId(mockId);
annotation.setLocationRefs("1-10");
List<DispoAnnotationData> resultSet = new ArrayList<DispoAnnotationData>();
+ resultSet.add(annotation);
when(dispositionApi.getDispoAnnotations(program, "itemId")).thenReturn(resultSet);
- when(htmlWriter.createSubTable(resultSet)).thenReturn("htmlFromWriter");
Response oneSetResponse = resource.getAllDispoAnnotations();
- html = (String) oneSetResponse.getEntity();
+ JSONArray jarray = new JSONArray((String) oneSetResponse.getEntity());
+ JSONObject annotationFromResponse = jarray.getJSONObject(0);
assertEquals(Response.Status.OK.getStatusCode(), oneSetResponse.getStatus());
- assertEquals("htmlFromWriter", html);
+ assertEquals(mockId, annotationFromResponse.getString("guid"));
}
@Test
@@ -146,7 +137,6 @@ public class AnnotationResourceTest {
when(dispoItem.getStatus()).thenReturn(DispoStrings.Item_Complete);
Response response = resource.putDispoAnnotation(annotationToEdit.getId(), newAnnotation, "name");
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- assertEquals(DispoStrings.Item_Complete, response.getEntity());
when(dispositionApi.editDispoAnnotation(program, "itemId", annotationToEdit.getId(), newAnnotation, "name")).thenReturn(
false);
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoItemResourceTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoItemResourceTest.java
index 039de113d6c..7c59b488aeb 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoItemResourceTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoItemResourceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Boeing.
+ * Copyright (c) 2013 Boein g.
* 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
@@ -21,9 +21,10 @@ import org.eclipse.osee.disposition.model.DispoItemData;
import org.eclipse.osee.disposition.model.DispoMessages;
import org.eclipse.osee.disposition.model.DispoProgram;
import org.eclipse.osee.disposition.rest.DispoApi;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
import org.eclipse.osee.orcs.data.ArtifactReadable;
+import org.json.JSONArray;
+import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -37,8 +38,6 @@ public class DispoItemResourceTest {
@Mock
private DispoApi dispositionApi;
@Mock
- private DispoHtmlWriter htmlWriter;
- @Mock
private Identifiable<String> id1;
@Mock
private Identifiable<String> id2;
@@ -52,33 +51,39 @@ public class DispoItemResourceTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- resource = new DispoItemResource(dispositionApi, htmlWriter, program, "setId");
+ resource = new DispoItemResource(dispositionApi, program, "setId");
when(id1.getGuid()).thenReturn("abcdef");
when(id2.getGuid()).thenReturn("fedcba");
when(setArt.getGuid()).thenReturn("setId");
}
@Test
- public void testGetAllAsHtml() throws Exception {
+ public void testGetAll() throws Exception {
// No Items
List<DispoItem> emptyResultSet = new ArrayList<DispoItem>();
when(dispositionApi.getDispoItems(program, "setId")).thenReturn(emptyResultSet);
Response noItemsResponse = resource.getAllDispoItems();
assertEquals(Response.Status.OK.getStatusCode(), noItemsResponse.getStatus());
- DispoItem item = new DispoItemData();
- List<DispoItem> resultSet = Collections.singletonList(item);
+ DispoItemData item = new DispoItemData();
+ item.setAnnotationsList(new JSONArray());
+ item.setDiscrepanciesList(new JSONObject());
+ item.setGuid(id1.getGuid());
+ List<DispoItem> resultSet = Collections.singletonList((DispoItem) item);
when(dispositionApi.getDispoItems(program, "setId")).thenReturn(resultSet);
- Response oneSetResponse = resource.getAllDispoItems();
- assertEquals(Response.Status.OK.getStatusCode(), oneSetResponse.getStatus());
+ Response response = resource.getAllDispoItems();
+ JSONArray entity = new JSONArray((String) response.getEntity());
+ JSONObject itemFromResponse = entity.getJSONObject(0);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ assertEquals(id1.getGuid(), itemFromResponse.getString("guid"));
}
@Test
- public void testGetSingleSetAsJson() {
+ public void testGetSingleSet() {
// No items
when(dispositionApi.getDispoItemById(program, id2.getGuid())).thenReturn(null);
- Response noItemsResponse = resource.getDispoItemsByIdJson(id2.getGuid());
+ Response noItemsResponse = resource.getDispoItemsById(id2.getGuid());
String messageActual = (String) noItemsResponse.getEntity();
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), noItemsResponse.getStatus());
assertEquals(DispoMessages.Item_NotFound, messageActual);
@@ -89,7 +94,7 @@ public class DispoItemResourceTest {
expectedItem.setNeedsRerun(false);
expectedItem.setTotalPoints("4");
when(dispositionApi.getDispoItemById(program, expectedItem.getGuid())).thenReturn(expectedItem);
- Response oneSetResponse = resource.getDispoItemsByIdJson(expectedItem.getGuid());
+ Response oneSetResponse = resource.getDispoItemsById(expectedItem.getGuid());
DispoItemData returnedItem = (DispoItemData) oneSetResponse.getEntity();
assertEquals(Response.Status.OK.getStatusCode(), oneSetResponse.getStatus());
assertEquals(expectedItem.getGuid(), returnedItem.getGuid());
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResourceTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResourceTest.java
index e5c40e6d449..8b4b1a97a8d 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResourceTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResourceTest.java
@@ -13,15 +13,16 @@ package org.eclipse.osee.disposition.rest.resources;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import javax.ws.rs.core.Response;
-import org.eclipse.osee.disposition.model.DispoMessages;
import org.eclipse.osee.disposition.model.DispoProgram;
import org.eclipse.osee.disposition.rest.DispoApi;
import org.eclipse.osee.disposition.rest.util.DispoFactory;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -35,8 +36,6 @@ public class DispoProgramResourceTest {
@Mock
private DispoApi dispoApi;
@Mock
- private DispoHtmlWriter htmlWriter;
- @Mock
private DispoProgram id1;
@Mock
private DispoProgram id2;
@@ -48,29 +47,29 @@ public class DispoProgramResourceTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- resource = new DispoProgramResource(dispoApi, htmlWriter, dispoFactory);
+ resource = new DispoProgramResource(dispoApi, dispoFactory);
when(id1.getUuid()).thenReturn(23L);
when(id2.getUuid()).thenReturn(25L);
}
@Test
- public void testGetAllAsHtml() {
+ public void testGetAll() throws JSONException {
// No Sets
ResultSet<IOseeBranch> emptyResultSet = ResultSets.emptyResultSet();
when(dispoApi.getDispoPrograms()).thenReturn(emptyResultSet);
Response noProgramsResponse = resource.getAllPrograms();
String messageActual = (String) noProgramsResponse.getEntity();
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), noProgramsResponse.getStatus());
- assertEquals(DispoMessages.Program_NoneFound, messageActual);
+ assertEquals("[]", messageActual);
IOseeBranch branch = TokenFactory.createBranch(id1.getUuid(), "testBranch");
ResultSet<IOseeBranch> branchList = ResultSets.singleton(branch);
when(dispoApi.getDispoPrograms()).thenReturn(branchList);
- when(htmlWriter.createSelectPrograms(branchList)).thenReturn("htmlFromWriter");
Response oneSetResponse = resource.getAllPrograms();
- String html = (String) oneSetResponse.getEntity();
+ JSONArray entity = new JSONArray((String) oneSetResponse.getEntity());
+ JSONObject programFromEntity = entity.getJSONObject(0);
assertEquals(Response.Status.OK.getStatusCode(), oneSetResponse.getStatus());
- assertEquals("htmlFromWriter", html);
+ assertEquals(String.valueOf(id1.getUuid()), programFromEntity.getString("value"));
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoSetResourceTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoSetResourceTest.java
index ecfe4433b97..0761a65159c 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoSetResourceTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/resources/DispoSetResourceTest.java
@@ -22,8 +22,10 @@ import org.eclipse.osee.disposition.model.DispoSet;
import org.eclipse.osee.disposition.model.DispoSetData;
import org.eclipse.osee.disposition.model.DispoSetDescriptorData;
import org.eclipse.osee.disposition.rest.DispoApi;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -37,8 +39,6 @@ public class DispoSetResourceTest {
@Mock
private DispoApi dispositionApi;
@Mock
- private DispoHtmlWriter htmlWriter;
- @Mock
private Identifiable<String> id1;
@Mock
private Identifiable<String> id2;
@@ -50,7 +50,7 @@ public class DispoSetResourceTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- resource = new DispoSetResource(dispositionApi, htmlWriter, program);
+ resource = new DispoSetResource(dispositionApi, program);
when(id1.getGuid()).thenReturn("abcdef");
when(id2.getGuid()).thenReturn("fedcba");
}
@@ -61,6 +61,7 @@ public class DispoSetResourceTest {
DispoSetDescriptorData descriptor = new DispoSetDescriptorData();
descriptor.setName("Name");
descriptor.setImportPath("c:");
+ descriptor.setDispoType("testScripts");
DispoSetData expected = new DispoSetData();
expected.setGuid(id1.getGuid());
@@ -104,6 +105,7 @@ public class DispoSetResourceTest {
DispoSetDescriptorData descriptor = new DispoSetDescriptorData();
descriptor.setName("Name");
descriptor.setImportPath("c:");
+ descriptor.setDispoType("testScript");
when(dispositionApi.isUniqueSetName(program, descriptor.getName())).thenReturn(false);
@@ -114,28 +116,29 @@ public class DispoSetResourceTest {
}
@Test
- public void testGetAllAsHtml() {
+ public void testGetAll() throws JSONException {
// No Sets
List<DispoSet> emptyResultSet = new ArrayList<DispoSet>();
when(dispositionApi.getDispoSets(program)).thenReturn(emptyResultSet);
Response noSetsResponse = resource.getAllDispoSets();
String messageActual = (String) noSetsResponse.getEntity();
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), noSetsResponse.getStatus());
- assertEquals(DispoMessages.Set_NoneFound, messageActual);
+ assertEquals("[]", messageActual);
- DispoSet set = new DispoSetData();
- List<DispoSet> resultSet = Collections.singletonList(set);
+ DispoSetData set = new DispoSetData();
+ set.setGuid(id1.getGuid());
+ List<DispoSet> resultSet = Collections.singletonList((DispoSet) set);
when(dispositionApi.getDispoSets(program)).thenReturn(resultSet);
- when(htmlWriter.createSelectSet(resultSet)).thenReturn("htmlFromWriter");
Response oneSetResponse = resource.getAllDispoSets();
- String html = (String) oneSetResponse.getEntity();
+ JSONArray entity = new JSONArray((String) oneSetResponse.getEntity());
+ JSONObject setFromEntity = entity.getJSONObject(0);
assertEquals(Response.Status.OK.getStatusCode(), oneSetResponse.getStatus());
- assertEquals("htmlFromWriter", html);
+ assertEquals(id1.getGuid(), setFromEntity.getString("guid"));
}
@Test
- public void testGetSingleSetAsJson() {
+ public void testGetSingleSet() {
// No Sets
when(dispositionApi.getDispoSetById(program, id2.getGuid())).thenReturn(null);
Response noSetsResponse = resource.getDispoSetByIdJson(id2.getGuid());
diff --git a/plugins/org.eclipse.osee.disposition.rest/build.properties b/plugins/org.eclipse.osee.disposition.rest/build.properties
index c58ea2178c3..948f0bdf020 100644
--- a/plugins/org.eclipse.osee.disposition.rest/build.properties
+++ b/plugins/org.eclipse.osee.disposition.rest/build.properties
@@ -2,4 +2,5 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- OSGI-INF/
+ OSGI-INF/,\
+ plugin.xml
diff --git a/plugins/org.eclipse.osee.disposition.rest/plugin.xml b/plugins/org.eclipse.osee.disposition.rest/plugin.xml
new file mode 100644
index 00000000000..ca1cbe680a8
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/plugin.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.equinox.http.registry.resources">
+ <resource
+ alias="/dispo"
+ base-name="/web">
+ </resource>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
index b61e28911f5..3afab7c1aa2 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
@@ -36,7 +36,6 @@ import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.json.JSONArray;
@@ -219,52 +218,40 @@ public class DispoApiImpl implements DispoApi {
JSONArray annotationsList = dispoItem.getAnnotationsList();
JSONObject discrepanciesList = dispoItem.getDiscrepanciesList();
try {
- DispoAnnotationData oldAnnotation =
+ DispoAnnotationData origAnnotation =
DispoUtil.jsonObjToDispoAnnotationData(DispoUtil.getById(annotationsList, annotationId));
- int indexOfAnnotation = oldAnnotation.getIndex();
-
- DispoAnnotationData consolidatedAnnotation = oldAnnotation;
-
- String newDeveloperNotes = newAnnotation.getDeveloperNotes();
- if (Strings.isValid(newDeveloperNotes)) {
- consolidatedAnnotation.setDeveloperNotes(newDeveloperNotes);
- }
- String newCustomerNotes = newAnnotation.getCustomerNotes();
- if (Strings.isValid(newCustomerNotes)) {
- consolidatedAnnotation.setCustomerNotes(newCustomerNotes);
- }
+ int indexOfAnnotation = origAnnotation.getIndex();
boolean needToReconnect = false;
// now if the new Annotation modified the location Reference or resolution then disconnect the annotation and try to match it to discrepancies again
String newLocationRefs = newAnnotation.getLocationRefs();
String newResolution = newAnnotation.getResolution();
String newResolutionType = newAnnotation.getResolutionType();
- if (newResolution != null) {
- consolidatedAnnotation.setResolution(newResolution);
- consolidatedAnnotation.setIsResolutionValid(validateResolution(consolidatedAnnotation));
- needToReconnect = true;
- }
- if (newResolutionType != null) {
- consolidatedAnnotation.setResolutionType(newAnnotation.getResolutionType());
+
+ if (!origAnnotation.getResolutionType().equals(newResolutionType) || !origAnnotation.getResolution().equals(
+ newResolution)) {
+ newAnnotation.setIsResolutionValid(validateResolution(newAnnotation));
needToReconnect = true;
}
- if (newLocationRefs != null) {
- consolidatedAnnotation.setLocationRefs(newLocationRefs);
+ if (!origAnnotation.getLocationRefs().equals(newLocationRefs)) {
needToReconnect = true;
}
if (needToReconnect == true) {
- consolidatedAnnotation.disconnect();
- dispoConnector.connectAnnotation(consolidatedAnnotation, discrepanciesList);
+ newAnnotation.disconnect();
+ dispoConnector.connectAnnotation(newAnnotation, discrepanciesList);
}
- //
- JSONObject annotationAsJsonObject = DispoUtil.annotationToJsonObj(consolidatedAnnotation);
+ JSONObject annotationAsJsonObject = DispoUtil.annotationToJsonObj(newAnnotation);
annotationsList.put(indexOfAnnotation, annotationAsJsonObject);
- DispoItem updatedItem = dataFactory.createUpdatedItem(annotationsList, discrepanciesList);
ArtifactReadable author = getQuery().findUser();
- getWriter().updateDispoItem(author, program, dispoItem.getGuid(), updatedItem);
+ DispoItemData modifiedDispoItem = DispoUtil.itemArtToItemData(getDispoItemById(program, itemId), true);
+
+ modifiedDispoItem.setAnnotationsList(annotationsList);
+ modifiedDispoItem.setStatus(dispoConnector.allDiscrepanciesAnnotated(modifiedDispoItem));
+ getWriter().updateDispoItem(author, program, dispoItem.getGuid(), modifiedDispoItem);
+
wasUpdated = true;
} catch (JSONException ex) {
throw new OseeCoreException(ex);
@@ -396,6 +383,12 @@ public class DispoApiImpl implements DispoApi {
} catch (Exception ex) {
throw new OseeCoreException(ex);
}
+ } else if (operation.equals("cleanPCRTypes")) {
+ List<DispoItem> dispoItems = getDispoItems(program, setToEdit.getGuid());
+ List<DispoItem> toModify = DispoSetDataCleaner.cleanUpPcrTypes(dispoItems);
+
+ ArtifactReadable author = getQuery().findUser();
+ getWriter().updateDispoItems(author, program, toModify, false);
}
// Create the Note to document the Operation
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 284354348a9..45d8db70e38 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
@@ -72,7 +72,7 @@ public class DispoDataFactory {
toReturn.setType("");
} else {
toReturn.setName("Code Method");
- toReturn.setPeerNotes("Develop Notes");
+ toReturn.setPeerNotes("Developer Notes");
toReturn.setCustomerNotes("Customer Notes");
toReturn.setResolutionTitle("Coverage Method Type");
toReturn.setResolutionType("Coverage Method");
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetDataCleaner.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetDataCleaner.java
new file mode 100644
index 00000000000..8e27a8771a5
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetDataCleaner.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.rest.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.disposition.model.DispoAnnotationData;
+import org.eclipse.osee.disposition.model.DispoItem;
+import org.eclipse.osee.disposition.model.DispoItemData;
+import org.eclipse.osee.disposition.rest.util.DispoUtil;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+/**
+ * @author Angel Avila
+ */
+public class DispoSetDataCleaner {
+
+ public static List<DispoItem> cleanUpPcrTypes(List<DispoItem> items) {
+ List<DispoItem> toModify = new ArrayList<DispoItem>();
+ for (DispoItem item : items) {
+ JSONArray annotationsList = item.getAnnotationsList();
+ if (checkForBadReqType(annotationsList)) {
+ try {
+ JSONArray modifiedAnnotations = cleanAnnotationsList(annotationsList);
+ DispoItemData modifiedItem = new DispoItemData();
+ modifiedItem.setAnnotationsList(modifiedAnnotations);
+ modifiedItem.setGuid(item.getGuid());
+
+ toModify.add(modifiedItem);
+ } catch (JSONException ex) {
+ throw new OseeCoreException(ex);
+ }
+ } else {
+ // do nothing
+ }
+ }
+ return toModify;
+ }
+
+ private static boolean checkForBadReqType(JSONArray annotations) {
+ if (containsBadWord(annotations.toString())) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private static JSONArray cleanAnnotationsList(JSONArray annotations) throws JSONException {
+ for (int i = 0; i < annotations.length(); i++) {
+ DispoAnnotationData annotation = DispoUtil.jsonObjToDispoAnnotationData(annotations.getJSONObject(i));
+ if (containsBadWord(annotation.getResolutionType())) {
+ annotation.setResolutionType("Requirement");
+ }
+ annotations.put(annotation.getIndex(), DispoUtil.annotationToJsonObj(annotation));
+ }
+ return annotations;
+ }
+
+ private static boolean containsBadWord(String toCheck) {
+ String allUpperCase = toCheck.toUpperCase();
+ if (allUpperCase.contains("\"REQ\"") || allUpperCase.equals("REQ")) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
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 c2b9c453997..8df934edccc 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
@@ -244,24 +244,20 @@ public class OrcsStorageImpl implements Storage {
@Override
public void updateDispoSet(ArtifactReadable author, DispoProgram program, String setId, DispoSet newData) {
ArtifactReadable dispoSet = findDispoArtifact(program, setId, DispoConstants.DispoSet);
+ DispoSetArtifact origSetAs = new DispoSetArtifact(dispoSet);
String name = newData.getName();
String importPath = newData.getImportPath();
- String importState = newData.getImportState();
- // DispoOperationsEnum operationRequest = dispositionSet.getOperation(); // Operation classes still not created
JSONArray notesList = newData.getNotesList();
TransactionBuilder tx = getTxFactory().createTransaction(program.getUuid(), author, "Delete Dispo Set");
- if (name != null) {
+ if (name != null && !name.equals(origSetAs.getName())) {
tx.setName(dispoSet, name);
}
- if (importPath != null) {
+ if (importPath != null && !importPath.equals(origSetAs.getImportPath())) {
tx.setSoleAttributeFromString(dispoSet, DispoConstants.ImportPath, importPath);
}
- if (importState != null) {
- tx.setSoleAttributeFromString(dispoSet, DispoConstants.ImportState, importState);
- }
- if (notesList != null) {
+ if (notesList != null && !notesList.toString().equals(origSetAs.getNotesList().toString())) {
tx.setSoleAttributeFromString(dispoSet, DispoConstants.DispoNotesJson, notesList.toString());
}
tx.commit();
@@ -293,7 +289,7 @@ public class OrcsStorageImpl implements Storage {
tx.commit();
}
- private void updateSingleItem(ArtifactReadable author, DispoProgram program, ArtifactId currentItemArt, DispoItem newItemData, TransactionBuilder tx, boolean resetRerunFlag) {
+ private void updateSingleItem(ArtifactReadable author, DispoProgram program, ArtifactReadable currentItemArt, DispoItem newItemData, TransactionBuilder tx, boolean resetRerunFlag) {
Date lastUpdate = newItemData.getLastUpdate();
String name = newItemData.getName();
JSONObject discrepanciesList = newItemData.getDiscrepanciesList();
@@ -309,38 +305,41 @@ public class OrcsStorageImpl implements Storage {
needsRerun = newItemData.getNeedsRerun();
}
- if (name != null) {
+ DispoItemArtifact origItem = new DispoItemArtifact(currentItemArt);
+
+ if (name != null && !name.equals(origItem.getName())) {
tx.setName(currentItemArt, name);
}
- if (discrepanciesList != null) {
+ if (discrepanciesList != null && !discrepanciesList.equals(origItem.getDiscrepanciesList())) {
tx.setSoleAttributeFromString(currentItemArt, DispoConstants.DispoDiscrepanciesJson,
discrepanciesList.toString());
}
- if (annotationsList != null) {
+ if (annotationsList != null && !annotationsList.equals(origItem.getAnnotationsList())) {
tx.setSoleAttributeFromString(currentItemArt, DispoConstants.DispoAnnotationsJson, annotationsList.toString());
}
- if (assignee != null) {
+ if (assignee != null && !assignee.equals(origItem.getAssignee())) {
tx.setSoleAttributeFromString(currentItemArt, DispoConstants.DispoItemAssignee, assignee);
}
- if (status != null) {
+ if (status != null && !status.equals(origItem.getStatus())) {
tx.setSoleAttributeFromString(currentItemArt, DispoConstants.DispoItemStatus, status);
}
- if (lastUpdate != null) {
+ if (lastUpdate != null && !lastUpdate.equals(origItem.getLastUpdate())) {
tx.setSoleAttributeValue(currentItemArt, DispoConstants.DispoLastUpdated, lastUpdate);
}
- if (needsRerun != null) {
+ if (needsRerun != null && !needsRerun.equals(origItem.getNeedsRerun())) {
tx.setSoleAttributeValue(currentItemArt, DispoConstants.DispoItemNeedsRerun, needsRerun.booleanValue());
}
- if (totalPoints != null) {
+ if (totalPoints != null && !totalPoints.equals(origItem.getTotalPoints())) {
tx.setSoleAttributeValue(currentItemArt, DispoConstants.DispoItemTotalPoints, totalPoints);
}
+
}
@Override
public void updateDispoItem(ArtifactReadable author, DispoProgram program, String dispoItemId, DispoItem data) {
IOseeBranch branch = TokenFactory.createBranch(program.getUuid(), "");
TransactionBuilder tx = getTxFactory().createTransaction(branch, author, "Edit Dispo Item");
- ArtifactId dispoItemArt = findDispoArtifact(program, dispoItemId, DispoConstants.DispoItem);
+ ArtifactReadable dispoItemArt = findDispoArtifact(program, dispoItemId, DispoConstants.DispoItem);
updateSingleItem(author, program, dispoItemArt, data, tx, false);
tx.commit();
}
@@ -350,7 +349,7 @@ public class OrcsStorageImpl implements Storage {
TransactionBuilder tx = getTxFactory().createTransaction(program.getUuid(), author, "Edit Multiple Dispo Items");
for (DispoItem newItem : data) {
- ArtifactId dispoItemArt = findDispoArtifact(program, newItem.getGuid(), DispoConstants.DispoItem);
+ ArtifactReadable dispoItemArt = findDispoArtifact(program, newItem.getGuid(), DispoConstants.DispoItem);
updateSingleItem(author, program, dispoItemArt, newItem, tx, resetRerunFlag);
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/AnnotationResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/AnnotationResource.java
index 305d303a632..dd2555532ee 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/AnnotationResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/AnnotationResource.java
@@ -29,22 +29,22 @@ import org.eclipse.osee.disposition.model.DispoItem;
import org.eclipse.osee.disposition.model.DispoMessages;
import org.eclipse.osee.disposition.model.DispoProgram;
import org.eclipse.osee.disposition.rest.DispoApi;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
+import org.eclipse.osee.disposition.rest.util.DispoUtil;
+import org.json.JSONArray;
+import org.json.JSONException;
/**
* @author Angel Avila
*/
public class AnnotationResource {
private final DispoApi dispoApi;
- private final DispoHtmlWriter writer;
private final DispoProgram program;
private final String itemId;
- public AnnotationResource(DispoApi dispoApi, DispoHtmlWriter writer, DispoProgram program, String setUuid, String dispResourceId) {
+ public AnnotationResource(DispoApi dispoApi, DispoProgram program, String setUuid, String dispResourceId) {
this.dispoApi = dispoApi;
this.program = program;
this.itemId = dispResourceId;
- this.writer = writer;
}
/**
@@ -82,20 +82,23 @@ public class AnnotationResource {
* Get all Annotations for the DisposionableItem
*
* @return The Annotation found for the DisposionableItem
+ * @throws JSONException
* @throws IOException
* @response.representation.200.doc OK, Found Annotations
* @response.representation.404.doc Not Found, Could not find any Annotations
*/
@GET
- @Produces(MediaType.TEXT_HTML)
- public Response getAllDispoAnnotations() throws IOException {
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getAllDispoAnnotations() throws JSONException {
Response.Status status;
- String html;
List<DispoAnnotationData> dispositionAnnotations = dispoApi.getDispoAnnotations(program, itemId);
status = Status.OK;
- html = writer.createSubTable(dispositionAnnotations);
- return Response.status(status).entity(html).build();
+ JSONArray array = new JSONArray();
+ for (DispoAnnotationData annotation : dispositionAnnotations) {
+ array.put(annotation.getIndex(), DispoUtil.annotationToJsonObj(annotation));
+ }
+ return Response.status(status).entity(array.toString()).build();
}
/**
@@ -136,8 +139,7 @@ public class AnnotationResource {
Response response;
boolean wasEdited = dispoApi.editDispoAnnotation(program, itemId, annotationId, newAnnotation, userName);
if (wasEdited) {
- DispoItem dispoItemById = dispoApi.getDispoItemById(program, itemId);
- response = Response.status(Response.Status.OK).entity(dispoItemById.getStatus()).build();
+ response = Response.status(Response.Status.OK).build();
} else {
response = Response.status(Response.Status.NOT_MODIFIED).build();
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java
index 221ea9022a5..1fa2190882f 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java
@@ -27,7 +27,7 @@ import org.eclipse.osee.disposition.rest.util.TemplateRegistry;
/**
* @author Angel Avila
*/
-@ApplicationPath("dispo")
+@ApplicationPath("dispor")
public final class DispoApplication extends Application {
private DispoApi dispoApi;
@@ -52,7 +52,7 @@ public final class DispoApplication extends Application {
singletons.add(new DispoAnnotationMessageWriter());
DispoHtmlWriter writer = new DispoHtmlWriter(TemplateRegistry.newRegistry());
- singletons.add(new DispoProgramResource(dispoApi, writer, dispoApi.getDispoFactory()));
+ singletons.add(new DispoProgramResource(dispoApi, dispoApi.getDispoFactory()));
singletons.add(new DispoInitResource(writer));
singletons.add(new DispoAdminResource(writer));
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoItemResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoItemResource.java
index 67598e942d9..3e0ee85d349 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoItemResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoItemResource.java
@@ -21,45 +21,38 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.StreamingOutput;
import org.eclipse.osee.disposition.model.DispoItem;
import org.eclipse.osee.disposition.model.DispoItemData;
import org.eclipse.osee.disposition.model.DispoMessages;
import org.eclipse.osee.disposition.model.DispoProgram;
import org.eclipse.osee.disposition.rest.DispoApi;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
import org.eclipse.osee.disposition.rest.util.DispoUtil;
+import org.json.JSONArray;
/**
* @author Angel Avila
*/
public class DispoItemResource {
private final DispoApi dispoApi;
- private final DispoHtmlWriter writer;
private final DispoProgram program;
private final String setId;
- public DispoItemResource(DispoApi dispoApi, DispoHtmlWriter writer, DispoProgram program, String setId) {
+ public DispoItemResource(DispoApi dispoApi, DispoProgram program, String setId) {
this.dispoApi = dispoApi;
this.program = program;
this.setId = setId;
- this.writer = writer;
}
- /**
- * Get all Dispositionable Items under the Disposition Set
- *
- * @return The Dispositionable Items found under the Disposition Set
- * @throws Exception
- * @response.representation.200.doc OK, Found Dispositionable Items
- * @response.representation.404.doc Not Found, Could not find any Dispositionable Items
- */
@GET
- @Produces(MediaType.TEXT_HTML)
+ @Produces(MediaType.APPLICATION_JSON)
public Response getAllDispoItems() throws Exception {
List<DispoItem> dispoItems = dispoApi.getDispoItems(program, setId);
- StreamingOutput streamingOutput = new DispoHtmlOutputStream(dispoItems);
- ResponseBuilder builder = Response.ok(streamingOutput);
+ JSONArray jarray = new JSONArray();
+ for (DispoItem dispoItem : dispoItems) {
+ jarray.put(DispoUtil.dispoItemToJsonObj(dispoItem));
+ }
+
+ ResponseBuilder builder = Response.ok(jarray.toString());
return builder.build();
}
@@ -74,13 +67,13 @@ public class DispoItemResource {
@Path("{itemId}")
@GET
@Produces(MediaType.APPLICATION_JSON)
- public Response getDispoItemsByIdJson(@PathParam("itemId") String itemId) {
+ public Response getDispoItemsById(@PathParam("itemId") String itemId) {
Response response;
DispoItem result = dispoApi.getDispoItemById(program, itemId);
if (result == null) {
response = Response.status(Response.Status.NOT_FOUND).entity(DispoMessages.Item_NotFound).build();
} else {
- response = Response.status(Response.Status.OK).entity(DispoUtil.itemArtToItemData(result)).build();
+ response = Response.status(Response.Status.OK).entity(DispoUtil.itemArtToItemData(result, false)).build();
}
return response;
}
@@ -131,6 +124,6 @@ public class DispoItemResource {
@Path("{itemId}/annotation/")
public AnnotationResource getAnnotation(@PathParam("itemId") String itemId) {
- return new AnnotationResource(dispoApi, writer, program, setId, itemId);
+ return new AnnotationResource(dispoApi, program, setId, itemId);
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java
index 5a6fb8e2dc9..9945a9e9fda 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java
@@ -17,12 +17,13 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
-import org.eclipse.osee.disposition.model.DispoMessages;
import org.eclipse.osee.disposition.rest.DispoApi;
import org.eclipse.osee.disposition.rest.util.DispoFactory;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
/**
* @author Angel Avila
@@ -31,45 +32,49 @@ import org.eclipse.osee.framework.jdk.core.type.ResultSet;
public class DispoProgramResource {
private final DispoApi dispoApi;
- private final DispoHtmlWriter writer;
private final DispoFactory dispoFactory;
- public DispoProgramResource(DispoApi dispoApi, DispoHtmlWriter writer, DispoFactory dispoFactory) {
+ public DispoProgramResource(DispoApi dispoApi, DispoFactory dispoFactory) {
this.dispoApi = dispoApi;
- this.writer = writer;
this.dispoFactory = dispoFactory;
}
/**
- * Get all Disposition Programs
+ * Get all Disposition Programs as JSON
*
* @return The Disposition Programs found
+ * @throws JSONException
* @response.representation.200.doc OK, Found Disposition Program
* @response.representation.404.doc Not Found, Could not find any Disposition Programs
*/
@GET
- @Produces(MediaType.TEXT_HTML)
- public Response getAllPrograms() {
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getAllPrograms() throws JSONException {
ResultSet<IOseeBranch> allPrograms = dispoApi.getDispoPrograms();
- Response.Status status;
- String html;
+ JSONArray jarray = new JSONArray();
+
+ for (IOseeBranch branch : allPrograms) {
+ JSONObject jobject = new JSONObject();
+ jobject.put("value", branch.getGuid());
+ jobject.put("text", branch.getName());
+ jarray.put(jobject);
+ }
+ Status status;
if (allPrograms.isEmpty()) {
status = Status.NOT_FOUND;
- html = DispoMessages.Program_NoneFound;
} else {
status = Status.OK;
- html = writer.createSelectPrograms(allPrograms);
}
- return Response.status(status).entity(html).build();
+ return Response.status(status).entity(jarray.toString()).build();
}
@Path("{programId}/set")
public DispoSetResource getAnnotation(@PathParam("programId") String programId) {
- return new DispoSetResource(dispoApi, writer, dispoFactory.createProgram(programId, Long.parseLong(programId)));
+ return new DispoSetResource(dispoApi, dispoFactory.createProgram(programId, Long.parseLong(programId)));
}
@Path("{programId}/report")
public DispoReportResource getDispoSetReport(@PathParam("programId") String programId) {
- return new DispoReportResource(dispoApi, writer, dispoFactory.createProgram(programId, Long.parseLong(programId)));
+ return new DispoReportResource(dispoApi, dispoFactory.createProgram(programId, Long.parseLong(programId)));
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoReportResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoReportResource.java
index 381e98a2a6f..24d07e44346 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoReportResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoReportResource.java
@@ -25,7 +25,6 @@ import org.eclipse.osee.disposition.model.DispoProgram;
import org.eclipse.osee.disposition.model.DispoSet;
import org.eclipse.osee.disposition.rest.DispoApi;
import org.eclipse.osee.disposition.rest.internal.report.STRSReport;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
/**
* @author Angel Avila
@@ -35,7 +34,7 @@ public class DispoReportResource {
private final DispoApi dispoApi;
private final DispoProgram program;
- public DispoReportResource(DispoApi dispoApi, DispoHtmlWriter writer, DispoProgram program) {
+ public DispoReportResource(DispoApi dispoApi, DispoProgram program) {
this.dispoApi = dispoApi;
this.program = program;
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoSetResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoSetResource.java
index b6af0095311..bc5fd36a9c6 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoSetResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoSetResource.java
@@ -28,8 +28,10 @@ import org.eclipse.osee.disposition.model.DispoSet;
import org.eclipse.osee.disposition.model.DispoSetData;
import org.eclipse.osee.disposition.model.DispoSetDescriptorData;
import org.eclipse.osee.disposition.rest.DispoApi;
-import org.eclipse.osee.disposition.rest.util.DispoHtmlWriter;
import org.eclipse.osee.disposition.rest.util.DispoUtil;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
/**
* @author Angel Avila
@@ -37,12 +39,10 @@ import org.eclipse.osee.disposition.rest.util.DispoUtil;
public class DispoSetResource {
private final DispoApi dispoApi;
- private final DispoHtmlWriter writer;
private final DispoProgram program;
- public DispoSetResource(DispoApi dispoApi, DispoHtmlWriter writer, DispoProgram program) {
+ public DispoSetResource(DispoApi dispoApi, DispoProgram program) {
this.dispoApi = dispoApi;
- this.writer = writer;
this.program = program;
}
@@ -63,8 +63,9 @@ public class DispoSetResource {
Response response;
String name = descriptor.getName();
String importPath = descriptor.getImportPath();
+ String dispoType = descriptor.getDispoType();
- if (!name.isEmpty() && !importPath.isEmpty()) {
+ if (!name.isEmpty() && !importPath.isEmpty() && !dispoType.isEmpty()) {
boolean isUniqueSetName = dispoApi.isUniqueSetName(program, name);
if (isUniqueSetName) {
String createdSetId = dispoApi.createDispoSet(program, descriptor).getGuid();
@@ -83,29 +84,6 @@ public class DispoSetResource {
}
/**
- * Get all Disposition Sets on the given program branch
- *
- * @return The Disposition Sets found on the program branch
- * @response.representation.200.doc OK, Found Disposition Sets
- * @response.representation.404.doc Not Found, Could not find any Disposition Sets
- */
- @GET
- @Produces(MediaType.TEXT_HTML)
- public Response getAllDispoSets() {
- List<DispoSet> allDispoSets = dispoApi.getDispoSets(program);
- Response.Status status;
- String html;
- if (allDispoSets.isEmpty()) {
- status = Status.NOT_FOUND;
- html = DispoMessages.Set_NoneFound;
- } else {
- status = Status.OK;
- html = writer.createSelectSet(allDispoSets);
- }
- return Response.status(status).entity(html).build();
- }
-
- /**
* Get a specific Disposition Set given a setId
*
* @param setId The Id of the Disposition Set to search for
@@ -128,23 +106,34 @@ public class DispoSetResource {
}
/**
- * Get a specific Disposition Set given a setId
+ * Get all Disposition Sets on the given program branch
*
- * @return The found Disposition Set if successful. Error Code otherwise
- * @response.representation.200.doc OK, Found Disposition Set
+ * @return The Disposition Sets found on the program branch
+ * @throws JSONException
+ * @response.representation.200.doc OK, Found Disposition Sets
* @response.representation.404.doc Not Found, Could not find any Disposition Sets
*/
- // Will go away once we implement the angular stuff
- @Path("/admin")
@GET
@Produces(MediaType.APPLICATION_JSON)
- public Response getAllDispoSetsAdmin() {
+ public Response getAllDispoSets() throws JSONException {
List<DispoSet> allDispoSets = dispoApi.getDispoSets(program);
- Response.Status status;
- String html;
- status = Status.OK;
- html = writer.createAllSetsTableHTML(allDispoSets);
- return Response.status(status).entity(html).build();
+ JSONArray jarray = new JSONArray();
+
+ for (DispoSet set : allDispoSets) {
+ JSONObject jobject = new JSONObject();
+ jobject.put("guid", set.getGuid());
+ jobject.put("name", set.getName());
+ jobject.put("importPath", set.getImportPath());
+ jobject.put("notesList", set.getNotesList());
+ jarray.put(jobject);
+ }
+ Status status;
+ if (allDispoSets.isEmpty()) {
+ status = Status.NOT_FOUND;
+ } else {
+ status = Status.OK;
+ }
+ return Response.status(status).entity(jarray.toString()).build();
}
/**
@@ -193,7 +182,6 @@ public class DispoSetResource {
@Path("{setId}/item")
public DispoItemResource getDispositionableItems(@PathParam("setId") String setId) {
- return new DispoItemResource(dispoApi, writer, program, setId);
+ return new DispoItemResource(dispoApi, program, setId);
}
-
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
index 5f64b2be527..bf32c6cf993 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.disposition.rest.util;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
import org.eclipse.osee.disposition.model.Discrepancy;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
import org.eclipse.osee.disposition.model.DispoItem;
@@ -18,6 +21,7 @@ import org.eclipse.osee.disposition.model.DispoSet;
import org.eclipse.osee.disposition.model.DispoSetData;
import org.eclipse.osee.disposition.model.LocationRange;
import org.eclipse.osee.disposition.model.Note;
+import org.eclipse.osee.disposition.rest.internal.LocationRangesCompressor;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.json.JSONArray;
import org.json.JSONException;
@@ -92,13 +96,14 @@ public final class DispoUtil {
dispoSetData.setImportPath(dispoSet.getImportPath());
dispoSetData.setNotesList(dispoSet.getNotesList());
dispoSetData.setGuid(dispoSet.getGuid());
+ dispoSetData.setDispoConfig(dispoSet.getDispoConfig());
} else {
dispoSetData = null;
}
return dispoSetData;
}
- public static DispoItemData itemArtToItemData(DispoItem dispoItemArt) {
+ public static DispoItemData itemArtToItemData(DispoItem dispoItemArt, boolean isIncludeDiscrepancies) {
DispoItemData dispoItemData = new DispoItemData();
dispoItemData.setName(dispoItemArt.getName());
dispoItemData.setGuid(dispoItemArt.getGuid());
@@ -109,11 +114,30 @@ public final class DispoUtil {
dispoItemData.setStatus(dispoItemArt.getStatus());
dispoItemData.setTotalPoints(dispoItemArt.getTotalPoints());
dispoItemData.setNeedsRerun(dispoItemArt.getNeedsRerun());
- dispoItemData.setDiscrepanciesList(dispoItemArt.getDiscrepanciesList());
- dispoItemData.setAnnotationsList(dispoItemArt.getAnnotationsList());
+ if (isIncludeDiscrepancies) {
+ dispoItemData.setDiscrepanciesList(dispoItemArt.getDiscrepanciesList());
+ }
return dispoItemData;
}
+ @SuppressWarnings("unchecked")
+ private static String discrepanciesToString(JSONObject discrepanciesList) {
+ List<Integer> discrepanciesPoints = new ArrayList<Integer>();
+ Iterator<String> iterator = discrepanciesList.keys();
+ while (iterator.hasNext()) {
+ try {
+ JSONObject jObject = discrepanciesList.getJSONObject(iterator.next());
+ int location = jObject.getInt("location");
+ discrepanciesPoints.add(location);
+ } catch (JSONException ex) {
+ throw new OseeCoreException(ex);
+ }
+ }
+
+ return LocationRangesCompressor.compress(discrepanciesPoints);
+
+ }
+
public static DispoItemData jsonObjToDispoItem(JSONObject jsonObject) {
DispoItemData dispoItem = new DispoItemData();
try {
@@ -172,11 +196,17 @@ public final class DispoUtil {
return dispoSet;
}
- public static JSONObject dispoItemToJsonObj(DispoItemData dispoItem) {
- JSONObject jsonObject = new JSONObject(dispoItem, true);
+ public static JSONObject dispoItemToJsonObj(DispoItem dispoItem) {
+ JSONObject jsonObject = new JSONObject();
try {
- jsonObject.put("annotationsList", dispoItem.getAnnotationsList());
- jsonObject.put("discrepanciesList", dispoItem.getDiscrepanciesList());
+ jsonObject.put("discrepanciesAsRanges", discrepanciesToString(dispoItem.getDiscrepanciesList()));
+ jsonObject.put("failureCount", dispoItem.getDiscrepanciesList().length());
+ jsonObject.put("name", dispoItem.getName());
+ jsonObject.put("status", dispoItem.getStatus());
+ jsonObject.put("totalPoints", dispoItem.getTotalPoints());
+ jsonObject.put("assignee", dispoItem.getAssignee());
+ jsonObject.put("needsRerun", dispoItem.getNeedsRerun());
+ jsonObject.put("guid", dispoItem.getGuid());
} catch (JSONException ex) {
throw new OseeCoreException("Error deserializing a Dispositionable Item.", ex);
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/html/dispo.html b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/html/dispo.html
deleted file mode 100644
index 65aaf9525da..00000000000
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/html/dispo.html
+++ /dev/null
@@ -1,905 +0,0 @@
-<?include path="4000000000000000 pageDeclaration.html" ?>
-
- <head>
- <style>
- <?include path="4000000000000019 dispoStyles.css"?>
- </style>
- <link rel="stylesheet" href="/lib/css/bootstrap.min.css">
- <title>Disposition Tool</title>
- </head>
-
- <body onload="getPrograms();">
- <div id="waitBlanket" style="display:none"><div id="waitText">Please Wait...</div></div>
- <div id="all">
- <div id="title">
- <h1 align="center">Disposition Tool</h1>
- </div>
- <div id="userSection">
- <div id="topSection">
- <div id="selectDiv">
- <div id="programSelectDiv">
- <p id="programSelectPrompt">Please Select ATS Version</p>
- <select class="form-control" id="programSelect" onfocus="getPrograms(this)" onchange="getProgramDetails(this)">
- <option selected disabled>Choose one</option>
- </select>
- </div>
- <div id="setSelectDiv">
- <p id="setSelectPrompt">Please Select a Set</p>
- <select class="form-control" id="setSelect" onchange="getSetTable(this)">
- <option selected disabled>Choose one</option>
- </select>
- </div>
- </div>
- </div>
- <div id="dispoSection">
- <table class="table" id="dispoTable">
- <tr>
- <th width="500" style="background-color: #969AA0">Script Name</th>
- <th width="150" style="background-color: #969AA0">
- <select class="form-control" id="statusSelect" onchange="getItemsFiltered(this)">
- <option selected="" disabled="">Status</option>
- <option>COMPLETE</option>
- <option>INCOMPLETE</option>
- <option>PASS</option>
- <option>ALL</option>
- </select></th>
- <th width="75" style="background-color: #969AA0">Total</th>
- <th width="75" style="background-color: #969AA0">Failures</th>
- <th width="400" style="background-color: #969AA0">Points</th>
- <th width="200" style="background-color: #969AA0">
- <input class="form-control" placeholder="Assignee" id="pocSelect" onchange="getPocFiltered(this)"></select></th>
- <th width="150" style="background-color: #969AA0">Version</th>
- <th width="50" style="background-color: #969AA0">Rerun?
- <input id="rerunCheckBox" class="form-control" type="checkbox" onclick="doFilter()"></th>
- </tr>
- <tbody id="dispoTableBody">
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <script>
- var userName = "";
- var programSelect = document.getElementById("programSelect");
- var setSelect = document.getElementById("setSelect");
- var path = "program/";
- var cellsToValueSubTable = ["locationRefs", "resolutionType", "resolution", "developerNotes", "customerNotes"];
- var cellsToValueMainTable = ["itemName", "status", "totalPoints", "failures", "discrepancyLocations", "POC", "version"];
- var dispoTableBody = document.getElementById("dispoTableBody");
- var dispoTable = document.getElementById("dispoTable");
- var waitBlanket = document.getElementById("waitBlanket");
- var pocSelect = document.getElementById("pocSelect");
- var statusSelect = document.getElementById("statusSelect");
- var rerunCheckBox = document.getElementById("rerunCheckBox");
- </script>
-<script>
- function toggleRerun(checkBoxEl) {
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var selectedRow = checkBoxEl.parentNode.parentNode;
- var itemId = selectedRow.id;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId);
-
- var jsonObject = {};
- jsonObject["needsRerun"] = checkBoxEl.checked;
- var params = JSON.stringify(jsonObject);
-
- put(fullPath, params, putItemStatusHandlerRerunChange, checkBoxEl);
- }
-</script>
-<script>
- function showFailures(currentCell) {
- var currentCellStyle = window.getComputedStyle(currentCell);
- var wordWrapStyle = currentCellStyle.getPropertyValue('white-space');
-
- if(wordWrapStyle == 'nowrap') {
- currentCell.style["white-space"] = "normal";
- } else {
- currentCell.style["white-space"] = "nowrap";
- }
-
- var currentCellStyle2 = window.getComputedStyle(currentCell);
- var wordWrapStyle2 = currentCellStyle2.getPropertyValue('white-space');
- }
-</script>
-<script>
- function getSetTable(setSelect) {
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/");
- get(fullPath, setTableStatusHandler, "");
- }
-</script>
-<script>
- function getPrograms() {
- if (programSelect.length < 2) {
- get(path, getAllProgramsStatusHandler, programSelect);
- }
- }
-</script>
-<script>
- function getProgramDetails(programSelect) {
- var selectedIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedIndex].value;
-
- var fullPath = path.concat(programId, "/set/");
- get(fullPath, getProgramStatusHandler, programSelect);
- }
-</script>
-<script>
- function getItemsFiltered() {
- var filterSelectedIndex = statusSelect.selectedIndex;
- var filterValue = statusSelect.options[filterSelectedIndex].value;
-
- doFilter();
- }
-</script>
-<script>
- function getPocFiltered() {
- var filterValue = pocSelect.value;
- doFilter();
- }
-</script>
-<script>
- function showAnnotations(currentRow) {
- var currentRowStatus = currentRow.cells[1].innerHTML;
- if(currentRowStatus != "PASS") {
- var currentRowIndex = currentRow.rowIndex;
- var nextRow = dispoTable.rows[currentRowIndex + 1];
-
- if (nextRow === undefined) {
- nextRow = dispoTable.insertRow(currentRowIndex + 1);
- }
- if (nextRow.className == "containerRow") {
- if (nextRow.style.display == "none") {
- nextRow.style.display = "";
- } else {
- nextRow.style.display = "none";
- }
- } else {
- var itemId = currentRow.id;
- getSubTableHTML(currentRow, itemId);
- }
- }
- }
-</script>
-<script>
- function getSubTableHTML(currentRow, itemId) {
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var itemId = currentRow.id;
- var currentRowIndex = currentRow.rowIndex;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId, "/annotation/");
-
- get(fullPath, subTableStatusHandler, currentRowIndex);
- }
-</script>
-<script>
- function changePOC(assigneeEl) {
- var cachedUserName = getCachedUserName();
- var currentRow = assigneeEl.parentNode;
- var currentAssigned = assigneeEl.innerHTML;
-
- if(currentAssigned != cachedUserName) {
- var confirmSteal;
- if(currentAssigned != "UnAssigned") {
- confirmSteal = confirm("Are you sure you want to steal this Item from user " + currentAssigned);
- } else {
- confirmSteal = true;
- }
-
- if (confirmSteal) {
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var itemId = currentRow.id;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId);
-
- var jsonObject = {};
- jsonObject["assignee"] = cachedUserName;
- var params = JSON.stringify(jsonObject);
-
- put(fullPath, params, putItemStatusHandler, currentRow);
- }
- }
- }
-</script>
-<script>
- function submitAnnotationData(selectedElement) {
- getLatestPoc(selectedElement);
- }
-</script>
-<script>
- function getLatestPoc(selectedElement) {
- var containerRow = selectedElement.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- var itemRow = dispoTable.rows[containerRow.rowIndex - 1];
-
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
- var itemId = itemRow.id;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId);
-
- get(fullPath, getLatestPocStatusHandler, selectedElement);
- }
-</script>
-<script>
- function submitAnnotationDataPostPoc(selectedElement) {
- var containerRow = selectedElement.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- var cachedUserName = getCachedUserName();
-
- var itemRow = dispoTable.rows[containerRow.rowIndex - 1];
- var pocCell = itemRow.cells[5];
- var currentAssigned = pocCell.innerHTML;
-
- if (cachedUserName == currentAssigned) {
- var selectedElementCell = selectedElement.parentNode;
- var annotationRow = selectedElementCell.parentNode;
-
- var isValidInput = true;
-
- if (selectedElementCell.cellIndex == 0) {
- var input = selectedElement.value;
- var regEx = new RegExp("^\\s*(\\d+|\\d+\\s*-\\s*\\d+)(\\s*,\\s*(\\d+|\\s*\\d+\\s*-\\s*\\d+))*\\s*$");
- isValidInput = regEx.test(input)
- }
-
- if (isValidInput) {
- if (annotationRow.id == "") {
- postAnnotation(selectedElement);
- } else {
- putAnnotation(selectedElement, annotationRow.id);
- }
- }
- } else {
- window.alert("You cannot edit this item because you're not the assignee. To assign yourself double click on the item's assignee field.");
- }
- }
-</script>
-<script>
- function getCachedUserName() {
- if (userName == "" || userName === undefined) {
- userName = getCookie("disponame");
- if(userName === undefined) {
- var nameEnter=prompt("Please enter your name","");
- if(nameEnter != null && nameEnter != "") {
- userName = nameEnter;
- addFieldToCookie("disponame", userName);
- } else {
- window.alert("Enter a Valid Name");
- getCachedUserName();
- }
- }
- }
-
- return userName;
- }
-</script>
-<script>
- function postAnnotation(selectedElement) {
- var locRef = selectedElement.value;
- var annotationJson = {
- "locationRefs": locRef
- };
-
- var params = JSON.stringify(annotationJson);
-
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var containerRow = selectedElement.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- var itemRow = dispoTable.rows[containerRow.rowIndex - 1];
- var itemId = itemRow.id;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId, "/annotation", "?userName=", userName);
-
- post(fullPath, params, postAnnotationStatusHandler, selectedElement);
- }
-</script>
-<script>
- function putAnnotation(selectedElement, annotationId) {
- var cellIndex = selectedElement.parentNode.cellIndex;
- var value = selectedElement.value;
- var key = cellsToValueSubTable[cellIndex];
-
- if(key == 'resolutionType') {
- value = value.toUpperCase();
- }
- var jsonObject = {};
- jsonObject[key] = value;
-
- var params = JSON.stringify(jsonObject);
-
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var containerRow = selectedElement.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- var itemRow = dispoTable.rows[containerRow.rowIndex - 1];
- var itemId = itemRow.id;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId, "/annotation/", annotationId, "?userName=", userName);
-
- put(fullPath, params, putAnnotationStatusHandler, selectedElement);
- }
-</script>
-<script>
- function deleteAnnotation(button) {
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var containerRow = button.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- var itemRow = dispoTable.rows[containerRow.rowIndex - 1];
- var itemId = itemRow.id;
-
- var annotationId = button.parentNode.parentNode.id;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId, "/annotation/", annotationId, "?userName=", userName);
- doDelete(fullPath, delAnnotationStatusHandler, button);
- }
-</script>
-<script>
- function getAnnotation(annotationRow) {
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var containerRow = annotationRow.parentNode.parentNode.parentNode.parentNode;
- var itemRow = dispoTable.rows[containerRow.rowIndex - 1];
- var itemId = itemRow.id;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId, "/annotation/", annotationRow.id);
- get(fullPath, getAnnotationStatuHandler, annotationRow);
- }
-</script>
-<script>
- function getItemStatus(itemRow) {
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var selectedSetIndex = setSelect.selectedIndex;
- var setId = setSelect.options[selectedSetIndex].value;
-
- var itemId = itemRow.id;
-
- var fullPath = path.concat(programId, "/set/", setId, "/item/", itemId);
- get(fullPath, getItemStatusHandler, itemRow);
- }
-</script>
-<script>
- function getAllProgramsStatusHandler(programSelectEl) {
- return function() {
- if (this.readyState == 4 && this.status == 200) {
- var responseHTML = this.responseText;
- programSelect.innerHTML = responseHTML;
- }
- };
- }
-</script>
-<script>
- function getProgramStatusHandler(setSelectEl) {
- return function() {
- if (this.readyState == 4 && this.status == 200) {
- var responseHTML = this.responseText;
- setSelect.innerHTML = responseHTML;
- }
- };
- }
-</script>
-<script>
- function putItemStatusHandler(currentRow) {
- return function() {
- if (this.readyState == 4 && this.status == 200) {
- currentRow.cells[5].innerHTML = userName;
- }
- };
- }
-</script>
-<script>
- function putItemStatusHandlerRerunChange(checkBox) {
- return function() {
- if (this.readyState == 4 && this.status == 200) {
- } else {
- checkBox.checked = !checkBox.checked;
- }
- };
- }
-</script>
-<script>
- function setTableStatusHandler(unusedParam) {
- return function() {
- if (this.readyState == 1) {
- waitBlanket.style.display = 'block';
- }
- if (this.readyState == 3) {
- //var responseHTML = this.responseText;
- //dispoTableBody.innerHTML = responseHTML;
- }
- if (this.readyState == 4 && this.status == 200) {
- waitBlanket.style.display = 'none';
- var responseHTML = this.responseText;
- dispoTableBody.innerHTML = responseHTML;
- } else if (this.status == 404) {
- dispoTableBody.innerHTML = "NO ITEMS FOUND FOR THIS SET";
- }
- };
- }
-</script>
-<script>
- function subTableStatusHandler(currentRowIndex) {
- return function() {
- if (this.readyState == 4 && this.status == 200) {
- var responseHTML = this.responseText;
- addContainerRow(currentRowIndex, responseHTML);
- }
- };
- }
-</script>
-<script>
- function getItemStatusHandler(itemRow) {
- return function() {
- if (this.readyState == 4 && this.status == 200) {
- var itemObject = eval('(' + this.responseText + ')');
-
- var statusCell = itemRow.cells[1];
-
- statusCell.innerHTML = itemObject.status;
-
- if (itemObject.status == "COMPLETE") {
- statusCell.className = "itemData";
- } else {
- statusCell.className = "itemDataFail";
- }
- }
- };
- }
-</script>
-<script>
- function getAnnotationStatuHandler(annotationRow) {
- return function() {
- if (this.readyState == 4 && this.status == 200) {
- var annotationObject = eval('(' + this.responseText + ')');
-
- if (!annotationObject.isConnected) {
- annotationRow.cells[0].firstChild.className = "annotationInputInvalid";
- } else {
- annotationRow.cells[0].firstChild.className = "annotationInput";
- }
- if (!annotationObject.isResolutionValid) {
- annotationRow.cells[1].firstChild.className = "annotationInputInvalid";
- annotationRow.cells[2].firstChild.className = "annotationInputInvalid";
- } else {
- annotationRow.cells[1].firstChild.className = "annotationInput";
- annotationRow.cells[2].firstChild.className = "annotationInput";
- }
- if (annotationObject.resolutionType == "None") {
- annotationRow.cells[1].firstChild.className = "annotationInputInvalid";
- } else {
- annotationRow.cells[1].firstChild.className = "annotationInput";
- }
- }
- }
- }
-</script>
-<script>
- function postAnnotationStatusHandler(annotationCell) {
- return function() {
- if(this.readyState == 4) {
- if(this.status == 201) {
- var annotationRow = annotationCell.parentNode.parentNode;
- enableRow(annotationRow);
- var annotationObject = eval('(' + this.responseText + ')');
-
- annotationRow.id = annotationObject.id;
-
- if (!annotationObject.isConnected) {
- annotationCell.className = "annotationInputInvalid";
- }
- addNewRow(annotationRow);
-
- var containerRow = annotationRow.parentNode.parentNode.parentNode.parentNode;
- var containerRowIndex = containerRow.rowIndex;
- var itemRow = dispoTableBody.rows[containerRowIndex - 2];
- getItemStatus(itemRow);
- } else if(this.status == 304) {
- window.alert("Your entry did not go through, please try refreshing the page. Someone else might be editing this Item.");
- } else {
- window.alert("Oops something went wrong. Please refresh your page.");
- }
- }
- };
- }
-</script>
-<script>
- function putAnnotationStatusHandler(annotationCell) {
- return function() {
- if(this.readyState == 4) {
- if(this.status == 200) {
- var containerRow = annotationCell.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- var containerRowIndex = containerRow.rowIndex;
- var itemRow = dispoTableBody.rows[containerRowIndex - 2];
-
- getItemStatus(itemRow);
- getAnnotation(annotationCell.parentNode.parentNode);
-
- } else if(this.status == 304) {
- window.alert("Your entry did not go through, please try refreshing the page. Someone else might be editing this Item.");
- } else {
- window.alert("Oops something went wrong. Please refresh your page.");
- }
- }
- };
- }
-</script>
-<script>
- function delAnnotationStatusHandler(buttonEl) {
- return function() {
- if(this.readyState == 4) {
- if(this.status == 200) {
- var rowToDelete = buttonEl.parentNode.parentNode;
- var rowToDeleteIndex = rowToDelete.rowIndex;
- var subTable = rowToDelete.parentNode.parentNode;
- subTable.deleteRow(rowToDeleteIndex);
-
- var containerRow = subTable.parentNode.parentNode;
- var containerRowIndex = containerRow.rowIndex;
- var itemRow = dispoTableBody.rows[containerRowIndex - 2];
-
- if (this.responseText == "COMPLETE") {
- itemRow.cells[1].className = "itemData";
- } else {
- itemRow.cells[1].className = "itemDataFail";
- }
- itemRow.cells[1].innerHTML = this.responseText;
- } else if(this.status == 304) {
- window.alert("Your entry did not go through, please try refreshing the page. Someone else might be editing this Item.");
- } else {
- window.alert("Oops something went wrong. Please refresh your page.");
- }
- }
- };
- }
-</script>
-<script>
- function getLatestPocStatusHandler(selectedElement) {
- return function() {
- if (this.readyState == 4 && this.status == 200) {
- var itemObject = eval('(' + this.responseText + ')');
- var containerRow = selectedElement.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- var itemRow = dispoTable.rows[containerRow.rowIndex - 1];
- itemRow.cells[5].innerHTML = itemObject.assignee;
- submitAnnotationDataPostPoc(selectedElement);
- }
- }
- }
-</script>
-<script>
- function addContainerRow(currentRowIndex, htmlToAdd) {
- var newRow = dispoTable.insertRow(currentRowIndex + 1);
- newRow.className = "containerRow";
- newRow.innerHTML = htmlToAdd;
- }
-</script>
-<script>
- function annotationDblClick(annotationInput) {
- var currentClass = annotationInput.className;
- var appendDetails = false;
-
- var searchResult = currentClass.search("Details");
-
- if(searchResult < 0) {
- appendDetails = true;
- }
-
- changeClassForRow(annotationInput.parentNode.parentNode, appendDetails);
- }
-</script>
-<script>
- function changeClassForRow(rowEl, appendDetails) {
- var cells = rowEl.cells;
- var cellsLength = cells.length;
- for (index = 0; index < cellsLength - 1; index++) {
- var currentEl = cells[index].firstChild;
- cells[index].firstChild.className = getNewClass(currentEl, appendDetails);
- }
- }
-</script>
-<script>
- function getNewClass(element, appendDetails) {
- var currentClass = element.className;
- if(appendDetails) {
- toReturn = currentClass + "Details";
- } else {
- toReturn = currentClass.replace("Details", "");
- }
- return toReturn;
- }
-</script>
-<script>
- function addDeleteButton(newRow, cellsLength) {
- var deleteCell = newRow.insertCell(cellsLength - 1);
- var newButton = document.createElement("button");
- deleteCell.appendChild(newButton);
- newButton.className = "annotationDelete";
- newButton.disabled = true;
- newButton.innerHTML = "X";
- newButton.setAttribute('onclick', 'deleteAnnotation(this)');
- }
-</script>
-<script>
- function addAnnotationCell(rowElement, index) {
- var newCell = rowElement.insertCell(index);
- newCell.className = "annotationData";
- var newTextArea = document.createElement("textarea");
- newCell.appendChild(newTextArea);
- if (index != 0) {
- newTextArea.readOnly = true;
- newTextArea.className = "annotationInputDisabled";
-
- } else {
- newTextArea.className = "annotationInput";
- }
-
- newTextArea.setAttribute('ondblclick', 'annotationDblClick(this);');
- newTextArea.setAttribute('onchange', 'submitAnnotationData(this);');
- }
-</script>
-<script>
- function addAnnotationCellSelect(rowElement, index) {
- var newCell = rowElement.insertCell(index);
- newCell.className = "annotationData";
- var newSelect = document.createElement("select");
- newCell.appendChild(newSelect);
-
- newSelect.disabled = true;
- newSelect.className = "annotationInputDisabled";
-
- optionText = "None";
- addOptionToSelect(newSelect, optionText, "None", true);
-
- var optionText = "Code";
- addOptionToSelect(newSelect, optionText, optionText, false);
-
- optionText = "Test";
- addOptionToSelect(newSelect, optionText, optionText, false);
-
- optionText = "Requirement";
- addOptionToSelect(newSelect, optionText, optionText, false);
-
- optionText = "Other";
- addOptionToSelect(newSelect, optionText, optionText, false);
-
- optionText = "Undetermined";
- addOptionToSelect(newSelect, optionText, optionText, false);
-
- newSelect.setAttribute('onchange', 'submitAnnotationData(this);');
-
- newSelect.focus();
- }
-</script>
-<script>
- function addOptionToSelect(selectEl, optionText, optionValue, isDefault) {
- var newOption = document.createElement("option");
- newOption.text = optionText;
- newOption.value = optionValue;
- if(isDefault) {
- newOption.selected = true;
- }
- selectEl.add(newOption);
- }
-</script>
-<script>
- function addNewRow(currentRow) {
- var subTable = currentRow.parentNode.parentNode;
- var newRow = subTable.insertRow(currentRow.rowIndex + 1);
-
- // increase rowSpan for spacer
- var spacerCol = subTable.rows[0].cells[0];
- spacerCol.rowSpan = spacerCol.rowSpan + 1;
-
- var cellsLength = currentRow.cells.length;
- for (index = 0; index < cellsLength - 1; index++) {
- if(index != 1) { //
- addAnnotationCell(newRow, index);
- } else {
- addAnnotationCellSelect(newRow, index);
- }
- }
-
- addDeleteButton(newRow, cellsLength);
- }
-</script>
-<script>
- function enableRow(row) {
- var annotationCells = row.cells;
- var cellsLength = annotationCells.length;
- for (index = 0; index < cellsLength - 1; index++) {
- var inputEl = annotationCells[index].firstChild;
- inputEl.readOnly = false;
- if(index == 1) { // if it's the Type element enable and set to focus
- inputEl.disabled = false;
- inputEl.focus();
- }
- inputEl.className = "annotationInput";
- }
- annotationCells[cellsLength - 1].firstChild.disabled = false; // enable Delete Button
- }
-</script>
-<script>
- function get(url, statusHandler, callbackParam) {
- httpRequest("GET", url, statusHandler, callbackParam);
- }
-</script>
-<script>
- function post(url, params, statusHandler, callbackParam) {
- httpRequestWithParams("POST", url, params, statusHandler, callbackParam);
- }
-</script>
-<script>
- function put(url, params, statusHandler, callbackParam) {
- httpRequestWithParams("PUT", url, params, statusHandler, callbackParam);
- }
-</script>
-<script>
- function doDelete(url, statusHandler, callbackParam) {
- httpRequest("DELETE", url, statusHandler, callbackParam);
- }
-</script>
-<script>
- function httpRequestWithParams(httpVerb, url, params, statusHandler, callbackParam) {
- var httpRequest = new XMLHttpRequest()
- httpRequest.prevDataLength = 0;
- httpRequest.onreadystatechange = statusHandler(callbackParam);
- httpRequest.open(httpVerb, url);
- //Send the proper header information along with the request
- httpRequest.setRequestHeader("Content-type", "application/json");
-
- httpRequest.send(params);
- }
-</script>
-<script>
- function httpRequest(httpVerb, url, statusHandler, callbackParam) {
- var httpRequest = new XMLHttpRequest()
- httpRequest.prevDataLength = 0;
- httpRequest.onreadystatechange = statusHandler(callbackParam);
- httpRequest.open(httpVerb, url);
- httpRequest.send();
- }
- </script>
-
-
- <script>
- function getValueByKeyFromCookie(key, cookie) {
- var i;
- var cookiesArray = document.cookie.split(";");
- for(i = 0; i < cookiesArray.length; i++) {
- var k =cookiesArray[i].substr(0,cookiesArray[i].indexOf("="));
- if(k = key) {
-
- }
- }
- return valueString =cookie.substr(cookie.indexOf("=")+1);
- }
- </script>
-
-
- <script>
- function getCookies() {
- var c = document.cookie, v = 0, cookies = {};
- if (document.cookie.match(/^\s*\$Version=(?:"1"|1);\s*(.*)/)) {
- c = RegExp.$1;
- v = 1;
- }
- if (v === 0) {
- c.split(/[,;]/).map(function(cookie) {
- var parts = cookie.split(/=/, 2),
- name = decodeURIComponent(parts[0].trimLeft()),
- value = parts.length > 1 ? decodeURIComponent(parts[1].trimRight()) : null;
- cookies[name] = value;
- });
- } else {
- c.match(/(?:^|\s+)([!#$%&'*+\-.0-9A-Z^`a-z|~]+)=([!#$%&'*+\-.0-9A-Z^`a-z|~]*|"(?:[\x20-\x7E\x80\xFF]|\\[\x00-\x7F])*")(?=\s*[,;]|$)/g).map(function($0, $1) {
- var name = $0,
- value = $1.charAt(0) === '"'
- ? $1.substr(1, -1).replace(/\\(.)/g, "$1")
- : $1;
- cookies[name] = value;
- });
- }
- return cookies;
- }
- </script>
- <script>
- function getCookie(name) {
- return getCookies()[name];
- }
- </script>
-
- <script>
- function addFieldToCookie(key, value) {
- var newField = key + "=" + value;
- document.cookie = newField;
-
- var newCookies = document.cookie;
- var c;
- }
-</script>
-<script>
- function getRerunFiltered(checkBox) {
-
- }
-</script>
-<script>
- function doFilter() {
- var filterSelectedIndex = statusSelect.selectedIndex;
- var statusFilter = statusSelect.options[filterSelectedIndex].value;
- var pocFilter = pocSelect.value;
- var rerunFilter = rerunCheckBox.checked;
-
- var rows = dispoTableBody.rows;
-
- var rowsLength = rows.length;
- var i = 0;
- while (i < rowsLength) {
- var row = rows[i];
- // hide row and possibly container row
- var statusFilterShow = (statusFilter == "ALL" || statusFilter == "Status" || statusFilter == row.cells[1].innerHTML);
- var pocFilterShow = (pocFilter == "" || pocFilter == row.cells[5].innerHTML);
- var rerunFilterShow = !rerunFilter || row.cells[7].firstChild.checked;
- if (statusFilterShow && pocFilterShow && rerunFilterShow) {
- row.style.display = "";
-
- i++;
- if (i < rowsLength) {
- var nextRow = rows[i];
- if (nextRow.className == "containerRow") {
- //nextRow.style.display = "";
- i++;
- }
- }
- } else {
- row.style.display = "none";
-
- i++;
- if (i < rowsLength) {
- var nextRow = rows[i];
- if (nextRow.className == "containerRow") {
- nextRow.style.display = "none";
- i++;
- }
- }
- }
- }
- }
-</script>
- </body> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/html/dispoAdmin.html b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/html/dispoAdmin.html
deleted file mode 100644
index 923fad48ddd..00000000000
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/html/dispoAdmin.html
+++ /dev/null
@@ -1,580 +0,0 @@
- <?include path="4000000000000000 pageDeclaration.html" ?>
-
- <head>
- <style>
- <?include path="4000000000000029 dispoAdminStyles.css"?>
- </style>
- <link rel="stylesheet" href="/lib/css/bootstrap.min.css">
- <title>Disposition Tool: Admin</title>
- </head>
-
-<body onload="getPrograms();">
- <div id="blanket" style="display:none"></div>
- <div id="waitBlanket" style="display:none"><div id="waitText">Please Wait...</div></div>
- <div id="setCreateDiv" style="display:none;"><h3 id="promptTitle" align="center"><h3>
- <input class="form-control" id="setNameInput" placeholder="Set Name" type="text" value=""><br>
- <input class="form-control" id="setPathInput" placeholder="Import Path" type="text" value=""><br>
- <button class="form-control" id="namePromptSubmit" value="Submit">Submit</button>
- <button class="form-control" id="cancelCreateSet" value="Cancel" onclick="namePromptClose();">Cancel</button>
- </div>
- <div id="all">
- <div id="title">
- <h1 align="center">Disposition Tool: Admin</h1>
- </div>
- <div id="userInput">
- <div id="programSelectDiv">
- <p>Select ATS Version</p>
- <select class="form-control" id="programSelect" onchange="getProgramDetails(this);">
- <option selected disabled>Choose one</option>
- </select>
- </div>
- <div id="setControls">
- <div id="topHalfSetControls">
- <div id="setOperationContainer">
- <button class="form-control" id="setOperation" onclick="doImport()">Import</button>
- <button class="form-control" id="rename" onclick="getSetForUpdate()">Rename/Update Path</button>
- <button class="form-control" id="delete" onclick="doSetDelete()">Delete Set</button>
- </div>
- <div id="setManageContainer">
- <div id="createSetContainer">
- <button class="form-control" disabled="true" id="setCreate" onclick="bringUpNamePromptCreate();">Create New Set</button>
- </div>
- <div id="setsTableContainer">
- <table class="table emptySetsTable" id="setsTable">
- <tbody>
- <tr id="headerRow">
- <th>Name</th>
- <th>Summary</th>
- </tr>
- </tbody>
- <tbody id="setsTableBody">
- <tr>
- <td class="setsTableData"></td>
- <td class="setsTableData"></td>
- </tr>
- <tr>
- <td class="setsTableData"></td>
- <td class="setsTableData"></td>
- </tr>
- <tr>
- <td class="setsTableData"></td>
- <td class="setsTableData"></td>
- </tr>
- <tr>
- <td class="setsTableData"></td>
- <td class="setsTableData"></td>
- </tr>
- <tr>
- <td class="setsTableData"></td>
- <td class="setsTableData"></td>
- </tr>
- <tr>
- <td class="setsTableData"></td>
- <td class="setsTableData"></td>
- </tr>
- <tr>
- <td class="setsTableData"></td>
- <td class="setsTableData"></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div id="reportDiv">
- <div id="generateReportDiv">
- <button class="form-control" id="generateReport" onclick="generateReport()">Generate Report</button>
- </div>
- <div id="reportSupportDiv">
- <p>Select Primary Set (Demo)</p>
- <select class="form-control" id="setSelectPrimary">
- <option selected disabled>Choose one</option>
- </select>
- <p>Select Secondary Set (Dry Run)</p>
- <select class="form-control" id="setSelectSecondary">
- <option selected disabled>Choose one</option>
- </select>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- var namePromptSumbit = document.getElementById("namePromptSubmit");
- var programSelect = document.getElementById("programSelect");
- var setSelectPrimary = document.getElementById("setSelectPrimary");
- var setSelectSecondary = document.getElementById("setSelectSecondary");
- var createSetDiv = document.getElementById("setCreateDiv");
- var waitBlanket = document.getElementById("waitBlanket");
- var lastFocusedSet = "";
- var path = "program/";
- </script>
- <script>
- function setFocused(element) {
- if(lastFocusedSet == "") {
- lastFocusedSet = element;
- } else {
- lastFocusedSet.className = "setsTableDataInput";
- lastFocusedSet = element;
- }
- lastFocusedSet.className = "setsTableDataInputFocused";
- }
- </script>
- <script>
- function doImport() {
- var lastFocusedRow = lastFocusedSet.parentNode.parentNode;
- var setToImportId = lastFocusedRow.id;
-
- if(setToImportId != "") {
- var operationKey = "operation";
-
- var jsonObject = {};
- jsonObject[operationKey] = "Import";
-
- var jsonStringParam = JSON.stringify(jsonObject);
-
- var programSelect = document.getElementById("programSelect");
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var fullPath = path.concat(programId, "/set/", setToImportId);
-
- put(fullPath, jsonStringParam, putSetStatusHandler, lastFocusedRow);
- }
- }
- </script>
- <script>
- function doReport() {
- var programSelect = document.getElementById("programSelect");
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
- var fullPath = path.concat(programId, "/report/");
- post(fullPath, "", postReportStatusHandler, "");
- }
- </script>
- <script>
- function doSetDelete() {
- var lastFocusedRow = lastFocusedSet.parentNode.parentNode;
- var setToImportId = lastFocusedRow.id;
-
- if(setToImportId != "") {
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var fullPath = path.concat(programId, "/set/", setToImportId);
-
- doDelete(fullPath, deleteSetStatusHandler, lastFocusedRow);
- }
- }
- </script>
- <script>
- function getPrograms() {
- if (programSelect.length < 2) {
- get(path, getAllProgramsStatusHandler, programSelect);
- }
- }
- </script>
- <script>
- function getProgramDetails(programSelect) {
- var selectedIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedIndex].value;
-
- var fullPath = path.concat(programId, "/set/admin");
- get(fullPath, getProgramAdminStatusHandler, programSelect);
- }
- </script>
- <script>
- function populateReportSetSelects() {
- var selectedIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedIndex].value;
-
- var fullPath = path.concat(programId, "/set/");
- get(fullPath, populateSetSelectsStatusHandler, "");
- }
- </script>
- <script>
- function namePromptClose() {
- var blanketEl = document.getElementById("blanket");
- blanketEl.removeChild(createSetDiv);
- blanketEl.style.display = 'none';
- createSetDiv.style.display = 'none';
- }
- </script>
- <script>
- function bringUpNamePromptCreate() {
- var blanketEl = document.getElementById("blanket");
- blanketEl.appendChild(createSetDiv);
- blanketEl.style.display = 'block';
- createSetDiv.style.display = 'block';
-
- var setName = document.getElementById("setNameInput");
- var setPath = document.getElementById("setPathInput");
-
- namePromptSumbit.setAttribute('onclick', 'setCreateSubmit()');
-
- var promptTitle = document.getElementById("promptTitle");
- promptTitle.innerHTML = "Create Set";
- setName.value = "";
- setPath.value = "";
- }
- </script>
- <script>
- function getSetForUpdate() {
- var lastFocusedRow = lastFocusedSet.parentNode.parentNode;
- var setId = lastFocusedRow.id;
-
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var fullPath = path.concat(programId, "/set/", setId);
-
- get(fullPath, getSetStatusHandlerForUpdate, lastFocusedRow);
- }
- </script>
- <script>
- function generateReport() {
- var setSelectPrimaryIndex = setSelectPrimary.selectedIndex;
- var setSelectPrimaryId = setSelectPrimary.options[setSelectPrimaryIndex].value;
-
- var setSelectSecondaryIndex = setSelectSecondary.selectedIndex;
- var setSelectSecondaryId = setSelectSecondary.options[setSelectSecondaryIndex].value;
-
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var fullPath = path.concat(programId, "/report?primarySet=", setSelectPrimaryId, "&secondarySet=", setSelectSecondaryId);
- window.location.href = fullPath;
- }
- </script>
- <script>
- function bringUpNamePromptUpdate(setName, setPath, setRow) {
- var blanketEl = document.getElementById("blanket");
- blanketEl.appendChild(createSetDiv);
- blanketEl.style.display = 'block';
- createSetDiv.style.display = 'block';
-
- var setNameInput = document.getElementById("setNameInput");
- var setPathInput = document.getElementById("setPathInput");
-
- var promptTitle = document.getElementById("promptTitle");
- promptTitle.innerHTML = "Edit Set";
- setNameInput.value = setName;
- setPathInput.value = setPath;
-
- namePromptSumbit.onclick = (function() {
- var setRowParam = setRow;
- var oldNameParam = setName;
- var oldPathParam = setPath;
- return function() {
- setUpdateSubmit(oldNameParam, oldPathParam, setRowParam);
- }
- })();
- }
- </script>
- <script>
- function setUpdateSubmit(oldName, oldPath, setRow) {
- var setName = document.getElementById("setNameInput").value;
- var setPath = document.getElementById("setPathInput").value;
-
- if(oldName == setName && oldPath == setPath) {
- // do nothing
- }
- else {
- namePromptClose();
- var nameKey = "name";
- var pathKey = "importPath";
-
- var jsonObject = {};
- if(oldName != setName) {
- jsonObject[nameKey] = setName;
- }
- if(oldPath != setPath) {
- jsonObject[pathKey] = setPath;
- }
-
- var jsonStringParam = JSON.stringify(jsonObject);
-
- var programSelect = document.getElementById("programSelect");
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var fullPath = path.concat(programId, "/set/", setRow.id);
-
- put(fullPath, jsonStringParam, putSetStatusHandler, setRow);
- }
- }
- </script>
- <script>
- function setCreateSubmit() {
- var setName = document.getElementById("setNameInput").value;
- var setPath = document.getElementById("setPathInput").value;
-
- if(setName == "" || setPath == "") {
- // do nothing
- }
- else {
- namePromptClose();
- var nameKey = "name";
- var pathKey = "importPath";
-
- var jsonObject = {};
- jsonObject[nameKey] = setName;
- jsonObject[pathKey] = setPath;
-
- var jsonStringParam = JSON.stringify(jsonObject);
-
- var programSelect = document.getElementById("programSelect");
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var fullPath = path.concat(programId, "/set/");
-
- post(fullPath, jsonStringParam, postSetStatusHandler, "");
- }
- }
- </script>
- <script>
- function getProgramAdminStatusHandler(setSelectEl) {
- return function() {
- if(this.readyState == 1) {
- waitBlanket.style.display = 'block';
- }
- if (this.readyState == 4) {
- waitBlanket.style.display = 'none';
-
- var responseHTML = this.responseText;
- var setsTableBody = document.getElementById("setsTableBody");
- setsTableBody.innerHTML = responseHTML;
-
- // check to see if there are any sets, if so change the class from emptySetsTable
- var setsTable = document.getElementById("setsTable");
- if(setsTableBody.rows[0].id != "") {
- setsTable.className = "setsTable";
- } else {
- setsTable.className = "emptySetsTable";
- }
-
- // Enable create set and import buttons
- var setCreateButton = document.getElementById("setCreate");
- setCreateButton.disabled=false;
- var setOperationButton = document.getElementById("setOperation");
- setOperationButton.disabled=false;
-
- populateReportSetSelects();
- }
- };
- }
- </script>
- <script>
- function postSetStatusHandler(noParam) {
- return function() {
- if(this.readyState == 1) {
- waitBlanket.style.display = 'block';
- }
- if (this.readyState == 4) {
- waitBlanket.style.display = 'none';
-
- var setsTable = document.getElementById("setsTable");
- setsTable.className = "setsTable";
-
-
- var setObject = eval('(' + this.responseText + ')');
-
- var rows = setsTable.rows;
- var index = 1;
- var nextFreeRow = -1;
- while(index < rows.length && nextFreeRow == -1) {
- var cell = rows[index].cells[0];
- if(cell.innerHTML == "") {
- nextFreeRow = index;
- }
- index++;
- }
-
- if(nextFreeRow == -1) {
- var newRow = setsTable.insertRow(rows.length);
- newRow.id = setObject.guid;
- var nameCell = newRow.insertCell(0);
- var summaryCell = newRow.insertCell(1);
-
- var nameInput = document.createElement("input");
- nameInput.className = "setsTableDataInput";
- nameInput.value = setObject.name;
- nameInput.setAttribute('onclick', 'setFocused(this)');
- nameCell.appendChild(nameInput);
- nameCell.className = "setsTableData";
-
- summaryCell.innerHTML = "No Import"; // change to summary field
- summaryCell.className = "setsTableData";
-
- setFocused(nameInput);
-
- } else {
- var nameInput = document.createElement("input");
- nameInput.value = setObject.name;
- nameInput.className = "setsTableDataInput";
- nameInput.setAttribute('onclick', 'setFocused(this)');
- rows[nextFreeRow].cells[0].appendChild(nameInput);
- rows[nextFreeRow].cells[1].innerHTML = "No Import";
- rows[nextFreeRow].id = setObject.guid;
- setFocused(nameInput);
- }
- }
- };
- }
- </script>
- <script>
- function postReportStatusHandler(unusedParam) {
- return function() {
-
- }
- }
- </script>
- <script>
- function putSetStatusHandler(setRow) {
- return function() {
- var selectedInput = setRow.cells[0].firstChild;
- if(this.readyState == 1) {
- selectedInput.className = "setsTableDataInputImporting";
- selectedInput.setAttribute('onclick', '');
- setRow.cells[1].innerHTML = "...WORKING...";
- }
- if(this.readyState == 4) {
- selectedInput.className = "setsTableDataInput";
- selectedInput.setAttribute('onclick', 'setFocused(this)');
- getSet(setRow);
- }
- if(this.readyState == 4 && this.status != 200) {
- setRow.cells[1].innerHTML = "Error Importing.";
- }
- };
- }
- </script>
- <script>
- function getSet(setRow) {
- var programSelect = document.getElementById("programSelect");
- var selectedProgramIndex = programSelect.selectedIndex;
- var programId = programSelect.options[selectedProgramIndex].value;
-
- var fullPath = path.concat(programId, "/set/", setRow.id);
-
- get(fullPath, getSetStatusHandler, setRow);
- }
- </script>
-
- <script>
- function getSetStatusHandler(setRow) {
- return function() {
- if (this.readyState == 4 && this.status==200) {
- var setObject = eval('(' + this.responseText + ')');
- setRow.cells[0].firstChild.value = setObject.name;
- setRow.cells[1].innerHTML = "No Summary Available";
- }
- };
- }
- </script>
- <script>
- function populateSetSelectsStatusHandler(emptyParam) {
- return function() {
- if (this.readyState == 4) {
- var responseHTML = this.responseText;
- setSelectPrimary.innerHTML = responseHTML;
- setSelectSecondary.innerHTML = responseHTML;
- }
- }
- }
- </script>
- <script>
- function getSetStatusHandlerForUpdate(setRow) {
- return function() {
- if (this.readyState == 4 && this.status==200) {
- var setObject = eval('(' + this.responseText + ')');
-
- bringUpNamePromptUpdate(setObject.name, setObject.importPath, setRow);
- }
- };
- }
- </script>
- <script>
- function getAllProgramsStatusHandler(unusedParam) {
- return function() {
- if (this.readyState == 4) {
- var responseHTML = this.responseText;
- programSelect.innerHTML = responseHTML;
- }
- };
- }
- </script>
- <script>
- function deleteSetStatusHandler(deletedRow) {
- return function() {
- if (this.readyState == 4) {
- var rowIndex = deletedRow.sectionRowIndex;
- var setsTableBody = document.getElementById("setsTableBody");
- setsTableBody.deleteRow(rowIndex);
-
- var rowsCount = setsTableBody.rows.length;
- if(rowsCount < 7) {
- var newRow = setsTableBody.insertRow(rowsCount-1);
- var newCell1 = newRow.insertCell(0);
- var newCell2 = newRow.insertCell(1);
-
- newCell1.className = "setsTableData";
- newCell2.className = "setsTableData";
- }
- }
- };
- }
- </script>
- <script>
- function getGenerateReportStatusHandler(unusedParam) {
- return function() {
- if (this.readyState == 4) {
- window.location.href = this.responseXML.URL;
- }
- }
- }
- </script>
- <script>
- function put(url, params, statusHandler, callbackParam) {
- httpRequestWithParams("PUT", url, params, statusHandler, callbackParam);
- }
- </script>
- <script>
- function get(url, statusHandler, callbackParam) {
- httpRequest("GET", url, statusHandler, callbackParam);
- }
- </script>
- <script>
- function post(url, params, statusHandler, callbackParam) {
- httpRequestWithParams("POST", url, params, statusHandler, callbackParam);
- }
- </script>
- <script>
- function doDelete(url, statusHandler, callbackParam) {
- httpRequest("DELETE", url, statusHandler, callbackParam);
- }
- </script>
- <script>
- function httpRequestWithParams(httpVerb, url, params, statusHandler, callbackParam) {
- var httpRequest = new XMLHttpRequest()
- httpRequest.prevDataLength = 0;
- httpRequest.onreadystatechange = statusHandler(callbackParam);
- httpRequest.open(httpVerb, url);
- //Send the proper header information along with the request
- httpRequest.setRequestHeader("Content-type", "application/json");
-
- httpRequest.send(params);
- }
- </script>
- <script>
- function httpRequest(httpVerb, url, statusHandler, callbackParam) {
- var httpRequest = new XMLHttpRequest()
- httpRequest.prevDataLength = 0;
- httpRequest.onreadystatechange = statusHandler(callbackParam);
- httpRequest.open(httpVerb, url);
- httpRequest.send();
- }
- </script>
-
- </body>
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/admin.html b/plugins/org.eclipse.osee.disposition.rest/web/admin.html
new file mode 100644
index 00000000000..0132448c9c2
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/admin.html
@@ -0,0 +1,71 @@
+<!doctype html>
+<html>
+
+<head>
+
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+
+ <title>Dispo Admin</title>
+</head>
+
+<body>
+
+ <div class="row">
+ <div class="span4 offset2">
+ <div class="row">
+ <h5>Select ATS Version</h5>
+ <select class="form-control" ng-model="programSelection" ng-change="updateProgram()" ng-options="obj.value as obj.text for obj in programs"></select>
+ </div>
+ <div class="row" id=reportRow>
+ <div class="span3 offset1" id=reportContainer>
+ <h3>STRS Report</h3>
+ <h5>Select Primary Set (Demo Set)</h5>
+ <select class="form-control" ng-model="primarySet" ng-options="obj.guid as obj.name for obj in sets"></select>
+ <h5>Select Secondary Set (Dryrun Set)</h5>
+ <select class="form-control" ng-model="secondarySet" ng-options="obj.guid as obj.name for obj in sets"></select>
+ <button ng-click="generateReport()" class="btn btn-primary active" id=generateReportBtn>Generate Report</button>
+ </div>
+ </div>
+ </div>
+ <div class="span7 offset1">
+ <div class="row">
+ <button ng-disabled="programSelection == null" ng-click="createNewSetModal()" class="btn pull-left">New</button>
+ <button ng-disabled="programSelection == null" ng-click="toggleReadOnly()" class="btn pull-right">Edit</button>
+ </div>
+ <div class="row">
+ <div style="height: 600px;" class="gridStyle" ng-grid="gridOptions"></div>
+ </div>
+ </div>
+ </div>
+
+ <!-- definitions for modal forms -->
+ <script type="text/ng-template" id="popup.html">
+ <div class="modal-header">
+ <h3 class="modal-title">Create Set</h3>
+ </div>
+ <div class="modal-body" style="height: 300px; overflow: auto;">
+ <div class="form-group">
+ <label for="setNameInput">Set Name</label>
+ <input ng-model="setName" class="form-control" name="setName" placeholder="Enter Set Name" required>
+ </div>
+ <div class="form-group">
+ <label for="setPathInput">Path</label>
+ <input ng-model="importPath" class="form-control" name="setPath" placeholder="Enter Import Path" required>
+ </div>
+ <div class="btn-group" data-toggle="buttons">
+ <label class="btn btn-primary active">
+ <input ng-model="dispoType" type="radio" name="Test Scripts" id="option1" value="testScripts" checked>Test Scripts Dispo
+ </label>
+ </div>
+ </div>
+
+ <div class="modal-footer">
+ <button class="btn btn-primary" ng-click="ok()">OK</button>
+ <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
+ </div>
+
+ </script>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/css/admin.css b/plugins/org.eclipse.osee.disposition.rest/web/css/admin.css
new file mode 100644
index 00000000000..c6f8d2bae96
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/css/admin.css
@@ -0,0 +1,30 @@
+#programSelect {
+ background-color: yellow;
+ width: 200px;
+}
+
+.createSetModal .modal-content {
+width: 500px;
+
+}
+
+button.btn.btn-default.btn-sm.setDelete.ng-scope {
+ width: 57px;
+}
+
+#importButton {
+ width:150px;
+}
+
+button.btn.btn-primary.ng-scope {
+ width: 70px;
+ height: 30px;
+}
+
+#reportRow {
+ margin-top: 100px;
+}
+
+#generateReportBtn {
+ margin-top:20px;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/css/user.css b/plugins/org.eclipse.osee.disposition.rest/web/css/user.css
new file mode 100644
index 00000000000..d319c61ce4a
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/css/user.css
@@ -0,0 +1,183 @@
+
+#top-content {
+ position: absolute;
+ top: 130px;
+ bottom: 240px; /* 130 + 6 */
+ left: 40px;
+ right: 0;
+ overflow: auto;
+}
+#bottom-content {
+ position: absolute;
+ height: 300px;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ overflow: auto;
+ background-color: lightslategray;
+}
+
+#content-resizer {
+ position: absolute;
+ height: 6px;
+ bottom: 300px;
+ left: 0;
+ right: 0;
+ background-color: #666;
+ cursor: n-resize;
+}
+
+#sidebar-resizer:hover, #preview-resizer:hover {
+ background-color: #AAA;
+}
+
+.ngHeaderScroller{
+ position:fixed;
+}
+
+#annotationsGrid {
+background-color: lightslategray;
+}
+
+.textarea {
+ resize: vertical;
+}
+
+#itemSelectedBar {
+ background-color: lightcyan;
+}
+
+
+
+
+
+
+
+#compareText {
+ width: 110px;
+ margin: 0px 0px 0px 75px;
+ border-style: solid;
+ border-width: 1px;
+ text-align: center;
+ background-color: #B0E0E6;
+}
+#dispoTable {
+ background-color: white;
+ border: 5px solid black;
+}
+th {
+ background-color: #969AA0;
+}
+
+.subTable {
+ border-spacing: 1px;
+ background-color: #FFF;
+ border: 1px solid #000;
+}
+
+td {
+ border: 1px solid black;
+}
+
+.itemData {
+ overflow: hidden;
+ white-space: nowrap;
+ max-width:50px;
+ height:30px;
+ background-color: white;
+}
+.itemDataFail {
+ overflow: hidden;
+ white-space: nowrap;
+ max-width:50px;
+ height:30px;
+ background-color: yellow;
+}
+
+input:disabled {
+ background-color: #D3DFE0;
+}
+.spacer {
+ background-color: white;
+}
+.emptyCell {
+ height:30px;
+ background-color: rgb(200, 200, 200);
+}
+td {
+ background-color: #9AEAF5;
+}
+.emptyAnnotation {
+ height:20px;
+ background-color: #9AEAF5;
+}
+textarea {
+ resize: none;
+}
+
+.annotationInput {
+ border: none;
+ width: 100%;
+ height: 32px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
+ box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
+ -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
+ transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
+ background-color: #9AEAF5;
+}
+.annotationInput:focus {
+ border: 2px dashed green;
+}
+.annotationInput.details {
+ height: 200px;
+ overflow: visible;
+ white-space: pre-line;
+}
+.annotationInput.invalid {
+ border: 4px solid red;
+}
+.annotationInput:disabled {
+ background-color: #D3DFE0;
+}
+
+.annotationInput.details:disabled {
+ height: 200px;
+ transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
+ background-color: #D3DFE0;
+}
+.annotationInput.invalid:focus {
+ border: 2px dashed red;
+}
+
+.annotationInput.details:focus {
+ border: 2px dashed green;
+}
+.annotationInput.details.invalid {
+ border: 4px solid red;
+}
+.annotationInput.details.invalid:focus {
+ border: 2px dashed red;
+}
+.annotationDelete {
+ display: block;
+ width: 100%;
+ height: 34px;
+ padding: 6px 12px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #555;
+ background-color: #fff;
+ background-image: none;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
+ box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
+ -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
+ transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
+}
+
+.annotationDelete:disabled {
+ background-color: white;
+ color: white;
+ border: none;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/js/adminController.js b/plugins/org.eclipse.osee.disposition.rest/web/js/adminController.js
new file mode 100644
index 00000000000..f1a02494f17
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/js/adminController.js
@@ -0,0 +1,195 @@
+ app.controller('adminController', ['$scope', '$modal', 'Program', 'Set', 'Report',
+ function($scope, $modal, Program, Set, Report) {
+ $scope.readOnly = true;
+ $scope.programSelection = null;
+ $scope.modalShown = false;
+ $scope.primarySet = "";
+ $scope.secondarySet = "";
+ $scope.sets = [];
+
+ $scope.cachedValue = "";
+
+ $scope.$on('ngGridEventStartCellEdit', function(data) {
+ var field = data.targetScope.col.field;
+ $scope.cachedValue = data.targetScope.row.getProperty(field);
+ });
+
+ $scope.$on('ngGridEventEndCellEdit', function(data) {
+ var field = data.targetScope.col.field;
+ var row = data.targetScope.row;
+ var newValue = row.getProperty(field);
+
+ if ($scope.cachedValue != newValue) {
+ $scope.editSet(row.entity);
+ }
+ });
+
+
+
+ $scope.gridOptions = {
+ data: 'sets',
+ enableHighlighting: true,
+ enableColumnResize: false,
+ enableRowReordering: true,
+ multiSelect: false,
+ columnDefs: 'columnDefs' // link to scope variable which we will define dynamically
+ }
+
+ var editCellTmpl = '<input editable="true" >'
+ var dellCellTmpl = '<button width="50px" class="btn btn-default btn-sm setDelete" ng-show="!readOnly" ng-click="deleteSet(row.entity)">X</button>';
+ var importCellTmpl = '<button width="50px" class="btn btn-primary" ng-click="importSet(row.entity)">Import</button>';
+
+ $scope.columnDefs1 = [{
+ field: "",
+ displayName: "Import",
+ width: 70,
+ enableCellEdit: false,
+ cellTemplate: importCellTmpl
+ }, {
+ field: "name",
+ displayName: "Name",
+ width: 250,
+ enableCellEdit: false
+ }, {
+ field: "importPath",
+ displayName: "Path",
+ width: 330,
+ enableCellEdit: false
+ }];
+
+ $scope.columnDefs2 = [{
+ field: "",
+ displayName: "Import",
+ width: 70,
+ enableCellEdit: false,
+ cellTemplate: importCellTmpl
+ }, {
+ field: "name",
+ displayName: "Name",
+ width: 250,
+ enableCellEdit: true
+ }, {
+ field: "importPath",
+ displayName: "Path",
+ width: 330,
+ enableCellEdit: true
+ }, {
+ field: "delete",
+ displayName: "Delete",
+ width: 57,
+ cellTemplate: dellCellTmpl
+ }];
+
+ $scope.columnDefs = $scope.columnDefs1;
+
+ $scope.programs = Program.query();
+
+ $scope.toggleModal = function() {
+ $scope.modalShown = !$scope.modalShown
+ };
+
+ $scope.toggleReadOnly = function() {
+ if ($scope.readOnly) {
+ $scope.columnDefs = $scope.columnDefs2;
+ $scope.readOnly = false;
+ } else {
+ $scope.columnDefs = $scope.columnDefs1;
+ $scope.readOnly = true;
+ }
+
+ };
+
+ $scope.generateReport = function() {
+ Report.get({
+ programId: $scope.programSelection,
+ primarySet: $scope.primarySet,
+ secondarySet: $scope.secondarySet,
+ });
+ }
+
+ $scope.updateProgram = function updateProgram() {
+ Set.query({
+ programId: $scope.programSelection
+ }, function(data) {
+ $scope.sets = data;
+ $scope.$setsLoaded = true;
+ });
+ };
+
+ $scope.editSet = function editSet(set) {
+ Set.update({
+ programId: $scope.programSelection,
+ setId: set.guid
+ }, set);
+ };
+
+ $scope.deleteSet = function deleteSet(set) {
+ Set.delete({
+ programId: $scope.programSelection,
+ setId: set.guid
+ }, function() {
+ var index = $scope.sets.indexOf(set);
+ if (index > -1) {
+ $scope.sets.splice(index, 1);
+ }
+ });
+
+ }
+
+
+ $scope.importSet = function importSet(set) {
+ var newSet = new Set;
+ newSet.operation = "Import";
+ Set.update({
+ programId: $scope.programSelection,
+ setId: set.guid
+ }, newSet);
+ };
+
+ $scope.createNewSet = function createNewSet(name, path, type) {
+ if (name != "" && path != "") {
+ var newSet = new Set;
+ newSet.name = name;
+ newSet.importPath = path;
+ newSet.dispoType = type;
+ newSet.$save({
+ programId: $scope.programSelection
+ }, function() {
+ $scope.sets.push(newSet);
+ });
+ }
+ };
+
+ $scope.createNewSetModal = function() {
+ var modalInstance = $modal.open({
+ templateUrl: 'popup.html',
+ controller: CreateSetModalCtrl,
+ size: 'sm',
+ windowClass: 'createSetModal'
+ });
+
+ modalInstance.result.then(function(inputs) {
+ $scope.createNewSet(inputs.name, inputs.path, inputs.dispoType);
+ });
+ }
+
+ var CreateSetModalCtrl = function($scope, $modalInstance) {
+ $scope.setName = "";
+ $scope.importPath = "";
+ $scope.dispoType = "";
+
+ $scope.ok = function() {
+ var inputs = {};
+ inputs.name = this.setName;
+ inputs.path = this.importPath;
+ inputs.dispoType = "testScripts";
+ $modalInstance.close(inputs);
+ };
+
+ $scope.cancel = function() {
+ $modalInstance.dismiss('cancel');
+ };
+ };
+
+ }
+ ]); \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/js/dispoApp.js b/plugins/org.eclipse.osee.disposition.rest/web/js/dispoApp.js
new file mode 100644
index 00000000000..2ded8528b37
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/js/dispoApp.js
@@ -0,0 +1,111 @@
+/**
+ * Dispo app definition
+ */
+var app = angular.module('dispoApp', ['ngRoute', 'ngResource', 'ui.bootstrap', 'ngGrid', 'mc.resizer', 'ngCookies', ]);
+
+app.config(['$routeProvider',
+ function($routeProvider) {
+ $routeProvider.when('/', {
+ redirectTo: "/user",
+ }).when('/user', {
+ templateUrl: 'user.html',
+ controller: 'userController'
+ }).when('/admin', {
+ templateUrl: 'admin.html',
+ controller: 'adminController'
+ }).otherwise({
+ redirectTo: "/user"
+ });
+ }
+]);
+
+
+app.directive('focusMe', function($timeout) {
+ return function(scope, element, attrs) {
+ scope.$watch(attrs.focusMe, function() {
+ $timeout(function() {
+ element[0].focus();
+ }, 20);
+ });
+ };
+});
+
+//http://stackoverflow.com/questions/11868393/angularjs-inputtext-ngchange-fires-while-the-value-is-changing
+app.directive('ngModelOnblur', function() {
+ return {
+ restrict: 'A',
+ require: 'ngModel',
+ priority: 1, // needed for angular 1.2.x
+ link: function(scope, elm, attr, ngModelCtrl) {
+ if (attr.type === 'radio' || attr.type === 'checkbox') return;
+
+ elm.unbind('input').unbind('keydown').unbind('change');
+ elm.bind('blur', function() {
+ scope.$apply(function() {
+ ngModelCtrl.$setViewValue(elm.val());
+ });
+ });
+ }
+ };
+});
+
+app.provider('Program', function() {
+ this.$get = ['$resource',
+ function($resource) {
+ var Program = $resource('/dispor/program/:programId', {}, {});
+ return Program;
+ }
+ ];
+});
+
+app.provider('Report', function() {
+ this.$get = ['$resource',
+ function($resource) {
+ var Program = $resource('/dispor/program/:programId/report', {}, {});
+ return Program;
+ }
+ ];
+});
+
+app.provider('Set', function() {
+ this.$get = ['$resource',
+ function($resource) {
+ var Set = $resource('/dispor/program/:programId/set/:setId', {}, {
+ update: {
+ method: 'PUT'
+ }
+ });
+ return Set;
+ }
+ ];
+});
+
+app.provider('Item', function() {
+ this.$get = [
+ '$resource',
+ function($resource) {
+ var Item = $resource(
+ '/dispor/program/:programId/set/:setId/item/:itemId', {}, {
+ update: {
+ method: 'PUT'
+ }
+ });
+ return Item;
+ }
+ ];
+});
+
+app.provider('Annotation', function() {
+ this.$get = [
+ '$resource',
+ function($resource) {
+ var Annotation = $resource(
+ '/dispor/program/:programId/set/:setId/item/:itemId/annotation/:annotationId', {}, {
+ update: {
+ method: 'PUT'
+ }
+ });
+ return Annotation;
+ }
+ ];
+}); \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/js/mainController.js b/plugins/org.eclipse.osee.disposition.rest/web/js/mainController.js
new file mode 100644
index 00000000000..8318d1f933d
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/js/mainController.js
@@ -0,0 +1,16 @@
+app.controller('mainController', [
+ '$rootScope',
+ '$cookieStore',
+
+ function($rootScope, $cookieStore) {
+ $rootScope.cachedName = "Need To Log In";
+
+ $rootScope.cachedName = $cookieStore.get('cachedName');
+ while($rootScope.cachedName == null || $rootScope.cachedName == "") {
+ var nameEnter=prompt("Please enter your name","");
+ $cookieStore.put('cachedName', nameEnter);
+ $rootScope.cachedName = nameEnter;
+ }
+ }]);
+
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/js/resizer.js b/plugins/org.eclipse.osee.disposition.rest/web/js/resizer.js
new file mode 100644
index 00000000000..6f0ef7a8b72
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/js/resizer.js
@@ -0,0 +1,61 @@
+angular.module('mc.resizer', []).directive('resizer', function($document) {
+
+ return function($scope, $element, $attrs) {
+
+ $element.on('mousedown', function(event) {
+ event.preventDefault();
+
+ $document.on('mousemove', mousemove);
+ $document.on('mouseup', mouseup);
+ });
+
+ function mousemove(event) {
+
+ if ($attrs.resizer == 'vertical') {
+ // Handle vertical resizer
+ var x = event.pageX;
+
+ if ($attrs.resizerMax && x > $attrs.resizerMax) {
+ x = parseInt($attrs.resizerMax);
+ }
+
+ $element.css({
+ left: x + 'px'
+ });
+
+ $($attrs.resizerLeft).css({
+ width: x + 'px'
+ });
+ $($attrs.resizerRight).css({
+ left: (x + parseInt($attrs.resizerWidth)) + 'px'
+ });
+
+ } else {
+ var innerHeight = window.innerHeight;
+ var y = innerHeight - event.pageY;
+
+ console.log(window.innerHeight);
+ if(y < innerHeight - 200) {
+
+ // Handle horizontal resizer
+
+ $element.css({
+ bottom: y + 'px'
+ });
+
+ $($attrs.resizerTop).css({
+ bottom: (y + parseInt($attrs.resizerHeight)) + 'px'
+ });
+ $($attrs.resizerBottom).css({
+ height: y + 'px'
+ });
+ }
+ }
+ }
+
+ function mouseup() {
+ $document.unbind('mousemove', mousemove);
+ $document.unbind('mouseup', mouseup);
+ }
+ };
+}); \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/js/userController.js b/plugins/org.eclipse.osee.disposition.rest/web/js/userController.js
new file mode 100644
index 00000000000..e2b5a7f4969
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/js/userController.js
@@ -0,0 +1,333 @@
+app.controller('userController', [
+ '$scope',
+ '$rootScope',
+ '$cookieStore',
+ 'Program',
+ 'Set',
+ 'Item',
+ 'Annotation',
+
+ function($scope, $rootScope, $cookieStore, Program, Set, Item, Annotation) {
+
+ $scope.programSelection = null;
+
+ // Get programs
+ Program.query(function(data) {
+ $scope.programs = data;
+ });
+
+ $scope.updateProgram = function updateProgram() {
+ Set.query({
+ programId: $scope.programSelection
+ }, function(data) {
+ $scope.sets = data;
+ });
+ };
+
+ $scope.updateSet = function updateSet() {
+ Item.query({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection
+ }, function(data) {
+ $scope.items = data;
+ });
+
+ Set.get({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection
+ }, function(data) {
+ $scope.set = data;
+ $scope.dispoConfig = $scope.set.dispoConfig;
+ });
+ };
+
+ $scope.updateItem = function updateItem(item, row) {
+ $scope.selectedItem = item;
+ Annotation.query({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: item.guid
+ }, function(data) {
+ $scope.annotations = data;
+ var blankAnnotation = new Annotation();
+ $scope.annotations.push(blankAnnotation);
+
+ $scope.gridOptions.selectRow(row.rowIndex, true);
+ });
+
+
+ };
+
+ $scope.$on('ngGridEventStartCellEdit', function(data) {
+ var field = data.targetScope.col.field;
+ $scope.cachedValue = data.targetScope.row.getProperty(field);
+ });
+
+ $scope.$on('ngGridEventEndCellEdit', function(data) {
+ var field = data.targetScope.col.field;
+ var newValue = data.targetScope.row.getProperty(field);
+
+ if ($scope.cachedValue != newValue) {
+ var object = data.targetScope.row.entity;
+ $scope.editItem(data.targetScope.row.entity);
+ }
+ });
+
+ var checkboxSorting = function checkboxSorting(itemA, itemB) {
+ if (itemA.needsRerun == itemA.needsRerun) {
+ return itemA;
+ } else if (itemA.needsRerun) {
+ return itemA;
+ } else if (itemB.needsRerun) {
+ return itemB;
+ } else {
+ return itemA;
+ }
+ };
+
+ // Need this so that user clicks on grid rows doesn't automatically change the selected/highlighted row
+ var checkSelectable = function checkSelectable(data) {
+ return false;
+ };
+
+ var origCellTmpl = '<div ng-dblclick="updateItem(row.entity, row)">{{row.entity.name}}</div>';
+ var dupCellTmpl = '<button class="btn btn-default btn-sm" ng-dblclick="updateItem(row.entity)">{{row.getProperty(col.field)}}</button>';
+ var chkBoxTemplate = '<input type="checkbox" class="form-control" ng-model="COL_FIELD" ng-change="editItem(row.entity)">hello world</input>';
+ var assigneeCellTmpl = '<div ng-dblclick="stealItem(row.entity)">{{row.entity.assignee}}</div>';
+
+ $scope.gridOptions = {
+ data: 'items',
+ enableHighlighting: true,
+ enableColumnResize: true,
+ enableRowReordering: true,
+ multiSelect: false,
+ showFilter: true,
+ showColumnMenu: true,
+ beforeSelectionChange: checkSelectable,
+ columnDefs: [{
+ field: 'name',
+ displayName: 'Name',
+ width: 400,
+ cellTemplate: origCellTmpl
+ }, {
+ field: 'status',
+ displayName: 'Status',
+ width: 150
+ }, {
+ field: 'totalPoints',
+ displayName: 'Total',
+ width: 100
+ }, {
+ field: 'failureCount',
+ displayName: 'Failure Count',
+ width: 125
+ }, {
+ field: 'discrepanciesAsRanges',
+ displayName: 'Failed Points',
+ width: 400
+ }, {
+ field: 'assignee',
+ displayName: 'Assignee',
+ width: 200,
+ enableCellEdit: false,
+ cellTemplate: assigneeCellTmpl
+ }, {
+ field: 'needsRerun',
+ displayName: 'Rerun?',
+ enableCellEdit: false,
+ cellTemplate: chkBoxTemplate,
+ sortFn: checkboxSorting
+ }, {
+ field: 'category',
+ displayName: 'Category',
+ enableCellEdit: true,
+ visible: false
+ }]
+
+ };
+
+ $scope.stealItem = function stealItem(item) {
+ if ($rootScope.cachedName != null) {
+ if ($rootScope.cachedName != item.assignee) {
+ var confirmed = window.confirm("Are you sure you want to steal this Item from " + item.assignee);
+ if (confirmed) {
+ item.assignee = $rootScope.cachedName;
+ $scope.editItem(item);
+ }
+ }
+ }
+ }
+
+ $scope.resolutionTypes = [{
+ text: "Code",
+ value: "CODE"
+ }, {
+ text: "Test",
+ value: "TEST"
+ }, {
+ text: "Requirement",
+ value: "REQUIREMENT"
+ }, {
+ text: "Other",
+ value: "OTHER"
+ }, {
+ text: "Undetermined",
+ value: "UNDETERMINED"
+ }];
+
+ $scope.deleteAnnotation = function deleteAnnotation(annotation) {
+ Annotation.delete({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: $scope.selectedItem.guid,
+ annotationId: annotation.guid,
+ userName: $rootScope.cachedName,
+ }, function() {
+ var index = $scope.annotations.indexOf(annotation);
+ if (index > -1) {
+ $scope.annotations.splice(index, 1);
+ }
+ Item.get({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: $scope.selectedItem.guid
+ }, function(data) {
+ $scope.selectedItem.status = data.status;
+ });
+ }, function(data) {
+ alert("Could not make change, please try refreshing");
+ });
+
+ }
+
+ $scope.editItem = function editItem(item) {
+ Item.update({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: item.guid,
+ }, item, function() {}, function(data) {
+ alert("Could not make change, please try refreshing");
+ });
+
+ }
+
+ $scope.getInvalidLocRefs = function getInvalidLocRefs(annotation) {
+ return !annotation.isConnected && annotation.locationRefs != null;
+ }
+
+ $scope.getInvalidRes = function getInvalidRes(annotation) {
+ return annotation.resolution != null && annotation.resolution != "" && !annotation.isResolutionValid;
+ }
+
+ $scope.editAnnotation = function editAnnotation(annotation) {
+ var annot = annotation;
+ if (annotation.guid == null) {
+ $scope.createAnnotation(annotation);
+ } else {
+ Annotation.update({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: $scope.selectedItem.guid,
+ annotationId: annotation.guid,
+ userName: $rootScope.cachedName,
+ }, annotation, function(annot) {
+ // get latest Annotation version from Server
+ Annotation.get({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: $scope.selectedItem.guid,
+ annotationId: annotation.guid
+ }, function(data) {
+ annotation.isConnected = data.isConnected;
+ annotation.isResolutionValid = data.isResolutionValid;
+ });
+
+ // Get new latest Item version from server
+ Item.get({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: $scope.selectedItem.guid
+ }, function(data) {
+ $scope.selectedItem.status = data.status;
+ });
+ }, function(data) {
+ alert("Could not make change, please try refreshing");
+ });
+ }
+ }
+
+ $scope.createAnnotation = function createAnnotation(annotation) {
+ annotation.$save({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: $scope.selectedItem.guid,
+ userName: $rootScope.cachedName,
+ }, function() {
+ Item.get({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: $scope.selectedItem.guid
+ }, function(data) {
+ $scope.selectedItem.status = data.status;
+ });
+
+ var blankAnnotation = new Annotation();
+ $scope.annotations.push(blankAnnotation);
+ }, function(data) {
+ alert("Could not make change, please try refreshing");
+ });
+ }
+
+ $scope.expandAnnotations = function expandAnnotations(item) {
+ $scope.selectedItem = item;
+ if (item.annotations == null) {
+ Annotation.query({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: item.guid
+ }, function(data) {
+ item.annotations = data;
+
+ var blankAnnotation = new Annotation;
+ item.annotations.push(blankAnnotation);
+ item.showDetails = (data.length > 0);
+ });
+ } else if (!item.showDetails) {
+ item.showDetails = (item.annotations.length > 0);
+ } else {
+ item.showDetails = false;
+ }
+ };
+
+ $scope.toggleDetails = function toggleDetails(annotation) {
+ if (annotation.showDeets == null) {
+ annotation.showDeets = true;
+ } else if (annotation.showDeets) {
+ annotation.showDeets = false;
+ } else {
+ annotation.showDeets = true;
+ }
+ }
+
+
+ }
+]);
+
+//http://stackoverflow.com/questions/11868393/angularjs-inputtext-ngchange-fires-while-the-value-is-changing
+app.directive('ngModelOnblur', function() {
+ return {
+ restrict: 'A',
+ require: 'ngModel',
+ priority: 1, // needed for angular 1.2.x
+ link: function(scope, elm, attr, ngModelCtrl) {
+ if (attr.type === 'radio' || attr.type === 'checkbox') return;
+
+ elm.unbind('input').unbind('keydown').unbind('change');
+ elm.bind('blur', function() {
+ scope.$apply(function() {
+ ngModelCtrl.$setViewValue(elm.val());
+ });
+ });
+ }
+ };
+});
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/main.html b/plugins/org.eclipse.osee.disposition.rest/web/main.html
new file mode 100644
index 00000000000..ebd506bf5be
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/main.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="ISO-8859-1">
+ <title>Disposition</title>
+ <link rel="stylesheet" href="/lib/css/bootstrap.min.css">
+ <link href="/lib/css/bootstrap-responsive.css" rel="stylesheet">
+ <link rel="stylesheet" type="text/css" href="http://angular-ui.github.com/ng-grid/css/ng-grid.css" />
+ <link href="css/user.css" rel="stylesheet">
+ <link href="css/admin.css" rel="stylesheet">
+</head>
+
+<body ng-app="dispoApp">
+
+ <nav ng-controller="mainController" class="navbar navbar-default" role="navigation">
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="#/user">Disposition</a>
+ </div>
+ <p class="navbar-text">Signed in as {{ cachedName }}</p>
+ <div class="collapse navbar-collapse" ng-controller="HeaderController">
+ <ul class="nav navbar-nav navbar-right">
+ <li ng-class="{ active: isActive('/user')}"><a href="#/user">User</a>
+ </li>
+ <li ng-class="{ active: isActive('/admin')}"><a href="#/admin">Admin</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </nav>
+
+ <div ng-view></div>
+
+ <script>
+ function HeaderController($scope, $location) {
+ $scope.isActive = function(viewLocation) {
+ return viewLocation === $location.path();
+ };
+ }
+ </script>
+
+ <script src="/lib/js/jquery-2.0.3.min.js"></script>
+ <script src="/lib/js/angular.min.js"></script>
+ <script src="/lib/js/angular-route.min.js"></script>
+ <script src="/lib/js/angular-resource.min.js"></script>
+ <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-cookies.js"></script>
+ <script src="/lib/js/ng-grid-2.0.11.min.js"></script>
+ <script src="/lib/js/bootstrap.min.js"></script>
+ <script src="/lib/js/ui-bootstrap-tpls-0.11.0.min.js"></script>
+ <script src="js/resizer.js"></script>
+ <script src="js/dispoApp.js"></script>
+ <script src="js/userController.js"></script>
+ <script src="js/adminController.js"></script>
+ <script src="js/mainController.js"></script>
+</body>
+
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/user.html b/plugins/org.eclipse.osee.disposition.rest/web/user.html
new file mode 100644
index 00000000000..03eb9255194
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/user.html
@@ -0,0 +1,69 @@
+<!doctype html>
+<html>
+
+<head>
+
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+
+ <title>Dispo User</title>
+</head>
+
+<body>
+
+ <div class="container-fluid" id="content">
+ <div>
+ <div class="row">
+ <div class="span3 offset1">
+ ATS Version:
+ <select class="form-control" ng-show="programs" ng-model="programSelection" ng-change="updateProgram()" ng-options="obj.value as obj.text for obj in programs">
+ </select>
+ </div>
+ <div ng-show="programSelection != null" class="span3 offset2">
+ Set:
+ <select class="form-control" ng-show="sets" ng-model="setSelection" ng-change="updateSet()" ng-options="obj.guid as obj.name for obj in sets">
+ </select>
+ </div>
+ </div>
+ <div id="top-content" class="row">
+ <div style="height: 600px;" id="itemsGrid" class="gridStyle" ng-grid="gridOptions"></div>
+ </div>
+ </div>
+
+ <div id="bottom-content">
+ <div id="itemSelectedBar">
+ Item: {{ selectedItem.name || "Select an Item"}} Failures: {{ selectedItem.discrepanciesAsRanges || "N/A"}}
+ </div>
+ <div id="annotationsGrid">
+ <table class="table subTable">
+ <th>Locations</th>
+ <th>Type</th>
+ <th>Resolution</th>
+ <th>Developer Notes</th>
+ <th>Customer Notes</th>
+ <tr ng-repeat="annotation in annotations">
+ <td>
+ <textarea ng-class="{annotationInput: true, invalid: getInvalidLocRefs(annotation), details: annotation.showDeets}" ng-invalid="true" ng-model="annotation.locationRefs" type=text ng-model-onblur ng-change="editAnnotation(annotation)" ng-dblclick="toggleDetails(annotation)"></textarea>
+ </td>
+ <td>
+ <select ng-class="{annotationInput: true, details: annotation.showDeets}" ng-options="obj.value as obj.text for obj in resolutionTypes" ng-disabled="annotation.guid == null" ng-model="annotation.resolutionType" ng-change="editAnnotation(annotation)" ng-dblclick="addDetailsClass($event)"></select>
+ </td>
+ <td>
+ <textarea ng-class="{annotationInput: true, invalid: getInvalidRes(annotation), details: annotation.showDeets}" ng-disabled="annotation.guid == null" ng-model="annotation.resolution" type=text ng-model-onblur ng-change="editAnnotation(annotation)" ng-dblclick="addDetailsClass($event)"></textarea>
+ </td>
+ <td>
+ <textarea ng-class="{annotationInput: true, details: annotation.showDeets}" ng-disabled="annotation.guid == null" ng-model="annotation.developerNotes" type=text ng-model-onblur ng-change="editAnnotation(annotation)" ng-dblclick="addDetailsClass($event)"></textarea>
+ </td>
+ <td>
+ <textarea ng-class="{annotationInput: true, details: annotation.showDeets}" ng-disabled="annotation.guid == null" ng-model="annotation.customerNotes" type=text ng-model-onblur ng-change="editAnnotation(annotation)" ng-dblclick="addDetailsClass($event)"></textarea>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <div id="content-resizer" resizer="horizontal" resizer-height="6" resizer-top="#top-content" resizer-bottom="#bottom-content">
+ </div>
+
+</body>
+
+</html> \ No newline at end of file

Back to the top