Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjphillips2008-06-10 18:29:24 +0000
committerjphillips2008-06-10 18:29:24 +0000
commit13361f0f2c2c272e0c9dd6476d33e2bcd8c8b804 (patch)
treeca271c2cf280f1db66abcd1dad7755c77c2a4917
parentb4bb8603f726a589e5e2be04934479472fe98e93 (diff)
downloadorg.eclipse.osee-13361f0f2c2c272e0c9dd6476d33e2bcd8c8b804.tar.gz
org.eclipse.osee-13361f0f2c2c272e0c9dd6476d33e2bcd8c8b804.tar.xz
org.eclipse.osee-13361f0f2c2c272e0c9dd6476d33e2bcd8c8b804.zip
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchCreator.java20
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeToTransactionOperation.java32
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchContentProvider.java23
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java3
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeColumn.java4
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeLabelProvider.java8
6 files changed, 38 insertions, 52 deletions
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchCreator.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchCreator.java
index a0c2862815f..ce1d4628cda 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchCreator.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchCreator.java
@@ -67,6 +67,8 @@ import org.eclipse.osee.framework.skynet.core.user.UserNotInDatabase;
public class BranchCreator implements PersistenceManager {
static final Logger logger = ConfigUtil.getConfigFactory().getLogger(BranchPersistenceManager.class);
+ public static final String NEW_MERGE_BRANCH_COMMENT = "New Merge Branch from ";
+
private static final LocalAliasTable ARTIFACT_VERSION_ALIAS_1 = new LocalAliasTable(ARTIFACT_VERSION_TABLE, "t1");
private static final LocalAliasTable ARTIFACT_VERSION_ALIAS_2 = new LocalAliasTable(ARTIFACT_VERSION_TABLE, "t2");
@@ -116,7 +118,7 @@ public class BranchCreator implements PersistenceManager {
// private static final String INSERT_DEFAULT_BRANCH_NAMES =
// "INSERT INTO " + BRANCH_DEFINITIONS.columnsForInsert("static_branch_name", "mapped_branch_id");
- private static final String MERGE_BRANCH_INSERT_QUERY =
+ private static final String MERGE_BRANCH_INSERT =
"INSERT INTO osee_define_merge " + "(source_branch_id, dest_branch_id, merge_branch_id) VALUES( ? , ? , ?)";
private static final BranchCreator instance = new BranchCreator();
@@ -139,16 +141,16 @@ public class BranchCreator implements PersistenceManager {
SkynetAuthentication.getInstance();
}
- private Pair<Branch, Integer> createBranchWithBaselineTransactionNumber(Artifact associatedArtifact, TransactionId sourceTransactionId, String childBranchShortName, String childBranchName, BranchType branchType) throws SQLException, MultipleAttributesExist, UserNotInDatabase, IllegalArgumentException, IllegalStateException, MultipleArtifactsExist {
+ private Pair<Branch, Integer> createMergeBranchWithBaselineTransactionNumber(Artifact associatedArtifact, TransactionId sourceTransactionId, String childBranchShortName, String childBranchName, BranchType branchType, Branch destBranch) throws SQLException, MultipleAttributesExist, UserNotInDatabase, IllegalArgumentException, IllegalStateException, MultipleArtifactsExist {
User userToBlame = SkynetAuthentication.getUser();
Branch parentBranch = sourceTransactionId.getBranch();
int userId =
(userToBlame == null) ? SkynetAuthentication.getUser(UserEnum.NoOne).getArtId() : userToBlame.getArtId();
String comment =
- BranchPersistenceManager.NEW_BRANCH_COMMENT + parentBranch.getBranchName() + "(" + sourceTransactionId.getTransactionNumber() + ")";
+ NEW_MERGE_BRANCH_COMMENT + parentBranch.getBranchName() + "(" + sourceTransactionId.getTransactionNumber() + ") and " + destBranch.getBranchName();
Timestamp timestamp = GlobalTime.GreenwichMeanTimestamp();
Branch childBranch =
- initializeBranch(childBranchShortName, childBranchName, sourceTransactionId, userId, timestamp, comment,
+ initializeBranch(childBranchShortName, childBranchName, null, userId, timestamp, comment,
associatedArtifact, branchType);
// insert the new transaction data first.
@@ -496,10 +498,10 @@ public class BranchCreator implements PersistenceManager {
Pair<Branch, Integer> branchWithTransactionNumber;
if (createBranch) {
branchWithTransactionNumber =
- createBranchWithBaselineTransactionNumber(SkynetAuthentication.getUser(),
+ createMergeBranchWithBaselineTransactionNumber(SkynetAuthentication.getUser(),
TransactionIdManager.getInstance().getStartEndPoint(sourceBranch).getKey(),
"Merge " + sourceBranch.getDisplayName(), "Merge " + sourceBranch.getDisplayName(),
- BranchType.MERGE);
+ BranchType.MERGE, destBranch);
} else {
TransactionId startTransactionId =
TransactionIdManager.getInstance().getStartEndPoint(mergeBranch).getKey();
@@ -515,9 +517,9 @@ public class BranchCreator implements PersistenceManager {
}
try {
ConnectionHandler.runPreparedUpdateBatch(ArtifactLoader.INSERT_INTO_LOADER, datas);
- String attributeGammas =
+ String attributeGammas =
"INSERT INTO OSEE_DEFINE_TXS (transaction_id, gamma_id, mod_type, tx_current) SELECT ?, atr1.gamma_id, txs1.mod_type, ? FROM osee_define_attribute atr1, osee_define_txs txs1, osee_define_tx_details txd1, osee_artifact_loader ald1 WHERE txd1.branch_id = ? AND txd1.transaction_id = txs1.transaction_id AND txs1.tx_current in (1,2) AND txs1.gamma_id = atr1.gamma_id AND atr1.art_id = ald1.art_id and ald1.query_id = ?";
- String artifactVersionGammas =
+ String artifactVersionGammas =
"INSERT INTO OSEE_DEFINE_TXS (transaction_id, gamma_id, mod_type, tx_current) SELECT ?, arv1.gamma_id, txs1.mod_type, ? FROM osee_define_artifact_version arv1, osee_define_txs txs1, osee_define_tx_details txd1, osee_artifact_loader ald1 WHERE txd1.branch_id = ? AND txd1.transaction_id = txs1.transaction_id AND txs1.tx_current in (1,2) AND txs1.gamma_id = arv1.gamma_id AND arv1.art_id = ald1.art_id and ald1.query_id = ?";
insertGammas(attributeGammas, branchWithTransactionNumber.getValue(), queryId);
@@ -532,7 +534,7 @@ public class BranchCreator implements PersistenceManager {
if (createBranch) {
try {
- ConnectionHandler.runPreparedUpdate(MERGE_BRANCH_INSERT_QUERY, SQL3DataType.INTEGER,
+ ConnectionHandler.runPreparedUpdate(MERGE_BRANCH_INSERT, SQL3DataType.INTEGER,
sourceBranch.getBranchId(), SQL3DataType.INTEGER, destBranch.getBranchId(), SQL3DataType.INTEGER,
mergeBranch.getBranchId());
} finally {
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeToTransactionOperation.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeToTransactionOperation.java
index ee12c2b3016..35c02792792 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeToTransactionOperation.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeToTransactionOperation.java
@@ -50,7 +50,7 @@ public class AttributeToTransactionOperation {
"UPDATE " + ATTRIBUTE_VERSION_TABLE + " SET value = ?, uri = ? WHERE art_id = ? and attr_id = ? and attr_type_id = ? and gamma_id = ?";
private static final String GET_EXISTING_ATTRIBUTE_IDS =
- "SELECT distinct atr1.attr_id FROM osee_define_attribute atr1, osee_define_attribute_type aty1 WHERE atr1.art_id = ? AND atr1.attr_type_id = ? AND atr1.attr_type_id = aty1.attr_type_id AND aty1.max_occurence = 1";
+ "SELECT DISTINCT atr1.attr_id FROM osee_define_attribute atr1, osee_define_attribute_type aty1 WHERE atr1.art_id = ? AND atr1.attr_type_id = ?";
private final Artifact artifact;
private final SkynetTransaction transaction;
@@ -82,6 +82,7 @@ public class AttributeToTransactionOperation {
}
}
+ //TODO
private void versionControlled(Artifact artifact, Attribute<?> attribute, SkynetTransaction transaction) throws Exception {
ModType modType = null;
ModificationType attrModType = null;
@@ -131,26 +132,27 @@ public class AttributeToTransactionOperation {
private void createNewAttributeMemo(Attribute<?> attribute) throws SQLException {
if (attribute == null) return;
- int gammaId = SkynetDatabase.getNextGammaId();
ConnectionHandlerStatement connectionHandlerStatement = null;
+ AttributeType attributeType = attribute.getAttributeType();
int attrId = -1;
- try {
- connectionHandlerStatement =
- ConnectionHandler.runPreparedQuery(GET_EXISTING_ATTRIBUTE_IDS, SQL3DataType.INTEGER,
- artifact.getArtId(), SQL3DataType.INTEGER, attribute.getAttributeType().getAttrTypeId(),
- SQL3DataType.INTEGER, artifact.getArtId(), SQL3DataType.INTEGER,
- attribute.getAttributeType().getAttrTypeId());
+ //TODO: Only handles a max Occurrence of 1
+ if (attributeType.getMaxOccurrences() == 1) {
+ try {
+ connectionHandlerStatement =
+ ConnectionHandler.runPreparedQuery(GET_EXISTING_ATTRIBUTE_IDS, SQL3DataType.INTEGER,
+ artifact.getArtId(), SQL3DataType.INTEGER, attributeType.getAttrTypeId());
- ResultSet resultSet = connectionHandlerStatement.getRset();
+ ResultSet resultSet = connectionHandlerStatement.getRset();
- if (resultSet.next()) {
- //TODO: Currently only grabs the first attrID found. Need to resolve multiple attrID,s where multiple attributes can exist
- attrId = (resultSet.getInt("attr_id"));
+ if (resultSet.next()) {
+ attrId = (resultSet.getInt("attr_id"));
+ }
+ } finally {
+ DbUtil.close(connectionHandlerStatement);
}
- } finally {
- DbUtil.close(connectionHandlerStatement);
}
- if (attrId < 0) {
+ int gammaId = SkynetDatabase.getNextGammaId();
+ if (attrId < 1) {
attrId = Query.getNextSeqVal(null, SkynetDatabase.ATTR_ID_SEQ);
}
attribute.setIds(attrId, gammaId);
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchContentProvider.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchContentProvider.java
index c1c4d3c534c..40f00a4a974 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchContentProvider.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchContentProvider.java
@@ -84,7 +84,6 @@ public class BranchContentProvider implements ITreeContentProvider, ArtifactChan
private IContentProviderRunnable providerRunnable;
private boolean showChildBranchesAtMainLevel;
private boolean showChildBranchesUnderParents;
- private boolean showMergeBranches;
private boolean showTransactions;
// private boolean myHideTransactions = false;
@@ -93,7 +92,6 @@ public class BranchContentProvider implements ITreeContentProvider, ArtifactChan
this.providerRunnable = new ChildrenRunnable();
this.root = null;
this.showChildBranchesAtMainLevel = false;
- this.showMergeBranches = false;
this.showChildBranchesUnderParents = true;
}
@@ -126,14 +124,6 @@ public class BranchContentProvider implements ITreeContentProvider, ArtifactChan
BranchPersistenceManager branchManager = (BranchPersistenceManager) parentElement;
try {
Collection<Branch> branches = branchManager.refreshBranches();
- if (!showMergeBranches) {
- Iterator<Branch> iter = branches.iterator();
- while (iter.hasNext()) {
- if (iter.next().isMergeBranch()) {
- iter.remove();
- }
- }
- }
if (!showChildBranchesAtMainLevel) {
Iterator<Branch> iter = branches.iterator();
while (iter.hasNext()) {
@@ -463,17 +453,4 @@ public class BranchContentProvider implements ITreeContentProvider, ArtifactChan
this.showChildBranchesUnderParents = showChildBranchesUnderParents;
}
- /**
- * @return the showChildBranchesUnderParents
- */
- public boolean isShowMergeBranches() {
- return showMergeBranches;
- }
-
- /**
- * @param showChildBranchesUnderParents the showChildBranchesUnderParents to set
- */
- public void setShowMergeBranches(boolean showMergeBranches) {
- this.showMergeBranches = showMergeBranches;
- }
}
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java
index 96641cf547a..46a6f657070 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java
@@ -1789,10 +1789,9 @@ public class BranchView extends ViewPart implements IActionable, IEventReceiver
BranchContentProvider provider = (BranchContentProvider) branchTable.getContentProvider();
// No effect if going to the same state
- if (provider.isShowChildBranchesAtMainLevel() != flat || provider.isShowChildBranchesUnderParents() != !flat || provider.isShowMergeBranches() != flat) {
+ if (provider.isShowChildBranchesAtMainLevel() != flat || provider.isShowChildBranchesUnderParents() != !flat) {
nameFilter.setFlat(flat);
provider.setShowChildBranchesAtMainLevel(flat);
- provider.setShowMergeBranches(flat);
provider.setShowChildBranchesUnderParents(!flat);
provider.refresh();
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeColumn.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeColumn.java
index 00d416e2bdd..8313ab17c77 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeColumn.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeColumn.java
@@ -24,10 +24,10 @@ public enum MergeColumn {
// Need empty column cause of how certain operating systems handle the first column of a table
Empty("", 0, SWT.LEFT, true, SortDataType.String, false),
- Conflict_Resolved("Conflict Resolved", 25, SWT.LEFT, true, SortDataType.String, false),
+ Conflict_Resolved("Conflict Resolved", 23, SWT.LEFT, true, SortDataType.String, false),
Artifact_Name("Artifact", 200, SWT.LEFT, true, SortDataType.String, false),
-
+
Type("Type", 150, SWT.LEFT, true, SortDataType.String, false),
Change_Item("Change Item", 150, SWT.LEFT, true, SortDataType.String, false),
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeLabelProvider.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeLabelProvider.java
index 785515db26d..1043856811d 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeLabelProvider.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeLabelProvider.java
@@ -81,7 +81,13 @@ public class XMergeLabelProvider implements ITableLabelProvider {
try {
if (element instanceof Conflict) {
Conflict conflict = (Conflict) element;
- if (aCol == MergeColumn.Artifact_Name) {
+ if (aCol == MergeColumn.Conflict_Resolved) {
+ if (conflict.statusResolved()) return "D) Resolved";
+ if (conflict.statusEdited()) return "B) Modified";
+ if (conflict.statusOutOfDate()) return "C) Artifact Changed After Resolution";
+ if (conflict.statusUntouched()) return " ";
+ if (conflict.statusNotResolvable()) return "A) Must Be Reverted";
+ } else if (aCol == MergeColumn.Artifact_Name) {
return conflict.getArtifactName();
} else if (aCol == MergeColumn.Change_Item) {
return conflict.getChangeItem();

Back to the top