1 package org.splat.service.dto;
4 * @author Daniel Brunier-Coulin
5 * @copyright OPEN CASCADE 2012
8 import java.text.DecimalFormat;
10 import java.util.List;
11 import java.util.Vector;
13 import org.splat.dal.bo.som.ProgressState;
14 import org.splat.som.Step;
17 public class KnowledgeElementDTO {
20 private KnowledgeElementTypeDTO type; // User extendable types
21 private ProgressState state;
24 private UserDTO author;
26 private List<Step> involving = new Vector<Step>();
27 private String studyTitle;
28 private String scenarioTitle;
30 // ==============================================================================================================================
31 // Public member functions
32 // ==============================================================================================================================
38 public boolean equals (KnowledgeElementDTO given) {
39 if (!this.getType().equals(given.getType())) return false;
40 if (this.getValue().equals(given.getValue())) return true;
44 public UserDTO getAuthor () {
48 public Date getDate () {
52 public ProgressState getProgressState () {
56 public String getTitle () {
60 public String getReference () {
61 DecimalFormat toString = new DecimalFormat("00000"); // Supports 99 999 knowledge elements
62 return "KE" + toString.format(this.getIndex());
65 public KnowledgeElementTypeDTO getType () {
69 public String getValue () {
75 * @param aState knowledge element progress state to set
77 public void setProgressState(ProgressState aState) {
81 * Set a title of the knowledge.
82 * @param aTitle a title to set
84 public void setTitle(String aTitle) {
89 * @param value the value to set
91 public void setValue(String value) {
95 * Get list of involving steps.
96 * @return list of steps
98 public List<Step> getInvolving() {
102 * Get title of the parent study.
103 * @return study title
105 public String getStudyTitle() {
109 * Get title of the parent scenario.
110 * @return scenario title
112 public String getScenarioTitle() {
113 return scenarioTitle;
120 public long getIndex() {
126 * @param rid the rid to set
128 public void setIndex(long rid) {
133 * Set the studyTitle.
134 * @param studyTitle the studyTitle to set
136 public void setStudyTitle(String studyTitle) {
137 this.studyTitle = studyTitle;
141 * Set the scenarioTitle.
142 * @param scenarioTitle the scenarioTitle to set
144 public void setScenarioTitle(String scenarioTitle) {
145 this.scenarioTitle = scenarioTitle;
150 * @param type the type to set
152 public void setType(KnowledgeElementTypeDTO type) {
158 * @param author the author to set
160 public void setAuthor(UserDTO author) {
161 this.author = author;
166 * @param date the date to set
168 public void setDate(Date date) {