Salome HOME
app.root property is removed.
authorrkv <rkv@opencascade.com>
Tue, 30 Oct 2012 07:21:30 +0000 (07:21 +0000)
committerrkv <rkv@opencascade.com>
Tue, 30 Oct 2012 07:21:30 +0000 (07:21 +0000)
22 files changed:
Workspace/Siman-Common/src/org/splat/dal/bo/kernel/Any.java
Workspace/Siman-Common/src/org/splat/dal/bo/kernel/Entity.java
Workspace/Siman-Common/src/org/splat/dal/bo/kernel/Relation.java
Workspace/Siman-Common/src/org/splat/dal/bo/kernel/TextAttribute.java
Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java
Workspace/Siman-Common/src/org/splat/service/SimulationContextServiceImpl.java
Workspace/Siman/conf/debug.properties
Workspace/Siman/conf/debug_pg.properties
Workspace/Siman/conf/release.properties
Workspace/Siman/conf/templates/siman.properties
Workspace/Siman/src/org/splat/simer/Action.java
Workspace/Siman/src/org/splat/simer/ApplicationSettings.java
Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction.java
Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java
Workspace/Siman/src/org/splat/simer/NewScenarioAction.java
Workspace/Siman/src/org/splat/simer/NewStudyAction.java
Workspace/Siman/src/org/splat/simer/OpenKnowledge.java
Workspace/Siman/src/org/splat/simer/OpenObject.java
Workspace/Siman/src/org/splat/simer/OpenStudy.java
Workspace/Siman/src/org/splat/simer/StartAction.java
Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java
Workspace/Siman/src/spring/applicationContext.xml

