]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java
Salome HOME
Modifications done to respect PMD rules. Versioning a document is fixed. Validation...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / DocumentServiceImpl.java
index 5c87bae00b947266f80bae6f720ed88e8dc6ad24..4391e4e05d0aec6de63fa020be328e96fc62d8f2 100644 (file)
@@ -38,6 +38,7 @@ import org.splat.dal.dao.som.StudyDAO;
 import org.splat.kernel.InvalidPropertyException;
 import org.splat.kernel.MissedPropertyException;
 import org.splat.kernel.NotApplicableException;
+import org.splat.log.AppLogger;
 import org.splat.manox.Reader;
 import org.splat.manox.Toolbox;
 import org.splat.service.technical.ProjectSettingsService;
@@ -54,6 +55,12 @@ import org.springframework.transaction.annotation.Transactional;
  */
 public class DocumentServiceImpl implements DocumentService {
 
+       /**
+        * The logger for the service.
+        */
+       public final static AppLogger LOG = AppLogger
+                       .getLogger(DocumentServiceImpl.class);
+
        /**
         * Injected study service.
         */
@@ -61,7 +68,7 @@ public class DocumentServiceImpl implements DocumentService {
        /**
         * Injected project settings service.
         */
-       private ProjectSettingsService _projectSettingsService;
+       private ProjectSettingsService _projectSettings;
        /**
         * Injected repository service.
         */
@@ -122,7 +129,7 @@ public class DocumentServiceImpl implements DocumentService {
                // Synchronize the object with the current Hibernate session.
                owner = getStudyDAO().get(owner.getIndex());
 
-               SimpleDateFormat tostring = new SimpleDateFormat("yyyy");
+               SimpleDateFormat tostring = new SimpleDateFormat("yyyy"); //RKV: NOPMD: TODO: Use locale here?
                String year = tostring.format(owner.getDate());
                String filename = generateEncodedName(aDoc, owner);
                String path = owner.getReference();
@@ -266,6 +273,7 @@ public class DocumentServiceImpl implements DocumentService {
                                        fprop.setReference(value);
                                }
                        } catch (Exception e) {
+                               LOG.debug(e.getMessage(), e);
                        }
                }
                return fprop;
@@ -325,8 +333,8 @@ public class DocumentServiceImpl implements DocumentService {
         *            the original document
         * @return true if the new reference is set
         */
-       public boolean buildReferenceFrom(final Document aDoc, final ProjectElement scope,
-                       final Document lineage) {
+       public boolean buildReferenceFrom(final Document aDoc,
+                       final ProjectElement scope, final Document lineage) {
                if (aDoc.getProgressState() != ProgressState.inWORK) {
                        return false;
                }
@@ -637,7 +645,7 @@ public class DocumentServiceImpl implements DocumentService {
         * @return Project settings service
         */
        private ProjectSettingsService getProjectSettings() {
-               return _projectSettingsService;
+               return _projectSettings;
        }
 
        /**
@@ -646,8 +654,9 @@ public class DocumentServiceImpl implements DocumentService {
         * @param projectSettingsService
         *            project settings service
         */
-       public void setProjectSettings(final ProjectSettingsService projectSettingsService) {
-               _projectSettingsService = projectSettingsService;
+       public void setProjectSettings(
+                       final ProjectSettingsService projectSettingsService) {
+               _projectSettings = projectSettingsService;
        }
 
        /**