]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman-Common/src/org/splat/service/PublicationServiceImpl.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 / PublicationServiceImpl.java
1 /*****************************************************************************
2  * Company         OPEN CASCADE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   06.10.2012
6  * @author         $Author$
7  * @version        $Revision$
8  *****************************************************************************/
9
10 package org.splat.service;
11
12 import java.io.File;
13 import java.io.FileNotFoundException;
14 import java.io.IOException;
15 import java.util.ArrayList;
16 import java.util.Date;
17 import java.util.HashSet;
18 import java.util.Iterator;
19 import java.util.List;
20
21 import org.apache.log4j.Logger;
22 import org.splat.dal.bo.kernel.User;
23 import org.splat.dal.bo.som.ConvertsRelation;
24 import org.splat.dal.bo.som.Document;
25 import org.splat.dal.bo.som.DocumentType;
26 import org.splat.dal.bo.som.ProgressState;
27 import org.splat.dal.bo.som.ProjectElement;
28 import org.splat.dal.bo.som.Publication;
29 import org.splat.dal.bo.som.SimulationContext;
30 import org.splat.dal.bo.som.SimulationContextType;
31 import org.splat.dal.bo.som.Study;
32 import org.splat.dal.bo.som.Timestamp;
33 import org.splat.dal.bo.som.UsedByRelation;
34 import org.splat.dal.bo.som.ValidationCycle;
35 import org.splat.dal.bo.som.ValidationStep;
36 import org.splat.dal.dao.som.ProjectElementDAO;
37 import org.splat.dal.dao.som.PublicationDAO;
38 import org.splat.dal.dao.som.TimestampDAO;
39 import org.splat.kernel.InvalidPropertyException;
40 import org.splat.kernel.MismatchException;
41 import org.splat.kernel.MissedPropertyException;
42 import org.splat.kernel.MultiplyDefinedException;
43 import org.splat.kernel.NotApplicableException;
44 import org.splat.manox.Reader;
45 import org.splat.manox.Toolbox;
46 import org.splat.service.technical.RepositoryService;
47 import org.splat.som.DocumentRights;
48 import org.splat.som.Revision;
49 import org.splat.som.Step;
50 import org.springframework.transaction.annotation.Transactional;
51
52 /**
53  * Publication service implementation.
54  * 
55  * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
56  */
57 public class PublicationServiceImpl implements PublicationService {
58
59         /**
60          * Logger for this class.
61          */
62         protected final static Logger LOG = Logger
63                         .getLogger(PublicationServiceImpl.class);
64
65         /**
66          * Injected study service.
67          */
68         private StudyService _studyService;
69         /**
70          * Injected step service.
71          */
72         private StepService _stepService;
73         /**
74          * Injected document service.
75          */
76         private DocumentService _documentService;
77         /**
78          * Injected project element service.
79          */
80         private ProjectElementService _projectElementService;
81         /**
82          * Injected simulation context service.
83          */
84         private SimulationContextService _simulationContextService;
85         /**
86          * Injected publication DAO.
87          */
88         private PublicationDAO _publicationDAO;
89         /**
90          * Injected timestamp DAO.
91          */
92         private TimestampDAO _timestampDAO;
93         /**
94          * Injected project element DAO.
95          */
96         private ProjectElementDAO _projectElementDAO;
97         /**
98          * Injected repository service.
99          */
100         private RepositoryService _repositoryService;
101
102         /**
103          * {@inheritDoc}
104          * 
105          * @see org.splat.service.PublicationService#copy(org.splat.dal.bo.som.Publication, org.splat.dal.bo.som.ProjectElement)
106          */
107         public Publication copy(final Publication aPublication, final ProjectElement publisher) {
108                 Publication copy = new Publication();
109                 copy.setValue(aPublication.value());
110                 copy.setStep(aPublication.getStep()); // May not be initialized yet
111                 copy.setOwner(publisher);
112                 copy.setIsnew(aPublication.getIsnew());
113                 if (!copy.getOwnerStudy().equals(aPublication.getOwnerStudy())) {
114                         copy.setIsnew('N'); // The referenced document is not new for the given study
115                 }
116                 return copy;
117         }
118
119         /** 
120          * {@inheritDoc}
121          * @see org.splat.service.PublicationService#versionDocument(org.splat.som.Step, org.splat.dal.bo.kernel.User, java.lang.String, long, java.lang.String, java.lang.String, org.splat.dal.bo.som.ProgressState, java.util.Date, java.lang.String[], long[])
122          */
123         @Transactional
124         public void versionDocument(final Step step, final User user,
125                         final String filename, final long docIndex, final String docver,
126                         final String summary, final ProgressState state, final Date date,
127                         final String[] docuses, final long[] docusedby)
128                         throws MissedPropertyException, InvalidPropertyException,
129                         MultiplyDefinedException, IOException, MismatchException,
130                         NotApplicableException, InterruptedException {
131                 File updir = getRepositoryService().getDownloadDirectory(user);
132                 File upfile = new File(updir.getPath() + "/" + filename);
133
134                 // Versioning of the document
135                 Document.Properties dprop = new Document.Properties();
136                 Publication current = step.getDocument(docIndex);
137                 Publication next;
138
139                 if ((docver.length() != 0) && // Importation of a not foreign document
140                                 (date != null)) {
141                         dprop.setDate(date);
142                 }
143                 next = getStepService().versionDocument(step, current,
144                                 dprop.setAuthor(user).setDescription(summary));
145                 updir = next.getSourceFile().asFile();
146                 if (LOG.isInfoEnabled()) {
147                         LOG.info("Moving \"" + upfile.getName() + "\" to \""
148                                         + updir.getPath() + "\".");
149                 }
150                 upfile.renameTo(updir);
151
152                 try {
153                         if (docver.length() == 0) { // Importation of a foreign document
154                                 saveAs(next, state); // May throw FileNotFound if rename was not done
155                         } else {
156                                 saveAs(next, new Revision(docver));
157                         }
158                 } catch (FileNotFoundException saverror) {
159                         Thread.sleep(1000);
160                         LOG.info("Waiting for the file.");
161                         upfile.renameTo(updir);
162                         saveAs(next, state);
163                 }
164                 // TODO: Remove current document details from the contents of open study
165
166                 // Creation of uses relations
167                 updateRelations(current, next, docuses, docusedby);
168         }
169
170         /**
171          * Update relations after creation of a new document version.
172          * 
173          * @param current
174          *            the current version
175          * @param next
176          *            the new version
177          * @param docuses
178          *            ids of used documents
179          * @param docusedby
180          *            ids of documents used by the versioned one.
181          */
182         private void updateRelations(final Publication current,
183                         final Publication next, final String[] docuses,
184                         final long[] docusedby) {
185                 if (docuses != null) {
186                         for (int i = 0; i < docuses.length; i++) {
187                                 Long index = Long.valueOf(docuses[i].trim());
188                                 Publication used = getPublicationDAO().get(index);// RKV: getPublication(index, steps);
189                                 next.addDependency(used);
190                         }
191                 }
192                 // Outdating impacted document
193                 HashSet<Long> compatible = new HashSet<Long>();
194                 if (docusedby != null) {
195                         for (int i = 0; i < docusedby.length; i++) {
196                                 compatible.add(docusedby[i]);
197                         }
198                 }
199                 List<Publication> relist = current.getRelations(UsedByRelation.class);
200                 for (Iterator<Publication> i = relist.iterator(); i.hasNext();) {
201                         Publication using = i.next();
202                         if (!compatible.contains(using.getIndex())) {
203                                 outdate(using);
204                         }
205                 }
206         }
207
208 /*      protected Publication getPublication(int index, List<Step> steps) {
209                 for (Iterator<Step> i = steps.iterator(); i.hasNext();) {
210                         List<Publication> published = i.next().getAllDocuments();
211                         for (Iterator<Publication> j = published.iterator(); j.hasNext();) {
212                                 Publication found = j.next(); // In a given study step,
213                                 if (found.value().getIndex() == index)
214                                         return found; // there is only one publication of a given document
215                         }
216                 }
217                 return null;
218         }
219 */
220         /**
221          * {@inheritDoc}
222          * 
223          * @see org.splat.service.PublicationService#approve(org.splat.dal.bo.som.Publication, java.util.Date)
224          */
225         @Transactional
226         public Timestamp approve(final Publication aPublication, final Date adate) {
227                 Timestamp res = null;
228                 if (!(aPublication.isOutdated() || (aPublication.value().getProgressState() != ProgressState.inCHECK))) {
229                         DocumentType type = aPublication.value().getType();
230                         Study owner = aPublication.getOwnerStudy();
231                         ValidationCycle cycle = getStudyService().getValidationCycleOf(owner,
232                                         type);
233                         User approver = cycle.getActor(ValidationStep.APPROVAL);
234                         Timestamp stamp = new Timestamp(ValidationStep.APPROVAL, aPublication
235                                         .value(), approver, adate);
236                         getTimestampDAO().create(stamp);
237                         
238                         if (getDocumentService().promote(aPublication.value(), stamp)) {
239                                 res = stamp;
240                                 if (getDocumentService().isStudyResult(type)
241                                                 && owner.getProgressState() == ProgressState.inCHECK) {
242                                         getStudyService().promote(owner);
243                                 }
244                         }
245                 }
246                 return res; // Hoping that promotion of the study succeeded
247         }
248
249         /**
250          * {@inheritDoc}
251          * 
252          * @see org.splat.service.PublicationService#demote(org.splat.dal.bo.som.Publication)
253          */
254         @Transactional
255         public boolean demote(final Publication aPublication) {
256                 boolean res = false;
257                 DocumentType type = aPublication.value().getType();
258                 Study owner = aPublication.getOwnerStudy();
259
260                 if (aPublication.value().getProgressState() == ProgressState.inCHECK) {
261                         ValidationCycle cycle = getStudyService().getValidationCycleOf(
262                                         owner, type);
263                         if (cycle.enables(ValidationStep.REVIEW)) {
264                                 res = getDocumentService().demote(aPublication.value());
265                         } else {
266                                 res = getDocumentService().demote(aPublication.value());
267                                 if (res) {
268                                         getDocumentService().demote(aPublication.value());
269                                 }
270                         }
271                 } else if (aPublication.value().getProgressState() == ProgressState.inDRAFT) {
272                         res = getDocumentService().demote(aPublication.value());
273                 }
274                 if (res && getDocumentService().isStudyResult(type)
275                                 && owner.getProgressState() != ProgressState.inWORK) {
276                         getStudyService().demote(owner);
277                 }
278                 return res;
279         }
280
281         /**
282          * {@inheritDoc}
283          * 
284          * @see org.splat.service.PublicationService#invalidate(org.splat.dal.bo.som.Publication)
285          */
286         @Transactional
287         public boolean invalidate(final Publication aPublication) {
288                 boolean res = false;
289                 if ((aPublication.value().getProgressState() == ProgressState.inCHECK)
290                                 && getDocumentService().demote(aPublication.value())) {
291                         DocumentType type = aPublication.value().getType();
292                         Study owner = aPublication.getOwnerStudy();
293                         if (getDocumentService().isStudyResult(type)
294                                         && owner.getProgressState() == ProgressState.inCHECK) {
295                                 getStudyService().demote(owner);
296                         }
297                         res = true;
298                 }
299                 return res;
300         }
301
302         /**
303          * {@inheritDoc}
304          * 
305          * @see org.splat.service.PublicationService#promote(org.splat.dal.bo.som.Publication, java.util.Date)
306          */
307         @Transactional
308         public Timestamp promote(final Publication aPublication, final Date pdate) {
309                 Timestamp res = null;
310                 if ((!aPublication.isOutdated())
311                                 && (aPublication.value().getProgressState() == ProgressState.inWORK)) {
312                         DocumentType type = aPublication.value().getType();
313                         Study owner = aPublication.getOwnerStudy();
314                         ValidationCycle cycle = getStudyService().getValidationCycleOf(
315                                         owner, type);
316                         User promoter = cycle.getActor(ValidationStep.PROMOTION);
317                         if (promoter == null) {
318                                 promoter = getInvolvedStep(aPublication).getActor();
319                         }
320                         if (promoter == null) {
321                                 promoter = owner.getAuthor();
322                         }
323                         Timestamp stamp = new Timestamp(ValidationStep.PROMOTION,
324                                         aPublication.value(), promoter, pdate);
325                         getTimestampDAO().create(stamp);
326
327                         if (getDocumentService().promote(aPublication.value(), stamp)) {
328                                 res = stamp;
329                                 if (!cycle.enables(ValidationStep.REVIEW)) {
330                                         getDocumentService().promote(aPublication.value(), null);
331                                 }
332                                 if (getDocumentService().isStudyResult(type)
333                                                 && owner.getProgressState() == ProgressState.inWORK) {
334                                         getStudyService().promote(owner);
335                                 }
336                         }
337                 }
338                 return res; // Hoping that promotion of the study succeeded
339         }
340
341         /**
342          * {@inheritDoc}
343          * 
344          * @see org.splat.service.PublicationService#review(org.splat.dal.bo.som.Publication, java.util.Date)
345          */
346         @Transactional
347         public Timestamp review(final Publication aPublication, final Date rdate) {
348                 Timestamp res = null;
349                 if (!aPublication.isOutdated()
350                                 && !(aPublication.value().getProgressState() != ProgressState.inDRAFT)) {
351
352                         DocumentType type = aPublication.value().getType();
353                         Study owner = aPublication.getOwnerStudy();
354                         ValidationCycle cycle = getStudyService().getValidationCycleOf(
355                                         owner, type);
356                         User reviewer = cycle.getActor(ValidationStep.REVIEW);
357                         Timestamp stamp = new Timestamp(ValidationStep.REVIEW, aPublication
358                                         .value(), reviewer, rdate);
359                         getTimestampDAO().create(stamp);
360
361                         if (getDocumentService().promote(aPublication.value(), stamp)) {
362                                 res = stamp;
363                                 if (getDocumentService().isStudyResult(type)
364                                                 && owner.getProgressState() == ProgressState.inDRAFT) {
365                                         getStudyService().promote(owner);
366                                 }
367                         }
368                 }
369                 return res; // Hoping that promotion of the study succeeded
370         }
371
372         /**
373          * {@inheritDoc}
374          * 
375          * @see org.splat.service.PublicationService#saveAs(org.splat.dal.bo.som.Publication, org.splat.som.Revision)
376          * @deprecated
377          */
378         @Deprecated
379         @Transactional
380         public void saveAs(final Publication aPublication, final Revision newvers)
381                         throws FileNotFoundException, NotApplicableException {
382                 if (aPublication.value().isUndefined()) {
383                         throw new NotApplicableException(
384                                         "Cannot save a Publication object refering an undefined Document");
385                 }
386                 if (!aPublication.value().getSourceFile().exists()) {
387                         throw new FileNotFoundException();
388                 }
389
390                 getPublicationDAO().create(aPublication); // Must be done before updating the study in order to fix this final (rid-based) hascode
391                 getDocumentService().updateAs(aPublication.value(), newvers); // May change the branch name of given revision
392                 updateOwner(aPublication);
393         }
394
395         /**
396          * {@inheritDoc}
397          * 
398          * @see org.splat.service.PublicationService#saveAs(org.splat.dal.bo.som.Publication, org.splat.dal.bo.som.ProgressState)
399          */
400         @Transactional
401         public void saveAs(final Publication aPublication, final ProgressState state)
402                         throws FileNotFoundException, NotApplicableException {
403                 if (aPublication.value().isUndefined()) {
404                         throw new NotApplicableException(
405                                         "Cannot save a Publication object refering an undefined Document");
406                 }
407                 if (!aPublication.value().getSourceFile().exists()) {
408                         throw new FileNotFoundException();
409                 }
410
411                 if (state == ProgressState.inWORK || state == ProgressState.EXTERN) {
412                         getPublicationDAO().create(aPublication); // Must be done before updating the study in order to fix this final (rid-based)
413                         // hascode
414                         getDocumentService().updateAs(aPublication.value(), state);
415                 } else {
416                         DocumentType mytype = aPublication.value().getType();
417                         Study owner = aPublication.getOwnerStudy();
418                         ValidationCycle cycle = getStudyService().getValidationCycleOf(
419                                         owner, mytype);
420                         boolean review = cycle.enables(ValidationStep.REVIEW);
421                         if (!(state == ProgressState.inDRAFT && review)
422                                         && !(state == ProgressState.inCHECK && !review)) {
423                                 throw new NotApplicableException(
424                                                 "Cannot save a result document in " + state.toString()
425                                                                 + " state");
426                         }
427                         getPublicationDAO().create(aPublication); // Must be done before updating the study in order to fix this final (rid-based)
428                         // hascode
429                         getDocumentService().updateAs(aPublication.value(),
430                                         ProgressState.inWORK);
431
432                         promote(aPublication, aPublication.value()
433                                         .getLastModificationDate()); // Promotes to the appropriate state in accordance to the validation cycle
434                 }
435                 updateOwner(aPublication);
436         }
437
438         /**
439          * Update an owner of the publication.
440          * 
441          * @param aPublication
442          *            the document publication
443          */
444         @Transactional
445         private void updateOwner(final Publication aPublication) {
446                 Step step = getInvolvedStep(aPublication);
447
448                 // Update of involved step
449                 Document previous = aPublication.value().getPreviousVersion();
450                 if (previous != null) {
451                         Publication oldoc = step.getDocument(previous.getIndex());
452                         boolean done = getStepService().remove(step, oldoc); // Decrements the configuration tag count of document
453                         if (done) {
454                                 oldoc = getPublicationDAO().merge(oldoc); //RKV: to avoid: NonUniqueObjectException: a different object with the same identifier value was already associated with the session
455                                 getPublicationDAO().delete(oldoc); // WARNING: Potential problem because it's not automatically done as orphan object
456                         }
457                 }
458                 getStepService().add(step, aPublication); // Increments the configuration tag count of document
459
460                 // Import the document properties and update of the study
461                 forwardProperties(aPublication, aPublication.value().getSourceFile()
462                                 .asFile(), step);
463                 getProjectElementDAO().merge(aPublication.getOwner());
464         }
465
466         /**
467          * Propagate simulation contexts from the given config file to the publication's owner (study or step).
468          * 
469          * @param aPublication
470          *            the document publication
471          * @param from
472          *            the config file
473          * @param to
474          *            the study step
475          */
476         private void forwardProperties(final Publication aPublication,
477                         final java.io.File from, final Step to) {
478                 Reader tool = Toolbox.getReader(from);
479                 if (tool != null) { // Properties extractor available for this type of document
480                         SimulationContextType.Properties sprop = new SimulationContextType.Properties()
481                                         .setStep(to.getStep()).setProgressState(
482                                                         ProgressState.APPROVED);
483                         List<SimulationContextType> contype = getSimulationContextService()
484                                         .selectTypesWhere(sprop);
485                         if (!contype.isEmpty()) { // There is an approved property type configured at this step
486
487                                 SimulationContext.Properties cprop = new SimulationContext.Properties();
488                                 List<SimulationContext> context = to.getAllSimulationContexts();
489
490                                 context = new ArrayList<SimulationContext>(context.size());
491                                 context.addAll(to.getAllSimulationContexts());
492                                 cprop.disableCheck();
493                                 for (Iterator<SimulationContextType> i = contype.iterator(); i
494                                                 .hasNext();) {
495                                         SimulationContextType property = i.next();
496                                         boolean isFound = false;
497                                         for (Iterator<SimulationContext> j = context.iterator(); j
498                                                         .hasNext();) {
499                                                 SimulationContext existing = j.next();
500                                                 isFound = existing.getType().equals(property);
501                                                 if (isFound) {
502                                                         // Forget this property as it is already set
503                                                         break;
504                                                 }
505                                         }
506                                         if (!isFound) {
507                                                 try {
508                                                         String value = tool.extractProperty(property
509                                                                         .getName());
510                                                         if (value == null) {
511                                                                 continue; // Property not defined into the document
512                                                         }
513
514                                                         cprop.setType(property).setValue(value);
515                                                         if (aPublication.getOwner() instanceof Study) {
516                                                                 getStudyService().addProjectContext(
517                                                                                 (Study) aPublication.getOwner(), cprop); // Re-indexes knowledges and the study
518                                                         } else {
519                                                                 getStepService()
520                                                                                 .addSimulationContext(to, cprop); // Re-indexes knowledges only
521                                                         }
522                                                 } catch (Exception e) {
523                                                         break;
524                                                 }
525                                         }
526                                 }
527                         }
528                 }
529         }
530
531         /**
532          * Returns the study Step into which the document version referenced by this publication has been published.
533          * 
534          * @param aPublication
535          *            the document publication
536          * @return the study step where the document is published
537          */
538         public Step getInvolvedStep(final Publication aPublication) {
539                 if (aPublication.getStep() == null) {
540                         Step[] step = getProjectElementService().getSteps(
541                                         aPublication.getOwner());
542                         for (int i = 0; i < step.length; i++) {
543                                 aPublication.setStep(step[i]); // The involved step necessarily exists
544                                 if (aPublication.value().isInto(aPublication.getStep())) {
545                                         break;
546                                 }
547                         }
548                 }
549                 return aPublication.getStep();
550         }
551
552         /**
553          * Undo the out-date operation.
554          * 
555          * @param aPublication
556          *            the publication
557          * @return true if the acceptance succeeds
558          * @see #outdate()
559          * @see DocumentRights#canAccept()
560          */
561         @Transactional
562         public boolean actualize(final Publication aPublication) {
563                 boolean res = aPublication.isOutdated();
564                 if (res) {
565                         aPublication.setIsnew('Y');
566                         getPublicationDAO().update(aPublication);
567                 }
568                 return res;
569         }
570
571         /**
572          * Out-dates this publication and recursively all publications using this one. Typically, a publication is out-dated when modifying a
573          * document to which it depends.
574          * 
575          * @param aPublication
576          *            the publication
577          * @see #isOutdated()
578          * @see #getProgressState()
579          * @see #actualize()
580          */
581         public void outdate(final Publication aPublication) {
582                 if (aPublication.isOutdated()) {
583                         return;
584                 }
585
586                 List<Publication> relist = aPublication
587                                 .getRelations(UsedByRelation.class);
588                 for (Iterator<Publication> i = relist.iterator(); i.hasNext();) {
589                         outdate(i.next());
590                 }
591                 aPublication.setIsnew('O');
592                 getPublicationDAO().update(aPublication);
593         }
594
595         /**
596          * Create "Converts" relation for the given document publication and format.
597          * 
598          * @param aPublication
599          *            the document publication
600          * @param format
601          *            the format
602          * @return the created "Converts" relation
603          */
604         public ConvertsRelation attach(final Publication aPublication, final String format) {
605                 return getDocumentService().attach(aPublication.value(), format);
606         }
607
608         /**
609          * Create "Converts" relation for the given document publication, format and description.
610          * 
611          * @param aPublication
612          *            the document publication
613          * @param format
614          *            the format
615          * @param description
616          *            the description of the relation
617          * @return the created "Converts" relation
618          */
619         public ConvertsRelation attach(final Publication aPublication, final String format,
620                         final String description) {
621                 return getDocumentService().attach(aPublication.value(), format,
622                                 description);
623         }
624
625         /**
626          * Rename the published document.
627          * 
628          * @param aPublication
629          *            the publication of the document
630          * @param title
631          *            the new document title
632          * @throws InvalidPropertyException
633          *             if the new title is empty
634          */
635         public void rename(final Publication aPublication, final String title)
636                         throws InvalidPropertyException {
637                 getDocumentService().rename(aPublication.value(), title);
638         }
639
640         /**
641          * Get the projectElementService.
642          * 
643          * @return the projectElementService
644          */
645         public ProjectElementService getProjectElementService() {
646                 return _projectElementService;
647         }
648
649         /**
650          * Set the projectElementService.
651          * 
652          * @param projectElementService
653          *            the projectElementService to set
654          */
655         public void setProjectElementService(
656                         final ProjectElementService projectElementService) {
657                 _projectElementService = projectElementService;
658         }
659
660         /**
661          * Get the simulationContextService.
662          * 
663          * @return the simulationContextService
664          */
665         public SimulationContextService getSimulationContextService() {
666                 return _simulationContextService;
667         }
668
669         /**
670          * Set the simulationContextService.
671          * 
672          * @param simulationContextService
673          *            the simulationContextService to set
674          */
675         public void setSimulationContextService(
676                         final SimulationContextService simulationContextService) {
677                 _simulationContextService = simulationContextService;
678         }
679
680         /**
681          * Get the studyService.
682          * 
683          * @return the studyService
684          */
685         public StudyService getStudyService() {
686                 return _studyService;
687         }
688
689         /**
690          * Set the studyService.
691          * 
692          * @param studyService
693          *            the studyService to set
694          */
695         public void setStudyService(final StudyService studyService) {
696                 _studyService = studyService;
697         }
698
699         /**
700          * Get the stepService.
701          * 
702          * @return the stepService
703          */
704         public StepService getStepService() {
705                 return _stepService;
706         }
707
708         /**
709          * Set the stepService.
710          * 
711          * @param stepService
712          *            the stepService to set
713          */
714         public void setStepService(final StepService stepService) {
715                 _stepService = stepService;
716         }
717
718         /**
719          * Get the documentService.
720          * 
721          * @return the documentService
722          */
723         public DocumentService getDocumentService() {
724                 return _documentService;
725         }
726
727         /**
728          * Set the documentService.
729          * 
730          * @param documentService
731          *            the documentService to set
732          */
733         public void setDocumentService(final DocumentService documentService) {
734                 _documentService = documentService;
735         }
736
737         /**
738          * Get the publicationDAO.
739          * 
740          * @return the publicationDAO
741          */
742         public PublicationDAO getPublicationDAO() {
743                 return _publicationDAO;
744         }
745
746         /**
747          * Set the publicationDAO.
748          * 
749          * @param publicationDAO
750          *            the publicationDAO to set
751          */
752         public void setPublicationDAO(final PublicationDAO publicationDAO) {
753                 _publicationDAO = publicationDAO;
754         }
755
756         /**
757          * Get the projectElementDAO.
758          * 
759          * @return the projectElementDAO
760          */
761         public ProjectElementDAO getProjectElementDAO() {
762                 return _projectElementDAO;
763         }
764
765         /**
766          * Set the projectElementDAO.
767          * 
768          * @param projectElementDAO
769          *            the projectElementDAO to set
770          */
771         public void setProjectElementDAO(final ProjectElementDAO projectElementDAO) {
772                 _projectElementDAO = projectElementDAO;
773         }
774
775         /**
776          * Get the repositoryService.
777          * 
778          * @return the repositoryService
779          */
780         public RepositoryService getRepositoryService() {
781                 return _repositoryService;
782         }
783
784         /**
785          * Set the repositoryService.
786          * 
787          * @param repositoryService
788          *            the repositoryService to set
789          */
790         public void setRepositoryService(final RepositoryService repositoryService) {
791                 _repositoryService = repositoryService;
792         }
793
794         /**
795          * Get the timestampDAO.
796          * @return the timestampDAO
797          */
798         public TimestampDAO getTimestampDAO() {
799                 return _timestampDAO;
800         }
801
802         /**
803          * Set the timestampDAO.
804          * @param timestampDAO the timestampDAO to set
805          */
806         public void setTimestampDAO(final TimestampDAO timestampDAO) {
807                 _timestampDAO = timestampDAO;
808         }
809 }