* @copyright OPEN CASCADE 2012
*/
-import java.util.List;
import java.util.Set;
import java.util.HashSet;
import org.splat.dal.bo.kernel.Persistent;
-import org.splat.dal.dao.som.Database;
import org.splat.kernel.InvalidPropertyException;
import org.splat.kernel.MissedPropertyException;
import org.splat.kernel.MultiplyDefinedException;
import org.splat.service.technical.ProjectSettingsService;
-import org.splat.service.technical.ProjectSettingsService.Step;
public class DocumentType extends Persistent {
// Persistent fields
private String name;
private ProgressState state;
- private String step; // List of (dash separated) steps (numbers) containing this type
+ private String step; // List of (dash separated) steps (numbers) containing this type
private String result; // Step (number ) having this type as result
private Set<DocumentType> uses;
// -------------------------
}
// Initialization constructor
- protected DocumentType (Properties dprop) throws MissedPropertyException, InvalidPropertyException, MultiplyDefinedException {
+ public DocumentType (Properties dprop) throws MissedPropertyException, InvalidPropertyException, MultiplyDefinedException {
// -----------------------------------------
super(dprop); // Throws one of the above exception if not valid
name = dprop.name;
// Public member functions
// ==============================================================================================================================
- public boolean approve () {
-// -------------------------
- if (state != ProgressState.inCHECK) return false;
- this.state = ProgressState.APPROVED; // The type name is supposed being localized
- Database.getSession().update(this);
- return true;
- }
-
public boolean equals(Object entity) {
// ------------------------------------
if (entity == null) return false;
if (result == null) return false;
return (Integer.valueOf(result) == step.getNumber());
}
+
+ /**
+ * Get the state.
+ * @return the state
+ */
+ public ProgressState getState() {
+ return state;
+ }
+ /**
+ * Set the state.
+ * @param state the state to set
+ */
+ public void setState(ProgressState state) {
+ this.state = state;
+ }
}
\ No newline at end of file