diff options
author | donald.g.dunne | 2013-10-08 18:05:15 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2013-10-12 01:16:36 +0000 |
commit | 591224f3d1942c0f9baffac2f954d66ced185833 (patch) | |
tree | 6c6195ac9d744867c1b310ba92e06a58f63d4c1a /plugins/org.eclipse.osee.ats.api | |
parent | ec1f61560cd11ac4579100d660dfd630f95d5ba8 (diff) | |
download | org.eclipse.osee-591224f3d1942c0f9baffac2f954d66ced185833.tar.gz org.eclipse.osee-591224f3d1942c0f9baffac2f954d66ced185833.tar.xz org.eclipse.osee-591224f3d1942c0f9baffac2f954d66ced185833.zip |
feature[ats_S5JDQ]: Move AtsLog to ats.core
Change-Id: Ic6db75135a67fe2ab433ba9dd1aeed1e3d7ad450
Diffstat (limited to 'plugins/org.eclipse.osee.ats.api')
7 files changed, 236 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF index 16c99fec61c..373b9fe5dc6 100644 --- a/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF @@ -18,7 +18,8 @@ Export-Package: org.eclipse.osee.ats.api, org.eclipse.osee.ats.api.util, org.eclipse.osee.ats.api.version, org.eclipse.osee.ats.api.workdef, - org.eclipse.osee.ats.api.workflow + org.eclipse.osee.ats.api.workflow, + org.eclipse.osee.ats.api.workflow.log Require-Bundle: org.eclipse.core.runtime Import-Package: org.eclipse.osee.framework.core.data, org.eclipse.osee.framework.core.enums, diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java new file mode 100644 index 00000000000..8898f0c46cb --- /dev/null +++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2013 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.api.user; + +import org.eclipse.osee.framework.core.exception.OseeCoreException; + +/** + * @author Donald G. Dunne + */ +public interface IAtsUserService { + + IAtsUser getCurrentUser() throws OseeCoreException; + + IAtsUser getUserById(String userId) throws OseeCoreException; +} diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLog.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLog.java new file mode 100644 index 00000000000..8e53f5ca4da --- /dev/null +++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLog.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2013 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.api.workflow.log; + +import java.util.Date; +import java.util.List; +import org.eclipse.osee.ats.api.user.IAtsUser; +import org.eclipse.osee.framework.core.exception.OseeCoreException; + +/** + * @author Donald G. Dunne + */ +public interface IAtsLog { + + public abstract String getHtml() throws OseeCoreException; + + public abstract String getHtml(boolean showLog) throws OseeCoreException; + + public abstract List<IAtsLogItem> getLogItems() throws OseeCoreException; + + public abstract Date getLastStatusDate() throws OseeCoreException; + + public abstract void putLogItems(List<IAtsLogItem> items); + + public abstract List<IAtsLogItem> getLogItemsReversed() throws OseeCoreException; + + /** + * Used to reset the original originated user. Only for internal use. Kept for backward compatibility. + */ + public abstract void internalResetOriginator(IAtsUser user) throws OseeCoreException; + + /** + * Used to reset the original originated user. Only for internal use. Kept for backward compatibility. + */ + public abstract void internalResetCreatedDate(Date date) throws OseeCoreException; + + public abstract String internalGetCancelledReason() throws OseeCoreException; + + /** + * This method is replaced by AbstractWorkflowArtifact.getCompletedFromState. Kept for backward compatibility. + */ + public abstract String internalGetCompletedFromState() throws OseeCoreException; + + /** + * @param state name of state or null + */ + public abstract void addLog(LogType type, String state, String msg) throws OseeCoreException; + + public abstract void addLogItem(IAtsLogItem item) throws OseeCoreException; + + public abstract void addLog(LogType type, String state, String msg, Date date, IAtsUser user) throws OseeCoreException; + + public abstract void clearLog(); + + public abstract String getTable() throws OseeCoreException; + + public abstract IAtsLogItem getLastEvent(LogType type) throws OseeCoreException; + + public abstract IAtsLogItem getStateEvent(LogType type, String stateName) throws OseeCoreException; + + public abstract IAtsLogItem getStateEvent(LogType type) throws OseeCoreException; + +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogFactory.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogFactory.java new file mode 100644 index 00000000000..b839349177b --- /dev/null +++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogFactory.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2013 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.api.workflow.log; + +import java.util.Date; +import org.eclipse.osee.ats.api.user.IAtsUser; +import org.eclipse.osee.ats.api.user.IAtsUserService; +import org.eclipse.osee.framework.core.exception.OseeCoreException; + +/** + * @author Donald G. Dunne + */ +public interface IAtsLogFactory { + + public IAtsLog getLog(ILogStorageProvider storageProvider, IAtsUserService userService) throws OseeCoreException; + + public IAtsLogItem newLogItem(LogType type, Date date, IAtsUser user, String state, String msg, String hrid) throws OseeCoreException; + + public IAtsLogItem newLogItem(LogType type, String date, String userId, String state, String msg, String hrid) throws OseeCoreException; + + public IAtsLogItem newLogItem(String type, String date, String userId, String state, String msg, String hrid) throws OseeCoreException; +} diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogItem.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogItem.java new file mode 100644 index 00000000000..20abee6fe39 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogItem.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2013 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.api.workflow.log; + +import java.util.Date; +import org.eclipse.osee.ats.api.user.IAtsUser; + +/** + * @author Donald G. Dunne + */ +public interface IAtsLogItem { + + public abstract Date getDate(); + + public abstract String getDate(String pattern); + + public abstract void setDate(Date date); + + public abstract String getUserId(); + + public abstract String getMsg(); + + public abstract void setMsg(String msg); + + public abstract IAtsUser getUser(); + + public abstract LogType getType(); + + public abstract void setType(LogType type); + + public abstract String toHTML(String labelFont); + + public abstract void setUser(IAtsUser user); + + public abstract String getState(); + + public abstract void setState(String state); + +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/ILogStorageProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/ILogStorageProvider.java new file mode 100644 index 00000000000..d79091163f3 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/ILogStorageProvider.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2010 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.api.workflow.log; + +import org.eclipse.core.runtime.IStatus; + +/** + * @author Donald G. Dunne + */ +public interface ILogStorageProvider { + + String getLogXml(); + + IStatus saveLogXml(String xml); + + String getLogTitle(); + + String getLogId(); +} diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/LogType.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/LogType.java new file mode 100644 index 00000000000..12e3c8c5b28 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/LogType.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2010 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.api.workflow.log; + +import org.eclipse.osee.framework.core.exception.OseeArgumentException; + +public enum LogType { + None, + Assign, + Released, + Originated, + StateComplete, + StateCancelled, + StateEntered, + Error, + Note, + Metrics; + + public static LogType getType(String type) throws OseeArgumentException { + for (Enum<LogType> e : LogType.values()) { + if (e.name().equals(type)) { + return (LogType) e; + } + } + throw new OseeArgumentException("Unhandled LogType: [%s]", type); + } + +}; |