]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman-Common/src/org/splat/service/PublicationServiceImpl.java
Salome HOME
a47e1dc7ed43d554a45a61d0538399dbd81e8974
[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                                 //RKV: use delete-orphan by removing from project element, see StepService.remove
456                                 //RKV: getPublicationDAO().delete(oldoc); // WARNING: Potential problem because it's not automatically done as orphan object
457                         }
458 */              }
459                 getStepService().add(step, aPublication); // Increments the configuration tag count of document
460
461                 // Import the document properties and update of the study
462                 forwardProperties(aPublication, aPublication.value().getSourceFile()
463                                 .asFile(), step);
464                 getProjectElementDAO().merge(aPublication.getOwner());
465         }
466
467         /**
468          * Propagate simulation contexts from the given config file to the publication's owner (study or step).
469          * 
470          * @param aPublication
471          *            the document publication
472          * @param from
473          *            the config file
474          * @param to
475          *            the study step
476          */
477         private void forwardProperties(final Publication aPublication,
478                         final java.io.File from, final Step to) {
479                 Reader tool = Toolbox.getReader(from);
480                 if (tool != null) { // Properties extractor available for this type of document
481                         SimulationContextType.Properties sprop = new SimulationContextType.Properties()
482                                         .setStep(to.getStep()).setProgressState(
483                                                         ProgressState.APPROVED);
484                         List<SimulationContextType> contype = getSimulationContextService()
485                                         .selectTypesWhere(sprop);
486                         if (!contype.isEmpty()) { // There is an approved property type configured at this step
487
488                                 SimulationContext.Properties cprop = new SimulationContext.Properties();
489                                 List<SimulationContext> context = to.getAllSimulationContexts();
490
491                                 context = new ArrayList<SimulationContext>(context.size());
492                                 context.addAll(to.getAllSimulationContexts());
493                                 cprop.disableCheck();
494                                 for (Iterator<SimulationContextType> i = contype.iterator(); i
495                                                 .hasNext();) {
496                                         SimulationContextType property = i.next();
497                                         boolean isFound = false;
498                                         for (Iterator<SimulationContext> j = context.iterator(); j
499                                                         .hasNext();) {
500                                                 SimulationContext existing = j.next();
501                                                 isFound = existing.getType().equals(property);
502                                                 if (isFound) {
503                                                         // Forget this property as it is already set
504                                                         break;
505                                                 }
506                                         }
507                                         if (!isFound) {
508                                                 try {
509                                                         String value = tool.extractProperty(property
510                                                                         .getName());
511                                                         if (value == null) {
512                                                                 continue; // Property not defined into the document
513                                                         }
514
515                                                         cprop.setType(property).setValue(value);
516                                                         if (aPublication.getOwner() instanceof Study) {
517                                                                 getStudyService().addProjectContext(
518                                                                                 (Study) aPublication.getOwner(), cprop); // Re-indexes knowledges and the study
519                                                         } else {
520                                                                 getStepService()
521                                                                                 .addSimulationContext(to, cprop); // Re-indexes knowledges only
522                                                         }
523                                                 } catch (Exception e) {
524                                                         break;
525                                                 }
526                                         }
527                                 }
528                         }
529                 }
530         }
531
532         /**
533          * Returns the study Step into which the document version referenced by this publication has been published.
534          * 
535          * @param aPublication
536          *            the document publication
537          * @return the study step where the document is published
538          */
539         public Step getInvolvedStep(final Publication aPublication) {
540                 if (aPublication.getStep() == null) {
541                         Step[] step = getProjectElementService().getSteps(
542                                         aPublication.getOwner());
543                         for (int i = 0; i < step.length; i++) {
544                                 aPublication.setStep(step[i]); // The involved step necessarily exists
545                                 if (aPublication.value().isInto(aPublication.getStep())) {
546                                         break;
547                                 }
548                         }
549                 }
550                 return aPublication.getStep();
551         }
552
553         /**
554          * Undo the out-date operation.
555          * 
556          * @param aPublication
557          *            the publication
558          * @return true if the acceptance succeeds
559          * @see #outdate()
560          * @see DocumentRights#canAccept()
561          */
562         @Transactional
563         public boolean actualize(final Publication aPublication) {
564                 boolean res = aPublication.isOutdated();
565                 if (res) {
566                         aPublication.setIsnew('Y');
567                         getPublicationDAO().update(aPublication);
568                 }
569                 return res;
570         }
571
572         /**
573          * Out-dates this publication and recursively all publications using this one. Typically, a publication is out-dated when modifying a
574          * document to which it depends.
575          * 
576          * @param aPublication
577          *            the publication
578          * @see #isOutdated()
579          * @see #getProgressState()
580          * @see #actualize()
581          */
582         public void outdate(final Publication aPublication) {
583                 if (aPublication.isOutdated()) {
584                         return;
585                 }
586
587                 List<Publication> relist = aPublication
588                                 .getRelations(UsedByRelation.class);
589                 for (Iterator<Publication> i = relist.iterator(); i.hasNext();) {
590                         outdate(i.next());
591                 }
592                 aPublication.setIsnew('O');
593                 getPublicationDAO().update(aPublication);
594         }
595
596         /**
597          * Create "Converts" relation for the given document publication and format.
598          * 
599          * @param aPublication
600          *            the document publication
601          * @param format
602          *            the format
603          * @return the created "Converts" relation
604          */
605         public ConvertsRelation attach(final Publication aPublication, final String format) {
606                 return getDocumentService().attach(aPublication.value(), format);
607         }
608
609         /**
610          * Create "Converts" relation for the given document publication, format and description.
611          * 
612          * @param aPublication
613          *            the document publication
614          * @param format
615          *            the format
616          * @param description
617          *            the description of the relation
618          * @return the created "Converts" relation
619          */
620         public ConvertsRelation attach(final Publication aPublication, final String format,
621                         final String description) {
622                 return getDocumentService().attach(aPublication.value(), format,
623                                 description);
624         }
625
626         /**
627          * Rename the published document.
628          * 
629          * @param aPublication
630          *            the publication of the document
631          * @param title
632          *            the new document title
633          * @throws InvalidPropertyException
634          *             if the new title is empty
635          */
636         public void rename(final Publication aPublication, final String title)
637                         throws InvalidPropertyException {
638                 getDocumentService().rename(aPublication.value(), title);
639         }
640
641         /**
642          * Get the projectElementService.
643          * 
644          * @return the projectElementService
645          */
646         public ProjectElementService getProjectElementService() {
647                 return _projectElementService;
648         }
649
650         /**
651          * Set the projectElementService.
652          * 
653          * @param projectElementService
654          *            the projectElementService to set
655          */
656         public void setProjectElementService(
657                         final ProjectElementService projectElementService) {
658                 _projectElementService = projectElementService;
659         }
660
661         /**
662          * Get the simulationContextService.
663          * 
664          * @return the simulationContextService
665          */
666         public SimulationContextService getSimulationContextService() {
667                 return _simulationContextService;
668         }
669
670         /**
671          * Set the simulationContextService.
672          * 
673          * @param simulationContextService
674          *            the simulationContextService to set
675          */
676         public void setSimulationContextService(
677                         final SimulationContextService simulationContextService) {
678                 _simulationContextService = simulationContextService;
679         }
680
681         /**
682          * Get the studyService.
683          * 
684          * @return the studyService
685          */
686         public StudyService getStudyService() {
687                 return _studyService;
688         }
689
690         /**
691          * Set the studyService.
692          * 
693          * @param studyService
694          *            the studyService to set
695          */
696         public void setStudyService(final StudyService studyService) {
697                 _studyService = studyService;
698         }
699
700         /**
701          * Get the stepService.
702          * 
703          * @return the stepService
704          */
705         public StepService getStepService() {
706                 return _stepService;
707         }
708
709         /**
710          * Set the stepService.
711          * 
712          * @param stepService
713          *            the stepService to set
714          */
715         public void setStepService(final StepService stepService) {
716                 _stepService = stepService;
717         }
718
719         /**
720          * Get the documentService.
721          * 
722          * @return the documentService
723          */
724         public DocumentService getDocumentService() {
725                 return _documentService;
726         }
727
728         /**
729          * Set the documentService.
730          * 
731          * @param documentService
732          *            the documentService to set
733          */
734         public void setDocumentService(final DocumentService documentService) {
735                 _documentService = documentService;
736         }
737
738         /**
739          * Get the publicationDAO.
740          * 
741          * @return the publicationDAO
742          */
743         public PublicationDAO getPublicationDAO() {
744                 return _publicationDAO;
745         }
746
747         /**
748          * Set the publicationDAO.
749          * 
750          * @param publicationDAO
751          *            the publicationDAO to set
752          */
753         public void setPublicationDAO(final PublicationDAO publicationDAO) {
754                 _publicationDAO = publicationDAO;
755         }
756
757         /**
758          * Get the projectElementDAO.
759          * 
760          * @return the projectElementDAO
761          */
762         public ProjectElementDAO getProjectElementDAO() {
763                 return _projectElementDAO;
764         }
765
766         /**
767          * Set the projectElementDAO.
768          * 
769          * @param projectElementDAO
770          *            the projectElementDAO to set
771          */
772         public void setProjectElementDAO(final ProjectElementDAO projectElementDAO) {
773                 _projectElementDAO = projectElementDAO;
774         }
775
776         /**
777          * Get the repositoryService.
778          * 
779          * @return the repositoryService
780          */
781         public RepositoryService getRepositoryService() {
782                 return _repositoryService;
783         }
784
785         /**
786          * Set the repositoryService.
787          * 
788          * @param repositoryService
789          *            the repositoryService to set
790          */
791         public void setRepositoryService(final RepositoryService repositoryService) {
792                 _repositoryService = repositoryService;
793         }
794
795         /**
796          * Get the timestampDAO.
797          * @return the timestampDAO
798          */
799         public TimestampDAO getTimestampDAO() {
800                 return _timestampDAO;
801         }
802
803         /**
804          * Set the timestampDAO.
805          * @param timestampDAO the timestampDAO to set
806          */
807         public void setTimestampDAO(final TimestampDAO timestampDAO) {
808                 _timestampDAO = timestampDAO;
809         }
810 }