index 5366bc74d79351ec702ec5442481db22d8d6174e..faba8598d35d2ff4a70ed0337aed0a965e0f29c1 100644 (file)
@@ -36,7 +36,6 @@ public abstract class Any extends Persistent {
       super(oprop);
     }
     protected Any (Attribute... field) {
-//  ----------------------------------
       for (int i=0; i<field.length; i++) {
        if (field[i] == null) continue;     // Happen when newing an Any object without property 
         if (field[i].getFrom().equals(this)) getAttributes().add(field[i]);
@@ -48,7 +47,6 @@ public abstract class Any extends Persistent {
 //  ==============================================================================================================================
 
     public Attribute getAttribute (Class<? extends Attribute> type) {
-//  ---------------------------------------------------------------
       for (Iterator<Attribute> i=getAttributes().iterator(); i.hasNext(); ) {
        Attribute field = i.next();
         if (field.getClass().equals(type)) return field;
@@ -61,20 +59,16 @@ public abstract class Any extends Persistent {
 //  ==============================================================================================================================
 
     protected boolean removeAttribute (Attribute field) {
-//  ---------------------------------------------------
       for (Iterator<Attribute> i=getAttributes().iterator(); i.hasNext(); ) {
         if (!i.next().equals(field)) continue;
        i.remove();
-       //RKV        if (this.isSaved()) Database.getCurSession().update(this);
        return true;
       }
       return false;
     }
 
     public boolean setAttribute (Attribute field) {
-//  ------------------------------------------------
       Class<?> type    = field.getClass();
-//RKV      Session  session = Database.getCurSession();
 
       if (!field.getFrom().equals(this)) return false;
       for (Iterator<Attribute> i=getAttributes().iterator(); i.hasNext(); ) {
@@ -83,10 +77,6 @@ public abstract class Any extends Persistent {
        break;
       }
       getAttributes().add(field);
-    //RKVif (this.isSaved()) {
-       //RKV        if (!field.isSaved()) session.save(field);
-       //RKV           session.update(this);
-    //RKV}     // Else, when saving this, Hibernate will propagate the operation
       return true;
     }
        /**
index ebe08746deb696206e96d21474e984e38e9e4378..77388d24086ea24c08fb35168ee7fd0615d67d8d 100644 (file)
@@ -35,7 +35,6 @@ public abstract class Entity extends Any {
     }
 //  Initialization constructor
     protected Entity (ObjectProperties prop) throws MissedPropertyException, InvalidPropertyException, MultiplyDefinedException {
-//  ----------------------------------------
       super(prop);
     }
 
@@ -53,7 +52,6 @@ public abstract class Entity extends Any {
     }
 
     public List<Relation> getRelations (Class<? extends Relation> type) {
-//  -------------------------------------------------------------------
       List<Relation> result = new Vector<Relation>();
 
       for (Iterator<Relation> i=relations.iterator(); i.hasNext();) {
@@ -68,38 +66,28 @@ public abstract class Entity extends Any {
 //  ==============================================================================================================================
 
     protected Set<Relation> getAllRelations () {
-//  ------------------------------------------
       return relations;
     }
 
     protected Relation addRelation (Relation link) {
-//  ----------------------------------------------
-//      Session  session = Database.getSession();
 
-//      session.save(link);
       relations.add(link);
-//      session.update(this);
 
       if (link.isBidirectional()) {
        Entity to = (Entity)link.getTo();   // Bidirectional relation are necessarily between entities
 
         link = link.getReverse();
-//             session.save(link);
-//      if (to.relations == null) to.relations = new HashSet<Relation>();
        to.relations.add(link);
-//             session.update(to);
       }
       return link;
     }
 
     protected void removeRelation (Class<? extends Relation> type, Persistent to) {
-//  -----------------------------------------------------------------------------
       for (Iterator<Relation> i=relations.iterator(); i.hasNext();) {
        Relation link = i.next();
        if (!link.getClass().equals(type)) continue;
        if (!link.getTo().equals(to))      continue;
        i.remove();
-       //RKV        if (this.isSaved()) Database.getCurSession().update(this);
        return;
       }
     }
index b176ad0d0d2464d694763053959cb39879e5be70..1ee3833e7b3a614c97c57bd0fe6d029e9f4f5e00 100644 (file)
@@ -85,20 +85,15 @@ public abstract class Relation extends Any {
  * @param nowner the document to which this relation is moved
  * */
     public void moveTo (Entity nowner) {
-       //RKV      Session  session = Database.getCurSession();
 
       Entity oldOwner = this.owner;
       this.owner = nowner;
       nowner.getAllRelations().add(this);
       oldOwner.getAllRelations().remove(this);
-//    myold.getAllRelations().remove(this);  Harmful as it leads to remove this relation from the database (!?)
-    //RKV      session.update(this);
-    //RKV      session.update(nowner);
 
       if (this.isBidirectional()) {
        Relation  link = this.getReverse();
        link.setTo(nowner);
-       //RKV  session.update(link);
       }
     }
 
index 1ebf2e4b96fb4b0d05cb2e9080ec5de304ce32de..729bd90a32e997a13a6cb485aea2df01ef373159 100644 (file)
@@ -1,48 +1,46 @@
 package org.splat.dal.bo.kernel;
 
 /**
- * 
+ * Text attribute persistent class.
  * @author    Daniel Brunier-Coulin
  * @copyright OPEN CASCADE 2012
  */
-
-
 public abstract class TextAttribute extends Attribute {
 
-    //private  Text mytext;
-       private String mytext;
-
-//  ==============================================================================================================================
-//  Constructors
-//  ==============================================================================================================================
+       /**
+        * Text value.
+        */
+       private String mytext;
 
-//  Database fetch constructor.
+    /**
+     * Database fetch constructor.
+     */
     public TextAttribute () {
     }
 
-//  Initialization constructor
+    /**
+     * Initialization constructor.
+     * @param from the owner of this attribute
+     * @param value the value of this attribute
+     */
     protected TextAttribute (Any from, String value) {
-//  ----------------------------------------------
       super(from);
       mytext = value;
     }
 
-//  ==============================================================================================================================
-//  Public member functions
-//  ==============================================================================================================================
-
+    /**
+     * Get value of this attribute.
+     * @return text value
+     */
     public String getValue () {
-//  -------------------------
       return mytext;
     }
 
-//  ==============================================================================================================================
-//  Protected services
-//  ==============================================================================================================================
-
+    /**
+     * Set value of this attribute.
+     * @param value the text value to set
+     */
     public void setValue (String value) {
-//  --------------------------------------
       mytext = value;
-//RKV      if (this.isSaved()) Database.getCurSession().update(this);
     }
 }
\ No newline at end of file
index f7e811c7480ad516d317d67084f4c0262546737c..5381141f03f20cee684c2ba2546af1a080382b6e 100644 (file)
@@ -297,7 +297,6 @@ public class DocumentServiceImpl implements DocumentService {
                ConvertsRelation attach = new ConvertsRelation(aDoc, export,
                                description);
 
-               // RKV Session session = Database.getSession();
                // RKV session.save(export);
                // RKV session.save(attach);
 
index 7165cd2c1ec77b07a076ce67a2821f2b738c08f5..29bb008bdc8beff9beabfd5bfe5fcdf85bf1743c 100644 (file)
@@ -154,8 +154,6 @@ public class SimulationContextServiceImpl implements SimulationContextService {
                                        state));
                }
                // query.append(order);
-               // return (List<SimulationContext>) Database.getSession().createQuery(
-               // query.toString()).list();
                return getSimulationContextDAO().getFilteredList(aCondition, anOrder);
        }
 
index 9e6b9444c84c5836ed8c0d91f835caf6964b23f3..49be9514051d894c34f83ab4e5069cda3a1b6b9a 100644 (file)
@@ -26,7 +26,4 @@ org.apache.struts2.interceptor.validation.logger.level=DEBUG
 # Generated file header
 file.header=Don't edit manually. See the source in @config.src.dir@.
 
-wapp.root=D:/users/rkv/SIMAN/SIMAN_SRC/Workspace/Siman/WebContent/
-
-
 
index 87e1a87569d17b764d23f6c4365e916df2c335bd..3bbbbdce4a7d3d090af65176e5517533256db874 100644 (file)
@@ -26,7 +26,4 @@ org.apache.struts2.interceptor.validation.logger.level=DEBUG
 # Generated file header
 file.header=Don't edit manually. See the source in @config.src.dir@.
 
-wapp.root=c:/work/SIMAN/SIMAN_SRC/Workspace/Siman/WebContent/
-
-
 
index 6aa0d034b8734b7116d17888359aa9db32a0f0e9..4cb9919cb1beb77ccd8f51cc62dc3fcb3ed5e903 100644 (file)
@@ -22,5 +22,3 @@ log4j.logger.org.hibernate.logger.level=INFO
 
 # Generated file header
 file.header=================================
-
-wapp.root=D:/users/rkv/SIMAN/SIMAN_SRC/Workspace/Siman/WebContent/
index b1eee7dd611b7327139aa630ffb19eb687faaf2a..447a3b67f2d05d13b6b8aaaa5a1f328fe17b20eb 100644 (file)
@@ -1,7 +1,6 @@
 schema.version     = D-0.3
 
 wapp.version       = D-0.5
-wapp.root          = @wapp.root@
 wapp.login         = conf/login.conf
 wapp.configuration = conf/som.xml
 wapp.customization = conf/my.xml
index 000d511d70f36d410cd95f880f809e9f52d0333c..74517cd57e92daf89ed2701c9d8610e74b355b66 100644 (file)
@@ -9,7 +9,6 @@ import javax.servlet.http.HttpServletRequest;
 
 import com.opensymphony.xwork2.ActionSupport;
 
-import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.interceptor.ServletRequestAware;
 import org.apache.struts2.interceptor.SessionAware;
 import org.apache.log4j.Logger;
@@ -22,13 +21,42 @@ import org.splat.dal.bo.som.DocumentType;
 import org.splat.wapp.Menu;
 
 
+/**
+ * Base Siman action.
+ */
 public class Action extends ActionSupport implements ServletRequestAware, SessionAware {
 
+       /**
+        * Serial version ID.
+        */
+       private   static final long    serialVersionUID = -895295026709526501L;
+       /**
+        * Action logger.
+        */
+    protected static final Logger  logger           = Logger.getLogger(Action.class);
+
+       /**
+        * Http servlet request.
+        */
+       private HttpServletRequest  request;
+       /**
+        * Http session container.
+        */
        private   Map<String, Object>  session;
+       /**
+        * Error code.
+        */
        private   String               mercode;
+       /**
+        * Current open study facade object.
+        */
        private OpenStudy _openStudy;
+       /**
+        * Current open knowledge facade object.
+        */
        private OpenKnowledge _openKnowledge;
        
+       
        /**
         * MenuBarSettings bean.
         */
@@ -38,20 +66,12 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
         * TitleBarSettings bean.
         */
        private TitleBarSettings _titleBarSettings;
-
-       private HttpServletRequest  request;
-
-       /**
-        * Serial version ID.
-        */
-       private   static final long    serialVersionUID = -895295026709526501L;
        /**
-        * Action logger.
+        * Injected application settings bean.
         */
-    protected static final Logger  logger           = Logger.getLogger(Action.class);
+       private ApplicationSettings _applicationSettings;
 
     public class DocumentTypeComparator implements Comparator<DocumentType> {
-//  -----------------------------------------------------------------------
       public int compare(DocumentType t1, DocumentType t2)
       {
         ResourceBundle       locale = ResourceBundle.getBundle("som", ApplicationSettings.getCurrentLocale());
@@ -64,7 +84,6 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
       }
     }
     public class ContextTypeComparator  implements Comparator<SimulationContextType> {
-//  --------------------------------------------------------------------------------
       public int compare(SimulationContextType t1, SimulationContextType t2)
       {
         ResourceBundle       locale = ResourceBundle.getBundle("som", ApplicationSettings.getCurrentLocale());
@@ -82,21 +101,18 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
 //  ==============================================================================================================================
 
     protected void closeKnowledge () {
-//  --------------------------------
       OpenObject open = (OpenObject)session.remove("knowledge.open");
       if (open != null) {
         if (session.get("study.open") == null) open.clearFacades();      // For eventually reopening the knowledge from a fresh context
       }
     }
     protected void closeStudy () {
-//  ----------------------------
       OpenObject open = (OpenObject)session.remove("study.open");
       if (open != null) {
         if (session.get("knowledge.open") == null) open.clearFacades();  // For eventually reopening the study from a fresh context
       }
     }
     protected void connect (LoginContext context, User user) {
-//  --------------------------------------------------------
       OpenStudy  open = getOpenStudy();
       if (open != null) {
           open.changeUser(user);
@@ -105,7 +121,6 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
       session.put("login.context", context);                             // For executing the deconnection, when requested
     }
     protected void disconnect () {
-//  ----------------------------
       OpenStudy  open = getOpenStudy();
       if (open != null) {
           open.changeUser(null);
@@ -114,12 +129,10 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
       session.remove("login.context");
     }
     protected User getConnectedUser () {
-//  ----------------------------------
       ApplicationRights  rights = (ApplicationRights)session.get("user.rights");
       return rights.getUser();                                           // May be null
     }
     protected Menu getMenu (String name) {
-//  ------------------------------------
       return (Menu)session.get("menu." + name);
     }
     public void setOpenKnowledge (OpenKnowledge kelm) {
@@ -137,7 +150,6 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
           return _openStudy;                       // May be null
         }
     protected OpenKnowledge open (KnowledgeElement kelm) {
-//  ----------------------------------------------------
       OpenKnowledge open = _openKnowledge.open(kelm);
 
       closeKnowledge();   // Just in case
@@ -145,8 +157,7 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
          return open;
     }
     protected OpenStudy open (Study study) {
-//  --------------------------------------
-         OpenStudy open = _openStudy.open(getConnectedUser(), study);         // The connected user may be null
+         OpenStudy open = _openStudy.open(getConnectedUser(), study);         // The connected user may be null
 
       closeStudy();       // Just in case
          session.put("study.open", open);
@@ -243,20 +254,16 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
        }
 
     public String getErrorCode () {
-//  -----------------------------
       return mercode;
     }
     public Map<String, Object> getSession () {
-//  ----------------------------------------
       return session;
     }
 
     public void setErrorCode (String code) {
-//  --------------------------------------
       this.mercode = code;
     }
        public void setSession (Map<String, Object> session) {
-//  ----------------------------------------------------               
          this.session = session;
        }
        
@@ -290,4 +297,18 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
        public void setTitleBarSettings(TitleBarSettings titleBarSettings) {
                _titleBarSettings = titleBarSettings;
        }
+       /**
+        * Get the applicationSettings.
+        * @return the applicationSettings
+        */
+       public ApplicationSettings getApplicationSettings() {
+               return _applicationSettings;
+       }
+       /**
+        * Set the applicationSettings.
+        * @param applicationSettings the applicationSettings to set
+        */
+       public void setApplicationSettings(ApplicationSettings applicationSettings) {
+               _applicationSettings = applicationSettings;
+       }
 }
\ No newline at end of file
index 21f17c28e6349a075b90cf6ab0300ae2f9396641..116d7b7189072c472e5d3c7acd072e8006c41ace 100644 (file)
@@ -13,6 +13,7 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.Vector;
 
+import javax.servlet.ServletContext;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import org.w3c.dom.Node;
@@ -38,8 +39,9 @@ import org.splat.wapp.PopupMenu;
 import org.splat.wapp.PopupItem;
 import org.splat.wapp.SimpleMenu;
 import org.splat.wapp.ToolBar;
+import org.springframework.web.context.ServletContextAware;
 
-public class ApplicationSettings {
+public class ApplicationSettings implements ServletContextAware {
 
        /**
         * Application settings logger.
@@ -47,6 +49,11 @@ public class ApplicationSettings {
        protected final static Logger logger = Logger
                        .getLogger(ApplicationSettings.class);
 
+       /**
+        * Injected servlet context to get path to resources.
+        */
+       private ServletContext _servletContext; 
+       
        private String wappserver;
        private String wappname;
        private Properties wapprops; // General properties from the application properties files
@@ -706,8 +713,8 @@ public class ApplicationSettings {
        }
 
        public String getApplicationRootPath() {
-               // ---------------------------------------
-               return getApplicationProperty("wapp.root"); // The property is supposed including the Web application name
+               //RKV: return getApplicationProperty("wapp.root"); // The property is supposed including the Web application name
+               return _servletContext.getRealPath("/");
        }
 
        public String getApplicationURL() {
@@ -948,4 +955,14 @@ public class ApplicationSettings {
        public void setDocumentTypeService(DocumentTypeService documentTypeService) {
                _documentTypeService = documentTypeService;
        }
+
+       /** 
+        * {@inheritDoc}
+        * @see org.apache.struts2.util.ServletContextAware#setServletContext(javax.servlet.ServletContext)
+        */
+       @Override
+       public void setServletContext(ServletContext context) {
+               _servletContext = context;
+       }
+
 }
\ No newline at end of file
index 275468593497636bb87050cf45f04f0944f7a745..dc3036ba3394c136834726db18c49fb14405d26e 100644 (file)
@@ -49,9 +49,9 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
        public String doInitialize() {
                // -----------------------------
                ResourceBundle label = ResourceBundle.getBundle("labels",
-                               ApplicationSettings.getCurrentLocale());
+                               getApplicationSettings().getCurrentLocale());
                ResourceBundle custom = ResourceBundle.getBundle("som",
-                               ApplicationSettings.getCurrentLocale());
+                               getApplicationSettings().getCurrentLocale());
                SimpleDateFormat datstring = new SimpleDateFormat(
                                custom.getString("date.format")); // Locale date display format
                Step step;
index fa66edfc0b1f4fe72610324610298e322f35cc98..995ea703d995b983e5dbace5300888b99ca276c5 100644 (file)
@@ -108,7 +108,7 @@ public class ImportDocumentAction extends UploadBaseNextAction {
                mystudy = getOpenStudy();
                Step step = mystudy.getSelectedStep();
                doctypes = getStepService().getValidDocumentTypes(step);
-               deftype = ApplicationSettings.getDefaultDocumentType(step, filext);
+               deftype = getApplicationSettings().getDefaultDocumentType(step, filext);
                defuses = new Vector<Document>();
                state = ProgressState.inWORK;
 
@@ -159,7 +159,7 @@ public class ImportDocumentAction extends UploadBaseNextAction {
                        date = tool.extractProperty("date");
                        if (date != null) {
                                ResourceBundle locale = ResourceBundle.getBundle("som",
-                                               ApplicationSettings.getCurrentLocale());
+                                               getApplicationSettings().getCurrentLocale());
                                SimpleDateFormat check = new SimpleDateFormat(
                                                locale.getString("date.format"));
                                try {
@@ -242,7 +242,7 @@ public class ImportDocumentAction extends UploadBaseNextAction {
                        } else { // Importation of a previously created template-based document
                                if (date.length() > 0) {
                                        ResourceBundle locale = ResourceBundle.getBundle("som",
-                                                       ApplicationSettings.getCurrentLocale());
+                                                       getApplicationSettings().getCurrentLocale());
                                        SimpleDateFormat get = new SimpleDateFormat(
                                                        locale.getString("date.format"));
                                        dprop.setDate(get.parse(date));
@@ -283,7 +283,7 @@ public class ImportDocumentAction extends UploadBaseNextAction {
                        }
                        // Creation of derived the document formats
                        // Document ndoc = addoc.value();
-                       // Converter send = ApplicationSettings.getConverter(ndoc.getType(), ndoc.getFormat());
+                       // Converter send = getApplicationSettings().getConverter(ndoc.getType(), ndoc.getFormat());
                        //
                        // if (send != null) send.converts(addoc); // Asynchronous process
 
index c30ff6d02ff790905ffc2490c555558f5d0bfec2..dfe72decbc13d76098c5e8b1e257c1b79e65d08e 100644 (file)
@@ -73,7 +73,7 @@ public class NewScenarioAction extends Action {
       Study          study   = mystudy.getStudyObject();
       Scenario[]     scene   = study.getScenarii();
       Scenario       base    = scene[scene.length-1];   // Default base scenario
-      ResourceBundle locale  = ResourceBundle.getBundle("labels", ApplicationSettings.getCurrentLocale());
+      ResourceBundle locale  = ResourceBundle.getBundle("labels", getApplicationSettings().getCurrentLocale());
 
       myscene   = Arrays.asList(scene);
       scindex   = base.getIndex();
index 499ffef35a4be7038d18d2ec96b021cf78b605f4..aee3a7546407796e960872163eae860602d5b9d1 100644 (file)
@@ -67,7 +67,7 @@ public class NewStudyAction extends Action {
 
                // set the default name of the new study
                ResourceBundle locale = ResourceBundle.getBundle("labels",
-                               ApplicationSettings.getCurrentLocale());
+                               getApplicationSettings().getCurrentLocale());
                title = locale.getString("label.study") + " "
                                + String.valueOf(number + 1);
 
@@ -114,7 +114,7 @@ public class NewStudyAction extends Action {
                try {
                        // Addition of a default scenario
                        ResourceBundle locale = ResourceBundle.getBundle("labels",
-                                       ApplicationSettings.getCurrentLocale());
+                                       getApplicationSettings().getCurrentLocale());
                        Scenario.Properties oprop = new Scenario.Properties();
                        oprop.setTitle(locale.getString("label.scenario") + " 1");
 
index 702f62b8c26f1b8d6c8895bd9ba8aa97b0c625af..aa647707b1699a8e67ce634970bc363bf953cd89 100644 (file)
@@ -50,9 +50,9 @@ public class OpenKnowledge extends OpenObject {
        public OpenKnowledge open (KnowledgeElement knelm) {
                // ---------------------------------------------
                ResourceBundle label = ResourceBundle.getBundle("labels",
-                               ApplicationSettings.getCurrentLocale());
+                               getApplicationSettings().getCurrentLocale());
                ResourceBundle custom = ResourceBundle.getBundle("som",
-                               ApplicationSettings.getCurrentLocale());
+                               getApplicationSettings().getCurrentLocale());
                SimpleDateFormat convert = new SimpleDateFormat(
                                custom.getString("date.format"));
                StringBuffer value = new StringBuffer(knelm.getValue());
@@ -134,7 +134,7 @@ public class OpenKnowledge extends OpenObject {
        public String getType() {
                // ------------------------
                return ResourceBundle.getBundle("som",
-                               ApplicationSettings.getCurrentLocale()).getString(
+                               getApplicationSettings().getCurrentLocale()).getString(
                                "type.knowledge." + myknelm.getType().getName());
        }
 
index 05d92896e30e7f91b2e5e36bcf32ee88e393d27c..f00252e0ace788309fb2bf75359b85df5d471f85 100644 (file)
@@ -43,6 +43,10 @@ public abstract class OpenObject implements Proxy {
         * Injected project settings service.
         */
        private ProjectSettingsService _projectSettingsService;
+       /**
+        * Injected application settings bean.
+        */
+       private ApplicationSettings _applicationSettings;
        /**
         * Injected publication service.
         */
@@ -386,4 +390,20 @@ public abstract class OpenObject implements Proxy {
                        KnowledgeElementTypeService knowledgeElementTypeService) {
                _knowledgeElementTypeService = knowledgeElementTypeService;
        }
+
+       /**
+        * Get the applicationSettings.
+        * @return the applicationSettings
+        */
+       public ApplicationSettings getApplicationSettings() {
+               return _applicationSettings;
+       }
+
+       /**
+        * Set the applicationSettings.
+        * @param applicationSettings the applicationSettings to set
+        */
+       public void setApplicationSettings(ApplicationSettings applicationSettings) {
+               _applicationSettings = applicationSettings;
+       }
 }
\ No newline at end of file
index b28bc689d0ea50cbf96e0cca4caed2f72a8a03a5..1edd57bb8b81fbf1ca10939e7ae6036900423ca0 100644 (file)
@@ -89,7 +89,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
        public OpenStudy open(User user, Study study) {
                // -----------------------------------------
                ResourceBundle custom = ResourceBundle.getBundle("som",
-                               ApplicationSettings.getCurrentLocale());
+                               getApplicationSettings().getCurrentLocale());
                SimpleDateFormat datstring = new SimpleDateFormat(custom
                                .getString("date.format"));
                Revision.Format verstring = new Revision.Format(getProjectSettings()
@@ -117,9 +117,9 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
                }
                if (getStudyService().isStaffedBy(mystudy, cuser) || getStudyService().hasActor(mystudy, cuser)) {
                        // ProgressState state = mystudy.getProgressState();
-                       // if (state == ProgressState.inCHECK) popup = ApplicationSettings.getPopupMenu("stapprovable");
-                       // else if (state == ProgressState.APPROVED) popup = ApplicationSettings.getPopupMenu("stapproved");
-                       /* else */popup = ApplicationSettings
+                       // if (state == ProgressState.inCHECK) popup = getApplicationSettings().getPopupMenu("stapprovable");
+                       // else if (state == ProgressState.APPROVED) popup = getApplicationSettings().getPopupMenu("stapproved");
+                       /* else */popup = getApplicationSettings()
                                        .getPopupMenu("steditable");
                        popup.setContext("study", new StudyRights(cuser, mystudy));
                }
@@ -173,7 +173,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
 
        public ToolBar getModuleBar() {
                // ------------------------------
-               return ApplicationSettings.getMe().getModuleBar(getSelectedStep());
+               return getApplicationSettings().getModuleBar(getSelectedStep());
        }
 
        public String getReference() {
@@ -209,7 +209,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
        public String getType() {
                // ------------------------
                return ResourceBundle.getBundle("labels",
-                               ApplicationSettings.getCurrentLocale())
+                               getApplicationSettings().getCurrentLocale())
                                .getString("label.study");
        }
 
@@ -259,7 +259,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
 
                        // Transfer to the document of all known properties
                        ResourceBundle locale = ResourceBundle.getBundle("som",
-                                       ApplicationSettings.getCurrentLocale());
+                                       getApplicationSettings().getCurrentLocale());
                        SimpleDateFormat get = new SimpleDateFormat(locale
                                        .getString("date.format"));
                        Writer tool = Toolbox.getWriter(credoc);
@@ -284,7 +284,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
                                        .replaceAll("''", "'"));
                        tool.save();
 
-                       return new URL(ApplicationSettings.getDownloadURL(author)
+                       return new URL(getApplicationSettings().getDownloadURL(author)
                                        + filename);
                } catch (Exception saverror) {
                        logger.error("Reason:", saverror);
@@ -294,7 +294,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
 
        public void selectDocument(String docurl) {
                // ------------------------------------------
-               String prefix = ApplicationSettings.getRepositoryURL();
+               String prefix = getApplicationSettings().getRepositoryURL();
 
                if (docurl.startsWith(prefix))
                        try {
@@ -385,7 +385,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
                cuser = user;
                popup = null;
                if (getStudyService().isStaffedBy(mystudy, cuser)) {
-                       popup = ApplicationSettings.getPopupMenu("steditable");
+                       popup = getApplicationSettings().getPopupMenu("steditable");
                        popup.setContext("study", new StudyRights(cuser, mystudy));
                }
                //ustep = getProjectElementService().getFirstStep(mystudy);
index f235f6fe2b2d47441a27cc18cbc2d003150bf472..044ee57f329698e68de87f001a83f718db958c95 100644 (file)
@@ -2,9 +2,11 @@ package org.splat.simer;
 
 import java.util.Map;
 
+import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.util.ServletContextAware;
 import org.hibernate.HibernateException;
 import org.hibernate.Session;
 import org.hibernate.Transaction;
@@ -60,6 +62,7 @@ public class StartAction extends Action implements ServletRequestAware {
                ProjectSettingsService project = getProjectSettings();
         ApplicationSettings wapp    = getApplicationSettings().init(wappurl.toString(), this.getLocale());
         String              root    = wapp.getApplicationRootPath();
+        logger.debug("Application root: " + root);
 
 //      Database configuration
                project.configure(root + wapp.getApplicationProperty("wapp.configuration"));
@@ -182,6 +185,4 @@ public class StartAction extends Action implements ServletRequestAware {
        public final void setEditDisabledProperty(String editDisabledProperty) {
                _editDisabledProperty = editDisabledProperty;
        }
-
-       
 }
\ No newline at end of file
index 0af6bc1da7f3949f48110cb6942a53f66e06d4c5..98550dc2488e751476a50474ea7e1a51f46cd3b5 100644 (file)
@@ -5,21 +5,16 @@ import java.io.FileNotFoundException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
 import java.util.Vector;
 
-import org.hibernate.HibernateException;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
 import org.splat.kernel.InvalidPropertyException;
 import org.splat.dal.bo.kernel.Relation;
 import org.splat.dal.bo.kernel.User;
 import org.splat.manox.Reader;
 import org.splat.manox.Toolbox;
-import org.splat.dal.dao.som.Database;
 import org.splat.dal.bo.som.Document;
 import org.splat.dal.bo.som.ProgressState;
 import org.splat.service.PublicationService;
@@ -32,59 +27,89 @@ import org.splat.som.Step;
 import org.splat.dal.bo.som.UsedByRelation;
 import org.splat.dal.bo.som.UsesRelation;
 
+/**
+ * Action for creating a new version of a document.
+ */
 public class VersionDocumentAction extends UploadBaseNextAction {
 
-       private String index = null; // Versioned document index
+       /**
+        * Serial version ID.
+        */
+       private static final long serialVersionUID = -5702264003232132168L;
+
+       /**
+        * Versioned document index.
+        */
+       private String index = null;
+       /**
+        * List of publications which use the selected document.
+        */
        private List<Publication> usedby = null;
+       /**
+        * List of selected impacted documents ids.
+        */
        private long[] docusedby = null;
-       private String summary = null; // Summary of changes in the new version
-       private String docver = ""; // Version number extracted from the imported file, if exist
-       private String date = ""; // Date extracted from the imported file, if exist
+       /**
+        * Summary of changes in the new version.
+        */
+       private String summary = null;
+       /**
+        * Version number extracted from the imported file, if exist.
+        */
+       private String docver = "";
+       /**
+        * Date extracted from the imported file, if exist.
+        */
+       private String date = "";
+       /**
+        * Injected project settings service.
+        */
        private ProjectSettingsService _projectSettingsService;
+       /**
+        * Injected publication service.
+        */
        private PublicationService _publicationService;
+       /**
+        * Injected step service.
+        */
        private StepService _stepService;
        /**
         * Injected repository service.
         */
        private RepositoryService _repositoryService;
        /**
-        * Value of the menu property. 
-        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
         */
        private String _menuProperty;
-       
+
        /**
-        * Value of the title bar property. 
-        * It can be: study, knowledge.
+        * Value of the title bar property. It can be: study, knowledge.
         */
        private String _titleProperty;
-       
-       /**
-        * Property that indicates whether the current open study is editable or not.
-        * On the screen it looks like pen on the status icon, pop-up menu also can be called.
-        * It is necessary for correct building the title bar.
-        */
-       private String _editDisabledProperty = "false";
 
        /**
-        * Serial version ID.
+        * Property that indicates whether the current open study is editable or not. On the screen it looks like pen on the status icon, pop-up
+        * menu also can be called. It is necessary for correct building the title bar.
         */
-       private static final long serialVersionUID = -5702264003232132168L;
+       private String _editDisabledProperty = "false";
 
        // ==============================================================================================================================
        // Action methods
        // ==============================================================================================================================
 
+       /**
+        * Initialize the action form.
+        * 
+        * @return SUCCESS if succeeded, ERROR if uploaded file is XML and we can't extract properties from it
+        */
        public String doInitialize() {
-               // -----------------------------
-               
+
                setMenuProperty("study");
                setTitleProperty("study");
                setEditDisabledProperty("true");
-        initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
-           
-               Session connex = Database.getCurSession();
-               Transaction transax = connex.beginTransaction();
+               initializationScreenContext(_menuProperty, _titleProperty,
+                               _editDisabledProperty);
+
                User user = getConnectedUser();
                File updir = getRepositoryService().getDownloadDirectory(user);
                File upfile = new File(updir.getPath() + "/" + filename);
@@ -99,46 +124,8 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                defuses = new Vector<Document>();
                usedby = new Vector<Publication>();
 
-               Reader tool = Toolbox.getReader(upfile);
-               if (tool != null) {
-                       String fileref = tool.extractProperty("reference");
-                       String filever = tool.extractProperty("version");
-                       if (fileref != null && !doc.getReference().equals(fileref)) {
-                               setErrorCode("reference.mismatch");
-                               return ERROR;
-                       }
-                       if (filever != null)
-                               try {
-                                       Revision.Format get = new Revision.Format(
-                                                       getProjectSettings().getRevisionPattern());
-                                       Revision newver = get.parse(filever);
-                                       Revision oldver = new Revision(doc.getVersion());
-                                       if (!newver.isGraterThan(oldver))
-                                               throw new InvalidPropertyException("version");
-                                       if (newver.isMinor())
-                                               state = ProgressState.inWORK;
-                                       else
-                                               state = ProgressState.inDRAFT;
-                                       docver = newver.toString();
-                               } catch (Exception e) {
-                                       setErrorCode("version.mismatch");
-                                       return ERROR;
-                               }
-                       summary = tool.extractProperty("history");
-                       date = tool.extractProperty("date");
-                       if (date != null) {
-                               ResourceBundle locale = ResourceBundle.getBundle("som",
-                                               ApplicationSettings.getCurrentLocale());
-                               SimpleDateFormat check = new SimpleDateFormat(
-                                               locale.getString("date.format"));
-                               try {
-                                       check.parse(date);
-                               } catch (ParseException e) {
-                                       setErrorCode("format.date");
-                                       return ERROR;
-                               }
-                       } else
-                               date = "";
+               if (!extractProperties(upfile, doc)) {
+                       return ERROR;
                }
                setupDefaultUses(deftype);
                // Add additional documents used by the current version
@@ -153,17 +140,83 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                for (Iterator<Publication> i = relist.iterator(); i.hasNext();) {
                        usedby.add(i.next());
                }
-               transax.commit();
                return SUCCESS;
        }
 
+       /**
+        * Try to extract properties from the uploaded file if it is XML.
+        * 
+        * @param upfile
+        *            the file to parse
+        * @param doc
+        *            the document to version
+        * @return true if succeeded or if the file is not XML, otherwise return false
+        */
+       private boolean extractProperties(File upfile, Document doc) {
+               boolean res = true;
+               Reader tool = Toolbox.getReader(upfile);
+               if (tool != null) {
+                       String fileref = tool.extractProperty("reference");
+                       String filever = tool.extractProperty("version");
+                       if (fileref != null && !doc.getReference().equals(fileref)) {
+                               setErrorCode("reference.mismatch");
+                               res = false;
+                       } else {
+                               if (filever != null) {
+                                       try {
+                                               Revision.Format get = new Revision.Format(
+                                                               getProjectSettings().getRevisionPattern());
+                                               Revision newver = get.parse(filever);
+                                               Revision oldver = new Revision(doc.getVersion());
+                                               if (!newver.isGraterThan(oldver)) {
+                                                       throw new InvalidPropertyException("version");
+                                               }
+                                               if (newver.isMinor()) {
+                                                       state = ProgressState.inWORK;
+                                               } else {
+                                                       state = ProgressState.inDRAFT;
+                                               }
+                                               docver = newver.toString();
+                                       } catch (Exception e) {
+                                               setErrorCode("version.mismatch");
+                                               res = false;
+                                       }
+                               }
+                               if (res) {
+                                       summary = tool.extractProperty("history");
+                                       date = tool.extractProperty("date");
+                                       if (date != null) {
+                                               ResourceBundle locale = ResourceBundle.getBundle("som",
+                                                               getApplicationSettings().getCurrentLocale());
+                                               SimpleDateFormat check = new SimpleDateFormat(locale
+                                                               .getString("date.format"));
+                                               try {
+                                                       check.parse(date);
+                                               } catch (ParseException e) {
+                                                       setErrorCode("format.date");
+                                                       res = false;
+                                               }
+                                       } else {
+                                               date = "";
+                                       }
+                               }
+                       }
+               }
+               return res;
+       }
+
+       /**
+        * Create a new version of the selected document.
+        * 
+        * @return SUCCESS - if succeeded, "cancel" - if canceled, ERROR - if failed
+        */
        public String doVersion() {
-               // -------------------------
                setMenuProperty("study");
                setTitleProperty("study");
                setEditDisabledProperty("true");
-        initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
-           
+               initializationScreenContext(_menuProperty, _titleProperty,
+                               _editDisabledProperty);
+
                if (action == ToDo.cancel)
                        return "cancel";
 
@@ -172,96 +225,23 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                        mystudy = getOpenStudy();
                        User user = getConnectedUser();
                        Step step = mystudy.getSelectedStep();
-//                     List<Step> steps = mystudy.getInvolvedSteps();
                        Date aDate = null;
                        if (date.length() > 0) {
                                ResourceBundle locale = ResourceBundle.getBundle("som",
-                                               ApplicationSettings.getCurrentLocale());
-                               SimpleDateFormat get = new SimpleDateFormat(
-                                               locale.getString("date.format"));
+                                               getApplicationSettings().getCurrentLocale());
+                               SimpleDateFormat get = new SimpleDateFormat(locale
+                                               .getString("date.format"));
                                aDate = get.parse(date);
                        }
-                       
+
                        String[] listDocuses = null;
                        if (docuses != null) {
                                listDocuses = docuses.split(",");
                        }
-                       getPublicationService().versionDocument(step, user, filename, Integer.valueOf(index), docver, 
-                                       summary, state, aDate, listDocuses, docusedby/*, steps*/);
-                       /*                      File updir = getRepositoryService().getDownloadDirectory(user);
-                       File upfile = new File(updir.getPath() + "/" + filename);
-
-                       // Versioning of the document
-                       Document.Properties dprop = new Document.Properties();
-                       Publication current = step.getDocument(Integer.valueOf(index));
-                       Publication next;
-
-                       if (docver.length() == 0) { // Importation of a foreign document
-                               next = getStepService().versionDocument(step, current, dprop.setAuthor(user)
-                                               .setDescription(summary));
-                               updir = next.getSourceFile().asFile();
-                               if (logger.isInfoEnabled())
-                                       logger.info("Moving \"" + upfile.getName() + "\" to \""
-                                                       + updir.getPath() + "\".");
-                               upfile.renameTo(updir);
-                               try {
-                                       getPublicationService().saveAs(next, state); // May throw FileNotFound if rename was not done
-                               } catch (FileNotFoundException saverror) {
-                                       Thread.sleep(1000);
-                                       logger.info("Waiting for the file.");
-                                       upfile.renameTo(updir);
-                                       getPublicationService().saveAs(next, state); // Forget it if throw again FileNotFound
-                               }
-                       } else {
-                               if (date.length() > 0) {
-                                       ResourceBundle locale = ResourceBundle.getBundle("som",
-                                                       ApplicationSettings.getCurrentLocale());
-                                       SimpleDateFormat get = new SimpleDateFormat(
-                                                       locale.getString("date.format"));
-                                       dprop.setDate(get.parse(date));
-                               }
-                               next = getStepService().versionDocument(step, current, dprop.setAuthor(user)
-                                               .setDescription(summary));
-                               updir = next.getSourceFile().asFile();
-                               if (logger.isInfoEnabled())
-                                       logger.info("Moving \"" + upfile.getName() + "\" to \""
-                                                       + updir.getPath() + "\".");
-                               upfile.renameTo(updir);
-                               try {
-                                       getPublicationService().saveAs(next, new Revision(docver));
-                               } catch (FileNotFoundException saverror) {
-                                       Thread.sleep(1000);
-                                       logger.info("Waiting for the file.");
-                                       upfile.renameTo(updir);
-                                       getPublicationService().saveAs(next, state);
-                               }
-                       }
-                       // TODO: Remove current document details from the contents of open study
+                       getPublicationService().versionDocument(step, user, filename,
+                                       Integer.valueOf(index), docver, summary, state, aDate,
+                                       listDocuses, docusedby);
 
-                       // Creation of uses relations
-                       if (docuses != null) {
-                               String[] list = docuses.split(",");
-                               for (int i = 0; i < list.length; i++) {
-                                       Integer index = Integer.valueOf(list[i].trim());
-                                       Publication used = getPublication(index);
-                                       next.addDependency(used);
-                               }
-                       }
-                       // Outdating impacted document
-                       HashSet<Integer> compatible = new HashSet<Integer>();
-                       if (docusedby != null) {
-                               String[] list = docusedby.split(",");
-                               for (int i = 0; i < list.length; i++)
-                                       compatible.add(Integer.valueOf(list[i].trim()));
-                       }
-                       List<Publication> relist = current
-                                       .getRelations(UsedByRelation.class);
-                       for (Iterator<Publication> i = relist.iterator(); i.hasNext();) {
-                               Publication using = i.next();
-                               if (!compatible.contains(using.getIndex()))
-                                       getPublicationService().outdate(using);
-                       }
-*/
                        // Update of the open study
                        mystudy.setSelection(mystudy.getSelection()); // Rebuilds the presentation
                        // TODO: Look is an optimization is possible (for example by updating the presentation of versioned document)
@@ -282,58 +262,47 @@ public class VersionDocumentAction extends UploadBaseNextAction {
        // ==============================================================================================================================
 
        public String getDate() {
-               // ------------------------
                return date;
        }
 
        public List<Publication> getDependencies() {
-               // -------------------------------------------
                return usedby;
        }
 
        public String getDescription() {
-               // -------------------------------
                return summary;
        }
 
        public String getIndex() {
-               // -------------------------
                return index;
        }
 
        public String getVersion() {
-               // ---------------------------
                return docver;
        }
 
        public void setDate(String date) {
-               // ---------------------------------
                this.date = date;
        }
 
        public void setDefaultDescription(String summary) {
-               // --------------------------------------------------
                if (this.summary == null)
                        this.summary = summary;
        }
 
        public void setDescription(String summary) {
-               // -------------------------------------------
                this.summary = summary;
        }
 
        public void setIndex(String index) {
-               // -----------------------------------
                this.index = index;
        }
 
        public void setUsedBy(long[] list) {
-               // -----------------------------------
                this.docusedby = list;
        }
 
        public void setVersion(String value) {
-               // -------------------------------------
                this.docver = value;
        }
 
@@ -377,6 +346,7 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Get the stepService.
+        * 
         * @return the stepService
         */
        public StepService getStepService() {
@@ -385,7 +355,9 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Set the stepService.
-        * @param stepService the stepService to set
+        * 
+        * @param stepService
+        *            the stepService to set
         */
        public void setStepService(StepService stepService) {
                _stepService = stepService;
@@ -393,6 +365,7 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Get the repositoryService.
+        * 
         * @return the repositoryService
         */
        public RepositoryService getRepositoryService() {
@@ -401,14 +374,17 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Set the repositoryService.
-        * @param repositoryService the repositoryService to set
+        * 
+        * @param repositoryService
+        *            the repositoryService to set
         */
        public void setRepositoryService(RepositoryService repositoryService) {
                _repositoryService = repositoryService;
        }
-       
+
        /**
         * Get the menuProperty.
+        * 
         * @return the menuProperty
         */
        public String getMenuProperty() {
@@ -417,14 +393,17 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Set the menuProperty.
-        * @param menuProperty the menuProperty to set
+        * 
+        * @param menuProperty
+        *            the menuProperty to set
         */
        public void setMenuProperty(String menuProperty) {
                this._menuProperty = menuProperty;
        }
-       
+
        /**
         * Get the _titleProperty.
+        * 
         * @return the _titleProperty
         */
        public String getTitleProperty() {
@@ -433,7 +412,9 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Set the _titleProperty.
-        * @param _titleProperty the titleProperty to set
+        * 
+        * @param titleProperty
+        *            the titleProperty to set
         */
        public void setTitleProperty(String titleProperty) {
                _titleProperty = titleProperty;
@@ -441,6 +422,7 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Get the _editDisabledProperty.
+        * 
         * @return the _editDisabledProperty
         */
        public String getEditDisabledProperty() {
@@ -449,7 +431,9 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Set the _editDisabledProperty.
-        * @param _editDisabledProperty the _editDisabledProperty to set
+        * 
+        * @param _editDisabledProperty
+        *            the _editDisabledProperty to set
         */
        public void setEditDisabledProperty(String _editDisabledProperty) {
                this._editDisabledProperty = _editDisabledProperty;
index c8092e2267548f38c2a16619a4e6fa8a247fde5a..3902f455a9b900bf4a29adbf51d44b103bc995f9 100644 (file)
@@ -38,13 +38,13 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
                <property name="projectSettings" ref="projectSettings" />
                <property name="documentTypeService" ref="documentTypeService" />
        </bean>
-       
-       <bean id="menuBarSettings"
-               class="org.splat.simer.MenuBarSettings" scope="session">
+
+       <bean id="menuBarSettings" class="org.splat.simer.MenuBarSettings"
+               scope="session">
        </bean>
-       
-       <bean id="titleBarSettings"
-               class="org.splat.simer.TitleBarSettings" scope="session">
+
+       <bean id="titleBarSettings" class="org.splat.simer.TitleBarSettings"
+               scope="session">
        </bean>
 
        <bean id="slidMenu" scope="session" abstract="true">
@@ -61,6 +61,7 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
 
        <bean id="openObject" abstract="true"
                class="org.splat.simer.OpenObject" scope="session">
+               <property name="applicationSettings" ref="applicationSettings" />
                <property name="projectElementService"
                        ref="projectElementService" />
                <property name="projectSettings" ref="projectSettings" />
@@ -87,6 +88,7 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
 
        <bean id="baseAction" class="org.splat.simer.Action"
                scope="prototype" abstract="true">
+        <property name="applicationSettings" ref="applicationSettings" />
                <property name="openStudy" ref="openStudy" />
                <property name="openKnowledge" ref="openKnowledge" />
                <property name="menuBarSettings" ref="menuBarSettings" />
@@ -118,8 +120,8 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
                <property name="projectSettings" ref="projectSettings" />
                <property name="publicationService" ref="publicationService" />
                <property name="repositoryService" ref="repositoryService" />
-        <property name="documentService" ref="documentService" />
-        <property name="documentTypeService" ref="documentTypeService" />
+               <property name="documentService" ref="documentService" />
+               <property name="documentTypeService" ref="documentTypeService" />
        </bean>
 
        <bean id="displayStudyStepAction"
@@ -153,10 +155,10 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
                class="org.splat.simer.EditSimulationContextAction" scope="prototype"
                parent="displayStudyStepAction">
                <property name="stepService" ref="stepService" />
-        <property name="simulationContextService"
-            ref="simulationContextService" />
-        <property name="simulationContextTypeService"
-            ref="simulationContextTypeService" />
+               <property name="simulationContextService"
+                       ref="simulationContextService" />
+               <property name="simulationContextTypeService"
+                       ref="simulationContextTypeService" />
        </bean>
 
        <bean id="editDocumentAction"
@@ -180,12 +182,12 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        <!-- End of Inherited from displayStudyStepAction -->
 
        <bean id="startAction" class="org.splat.simer.StartAction"
-               scope="prototype" parent ="baseAction">
+               scope="prototype" parent="baseAction">
                <property name="applicationSettings" ref="applicationSettings" />
                <property name="projectSettings" ref="projectSettings" />
        </bean>
        <bean id="connectionAction" class="org.splat.simer.ConnectionAction"
-               scope="prototype" parent ="baseAction">
+               scope="prototype" parent="baseAction">
        </bean>
 
        <bean id="menuAction" class="org.splat.simer.MenuAction"
@@ -193,13 +195,13 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        </bean>
 
        <bean id="notYetImplementedAction"
-               class="org.splat.simer.NotYetImplementedAction" 
-               scope="prototype" parent ="baseAction">
+               class="org.splat.simer.NotYetImplementedAction" scope="prototype"
+               parent="baseAction">
        </bean>
 
        <bean id="searchStudyAction"
-               class="org.splat.simer.SearchStudyAction" 
-               scope="prototype" parent ="baseAction">
+               class="org.splat.simer.SearchStudyAction" scope="prototype"
+               parent="baseAction">
                <property name="projectSettings" ref="projectSettings" />
                <property name="searchService" ref="searchService" />
                <property name="simulationContextService"
@@ -208,8 +210,8 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        </bean>
 
        <bean id="searchKnowledgeAction"
-               class="org.splat.simer.SearchKnowledgeAction" 
-               scope="prototype" parent ="baseAction">
+               class="org.splat.simer.SearchKnowledgeAction" scope="prototype"
+               parent="baseAction">
                <property name="searchService" ref="searchService" />
                <property name="simulationContextService"
                        ref="simulationContextService" />
@@ -223,24 +225,25 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        </bean>
 
        <bean id="displayKnowledgeAction"
-               class="org.splat.simer.DisplayKnowledgeAction" 
-               scope="prototype"  parent ="baseAction">
+               class="org.splat.simer.DisplayKnowledgeAction" scope="prototype"
+               parent="baseAction">
                <property name="knowledgeElementService"
                        ref="knowledgeElementService" />
        </bean>
 
        <bean id="uploadAction" class="org.splat.simer.UploadAction"
-               scope="prototype" parent ="baseAction">
+               scope="prototype" parent="baseAction">
                <property name="repositoryService" ref="repositoryService" />
        </bean>
-       
-       <bean id="uploadStudyAction" class="org.splat.simer.UploadStudyAction"
-               scope="prototype" parent ="baseAction">
+
+       <bean id="uploadStudyAction"
+               class="org.splat.simer.UploadStudyAction" scope="prototype"
+               parent="baseAction">
        </bean>
 
        <bean id="versionDocumentAction"
-               class="org.splat.simer.VersionDocumentAction" 
-               scope="prototype" parent ="baseAction">
+               class="org.splat.simer.VersionDocumentAction" scope="prototype"
+               parent="baseAction">
                <property name="projectSettings" ref="projectSettings" />
                <property name="publicationService" ref="publicationService" />
                <property name="stepService" ref="stepService" />
@@ -248,14 +251,14 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        </bean>
 
        <bean id="databaseIndexingAction"
-               class="org.splat.simer.admin.DatabaseIndexingAction"
-               scope="prototype" parent ="baseAction">
+               class="org.splat.simer.admin.DatabaseIndexingAction" scope="prototype"
+               parent="baseAction">
                <property name="searchService" ref="searchService" />
        </bean>
 
        <bean id="importUserAction"
-               class="org.splat.simer.admin.ImportUserAction" 
-               scope="prototype" parent="baseAction">
+               class="org.splat.simer.admin.ImportUserAction" scope="prototype"
+               parent="baseAction">
                <property name="repositoryService" ref="repositoryService" />
                <property name="userService" ref="userService" />
        </bean>