From 6b7335fc7572597f448ed21fa7b0c63203566507 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 22 Oct 2012 09:53:04 +0000 Subject: [PATCH] SimulationContextFacade has been moved into Siman-Common. Import document action is fixed. --- .../splat/service/DocumentServiceImpl.java | 1 + .../service/SimulationContextService.java | 38 +++----- .../service/SimulationContextServiceImpl.java | 97 +++++++++++-------- .../service/SimulationContextTypeService.java | 47 +++++++++ .../SimulationContextTypeServiceImpl.java | 83 ++++++++++++++++ .../service/dto/SimulationContextFacade.java | 77 +++++++++++++++ .../technical/ProjectSettingsServiceImpl.java | 30 +++--- .../src/spring/businessServiceContext.xml | 20 ++-- .../src/spring/technicalServiceContext.xml | 4 +- .../org/splat/simer/ApplicationSettings.java | 1 + .../simer/admin/SimulationContextAction.java | 33 +++---- .../simer/admin/SimulationContextFacade.java | 71 -------------- 12 files changed, 328 insertions(+), 174 deletions(-) create mode 100644 Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeService.java create mode 100644 Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeServiceImpl.java create mode 100644 Workspace/Siman-Common/src/org/splat/service/dto/SimulationContextFacade.java delete mode 100644 Workspace/Siman/src/org/splat/simer/admin/SimulationContextFacade.java diff --git a/Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java index 508ebfc..325bfd1 100644 --- a/Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java +++ b/Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java @@ -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) diff --git a/Workspace/Siman-Common/src/org/splat/service/SimulationContextService.java b/Workspace/Siman-Common/src/org/splat/service/SimulationContextService.java index a15cc17..e82b810 100644 --- a/Workspace/Siman-Common/src/org/splat/service/SimulationContextService.java +++ b/Workspace/Siman-Common/src/org/splat/service/SimulationContextService.java @@ -10,10 +10,13 @@ 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 getSimulationContextsInState( + ProgressState aState) throws InvalidPropertyException; + /** * Get simulation context by its id. * @@ -55,20 +70,6 @@ public interface SimulationContextService { public List 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 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 diff --git a/Workspace/Siman-Common/src/org/splat/service/SimulationContextServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/SimulationContextServiceImpl.java index 0b31930..7165cd2 100644 --- a/Workspace/Siman-Common/src/org/splat/service/SimulationContextServiceImpl.java +++ b/Workspace/Siman-Common/src/org/splat/service/SimulationContextServiceImpl.java @@ -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 getSimulationContextsInState( + ProgressState aState) throws InvalidPropertyException { + SimulationContext.Properties cprop = new SimulationContext.Properties(); + List context = selectSimulationContextsWhere(cprop + .setState(aState)); + + Vector result = new Vector( + context.size()); + for (Iterator 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) 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 index 0000000..10d50f6 --- /dev/null +++ b/Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeService.java @@ -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 Roman Kozlov (RKV) + */ +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 index 0000000..410b642 --- /dev/null +++ b/Workspace/Siman-Common/src/org/splat/service/SimulationContextTypeServiceImpl.java @@ -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 Roman Kozlov (RKV) + */ +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 index 0000000..77475ed --- /dev/null +++ b/Workspace/Siman-Common/src/org/splat/service/dto/SimulationContextFacade.java @@ -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 steps) { + // -------------------------------------------------------------- + SimulationContextType mytype; + + my = represented; + mytype = my.getType(); + for (Iterator 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 diff --git a/Workspace/Siman-Common/src/org/splat/service/technical/ProjectSettingsServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/technical/ProjectSettingsServiceImpl.java index b11341b..14eda46 100644 --- a/Workspace/Siman-Common/src/org/splat/service/technical/ProjectSettingsServiceImpl.java +++ b/Workspace/Siman-Common/src/org/splat/service/technical/ProjectSettingsServiceImpl.java @@ -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; } /** diff --git a/Workspace/Siman-Common/src/spring/businessServiceContext.xml b/Workspace/Siman-Common/src/spring/businessServiceContext.xml index d4abfbc..51146ad 100644 --- a/Workspace/Siman-Common/src/spring/businessServiceContext.xml +++ b/Workspace/Siman-Common/src/spring/businessServiceContext.xml @@ -102,13 +102,19 @@ http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> - - - - + + + + + + + + diff --git a/Workspace/Siman-Common/src/spring/technicalServiceContext.xml b/Workspace/Siman-Common/src/spring/technicalServiceContext.xml index 2c368a5..25da86b 100644 --- a/Workspace/Siman-Common/src/spring/technicalServiceContext.xml +++ b/Workspace/Siman-Common/src/spring/technicalServiceContext.xml @@ -17,8 +17,8 @@ http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> - + diff --git a/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java b/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java index af7bd67..21f17c2 100644 --- a/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java +++ b/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java @@ -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; diff --git a/Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java b/Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java index 92b36c9..38dc4c7 100644 --- a/Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java +++ b/Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java @@ -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 context = getSimulationContextService() - .selectSimulationContextsWhere( - cprop.setState(ProgressState.inCHECK)); - - tocheck = new Vector(context.size()); - for (Iterator 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(); for (Iterator i = kelm.iterator(); i.hasNext();) { KnowledgeElement next = getKnowledgeElementService() @@ -190,7 +183,8 @@ public class SimulationContextAction extends Action { } SimulationContextType.Properties sprop = new SimulationContextType.Properties(); List 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 index d27d373..0000000 --- a/Workspace/Siman/src/org/splat/simer/admin/SimulationContextFacade.java +++ /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 steps) { -// -------------------------------------------------------------- - SimulationContextType mytype; - - my = represented; - mytype = my.getType(); - for (Iterator 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 -- 2.30.2