1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service;
12 import java.io.IOException;
13 import java.util.ArrayList;
14 import java.util.List;
16 import org.hibernate.criterion.Restrictions;
17 import org.splat.dal.bo.kernel.Relation;
18 import org.splat.dal.bo.kernel.User;
19 import org.splat.dal.bo.som.ConvertsRelation;
20 import org.splat.dal.bo.som.Document;
21 import org.splat.dal.bo.som.DocumentType;
22 import org.splat.dal.bo.som.File;
23 import org.splat.dal.bo.som.KnowledgeElement;
24 import org.splat.dal.bo.som.ProjectElement;
25 import org.splat.dal.bo.som.Publication;
26 import org.splat.dal.bo.som.Scenario;
27 import org.splat.dal.bo.som.SimulationContext;
28 import org.splat.dal.bo.som.StepCommentAttribute;
29 import org.splat.dal.bo.som.UsedByRelation;
30 import org.splat.dal.bo.som.UsesRelation;
31 import org.splat.dal.bo.som.VersionsRelation;
32 import org.splat.dal.dao.kernel.RelationDAO;
33 import org.splat.dal.dao.kernel.UserDAO;
34 import org.splat.dal.dao.som.DocumentDAO;
35 import org.splat.dal.dao.som.FileDAO;
36 import org.splat.dal.dao.som.ProjectElementDAO;
37 import org.splat.dal.dao.som.PublicationDAO;
38 import org.splat.dal.dao.som.SimulationContextDAO;
39 import org.splat.dal.dao.som.StepCommentAttributeDAO;
40 import org.splat.dal.dao.som.VersionsRelationDAO;
41 import org.splat.exception.DocumentIsUsedException;
42 import org.splat.exception.InvalidParameterException;
43 import org.splat.kernel.InvalidPropertyException;
44 import org.splat.kernel.MismatchException;
45 import org.splat.kernel.MissedPropertyException;
46 import org.splat.kernel.MultiplyDefinedException;
47 import org.splat.kernel.NotApplicableException;
48 import org.splat.log.AppLogger;
49 import org.splat.service.dto.StepCommentDTO;
50 import org.splat.service.technical.IndexService;
51 import org.splat.service.technical.ProjectSettingsService;
52 import org.splat.som.Revision;
53 import org.splat.som.Step;
54 import org.splat.util.BeanHelper;
55 import org.springframework.transaction.annotation.Transactional;
58 * Step service implementation.
60 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
62 public class StepServiceImpl implements StepService {
65 * logger for the service.
67 public final static AppLogger LOG = AppLogger
68 .getLogger(StepServiceImpl.class);
70 * Injected index service.
72 private IndexService _indexService;
74 * Injected document service.
76 private DocumentService _documentService;
78 * Injected document type service.
80 private DocumentTypeService _documentTypeService;
82 * Injected document DAO.
84 private DocumentDAO _documentDAO;
86 * Injected relation DAO.
88 private RelationDAO _relationDAO;
92 private FileDAO _fileDAO;
94 * Injected simulation context service.
96 private SimulationContextService _simulationContextService;
98 * Injected simulation context DAO.
100 private SimulationContextDAO _simulationContextDAO;
102 * Injected project element DAO.
104 private ProjectElementDAO _projectElementDAO;
106 * Injected versions relation DAO.
108 private VersionsRelationDAO _versionsRelationDAO;
110 * Injected project service.
112 private ProjectSettingsService _projectSettings;
114 * Injected publication DAO.
116 private PublicationDAO _publicationDAO;
119 * Injected text attribute DAO.
121 private StepCommentAttributeDAO _stepCommentAttributeDAO;
126 private UserDAO _userDAO;
131 * @see org.splat.service.StepService#addSimulationContext(org.splat.som.Step, org.splat.dal.bo.som.SimulationContext.Properties)
135 public SimulationContext addSimulationContext(final Step aStep,
136 final SimulationContext.Properties dprop)
137 throws MissedPropertyException, InvalidPropertyException,
138 MultiplyDefinedException {
139 SimulationContext context = new SimulationContext(dprop.setStep(aStep
141 return addSimulationContext(aStep, context);
147 * @see org.splat.service.StepService#addSimulationContext(org.splat.som.Step, org.splat.dal.bo.som.SimulationContext)
151 public SimulationContext addSimulationContext(final Step aStep,
152 final SimulationContext context) {
153 SimulationContext res = null;
154 getSimulationContextService().hold(context); // Increments the reference count of simulation context
155 if (aStep.getOwner().isSaved()) {
157 if (!context.isSaved()) {
158 getSimulationContextDAO().create(context);
160 aStep.getOwner().add(context);
161 aStep.getContex().add(context); // The context is also referenced from this (transient) Step
162 getProjectElementDAO().update(aStep.getOwner());
163 updateKnowledgeElementsIndex(aStep);
165 } catch (Exception error) {
166 LOG.debug(error.getMessage(), error);
168 } else { // Happens when copying a scenario
169 aStep.getOwner().add(context);
170 aStep.getContex().add(context); // The context is also referenced from this (transient) Step
171 // In case of owner scenario, the Knowledge Element index will be updated later, when saving the scenario
178 * Update lucene index of knowledge elements of a scenario or a study which the given step is related to.
181 * the step (activity)
183 private void updateKnowledgeElementsIndex(final Step aStep) {
185 if (aStep.getOwner() instanceof Scenario) {
186 scenarii = new Scenario[1];
187 scenarii[0] = (Scenario) aStep.getOwner();
189 scenarii = aStep.getOwnerStudy().getScenarii();
191 for (int i = 0; i < scenarii.length; i++) {
192 Scenario scene = scenarii[i];
193 updateScenarioIndex(scene);
198 * Update lucene index for knowledge elements of the scenario.
203 private void updateScenarioIndex(final Scenario scene) {
204 if (scene.getUcase() == null) {
205 for (KnowledgeElement kelm : scene.getKnowledgeElements()) {
206 if (kelm.getType().equals("usecase")) {
207 scene.setUcase(kelm);
217 * @see org.splat.service.StepService#removeSimulationContext(org.splat.som.Step, org.splat.dal.bo.som.SimulationContext)
221 public boolean removeSimulationContext(final Step aStep,
222 final SimulationContext context) {
223 SimulationContext torem = aStep
224 .getSimulationContext(context.getIndex());
226 boolean isOk = (torem != null) && (aStep.getOwner().remove(torem));
229 aStep.getContex().remove(torem);
230 getProjectElementDAO().update(aStep.getOwner());
231 if (torem.isShared()) {
232 getSimulationContextService().release(torem);
233 getSimulationContextDAO().update(torem);
235 getSimulationContextDAO().delete(torem);
244 * @see org.splat.service.StepService#createDocument(org.splat.som.Step, org.splat.dal.bo.som.Document.Properties)
248 public Publication createDocument(final Step aStep,
249 final Document.Properties dprop) throws MissedPropertyException,
250 InvalidPropertyException, MultiplyDefinedException, IOException {
251 if (LOG.isDebugEnabled()) {
252 LOG.debug("Local index before: "
253 + aStep.getOwnerStudy().getLastLocalIndex());
255 Document newdoc = new Document(dprop.setOwner(aStep.getOwner())
256 .setStep(aStep.getStep()));
257 getDocumentService().generateDocumentId(newdoc, dprop);
259 // Creation of the save directory
260 java.io.File wdir = getDocumentService().getSaveDirectory(newdoc);
261 if ((!wdir.exists()) && (!wdir.mkdirs())) {
262 throw new IOException(
263 "Cannot create the repository vault directory");
266 // Identification and save
267 if (LOG.isDebugEnabled()) {
268 LOG.debug("Local index after: "
269 + aStep.getOwnerStudy().getLastLocalIndex());
271 getDocumentService().buildReferenceFrom(newdoc, aStep.getOwnerStudy());
272 getDocumentDAO().create(newdoc);
274 return new Publication(newdoc, aStep.getOwner());
280 * @see org.splat.service.StepService#assignDocument(org.splat.som.Step, org.splat.dal.bo.som.Document.Properties)
283 public Publication assignDocument(final Step aStep,
284 final Document.Properties dprop) throws MissedPropertyException,
285 InvalidPropertyException, NotApplicableException {
286 String refid = dprop.getReference();
287 Publication res = null;
289 Document slot = getDocumentService().selectDocument(refid,
290 new Revision().toString());
291 if ((slot != null) && (slot.isUndefined())) {
292 getDocumentService().initialize(slot,
293 dprop.setOwner(aStep.getOwnerStudy()));
294 res = new Publication(slot, aStep.getOwner());
301 * Create a new version of a document in the given study step.
306 * the base document published version
307 * @return the new version publication
308 * @throws MissedPropertyException
309 * if a mandatory property is missed
310 * @throws InvalidPropertyException
311 * if some property doesn't exist
312 * @throws MultiplyDefinedException
313 * if some property is defined several times
314 * @throws IOException
315 * if a file system error occurs
316 * @throws MismatchException
317 * if the document is not applicable to the given study step
319 public Publication versionDocument(final Step aStep, final Publication base)
320 throws MissedPropertyException, InvalidPropertyException,
321 MultiplyDefinedException, IOException, MismatchException {
322 return versionDocument(aStep, base, new Document.Properties());
326 * Create a new version of a document in the given study step.
331 * the base document published version
333 * the comment for the new version
334 * @return the new version publication
335 * @throws MissedPropertyException
336 * if a mandatory property is missed
337 * @throws InvalidPropertyException
338 * if some property doesn't exist
339 * @throws MultiplyDefinedException
340 * if some property is defined several times
341 * @throws IOException
342 * if a file system error occurs
343 * @throws MismatchException
344 * if the document is not applicable to the given study step
346 public Publication versionDocument(final Step aStep,
347 final Publication base, final String reason)
348 throws MissedPropertyException, InvalidPropertyException,
349 MultiplyDefinedException, IOException, MismatchException {
350 return versionDocument(aStep, base, new Document.Properties()
351 .setDescription(reason));
355 * Create a new version of a document in the given study step.
360 * the base document published version
362 * properties of the new version
363 * @return the new version publication
364 * @throws MissedPropertyException
365 * if a mandatory property is missed
366 * @throws InvalidPropertyException
367 * if some property doesn't exist
368 * @throws MultiplyDefinedException
369 * if some property is defined several times
370 * @throws IOException
371 * if a file system error occurs
372 * @throws MismatchException
373 * if the document is not applicable to the given study step
376 public Publication versionDocument(final Step aStep,
377 final Publication base, final Document.Properties dprop)
378 throws MissedPropertyException, InvalidPropertyException,
379 MultiplyDefinedException, IOException, MismatchException {
380 Document previous = base.value();
382 // RKV: Keep the new file format if it is related to the same document type on this step.
383 String newFormat = dprop.getFormat();
385 dprop.setDocument(previous, getProjectSettings().getStep(
386 base.getStep().getNumber())); // Initializes the Step property
387 if (dprop.getStep().getNumber() != aStep.getNumber()) {
388 throw new MismatchException();
391 if (newFormat != null
393 * && previous.getType().equals( getProjectSettings().getDefaultDocumentType( aStep.getStep(), newFormat))
395 dprop.setFormat(newFormat);
398 if (dprop.getAuthor() == null) {
399 dprop.setAuthor(previous.getAuthor());
401 String summary = dprop.getDescription();
403 // Creation of the document
404 Document newdoc = new Document(dprop.setOwner(aStep.getOwner())
405 .setStep(aStep.getStep()));
406 getDocumentService().generateDocumentId(newdoc, dprop);
407 getDocumentService().buildReferenceFrom(newdoc, aStep.getOwner(),
409 getDocumentDAO().create(newdoc);
412 VersionsRelation aRel;
413 aRel = new VersionsRelation(newdoc, previous, summary);
414 // getVersionsRelationDAO().create(aRel);
415 newdoc.addRelation(aRel);
417 // Update of usedby relations, if exist
419 * RKV: Consider the new version as not used by old dependent documents. So these documents must be marked as outdated then. List<Relation>
420 * relist = previous.getRelations(UsedByRelation.class); Study scope = aStep.getOwnerStudy(); for (Iterator<Relation> i =
421 * relist.iterator(); i.hasNext();) { UsedByRelation relation = (UsedByRelation) i.next(); Document relatedoc = relation.getTo(); if
422 * (scope.shares(relatedoc)) { relatedoc.addRelation(new UsesRelation(relatedoc, newdoc)); } else { relation.moveTo(newdoc); } }
424 return new Publication(newdoc, aStep.getOwner());
428 * Get document types which are applicable for the given study step (activity).
432 * @return the list of document types
435 public List<DocumentType> getValidDocumentTypes(final Step aStep) {
436 return getDocumentTypeService().selectTypesOf(aStep.getStep());
440 * Add a document publication to the given step.
443 * the target study step
445 * the document publication to add
446 * @return true if publication succeeded
449 public boolean add(final Step aStep, final Publication newdoc) {
450 boolean res = aStep.getOwner().add(newdoc); // Updates the study in memory
452 aStep.getDocuments().add(0, newdoc); // Updates this step
453 getDocumentService().hold(newdoc.value()); // Increments the configuration tag count of document
454 // If not yet saved, the Publication MUST NOT be saved here, although this creates a temporary inconsistent state into the
455 // database (it will be saved later by cascading the update of owner scenario).
461 * Remove a document publication from the given step.
466 * the document publication to remove
467 * @return true if removing of the publication succeeded
470 public boolean remove(final Step aStep, final Publication oldoc) {
471 aStep.getDocuments().remove(oldoc); // Updates this step
472 aStep.getOwner().remove(oldoc); // remove from the parent project element
473 getProjectElementDAO().merge(aStep.getOwner().getOwnerStudy());
474 getDocumentService().release(oldoc.value()); // Decrements the configuration tag count of document
475 // The publication becoming orphan, it should automatically be removed from the database when updating of owner scenario.
480 * Remove a document from the given step and from the database if it is no more used.
486 * @return true if removing of the document succeeded
487 * @throws DocumentIsUsedException
488 * if the document is used by other documents
492 public boolean removeDocument(final Step aStep, final long docId)
493 throws DocumentIsUsedException {
494 Publication torem = aStep.getDocument(docId);
495 boolean res = (torem != null);
497 if (!torem.value().getRelations(UsedByRelation.class).isEmpty()) {
498 throw new DocumentIsUsedException(torem.value().getTitle());
500 // Remove the document publication from the step
501 remove(aStep, torem);
502 // Republish the previous version if any to avoid it becoming an orphan
503 Document prevVersion = torem.value().getPreviousVersion();
504 if (prevVersion != null) {
505 prevVersion.setHistory(prevVersion.getHistory() - 1);
506 add(aStep, new Publication(prevVersion, aStep.getOwner()));
507 getProjectElementDAO().merge(aStep.getOwner());
509 // Delete the document if it is no more used
510 Document value = torem.value();
511 if (!value.isPublished() && !value.isVersioned()) { // The referenced document is no more used
512 List<Document> using = new ArrayList<Document>();
513 List<File> files = new ArrayList<File>();
514 files.add(value.getFile()); // To delete the source file physically at the end
515 for (Relation link : value.getAllRelations()) {
516 if (link.getClass().equals(ConvertsRelation.class)) { // File conversion
517 files.add((File) link.getTo());
518 } else if (link.getClass().equals(UsesRelation.class)) { // Document dependency
519 using.add((Document) link.getTo());
522 // Remove relations from depending documents
523 if (LOG.isDebugEnabled()) {
524 LOG.debug("Remove " + using.size() + " UsedByRelation(s).");
526 for (Document doc : using) {
527 if (LOG.isDebugEnabled()) {
528 LOG.debug("Remove UsedByRelation from "
529 + doc.getTitle() + " to " + value.getTitle());
530 LOG.debug("Nb relations of doc " + doc.getTitle()
531 + " before: " + doc.getAllRelations().size());
533 doc.removeRelation(UsedByRelation.class, value);
534 if (LOG.isDebugEnabled()) {
535 LOG.debug("Nb relations of doc " + doc.getTitle()
536 + " after: " + doc.getAllRelations().size());
538 getDocumentDAO().merge(doc);
540 // Synchronize deleted objects with the database to avoid hibernate exception
541 // org.hibernate.PropertyValueException: not-null property references a null or transient value
542 getDocumentDAO().flush();
543 // The corresponding physical file is not removed from the vault
544 getDocumentDAO().delete(getDocumentDAO().merge(torem.value()));
545 // Delete document's files
546 // Delete files from file system
547 for (File file : files) {
548 // getFileDAO().delete(getFileDAO().merge(file)); // The corresponding physical file is not removed from the vault
549 LOG.info("Delete the file "
550 + file.asFile().getAbsolutePath());
551 if (file.asFile().delete()) {
552 LOG.info("File " + file.asFile().getAbsolutePath()
553 + " successfully deleted.");
555 LOG.info("File " + file.asFile().getAbsolutePath()
556 + " can not be deleted.");
567 * @see org.splat.service.StepService#addComment(org.splat.som.Step, org.splat.dal.bo.som.CommentAttribute)
571 public void addStepComment(final StepCommentDTO comment)
572 throws InvalidParameterException {
574 if (comment.getId() != null) {
575 throw new InvalidParameterException("id", String.valueOf(comment
578 User user = getUserDAO().get(comment.getUserId());
580 throw new InvalidParameterException("userId", String
581 .valueOf(comment.getUserId()));
583 ProjectElement projectElement = getProjectElementDAO().get(
584 comment.getProjectElementId());
585 if (projectElement == null) {
586 throw new InvalidParameterException("projectElementId", comment
587 .getProjectElementId().toString());
589 if (comment.getStep() == null || comment.getStep() < 0) {
590 throw new InvalidParameterException("step", String.valueOf(comment
593 if (comment.getDate() == null) {
594 throw new InvalidParameterException("date", String.valueOf(comment
597 if (comment.getTitle() == null) {
598 throw new InvalidParameterException("title", String.valueOf(comment
602 StepCommentAttribute newComment = new StepCommentAttribute(
603 projectElement, comment.getText(), comment.getDate(), comment
604 .getStep(), user, comment.getTitle());
606 Long resultKey = getStepCommentAttributeDAO().create(newComment);
607 comment.setId(resultKey);
613 * @see org.splat.service.StepService#getStepComments(org.splat.som.Step)
616 @Transactional(readOnly = true)
617 public List<StepCommentDTO> getStepComments(final Step step)
618 throws InvalidParameterException {
619 ProjectElement owner = _projectElementDAO.get(step.getOwner().getRid());
621 throw new InvalidParameterException("step owner id", Long.valueOf(
622 step.getOwner().getRid()).toString());
624 List<StepCommentAttribute> comments = _stepCommentAttributeDAO
625 .getFilteredList(Restrictions.and(Restrictions.eq("step",
626 Integer.valueOf(step.getNumber())), Restrictions.eq(
628 List<StepCommentDTO> commentDTOs = new ArrayList<StepCommentDTO>();
629 for (StepCommentAttribute comment : comments) {
630 StepCommentDTO stepCommentDTO = BeanHelper.copyBean(comment,
631 StepCommentDTO.class);
632 stepCommentDTO.setText(comment.getValue());
633 stepCommentDTO.setId(Long.valueOf(comment.getRid()));
634 commentDTOs.add(stepCommentDTO);
642 * @see org.splat.service.StepService#removeStepComment(long)
646 public void removeStepComment(final long commentId)
647 throws InvalidParameterException {
648 StepCommentAttribute stepComment = _stepCommentAttributeDAO.get(Long
649 .valueOf(commentId));
650 if (stepComment == null) {
651 throw new InvalidParameterException("commentId", String
652 .valueOf(commentId));
654 _stepCommentAttributeDAO.delete(stepComment);
660 * @see org.splat.service.StepService#editStepComment(long, java.lang.String, java.lang.String)
664 public void editStepComment(final long commentId, final String newValue,
665 final String newTitle) throws InvalidParameterException {
666 StepCommentAttribute comment = _stepCommentAttributeDAO.get(Long
667 .valueOf(commentId));
668 if (comment == null) {
669 throw new InvalidParameterException("commentId", String
670 .valueOf(commentId));
672 if (newTitle != null) {
673 comment.setTitle(newTitle);
675 if (newValue != null) {
676 comment.setValue(newValue);
678 _stepCommentAttributeDAO.update(comment);
684 * @see org.splat.service.StepService#isCommentMadeByUser(long, long)
687 @Transactional(readOnly = true)
688 public boolean isCommentMadeByUser(final long commentId, final long userId)
689 throws InvalidParameterException {
690 StepCommentAttribute comment = _stepCommentAttributeDAO.get(Long
691 .valueOf(commentId));
692 if (comment == null) {
693 throw new InvalidParameterException("commentId", String
694 .valueOf(commentId));
696 return comment.getUser().getIndex() == userId;
700 * Get the documentService.
702 * @return the documentService
704 public DocumentService getDocumentService() {
705 return _documentService;
709 * Set the documentService.
711 * @param documentService
712 * the documentService to set
714 public void setDocumentService(final DocumentService documentService) {
715 _documentService = documentService;
719 * Get the simulationContextService.
721 * @return the simulationContextService
723 public SimulationContextService getSimulationContextService() {
724 return _simulationContextService;
728 * Set the simulationContextService.
730 * @param simulationContextService
731 * the simulationContextService to set
733 public void setSimulationContextService(
734 final SimulationContextService simulationContextService) {
735 _simulationContextService = simulationContextService;
739 * Get the documentDAO.
741 * @return the documentDAO
743 public DocumentDAO getDocumentDAO() {
748 * Set the documentDAO.
751 * the documentDAO to set
753 public void setDocumentDAO(final DocumentDAO documentDAO) {
754 _documentDAO = documentDAO;
758 * Get the simulationContextDAO.
760 * @return the simulationContextDAO
762 public SimulationContextDAO getSimulationContextDAO() {
763 return _simulationContextDAO;
767 * Set the simulationContextDAO.
769 * @param simulationContextDAO
770 * the simulationContextDAO to set
772 public void setSimulationContextDAO(
773 final SimulationContextDAO simulationContextDAO) {
774 _simulationContextDAO = simulationContextDAO;
778 * Get the projectElementDAO.
780 * @return the projectElementDAO
782 public ProjectElementDAO getProjectElementDAO() {
783 return _projectElementDAO;
787 * Set the projectElementDAO.
789 * @param projectElementDAO
790 * the projectElementDAO to set
792 public void setProjectElementDAO(final ProjectElementDAO projectElementDAO) {
793 _projectElementDAO = projectElementDAO;
797 * Get the indexService.
799 * @return the indexService
801 public IndexService getIndexService() {
802 return _indexService;
806 * Set the indexService.
808 * @param indexService
809 * the indexService to set
811 public void setIndexService(final IndexService indexService) {
812 _indexService = indexService;
818 * @return the fileDAO
820 public FileDAO getFileDAO() {
830 public void setFileDAO(final FileDAO fileDAO) {
835 * Get the documentTypeService.
837 * @return the documentTypeService
839 public DocumentTypeService getDocumentTypeService() {
840 return _documentTypeService;
844 * Set the documentTypeService.
846 * @param documentTypeService
847 * the documentTypeService to set
849 public void setDocumentTypeService(
850 final DocumentTypeService documentTypeService) {
851 _documentTypeService = documentTypeService;
855 * Get the versionsRelationDAO.
857 * @return the versionsRelationDAO
859 public VersionsRelationDAO getVersionsRelationDAO() {
860 return _versionsRelationDAO;
864 * Set the versionsRelationDAO.
866 * @param versionsRelationDAO
867 * the versionsRelationDAO to set
869 public void setVersionsRelationDAO(
870 final VersionsRelationDAO versionsRelationDAO) {
871 _versionsRelationDAO = versionsRelationDAO;
875 * Get project settings.
877 * @return Project settings service
879 private ProjectSettingsService getProjectSettings() {
880 return _projectSettings;
884 * Set project settings service.
886 * @param projectSettingsService
887 * project settings service
889 public void setProjectSettings(
890 final ProjectSettingsService projectSettingsService) {
891 _projectSettings = projectSettingsService;
895 * Get the stepCommentAttributeDAO.
897 * @return the stepCommentAttributeDAO
899 public StepCommentAttributeDAO getStepCommentAttributeDAO() {
900 return _stepCommentAttributeDAO;
904 * Set the stepCommentAttributeDAO.
906 * @param commentAttributeDAO
907 * the stepCommentAttributeDAO to set
909 public void setStepCommentAttributeDAO(
910 final StepCommentAttributeDAO commentAttributeDAO) {
911 _stepCommentAttributeDAO = commentAttributeDAO;
917 * @return the userDAO
919 public UserDAO getUserDAO() {
929 public void setUserDAO(final UserDAO userDAO) {
934 * Get the publicationDAO.
936 * @return the publicationDAO
938 public PublicationDAO getPublicationDAO() {
939 return _publicationDAO;
943 * Set the publicationDAO.
945 * @param publicationDAO
946 * the publicationDAO to set
948 public void setPublicationDAO(final PublicationDAO publicationDAO) {
949 this._publicationDAO = publicationDAO;
953 * Get the relationDAO.
955 * @return the relationDAO
957 public RelationDAO getRelationDAO() {
962 * Set the relationDAO.
965 * the relationDAO to set
967 public void setRelationDAO(final RelationDAO relationDAO) {
968 _relationDAO = relationDAO;