diff options
author | ddunne | 2011-07-13 17:39:00 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2011-07-13 17:39:00 +0000 |
commit | e0439292488a096cbbe398f9fe8f331940ee27aa (patch) | |
tree | 648aeac582b5f4827b0d04195f2d5d6171cce421 /plugins/org.eclipse.osee.framework.skynet.core/src | |
parent | 6271074089d83a46136c8dd740eec344c9f35d66 (diff) | |
download | org.eclipse.osee-e0439292488a096cbbe398f9fe8f331940ee27aa.tar.gz org.eclipse.osee-e0439292488a096cbbe398f9fe8f331940ee27aa.tar.xz org.eclipse.osee-e0439292488a096cbbe398f9fe8f331940ee27aa.zip |
bug[ats_NP5XR]: ATS Action to "Start Commit" does not appear unless action is saved first
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core/src')
4 files changed, 37 insertions, 8 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEventType.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEventType.java index 47a9beaf981..20e595f6714 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEventType.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEventType.java @@ -16,10 +16,14 @@ package org.eclipse.osee.framework.skynet.core.event.model; public enum BranchEventType { // Local and Remote events + Purging(EventType.LocalAndRemote, "ATPHeMoAFyL543vrAyQA"), Purged(EventType.LocalAndRemote, "AAn_QG7jRGZAqPE0UewA"), + Deleting(EventType.LocalAndRemote, "ATPHeNujxAkPZEkWUtQA"), Deleted(EventType.LocalAndRemote, "AAn_QHBDvwtT5jjKaHgA"), Added(EventType.LocalAndRemote, "AAn_QHDohywDoSTxwcQA"), Renamed(EventType.LocalAndRemote, "AAn_QHGLIUsH2BdX2gwA"), + Committing(EventType.LocalAndRemote, "ATPHeN1du2GAbS3SQsAA"), + CommitFailed(EventType.LocalAndRemote, "ATPHeN3RaBnDmpoYXkQA"), Committed(EventType.LocalAndRemote, "AAn_QHIu0mGZytQ11QwA"), TypeUpdated(EventType.LocalAndRemote, "AAn_QHLW4DKKbUkEZggA"), StateUpdated(EventType.LocalAndRemote, "AAn_QHQdKhxNLtWPchAA"), diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java index 2e88c010a9a..4f87098aa34 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java @@ -16,6 +16,7 @@ import java.util.Map; import java.util.Set; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.osee.framework.core.data.OseeServerContext; +import org.eclipse.osee.framework.core.enums.BranchState; import org.eclipse.osee.framework.core.enums.CoreTranslatorId; import org.eclipse.osee.framework.core.enums.Function; import org.eclipse.osee.framework.core.exception.OseeCoreException; @@ -64,12 +65,26 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("function", Function.BRANCH_COMMIT.name()); + BranchState currentState = sourceBranch.getBranchState(); + sourceBranch.setBranchState(BranchState.COMMIT_IN_PROGRESS); + + OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Committing, sourceBranch.getGuid()), + sourceBranch.getId()); + BranchCommitRequest requestData = new BranchCommitRequest(user.getArtId(), sourceBranch.getId(), destinationBranch.getId(), isArchiveAllowed); - BranchCommitResponse response = - HttpClientMessage.send(OseeServerContext.BRANCH_CONTEXT, parameters, CoreTranslatorId.BRANCH_COMMIT_REQUEST, - requestData, CoreTranslatorId.BRANCH_COMMIT_RESPONSE); + BranchCommitResponse response = null; + try { + response = + HttpClientMessage.send(OseeServerContext.BRANCH_CONTEXT, parameters, + CoreTranslatorId.BRANCH_COMMIT_REQUEST, requestData, CoreTranslatorId.BRANCH_COMMIT_RESPONSE); + } catch (OseeCoreException ex) { + sourceBranch.setBranchState(currentState); + OseeEventManager.kickBranchEvent(getClass(), + new BranchEvent(BranchEventType.CommitFailed, sourceBranch.getGuid()), sourceBranch.getId()); + throw ex; + } if (response != null) { handleResponse(response, sourceBranch); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java index e0a2c558f1c..bcda352dd66 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java @@ -48,6 +48,9 @@ public final class PurgeBranchHttpRequestOperation extends AbstractOperation { @Override protected void doWork(IProgressMonitor monitor) throws OseeCoreException { + OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purging, branch.getGuid()), + branch.getId()); + PurgeBranchRequest requestData = new PurgeBranchRequest(branch.getId(), recursive); Map<String, String> parameters = new HashMap<String, String>(); parameters.put("function", Function.PURGE_BRANCH.name()); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientBranchAccessor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientBranchAccessor.java index 529545c82b3..9d3395d9320 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientBranchAccessor.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientBranchAccessor.java @@ -74,19 +74,26 @@ public class ClientBranchAccessor extends AbstractClientDataAccessor<Branch> { store(branchCache, types); } - public void store(IOseeCache<Branch> cache, Collection<Branch> types) throws OseeCoreException { + public void store(IOseeCache<Branch> cache, Collection<Branch> branches) throws OseeCoreException { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("function", CacheOperation.STORE.name()); - BranchCacheStoreRequest request = BranchCacheStoreRequest.fromCache(types); + for (Branch branch : branches) { + if (branch.getBranchState().isDeleted()) { + OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Deleting, branch.getGuid()), + branch.getId()); + } + } + + BranchCacheStoreRequest request = BranchCacheStoreRequest.fromCache(branches); AcquireResult updateResponse = HttpClientMessage.send(OseeServerContext.CACHE_CONTEXT, parameters, CoreTranslatorId.BRANCH_CACHE_STORE_REQUEST, request, null); if (updateResponse.wasSuccessful()) { - sendChangeEvents(types); - for (Branch type : types) { - type.clearDirty(); + sendChangeEvents(branches); + for (Branch branch : branches) { + branch.clearDirty(); } } } |