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;
* Injected simulation context service.
*/
private SimulationContextService _simulationContextService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
/**
* Context name comparator.
// Action methods
// ==============================================================================================================================
+ /**
+ * Initialize the simulation context list.
+ * @return SUCCESS if succeeded, otherwise - ERROR
+ */
public String doInitialize() {
- // -----------------------------
- Session connex = Database.getSession();
- 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;
+
+ setMenuProperty("study");
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
- transax.commit();
return SUCCESS;
} catch (Exception error) {
logger.error("Reason:", error);
public String doSelect() {
// -------------------------
- Session connex = Database.getSession();
+
+ setMenuProperty("study");
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
+
+ Session connex = Database.getCurSession();
Transaction transax = connex.beginTransaction();
try {
SimulationContext.Properties cprop = new SimulationContext.Properties();
kprop.setSimulationContexts(selected).setState(
ProgressState.inWORK));
- step = edition.getType().getAttachedStep();
+ step = getSimulationContextService().getAttachedStep(
+ edition.getType());
owner = new HashSet<ProjectElementFacade>();
for (Iterator<Proxy> i = kelm.iterator(); i.hasNext();) {
KnowledgeElement next = getKnowledgeElementService()
}
SimulationContextType.Properties sprop = new SimulationContextType.Properties();
List<SimulationContextType> types = getSimulationContextService()
- .selectTypesWhere(sprop.setState(ProgressState.APPROVED));
+ .selectTypesWhere(
+ sprop.setProgressState(ProgressState.APPROVED));
Locale[] support = ApplicationSettings.getSupportedLocales();
// Sort localized type names
/**
* Get the searchService.
+ *
* @return the searchService
*/
public SearchService getSearchService() {
/**
* Set the searchService.
- * @param searchService the searchService to set
+ *
+ * @param searchService
+ * the searchService to set
*/
public void setSearchService(SearchService searchService) {
_searchService = searchService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty
+ * the menuProperty to set
+ */
+ public void setMenuProperty(final String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file