Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / technical / ProjectSettingsService.java
1 /*****************************************************************************
2  * Company         EURIWARE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   05.10.2012
6  * @author         $Author$
7  * @version        $Revision$
8  *****************************************************************************/
9
10 package org.splat.service.technical;
11
12 import java.io.IOException;
13 import java.sql.SQLException;
14 import java.util.HashSet;
15 import java.util.List;
16 import java.util.Set;
17
18 import org.splat.dal.bo.som.ProjectElement;
19 import org.splat.service.technical.ProjectSettingsService.Step;
20 import org.splat.service.technical.ProjectSettingsServiceImpl.FileNaming;
21
22 /**
23  * @author rkv
24  * 
25  */
26 public interface ProjectSettingsService {
27
28         public static class Step {
29                 // ------------------------
30                 int number;
31                 private Class<? extends ProjectElement> level; // Study or Scenario
32                 Set<Class<?>> contents; // Set of Document and/or Knowledge
33                 private String path;
34
35                 Step(int number, Class<? extends ProjectElement> level, String path) {
36                         this.initialize(number, level, path);
37                 }
38
39                 private Step(int number, Class<? extends ProjectElement> level,
40                                 Class<?> contents, String path) {
41                         this.initialize(number, level, path);
42                         this.contents.add(contents);
43                 }
44
45                 private void initialize(int number,
46                                 Class<? extends ProjectElement> level, String path) {
47                         this.number = number;
48                         this.level = level;
49                         this.path = path + "/";
50                         this.contents = new HashSet<Class<?>>();
51                 }
52
53                 public boolean appliesTo(Class<? extends ProjectElement> level) {
54                         return (level == this.level);
55                 }
56
57                 public boolean mayContain(Class<?> type) {
58                         return contents.contains(type);
59                 }
60
61                 public int getNumber() {
62                         return number;
63                 }
64
65                 public String getPath() {
66                         return path;
67                 }
68         }
69
70         public FileNaming getFileNamingScheme();
71
72         public List<ProjectSettingsService.Step> getAllSteps();
73
74         public String getReferencePattern();
75
76         public String getRevisionPattern();
77
78         public void configure(String filename) throws IOException, SQLException;
79
80         public List<ProjectSettingsService.Step> getStepsOf(
81                         Class<? extends ProjectElement> level);
82 }