* @param userId the user ID
**/
String checkIn(final String fileURL, final Long scenarioId, final Long userId);
+
+ /**
+ * Create new study from python - client.
+ * @param studyName new study name
+ * @param productName product name
+ * @param userName creator(user) name
+ * @param description the study description
+ * @return string contains information about new study Id
+ */
+ String createNewStudy(final String userName, final String studyName, final String productName, final String description);
+
+ /**
+ * Assign the new simulation context to the existing study.
+ * @param studyId - the target study id.
+ * @param contextName - new context name.
+ * @return success or not.
+ */
+ String assignSimulationContext(final Long studyId, final String contextName);
}
return "ERROR";
}
}
+
+ //================ Python client methods.
+
+ /**
+ *
+ * {@inheritDoc}
+ * @see org.splat.ws_server.service.salome.SimanSalomeService#createNewStudy(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
+ */
+ public String createNewStudy(final String userName, final String studyName, final String productName, final String description) {
+ long resultId = 0;
+
+ if ("".equals(userName)) {
+ return "Please enter the not empty user name.";
+ }
+ if ("".equals(studyName)) {
+ return "Please enter the not empty study name.";
+ }
+ if ("".equals(productName)) {
+ return "Please enter the not empty product name.";
+ }
+ if ("".equals(description)) {
+ return "Please enter the not empty description.";
+ }
+
+ try {
+ resultId = _scenarioService.createStudy(userName, studyName, productName, description);
+ } catch (InvalidPropertyException e) {
+ return e.getMessage();
+ } catch (MissedPropertyException e) {
+ return e.getMessage();
+ } catch (MultiplyDefinedException e) {
+ return e.getMessage();
+ }
+ return "New study is successfully created with id = " + String.valueOf(resultId);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ * @see org.splat.ws_server.service.salome.SimanSalomeService#assignSimulationContext(java.lang.Long, java.lang.String)
+ */
+ public String assignSimulationContext(final Long studyId, final String contextName) {
+
+ return "result";
+ }
/**
* Get the scenarioService.
* @return the scenarioService