Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2017-07-26 18:38:10 -0400
committerMegumi Telles2017-08-03 13:15:26 -0400
commitd44f86d7e37b231b4f57db20d253ec92e89052e0 (patch)
tree0c8cba31867b53097fa1dc71dea3767dc3f6ef7c
parentce2f4ca4ccfb7f2cef71fda9436984043e87139a (diff)
downloadorg.eclipse.osee-d44f86d7e37b231b4f57db20d253ec92e89052e0.tar.gz
org.eclipse.osee-d44f86d7e37b231b4f57db20d253ec92e89052e0.tar.xz
org.eclipse.osee-d44f86d7e37b231b4f57db20d253ec92e89052e0.zip
feature: Add support for dispo and CI integration
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java10
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStorageMetadata.java34
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/OSGI-INF/dispo.broadcaster.service.xml9
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/external/DispoListenerApi.java23
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/external/DispoUpdateBroadcaster.java50
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java78
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoCiAdapter.java18
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoItemArtifact.java1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java6
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java5
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java24
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee10
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java3
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js89
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js4
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html43
24 files changed, 400 insertions, 19 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
index a744bb19aa..4ab251ed85 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
@@ -29,4 +29,6 @@ public interface DispoSet extends Identifiable<String> {
String getDispoType();
OperationReport getOperationSummary();
+
+ String getCiSet();
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
index b85162e605..0381a58fa8 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
@@ -26,6 +26,7 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
private List<Note> notesList;
private String importState;
private OperationReport operationSummary;
+ private String ciSet;
public DispoSetData() {
@@ -75,4 +76,13 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
return operationSummary;
}
+ public void setCiSet(String ciSet) {
+ this.ciSet = ciSet;
+ }
+
+ @Override
+ public String getCiSet() {
+ return ciSet;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStorageMetadata.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStorageMetadata.java
new file mode 100644
index 0000000000..8257cc542b
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStorageMetadata.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.disposition.model;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Angel Avila
+ */
+public class DispoStorageMetadata {
+
+ private final Set<String> idsOfUpdatedItems = new HashSet<>();
+
+ public DispoStorageMetadata() {
+
+ }
+
+ public Set<String> getIdsOfUpdatedItems() {
+ return idsOfUpdatedItems;
+ }
+
+ public void addIdOfUpdatedItem(String id) {
+ idsOfUpdatedItems.add(id);
+ }
+}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
index aeea6fd40a..67c224936f 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
@@ -45,6 +45,7 @@ public class DispoStrings {
public static final String Item_InComplete = "INCOMPLETE";
public static final String Operation_Import = "Import";
+ public static final String Operation_MassSendStatus = "MassSendDispoItemStatus";
public static final String DeletedDiscrepancy = "Deleted Discrepancy";
@@ -52,4 +53,5 @@ public class DispoStrings {
public static final String Test_Unit_Resolution = "Test_Script";
public static final String Exception_Handling_Resolution = "Exception_Handling";
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
index fcbbef44e2..fbdbfc18f3 100644
--- a/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
@@ -33,3 +33,4 @@ Import-Package:
org.eclipse.osee.vcast,
org.eclipse.osee.vcast.model,
org.json
+Export-Package: org.eclipse.osee.disposition.rest.external
diff --git a/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/dispo.broadcaster.service.xml b/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/dispo.broadcaster.service.xml
new file mode 100644
index 0000000000..a8b133c176
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/dispo.broadcaster.service.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
+ <implementation class="org.eclipse.osee.disposition.rest.external.DispoUpdateBroadcaster"/>
+ <service>
+ <provide interface="org.eclipse.osee.disposition.rest.external.DispoUpdateBroadcaster"/>
+ </service>
+ <reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+ <reference bind="addDispoListener" cardinality="0..n" interface="org.eclipse.osee.disposition.rest.external.DispoListenerApi" name="DispoListenerApi" policy="dynamic"/>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml b/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml
index e04df0dd7b..a83697ed2d 100644
--- a/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml
+++ b/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml
@@ -10,4 +10,5 @@
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
<reference bind="setResolutionValidator" cardinality="1..1" interface="org.eclipse.osee.disposition.rest.internal.DispoResolutionValidator" name="DispoResolutionValidator" policy="static"/>
<reference bind="setExecutor" cardinality="1..1" interface="org.eclipse.osee.executor.admin.ExecutorAdmin" name="ExecutorAdmin" policy="static"/>
+ <reference bind="setDispoUpdateBroadcaster" cardinality="1..1" interface="org.eclipse.osee.disposition.rest.external.DispoUpdateBroadcaster" name="DispoUpdateBroadcaster" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
index e10ce1acaf..dd381c150e 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
@@ -45,6 +45,8 @@ public interface DispoApi {
DispoConfig getDispoConfig(BranchId branch);
+ DispoSet getDispoItemParentSet(BranchId branch, String itemId);
+
// Writes
Long createDispoProgram(String name);
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
index 68b399d4bc..a8d086dd00 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
@@ -49,6 +49,7 @@ public final class DispoConstants {
public static final AttributeTypeToken DispoItemTeam = AttributeTypeToken.valueOf(3160880792426011047L, "dispo.Team");
public static final AttributeTypeToken DispoItemFileNumber = AttributeTypeToken.valueOf(3458764513820541715L, "dispo.File Number");
public static final AttributeTypeToken DispoItemMethodNumber = AttributeTypeToken.valueOf(3458764513820541460L, "dispo.Method Number");
+ public static final AttributeTypeToken DispoCiSet = AttributeTypeToken.valueOf(5225296359986133054L, "dispo.Ci Set");
public static final ArtifactToken DISPO_ARTIFACT = ArtifactToken.valueOf(4757831, "DispositionTypes", COMMON, CoreArtifactTypes.OseeTypeDefinition);
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/external/DispoListenerApi.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/external/DispoListenerApi.java
new file mode 100644
index 0000000000..8d78085c84
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/external/DispoListenerApi.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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.external;
+
+import java.util.Collection;
+import org.eclipse.osee.disposition.model.DispoItem;
+import org.eclipse.osee.disposition.model.DispoSet;
+
+/**
+ * @author Angel Avila
+ */
+public interface DispoListenerApi {
+
+ public void onUpdateItemStats(Collection<String> ids, Collection<DispoItem> items, DispoSet set);
+}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/external/DispoUpdateBroadcaster.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/external/DispoUpdateBroadcaster.java
new file mode 100644
index 0000000000..b2c9dd746e
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/external/DispoUpdateBroadcaster.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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.external;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.disposition.model.DispoItem;
+import org.eclipse.osee.disposition.model.DispoSet;
+import org.eclipse.osee.logger.Log;
+
+/**
+ * @author Angel Avila
+ * @author Megumi Telles
+ */
+public class DispoUpdateBroadcaster {
+
+ private Log logger;
+ private final Set<DispoListenerApi> listeners = new HashSet<>();
+
+ public void setLogger(Log logger) {
+ this.logger = logger;
+ }
+
+ public void start() {
+ logger.trace("Starting DispoUpdateBroadcaster...");
+ }
+
+ public void stop() {
+ logger.trace("Stopping DispoUpdateBroadcaster...");
+ }
+
+ public void addDispoListener(DispoListenerApi listener) {
+ listeners.add(listener);
+ }
+
+ public void broadcastUpdateItems(Collection<String> ids, Collection<DispoItem> items, DispoSet set) {
+ for (DispoListenerApi listener : listeners) {
+ listener.onUpdateItemStats(ids, items, set);
+ }
+ }
+}
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 923c264987..089283444a 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.disposition.rest.internal;
+import static java.util.Collections.singleton;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
@@ -28,12 +29,14 @@ import org.eclipse.osee.disposition.model.DispoItemData;
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.model.DispoStorageMetadata;
import org.eclipse.osee.disposition.model.DispoStrings;
import org.eclipse.osee.disposition.model.DispoSummarySeverity;
import org.eclipse.osee.disposition.model.Note;
import org.eclipse.osee.disposition.model.OperationReport;
import org.eclipse.osee.disposition.rest.DispoApi;
import org.eclipse.osee.disposition.rest.DispoImporterApi;
+import org.eclipse.osee.disposition.rest.external.DispoUpdateBroadcaster;
import org.eclipse.osee.disposition.rest.internal.importer.DispoImporterFactory;
import org.eclipse.osee.disposition.rest.internal.importer.DispoImporterFactory.ImportFormat;
import org.eclipse.osee.disposition.rest.internal.importer.DispoSetCopier;
@@ -60,6 +63,7 @@ public class DispoApiImpl implements DispoApi {
private DispoConnector dispoConnector;
private DispoResolutionValidator resolutionValidator;
private DispoImporterFactory importerFactory;
+ private DispoUpdateBroadcaster updateBroadcaster;
public void setExecutor(ExecutorAdmin executor) {
this.executor = executor;
@@ -85,6 +89,10 @@ public class DispoApiImpl implements DispoApi {
this.resolutionValidator = resolutionValidator;
}
+ public void setDispoUpdateBroadcaster(DispoUpdateBroadcaster updateBroadcater) {
+ this.updateBroadcaster = updateBroadcater;
+ }
+
public void start() {
logger.trace("Starting DispoApiImpl...");
importerFactory = new DispoImporterFactory(dataFactory, executor, logger);
@@ -142,7 +150,14 @@ public class DispoApiImpl implements DispoApi {
DispoItem updatedItem;
updatedItem = dataFactory.createUpdatedItem(annotationsList, discrepanciesList);
ArtifactReadable author = getQuery().findUser();
- getWriter().updateDispoItem(author, branch, dispoItem.getGuid(), updatedItem);
+
+ DispoStorageMetadata metadata = new DispoStorageMetadata();
+ getWriter().updateDispoItem(author, branch, dispoItem.getGuid(), updatedItem, metadata);
+ if (!metadata.getIdsOfUpdatedItems().isEmpty()) {
+ updateBroadcaster.broadcastUpdateItems(metadata.getIdsOfUpdatedItems(), singleton(dispoItem),
+ getDispoItemParentSet(branch, itemId));
+ }
+
}
return idOfNewAnnotation;
}
@@ -174,7 +189,12 @@ public class DispoApiImpl implements DispoApi {
if (dispoItemToEdit != null && newDispoItem.getAnnotationsList() == null && newDispoItem.getDiscrepanciesList() == null) { // We will not allow the user to do mass edit of Annotations or discrepancies
ArtifactReadable author = getQuery().findUser();
- getWriter().updateDispoItem(author, branch, dispoItemToEdit.getGuid(), newDispoItem);
+ DispoStorageMetadata metadata = new DispoStorageMetadata();
+ getWriter().updateDispoItem(author, branch, dispoItemToEdit.getGuid(), newDispoItem, metadata);
+ if (!metadata.getIdsOfUpdatedItems().isEmpty()) {
+ updateBroadcaster.broadcastUpdateItems(metadata.getIdsOfUpdatedItems(), singleton(newDispoItem),
+ getDispoItemParentSet(branch, itemId));
+ }
wasUpdated = true;
}
return wasUpdated;
@@ -221,7 +241,7 @@ public class DispoApiImpl implements DispoApi {
DispoSummarySeverity.WARNING);
}
}
- editDispoItems(branch, dispoItems, false, operation);
+ editDispoItems(branch, setId, dispoItems, false, operation);
} else {
report.addEntry("Womp womp womp",
"No items were updated. Please check your 'Items' list and make sure it's a comma seperated list of item names",
@@ -234,11 +254,16 @@ public class DispoApiImpl implements DispoApi {
return wasUpdated;
}
- private boolean editDispoItems(BranchId branch, Collection<DispoItem> dispoItems, boolean resetRerunFlag, String operation) {
+ private boolean editDispoItems(BranchId branch, String setId, Collection<DispoItem> dispoItems, boolean resetRerunFlag, String operation) {
boolean wasUpdated = false;
ArtifactReadable author = getQuery().findUser();
- getWriter().updateDispoItems(author, branch, dispoItems, resetRerunFlag, operation);
+ DispoStorageMetadata metadata = new DispoStorageMetadata();
+ getWriter().updateDispoItems(author, branch, dispoItems, resetRerunFlag, operation, metadata);
+ if (!metadata.getIdsOfUpdatedItems().isEmpty()) {
+ updateBroadcaster.broadcastUpdateItems(metadata.getIdsOfUpdatedItems(), dispoItems,
+ getDispoSetById(branch, setId));
+ }
wasUpdated = true;
return wasUpdated;
}
@@ -285,7 +310,13 @@ public class DispoApiImpl implements DispoApi {
modifiedDispoItem.setAnnotationsList(annotationsList);
modifiedDispoItem.setStatus(dispoConnector.getItemStatus(modifiedDispoItem));
- getWriter().updateDispoItem(author, branch, dispoItem.getGuid(), modifiedDispoItem);
+
+ DispoStorageMetadata metadata = new DispoStorageMetadata();
+ getWriter().updateDispoItem(author, branch, dispoItem.getGuid(), modifiedDispoItem, metadata);
+ if (!metadata.getIdsOfUpdatedItems().isEmpty()) {
+ updateBroadcaster.broadcastUpdateItems(metadata.getIdsOfUpdatedItems(), singleton(modifiedDispoItem),
+ getDispoItemParentSet(branch, itemId));
+ }
wasUpdated = true;
}
@@ -309,7 +340,12 @@ public class DispoApiImpl implements DispoApi {
DispoItem updatedItem = dataFactory.createUpdatedItem(newAnnotationsList, discrepanciesList);
ArtifactReadable author = getQuery().findUser();
- getWriter().updateDispoItem(author, branch, dispoItem.getGuid(), updatedItem);
+ DispoStorageMetadata metadata = new DispoStorageMetadata();
+ getWriter().updateDispoItem(author, branch, dispoItem.getGuid(), updatedItem, metadata);
+ if (!metadata.getIdsOfUpdatedItems().isEmpty()) {
+ updateBroadcaster.broadcastUpdateItems(metadata.getIdsOfUpdatedItems(), singleton(updatedItem),
+ getDispoItemParentSet(branch, itemId));
+ }
wasUpdated = true;
}
return wasUpdated;
@@ -413,13 +449,15 @@ public class DispoApiImpl implements DispoApi {
createDispoItems(branch, setToEdit.getGuid(), itemsToCreate);
}
if (itemsToEdit.size() > 0) {
- editDispoItems(branch, itemsToEdit, true, "Import");
+ editDispoItems(branch, setToEdit.getGuid(), itemsToEdit, true, "Import");
}
}
} catch (Exception ex) {
throw new OseeCoreException(ex);
}
+ } else if (operation.equals(DispoStrings.Operation_MassSendStatus)) {
+ MassSendDispoItemStatus(branch, setToEdit);
}
// Create the Note to document the Operation
@@ -431,6 +469,19 @@ public class DispoApiImpl implements DispoApi {
getWriter().updateOperationSummary(author, branch, setToEdit.getGuid(), report);
}
+ private void MassSendDispoItemStatus(BranchId branch, DispoSet set) {
+ try {
+ HashMap<String, DispoItem> nameToItemMap = getItemsMap(branch, set);
+ Collection<String> ids = new ArrayList<>();
+ for (DispoItem item : nameToItemMap.values()) {
+ ids.add(item.getGuid());
+ }
+ updateBroadcaster.broadcastUpdateItems(ids, nameToItemMap.values(), set);
+ } catch (Exception ex) {
+ throw new OseeCoreException(ex);
+ }
+ }
+
private HashMap<String, DispoItem> getItemsMap(BranchId branch, DispoSet set) {
HashMap<String, DispoItem> toReturn = new HashMap<>();
List<DispoItem> dispoItems = getDispoItems(branch, set.getGuid());
@@ -480,7 +531,7 @@ public class DispoApiImpl implements DispoApi {
String operation =
String.format("Copy From Legacy Coverage - Branch [%s] and Source Set [%s]", sourceBranch, sourceCoverageUuid);
if (!copyData.isEmpty()) {
- editDispoItems(destBranch, copyData, false, operation);
+ editDispoItems(destBranch, destSetId, copyData, false, operation);
storageProvider.get().updateOperationSummary(getQuery().findUser(), destBranch, destSetId, report);
}
}
@@ -520,7 +571,7 @@ public class DispoApiImpl implements DispoApi {
String operation = String.format("Copy Set from Program [%s] and Set [%s]", sourceBranch, sourceSetId);
if (!namesToToEditItems.isEmpty() && !report.getStatus().isFailed()) {
- editDispoItems(branch, namesToToEditItems.values(), false, operation);
+ editDispoItems(branch, destSetId, namesToToEditItems.values(), false, operation);
storageProvider.get().updateOperationSummary(getQuery().findUser(), branch, destSetId, report);
}
@@ -530,4 +581,11 @@ public class DispoApiImpl implements DispoApi {
public DispoConfig getDispoConfig(BranchId branch) {
return getQuery().findDispoConfig(branch);
}
+
+ @Override
+ public DispoSet getDispoItemParentSet(BranchId branch, String itemId) {
+ Long id = getQuery().getDispoItemParentSet(branch, itemId);
+ return getDispoSetById(branch, String.valueOf(id));
+ }
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoCiAdapter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoCiAdapter.java
new file mode 100644
index 0000000000..b158654eee
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoCiAdapter.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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;
+
+/**
+ * @author Angel Avila
+ */
+public class DispoCiAdapter {
+
+}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoItemArtifact.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoItemArtifact.java
index 90acc22735..b11654172f 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoItemArtifact.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoItemArtifact.java
@@ -175,4 +175,5 @@ public class DispoItemArtifact extends BaseIdentity<String> implements DispoItem
public String getTeam() {
return artifact.getSoleAttributeAsString(DispoConstants.DispoItemTeam, "");
}
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java
index 8a596b0394..ab4b554cb8 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java
@@ -53,4 +53,6 @@ public interface DispoQuery {
DispoConfig findDispoConfig(BranchId branch);
+ Long getDispoItemParentSet(BranchId branch, String itemId);
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
index 46ae2ce0e5..c3db4bfa3e 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
@@ -86,4 +86,10 @@ public class DispoSetArtifact extends BaseIdentity<String> implements DispoSet {
public String getDispoType() {
return artifact.getSoleAttributeAsString(DispoConstants.DispoType, "");
}
+
+ @Override
+ public String getCiSet() {
+ return artifact.getSoleAttributeAsString(DispoConstants.DispoCiSet, "");
+ }
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java
index 1759a17ae9..96e6f6b98f 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java
@@ -14,6 +14,7 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.osee.disposition.model.DispoItem;
import org.eclipse.osee.disposition.model.DispoSet;
+import org.eclipse.osee.disposition.model.DispoStorageMetadata;
import org.eclipse.osee.disposition.model.OperationReport;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -35,9 +36,9 @@ public interface DispoWriter {
boolean deleteDispoItem(ArtifactReadable author, BranchId branch, String itemId);
- void updateDispoItem(ArtifactReadable author, BranchId branch, String dispoItemId, DispoItem data);
+ void updateDispoItem(ArtifactReadable author, BranchId branch, String dispoItemId, DispoItem data, DispoStorageMetadata metadata);
- void updateDispoItems(ArtifactReadable author, BranchId branch, Collection<DispoItem> data, boolean resetRerunFlag, String operation);
+ void updateDispoItems(ArtifactReadable author, BranchId branch, Collection<DispoItem> data, boolean resetRerunFlag, String operation, DispoStorageMetadata metadata);
void updateOperationSummary(ArtifactReadable author, BranchId branch, String setId, OperationReport summary);
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 46ed20c7a1..f877163514 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
@@ -25,6 +25,7 @@ import java.util.Set;
import org.eclipse.osee.disposition.model.DispoConfig;
import org.eclipse.osee.disposition.model.DispoItem;
import org.eclipse.osee.disposition.model.DispoSet;
+import org.eclipse.osee.disposition.model.DispoStorageMetadata;
import org.eclipse.osee.disposition.model.OperationReport;
import org.eclipse.osee.disposition.rest.DispoConstants;
import org.eclipse.osee.disposition.rest.internal.importer.coverage.CoverageUtil;
@@ -235,6 +236,7 @@ public class OrcsStorageImpl implements Storage {
tx.setSoleAttributeFromString(creatdArtId, DispoConstants.DispoType, descriptor.getDispoType());
JSONArray notesJarray = DispoUtil.noteListToJsonObj(descriptor.getNotesList());
tx.setSoleAttributeFromString(creatdArtId, DispoConstants.DispoNotesJson, notesJarray.toString());
+ tx.setSoleAttributeFromString(creatdArtId, DispoConstants.DispoCiSet, descriptor.getCiSet());
tx.commit();
return creatdArtId.getUuid();
}
@@ -269,6 +271,7 @@ public class OrcsStorageImpl implements Storage {
String name = newData.getName();
String importPath = newData.getImportPath();
+ String ciSet = newData.getCiSet();
JSONArray notesList = null;
if (newData.getNotesList() != null) {
@@ -285,6 +288,9 @@ public class OrcsStorageImpl implements Storage {
if (notesList != null && !notesList.toString().equals(origSetAs.getNotesList().toString())) {
tx.setSoleAttributeFromString(dispoSet, DispoConstants.DispoNotesJson, notesList.toString());
}
+ if (ciSet != null && !ciSet.equals(origSetAs.getCiSet())) {
+ tx.setSoleAttributeFromString(dispoSet, DispoConstants.DispoCiSet, ciSet);
+ }
tx.commit();
}
@@ -328,7 +334,7 @@ public class OrcsStorageImpl implements Storage {
tx.commit();
}
- private void updateSingleItem(ArtifactReadable author, BranchId branch, ArtifactReadable currentItemArt, DispoItem newItemData, TransactionBuilder tx, boolean resetRerunFlag) {
+ private void updateSingleItem(ArtifactReadable author, BranchId branch, ArtifactReadable currentItemArt, DispoItem newItemData, TransactionBuilder tx, boolean resetRerunFlag, DispoStorageMetadata metadata) {
Date lastUpdate = newItemData.getLastUpdate();
String name = newItemData.getName();
@@ -379,6 +385,7 @@ public class OrcsStorageImpl implements Storage {
tx.setSoleAttributeFromString(currentItemArt, DispoConstants.DispoItemAssignee, assignee);
}
if (status != null && !status.equals(origItem.getStatus())) {
+ metadata.addIdOfUpdatedItem(newItemData.getGuid());
tx.setSoleAttributeFromString(currentItemArt, DispoConstants.DispoItemStatus, status);
}
if (lastUpdate != null && !lastUpdate.equals(origItem.getLastUpdate())) {
@@ -418,15 +425,15 @@ public class OrcsStorageImpl implements Storage {
}
@Override
- public void updateDispoItem(ArtifactReadable author, BranchId branch, String dispoItemId, DispoItem data) {
+ public void updateDispoItem(ArtifactReadable author, BranchId branch, String dispoItemId, DispoItem data, DispoStorageMetadata metadata) {
TransactionBuilder tx = getTxFactory().createTransaction(branch, author, "Update Dispo Item");
ArtifactReadable dispoItemArt = findDispoArtifact(branch, dispoItemId, DispoConstants.DispoItem);
- updateSingleItem(author, branch, dispoItemArt, data, tx, false);
+ updateSingleItem(author, branch, dispoItemArt, data, tx, false, metadata);
tx.commit();
}
@Override
- public void updateDispoItems(ArtifactReadable author, BranchId branch, Collection<DispoItem> data, boolean resetRerunFlag, String operation) {
+ public void updateDispoItems(ArtifactReadable author, BranchId branch, Collection<DispoItem> data, boolean resetRerunFlag, String operation, DispoStorageMetadata metadata) {
TransactionBuilder tx = getTxFactory().createTransaction(branch, author, operation);
boolean isCommitNeeded = false;
@@ -435,7 +442,7 @@ public class OrcsStorageImpl implements Storage {
if (Strings.isValid(itemId)) {
isCommitNeeded = true;
ArtifactReadable dispoItemArt = findDispoArtifact(branch, newItem.getGuid(), DispoConstants.DispoItem);
- updateSingleItem(author, branch, dispoItemArt, newItem, tx, resetRerunFlag);
+ updateSingleItem(author, branch, dispoItemArt, newItem, tx, resetRerunFlag, metadata);
}
}
@@ -572,4 +579,11 @@ public class OrcsStorageImpl implements Storage {
DispoUtil.operationReportToString(newReport));
tx.commit();
}
+
+ @Override
+ public Long getDispoItemParentSet(BranchId branch, String itemId) {
+ ArtifactReadable artifact = findDispoArtifact(branch, itemId, DispoConstants.DispoItem);
+ return artifact.getParent().getUuid();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
index 630109112d..3f528dcbe6 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
@@ -11,6 +11,7 @@ artifactType "Disposition Set" extends "Artifact" {
attribute "dispo.Summary Count"
attribute "dispo.Dispo Config"
attribute "dispo.Operation Summary"
+ attribute "dispo.CI Set"
}
artifactType "dispo.Dispositionable Item" extends "Artifact" {
@@ -287,4 +288,13 @@ attributeType "dispo.Last Updated" extends DateAttribute {
min 0
max 1
mediaType "text/calendar"
+}
+
+attributeType "dispo.CI Set" extends StringAttribute {
+ id 5225296359986133054
+ dataProvider DefaultAttributeDataProvider
+ min 0
+ max 1
+ defaultValue ""
+ mediaType "text/plain"
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
index 7ff3918545..eb2fc601e9 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
@@ -139,4 +139,5 @@ public class DispoAdminResource {
status = Status.OK;
return Response.status(status).build();
}
+
}
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 872e3c92a3..7dacbf3ab3 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
@@ -253,6 +253,9 @@ public final class DispoUtil {
}
dispoSet.setNotesList(notesList);
}
+ if (jsonObject.has("ciSet")) {
+ dispoSet.setCiSet(jsonObject.getString("ciSet"));
+ }
} catch (JSONException ex) {
throw new OseeCoreException("Error deserializing a Dispositionable Item.", ex);
}
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
index ddbda580a9..375fad1ea3 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
@@ -331,7 +331,28 @@ app.controller('adminController', [
$scope.isRunningOperation = false;
$scope.getSetImportDetails(destinationSet);
});
- }
+ };
+
+
+ $scope.configureCiSet = function setCiSet(inputs) {
+ var localSet = $scope.getSetById(inputs.ciDispositionSet);
+ localSet.ciSet = inputs.ciSet;
+ Set.update({
+ programId: $scope.programSelection,
+ setId: inputs.ciDispositionSet,
+ }, localSet);
+ };
+
+
+ $scope.massSendDispoItemStatus = function massSendDispoItemStatus (set) {
+ var newSet = $scope.getSetById(set.ciDispositionSet);
+ newSet.operation = "MassSendDispoItemStatus";
+ Set.update({
+ programId: $scope.programSelection,
+ setId: set.ciDispositionSet
+ }, newSet);
+ };
+
// -------------------- Summary Grids ----------------------\\
var filterBarPlugin = {
@@ -653,7 +674,73 @@ app.controller('adminController', [
$modalInstance.dismiss('cancel');
};
};
+
+ // Configure/Set CI Set
+ $scope.openConfigureCiSetModal = function() {
+ var modalInstance = $modal.open({
+ templateUrl: 'configureCiSet.html',
+ controller: ConfigureCiSetCtrl,
+ size: 'sm',
+ windowClass: 'ConfigureCiSetModal',
+ resolve: {
+ sets: function() {
+ return $scope.sets;
+ }
+ }
+ });
+ modalInstance.result.then(function(inputs) {
+ $scope.configureCiSet(inputs);
+ });
+ }
+
+ var ConfigureCiSetCtrl = function($scope, $modalInstance, sets) {
+ $scope.ciSet = "";
+ $scope.ciDispositionSet = "";
+ $scope.setsLocal = angular.copy(sets);
+ $scope.ok = function() {
+ var inputs = {};
+ inputs.ciSet = this.ciSet
+ inputs.ciDispositionSet = this.dispositionSet;
+ $modalInstance.close(inputs);
+ };
+ $scope.cancel = function() {
+ $modalInstance.dismiss('cancel');
+ };
+ }
+
+ // Mass Send Disposition Item Status
+ $scope.openMassSendDispoItemStatusModal = function() {
+ var modalInstance = $modal.open({
+ templateUrl: 'massSendDispoItemStatus.html',
+ controller: MassSendDispoItemStatusCtrl,
+ size: 'sm',
+ windowClass: 'MassSendDispoItemStatusModal',
+ resolve: {
+ sets: function() {
+ return $scope.sets;
+ }
+ }
+ });
+
+ modalInstance.result.then(function(inputs) {
+ $scope.massSendDispoItemStatus(inputs);
+ });
+ }
+
+ var MassSendDispoItemStatusCtrl = function($scope, $modalInstance, sets) {
+ $scope.ciDispositionSet = "";
+ $scope.setsLocal = angular.copy(sets);
+ $scope.ok = function() {
+ var inputs = {};
+ inputs.ciDispositionSet = this.dispositionSet;
+ $modalInstance.close(inputs);
+ };
+
+ $scope.cancel = function() {
+ $modalInstance.dismiss('cancel');
+ };
+ }
}
]); \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js
index e740f046f2..5dd107798c 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js
@@ -277,4 +277,6 @@ app.provider('Annotation', function() {
return Annotation;
}
];
-}); \ No newline at end of file
+});
+
+
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html b/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
index 6368890266..0d10da4dde 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
@@ -50,6 +50,8 @@
<div class="btn-group btn-group-md" role="group"">
<button ng-disabled="isRunningOperation" ng-click="openCopySetModal()" ng-show="sets.length > 0" class="btn btn-primary" id=generateReportBtn>Merge Annotations</button>
<button ng-disabled="isRunningOperation" ng-click="openMassAssignTeamModal()" ng-show="sets.length > 0" class="btn btn-primary" id=generateReportBtn>Mass Assign Team</button>
+ <button ng-disabled="isRunningOperation" ng-click="openConfigureCiSetModal()" ng-show="sets.length > 0" class="btn btn-primary" id=generateReportBtn>Configure CI Set</button>
+ <button ng-disabled="isRunningOperation" ng-click="openMassSendDispoItemStatusModal()" ng-show="sets.length > 0" class="btn btn-primary" id=generateReportBtn>Mass Send Dispo Item Status</button>
</div>
</div>
</div>
@@ -199,6 +201,47 @@
</div>
</script>
+
+ <script type="text/ng-template" id="configureCiSet.html">
+ <div class="modal-header">
+ <h3 class="modal-title">Add CI Set</h3>
+ </div>
+ <div class="modal-body" overflow: auto;">
+ <div class="form-group">
+ Select Disposition Set
+ <select class="form-control" ng-model="dispositionSet" ng-options="obj.guid as obj.name for obj in setsLocal">
+ </select>
+ </div>
+ <div class="form-group">
+ CI Set:
+ <input class="form-control" ng-model="ciSet"></input>
+ </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>
+
+ <script type="text/ng-template" id="massSendDispoItemStatus.html">
+ <div class="modal-header">
+ <h3 class="modal-title">Mass Send Disposition Items Status</h3>
+ </div>
+ <div class="modal-body" overflow: auto;">
+ <div class="form-group">
+ Select Disposition Set
+ <select class="form-control" ng-model="dispositionSet" ng-options="obj.guid as obj.name for obj in setsLocal">
+ </select>
+ </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>

Back to the top