Salome HOME
SimulationContextFacade has been moved into Siman-Common. Import document action...
authorrkv <rkv@opencascade.com>
Mon, 22 Oct 2012 09:53:04 +0000 (09:53 +0000)
committerrkv <rkv@opencascade.com>
Mon, 22 Oct 2012 09:53:04 +0000 (09:53 +0000)
12 files changed:
Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java
Workspace/Siman-Common/src/org/splat/service/SimulationContextService.java
Workspace/Siman-Common/src/org/splat/service/SimulationContextServiceImpl.java
Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeService.java [new file with mode: 0644]
Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeServiceImpl.java [new file with mode: 0644]
Workspace/Siman-Common/src/org/splat/service/dto/SimulationContextFacade.java [new file with mode: 0644]
Workspace/Siman-Common/src/org/splat/service/technical/ProjectSettingsServiceImpl.java
Workspace/Siman-Common/src/spring/businessServiceContext.xml
Workspace/Siman-Common/src/spring/technicalServiceContext.xml
Workspace/Siman/src/org/splat/simer/ApplicationSettings.java
Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java
Workspace/Siman/src/org/splat/simer/admin/SimulationContextFacade.java [deleted file]

index 508ebfc23dcae0edde0e8c0827e8b4de0b31dcf6..325bfd19acec845fbcabae94ac1af47429629081 100644 (file)
@@ -106,6 +106,7 @@ public class DocumentServiceImpl implements DocumentService {
         * 
         * @see org.splat.service.DocumentService#generateDocumentId(org.splat.dal.bo.som.Document, org.splat.dal.bo.som.Document.Properties)
         */
+       @Transactional
        public void generateDocumentId(Document aDoc, Properties dprop) {
                Study owner = null;
                if (dprop.getOwner() instanceof Study)
index a15cc17eb8dba7f8d5867ad40d5dfd866a1dfd6e..e82b810d43dc0e059f2ac5f5668fa7b0613f4d4e 100644 (file)
 package org.splat.service;
 
 import java.util.List;
+import java.util.Vector;
 
+import org.splat.dal.bo.som.ProgressState;
 import org.splat.dal.bo.som.SimulationContext;
 import org.splat.dal.bo.som.SimulationContextType;
 import org.splat.kernel.InvalidPropertyException;
+import org.splat.service.dto.SimulationContextFacade;
 import org.splat.service.technical.ProjectSettingsService;
 
 /**
@@ -24,6 +27,18 @@ import org.splat.service.technical.ProjectSettingsService;
  */
 public interface SimulationContextService {
 
+       /**
+        * Get simulation contexts which are currently in the given state.
+        * 
+        * @param aState
+        *            the progress state to filter contexts
+        * @return the list of found contexts as a vector of SimulationContextFacade
+        * @throws InvalidPropertyException
+        *             if the given state is invalid
+        */
+       public Vector<SimulationContextFacade> getSimulationContextsInState(
+                       ProgressState aState) throws InvalidPropertyException;
+
        /**
         * Get simulation context by its id.
         * 
@@ -55,20 +70,6 @@ public interface SimulationContextService {
        public List<SimulationContext> selectSimulationContextsWhere(
                        SimulationContext.Properties cprop);
 
-       /**
-        * Create a simulation context type.
-        * 
-        * @param name
-        *            context type name
-        * @param step
-        *            activity related to this context type
-        * @return the created context type
-        * @throws InvalidPropertyException
-        *             if some property of the type to be created is invalid
-        */
-       public SimulationContextType createType(String name,
-                       ProjectSettingsService.Step step) throws InvalidPropertyException;
-
        /**
         * Get all simulation context types.
         * 
@@ -137,15 +138,6 @@ public interface SimulationContextService {
         */
        List<SimulationContext> getSimulationContextList();
 
-       /**
-        * Approve the simulation context type.
-        * 
-        * @param simCtxType
-        *            the type to approve
-        * @return true if approval succeeded
-        */
-       public boolean approve(SimulationContextType simCtxType);
-
        /**
         * @param simCtxType
         * @return
index 0b31930a084eb1a5c105a15f5a75057336e5352a..7165cd2c1ec77b07a076ce67a2821f2b738c08f5 100644 (file)
@@ -9,7 +9,9 @@
 
 package org.splat.service;
 
+import java.util.Iterator;
 import java.util.List;
+import java.util.Vector;
 
 import org.hibernate.criterion.Criterion;
 import org.hibernate.criterion.Order;
@@ -21,6 +23,7 @@ import org.splat.dal.dao.som.SimulationContextDAO;
 import org.splat.dal.dao.som.SimulationContextTypeDAO;
 import org.splat.kernel.InvalidPropertyException;
 import org.splat.log.AppLogger;
+import org.splat.service.dto.SimulationContextFacade;
 import org.splat.service.technical.ProjectSettingsService;
 import org.splat.service.technical.ProjectSettingsServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
@@ -47,6 +50,35 @@ public class SimulationContextServiceImpl implements SimulationContextService {
         * Injected simulation context type DAO.
         */
        private SimulationContextTypeDAO _simulationContextTypeDAO;
+       /**
+        * Injected project settings service.
+        */
+       private ProjectSettingsService _projectSettingsService;
+
+       /**
+        * Get simulation contexts which are currently in the given state.
+        * 
+        * @param aState
+        *            the progress state to filter contexts
+        * @return the list of found contexts as a vector of SimulationContextFacade
+        * @throws InvalidPropertyException
+        *             if the given state is invalid
+        */
+       @Transactional(readOnly=true)
+       public Vector<SimulationContextFacade> getSimulationContextsInState(
+                       ProgressState aState) throws InvalidPropertyException {
+               SimulationContext.Properties cprop = new SimulationContext.Properties();
+               List<SimulationContext> context = selectSimulationContextsWhere(cprop
+                               .setState(aState));
+
+               Vector<SimulationContextFacade> result = new Vector<SimulationContextFacade>(
+                               context.size());
+               for (Iterator<SimulationContext> i = context.iterator(); i.hasNext();) {
+                       result.add(new SimulationContextFacade(i.next(),
+                                       getProjectSettings().getAllSteps()));
+               }
+               return result;
+       }
 
        /**
         * {@inheritDoc}
@@ -108,8 +140,8 @@ public class SimulationContextServiceImpl implements SimulationContextService {
                        // .append("'");
                        // separator = " and";
 
-                       aCondition = Restrictions.and(aCondition,
-                                       Restrictions.eq("value", value));
+                       aCondition = Restrictions.and(aCondition, Restrictions.eq("value",
+                                       value));
                }
                if (state != null) {
                        // query = query.append(separator).append(" state='").append(state)
@@ -118,8 +150,8 @@ public class SimulationContextServiceImpl implements SimulationContextService {
                                // order = " order by type asc";
                                anOrder = Order.asc("type");
                        }
-                       aCondition = Restrictions.and(aCondition,
-                                       Restrictions.eq("state", state));
+                       aCondition = Restrictions.and(aCondition, Restrictions.eq("state",
+                                       state));
                }
                // query.append(order);
                // return (List<SimulationContext>) Database.getSession().createQuery(
@@ -141,21 +173,6 @@ public class SimulationContextServiceImpl implements SimulationContextService {
                return resList;
        }
 
-       /**
-        * {@inheritDoc}
-        * 
-        * @see org.splat.service.SimulationContextService#createType(java.lang.String, org.splat.service.technical.ProjectSettingsService.Step)
-        */
-       @Transactional
-       public SimulationContextType createType(String name,
-                       ProjectSettingsService.Step step) throws InvalidPropertyException {
-               // TODO: Check for duplicate definition
-               SimulationContextType type = new SimulationContextType(name, step);
-               getSimulationContextTypeDAO().create(type);
-
-               return type;
-       }
-
        /**
         * {@inheritDoc}
         * 
@@ -184,8 +201,8 @@ public class SimulationContextServiceImpl implements SimulationContextService {
                // query = query.append(" order by step asc");
                Criterion aCondition = Restrictions.eq("step", step[0].getNumber());
                for (int i = 1; i < step.length; i++) { // Useless to order as the result mixes localized and non localized types
-                       aCondition = Restrictions.or(aCondition,
-                                       Restrictions.eq("step", step[i].getNumber()));
+                       aCondition = Restrictions.or(aCondition, Restrictions.eq("step",
+                                       step[i].getNumber()));
                }
                return getSimulationContextTypeDAO().getFilteredList(aCondition,
                                Order.asc("step"));
@@ -229,8 +246,8 @@ public class SimulationContextServiceImpl implements SimulationContextService {
                        anOrder = Order.desc("state"); // APPROVED (upper case A) is grater than inCHECK (lower case i)
                }
                if (state != null) {
-                       aCondition = Restrictions.and(aCondition,
-                                       Restrictions.eq("state", state));
+                       aCondition = Restrictions.and(aCondition, Restrictions.eq("state",
+                                       state));
                        if (step != null) {
                                if (state != ProgressState.APPROVED) {
                                        anOrder = Order.asc("name");
@@ -304,21 +321,6 @@ public class SimulationContextServiceImpl implements SimulationContextService {
                return true;
        }
 
-       /**
-        * Approve the simulation context type.
-        * 
-        * @param simCtxType
-        *            the type to approve
-        * @return true if approval succeeded
-        */
-       public boolean approve(SimulationContextType simCtxType) {
-               if (simCtxType.getState() != ProgressState.inCHECK)
-                       return false;
-               simCtxType.setState(ProgressState.APPROVED); // The type name is supposed being localized
-               getSimulationContextTypeDAO().update(simCtxType);
-               return true;
-       }
-
        /**
         * @param simCtxType
         * @return
@@ -367,4 +369,23 @@ public class SimulationContextServiceImpl implements SimulationContextService {
                        SimulationContextTypeDAO simulationContextTypeDAO) {
                _simulationContextTypeDAO = simulationContextTypeDAO;
        }
+
+       /**
+        * Get project settings.
+        * 
+        * @return Project settings service
+        */
+       private ProjectSettingsService getProjectSettings() {
+               return _projectSettingsService;
+       }
+
+       /**
+        * Set project settings service.
+        * 
+        * @param projectSettingsService
+        *            project settings service
+        */
+       public void setProjectSettings(ProjectSettingsService projectSettingsService) {
+               _projectSettingsService = projectSettingsService;
+       }
 }
diff --git a/Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeService.java b/Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeService.java
new file mode 100644 (file)
index 0000000..10d50f6
--- /dev/null
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Company         OPEN CASCADE
+ * Application     SIMAN
+ * File            $Id$ 
+ * Creation date   22.10.2012
+ * @author         $Author$
+ * @version        $Revision$
+ * @copyright      OPEN CASCADE 2012
+ *****************************************************************************/
+
+package org.splat.service;
+
+import org.splat.dal.bo.som.SimulationContextType;
+import org.splat.kernel.InvalidPropertyException;
+import org.splat.service.technical.ProjectSettingsService;
+
+/**
+ * Simulation context type service interface.
+ * 
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
+ */
+public interface SimulationContextTypeService {
+
+       /**
+        * Create a simulation context type.
+        * 
+        * @param name
+        *            context type name
+        * @param step
+        *            activity related to this context type
+        * @return the created context type
+        * @throws InvalidPropertyException
+        *             if some property of the type to be created is invalid
+        */
+       public SimulationContextType createType(String name,
+                       ProjectSettingsService.Step step) throws InvalidPropertyException;
+
+       /**
+        * Approve the simulation context type.
+        * 
+        * @param simCtxType
+        *            the type to approve
+        * @return true if approval succeeded
+        */
+       public boolean approve(SimulationContextType simCtxType);
+
+}
diff --git a/Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeServiceImpl.java
new file mode 100644 (file)
index 0000000..410b642
--- /dev/null
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ * Company         OPEN CASCADE
+ * Application     SIMAN
+ * File            $Id$ 
+ * Creation date   22.10.2012
+ * @author         $Author$
+ * @version        $Revision$
+ * @copyright      OPEN CASCADE 2012
+ *****************************************************************************/
+
+package org.splat.service; 
+
+import org.splat.dal.bo.som.ProgressState;
+import org.splat.dal.bo.som.SimulationContextType;
+import org.splat.dal.dao.som.SimulationContextTypeDAO;
+import org.splat.kernel.InvalidPropertyException;
+import org.splat.service.technical.ProjectSettingsService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Simulation context type service implementation.
+ *
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
+ */
+public class SimulationContextTypeServiceImpl implements
+               SimulationContextTypeService {
+
+       /**
+        * Injected simulation context type DAO.
+        */
+       private SimulationContextTypeDAO _simulationContextTypeDAO;
+
+       /**
+        * {@inheritDoc}
+        * 
+        * @see org.splat.service.SimulationContextService#createType(java.lang.String, org.splat.service.technical.ProjectSettingsService.Step)
+        */
+       @Transactional
+       public SimulationContextType createType(String name,
+                       ProjectSettingsService.Step step) throws InvalidPropertyException {
+               // TODO: Check for duplicate definition
+               SimulationContextType type = new SimulationContextType(name, step);
+               getSimulationContextTypeDAO().create(type);
+
+               return type;
+       }
+
+       /**
+        * Approve the simulation context type.
+        * 
+        * @param simCtxType
+        *            the type to approve
+        * @return true if approval succeeded
+        */
+       public boolean approve(SimulationContextType simCtxType) {
+               if (simCtxType.getState() != ProgressState.inCHECK)
+                       return false;
+               simCtxType.setState(ProgressState.APPROVED); // The type name is supposed being localized
+               getSimulationContextTypeDAO().update(simCtxType);
+               return true;
+       }
+
+       /**
+        * Get the simulationContextTypeDAO.
+        * 
+        * @return the simulationContextTypeDAO
+        */
+       public SimulationContextTypeDAO getSimulationContextTypeDAO() {
+               return _simulationContextTypeDAO;
+       }
+
+       /**
+        * Set the simulationContextTypeDAO.
+        * 
+        * @param simulationContextTypeDAO
+        *            the simulationContextTypeDAO to set
+        */
+       public void setSimulationContextTypeDAO(
+                       SimulationContextTypeDAO simulationContextTypeDAO) {
+               _simulationContextTypeDAO = simulationContextTypeDAO;
+       }
+
+}
diff --git a/Workspace/Siman-Common/src/org/splat/service/dto/SimulationContextFacade.java b/Workspace/Siman-Common/src/org/splat/service/dto/SimulationContextFacade.java
new file mode 100644 (file)
index 0000000..77475ed
--- /dev/null
@@ -0,0 +1,77 @@
+package org.splat.service.dto;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.splat.service.technical.ProjectSettingsService;
+import org.splat.dal.bo.som.ProgressState;
+import org.splat.dal.bo.som.SimulationContext;
+import org.splat.dal.bo.som.SimulationContextType;
+
+public class SimulationContextFacade {
+
+       private SimulationContext my;
+       private String name;
+       private int at;
+       private ProgressState state;
+
+       // ==============================================================================================================================
+       // Constructor
+       // ==============================================================================================================================
+
+       public SimulationContextFacade(SimulationContext represented,
+                       List<ProjectSettingsService.Step> steps) {
+               // --------------------------------------------------------------
+               SimulationContextType mytype;
+
+               my = represented;
+               mytype = my.getType();
+               for (Iterator<ProjectSettingsService.Step> i = steps.iterator(); i
+                               .hasNext();) {
+                       ProjectSettingsService.Step step = i.next();
+                       if (!mytype.isAttachedTo(step))
+                               continue;
+                       at = step.getNumber(); // There is no direct service for getting the step number
+                       break;
+               }
+               name = my.getType().getName();
+               if (mytype.isApproved()) {
+                       state = ProgressState.inCHECK;
+                       // RKV: TODO: Do translation in presentation layer by struts tools: name = ResourceBundle.getBundle("som",
+                       // ApplicationSettings.getCurrentLocale()).getString("type.context." + name);
+               } else {
+                       state = ProgressState.inDRAFT;
+               }
+       }
+
+       // ==============================================================================================================================
+       // Getters
+       // ==============================================================================================================================
+
+       public String getEditIcon() {
+               // ----------------------------
+               StringBuffer result = new StringBuffer("icon.ed").append(state).append(
+                               ".png");
+               return result.toString();
+       }
+
+       public String getIndex() {
+               // -------------------------
+               return String.valueOf(my.getIndex());
+       }
+
+       public int getStepNumber() {
+               // ---------------------------
+               return at;
+       }
+
+       public String getTypeName() {
+               // ----------------------------
+               return name;
+       }
+
+       public String getValue() {
+               // -------------------------
+               return my.getValue();
+       }
+}
\ No newline at end of file
index b11341b33c0af8bad60f834e99c78ab9d1c23365..14eda4605e519557e7aa64024a7ede672034d8a9 100644 (file)
@@ -39,7 +39,7 @@ import org.splat.dal.dao.som.Database;
 import org.splat.manox.XDOM;
 import org.splat.service.DocumentTypeService;
 import org.splat.service.KnowledgeElementTypeService;
-import org.splat.service.SimulationContextService;
+import org.splat.service.SimulationContextTypeService;
 
 public class ProjectSettingsServiceImpl implements ProjectSettingsService {
 
@@ -68,9 +68,9 @@ public class ProjectSettingsServiceImpl implements ProjectSettingsService {
        private static ProjectSettingsServiceImpl my = null; // Singleton instance
        private Database _database;
        /**
-        * Injected simulation context service.
+        * Injected simulation context type service.
         */
-       private SimulationContextService _simulationContextService;
+       private SimulationContextTypeService _simulationContextTypeService;
        /**
         * Injected knowledge element type service.
         */
@@ -521,9 +521,9 @@ public class ProjectSettingsServiceImpl implements ProjectSettingsService {
                                                                        + "\" classification. Simulation Context type ignored.");
                                        continue;
                                }
-                               tctex = getSimulationContextService().createType(type,
+                               tctex = getSimulationContextTypeService().createType(type,
                                                mapstep.get(type)); // Creation of Simulation Context Types
-                               getSimulationContextService().approve(tctex);
+                               getSimulationContextTypeService().approve(tctex);
                        }
                } catch (Exception error) {
                        logger.warn("Error creating context types, reason:", error); // Should not happen
@@ -550,23 +550,23 @@ public class ProjectSettingsServiceImpl implements ProjectSettingsService {
        }
 
        /**
-        * Get the simulationContextService.
+        * Get the simulationContextTypeService.
         * 
-        * @return the simulationContextService
+        * @return the simulationContextTypeService
         */
-       public SimulationContextService getSimulationContextService() {
-               return _simulationContextService;
+       public SimulationContextTypeService getSimulationContextTypeService() {
+               return _simulationContextTypeService;
        }
 
        /**
-        * Set the simulationContextService.
+        * Set the simulationContextTypeService.
         * 
-        * @param simulationContextService
-        *            the simulationContextService to set
+        * @param simulationContextTypeService
+        *            the simulationContextTypeService to set
         */
-       public void setSimulationContextService(
-                       SimulationContextService simulationContextService) {
-               _simulationContextService = simulationContextService;
+       public void setSimulationContextTypeService(
+                       SimulationContextTypeService simulationContextTypeService) {
+               _simulationContextTypeService = simulationContextTypeService;
        }
 
        /**
index d4abfbc97b28ba28b7dc6bed0fee1c7acee8a8dd..51146ad2083c68709a57044da5d7d69a4e6a1f95 100644 (file)
@@ -102,13 +102,19 @@ http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
                <property name="projectElementDAO" ref="projectElementDAO" />
        </bean>
 
-       <bean id="simulationContextService"
-               class="org.splat.service.SimulationContextServiceImpl">
-               <property name="simulationContextDAO"
-                       ref="simulationContextDAO" />
-               <property name="simulationContextTypeDAO"
-                       ref="simulationContextTypeDAO" />
-       </bean>
+    <bean id="simulationContextService"
+        class="org.splat.service.SimulationContextServiceImpl">
+        <property name="simulationContextDAO"
+            ref="simulationContextDAO" />
+        <property name="simulationContextTypeDAO"
+            ref="simulationContextTypeDAO" />
+    </bean>
+
+    <bean id="simulationContextTypeService"
+        class="org.splat.service.SimulationContextTypeServiceImpl">
+        <property name="simulationContextTypeDAO"
+            ref="simulationContextTypeDAO" />
+    </bean>
 
        <bean id="studyService"
                class="org.splat.service.StudyServiceImpl">
index 2c368a54e59ada6f4faac38d8fc2be9aec647af4..25da86b8b89f14e80d35144c0b5fdd94dedcf790 100644 (file)
@@ -17,8 +17,8 @@ http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
        <bean id="projectSettings"
                class="org.splat.service.technical.ProjectSettingsServiceImpl">
                <property name="database" ref="database" />
-               <property name="simulationContextService"
-                       ref="simulationContextService" />
+               <property name="simulationContextTypeService"
+                       ref="simulationContextTypeService" />
                <property name="documentTypeService" ref="documentTypeService" />
                <property name="knowledgeElementTypeService"
                        ref="knowledgeElementTypeService" />
index af7bd67f257cb220085756fdaf6f45bfa1880270..21f17c28e6349a075b90cf6ab0300ae2f9396641 100644 (file)
@@ -29,6 +29,7 @@ import org.splat.dal.bo.som.KnowledgeElement;
 import org.splat.dal.bo.som.ProgressState;
 import org.splat.service.DocumentTypeService;
 import org.splat.service.technical.ProjectSettingsService;
+import org.splat.simer.Converter;
 import org.splat.dal.bo.som.SimulationContext;
 import org.splat.som.Step;
 import org.splat.som.StudyRights;
index 92b36c9b6aeeb3909797bc043c1d91ae57475d93..38dc4c72cc1b3f74b5f317ffab63b08f2f438e03 100644 (file)
@@ -24,6 +24,7 @@ import org.splat.service.SearchService;
 import org.splat.service.SimulationContextService;
 import org.splat.service.technical.ProjectSettingsService;
 import org.splat.service.dto.Proxy;
+import org.splat.service.dto.SimulationContextFacade;
 import org.splat.dal.bo.som.SimulationContext;
 import org.splat.dal.bo.som.SimulationContextType;
 import org.splat.dal.bo.som.Study;
@@ -118,27 +119,18 @@ public class SimulationContextAction extends Action {
        // Action methods
        // ==============================================================================================================================
 
+       /**
+        * Initialize the simulation context list.
+        * @return SUCCESS if succeeded, otherwise - ERROR
+        */
        public String doInitialize() {
-               // -----------------------------
-               Session connex = Database.getCurSession();
-               Transaction transax = connex.beginTransaction();
                try {
-                       SimulationContext.Properties cprop = new SimulationContext.Properties();
-                       List<SimulationContext> context = getSimulationContextService()
-                                       .selectSimulationContextsWhere(
-                                                       cprop.setState(ProgressState.inCHECK));
-
-                       tocheck = new Vector<SimulationContextFacade>(context.size());
-                       for (Iterator<SimulationContext> i = context.iterator(); i
-                                       .hasNext();) {
-                               tocheck.add(new SimulationContextFacade(i.next(),
-                                               getProjectSettings().getAllSteps()));
-                       }
+                       tocheck = getSimulationContextService()
+                                       .getSimulationContextsInState(ProgressState.inCHECK);
                        selection = 0;
                        edition = null;
                        owner = null;
 
-                       transax.commit();
                        return SUCCESS;
                } catch (Exception error) {
                        logger.error("Reason:", error);
@@ -174,7 +166,8 @@ public class SimulationContextAction extends Action {
                                        kprop.setSimulationContexts(selected).setState(
                                                        ProgressState.inWORK));
 
-                       step = getSimulationContextService().getAttachedStep(edition.getType());
+                       step = getSimulationContextService().getAttachedStep(
+                                       edition.getType());
                        owner = new HashSet<ProjectElementFacade>();
                        for (Iterator<Proxy> i = kelm.iterator(); i.hasNext();) {
                                KnowledgeElement next = getKnowledgeElementService()
@@ -190,7 +183,8 @@ public class SimulationContextAction extends Action {
                        }
                        SimulationContextType.Properties sprop = new SimulationContextType.Properties();
                        List<SimulationContextType> types = getSimulationContextService()
-                                       .selectTypesWhere(sprop.setProgressState(ProgressState.APPROVED));
+                                       .selectTypesWhere(
+                                                       sprop.setProgressState(ProgressState.APPROVED));
                        Locale[] support = ApplicationSettings.getSupportedLocales();
 
                        // Sort localized type names
@@ -332,6 +326,7 @@ public class SimulationContextAction extends Action {
 
        /**
         * Get the searchService.
+        * 
         * @return the searchService
         */
        public SearchService getSearchService() {
@@ -340,7 +335,9 @@ public class SimulationContextAction extends Action {
 
        /**
         * Set the searchService.
-        * @param searchService the searchService to set
+        * 
+        * @param searchService
+        *            the searchService to set
         */
        public void setSearchService(SearchService searchService) {
                _searchService = searchService;
diff --git a/Workspace/Siman/src/org/splat/simer/admin/SimulationContextFacade.java b/Workspace/Siman/src/org/splat/simer/admin/SimulationContextFacade.java
deleted file mode 100644 (file)
index d27d373..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.splat.simer.admin;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ResourceBundle;
-
-import org.splat.service.technical.ProjectSettingsService;
-import org.splat.simer.ApplicationSettings;
-import org.splat.dal.bo.som.ProgressState;
-import org.splat.dal.bo.som.SimulationContext;
-import org.splat.dal.bo.som.SimulationContextType;
-
-
-public class SimulationContextFacade {
-
-    private SimulationContext  my;
-    private String             name;
-    private int                at;
-    private ProgressState      state;
-
-//  ==============================================================================================================================
-//  Constructor
-//  ==============================================================================================================================
-
-    public SimulationContextFacade (SimulationContext represented, List<ProjectSettingsService.Step> steps) {
-//  --------------------------------------------------------------
-      SimulationContextType      mytype;
-
-      my     = represented;
-      mytype = my.getType();
-      for (Iterator<ProjectSettingsService.Step> i=steps.iterator(); i.hasNext(); ) {
-       ProjectSettingsService.Step          step = i.next();
-       if (!mytype.isAttachedTo(step)) continue;
-       at = step.getNumber();   // There is no direct service for getting the step number
-       break;
-      }
-         name  = my.getType().getName();
-      if (mytype.isApproved()) {
-       state = ProgressState.inCHECK;
-        name  = ResourceBundle.getBundle("som", ApplicationSettings.getCurrentLocale()).getString("type.context." + name);
-      } else {
-       state = ProgressState.inDRAFT;
-      }
-    }
-
-//  ==============================================================================================================================
-//  Getters
-//  ==============================================================================================================================
-
-    public String getEditIcon () {
-//  ----------------------------
-      StringBuffer result = new StringBuffer("icon.ed").append(state).append(".png");
-      return       result.toString();
-    }
-    public String getIndex () {
-//  -------------------------
-      return String.valueOf(my.getIndex());
-    }
-    public int getStepNumber () {
-//  ---------------------------
-      return  at;
-    }
-    public String getTypeName () {
-//  ----------------------------
-      return name;
-    }
-    public String getValue () {
-//  -------------------------
-      return  my.getValue();
-    }
-}
\ No newline at end of file