Salome HOME
NewStudyAction is improved. Specific business method for creation of a new study...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / StudyServiceImpl.java
index aaf0249d217d2fd9c4cc5251aefa7c0cbdbe137d..e6a6191795712f00867441fbc76271c83a69764e 100644 (file)
@@ -176,6 +176,7 @@ public class StudyServiceImpl implements StudyService {
         * 
         * @see org.splat.service.StudyService#addProjectContext(org.splat.dal.bo.som.Study, org.splat.dal.bo.som.SimulationContext.Properties)
         */
+       @Transactional
        public SimulationContext addProjectContext(Study aStudy,
                        SimulationContext.Properties cprop) throws MissedPropertyException,
                        InvalidPropertyException, MultiplyDefinedException {
@@ -190,6 +191,7 @@ public class StudyServiceImpl implements StudyService {
         * 
         * @see org.splat.service.StudyService#addProjectContext(org.splat.dal.bo.som.Study, org.splat.dal.bo.som.SimulationContext)
         */
+       @Transactional
        public SimulationContext addProjectContext(Study aStudy,
                        SimulationContext context) {
                SimulationContext added = getStepService().addSimulationContext(
@@ -445,9 +447,8 @@ public class StudyServiceImpl implements StudyService {
                        setShortCuts(aStudy); // RKV: initialize transient actors set
                        getIndex().update(aStudy); // Update of Lucene index
                        isOk = true;
-               } catch (Exception error) {
-                       logger.error("Unable to re-index the study '" + aStudy.getIndex()
-                                       + "', reason:", error);
+               } catch (Exception e) {
+                       logger.error("STD-000001", e, aStudy.getIndex(), e.getMessage());
                }
                return isOk;
        }
@@ -517,8 +518,8 @@ public class StudyServiceImpl implements StudyService {
                                                if (i == format.length)
                                                        break;
                                        }
-                                       DecimalFormat tostring = new DecimalFormat(
-                                                       pattern.substring(n, i));
+                                       DecimalFormat tostring = new DecimalFormat(pattern
+                                                       .substring(n, i));
                                        String number = tostring.format(next);
                                        for (int j = 0; j < number.length(); j++) {
                                                ref[count] = number.charAt(j);
@@ -649,15 +650,13 @@ public class StudyServiceImpl implements StudyService {
                                        if (actype[i] == Actor.manager) {
                                                actor = from.getAuthor();
                                        } else if (actype[i] == Actor.Nx1) {
-                                               List<User> manager = getUserService()
-                                                               .selectUsersWhere(uprop
-                                                                               .setOrganizationName("Nx1"));
+                                               List<User> manager = getUserService().selectUsersWhere(
+                                                               uprop.setOrganizationName("Nx1"));
                                                if (manager.size() == 1)
                                                        actor = manager.get(0);
                                        } else if (actype[i] == Actor.Nx2) {
-                                               List<User> manager = getUserService()
-                                                               .selectUsersWhere(uprop
-                                                                               .setOrganizationName("Nx2"));
+                                               List<User> manager = getUserService().selectUsersWhere(
+                                                               uprop.setOrganizationName("Nx2"));
                                                if (manager.size() == 1)
                                                        actor = manager.get(0);
                                        } else { /* Actor.customer */
@@ -1111,6 +1110,7 @@ public class StudyServiceImpl implements StudyService {
 
        /**
         * Get the userService.
+        * 
         * @return the userService
         */
        public UserService getUserService() {
@@ -1119,7 +1119,9 @@ public class StudyServiceImpl implements StudyService {
 
        /**
         * Set the userService.
-        * @param userService the userService to set
+        * 
+        * @param userService
+        *            the userService to set
         */
        public void setUserService(UserService userService) {
                _userService = userService;