Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-04-07 20:33:08 +0000
committerrescobar2010-04-07 20:33:08 +0000
commitc3bcc6f58041466411ce81e68501edc81f6a97fc (patch)
treee7ba5849e675e0d76bc3d96a9a7609d32e32256a /plugins
parent5a03f252d6a18ef0b0dbab13348402893a99a185 (diff)
downloadorg.eclipse.osee-c3bcc6f58041466411ce81e68501edc81f6a97fc.tar.gz
org.eclipse.osee-c3bcc6f58041466411ce81e68501edc81f6a97fc.tar.xz
org.eclipse.osee-c3bcc6f58041466411ce81e68501edc81f6a97fc.zip
"Team Workflow" - UR8MZ - "Word Change Report Showing Changes Incorrectly"
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadChangeDataOperation.java22
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/AddArtifactChangeData.java15
-rw-r--r--plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeTestUtility.java5
-rw-r--r--plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeVersionTest.java14
-rw-r--r--plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockChangeItem.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockDataFactory.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/translation/DataAsserts.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/util/ChangeItemUtilTest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactChangeItem.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeChangeItem.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeItem.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeVersion.java14
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationChangeItem.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeItemTranslator.java7
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeVersionTranslator.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/ChangeItemUtil.java1
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java11
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java18
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java9
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java5
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java114
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordEditTest.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevertArtifactHandler.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowPreviewHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java122
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/ArtifactDiffMenu.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WholeWordCompare.java19
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordChangeReportOperation.java12
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java42
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeLabelProvider.java215
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeTextFilter.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java2
44 files changed, 374 insertions, 398 deletions
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadChangeDataOperation.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadChangeDataOperation.java
index be13d271e33..ef48943b0d9 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadChangeDataOperation.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadChangeDataOperation.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.branch.management.change;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map.Entry;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.branch.management.internal.Activator;
import org.eclipse.osee.framework.core.data.ArtifactChangeItem;
@@ -31,7 +32,6 @@ import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.JoinUtility;
import org.eclipse.osee.framework.database.core.JoinUtility.IdJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility.TransactionJoinQuery;
-import org.eclipse.osee.framework.jdk.core.type.Pair;
/**
* @author Ryan D. Brooks
@@ -49,8 +49,8 @@ public class LoadChangeDataOperation extends AbstractOperation {
private final HashMap<Integer, ChangeItem> artifactChangesByItemId = new HashMap<Integer, ChangeItem>();
private final HashMap<Integer, ChangeItem> relationChangesByItemId = new HashMap<Integer, ChangeItem>();
private final HashMap<Integer, ChangeItem> attributeChangesByItemId = new HashMap<Integer, ChangeItem>();
- private final HashMap<Long, Pair<Integer, ModificationType>> changeByGammaId =
- new HashMap<Long, Pair<Integer, ModificationType>>();
+ private final HashMap<Long, ModificationType> changeByGammaId =
+ new HashMap<Long, ModificationType>();
private final Collection<ChangeItem> changeData;
private final TransactionRecord sourceTransaction;
@@ -128,8 +128,7 @@ public class LoadChangeDataOperation extends AbstractOperation {
while (chStmt.next()) {
checkForCancelledStatus(monitor);
txJoin.add(chStmt.getLong("gamma_id"), -1);
- changeByGammaId.put(chStmt.getLong("gamma_id"), new Pair<Integer, ModificationType>(
- sourceTransaction.getId(), ModificationType.getMod(chStmt.getInt("mod_type"))));
+ changeByGammaId.put(chStmt.getLong("gamma_id"), ModificationType.getMod(chStmt.getInt("mod_type")));
}
txJoin.store();
} finally {
@@ -147,9 +146,9 @@ public class LoadChangeDataOperation extends AbstractOperation {
chStmt.runPreparedQuery(10000, query, queryId);
while (chStmt.next()) {
checkForCancelledStatus(monitor);
- Pair<Integer, ModificationType> txsTableData = changeByGammaId.get(chStmt.getLong("gamma_id"));
+ ModificationType modType = changeByGammaId.get(chStmt.getLong("gamma_id"));
ArtifactChangeItem changeItem =
- new ArtifactChangeItem(chStmt.getLong("gamma_id"), txsTableData.getSecond(), txsTableData.getFirst(),
+ new ArtifactChangeItem(chStmt.getLong("gamma_id"), modType,
chStmt.getInt("art_id"));
changesByItemId.put(changeItem.getItemId(), changeItem);
}
@@ -167,10 +166,9 @@ public class LoadChangeDataOperation extends AbstractOperation {
chStmt.runPreparedQuery(10000, query, queryId);
while (chStmt.next()) {
checkForCancelledStatus(monitor);
- Pair<Integer, ModificationType> txsTableData = changeByGammaId.get(chStmt.getLong("gamma_id"));
+ ModificationType modType = changeByGammaId.get(chStmt.getLong("gamma_id"));
AttributeChangeItem changeItem =
- new AttributeChangeItem(chStmt.getLong("gamma_id"), txsTableData.getSecond(),
- txsTableData.getFirst(), chStmt.getInt("attr_id"), chStmt.getInt("art_id"),
+ new AttributeChangeItem(chStmt.getLong("gamma_id"), modType, chStmt.getInt("attr_id"), chStmt.getInt("art_id"),
chStmt.getString("value"));
changesByItemId.put(changeItem.getItemId(), changeItem);
@@ -189,9 +187,9 @@ public class LoadChangeDataOperation extends AbstractOperation {
chStmt.runPreparedQuery(10000, query, queryId);
while (chStmt.next()) {
checkForCancelledStatus(monitor);
- Pair<Integer, ModificationType> txsTableData = changeByGammaId.get(chStmt.getLong("gamma_id"));
+ ModificationType modType = changeByGammaId.get(chStmt.getLong("gamma_id"));
RelationChangeItem changeItem =
- new RelationChangeItem(chStmt.getLong("gamma_id"), txsTableData.getSecond(), txsTableData.getFirst(),
+ new RelationChangeItem(chStmt.getLong("gamma_id"), modType,
chStmt.getInt("a_art_id"), chStmt.getInt("b_art_id"), chStmt.getInt("rel_link_id"),
chStmt.getInt("rel_link_type_id"), chStmt.getString("rationale"));
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/AddArtifactChangeData.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/AddArtifactChangeData.java
index 8b345f44108..cf13df93ba5 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/AddArtifactChangeData.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/AddArtifactChangeData.java
@@ -15,11 +15,11 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.data.ArtifactChangeItem;
import org.eclipse.osee.framework.core.data.AttributeChangeItem;
import org.eclipse.osee.framework.core.data.ChangeItem;
-import org.eclipse.osee.framework.core.data.ChangeVersion;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.util.ChangeItemUtil;
@@ -53,7 +53,7 @@ public class AddArtifactChangeData extends AbstractOperation {
if (artifactChange == null) {
artifactChange = syntheticArtifactChanges.get(artIdToCheck);
if (artifactChange == null) {
- artifactChange = new ArtifactChangeItem(-1, null, -1, artIdToCheck);
+ artifactChange = new ArtifactChangeItem(-1, null, artIdToCheck);
syntheticArtifactChanges.put(artIdToCheck, artifactChange);
}
attrItems.add(attributeChange);
@@ -62,17 +62,6 @@ public class AddArtifactChangeData extends AbstractOperation {
}
}
changeItems.addAll(syntheticArtifactChanges.values());
-
- for (AttributeChangeItem item : attrItems) {
- AttributeChangeItem attributeChange = item;
- if (attributeChange.getNetChange().isValid()) {
- ChangeVersion netVersion = attributeChange.getNetChange();
- if (ChangeItemUtil.isNew(netVersion) || ChangeItemUtil.isIntroduced(netVersion)) {
- ArtifactChangeItem artifactChange = syntheticArtifactChanges.get(attributeChange.getArtId());
- ChangeItemUtil.copy(artifactChange.getBaselineVersion(), attributeChange.getBaselineVersion());
- }
- }
- }
}
private void updateArtifactChangeItem(ArtifactChangeItem artifact, AttributeChangeItem attribute) {
diff --git a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeTestUtility.java b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeTestUtility.java
index a4250ed8001..ac0d2c74f8f 100644
--- a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeTestUtility.java
+++ b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeTestUtility.java
@@ -25,7 +25,7 @@ public class ChangeTestUtility {
}
public static ChangeVersion createChange(Long long1, ModificationType mod1) {
- return new ChangeVersion(long1, mod1, 0);
+ return new ChangeVersion(long1, mod1);
}
public static void checkChange(String message, ChangeVersion expected, ChangeVersion actual) {
@@ -33,7 +33,6 @@ public class ChangeTestUtility {
Assert.assertEquals(message, expected.getModType(), actual.getModType());
Assert.assertEquals(message, expected.getValue(), actual.getValue());
- Assert.assertEquals(message, expected.getTransactionNumber(), actual.getTransactionNumber());
}
public static void checkChange(ChangeVersion expected, ChangeVersion actual) {
@@ -42,7 +41,7 @@ public class ChangeTestUtility {
public static ChangeItem createItem(int itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net) {
MockChangeItem change =
- new MockChangeItem(current.getGammaId(), current.getModType(), current.getTransactionNumber());
+ new MockChangeItem(current.getGammaId(), current.getModType());
change.setItemId(itemId);
if (base != null) {
change.getBaselineVersion().copy(base);
diff --git a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeVersionTest.java b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeVersionTest.java
index 12283f6b1b2..c2c98e7f6c3 100644
--- a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeVersionTest.java
+++ b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/data/ChangeVersionTest.java
@@ -28,14 +28,14 @@ public class ChangeVersionTest {
ChangeVersion expected = new ChangeVersion();
ChangeTestUtility.checkChange(expected, actual);
- actual = new ChangeVersion(45L, ModificationType.NEW, 54);
+ actual = new ChangeVersion(45L, ModificationType.NEW);
expected.setValue(null);
expected.setGammaId(45L);
expected.setModType(ModificationType.NEW);
expected.setTransactionNumber(54);
ChangeTestUtility.checkChange(expected, actual);
- actual = new ChangeVersion("hello", 47L, ModificationType.MERGED, 46);
+ actual = new ChangeVersion("hello", 47L, ModificationType.MERGED);
expected.setValue("hello");
expected.setGammaId(47L);
expected.setModType(ModificationType.MERGED);
@@ -45,12 +45,12 @@ public class ChangeVersionTest {
@Test
public void testCopy() {
- ChangeVersion expected = new ChangeVersion("hello", 47L, ModificationType.MERGED, 46);
+ ChangeVersion expected = new ChangeVersion("hello", 47L, ModificationType.MERGED);
ChangeVersion actual = new ChangeVersion();
actual.copy(expected);
ChangeTestUtility.checkChange(expected, actual);
- expected = new ChangeVersion(null, 47L, ModificationType.MERGED, null);
+ expected = new ChangeVersion(null, 47L, ModificationType.MERGED);
actual.copy(expected);
ChangeTestUtility.checkChange(expected, actual);
}
@@ -69,8 +69,8 @@ public class ChangeVersionTest {
@Test
public void testEquals() {
- ChangeVersion actual1 = new ChangeVersion("hello", 47L, ModificationType.MERGED, 46);
- ChangeVersion actual2 = new ChangeVersion("hello", 47L, ModificationType.MERGED, 46);
+ ChangeVersion actual1 = new ChangeVersion("hello", 47L, ModificationType.MERGED);
+ ChangeVersion actual2 = new ChangeVersion("hello", 47L, ModificationType.MERGED);
ChangeVersion expected = new ChangeVersion();
Assert.assertEquals(actual2, actual1);
@@ -90,7 +90,7 @@ public class ChangeVersionTest {
@Test
public void testToString() {
- ChangeVersion actual1 = new ChangeVersion("hello", 47L, ModificationType.MERGED, 46);
+ ChangeVersion actual1 = new ChangeVersion("hello", 47L, ModificationType.MERGED);
Assert.assertEquals("[46,47,MERGED]", actual1.toString());
ChangeVersion expected = new ChangeVersion();
diff --git a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockChangeItem.java b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockChangeItem.java
index 829669738d8..ae2578c82b6 100644
--- a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockChangeItem.java
+++ b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockChangeItem.java
@@ -18,8 +18,8 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
*/
public class MockChangeItem extends ChangeItem {
- public MockChangeItem(long currentSourceGammaId, ModificationType currentSourceModType, int currentSourceTransactionNumber) {
- super(currentSourceGammaId, currentSourceModType, currentSourceTransactionNumber);
+ public MockChangeItem(long currentSourceGammaId, ModificationType currentSourceModType) {
+ super(currentSourceGammaId, currentSourceModType);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockDataFactory.java b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockDataFactory.java
index dbd04f3d8c8..66e1347e473 100644
--- a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockDataFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/MockDataFactory.java
@@ -14,6 +14,7 @@ package org.eclipse.osee.framework.core.test.mocks;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+
import org.eclipse.osee.framework.core.cache.ArtifactTypeCache;
import org.eclipse.osee.framework.core.cache.AttributeTypeCache;
import org.eclipse.osee.framework.core.cache.BranchCache;
@@ -73,11 +74,10 @@ public final class MockDataFactory {
public static ArtifactChangeItem createArtifactChangeItem() throws OseeArgumentException {
int artId = (int) Math.random();
- int transactionNumber = (int) Math.random();
Long gammaIdNumber = Long.valueOf((int) Math.random());
ArtifactChangeItem changeItem =
- new ArtifactChangeItem(gammaIdNumber, ModificationType.getMod(1), transactionNumber, artId);
+ new ArtifactChangeItem(gammaIdNumber, ModificationType.getMod(1), artId);
populateChangeVersion(changeItem.getDestinationVersion(), 22);
populateChangeVersion(changeItem.getCurrentVersion(), 15);
return changeItem;
@@ -85,7 +85,7 @@ public final class MockDataFactory {
public static ChangeVersion createChangeVersion(int index) {
ModificationType modType = ModificationType.values()[index % ModificationType.values().length];
- return new ChangeVersion("change_version_value_" + index, (long) (index * Integer.MAX_VALUE), modType, index * 11);
+ return new ChangeVersion("change_version_value_" + index, (long) (index * Integer.MAX_VALUE), modType);
}
public static void populateChangeVersion(ChangeVersion changeVersion, int index) {
diff --git a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/translation/DataAsserts.java b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/translation/DataAsserts.java
index ae6875dfa47..35ffdc14940 100644
--- a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/translation/DataAsserts.java
+++ b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/translation/DataAsserts.java
@@ -11,7 +11,9 @@
package org.eclipse.osee.framework.core.test.translation;
import java.util.List;
+
import junit.framework.Assert;
+
import org.eclipse.osee.framework.core.data.BranchCommitRequest;
import org.eclipse.osee.framework.core.data.BranchCommitResponse;
import org.eclipse.osee.framework.core.data.BranchCreationRequest;
@@ -207,7 +209,6 @@ public final class DataAsserts {
Assert.assertEquals(expected.isValid(), actual.isValid());
Assert.assertEquals(expected.getGammaId(), actual.getGammaId());
Assert.assertEquals(expected.getModType(), actual.getModType());
- Assert.assertEquals(expected.getTransactionNumber(), actual.getTransactionNumber());
Assert.assertEquals(expected.getValue(), actual.getValue());
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/util/ChangeItemUtilTest.java b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/util/ChangeItemUtilTest.java
index 507c5b32288..211b3501ad3 100644
--- a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/util/ChangeItemUtilTest.java
+++ b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/util/ChangeItemUtilTest.java
@@ -14,8 +14,10 @@ package org.eclipse.osee.framework.core.test.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+
import java.util.ArrayList;
import java.util.List;
+
import org.eclipse.osee.framework.core.data.ChangeItem;
import org.eclipse.osee.framework.core.data.ChangeVersion;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -328,7 +330,7 @@ public class ChangeItemUtilTest {
@Test
public void testCopy() throws OseeCoreException {
- ChangeVersion expected = new ChangeVersion(5679L, ModificationType.MERGED, 1234);
+ ChangeVersion expected = new ChangeVersion(5679L, ModificationType.MERGED);
ChangeVersion actual = new ChangeVersion();
ChangeItemUtil.copy(expected, actual);
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactChangeItem.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactChangeItem.java
index 1fb34f0297c..92ab3f7152b 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactChangeItem.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactChangeItem.java
@@ -17,8 +17,8 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
*/
public class ArtifactChangeItem extends ChangeItem {
- public ArtifactChangeItem(long currentSourceGammaId, ModificationType currentSourceModType, int currentSourceTransactionNumber, int artId) {
- super(currentSourceGammaId, currentSourceModType, currentSourceTransactionNumber);
+ public ArtifactChangeItem(long currentSourceGammaId, ModificationType currentSourceModType, int artId) {
+ super(currentSourceGammaId, currentSourceModType);
this.setItemId(artId);
this.setArtId(artId);
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeChangeItem.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeChangeItem.java
index 19d511d8b2c..e0037f1fc1c 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeChangeItem.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeChangeItem.java
@@ -17,8 +17,8 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
*/
public class AttributeChangeItem extends ChangeItem {
- public AttributeChangeItem(long currentSourceGammaId, ModificationType currentSourceModType, int currentSourceTransactionNumber, int attrId, int artId, String value) {
- super(currentSourceGammaId, currentSourceModType, currentSourceTransactionNumber);
+ public AttributeChangeItem(long currentSourceGammaId, ModificationType currentSourceModType, int attrId, int artId, String value) {
+ super(currentSourceGammaId, currentSourceModType);
this.setItemId(attrId);
this.setArtId(artId);
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeItem.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeItem.java
index e7acd792d41..262db4c6072 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeItem.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeItem.java
@@ -25,9 +25,9 @@ public abstract class ChangeItem {
private final ChangeVersion destinationEntry;
private final ChangeVersion netEntry;
- protected ChangeItem(long currentSourceGammaId, ModificationType currentSourceModType, int currentSourceTransactionNumber) {
+ protected ChangeItem(long currentSourceGammaId, ModificationType currentSourceModType) {
super();
- this.currentEntry = new ChangeVersion(currentSourceGammaId, currentSourceModType, currentSourceTransactionNumber);
+ this.currentEntry = new ChangeVersion(currentSourceGammaId, currentSourceModType);
this.baseEntry = new ChangeVersion();
this.firstChange = new ChangeVersion();
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeVersion.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeVersion.java
index 0c364def47d..5c0a7f2952f 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeVersion.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ChangeVersion.java
@@ -25,16 +25,15 @@ public final class ChangeVersion {
this(null, null, null);
}
- public ChangeVersion(Long gammaId, ModificationType modType, Integer transactionNumber) {
- this(null, gammaId, modType, transactionNumber);
+ public ChangeVersion(Long gammaId, ModificationType modType) {
+ this(null, gammaId, modType);
}
- public ChangeVersion(String value, Long gammaId, ModificationType modType, Integer transactionNumber) {
+ public ChangeVersion(String value, Long gammaId, ModificationType modType) {
super();
this.value = value;
this.gammaId = gammaId;
this.modType = modType;
- this.transactionNumber = transactionNumber;
}
public Long getGammaId() {
@@ -49,10 +48,6 @@ public final class ChangeVersion {
return value;
}
- public Integer getTransactionNumber() {
- return transactionNumber;
- }
-
public void setTransactionNumber(Integer transactionNumber) {
this.transactionNumber = transactionNumber;
}
@@ -76,13 +71,12 @@ public final class ChangeVersion {
public void copy(ChangeVersion item) {
setGammaId(item.getGammaId());
setModType(item.getModType());
- setTransactionNumber(item.getTransactionNumber());
setValue(item.getValue());
}
@Override
public String toString() {
- return String.format("[%s,%s,%s]", getTransactionNumber(), getGammaId(), getModType());
+ return String.format("[%s,%s]", getGammaId(), getModType());
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationChangeItem.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationChangeItem.java
index dba1dcb2f2b..4dd04a9bf01 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationChangeItem.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationChangeItem.java
@@ -20,8 +20,8 @@ public class RelationChangeItem extends ChangeItem {
private final int relTypeId;
private final String rationale;
- public RelationChangeItem(long currentSourceGammaId, ModificationType currentSourceModType, int currentSourceTansactionNumber, int aArtId, int bArtId, int relLinkId, int relTypeId, String rationale) {
- super(currentSourceGammaId, currentSourceModType, currentSourceTansactionNumber);
+ public RelationChangeItem(long currentSourceGammaId, ModificationType currentSourceModType, int aArtId, int bArtId, int relLinkId, int relTypeId, String rationale) {
+ super(currentSourceGammaId, currentSourceModType);
this.setItemId(relLinkId);
this.getCurrentVersion().setValue(rationale);
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeItemTranslator.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeItemTranslator.java
index fa918b2a48c..bacf85aa584 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeItemTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeItemTranslator.java
@@ -74,12 +74,12 @@ public class ChangeItemTranslator implements ITranslator<ChangeItem> {
case ARTIFACT:
changeItem =
new ArtifactChangeItem(currentChangeVersion.getGammaId(), currentChangeVersion.getModType(),
- currentChangeVersion.getTransactionNumber(), artId);
+ artId);
break;
case ATTRIBUTE:
changeItem =
new AttributeChangeItem(currentChangeVersion.getGammaId(), currentChangeVersion.getModType(),
- currentChangeVersion.getTransactionNumber(), itemId, artId, currentChangeVersion.getValue());
+ itemId, artId, currentChangeVersion.getValue());
break;
case RELATION:
int bArtId = Integer.parseInt(propertyStore.get(Entry.B_ART_ID.name()));
@@ -88,7 +88,7 @@ public class ChangeItemTranslator implements ITranslator<ChangeItem> {
changeItem =
new RelationChangeItem(currentChangeVersion.getGammaId(), currentChangeVersion.getModType(),
- currentChangeVersion.getTransactionNumber(), artId, bArtId, itemId, relTypeId, rationale);
+ artId, bArtId, itemId, relTypeId, rationale);
break;
default:
throw new OseeStateException("Invalid change item type");
@@ -102,7 +102,6 @@ public class ChangeItemTranslator implements ITranslator<ChangeItem> {
if (srcVersion != null && destVersion != null && srcVersion.isValid()) {
destVersion.setGammaId(srcVersion.getGammaId());
destVersion.setModType(srcVersion.getModType());
- destVersion.setTransactionNumber(srcVersion.getTransactionNumber());
destVersion.setValue(srcVersion.getValue());
}
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeVersionTranslator.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeVersionTranslator.java
index db42467ecd6..bf5a60bb2f3 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeVersionTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/translation/ChangeVersionTranslator.java
@@ -23,7 +23,6 @@ public class ChangeVersionTranslator implements ITranslator<ChangeVersion> {
GAMMA_ID,
MOD_TYPE,
VALUE,
- TRANSACTION_NUMBER,
IS_VALID;
}
@@ -40,11 +39,9 @@ public class ChangeVersionTranslator implements ITranslator<ChangeVersion> {
ModificationType modificationType =
ModificationType.getMod(Integer.parseInt(propertyStore.get(Entry.MOD_TYPE.name())));
Long gammaId = Long.parseLong(propertyStore.get(Entry.GAMMA_ID.name()));
- Integer transactionNumber = Integer.parseInt(propertyStore.get(Entry.TRANSACTION_NUMBER.name()));
changeVersion.setGammaId(gammaId);
changeVersion.setModType(modificationType);
- changeVersion.setTransactionNumber(transactionNumber);
changeVersion.setValue(value);
}
return changeVersion;
@@ -59,7 +56,6 @@ public class ChangeVersionTranslator implements ITranslator<ChangeVersion> {
store.put(Entry.GAMMA_ID.name(), changeVersion.getGammaId());
store.put(Entry.MOD_TYPE.name(), changeVersion.getModType().getValue());
store.put(Entry.VALUE.name(), changeVersion.getValue());
- store.put(Entry.TRANSACTION_NUMBER.name(), changeVersion.getTransactionNumber());
}
return store;
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/ChangeItemUtil.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/ChangeItemUtil.java
index f31a7522f17..0b20ea662a3 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/ChangeItemUtil.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/ChangeItemUtil.java
@@ -49,7 +49,6 @@ public class ChangeItemUtil {
dest.setGammaId(source.getGammaId());
dest.setModType(source.getModType());
- dest.setTransactionNumber(source.getTransactionNumber());
dest.setValue(source.getValue());
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java
index a0699fbf5cb..83131786d21 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java
@@ -27,8 +27,8 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
*/
public final class ArtifactChange extends Change {
- public ArtifactChange(IOseeBranch branch, ArtifactType artType, int sourceGamma, int artId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, boolean isHistorical, Artifact artifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
- super(branch, artType, sourceGamma, artId, toTransactionId, fromTransactionId, modType, isHistorical, artifact);
+ public ArtifactChange(IOseeBranch branch, ArtifactType artType, int sourceGamma, int artId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, boolean isHistorical, Artifact toArtifact, Artifact fromArtifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
+ super(branch, artType, sourceGamma, artId, toTransactionId, fromTransactionId, modType, isHistorical, toArtifact, fromArtifact);
}
@Override
@@ -53,8 +53,8 @@ public final class ArtifactChange extends Change {
throw new IllegalArgumentException("adapter can not be null");
}
- if (adapter.isInstance(getArtifact())) {
- return getArtifact();
+ if (adapter.isInstance(getToArtifact())) {
+ return getToArtifact();
} else if (adapter.isInstance(getToTransactionId()) && isHistorical()) {
return getToTransactionId();
} else if (adapter.isInstance(this)) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeBuilder.java
index cbd6a73c40f..eead5b86a04 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeBuilder.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeBuilder.java
@@ -37,6 +37,6 @@ public class ArtifactChangeBuilder extends ChangeBuilder {
@Override
public Change build(Branch branch) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
return new ArtifactChange(branch, getArtifactType(), getSourceGamma(), getArtId(), getToTransactionId(),
- getFromTransactionId(), getModType(), isHistorical(), loadArtifact());
+ getFromTransactionId(), getModType(), isHistorical(), loadArtifact(), null);
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
index 027da1b4f32..bb541b91aa8 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
@@ -12,6 +12,7 @@
package org.eclipse.osee.framework.skynet.core.change;
import java.util.logging.Level;
+
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
@@ -40,8 +41,8 @@ public final class AttributeChange extends Change {
private AttributeType dynamicAttributeDescriptor;
private final ModificationType artModType;
- public AttributeChange(IOseeBranch branch, ArtifactType artType, int sourceGamma, int artId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, String isValue, String wasValue, int attrId, int attrTypeId, ModificationType artModType, boolean isHistorical, Artifact artifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
- super(branch, artType, sourceGamma, artId, toTransactionId, fromTransactionId, modType, isHistorical, artifact);
+ public AttributeChange(IOseeBranch branch, ArtifactType artType, int sourceGamma, int artId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, String isValue, String wasValue, int attrId, int attrTypeId, ModificationType artModType, boolean isHistorical, Artifact toArtifact, Artifact fromArtifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
+ super(branch, artType, sourceGamma, artId, toTransactionId, fromTransactionId, modType, isHistorical, toArtifact, fromArtifact);
this.isValue = isValue;
this.wasValue = wasValue;
this.attrId = attrId;
@@ -118,7 +119,7 @@ public final class AttributeChange extends Change {
}
public Attribute<?> getAttribute() throws OseeCoreException {
- for (Attribute<?> attribute : getArtifact().getAllAttributesIncludingHardDeleted()) {
+ for (Attribute<?> attribute : getToArtifact().getAllAttributesIncludingHardDeleted()) {
if (attribute.getId() == attrId) {
return attribute;
}
@@ -133,8 +134,8 @@ public final class AttributeChange extends Change {
}
try {
- if (adapter.isInstance(getArtifact())) {
- return getArtifact();
+ if (adapter.isInstance(getToArtifact())) {
+ return getToArtifact();
} else if (adapter.isInstance(getToTransactionId()) && isHistorical()) {
return getToTransactionId();
} else if (adapter.isInstance(this)) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeBuilder.java
index 2966ea8acac..cbc608f4cd4 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeBuilder.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeBuilder.java
@@ -44,6 +44,6 @@ public final class AttributeChangeBuilder extends ChangeBuilder {
public Change build(Branch branch) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
return new AttributeChange(branch, getArtifactType(), getSourceGamma(), getArtId(), getToTransactionId(),
getFromTransactionId(), getModType(), isValue, wasValue, attrId, attrTypeId, artModType, isHistorical(),
- loadArtifact());
+ loadArtifact(), null);
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
index 22b56940472..c391bb8cf16 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
@@ -30,13 +30,14 @@ public abstract class Change implements IAdaptable {
private final int artId;
private final TransactionRecord toTransactionId;
private TransactionRecord fromTransactionId;
- private final Artifact artifact;
+ private final Artifact toArtifact;
+ private final Artifact fromArtifact;
private ModificationType modType;
private final IOseeBranch branch;
private final ArtifactType artifactType;
private final boolean isHistorical;
- public Change(IOseeBranch branch, ArtifactType artifactType, int sourceGamma, int artId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, boolean isHistorical, Artifact artifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
+ public Change(IOseeBranch branch, ArtifactType artifactType, int sourceGamma, int artId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, boolean isHistorical, Artifact toArtifact, Artifact fromArtifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
super();
this.branch = branch;
this.sourceGamma = sourceGamma;
@@ -46,7 +47,8 @@ public abstract class Change implements IAdaptable {
this.modType = modType;
this.artifactType = artifactType;
this.isHistorical = isHistorical;
- this.artifact = artifact;
+ this.toArtifact = toArtifact;
+ this.fromArtifact = fromArtifact;
}
@Override
@@ -95,12 +97,16 @@ public abstract class Change implements IAdaptable {
return modType;
}
- public Artifact getArtifact() {
- return artifact;
+ public Artifact getToArtifact() {
+ return toArtifact;
}
+
+ public Artifact getFromArtifact(){
+ return fromArtifact;
+ }
public String getArtifactName() throws IllegalArgumentException, ArtifactDoesNotExist, MultipleArtifactsExist {
- return getArtifact().getName();
+ return getToArtifact().getName();
}
public int getGamma() {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java
index a2c67e7c4a5..4cca7371fd8 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java
@@ -24,7 +24,7 @@ public class ErrorChange extends Change {
public ErrorChange(IOseeBranch branch, ArtifactType artifactType, int sourceGamma, int artId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, boolean isHistorical, Artifact artifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
super(branch, artifactType, sourceGamma, artId, toTransactionId, fromTransactionId, modType, isHistorical,
- artifact);
+ artifact, null);
}
public ErrorChange(IOseeBranch branch, int artId, String exception) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
index a92443ff028..d6fa02a2852 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
@@ -12,6 +12,7 @@
package org.eclipse.osee.framework.skynet.core.change;
import java.util.logging.Level;
+
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
@@ -56,8 +57,8 @@ public final class RelationChange extends Change {
* @throws OseeDataStoreException
* @throws ArtifactDoesNotExist
*/
- public RelationChange(IOseeBranch branch, ArtifactType aArtType, int sourceGamma, int aArtId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, int bArtId, int relLinkId, String rationale, RelationType relationType, boolean isHistorical, Artifact artifact, Artifact bArtifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
- super(branch, aArtType, sourceGamma, aArtId, toTransactionId, fromTransactionId, modType, isHistorical, artifact);
+ public RelationChange(IOseeBranch branch, ArtifactType aArtType, int sourceGamma, int aArtId, TransactionRecord toTransactionId, TransactionRecord fromTransactionId, ModificationType modType, int bArtId, int relLinkId, String rationale, RelationType relationType, boolean isHistorical, Artifact toArtifact, Artifact bArtifact, Artifact fromArtifact) throws OseeDataStoreException, OseeTypeDoesNotExist, ArtifactDoesNotExist {
+ super(branch, aArtType, sourceGamma, aArtId, toTransactionId, fromTransactionId, modType, isHistorical, toArtifact, fromArtifact);
this.bArtId = bArtId;
this.relLinkId = relLinkId;
this.rationale = rationale;
@@ -73,8 +74,8 @@ public final class RelationChange extends Change {
}
try {
- if (adapter.isInstance(getArtifact())) {
- return getArtifact();
+ if (adapter.isInstance(getToArtifact())) {
+ return getToArtifact();
} else if (adapter.isInstance(getToTransactionId()) && isHistorical()) {
return getToTransactionId();
} else if (adapter.isInstance(this)) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeBuilder.java
index 33b9acae533..2559975cc49 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeBuilder.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeBuilder.java
@@ -44,7 +44,7 @@ public class RelationChangeBuilder extends ChangeBuilder {
}
return new RelationChange(branch, getArtifactType(), getSourceGamma(), getArtId(), getToTransactionId(),
getFromTransactionId(), getModType(), bArtId, relLinkId, rationale, relationType, isHistorical(),
- loadArtifact(), bArtifact);
+ loadArtifact(), bArtifact, null);
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java
index 303e2fafefb..4004ac0d30f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.skynet.core.commit.actions;
import java.util.HashSet;
import java.util.Set;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -54,10 +55,12 @@ public class CatchTrackedChanges implements CommitAction {
}
}
}
- Artifact artifactChanged = change.getArtifact();
+
+ Artifact artifactChanged = change.getToArtifact();
if (artifactChanged != null) {
changedArtifacts.add(artifactChanged);
}
+
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java
index f0d031d5176..437d76947ca 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java
@@ -80,13 +80,13 @@ public class ChangeData {
for (Change change : changes) {
if ((kindType == KindType.Artifact || kindType == KindType.ArtifactOrRelation) && change instanceof ArtifactChange) {
if (modTypes.contains(change.getModificationType())) {
- artifacts.add(change.getArtifact());
+ artifacts.add(change.getToArtifact());
}
}
//
else if ((kindType == KindType.Relation || kindType == KindType.ArtifactOrRelation) && change instanceof RelationChange) {
if (modTypes.contains(change.getModificationType())) {
- artifacts.add(((RelationChange) change).getArtifact());
+ artifacts.add(((RelationChange) change).getToArtifact());
artifacts.add(((RelationChange) change).getBArtifact());
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
index 751343d6f49..32c855d6453 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
@@ -18,6 +18,7 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.data.ArtifactChangeItem;
import org.eclipse.osee.framework.core.data.AttributeChangeItem;
@@ -26,11 +27,12 @@ import org.eclipse.osee.framework.core.data.ChangeReportResponse;
import org.eclipse.osee.framework.core.data.ChangeVersion;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.RelationChangeItem;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeWrappedException;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.util.ChangeItemUtil;
import org.eclipse.osee.framework.database.core.SQL3DataType;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
@@ -45,6 +47,7 @@ import org.eclipse.osee.framework.skynet.core.change.ErrorChange;
import org.eclipse.osee.framework.skynet.core.change.RelationChange;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
/**
* @author Jeff C. Phillips
@@ -56,81 +59,90 @@ public class ChangeDataLoader {
IOseeBranch branch = isHistorical ? transactionId.getBranch() : sourceBranch;
ArrayList<Change> changes = new ArrayList<Change>();
- List<ChangeItem> changeItems = loadChangeItems(sourceBranch, transactionId, monitor, isHistorical);
+ Pair<TransactionRecord, TransactionRecord> toTransactionFromTransactionPair = getTransactionRecords(sourceBranch, transactionId, monitor, isHistorical);
+ ChangeReportResponse response =
+ HttpChangeDataRequester.getChanges(toTransactionFromTransactionPair.getFirst(), toTransactionFromTransactionPair.getSecond(), monitor, isHistorical);
+ List<ChangeItem> changeItems = response.getChangeItems();
//This is to keep the weak reference from being collected before they can be used.
- Collection<Artifact> bulkLoadedArtifacts =
+ Collection<Artifact> bulkLoadedToArtifacts =
preloadArtifacts(changeItems, sourceBranch, transactionId, isHistorical, monitor);
+ Collection<Artifact> bulkLoadedFromArtifacts =
+ preloadArtifacts(changeItems, sourceBranch, toTransactionFromTransactionPair.getSecond(), true, monitor);
for (ChangeItem item : changeItems) {
Change change = null;
try {
- Artifact artifact = null;
+ Artifact toArtifact = null;
if (isHistorical) {
- artifact = ArtifactCache.getHistorical(item.getArtId(), transactionId.getId());
+ toArtifact = ArtifactCache.getHistorical(item.getArtId(), transactionId.getId());
} else {
- artifact = ArtifactQuery.getArtifactFromId(item.getArtId(), branch, true);
+ toArtifact = ArtifactQuery.getArtifactFromId(item.getArtId(), branch, true);
}
+
+ Artifact fromArtifact = null;
+ ModificationType modType = Artifacts.getArtifactModType(toArtifact);
+ if (modType != ModificationType.NEW && modType != ModificationType.INTRODUCED) {
+ fromArtifact = ArtifactCache.getHistorical(item.getArtId(), toTransactionFromTransactionPair.getSecond().getId());
+ }
+
String wasValue = "";
+
if (!isHistorical) {
ChangeVersion netChange = item.getNetChange();
if (!ChangeItemUtil.isNew(netChange) && !ChangeItemUtil.isIntroduced(netChange)) {
- ChangeVersion fromVersion = ChangeItemUtil.getStartingVersion(item);
+ ChangeVersion fromVersion = ChangeItemUtil.getStartingVersion(item);
wasValue = fromVersion.getValue();
}
}
-
- TransactionRecord toTransactionId =
- TransactionManager.getTransactionId(item.getCurrentVersion().getTransactionNumber().intValue());
- TransactionRecord fromTransactionId;
- if (isHistorical) {
- fromTransactionId = TransactionManager.getPriorTransaction(toTransactionId);
- } else {
- ChangeVersion netChange = item.getNetChange();
- if (item instanceof AttributeChangeItem) {
- ChangeVersion fromVersion = ChangeItemUtil.getStartingVersion(item);
- fromTransactionId = TransactionManager.getTransactionId(fromVersion.getTransactionNumber());
- } else {
- if (ChangeItemUtil.isNew(netChange) || ChangeItemUtil.isIntroduced(netChange)) {
- fromTransactionId = toTransactionId;
- } else {
- ChangeVersion fromVersion = ChangeItemUtil.getStartingVersion(item);
- fromTransactionId = TransactionManager.getTransactionId(fromVersion.getTransactionNumber());
- }
- }
- }
-
monitor.subTask("Build Change Display Objects");
//The artifacts have been previously bulk loaded for performance
- change = asChange(item, artifact, branch, fromTransactionId, toTransactionId, wasValue, isHistorical);
+ change = asChange(item, toArtifact, fromArtifact, branch, toTransactionFromTransactionPair.getSecond(), toTransactionFromTransactionPair.getFirst(), wasValue, isHistorical);
} catch (Exception ex) {
change = new ErrorChange(branch, item.getArtId(), ex.toString());
}
changes.add(change);
}
monitor.done();
- bulkLoadedArtifacts.clear();
+ bulkLoadedToArtifacts.clear();
+ bulkLoadedFromArtifacts.clear();
return changes;
}
- private Change asChange(ChangeItem item, Artifact artifact, IOseeBranch branch, TransactionRecord fromTransactionId, TransactionRecord toTransactionId, String wasValue, boolean isHistorical) throws OseeCoreException {
+ private Pair<TransactionRecord, TransactionRecord> getTransactionRecords(IOseeBranch sourceBranch, TransactionRecord transactionId,
+ IProgressMonitor monitor, boolean isHistorical) throws OseeCoreException {
+ TransactionRecord destinationTransactionId;
+ TransactionRecord sourceTransactionId;
+
+ if (isHistorical) {
+ destinationTransactionId = TransactionManager.getPriorTransaction(transactionId);
+ sourceTransactionId = transactionId;
+ } else {
+ destinationTransactionId =
+ TransactionManager.getHeadTransaction(BranchManager.getBranch(sourceBranch).getParentBranch());
+ sourceTransactionId = TransactionManager.getHeadTransaction(sourceBranch);
+ }
+ return new Pair<TransactionRecord, TransactionRecord>(sourceTransactionId, destinationTransactionId);
+ }
+
+ private Change asChange(ChangeItem item, Artifact toArtifact, Artifact fromArtifact, IOseeBranch branch, TransactionRecord fromTransactionId, TransactionRecord toTransactionId, String wasValue, boolean isHistorical) throws OseeCoreException {
Change change = null;
// TODO create artifact item
// HERE
if (item instanceof ArtifactChangeItem) {
change =
- new ArtifactChange(branch, artifact.getArtifactType(),
+ new ArtifactChange(branch, toArtifact.getArtifactType(),
(int) item.getCurrentVersion().getGammaId().longValue(), item.getItemId(), toTransactionId,
- fromTransactionId, item.getNetChange().getModType(), isHistorical, artifact);
+ fromTransactionId, item.getNetChange().getModType(), isHistorical, toArtifact, fromArtifact);
} else if (item instanceof AttributeChangeItem) {
change =
- new AttributeChange(branch, artifact.getArtifactType(),
+ new AttributeChange(branch, toArtifact.getArtifactType(),
(int) item.getCurrentVersion().getGammaId().longValue(), item.getArtId(), toTransactionId,
fromTransactionId, item.getNetChange().getModType(), item.getCurrentVersion().getValue(),
wasValue, item.getItemId(),
- artifact.getAttributeById(item.getItemId(), true).getAttributeType().getId(),
- item.getNetChange().getModType(), isHistorical, artifact);
+ toArtifact.getAttributeById(item.getItemId(), true).getAttributeType().getId(),
+ item.getNetChange().getModType(), isHistorical, toArtifact, fromArtifact);
} else if (item instanceof RelationChangeItem) {
RelationChangeItem relationChangeItem = (RelationChangeItem) item;
Artifact bArtifact;
@@ -141,11 +153,11 @@ public class ChangeDataLoader {
bArtifact = ArtifactQuery.getArtifactFromId(relationChangeItem.getBArtId(), branch, true);
}
change =
- new RelationChange(branch, artifact.getArtifactType(),
+ new RelationChange(branch, toArtifact.getArtifactType(),
(int) relationChangeItem.getCurrentVersion().getGammaId().longValue(), item.getArtId(),
toTransactionId, fromTransactionId, relationChangeItem.getNetChange().getModType(),
bArtifact.getArtId(), relationChangeItem.getItemId(), relationChangeItem.getRationale(),
- RelationTypeManager.getType(relationChangeItem.getRelTypeId()), isHistorical, artifact, bArtifact);
+ RelationTypeManager.getType(relationChangeItem.getRelTypeId()), isHistorical, toArtifact, bArtifact, fromArtifact);
} else {
throw new OseeCoreException("The change item must map to either a artifact, attribute or relation change");
}
@@ -168,41 +180,15 @@ public class ChangeDataLoader {
artIds.add(((RelationChangeItem) item).getBArtId());
}
}
-
List<Object[]> insertParameters = new LinkedList<Object[]>();
for (Integer artId : artIds) {
insertParameters.add(new Object[] {queryId, insertTime, artId, BranchManager.getBranch(branch).getId(),
isHistorical ? transactionId.getId() : SQL3DataType.INTEGER});
}
-
artifacts =
ArtifactLoader.loadArtifacts(queryId, ArtifactLoad.ALL_CURRENT, null, insertParameters, true,
isHistorical, true);
}
return artifacts;
}
-
- /**
- * @param sourceBranch
- * @param monitor
- * @return
- * @throws OseeCoreException
- * @throws OseeWrappedException
- */
- private List<ChangeItem> loadChangeItems(IOseeBranch sourceBranch, TransactionRecord transactionId, IProgressMonitor monitor, boolean isHistorical) throws OseeCoreException, OseeWrappedException {
- TransactionRecord destinationTransactionId;
- TransactionRecord sourceTransactionId;
-
- if (isHistorical) {
- destinationTransactionId = TransactionManager.getPriorTransaction(transactionId);
- sourceTransactionId = transactionId;
- } else {
- destinationTransactionId =
- TransactionManager.getHeadTransaction(BranchManager.getBranch(sourceBranch).getParentBranch());
- sourceTransactionId = TransactionManager.getHeadTransaction(sourceBranch);
- }
- ChangeReportResponse response =
- HttpChangeDataRequester.getChanges(sourceTransactionId, destinationTransactionId, monitor, isHistorical);
- return response.getChangeItems();
- }
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java
index ac56e14ed0c..51d19a8409d 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java
@@ -17,6 +17,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
+
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.core.model.Branch;
@@ -24,6 +26,7 @@ import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
import org.eclipse.osee.framework.skynet.core.internal.Activator;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.types.IArtifact;
@@ -47,6 +50,21 @@ public final class Artifacts {
}
return guids;
}
+
+ public static ModificationType getArtifactModType(Artifact artifact) throws OseeCoreException{
+ ModificationType modificationType = artifact.getModType();
+
+ if(modificationType == ModificationType.NEW || modificationType == ModificationType.INTRODUCED){
+ for(Attribute<?> attribute : artifact.getAttributes()){
+ if(attribute.getModificationType() != ModificationType.NEW &&
+ attribute.getModificationType() != ModificationType.INTRODUCED){
+ modificationType = attribute.getModificationType();
+ break;
+ }
+ }
+ }
+ return modificationType;
+ }
public static String commaArts(Collection<? extends Artifact> artifacts) {
return toTextList(artifacts, ", ");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java
index 11bcf68dd53..d0899e75a1c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ViewWordChangeAndDiffTest.java
@@ -84,7 +84,7 @@ public class ViewWordChangeAndDiffTest {
@org.junit.Test
public void testSingleNativeDiff() throws Exception {
Collection<Change> changes = ChangeManager.getChangesPerBranch(getTestBranch(), new NullProgressMonitor());
- Artifact artifact = changes.iterator().next().getArtifact();
+ Artifact artifact = changes.iterator().next().getToArtifact();
checkPermissions(Collections.singletonList(artifact));
@@ -130,7 +130,7 @@ public class ViewWordChangeAndDiffTest {
private static ArrayList<Artifact> asArtifacts(Collection<Change> changes) throws ArtifactDoesNotExist {
ArrayList<Artifact> arts = new ArrayList<Artifact>();
for (Change artifactChange : changes) {
- arts.add(artifactChange.getArtifact());
+ arts.add(artifactChange.getToArtifact());
}
return arts;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordEditTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordEditTest.java
index c731cffc3f6..96195ca1822 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordEditTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/WordEditTest.java
@@ -104,7 +104,7 @@ public class WordEditTest {
List<Artifact> arts = new ArrayList<Artifact>();
Collection<Change> changes = ChangeManager.getChangesPerBranch(branch, new NullProgressMonitor());
for (Change change : changes) {
- Artifact art = change.getArtifact();
+ Artifact art = change.getToArtifact();
if (art.isOfType(CoreArtifactTypes.AbstractSoftwareRequirement)) {
arts.add(art);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevertArtifactHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevertArtifactHandler.java
index 2473776229e..5758a8395d5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevertArtifactHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevertArtifactHandler.java
@@ -51,10 +51,10 @@ public class RevertArtifactHandler extends AbstractHandler {
for (Change change : changes) {
List<Artifact> artifactList = new LinkedList<Artifact>();
- if (!duplicateCheck.contains(change.getArtifact())) {
- artifactList.add(change.getArtifact());
+ if (!duplicateCheck.contains(change.getToArtifact())) {
+ artifactList.add(change.getToArtifact());
artifacts.add(artifactList);
- duplicateCheck.add(change.getArtifact());
+ duplicateCheck.add(change.getToArtifact());
}
}
@@ -85,7 +85,7 @@ public class RevertArtifactHandler extends AbstractHandler {
}
for (Change change : changes) {
- isEnabled = AccessControlManager.hasPermission(change.getArtifact(), PermissionEnum.WRITE);
+ isEnabled = AccessControlManager.hasPermission(change.getToArtifact(), PermissionEnum.WRITE);
if (!isEnabled) {
break;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowPreviewHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowPreviewHandler.java
index eaacfc37e1c..22aa744751f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowPreviewHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowPreviewHandler.java
@@ -43,7 +43,7 @@ public class ShowPreviewHandler extends AbstractHandler {
for (Change mySelectedArtifactChange : mySelectedArtifactChangeList) {
Artifact selectedArtifact;
try {
- selectedArtifact = mySelectedArtifactChange.getArtifact();
+ selectedArtifact = mySelectedArtifactChange.getToArtifact();
ArtifactEditor.editArtifact(selectedArtifact);
} catch (Exception ex) {
OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java
index c505bc4e65b..0b7e0c250bf 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java
@@ -10,113 +10,81 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.commandHandlers.change;
-import static org.eclipse.osee.framework.core.enums.ModificationType.NEW;
import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.Collection;
+
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.access.AccessControlManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.change.Change;
-import org.eclipse.osee.framework.skynet.core.word.WordAnnotationHandler;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.CommandHandler;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers;
-import org.eclipse.osee.framework.ui.skynet.preferences.MsWordPreferencePage;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
-import org.eclipse.osee.framework.ui.skynet.util.WordUiUtil;
import org.eclipse.ui.PlatformUI;
/**
* @author Jeff C. Phillips
*/
public class SingleNativeDiffHandler extends CommandHandler {
- private ArrayList<Change> changes;
-
- @Override
- public boolean isEnabledWithException() throws OseeCoreException {
- boolean enabled = false;
+ private ArrayList<Change> changes;
- if (PlatformUI.getWorkbench().isClosing()) {
- return false;
- }
+ @Override
+ public boolean isEnabledWithException() throws OseeCoreException {
+ boolean enabled = false;
- try {
- ISelectionProvider selectionProvider =
- AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider();
+ if (PlatformUI.getWorkbench().isClosing()) {
+ return false;
+ }
- if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selectionProvider.getSelection();
+ try {
+ ISelectionProvider selectionProvider = AWorkbench.getActivePage()
+ .getActivePart().getSite().getSelectionProvider();
- changes = new ArrayList<Change>(Handlers.getArtifactChangesFromStructuredSelection(structuredSelection));
+ if (selectionProvider != null
+ && selectionProvider.getSelection() instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selectionProvider
+ .getSelection();
- enabled =
- changes.size() == 1 && AccessControlManager.hasPermission(changes.get(0).getArtifact(),
- PermissionEnum.READ);
- }
- } catch (Exception ex) {
- OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
- }
- return enabled;
- }
+ changes = new ArrayList<Change>(
+ Handlers
+ .getArtifactChangesFromStructuredSelection(structuredSelection));
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- Change change = changes.iterator().next();
- Set<Artifact> artifacts = new HashSet<Artifact>();
- try {
- Artifact baseArtifact =
- change.getModificationType() == NEW || change.getModificationType() == ModificationType.INTRODUCED ? null : ArtifactQuery.getHistoricalArtifactFromId(
- change.getArtifact().getArtId(), change.getFromTransactionId(), true);
- artifacts.addAll(checkForTrackedChangesOn(baseArtifact));
- Artifact newerArtifact =
- change.getModificationType().isDeleted() ? null : change.isHistorical() ? ArtifactQuery.getHistoricalArtifactFromId(
- change.getArtifact().getArtId(), change.getToTransactionId(), true) : change.getArtifact();
- artifacts.addAll(checkForTrackedChangesOn(newerArtifact));
- if (artifacts.isEmpty()) {
- VariableMap variableMap = new VariableMap();
- String fileName = baseArtifact != null ? baseArtifact.getSafeName() : newerArtifact.getSafeName();
- variableMap.setValue("fileName", fileName + "_" + new Date().toString().replaceAll(":", ";") + ".xml");
+ enabled = changes.size() == 1
+ && AccessControlManager.hasPermission(changes.get(0)
+ .getToArtifact(), PermissionEnum.READ);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
+ }
+ return enabled;
+ }
- RendererManager.diff(baseArtifact, newerArtifact, true);
- } else {
- WordUiUtil.displayWarningMessageDialog("Diff Artifacts Warning",
- "Detected tracked changes for some artifacts. Please refer to the results HTML report.");
- WordUiUtil.displayTrackedChangesOnArtifacts(artifacts);
- }
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- return null;
- }
+ Collection<Pair<Artifact, Artifact>> compareArtifacts = ChangeManager
+ .getCompareArtifacts(changes);
- private Set<Artifact> checkForTrackedChangesOn(Artifact artifact) throws OseeCoreException {
- Set<Artifact> artifacts = new HashSet<Artifact>();
- if (!UserManager.getUser().getBooleanSetting(MsWordPreferencePage.REMOVE_TRACKED_CHANGES)) {
- if (artifact != null) {
- String value = artifact.getSoleAttributeValueAsString(CoreAttributeTypes.WORD_TEMPLATE_CONTENT, "");
- // check for track changes
- if (WordAnnotationHandler.containsWordAnnotations(value)) {
- // capture those artifacts that have tracked changes on
- artifacts.add(artifact);
- }
- }
- }
- return artifacts;
- }
+ for (Pair<Artifact, Artifact> pair : compareArtifacts) {
+ try {
+ Artifact baseArtifact = pair.getFirst();
+ Artifact newerArtifact = pair.getSecond();
+ RendererManager.diff(baseArtifact, newerArtifact, true);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ return null;
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java
index 3a0a3c6e97f..ed69a6e2f9f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java
@@ -89,8 +89,8 @@ public class ViewWordChangeReportHandler extends AbstractHandler {
Set<Artifact> artifacts = new HashSet<Artifact>();
for (Change change : localChanges) {
- if (!artifacts.contains(change.getArtifact())) {
- artifacts.add(change.getArtifact());
+ if (!artifacts.contains(change.getToArtifact())) {
+ artifacts.add(change.getToArtifact());
changes.add(change);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/ArtifactDiffMenu.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/ArtifactDiffMenu.java
index 6f1d8b85d31..ae0773ee053 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/ArtifactDiffMenu.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/ArtifactDiffMenu.java
@@ -83,7 +83,7 @@ public class ArtifactDiffMenu {
try {
valid =
(RendererManager.getBestFileRenderer(PresentationType.DIFF,
- ((Change) selections[0]).getArtifact()).supportsCompare());
+ ((Change) selections[0]).getToArtifact()).supportsCompare());
} catch (OseeCoreException ex) {
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java
index 0a0eb6fb4a3..0d2b897386d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/FileSystemRenderer.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.ui.skynet.render;
import java.util.List;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -97,16 +98,17 @@ public abstract class FileSystemRenderer extends DefaultArtifactRenderer {
return renderToFileSystem(baseFolder, null, branch, PresentationType.DIFF);
}
- public IFile renderForDiff(IProgressMonitor monitor, Artifact artifact) throws OseeCoreException {
- if (artifact == null) {
- throw new OseeArgumentException("Artifact can not be null.");
- }
-
- IFolder baseFolder = RenderingUtil.getRenderFolder(artifact.getBranch(), PresentationType.DIFF);
- return renderToFileSystem(baseFolder, artifact, artifact.getBranch(), PresentationType.DIFF);
+ public IFile renderForDiff(IProgressMonitor monitor, Artifact artifact, Branch branch) throws OseeCoreException {
+ Artifact artifactToRender = artifact;
+ if(artifactToRender == null || artifactToRender.isDeleted() ){
+ artifactToRender = null;
+ }
+
+ IFolder baseFolder = RenderingUtil.getRenderFolder(branch, PresentationType.DIFF);
+ return renderToFileSystem(baseFolder, artifactToRender, branch, PresentationType.DIFF);
}
- public IFile renderForMerge(IProgressMonitor monitor, Artifact artifact, PresentationType presentationType) throws OseeCoreException {
+ public IFile renderForMerge(IProgressMonitor monitor, Artifact artifact, Branch branch, PresentationType presentationType) throws OseeCoreException {
if (artifact == null) {
throw new IllegalArgumentException("Artifact can not be null.");
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
index b72c9e09331..6bdfdada8ef 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
@@ -19,6 +19,7 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -331,6 +332,7 @@ public class RendererManager {
public IStatus run(IProgressMonitor monitor) throws OseeCoreException {
Pair<Artifact, Artifact> entry = itemsToCompare.iterator().next();
Artifact sampleArtifact = entry.getFirst() != null ? entry.getFirst() : entry.getSecond();
+
IRenderer renderer = getBestRenderer(PresentationType.DIFF, sampleArtifact, options);
IComparator comparator = renderer.getComparator();
comparator.compareArtifacts(monitor, PresentationType.DIFF, itemsToCompare);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
index 40d3315b91c..6a3e29825cd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
@@ -19,7 +19,9 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Pattern;
+
import javax.xml.namespace.QName;
+
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -235,8 +237,8 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
}
protected String getTemplate(Artifact artifact, PresentationType presentationType) throws OseeCoreException {
- return TemplateManager.getTemplate(this, artifact, presentationType.name(), getStringOption(TEMPLATE_OPTION)).getSoleAttributeValue(
- CoreAttributeTypes.WHOLE_WORD_CONTENT);
+ Artifact templateArtifact = TemplateManager.getTemplate(this, artifact, presentationType.name(), getStringOption(TEMPLATE_OPTION));
+ return templateArtifact.getSoleAttributeValue(CoreAttributeTypes.WHOLE_WORD_CONTENT);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WholeWordCompare.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WholeWordCompare.java
index 3f731bbfac6..0aed818e311 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WholeWordCompare.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WholeWordCompare.java
@@ -6,6 +6,7 @@
package org.eclipse.osee.framework.ui.skynet.render.compare;
import java.util.Collection;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -119,17 +120,13 @@ public class WholeWordCompare implements IComparator {
}
private IFile renderFile(IProgressMonitor monitor, FileRenderer renderer, Artifact artifact, Branch branch, PresentationType presentationType) throws OseeCoreException {
- IFile toReturn = null;
- if (artifact != null) {
- if (presentationType == PresentationType.MERGE || presentationType == PresentationType.MERGE_EDIT) {
- toReturn = renderer.renderForMerge(monitor, artifact, presentationType);
- } else {
- toReturn = renderer.renderForDiff(monitor, artifact);
- }
- } else {
- toReturn = renderer.renderForDiff(monitor, branch);
- }
- return toReturn;
+ IFile toReturn = null;
+ if (presentationType == PresentationType.MERGE || presentationType == PresentationType.MERGE_EDIT) {
+ toReturn = renderer.renderForMerge(monitor, artifact, branch, presentationType);
+ } else {
+ toReturn = renderer.renderForDiff(monitor, artifact, branch);
+ }
+ return toReturn;
}
private Attribute<String> getWordContent(Artifact artifact, IAttributeType attributeType) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordChangeReportOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordChangeReportOperation.java
index 557197e62c9..57630580261 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordChangeReportOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordChangeReportOperation.java
@@ -4,6 +4,7 @@ import java.io.InputStream;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -95,9 +96,14 @@ public final class WordChangeReportOperation extends AbstractOperation {
artifacts.addAll(RenderingUtil.checkForTrackedChangesOn(entry.getFirst()));
artifacts.addAll(RenderingUtil.checkForTrackedChangesOn(entry.getSecond()));
- if (!artifacts.isEmpty()) {
- continue;
- }
+ if (!artifacts.isEmpty()) {
+ if (RenderingUtil.arePopupsAllowed()) {
+ WordUiUtil.displayWarningMessageDialog("Diff Artifacts Warning",
+ "Detected tracked changes for some artifacts. Please refer to the results HTML report.");
+ WordUiUtil.displayTrackedChangesOnArtifacts(artifacts);
+ }
+ continue;
+ }
Artifact baseArtifact = entry.getFirst();
Artifact newerArtifact = entry.getSecond();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
index f661d12bed4..71df0fe330b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
@@ -8,15 +8,18 @@ package org.eclipse.osee.framework.ui.skynet.render.compare;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
@@ -48,11 +51,24 @@ public class WordTemplateCompare implements IComparator {
artifacts.addAll(RenderingUtil.checkForTrackedChangesOn(baseArtifact));
artifacts.addAll(RenderingUtil.checkForTrackedChangesOn(newerArtifact));
- Attribute<String> baseContent = getWordContent(baseArtifact, attributeType);
- Attribute<String> newerContent = getWordContent(newerArtifact, attributeType);
- if (artifacts.isEmpty()) {
- if (!UserManager.getUser().getBooleanSetting(MsWordPreferencePage.IDENTFY_IMAGE_CHANGES)) {
+
+ if (!artifacts.isEmpty()) {
+ if (RenderingUtil.arePopupsAllowed()) {
+ WordUiUtil.displayWarningMessageDialog("Diff Artifacts Warning",
+ "Detected tracked changes for some artifacts. Please refer to the results HTML report.");
+ WordUiUtil.displayTrackedChangesOnArtifacts(artifacts);
+ }
+ } else {
+
+ if (baseArtifact == null && newerArtifact == null) {
+ throw new OseeArgumentException("baseVersion and newerVersion can't both be null.");
+ }
+
+ Attribute<String> baseContent = getWordContent(baseArtifact, attributeType);
+ Attribute<String> newerContent = getWordContent(newerArtifact, attributeType);
+
+ if (!UserManager.getUser().getBooleanSetting(MsWordPreferencePage.IDENTFY_IMAGE_CHANGES)) {
originalValue = WordImageChecker.checkForImageDiffs(baseContent, newerContent);
}
@@ -66,12 +82,6 @@ public class WordTemplateCompare implements IComparator {
WordImageChecker.restoreOriginalValue(newerContent, newAnnotationValue);
return compare(baseArtifact, newerArtifact, baseFile, newerFile, presentationType, show);
- } else {
- if (RenderingUtil.arePopupsAllowed()) {
- WordUiUtil.displayWarningMessageDialog("Diff Artifacts Warning",
- "Detected tracked changes for some artifacts. Please refer to the results HTML report.");
- WordUiUtil.displayTrackedChangesOnArtifacts(artifacts);
- }
}
return "";
}
@@ -81,7 +91,7 @@ public class WordTemplateCompare implements IComparator {
String diffPath;
String fileName = renderer.getStringOption("fileName");
- if (fileName == null || fileName.equals("")) {
+ if (!Strings.isValid(fileName)) {
if (baseVersion != null) {
String baseFileStr = baseFile.getLocation().toOSString();
diffPath =
@@ -117,14 +127,10 @@ public class WordTemplateCompare implements IComparator {
private IFile renderFile(IProgressMonitor monitor, FileRenderer renderer, Artifact artifact, Branch branch, PresentationType presentationType) throws OseeCoreException {
IFile toReturn = null;
- if (artifact != null) {
- if (presentationType == PresentationType.MERGE || presentationType == PresentationType.MERGE_EDIT) {
- toReturn = renderer.renderForMerge(monitor, artifact, presentationType);
- } else {
- toReturn = renderer.renderForDiff(monitor, artifact);
- }
+ if (presentationType == PresentationType.MERGE || presentationType == PresentationType.MERGE_EDIT) {
+ toReturn = renderer.renderForMerge(monitor, artifact, branch, presentationType);
} else {
- toReturn = renderer.renderForDiff(monitor, branch);
+ toReturn = renderer.renderForDiff(monitor, artifact, branch);
}
return toReturn;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeLabelProvider.java
index 49979038104..b7dfb45661b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeLabelProvider.java
@@ -12,6 +12,7 @@
package org.eclipse.osee.framework.ui.skynet.widgets.xchange;
import java.util.logging.Level;
+
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.nebula.widgets.xviewer.XViewerCells;
import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
@@ -32,111 +33,111 @@ import org.eclipse.swt.graphics.Image;
public class XChangeLabelProvider extends XViewerLabelProvider {
- Font font = null;
- private final ChangeXViewer changeXViewer;
-
- public XChangeLabelProvider(ChangeXViewer changeXViewer) {
- super(changeXViewer);
- this.changeXViewer = changeXViewer;
- }
-
- @Override
- public String getColumnText(Object element, XViewerColumn cCol, int columnIndex) throws OseeCoreException {
- try {
- if (!(element instanceof Change)) {
- return "";
- }
- Change change = (Change) element;
- if (cCol.equals(ChangeXViewerFactory.Name)) {
- return change.getName();
- }
- else if (cCol.equals(ChangeXViewerFactory.Change_Type)) {
- return change.getModificationType().getDisplayName();
- }
- else if (cCol.equals(ChangeXViewerFactory.Item_Kind)) {
- return change.getItemKind();
- }
- else if (cCol.equals(ChangeXViewerFactory.Item_Type)) {
- return change.getItemTypeName();
- }
- else if (cCol.equals(ChangeXViewerFactory.Is_Value)) {
- return change.getIsValue();
- }
- else if (cCol.equals(ChangeXViewerFactory.Was_Value)) {
- return change.getWasValue();
- }
- else if (cCol.equals(ChangeXViewerFactory.Artifact_Type)) {
- return change.getArtifact().getArtifactTypeName();
- }
- else if (cCol.equals(ChangeXViewerFactory.Hrid)) {
- return change.getArtifact().getHumanReadableId();
- }
- else if (cCol.equals(ChangeXViewerFactory.lastModDate)) {
- return XDate.getDateStr(change.getArtifact().getLastModified(), XDate.MMDDYYHHMM);
- }
- else if (cCol.equals(ChangeXViewerFactory.paraNumber)) {
- String paragraphNum = "";
-
- if (change.getArtifact().isAttributeTypeValid(CoreAttributeTypes.PARAGRAPH_NUMBER)) {
- paragraphNum = change.getArtifact().getSoleAttributeValue(CoreAttributeTypes.PARAGRAPH_NUMBER, "");
- }
- return paragraphNum;
- }
- }
- catch (Exception ex) {
- return XViewerCells.getCellExceptionString(ex);
- }
- return "unhandled column";
- }
-
- public void dispose() {
- if (font != null) {
- font.dispose();
- }
- font = null;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void addListener(ILabelProviderListener listener) {
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
-
- public ChangeXViewer getTreeViewer() {
- return changeXViewer;
- }
-
- @Override
- public Image getColumnImage(Object element, XViewerColumn xCol, int columnIndex) throws OseeCoreException {
- try {
- if (!(element instanceof Change)) {
- return null;
- }
- Change change = (Change) element;
- if (xCol.equals(ChangeXViewerFactory.Name)) {
- try {
- if (change instanceof ErrorChange) {
- return ImageManager.getImage(FrameworkImage.ERROR);
- }
- else {
- return ArtifactImageManager.getChangeKindImage(change);
- }
- }
- catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- else if (xCol.equals(ChangeXViewerFactory.Item_Type)) {
- return ArtifactImageManager.getChangeTypeImage(change);
- }
- }
- catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- return null;
- }
+ Font font = null;
+ private final ChangeXViewer changeXViewer;
+
+ public XChangeLabelProvider(ChangeXViewer changeXViewer) {
+ super(changeXViewer);
+ this.changeXViewer = changeXViewer;
+ }
+
+ @Override
+ public String getColumnText(Object element, XViewerColumn cCol,
+ int columnIndex) throws OseeCoreException {
+ try {
+ if (!(element instanceof Change)) {
+ return "";
+ }
+ Change change = (Change) element;
+
+ if (cCol.equals(ChangeXViewerFactory.Name)) {
+ return change.getName();
+ }
+
+ if (change instanceof ErrorChange) {
+ return "";
+ }
+
+ else if (cCol.equals(ChangeXViewerFactory.Change_Type)) {
+ return change.getModificationType().getDisplayName();
+ } else if (cCol.equals(ChangeXViewerFactory.Item_Kind)) {
+ return change.getItemKind();
+ } else if (cCol.equals(ChangeXViewerFactory.Item_Type)) {
+ return change.getItemTypeName();
+ } else if (cCol.equals(ChangeXViewerFactory.Is_Value)) {
+ return change.getIsValue();
+ } else if (cCol.equals(ChangeXViewerFactory.Was_Value)) {
+ return change.getWasValue();
+ } else if (cCol.equals(ChangeXViewerFactory.Artifact_Type)) {
+ return change.getToArtifact().getArtifactTypeName();
+ } else if (cCol.equals(ChangeXViewerFactory.Hrid)) {
+ return change.getToArtifact().getHumanReadableId();
+ } else if (cCol.equals(ChangeXViewerFactory.lastModDate)) {
+ return XDate.getDateStr(change.getToArtifact()
+ .getLastModified(), XDate.MMDDYYHHMM);
+ } else if (cCol.equals(ChangeXViewerFactory.paraNumber)) {
+ String paragraphNum = "";
+
+ if (change.getToArtifact().isAttributeTypeValid(
+ CoreAttributeTypes.PARAGRAPH_NUMBER)) {
+ paragraphNum = change.getToArtifact()
+ .getSoleAttributeValue(
+ CoreAttributeTypes.PARAGRAPH_NUMBER, "");
+ }
+ return paragraphNum;
+ }
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return "unhandled column";
+ }
+
+ public void dispose() {
+ if (font != null) {
+ font.dispose();
+ }
+ font = null;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public ChangeXViewer getTreeViewer() {
+ return changeXViewer;
+ }
+
+ @Override
+ public Image getColumnImage(Object element, XViewerColumn xCol,
+ int columnIndex) throws OseeCoreException {
+ try {
+ if (!(element instanceof Change)) {
+ return null;
+ }
+ Change change = (Change) element;
+ if (xCol.equals(ChangeXViewerFactory.Name)) {
+ try {
+ if (change instanceof ErrorChange) {
+ return ImageManager.getImage(FrameworkImage.ERROR);
+ } else {
+ return ArtifactImageManager.getChangeKindImage(change);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP,
+ ex);
+ }
+ } else if (xCol.equals(ChangeXViewerFactory.Item_Type)) {
+ return ArtifactImageManager.getChangeTypeImage(change);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeTextFilter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeTextFilter.java
index febbdb71f12..f8154174de3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeTextFilter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xchange/XChangeTextFilter.java
@@ -64,7 +64,7 @@ public class XChangeTextFilter extends XViewerTextFilter {
for (Object object : changes) {
if (object instanceof ArtifactChange) {
ArtifactChange artifactChanged = (ArtifactChange) object;
- Artifact artifact = artifactChanged.getArtifact();
+ Artifact artifact = artifactChanged.getToArtifact();
if (artifact != null) {
artifacts.add(artifact);
artifactToChangeMap.put(artifact, artifactChanged);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java
index ceaba4d730a..a5454952074 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java
@@ -49,7 +49,7 @@ public class XViewerAttributeColumn extends XViewerValueColumn {
return ((Artifact) element).getAttributesToString(attributeTypeName);
}
if (element instanceof Change) {
- return ((Change) element).getArtifact().getAttributesToString(attributeTypeName);
+ return ((Change) element).getToArtifact().getAttributesToString(attributeTypeName);
}
if (element instanceof Conflict) {
return ((Conflict) element).getArtifact().getAttributesToString(attributeTypeName);

Back to the top