#Lock service exception values
-LCK-000001=Lock reference already exists for user {2}.
+LCK-000001=Lock reference already exists for user {0}.
LCK-000002=Lock reference does not exists.
-LCK-000003=Lock reference protected and can be only deleted or updated by user {2}.
-LCK-000004=Lock reference is timeout and could have been modified by user {2}.
-STD-000001=Unable to re-index the study #{1}, reason: {2}
-SCN-000001=Scenario doesn't contain the step number #{1}
-SCN-000002=Scenario doesn't contain the document #{1}
-SCN-000003=The existing file {1} has been deleted when check-in the scenario #{2}
-SCN-000004=Can not delete the existing destination file to move file from {1} to {2} when check-in the scenario #{3}
-SCN-000005=Can not move file from {1} to {2} when check-in the scenario #{3}
-KNT-000001=Knowledge element type "{1}" already exists
-SCT-000001=Simulation context type "{1}" already exists
-DCT-000001=Document type "{1}" already exists
+LCK-000003=Lock reference protected and can be only deleted or updated by user {0}.
+LCK-000004=Lock reference is timeout and could have been modified by user {0}.
+STD-000001=Unable to re-index the study #{0}, reason: {1}
+SCN-000001=Scenario doesn't contain the step number #{0}
+SCN-000002=Scenario doesn't contain the document #{0}
+SCN-000003=The existing file {0} has been deleted when check-in the scenario #{0}
+SCN-000004=Can not delete the existing destination file to move file from {0} to {1} when check-in the scenario #{2}
+SCN-000005=Can not move file from {0} to {1} when check-in the scenario #{2}
+SCN-000006=Scenario #{0} is not found
+SCN-000007=The user {0} does not participate in the scenario #{1}
+SCN-000008=The scenario #{0} is already checked out by the user {1}
+USR-000001=User {0} is not found in the database
+KNT-000001=Knowledge element type "{0}" already exists
+SCT-000001=Simulation context type "{0}" already exists
+DCT-000001=Document type "{0}" already exists
#Lock service exception values
-LCK-000001=Lock reference already exists for user {2}.
+LCK-000001=Lock reference already exists for user {0}.
LCK-000002=Lock reference does not exists.
-LCK-000003=Lock reference protected and can be only deleted or updated by user {2}.
-LCK-000004=Lock reference is timeout and could have been modified by user {2}.
-STD-000001=Unable to re-index the study #{1}, reason: {2}
-SCN-000001=Scenario doesn't contain the step number #{1}
-SCN-000002=Scenario doesn't contain the document #{1}
-SCN-000003=The existing file {1} has been deleted when check-in the scenario #{2}
-SCN-000004=Can not delete the existing destination file to move file from {1} to {2} when check-in the scenario #{3}
-SCN-000005=Can not move file from {1} to {2} when check-in the scenario #{3}
-KNT-000001=Knowledge element type "{1}" already exists
-SCT-000001=Simulation context type "{1}" already exists
-DCT-000001=Document type "{1}" already exists
+LCK-000003=Lock reference protected and can be only deleted or updated by user {0}.
+LCK-000004=Lock reference is timeout and could have been modified by user {0}.
+STD-000001=Unable to re-index the study #{0}, reason: {1}
+SCN-000001=Scenario doesn't contain the step number #{0}
+SCN-000002=Scenario doesn't contain the document #{0}
+SCN-000003=The existing file {0} has been deleted when check-in the scenario #{0}
+SCN-000004=Can not delete the existing destination file to move file from {0} to {1} when check-in the scenario #{2}
+SCN-000005=Can not move file from {0} to {1} when check-in the scenario #{2}
+SCN-000006=Scenario #{0} is not found
+SCN-000007=The user {0} does not participate in the scenario #{1}
+SCN-000008=The scenario #{0} is already checked out by the user {1}
+USR-000001=User {0} is not found in the database
+KNT-000001=Knowledge element type "{0}" already exists
+SCT-000001=Simulation context type "{0}" already exists
+DCT-000001=Document type "{0}" already exists
public enum MessageKeyEnum {
/**
- * Lock reference already exists for user {2}.
+ * Lock reference already exists for user {0}.
*/
LCK_000001("LCK-000001"),
/**
*/
LCK_000002("LCK-000002"),
/**
- * Lock reference protected and can be only deleted or updated by user {2}.
+ * Lock reference protected and can be only deleted or updated by user {0}.
*/
LCK_000003("LCK-000003"),
/**
- * Lock reference is timeout and could have been modified by user {2}.
+ * Lock reference is timeout and could have been modified by user {0}.
*/
LCK_000004("LCK-000004"),
/**
- * Unable to re-index the study #{1}, reason: {2}.
+ * Unable to re-index the study #{0}, reason: {1}.
*/
STD_000001("STD-000001"),
/**
- * Scenario doesn't contain the step number #{1}.
+ * Scenario doesn't contain the step number #{0}.
*/
SCN_000001("SCN-000001"),
/**
- * Scenario doesn't contain the document #{1}.
+ * Scenario doesn't contain the document #{0}.
*/
SCN_000002("SCN-000002"),
/**
- * The existing file {1} has been deleted when check-in the scenario #{2}.
+ * The existing file {0} has been deleted when check-in the scenario #{1}.
*/
SCN_000003("SCN-000003"),
/**
- * Can not delete the existing destination file to move file from {1} to {2} when check-in the scenario #{3}.
+ * Can not delete the existing destination file to move file from {0} to {1} when check-in the scenario #{2}.
*/
SCN_000004("SCN-000004"),
/**
- * Can not move file from {1} to {2} when check-in the scenario #{3}.
+ * Can not move file from {0} to {1} when check-in the scenario #{2}.
*/
SCN_000005("SCN-000005"),
/**
- * Simulation context type "{1}" already exists.
+ * SCN-000006=Scenario #{0} is not found.
+ */
+ SCN_000006("SCN-000006"),
+ /**
+ * SCN-000007=The user {0} does not participate in the scenario #{1}.
+ */
+ SCN_000007("SCN-000007"),
+ /**
+ * SCN-000008=The scenario #{0} is already checked out by the user {1}.
+ */
+ SCN_000008("SCN-000008"),
+ /**
+ * USR-000001=User {0} is not found in the database.
+ */
+ USR_000001("USR-000001"),
+ /**
+ * Simulation context type "{0}" already exists.
*/
KNT_000001("KNT-000001"),
/**
- * Knowledge element type "{1}" already exists.
+ * Knowledge element type "{0}" already exists.
*/
SCT_000001("SCT-000001"),
/**
- * Document type "{1}" already exists.
+ * Document type "{0}" already exists.
*/
DCT_000001("DCT-000001");
import java.util.Locale;
+import org.springframework.context.NoSuchMessageException;
import org.springframework.context.support.ResourceBundleMessageSource;
/**
* @return Translated message
*/
public static String getMessageLocaleDefault(final String code, final Object... context) {
- return getMessage(Locale.getDefault(), code, context);
+ String res = "";
+ try {
+ res = getMessage(Locale.getDefault(), code, context);
+ } catch (NoSuchMessageException nsme) {
+ res = getMessage(new Locale(""), code, context);
+ }
+ return res;
}
public NotApplicableException (final String message) {
super(message);
}
+
+ /**
+ * @param messageKey
+ * @param context
+ */
+ public NotApplicableException(final String messageKey, final Object... context) {
+ super(messageKey, context);
+ }
}
\ No newline at end of file
*/
boolean checkout(Scenario aScenario, User user);
+ /**
+ * Mark the given scenario as checked out by the given user.
+ *
+ * @param scenarioId
+ * the scenario id
+ * @param username
+ * the username of the user performing the check out
+ * @throws InvalidPropertyException
+ * if the user or the scenario is not found in the database
+ * @throws NotApplicableException
+ * if the given user can not check out the scenario
+ */
+ public void checkout(final long scenarioId, final String username)
+ throws InvalidPropertyException, NotApplicableException;
+
/**
* Copy contents from other scenario up to its given step into the given scenario.
*
+ " is added to the scenario #" + aScenario.getIndex());
}
} catch (IOException error) {
- LOG.error("Unable to index the knowedge element '"
- + kelm.getIndex() + "', reason:", error);
+ LOG.error(
+ "Unable to index the knowedge element '" + kelm.getIndex()
+ + "', reason:", error);
kelm = null;
}
getScenarioDAO().update(aScenario); // Update of relational base
isOk = true;
} catch (Exception error) {
- LOG.error("Unable to re-index the knowledge element '"
- + aScenario.getIndex() + "', reason:", error);
+ LOG.error(
+ "Unable to re-index the knowledge element '"
+ + aScenario.getIndex() + "', reason:", error);
}
return isOk;
}
java.io.File upfile = new java.io.File(file.getPath());
String fileFormat = upfile.getName().substring(
upfile.getName().lastIndexOf('.') + 1);
- String docname = upfile.getName().substring(0,
- upfile.getName().lastIndexOf('.'));
// Create a new document or a new version of the document
dprop.setAuthor(aUser).setDate(aDate);
MessageKeyEnum.SCN_000002.toString(), doc.getId());
}
if (pub.value() == null) {
- throw new MismatchException(MessageKeyEnum.SCN_000002
- .toString(), doc.getId());
+ throw new MismatchException(
+ MessageKeyEnum.SCN_000002.toString(), doc.getId());
}
newPub = getStepService().versionDocument(step, pub, dprop);
// Remeber the link from the old document to the new document version
} else {
dprop.setType(resType);
}
- dprop.setDescription("Checked in").setName(docname).setFormat(
- fileFormat);
+ // New document title generation as <document type name>_N
+ String docname = dprop.getType().getName();
+ int i = 1;
+ for (Publication scenPub : step.getOwner().getDocums()) {
+ if (scenPub.value().getTitle().startsWith(docname)) {
+ i++;
+ }
+ }
+ docname += "_" + i; // The generated new document title
+
+ dprop.setDescription("Checked in").setName(docname)
+ .setFormat(fileFormat);
newPub = getStepService().createDocument(step, dprop);
// Remeber the new document
}
if (updir.exists()) {
if (updir.delete()) {
- LOG.info(MessageKeyEnum.SCN_000003.toString(), updir
- .getAbsoluteFile(), step.getOwner().getIndex());
+ LOG.info(MessageKeyEnum.SCN_000003.toString(),
+ updir.getAbsoluteFile(), step.getOwner().getIndex());
} else {
throw new IOException(
"Can't delete the existing destination file to move file from "
} while ((step == null) && (i < steps.length));
if (step == null) {
- throw new InvalidPropertyException(MessageKeyEnum.SCN_000001
- .toString(), stepDTO.getNumber());
+ throw new InvalidPropertyException(
+ MessageKeyEnum.SCN_000001.toString(), stepDTO.getNumber());
}
return step;
}
if (res) {
aScenario.setUser(user);
aScenario.setLastModificationDate(Calendar.getInstance().getTime());
- getScenarioDAO().update(aScenario);
+ // RKV: getScenarioDAO().update(aScenario);
}
return res;
}
+ /**
+ * Mark the given scenario as checked out by the given user.
+ *
+ * @param scenarioId
+ * the scenario id
+ * @param username
+ * the username of the user performing the check out
+ * @throws InvalidPropertyException
+ * if the user or the scenario is not found in the database
+ * @throws NotApplicableException
+ * if the given user can not check out the scenario
+ */
+ @Transactional
+ public void checkout(final long scenarioId, final String username)
+ throws InvalidPropertyException, NotApplicableException {
+ User aUser = getUserService().selectUser(username);
+ if (aUser == null) {
+ // User not found
+ throw new InvalidPropertyException(
+ MessageKeyEnum.USR_000001.toString(), username);
+ }
+ Scenario aScenario = getScenarioDAO().get(scenarioId);
+ if (aScenario == null) {
+ // Scenario not found
+ throw new InvalidPropertyException(
+ MessageKeyEnum.SCN_000006.toString(), scenarioId);
+ }
+ boolean res = getStudyService().isStaffedBy(aScenario.getOwnerStudy(),
+ aUser);
+ if (res) {
+ if (aScenario.isCheckedout()
+ && (!aScenario.getUser().getUsername().equals(username))) {
+ throw new NotApplicableException(
+ MessageKeyEnum.SCN_000008.toString(), scenarioId,
+ aScenario.getUser().getUsername());
+ }
+ aScenario.setUser(aUser);
+ aScenario.setLastModificationDate(Calendar.getInstance().getTime());
+ } else {
+ // User doesn't participate in the scenario
+ throw new NotApplicableException(
+ MessageKeyEnum.SCN_000007.toString(), username, scenarioId);
+ }
+ }
+
/**
* {@inheritDoc}
*
Restrictions.like("role", "%sysadmin%")).get(0);
User admin = getUserDAO().getFilteredList(
Restrictions.eq("role", adminRole), Order.asc("rid")).get(0); // First sysadmin in the database
-
- kprop.setType(ucase).setTitle(aStudy.getTitle()).setValue(
- scenario.getTitle()).setAuthor(admin); // Internal Knowledge Element required by the validation process of
+
+ kprop.setType(ucase).setTitle(aStudy.getTitle())
+ .setValue(scenario.getTitle()).setAuthor(admin); // Internal Knowledge Element required by the validation process of
// knowledges
addKnowledgeElement(scenario, kprop);
return scenario;
import org.splat.dal.bo.kernel.Relation;
import org.splat.dal.bo.kernel.User;
import org.splat.dal.bo.som.Document;
+import org.splat.dal.bo.som.Document.Properties;
import org.splat.dal.bo.som.DocumentType;
import org.splat.dal.bo.som.KnowledgeElementType;
import org.splat.dal.bo.som.Publication;
import org.splat.dal.bo.som.Study;
import org.splat.dal.bo.som.UsedByRelation;
import org.splat.dal.bo.som.UsesRelation;
-import org.splat.dal.bo.som.Document.Properties;
import org.splat.dal.dao.som.Database;
import org.splat.dal.dao.som.ScenarioDAO;
import org.splat.kernel.InvalidPropertyException;
import org.splat.service.dto.FileDTO;
import org.splat.service.dto.StepDTO;
import org.splat.service.technical.ProjectSettingsService;
-import org.splat.service.technical.RepositoryService;
import org.splat.service.technical.ProjectSettingsService.Step;
+import org.splat.service.technical.RepositoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.testng.Assert;
import org.testng.annotations.Test;
+import org.testng.reporters.Files;
import test.splat.common.BaseTest;
@Autowired
@Qualifier("simulationContextService")
private transient SimulationContextService _simulationContextService;
-
+
/**
* The ProjectSettingsService. Later injected by Spring.
*/
SQLException {
LOG.debug(">>>>> BEGIN testGetScenarioInfo()");
startNestedTransaction();
-
+
long scenarioId = createScenario();
// Call DAO's create method for a good transient knowledge element.
List<StepDTO> steps = _scenarioService.getScenarioInfo(scenarioId);
Assert.assertEquals(doc.getTitle(), docName);
Assert.assertNotNull(doc.getFiles(),
"Document files list must not be null.");
- Assert
- .assertTrue(doc.getFiles().size() > 1,
- "Document must have more then 1 attached file.");
+ Assert.assertTrue(doc.getFiles().size() > 1,
+ "Document must have more then 1 attached file.");
for (FileDTO file : doc.getFiles()) {
Assert.assertNotNull(file.getPath(),
} else { // Outdated
Assert.assertEquals(file.getState(), 'O',
"File state must be outdated ('O').");
- Assert
- .assertEquals(file.getProcessing(),
- "file-download",
- "Outdated document should not be imported but downloaded.");
+ Assert.assertEquals(file.getProcessing(),
+ "file-download",
+ "Outdated document should not be imported but downloaded.");
}
}
}
try {
steps = _scenarioService.getScenarioInfo(-1L);
// getHibernateTemplate().flush();
- Assert
- .fail("Getting an object with not existing id must be failed.");
+ Assert.fail("Getting an object with not existing id must be failed.");
} catch (Exception e) {
LOG.debug("Expected exception is thrown: "
+ e.getClass().getSimpleName() + ": " + e.getMessage());
* <li>uses relations are copied correctly</li>
* <li>files are moved correctly</li>
* <li>new documents are created for new data</li>
+ * <li>new documents have correctly generated names</li>
* <li>uses relations are created correctly</li>
* <li>files are moved correctly</li>
* </ul>
SQLException, MismatchException, NotApplicableException {
LOG.debug(">>>>> BEGIN testCheckin()");
startNestedTransaction();
-
+
_projectSettings.getAllSteps().clear(); // Clear config to be able to load it again
_projectSettings.configure(ClassLoader
.getSystemResource("test/som.xml").getPath());
}
}
}
- Assert.assertTrue(found,
+ Assert.assertTrue(
+ found,
"New version of the existing checked in document \""
+ docDTO.getTitle() + "\" (id="
+ docDTO.getId()
Publication newPub = null;
for (Publication pub : aScen.getDocums()) {
if (pub.value().getPreviousVersion() == null) {
- found = (docDTO.getTitle().equals(pub.value()
- .getTitle()));
+ found = (pub.value().getTitle().startsWith(pub
+ .value().getType().getName()));
if (found) { // Found next published version of the checked in document
- newPub = pub;
- break;
+ String fcontent = Files.readFile(pub
+ .getSourceFile().asFile());
+ found = fcontent.contains(docDTO.getTitle());
+ if (found) {
+ LOG.debug("Found new document with generated title: "
+ + pub.value().getTitle());
+ newPub = pub;
+ break;
+ }
}
}
}
"New document is not created for checked in document \""
+ docDTO.getTitle() + "\".");
// Check that uses relations are created correctly
+ Assert.assertTrue(
+ newPub.value()
+ .getTitle()
+ .startsWith(
+ newPub.value().getType().getName()
+ + "_"),
+ "Document title newPub.value().getTitle() must start with "
+ + newPub.value().getType().getName() + "_");
// 1. Find the document type used by this document type
Set<DocumentType> usedTypes = newPub.value().getType()
// Call checkin method for a not existing id.
try {
_scenarioService.checkin(-1, userId, stepsToCheckin);
- Assert
- .fail("Check in for scenario with not existing id must be failed.");
+ Assert.fail("Check in for scenario with not existing id must be failed.");
} catch (Exception e) {
LOG.debug("Expected exception is thrown: "
+ e.getClass().getSimpleName() + ": " + e.getMessage());
}
-
+
rollbackNestedTransaction();
LOG.debug(">>>>> END testCheckin()");
}
}
// Prepare new data
stepToCheckin.addDoc(0, "newdoc" + stepFrom.getNumber()).addFile(
- createDownloadedFile(userId, "newdoc"
- + stepFrom.getNumber(), "brep"));
+ createDownloadedFile(userId,
+ "newdoc" + stepFrom.getNumber(), "brep"));
}
return stepToCheckin;
}
// Prepare download directory
File tmpDir = _repositoryService.getDownloadDirectory(userId);
if (!tmpDir.exists()) {
- Assert.assertTrue(tmpDir.mkdir(),
+ Assert.assertTrue(
+ tmpDir.mkdir(),
"Can't create temporary directory: "
+ tmpDir.getAbsolutePath());
}
User.Properties uprop = new User.Properties();
uprop.setUsername("TST_Username").setName("TST_SimanUnitTestsUser")
.setFirstName("TST_FirstName").setDisplayName("TST_test.user")
- .addRole("TST_user").setMailAddress(
- "noreply@salome-platform.org");
+ .addRole("TST_user")
+ .setMailAddress("noreply@salome-platform.org");
uprop.disableCheck();
User anAuthor = new User(uprop);
ht.saveOrUpdate(anAuthor);
// Create a test study
- Study.Properties stprops = new Study.Properties().setReference(
- "TST_SID_01").setTitle("TST_Study").setManager(anAuthor);
+ Study.Properties stprops = new Study.Properties()
+ .setReference("TST_SID_01").setTitle("TST_Study")
+ .setManager(anAuthor);
Study aStudy = new Study(stprops);
ht.saveOrUpdate(aStudy);
// Create a test scenario
- Scenario.Properties sprops = new Scenario.Properties().setTitle(
- "TST_Scenario").setManager(anAuthor).setOwnerStudy(aStudy);
+ Scenario.Properties sprops = new Scenario.Properties()
+ .setTitle("TST_Scenario").setManager(anAuthor)
+ .setOwnerStudy(aStudy);
Scenario aScenario = new Scenario(sprops);
aStudy.getScenariiList().add(aScenario);
ht.saveOrUpdate(anAuthor);
Assert.assertTrue(ht.find("from Document").size() > 0,
"No documents in the database.");
- Assert.assertNotNull(ht.find("from Publication where owner="
- + aScenario.getIndex()), "No publications in the database.");
+ Assert.assertNotNull(
+ ht.find("from Publication where owner=" + aScenario.getIndex()),
+ "No publications in the database.");
Assert.assertTrue(
ht.find("from Publication where owner=" + aScenario.getIndex())
.size() > 0, "No publications in the database.");
"More then one document must be in the database");
// Check created uses relations
- Assert
- .assertTrue(usedMap.size() > 0,
- "Uses relations must be created.");
+ Assert.assertTrue(usedMap.size() > 0, "Uses relations must be created.");
boolean foundAny = false;
for (Long usingId : usedMap.keySet()) {
for (Publication pub : aScen.getDocums()) {
return pub;
}
-
/**
* Test check-in scenario operation to be performed after SALOME session.<BR>
* <B>Description :</B> <BR>
SQLException, MismatchException, NotApplicableException {
LOG.debug(">>>>> BEGIN testCreateStudy()");
startNestedTransaction();
-
+
Database.getInstance().reset();
_projectSettings.getAllSteps().clear(); // Clear config to be able to load it again
_projectSettings.configure(ClassLoader
.getSystemResource("test/som.xml").getPath());
-
+
// Create a test user
User.Properties uprop = new User.Properties();
uprop.setUsername("TST_Username").setName("TST_SimanUnitTestsUser")
.setFirstName("TST_FirstName").setDisplayName("TST_test.user")
- .addRole("TST_user").setMailAddress(
- "noreply@salome-platform.org");
+ .addRole("TST_user")
+ .setMailAddress("noreply@salome-platform.org");
uprop.disableCheck();
User anAuthor = new User(uprop);
-
+
getHibernateTemplate().saveOrUpdate(anAuthor);
- KnowledgeElementType ucase = _knowledgeElementTypeService.selectType("usecase");
- Assert.assertNotNull(ucase, "Knowledge type 'usecase' must be created in the database.");
- SimulationContextType prodtype = _simulationContextService.selectType("product");
- Assert.assertNotNull(prodtype, "Simulation context type 'product' must be created in the database.");
-
+ KnowledgeElementType ucase = _knowledgeElementTypeService
+ .selectType("usecase");
+ Assert.assertNotNull(ucase,
+ "Knowledge type 'usecase' must be created in the database.");
+ SimulationContextType prodtype = _simulationContextService
+ .selectType("product");
+ Assert.assertNotNull(prodtype,
+ "Simulation context type 'product' must be created in the database.");
+
// Create admin
uprop.clear();
uprop.setUsername("TST_Admin").setName("TST_SimanUnitTestsAdmin")
- .setFirstName("TST_AdminFirstName").setDisplayName("TST_test.admin")
- .addRole("TST_user,sysadmin").setMailAddress(
- "noreply@salome-platform.org");
+ .setFirstName("TST_AdminFirstName")
+ .setDisplayName("TST_test.admin").addRole("TST_user,sysadmin")
+ .setMailAddress("noreply@salome-platform.org");
uprop.disableCheck();
-
+
getHibernateTemplate().saveOrUpdate(new User(uprop));
getHibernateTemplate().flush();
-
+
Study.Properties sprop = new Study.Properties();
sprop.setTitle("Test study creation").setManager(anAuthor);
Scenario.Properties oprop = new Scenario.Properties();
SimulationContext.Properties cprop = new SimulationContext.Properties();
// Input of new project context
cprop.setType(_simulationContextService.selectType("product"))
- .setValue("Test Simulation Context: Product");
+ .setValue("Test Simulation Context: Product");
Study study = _scenarioService.createStudy(sprop, oprop, cprop);
-
+
rollbackNestedTransaction();
LOG.debug(">>>>> END testCreateStudy()");
}
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
- <value>application</value>
- <value>log-messages</value>
+ <value>som</value>
+ <value>conf/log-messages</value>
</list>
</property>
</bean>
--- /dev/null
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
+<%@ page import="org.splat.launcher.ToolbarApplet"%>
+{<%=ToolbarApplet.CHECKOUT_RES%> "<s:property value="result"/>"}
\ No newline at end of file
--- /dev/null
+/*****************************************************************************
+ * Company OPEN CASCADE
+ * Application SIMAN
+ * File $Id$
+ * Creation date 02.12.2012
+ * @author $Author$
+ * @version $Revision$
+ * @copyright OPEN CASCADE 2012
+ *****************************************************************************/
+
+package org.splat.launcher;
+
+/**
+ * Exception thrown when configuration problem appears during an executable module launching.
+ *
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
+ */
+public class ConfigurationException extends Exception {
+
+ /**
+ * Constructs a configuration exception with its reason description.
+ *
+ * @param message
+ * error message
+ */
+ public ConfigurationException(final String message) {
+ super(message);
+ }
+
+ /**
+ * Serialization version id.
+ */
+ private static final long serialVersionUID = -8886811002435115163L;
+
+}
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.io.BufferedReader;
import java.io.File;
-import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
import java.io.ObjectInputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
+import java.net.URLEncoder;
/**
* Applet providing a set of buttons. Each button is defined by three parameters:<BR>
*/
private static final long serialVersionUID = 3243053622061086715L;
+ /**
+ * The response key string: '<i>"canCheckout"</i> :'.
+ */
+ public static final String CHECKOUT_RES = "\"canCheckout\" :";
+
// ==============================================================================================================================
// Overridden functions
// ==============================================================================================================================
// Opening an application on the local machine
- if (module.equals("runSalome")) {
- // Run SALOME
- // To get the SALOME_HOME environment variable
- String SALOME_HOME = System.getenv("SALOME_ROOT_DIR");
- // If SALOME_ROOT_DIR does not exist the SALOME_HOME equals to null.
- if (SALOME_HOME == null) {
- // TODO: Use logger to be more user friendly
- getAppletContext()
- .showDocument(
- new URL(
- getCodeBase().toString()
- + "error.jsp?message=launch&value="
- + "SALOME_ROOT_DIR environment variable is not defined."),
- "_blank");
- throw new Exception(
- "SALOME_ROOT_DIR nevironment variable is not defined.");
- } else if (!SALOME_HOME.endsWith(File.separator)) {
- SALOME_HOME += File.separator;
- }
- String pathToScript = SALOME_HOME + "runSalome";
-
- File script = new File(pathToScript);
- if (!script.exists()) {
- script = new File(pathToScript + ".bat");
- if (!script.exists()) {
- script = new File(pathToScript + ".cmd");
- }
- }
-
- if (script.exists()) {
- // Execute the runSalome script.
- // filename here indeed a string containing parameters for runSalome.
- Runtime.getRuntime().exec(
- new String[] { script.getAbsolutePath(), filename });
- } else {
- // TODO: Use logger to be more user friendly
- getAppletContext().showDocument(
- new URL(getCodeBase().toString()
- + "error.jsp?message=launch&value="
- + "SALOME module is not found: "
- + script.getAbsolutePath()), "_blank");
- throw new FileNotFoundException(
- "SALOME module is not found: " + script.getAbsolutePath());
- }
+ if ("runSalome".equals(module)) {
+ salomeCheckout(filename);
} else
if (module.endsWith(".exe") || module.endsWith(".EXE")) {
error.printStackTrace(); // RKV: NOPMD: TODO: try to use logger
}
}
+
+ /**
+ * Checkout a scenario and start Salome with it.
+ *
+ * @param params
+ * Salome parameters
+ * @throws IOException
+ * if URL connection opening/reading is failed
+ * @throws ConfigurationException
+ * if SALOME_ROOT_DIR environment variable is not defined or Salome launcher script is not found
+ */
+ private void salomeCheckout(final String params)
+ throws ConfigurationException, IOException {
+ // Run SALOME
+ // To get the SALOME_HOME environment variable
+ String SALOME_HOME = System.getenv("SALOME_ROOT_DIR");
+ // If SALOME_ROOT_DIR does not exist the SALOME_HOME equals to null.
+ if (SALOME_HOME == null) {
+ // TODO: Use logger to be more user friendly
+ showError("SALOME_ROOT_DIR environment variable is not defined.");
+ throw new ConfigurationException(
+ "SALOME_ROOT_DIR nevironment variable is not defined.");
+ } else if (!SALOME_HOME.endsWith(File.separator)) {
+ SALOME_HOME += File.separator;
+ }
+ String pathToScript = SALOME_HOME + "runSalome";
+
+ File script = new File(pathToScript);
+ if (!script.exists()) {
+ script = new File(pathToScript + ".bat");
+ if (!script.exists()) {
+ script = new File(pathToScript + ".cmd");
+ }
+ }
+
+ if (script.exists()) {
+
+ // Checkout the scenario
+ URL checkoutUrl = new URL(getCodeBase().toString()
+ + "checkout.action?"
+ + params.replaceAll("siman-", "").replaceAll("--", "-")
+ .replaceAll("-", "&").replaceAll("\\s", ""));
+
+ BufferedReader buffer = new BufferedReader(new InputStreamReader(
+ checkoutUrl.openStream()));
+ boolean isOk = false;
+ String response = buffer.readLine();
+ while ((response != null)) {
+ if (response.contains(CHECKOUT_RES)) {
+ isOk = response.contains(CHECKOUT_RES + " \"true\"");
+ break;
+ }
+ response = buffer.readLine();
+ }
+ buffer.close();
+
+ if (isOk) {
+ // Execute the runSalome script.
+ // filename here indeed a string containing parameters for runSalome.
+ Runtime.getRuntime().exec(
+ new String[] { script.getAbsolutePath(), params });
+ } else {
+ // Checkout of the scenario is failed at the beginning.
+ if (response != null) {
+ response = response
+ .substring(
+ response.indexOf(CHECKOUT_RES)
+ + CHECKOUT_RES.length())
+ .replace('}', ' ').replace('"', ' ');
+ }
+ showError(response);
+ }
+ } else {
+ // TODO: Use logger to be more user friendly
+ showError("SALOME module is not found: " + script.getAbsolutePath());
+ throw new ConfigurationException("SALOME module is not found: "
+ + script.getAbsolutePath());
+ }
+ }
+
+ /**
+ * Show error message in the new window.
+ *
+ * @param message
+ * the error message
+ * @throws MalformedURLException
+ * if built URL is incorrect
+ * @throws UnsupportedEncodingException
+ * if UTF-8 encoding is not supported
+ */
+ private void showError(final String message) throws MalformedURLException,
+ UnsupportedEncodingException {
+ getAppletContext().showDocument(
+ new URL(getCodeBase().toString() + "../error.jsp?error="
+ + URLEncoder.encode(message, "UTF-8")), "_blank");
+ }
}
\ No newline at end of file
--- /dev/null
+/*****************************************************************************
+ * Company OPEN CASCADE
+ * Application SIMAN
+ * File $Id$
+ * Creation date 02.12.2012
+ * @author $Author$
+ * @version $Revision$
+ * @copyright OPEN CASCADE 2012
+ *****************************************************************************/
+
+package org.splat.simer;
+
+import org.splat.exception.BusinessException;
+import org.splat.log.AppLogger;
+import org.splat.service.ScenarioService;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * Action to checkout a scenario.
+ *
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
+ */
+public class CheckoutAction extends ActionSupport {
+
+ /**
+ * Serialization version id.
+ */
+ private static final long serialVersionUID = 6140789360802711199L;
+
+ /**
+ * Action logger.
+ */
+ protected static final AppLogger LOG = AppLogger
+ .getLogger(CheckoutAction.class);
+
+ /**
+ * Result message. If the scenario is successfully checked out then result is "true", otherwise it contains the error message.
+ */
+ private String _result;
+ /**
+ * Scenario id action parameter. Defines the scenario to check out.
+ */
+ private long _scenario;
+ /**
+ * User login name action parameter. Defines the user who performs check out.
+ */
+ private String _user;
+ /**
+ * Injected scenario service.
+ */
+ private ScenarioService _scenarioService;
+
+ /**
+ * Mark the currently selected scenario as checked out. If the scenario is successfully checked out then result is "true", otherwise it
+ * contains the error message.
+ *
+ * @return SUCCESS
+ */
+ public String doCheckout() {
+ try {
+ getScenarioService().checkout(getScenario(), getUser());
+ setResult("true");
+ } catch (BusinessException e) {
+ setResult(e.getMessage());
+ }
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Can checkout scenario #" + getScenario()
+ + " by the user " + getUser() + ": " + getResult());
+ }
+ return SUCCESS;
+ }
+
+ /**
+ * Get the scenarioService.
+ *
+ * @return the scenarioService
+ */
+ public ScenarioService getScenarioService() {
+ return _scenarioService;
+ }
+
+ /**
+ * Set the scenarioService.
+ *
+ * @param scenarioService
+ * the scenarioService to set
+ */
+ public void setScenarioService(final ScenarioService scenarioService) {
+ _scenarioService = scenarioService;
+ }
+
+ /**
+ * Result message. If the scenario is successfully checked out then result is "true", otherwise it contains the error message.
+ *
+ * @return the result
+ */
+ public String getResult() {
+ return _result;
+ }
+
+ /**
+ * Set the result.
+ *
+ * @param result
+ * the result to set
+ */
+ public void setResult(final String result) {
+ _result = result;
+ }
+
+ /**
+ * Get the scenario.
+ *
+ * @return the scenario
+ */
+ public long getScenario() {
+ return _scenario;
+ }
+
+ /**
+ * Set the scenario.
+ *
+ * @param scenario
+ * the scenario to set
+ */
+ public void setScenario(final long scenario) {
+ _scenario = scenario;
+ }
+
+ /**
+ * Get the user.
+ *
+ * @return the user
+ */
+ public String getUser() {
+ return _user;
+ }
+
+ /**
+ * Set the user.
+ *
+ * @param user
+ * the user to set
+ */
+ public void setUser(final String user) {
+ _user = user;
+ }
+}
public OpenStudy open(final User user, final Study study) {
ResourceBundle custom = ResourceBundle.getBundle("som",
getApplicationSettings().getCurrentLocale());
- SimpleDateFormat datstring = new SimpleDateFormat(custom
- .getString("date.format"));
+ SimpleDateFormat datstring = new SimpleDateFormat(
+ custom.getString("date.format"));
Revision.Format verstring = new Revision.Format(getProjectSettings()
.getRevisionPattern());
}
public String getType() {
- return ResourceBundle.getBundle("labels",
- getApplicationSettings().getCurrentLocale()).getString(
- "label.study");
+ /*
+ * RKV: return ResourceBundle.getBundle("labels", getApplicationSettings().getCurrentLocale()).getString( "label.study");
+ */
+ return "study";
}
public String getVersion() {
// Transfer to the document of all known properties
ResourceBundle locale = ResourceBundle.getBundle("som",
getApplicationSettings().getCurrentLocale());
- SimpleDateFormat get = new SimpleDateFormat(locale
- .getString("date.format"));
+ SimpleDateFormat get = new SimpleDateFormat(
+ locale.getString("date.format"));
Writer tool = Toolbox.getWriter(credoc);
List<Step> slist = getInvolvedSteps();
for (Iterator<Step> i = slist.iterator(); i.hasNext();) {
for (Iterator<SimulationContext> j = clist.iterator(); j
.hasNext();) {
SimulationContext context = j.next();
- tool.updateProperty(context.getType().getName(), context
- .getValue());
+ tool.updateProperty(context.getType().getName(),
+ context.getValue());
}
}
tool.updateProperty("reference", medoc.getReference());
tool.updateProperty("study", _mystudy.getTitle());
- tool.updateProperty("step", locale.getString(
- "folder.step." + step.getNumber()).replaceAll("''", "'"));
+ tool.updateProperty("step",
+ locale.getString("folder.step." + step.getNumber())
+ .replaceAll("''", "'"));
tool.updateProperty("author", author.getUsername().toUpperCase());
tool.updateProperty("date", get.format(medoc.getCreationDate()));
tool.updateProperty("history", locale.getString("label.creation")
}
protected void add(final KnowledgeElement kelm) {
- KnowledgeElementFacade facade = new KnowledgeElementFacade(BeanHelper
- .copyBean(kelm, KnowledgeElementDTO.class),
+ KnowledgeElementFacade facade = new KnowledgeElementFacade(
+ BeanHelper.copyBean(kelm, KnowledgeElementDTO.class),
getApplicationSettings());
// RKV KnowledgeIterator known = knowledge.get(kelm.getType().getIndex() - 2);
// Knowledges are ordered by type index, from 0 to n-1, the first one being reserved (reason for -2)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
<!-- configuration i18n -->
<bean id="i18nUtils" class="org.splat.i18n.I18nUtils">
- <property name="resourceBundleMessageSource"
- ref="messageSource" />
+ <property name="resourceBundleMessageSource" ref="messageSource" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
- <value>application</value>
- <value>log-messages</value>
+ <value>conf/log-messages</value>
</list>
</property>
</bean>
<!-- ref 'baseMessageSource' into Siman-common\src\spring\globalContext.xml -->
<!-- property name="parentMessageSource" ref="baseMessageSource"/ -->
- <bean id="applicationSettings"
- class="org.splat.simer.ApplicationSettings" scope="session">
+ <bean id="applicationSettings" class="org.splat.simer.ApplicationSettings"
+ scope="session">
<property name="projectSettings" ref="projectSettings" />
<property name="documentTypeService" ref="documentTypeService" />
</bean>
</bean>
<bean id="slidMenu" scope="session" abstract="true">
- <property name="projectElementService"
- ref="projectElementService" />
+ <property name="projectElementService" ref="projectElementService" />
<property name="scenarioService" ref="scenarioService" />
</bean>
- <bean id="studyMenu" class="org.splat.simer.StudyMenu"
- scope="session" parent="slidMenu" />
+ <bean id="studyMenu" class="org.splat.simer.StudyMenu" scope="session"
+ parent="slidMenu" />
<bean id="newScenarioMenu" class="org.splat.simer.NewScenarioMenu"
scope="session" parent="slidMenu" />
<bean id="openObject" abstract="true"
class="org.splat.simer.AbstractOpenObject" scope="session">
<property name="applicationSettings" ref="applicationSettings" />
- <property name="projectElementService"
- ref="projectElementService" />
+ <property name="projectElementService" ref="projectElementService" />
<property name="projectSettings" ref="projectSettings" />
- <property name="knowledgeElementTypeService"
- ref="knowledgeElementTypeService" />
+ <property name="knowledgeElementTypeService" ref="knowledgeElementTypeService" />
</bean>
- <bean id="openStudy" class="org.splat.simer.OpenStudy"
- parent="openObject" scope="session">
- <property name="projectElementService"
- ref="projectElementService" />
+ <bean id="openStudy" class="org.splat.simer.OpenStudy" parent="openObject"
+ scope="session">
+ <property name="projectElementService" ref="projectElementService" />
<property name="publicationService" ref="publicationService" />
<property name="studyService" ref="studyService" />
<property name="stepService" ref="stepService" />
parent="openObject" scope="session">
</bean>
- <bean id="baseAction" class="org.splat.simer.Action"
- scope="prototype" abstract="true">
+ <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" />
<bean id="newStudyAction" class="org.splat.simer.NewStudyAction"
parent="baseAction" scope="prototype">
- <property name="simulationContextService"
- ref="simulationContextService" />
+ <property name="simulationContextService" ref="simulationContextService" />
<property name="scenarioService" ref="scenarioService" />
</bean>
- <bean id="newScenarioAction"
- class="org.splat.simer.NewScenarioAction" parent="baseAction"
- scope="prototype">
- <property name="projectElementService"
- ref="projectElementService" />
+ <bean id="newScenarioAction" class="org.splat.simer.NewScenarioAction"
+ parent="baseAction" scope="prototype">
+ <property name="projectElementService" ref="projectElementService" />
<property name="scenarioService" ref="scenarioService" />
<property name="menu" ref="newScenarioMenu" />
</bean>
- <bean id="importDocumentAction"
- class="org.splat.simer.ImportDocumentAction" scope="prototype"
- parent="baseAction">
+ <bean id="checkoutAction" class="org.splat.simer.CheckoutAction"
+ scope="prototype">
+ <property name="scenarioService" ref="scenarioService" />
+ </bean>
+
+ <bean id="importDocumentAction" class="org.splat.simer.ImportDocumentAction"
+ scope="prototype" parent="baseAction">
<property name="stepService" ref="stepService" />
<property name="projectSettings" ref="projectSettings" />
<property name="publicationService" ref="publicationService" />
<property name="documentTypeService" ref="documentTypeService" />
</bean>
- <bean id="displayStudyStepAction"
- class="org.splat.simer.DisplayStudyStepAction" parent="baseAction"
- scope="prototype">
+ <bean id="displayStudyStepAction" class="org.splat.simer.DisplayStudyStepAction"
+ parent="baseAction" scope="prototype">
<property name="studyService" ref="studyService" />
</bean>
<!--========= Inherited from displayStudyStepAction ========= -->
- <bean id="studyPropertiesAction"
- class="org.splat.simer.StudyPropertiesAction" scope="prototype"
- parent="displayStudyStepAction">
+ <bean id="studyPropertiesAction" class="org.splat.simer.StudyPropertiesAction"
+ scope="prototype" parent="displayStudyStepAction">
<property name="documentTypeService" ref="documentTypeService" />
<property name="userService" ref="userService" />
</bean>
scope="prototype" parent="displayStudyStepAction">
</bean>
- <bean id="editScenarioPropertiesAction"
- class="org.splat.simer.EditScenarioPropertiesAction" scope="prototype"
- parent="displayStudyStepAction">
- <property name="projectElementService"
- ref="projectElementService" />
+ <bean id="editScenarioPropertiesAction" class="org.splat.simer.EditScenarioPropertiesAction"
+ scope="prototype" parent="displayStudyStepAction">
+ <property name="projectElementService" ref="projectElementService" />
<property name="scenarioService" ref="scenarioService" />
</bean>
- <bean id="editSimulationContextAction"
- class="org.splat.simer.EditSimulationContextAction" scope="prototype"
- parent="displayStudyStepAction">
+ <bean id="editSimulationContextAction" 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"
- class="org.splat.simer.EditDocumentAction" scope="prototype"
- parent="displayStudyStepAction">
+ <bean id="editDocumentAction" class="org.splat.simer.EditDocumentAction"
+ scope="prototype" parent="displayStudyStepAction">
<property name="stepService" ref="stepService" />
<property name="publicationService" ref="publicationService" />
<property name="repositoryService" ref="repositoryService" />
</bean>
- <bean id="editKnowledgeElementAction"
- class="org.splat.simer.EditKnowledgeElementAction" scope="prototype"
- parent="displayStudyStepAction">
- <property name="knowledgeElementService"
- ref="knowledgeElementService" />
- <property name="knowledgeElementTypeService"
- ref="knowledgeElementTypeService" />
+ <bean id="editKnowledgeElementAction" class="org.splat.simer.EditKnowledgeElementAction"
+ scope="prototype" parent="displayStudyStepAction">
+ <property name="knowledgeElementService" ref="knowledgeElementService" />
+ <property name="knowledgeElementTypeService" ref="knowledgeElementTypeService" />
<property name="scenarioService" ref="scenarioService" />
</bean>
<!-- End of Inherited from displayStudyStepAction -->
- <bean id="startAction" class="org.splat.simer.StartAction"
- scope="prototype" parent="baseAction">
+ <bean id="startAction" class="org.splat.simer.StartAction" scope="prototype"
+ parent="baseAction">
<property name="applicationSettings" ref="applicationSettings" />
<property name="projectSettings" ref="projectSettings" />
</bean>
scope="prototype" parent="baseAction">
</bean>
- <bean id="menuAction" class="org.splat.simer.MenuAction"
- scope="prototype" parent="baseAction">
+ <bean id="menuAction" class="org.splat.simer.MenuAction" scope="prototype"
+ parent="baseAction">
</bean>
- <bean id="notYetImplementedAction"
- class="org.splat.simer.NotYetImplementedAction" scope="prototype"
- parent="baseAction">
+ <bean id="notYetImplementedAction" class="org.splat.simer.NotYetImplementedAction"
+ scope="prototype" parent="baseAction">
</bean>
- <bean id="searchStudyAction"
- class="org.splat.simer.SearchStudyAction" scope="prototype"
- parent="baseAction">
+ <bean id="searchStudyAction" class="org.splat.simer.SearchStudyAction"
+ scope="prototype" parent="baseAction">
<property name="projectSettings" ref="projectSettings" />
<property name="searchService" ref="searchService" />
- <property name="simulationContextService"
- ref="simulationContextService" />
+ <property name="simulationContextService" ref="simulationContextService" />
<property name="userService" ref="userService" />
</bean>
- <bean id="searchKnowledgeAction"
- class="org.splat.simer.SearchKnowledgeAction" scope="prototype"
- parent="baseAction">
+ <bean id="searchKnowledgeAction" class="org.splat.simer.SearchKnowledgeAction"
+ scope="prototype" parent="baseAction">
<property name="searchService" ref="searchService" />
- <property name="simulationContextService"
- ref="simulationContextService" />
- <property name="knowledgeElementTypeService"
- ref="knowledgeElementTypeService" />
+ <property name="simulationContextService" ref="simulationContextService" />
+ <property name="knowledgeElementTypeService" ref="knowledgeElementTypeService" />
<property name="userService" ref="userService" />
</bean>
- <bean id="searchDocumentAction"
- class="org.splat.simer.SearchDocumentAction" scope="prototype">
+ <bean id="searchDocumentAction" class="org.splat.simer.SearchDocumentAction"
+ scope="prototype">
</bean>
- <bean id="displayKnowledgeAction"
- class="org.splat.simer.DisplayKnowledgeAction" scope="prototype"
- parent="baseAction">
- <property name="knowledgeElementService"
- ref="knowledgeElementService" />
+ <bean id="displayKnowledgeAction" class="org.splat.simer.DisplayKnowledgeAction"
+ scope="prototype" parent="baseAction">
+ <property name="knowledgeElementService" ref="knowledgeElementService" />
</bean>
<bean id="uploadAction" class="org.splat.simer.UploadAction"
<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">
+ <bean id="versionDocumentAction" class="org.splat.simer.VersionDocumentAction"
+ scope="prototype" parent="baseAction">
<property name="projectSettings" ref="projectSettings" />
<property name="publicationService" ref="publicationService" />
<property name="stepService" ref="stepService" />
<property name="repositoryService" ref="repositoryService" />
</bean>
- <bean id="databaseIndexingAction"
- class="org.splat.simer.admin.DatabaseIndexingAction" scope="prototype"
- parent="baseAction">
+ <bean id="databaseIndexingAction" 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">
+ <bean id="importUserAction" class="org.splat.simer.admin.ImportUserAction"
+ scope="prototype" parent="baseAction">
<property name="repositoryService" ref="repositoryService" />
<property name="userService" ref="userService" />
</bean>
- <bean id="simulationContextAction"
- class="org.splat.simer.admin.SimulationContextAction"
+ <bean id="simulationContextAction" class="org.splat.simer.admin.SimulationContextAction"
scope="prototype" parent="baseAction">
- <property name="knowledgeElementService"
- ref="knowledgeElementService" />
+ <property name="knowledgeElementService" ref="knowledgeElementService" />
<property name="searchService" ref="searchService" />
<property name="projectSettings" ref="projectSettings" />
- <property name="simulationContextService"
- ref="simulationContextService" />
+ <property name="simulationContextService" ref="simulationContextService" />
</bean>
- <bean id="knowledgeElementAction"
- class="org.splat.simer.admin.KnowledgeElementAction"
+ <bean id="knowledgeElementAction" class="org.splat.simer.admin.KnowledgeElementAction"
scope="prototype">
</bean>
- <bean id="saveDocumentAction"
- class="org.splat.module.SaveDocumentAction" scope="prototype">
+ <bean id="saveDocumentAction" class="org.splat.module.SaveDocumentAction"
+ scope="prototype">
<property name="documentTypeService" ref="documentTypeService" />
<property name="publicationService" ref="publicationService" />
<property name="repositoryService" ref="repositoryService" />
<property name="scenarioService" ref="scenarioService" />
<property name="stepService" ref="stepService" />
- <property name="simulationContextService"
- ref="simulationContextService" />
+ <property name="simulationContextService" ref="simulationContextService" />
</bean>
</beans>
<result name="success" type="tiles">page.error.study</result>
</action>
+ <action name="checkout" class="checkoutAction" method="checkout">
+ <result name="success">/study/jsonCheckoutRes.jsp</result>
+ </action>
+
<!-- Creation of a study
-->
<action name="new-empty" class="newStudyAction" method="initialize">