diff options
author | ddunne | 2012-02-13 23:24:10 +0000 |
---|---|---|
committer | kwilk | 2012-02-13 23:24:10 +0000 |
commit | 016cc541b7b61352ac3e833248261948e0eb9190 (patch) | |
tree | 0e31d51db51a6d922e7eeaa59302d03a1d802850 /plugins | |
parent | 0fea4ce82734e11b414b868586de73bba0609dbf (diff) | |
download | org.eclipse.osee-016cc541b7b61352ac3e833248261948e0eb9190.tar.gz org.eclipse.osee-016cc541b7b61352ac3e833248261948e0eb9190.tar.xz org.eclipse.osee-016cc541b7b61352ac3e833248261948e0eb9190.zip |
refinement: Remove AtsLog backward compatibility code for 0.9.7
Diffstat (limited to 'plugins')
3 files changed, 29 insertions, 87 deletions
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AbstractWorkflowArtifact.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AbstractWorkflowArtifact.java index c16e8233510..a41c1275e25 100644 --- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AbstractWorkflowArtifact.java +++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AbstractWorkflowArtifact.java @@ -29,7 +29,6 @@ import org.eclipse.osee.ats.core.notify.AtsNotifyType; import org.eclipse.osee.ats.core.review.AbstractReviewArtifact; import org.eclipse.osee.ats.core.review.ReviewManager; import org.eclipse.osee.ats.core.task.AbstractTaskableArtifact; -import org.eclipse.osee.ats.core.team.TeamState; import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact; import org.eclipse.osee.ats.core.type.AtsArtifactTypes; import org.eclipse.osee.ats.core.type.AtsAttributeTypes; @@ -535,48 +534,27 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple } public Date getCreatedDate() throws OseeCoreException { - Date date = getSoleAttributeValue(AtsAttributeTypes.CreatedDate, null); - if (date == null) { - // Keep this for backward compatibility - return getLog().internalGetCreationDate(); - } - return date; + return getSoleAttributeValue(AtsAttributeTypes.CreatedDate, null); } public IBasicUser getCreatedBy() throws OseeCoreException { String userId = getSoleAttributeValue(AtsAttributeTypes.CreatedBy, null); - if (!Strings.isValid(userId)) { - return getLog().internalGetOriginator(); - } else { + if (Strings.isValid(userId)) { return UserManager.getUserByUserId(userId); } + return null; } public Date internalGetCancelledDate() throws OseeCoreException { - Date date = getSoleAttributeValue(AtsAttributeTypes.CancelledDate, null); - if (date == null) { - // Keep this for backward compatibility - LogItem item = getLog().internalGetCancelledLogItem(); - if (item != null) { - return item.getDate(); - } - return null; - } - return date; + return getSoleAttributeValue(AtsAttributeTypes.CancelledDate, null); } public IBasicUser getCancelledBy() throws OseeCoreException { String userId = getSoleAttributeValue(AtsAttributeTypes.CancelledBy, null); - if (!Strings.isValid(userId)) { - // Keep this for backward compatibility - LogItem item = getLog().internalGetCancelledLogItem(); - if (item != null) { - return item.getUser(); - } - return null; - } else { + if (Strings.isValid(userId)) { return UserManager.getUserByUserId(userId); } + return null; } public String getCancelledReason() throws OseeCoreException { @@ -588,47 +566,23 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple } public void setCancellationReason(String reason) throws OseeCoreException { - // Keep this for backward compatibility - getLog().internalSetCancellationReason(reason); - if (isAttributeTypeValid(AtsAttributeTypes.CancelledReason)) { - setSoleAttributeValue(AtsAttributeTypes.CancelledReason, reason); - } + setSoleAttributeValue(AtsAttributeTypes.CancelledReason, reason); } public String getCancelledFromState() throws OseeCoreException { - String fromState = getSoleAttributeValue(AtsAttributeTypes.CancelledFromState, null); - if (!Strings.isValid(fromState)) { - // Keep this for backward compatibility - return getLog().internalGetCancelledFromState(); - } - return fromState; + return getSoleAttributeValue(AtsAttributeTypes.CancelledFromState, null); } public Date getCompletedDate() throws OseeCoreException { - Date date = getSoleAttributeValue(AtsAttributeTypes.CompletedDate, null); - if (date == null) { - // Keep this for backward compatibility - LogItem item = getLog().internalGetCompletedLogItem(); - if (item != null) { - return item.getDate(); - } - return null; - } - return date; + return getSoleAttributeValue(AtsAttributeTypes.CompletedDate, null); } public IBasicUser getCompletedBy() throws OseeCoreException { String userId = getSoleAttributeValue(AtsAttributeTypes.CompletedBy, null); - if (!Strings.isValid(userId)) { - // Keep this for backward compatibility - LogItem item = getLog().internalGetCompletedLogItem(); - if (item != null) { - return item.getUser(); - } - return null; - } else { + if (Strings.isValid(userId)) { return UserManager.getUserByUserId(userId); } + return null; } public LogItem getStateCompletedData(IWorkPage state) throws OseeCoreException { @@ -664,33 +618,15 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple } public boolean isInWork() throws OseeCoreException { - // Backward compatibility; remove this once 0.9.7 released - if (isAttributeTypeValid(AtsAttributeTypes.CurrentStateType) && getSoleAttributeValue( - AtsAttributeTypes.CurrentStateType, null) != null) { - return getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "").equals(WorkPageType.Working.name()); - } else { - return !isCompletedOrCancelled(); - } - + return getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "").equals(WorkPageType.Working.name()); } public boolean isCompleted() throws OseeCoreException { - if (isAttributeTypeValid(AtsAttributeTypes.CurrentStateType) && getSoleAttributeValue( - AtsAttributeTypes.CurrentStateType, null) != null) { - return getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "").equals(WorkPageType.Completed.name()); - } else { - return getCurrentStateName().equals(TeamState.Completed.getPageName()); - } + return getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "").equals(WorkPageType.Completed.name()); } public boolean isCancelled() throws OseeCoreException { - // Backward compatibility; remove this once 0.9.7 released - if (isAttributeTypeValid(AtsAttributeTypes.CurrentStateType) && getSoleAttributeValue( - AtsAttributeTypes.CurrentStateType, null) != null) { - return getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "").equals(WorkPageType.Cancelled.name()); - } else { - return getCurrentStateName().equals(TeamState.Cancelled.getPageName()); - } + return getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "").equals(WorkPageType.Cancelled.name()); } public boolean isCompletedOrCancelled() throws OseeCoreException { diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/StateManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/StateManager.java index 614fb8a81f9..f9c853bc675 100644 --- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/StateManager.java +++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/StateManager.java @@ -505,9 +505,11 @@ public class StateManager { users.add(user); } } - IBasicUser user = workflow.getCompletedBy(); - if (user != null && !users.contains(user)) { - users.add(user); + if (workflow.isCompleted()) { + IBasicUser user = workflow.getCompletedBy(); + if (user != null && !users.contains(user)) { + users.add(user); + } } } return users; diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumn.java index 0d9fdb7a332..bad25c91dc4 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumn.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumn.java @@ -245,13 +245,17 @@ public class AssigneeColumn extends XViewerAtsColumn implements IXViewerValueCol if (awa.isCompletedOrCancelled()) { if (awa.implementersStr == null && !awa.getImplementers().isEmpty()) { List<IBasicUser> implementers = awa.getImplementers(); - IBasicUser completedBy = awa.getCompletedBy(); - if (awa.isCompleted() && completedBy != null && !implementers.contains(completedBy)) { - implementers.add(completedBy); + if (awa.isCompleted()) { + IBasicUser completedBy = awa.getCompletedBy(); + if (completedBy != null && !implementers.contains(completedBy)) { + implementers.add(completedBy); + } } - IBasicUser cancelledBy = awa.getCancelledBy(); - if (awa.isCancelled() && cancelledBy != null && !implementers.contains(cancelledBy)) { - implementers.add(cancelledBy); + if (awa.isCancelled()) { + IBasicUser cancelledBy = awa.getCancelledBy(); + if (cancelledBy != null && !implementers.contains(cancelledBy)) { + implementers.add(cancelledBy); + } } Collections.sort(implementers); awa.implementersStr = "(" + Artifacts.toString("; ", implementers) + ")"; |