]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/ApplicationSettings.java
Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / ApplicationSettings.java
index a6cb60108512594028ea8e951034396ceea93c71..27ec0ac765e5b665ab52131a4a8f6ef5676a7e4a 100644 (file)
@@ -20,15 +20,15 @@ import org.w3c.dom.NodeList;
 import org.w3c.dom.NamedNodeMap;
 
 import org.apache.log4j.Logger;
-import org.splat.kernel.User;
+import org.splat.dal.bo.kernel.User;
 import org.splat.manox.XDOM;
-import org.splat.som.Document;
+import org.splat.dal.bo.som.Document;
 import org.splat.som.DocumentRights;
-import org.splat.som.DocumentType;
-import org.splat.som.KnowledgeElement;
-import org.splat.som.ProgressState;
-import org.splat.som.ProjectSettings;
-import org.splat.som.SimulationContext;
+import org.splat.dal.bo.som.DocumentType;
+import org.splat.dal.bo.som.KnowledgeElement;
+import org.splat.dal.bo.som.ProgressState;
+import org.splat.service.technical.ProjectSettingsService;
+import org.splat.dal.bo.som.SimulationContext;
 import org.splat.som.Step;
 import org.splat.som.StudyRights;
 import org.splat.wapp.MenuItem;
@@ -57,6 +57,23 @@ public class ApplicationSettings {
        private         static ApplicationSettings my         = null;        // Singleton instance
     protected final static Logger              logger     = Logger.getLogger(ApplicationSettings.class);
 
+    private ProjectSettingsService _projectSettingsService;
+
+       /**
+        * Get the projectSettingsService.
+        * @return the projectSettingsService
+        */
+       public ProjectSettingsService getProjectSettings() {
+               return _projectSettingsService;
+       }
+       /**
+        * Set the projectSettingsService.
+        * @param projectSettingsService the projectSettingsService to set
+        */
+       public void setProjectSettings(
+                       ProjectSettingsService projectSettingsService) {
+               _projectSettingsService = projectSettingsService;
+       }
 
        private   static class NewMenu                 extends SimpleMenu {
 //  -----------------------------------------------------------------
@@ -389,8 +406,12 @@ public class ApplicationSettings {
 //  ------------------------------------------
       return my;                                  // The application is supposed being previously created below
     }
-    protected ApplicationSettings (String wappurl, Locale lang) throws IOException {
-//  -----------------------------------------------------------
+       /**
+        * @param wappurl
+        * @param lang
+        * @return
+        */
+       public ApplicationSettings init(String wappurl, Locale lang) throws IOException {
       ClassLoader cloader = getClass().getClassLoader();
       String[]    wurl    = wappurl.split("/");   // [0]="http:", [1]="", [2]="{server}:{port}", [3]="name"
 
@@ -404,6 +425,7 @@ public class ApplicationSettings {
 
       logger.info("Application root set to " + wapprops.getProperty("wapp.root"));
       my = this;
+      return this;
     }
     
 //  ==============================================================================================================================
@@ -475,9 +497,9 @@ public class ApplicationSettings {
 //    Settings based on the customization
          bars = new HashMap<Integer, ToolBar>();             // May be empty if no module installed
          
-         List<ProjectSettings.Step> steps = ProjectSettings.getAllSteps();
-         for (Iterator<ProjectSettings.Step> i=steps.iterator(); i.hasNext();) {
-        ProjectSettings.Step step    = i.next();
+         List<ProjectSettingsService.Step> steps = getProjectSettings().getAllSteps();
+         for (Iterator<ProjectSettingsService.Step> i=steps.iterator(); i.hasNext();) {
+                 ProjectSettingsService.Step step    = i.next();
                List<String>         formats = getDefaultFormats(step);
                if (formats.size() == 0) continue;
 
@@ -618,7 +640,7 @@ public class ApplicationSettings {
 //  Private services
 //  ==============================================================================================================================
 
-    private List<String> getDefaultFormats (ProjectSettings.Step step) {
+    private List<String> getDefaultFormats (ProjectSettingsService.Step step) {
 //  ------------------------------------------------------------------
       Set<String>    keys   = defdoctype.keySet();
       int            number = step.getNumber();