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.Calendar;
15 import java.util.Date;
16 import java.util.HashMap;
17 import java.util.Iterator;
18 import java.util.List;
22 import org.splat.common.properties.MessageKeyEnum;
23 import org.splat.dal.bo.kernel.Relation;
24 import org.splat.dal.bo.kernel.User;
25 import org.splat.dal.bo.som.ConvertsRelation;
26 import org.splat.dal.bo.som.Document;
27 import org.splat.dal.bo.som.DocumentType;
28 import org.splat.dal.bo.som.File;
29 import org.splat.dal.bo.som.KnowledgeElement;
30 import org.splat.dal.bo.som.KnowledgeElementType;
31 import org.splat.dal.bo.som.ProgressState;
32 import org.splat.dal.bo.som.Publication;
33 import org.splat.dal.bo.som.Scenario;
34 import org.splat.dal.bo.som.SimulationContext;
35 import org.splat.dal.bo.som.Study;
36 import org.splat.dal.bo.som.UsedByRelation;
37 import org.splat.dal.bo.som.UsesRelation;
38 import org.splat.dal.dao.kernel.UserDAO;
39 import org.splat.dal.dao.som.KnowledgeElementDAO;
40 import org.splat.dal.dao.som.KnowledgeElementTypeDAO;
41 import org.splat.dal.dao.som.ScenarioDAO;
42 import org.splat.dal.dao.som.StudyDAO;
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.DocumentDTO;
50 import org.splat.service.dto.FileDTO;
51 import org.splat.service.dto.StepDTO;
52 import org.splat.service.technical.IndexService;
53 import org.splat.service.technical.ProjectSettingsService;
54 import org.splat.som.Step;
55 import org.splat.util.BeanHelper;
56 import org.springframework.transaction.annotation.Transactional;
59 * Scenario service implementation.
61 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
63 public class ScenarioServiceImpl implements ScenarioService {
66 * The logger for the service.
68 public final static AppLogger LOG = AppLogger
69 .getLogger(ScenarioServiceImpl.class);
72 * Injected index service.
74 private IndexService _indexService;
76 * Injected step service.
78 private StepService _stepService;
80 * Injected study service.
82 private StudyService _studyService;
84 * Injected publication service.
86 private PublicationService _publicationService;
88 * Injected project element service.
90 private ProjectElementService _projectElementService;
92 * Injected knowledge element DAO.
94 private KnowledgeElementDAO _knowledgeElementDAO;
96 * Injected scenario DAO.
98 private ScenarioDAO _scenarioDAO;
101 * Injected study DAO.
103 private StudyDAO _studyDAO;
106 * Injected knowledge element service.
108 private KnowledgeElementTypeService _knowledgeElementTypeService;
111 * Injected user service.
113 private UserService _userService;
118 private UserDAO _userDAO;
121 * Injected knowledge element type DAO.
123 private KnowledgeElementTypeDAO _knowledgeElementTypeDAO;
126 * Injected simulation context service.
128 private SimulationContextService _simulationContextService;
131 * Injected project service.
133 private ProjectSettingsService _projectSettings;
136 * Injected document type service.
138 private DocumentTypeService _documentTypeService;
141 * Get the projectElementService.
143 * @return the projectElementService
145 public ProjectElementService getProjectElementService() {
146 return _projectElementService;
150 * Set the projectElementService.
152 * @param projectElementService
153 * the projectElementService to set
155 public void setProjectElementService(
156 final ProjectElementService projectElementService) {
157 _projectElementService = projectElementService;
161 * Get the publicationService.
163 * @return the publicationService
165 public PublicationService getPublicationService() {
166 return _publicationService;
170 * Set the publicationService.
172 * @param publicationService
173 * the publicationService to set
175 public void setPublicationService(
176 final PublicationService publicationService) {
177 _publicationService = publicationService;
181 * Get the stepService.
183 * @return the stepService
185 public StepService getStepService() {
190 * Set the stepService.
193 * the stepService to set
195 public void setStepService(final StepService stepService) {
196 _stepService = stepService;
202 * @see org.splat.service.ScenarioService#getScenarioInfo(long)
204 @Transactional(readOnly = true)
205 public List<StepDTO> getScenarioInfo(final long scenarioId) {
206 List<StepDTO> res = new ArrayList<StepDTO>();
207 // Get the scenario from the database by id
208 Scenario scen = getScenarioDAO().get(scenarioId);
209 if (LOG.isDebugEnabled()) {
210 LOG.debug("Scenario[" + scenarioId + "]: Number of publications: "
211 + scen.getDocums().size());
213 // Get activities of the scenario
214 Step[] steps = getProjectElementService().getSteps(scen);
217 String docType, fileFormat;
220 // For each activity create a step DTO and add it to the result list
221 for (Step step : steps) {
222 stepDTO = BeanHelper.copyBean(step.getStep(), StepDTO.class);
224 if (LOG.isDebugEnabled()) {
225 LOG.debug("Step[" + stepDTO.getNumber()
226 + "]: Number of documents: "
227 + step.getDocuments().size());
229 // For each publication of the activity create a document DTO.
230 // Each file is considered as a source file.
231 for (Publication tag : step.getDocuments()) {
232 docDTO = stepDTO.addDoc(tag.value().getIndex(), tag.value()
234 char aState = tag.getIsnew();
235 docType = tag.value().getType().getName();
236 // For each file of the document create a file DTO
237 // Process source file of the document
238 fileFormat = tag.value().getFile().getFormat();
239 doImport = getProjectSettings().doImport(docType, fileFormat);
240 if (doImport && (!tag.isOutdated())) {
241 processing = "file-import";
243 processing = "file-download";
245 docDTO.addFile(tag.value().getFile().getRelativePath(), aState,
247 // Process all exported files
248 for (Relation rel : tag.value().getRelations(
249 ConvertsRelation.class)) {
250 File aFile = ((ConvertsRelation) rel).getTo();
251 fileFormat = aFile.getFormat();
252 doImport = getProjectSettings().doImport(docType,
254 if (doImport && (!tag.isOutdated())) {
255 processing = "file-import";
257 processing = "file-download";
259 docDTO.addFile(aFile.getRelativePath(), aState, processing,
268 * Create a new study with one scenario and "product" simulation context.
271 * the study properties
273 * the scenario properties
275 * the "product" simulation context properties
276 * @return the created study
277 * @throws MissedPropertyException
278 * if a mandatory property is missed
279 * @throws InvalidPropertyException
280 * if a property is invalid
281 * @throws MultiplyDefinedException
282 * if some property occurs several times
285 public Study createStudy(final Study.Properties sprop,
286 final Scenario.Properties oprop,
287 final SimulationContext.Properties cprop)
288 throws MissedPropertyException, InvalidPropertyException,
289 MultiplyDefinedException {
290 Study study = getStudyService().createStudy(sprop);
291 addScenario(study, oprop);
292 if (cprop.getIndex() == 0) { // Input of new project context
293 cprop.setType(getSimulationContextService().selectType("product"))
294 .setValue(cprop.getValue());
295 getStudyService().addProjectContext(study, cprop);
296 } else { // Selection of existing project context
297 SimulationContext context = getSimulationContextService()
298 .selectSimulationContext(cprop.getIndex());
299 getStudyService().addProjectContext(study, context);
307 * @see org.splat.service.ScenarioService#addKnowledgeElement(org.splat.dal.bo.som.Scenario,
308 * org.splat.dal.bo.som.KnowledgeElement.Properties)
311 public KnowledgeElement addKnowledgeElement(final Scenario aScenarioDTO,
312 final KnowledgeElement.Properties kprop)
313 throws MissedPropertyException, InvalidPropertyException,
314 MultiplyDefinedException {
315 KnowledgeElement kelm = null;
317 long aScenarioId = aScenarioDTO.getIndex();
318 if (LOG.isDebugEnabled()) {
319 LOG.debug("Add a knowledge element to the scenario #"
322 // Get the persistent scenario.
323 Scenario aScenario = getScenarioDAO().get(aScenarioId);
324 // Get persistent objects for creating a new knowledge.
325 // TODO: Actions must use DTO instead of persistent objects.
326 getUserDAO().merge(kprop.getAuthor());
327 getKnowledgeElementTypeDAO().merge(kprop.getType());
328 // Create a transient knowledge element related to the given scenario.
329 kelm = new KnowledgeElement(kprop.setOwnerScenario(aScenario));
330 // Save the new knowledge in the database.
331 getKnowledgeElementDAO().create(kelm);
332 // Update scenario transient data.
333 if (kelm.getType().equals("usecase")) {
334 aScenarioDTO.setUcase(kelm);
335 } else if (aScenarioDTO.getKnowledgeElementsList() != null) { // If null, knowl will be initialized when needed
336 aScenarioDTO.getKnowledgeElementsList().add(kelm);
339 // Load the workflow for the parent study to take into account
340 // all study actors durng reindexing.
341 getStudyService().loadWorkflow(aScenario.getOwnerStudy());
343 // Update the lucene index of knowledge elements.
344 getIndexService().add(kelm);
345 if (LOG.isDebugEnabled()) {
346 LOG.debug("A knowledge element #" + kelm.getIndex()
347 + " is added to the scenario #" + aScenario.getIndex());
349 } catch (IOException error) {
350 LOG.error("Unable to index the knowedge element '"
351 + kelm.getIndex() + "', reason:", error);
359 * Update the scenario in the database.
362 * the scenario to update
363 * @return true if updating succeeded
366 private boolean update(final Scenario aScenario) {
367 boolean isOk = false;
369 getScenarioDAO().update(aScenario); // Update of relational base
371 } catch (Exception error) {
372 LOG.error("Unable to re-index the knowledge element '"
373 + aScenario.getIndex() + "', reason:", error);
381 * @see org.splat.service.ScenarioService#checkin(long, long, java.util.List)
384 public void checkin(final long scenId, final long userId,
385 final List<StepDTO> scInfo) throws InvalidPropertyException,
386 MissedPropertyException, MultiplyDefinedException,
387 MismatchException, IOException, NotApplicableException {
388 // Get the scenario from the database by id
389 Scenario aScenario = getScenarioDAO().get(scenId);
390 // Get the user who perform this check-in operation
391 User aUser = getUserService().selectUser(userId);
392 // Get activities of the scenario
393 Step[] steps = getProjectElementService().getSteps(aScenario);
394 // Find result document types
395 List<DocumentType> resTypes = getDocumentTypeService()
396 .selectResultTypes();
398 // For each processed existing document keep its new version
399 Map<Document, Document> newVersion = new HashMap<Document, Document>();
400 // Keep newly created documents to create uses relations to results of a previous step.
401 List<Publication> newVers = new ArrayList<Publication>();
402 List<Publication> newDocs = new ArrayList<Publication>();
404 DocumentType resType;
406 Document.Properties dprop = new Document.Properties();
407 Date aDate = new Date();
408 for (StepDTO stepDTO : scInfo) {
409 if (LOG.isDebugEnabled()) {
410 LOG.debug("Checkin the step:\n" + stepDTO);
412 // Find a result document type of the step
416 if (resTypes.get(i).isResultOf(
417 getProjectSettings().getStep(stepDTO.getNumber()))) {
418 resType = resTypes.get(i);
421 } while ((resType == null) && (i < resTypes.size()));
423 // Find the appropriate scenario step
424 Step step = findStep(stepDTO, steps);
426 // Process documents of the step
427 for (DocumentDTO doc : stepDTO.getDocs()) {
428 if (doc.getFiles().size() > 0) {
429 // NOTE: Process only the first attached file for each document
430 FileDTO file = doc.getFiles().get(0);
432 // Get document title as the file name
433 java.io.File upfile = new java.io.File(file.getPath());
434 String fileFormat = upfile.getName().substring(
435 upfile.getName().lastIndexOf('.') + 1);
436 String docname = upfile.getName().substring(0,
437 upfile.getName().lastIndexOf('.'));
439 // Create a new document or a new version of the document
441 dprop.setAuthor(aUser).setDate(aDate);
442 Publication pub, newPub;
444 if (doc.getId() > 0) {
445 // If the document already exists then create a new version of it
446 // Find the document publication
447 pub = step.getDocument(doc.getId());
449 throw new InvalidPropertyException(
450 MessageKeyEnum.SCN_000002.toString(), doc
453 if (pub.value() == null) {
454 throw new MismatchException(
455 MessageKeyEnum.SCN_000002.toString(), doc
458 newPub = getStepService().versionDocument(step, pub,
460 // Remeber the link from the old document to the new document version
461 newVersion.put(pub.value(), newPub.value());
462 // Remember the new version publication
466 // Otherwise create a new document of the result type
467 // If result type is not found try to get type by file extension
468 if (resType == null) {
469 dprop.setType(getProjectSettings()
470 .getDefaultDocumentType(step.getStep(),
473 dprop.setType(resType);
475 dprop.setDescription("Checked in").setName(docname)
476 .setFormat(fileFormat);
477 newPub = getStepService().createDocument(step, dprop);
479 // Remeber the new document
483 // Attach the file to the created document
484 updir = newPub.getSourceFile().asFile();
485 if (LOG.isDebugEnabled()) {
486 LOG.debug("Moving \"" + upfile.getName() + "\" to \""
487 + updir.getPath() + "\".");
489 if (updir.exists()) {
490 if (updir.delete()) {
491 LOG.info(MessageKeyEnum.SCN_000003.toString(),
492 updir.getAbsoluteFile(), scenId);
494 throw new IOException(
495 "Can't delete the existing destination file to move file from "
496 + file.getPath() + " to "
497 + updir.getAbsolutePath());
500 if (upfile.renameTo(updir)) {
501 // Save the new publication in the scenario.
502 // The old publication is removed from the scenario here.
503 getPublicationService().saveAs(newPub,
504 ProgressState.inWORK); // May throw FileNotFound if rename was not done
506 throw new IOException("Can't move file from "
507 + file.getPath() + " to "
508 + updir.getAbsolutePath());
514 // Set uses/used relations
516 // For each new version copy uses relations from the previous version.
517 for (Publication newVer : newVers) {
518 // For each Uses relation of the previous version
519 Document prevDoc = newVer.value().getPreviousVersion();// prevVersion.get(newVer);
520 if (LOG.isDebugEnabled()) {
521 LOG.debug("Previous version for publication #"
522 + newVer.getIndex() + " is found: " + prevDoc);
524 List<Relation> usesRelations = prevDoc
525 .getRelations(UsesRelation.class);
526 for (Relation rel : usesRelations) {
527 // If used document has been also versioned then refer to its new version.
528 Document usedDoc = ((UsesRelation) rel).getTo();
529 if (newVersion.containsKey(usedDoc)) {
530 usedDoc = newVersion.get(usedDoc);
532 // Build the appropriate relation for the new version.
533 newVer.addDependency(usedDoc);
535 // Outdate documents which depend from the previous version and
536 // were not checked in during this operation.
537 // 1. Get all usedBy relations of the previous document version
538 for (Relation rel : prevDoc.getRelations(UsedByRelation.class)) {
539 Document using = ((UsedByRelation) rel).getTo();
540 // Check that not checked in dependent documents became outdated
541 Publication usingPub = aScenario.getPublication(using);
542 if (usingPub != null) { // if the document using the old version is still published
543 usingPub.setIsnew('O');
548 // For each new document create uses relation to the last versions of
549 // results of the previous step.
550 for (Publication newPub : newDocs) {
551 // Find used document type according to the configuration.
552 Set<DocumentType> usedTypes = newPub.value().getType()
554 // Find documents of used type in the previous study step.
555 for (Publication pub : aScenario.getDocums()) {
556 if ((pub.getStep().getNumber() <= newPub.getStep().getNumber())
557 && (!pub.isOutdated())
558 && usedTypes.contains(pub.value().getType())) {
559 // Create uses relation from the new document
560 // to the found document in the previous step.
561 newPub.addDependency(pub);
566 // Mark the scenario as checked in
571 * Find appropriate step in the array of scenario steps according to the given step DTO.
577 * @return appropriate scenario step
578 * @throws InvalidPropertyException
579 * if appropriate step is not found
581 private Step findStep(final StepDTO stepDTO, final Step[] steps)
582 throws InvalidPropertyException {
586 if (steps[i].getNumber() == stepDTO.getNumber()) {
590 } while ((step == null) && (i < steps.length));
593 throw new InvalidPropertyException(MessageKeyEnum.SCN_000001
594 .toString(), stepDTO.getNumber());
602 * @see org.splat.service.ScenarioService#checkin(org.splat.dal.bo.som.Scenario)
604 public void checkin(final Scenario aScenario) {
605 aScenario.setUser(null);
606 aScenario.setLastModificationDate(Calendar.getInstance().getTime());
607 getScenarioDAO().update(aScenario);
613 * @see org.splat.service.ScenarioService#checkout(org.splat.dal.bo.som.Scenario, org.splat.dal.bo.kernel.User)
615 public boolean checkout(final Scenario aScenario, final User user) {
616 boolean res = getStudyService().isStaffedBy(aScenario.getOwnerStudy(),
619 aScenario.setUser(user);
620 aScenario.setLastModificationDate(Calendar.getInstance().getTime());
621 getScenarioDAO().update(aScenario);
629 * @see org.splat.service.ScenarioService#copyContentsUpTo(org.splat.dal.bo.som.Scenario, org.splat.som.Step)
631 public void copyContentsUpTo(final Scenario scenario, final Step lastep) {
632 Scenario base = (Scenario) lastep.getOwner();
633 Step[] from = getProjectElementService().getSteps(base);
634 Step[] to = getProjectElementService().getSteps(scenario);
635 for (int i = 0; i < from.length; i++) {
637 if (step.getNumber() > lastep.getNumber()) {
641 List<Publication> docs = step.getAllDocuments();
642 for (Iterator<Publication> j = docs.iterator(); j.hasNext();) {
643 Publication doc = getPublicationService().copy(j.next(),
644 scenario); // Creation of a new reference to the document
645 // Database.getSession().save(doc); Publications MUST be saved later through cascading when saving the scenario
646 getStepService().add(to[i], doc);
648 List<SimulationContext> ctex = step.getAllSimulationContexts();
649 for (Iterator<SimulationContext> j = ctex.iterator(); j.hasNext();) {
650 getStepService().addSimulationContext(to[i], j.next());
658 * @see org.splat.service.ScenarioService#isEmpty(org.splat.dal.bo.som.Scenario)
660 public boolean isEmpty(final Scenario scenario) {
661 Step[] mystep = getProjectElementService().getSteps(scenario);
662 boolean isEmp = true;
663 for (int i = 0; i < mystep.length; i++) {
664 if (mystep[i].isStarted()) {
676 public boolean isFinished(final Scenario scenario) {
677 Step[] mystep = getProjectElementService().getSteps(scenario);
678 boolean notempty = false; // If this is empty, this is not finished
679 for (int i = 0; i < mystep.length; i++) {
680 if (!mystep[i].isStarted()) {
683 if (!mystep[i].isFinished()) {
694 * @see org.splat.service.StudyService#addScenario(org.splat.dal.bo.som.Study, org.splat.dal.bo.som.Scenario.Properties)
697 public Scenario addScenario(final Study aStudy,
698 final Scenario.Properties sprop) throws MissedPropertyException,
699 InvalidPropertyException, MultiplyDefinedException {
700 if (sprop.getManager() == null) {
701 sprop.setManager(aStudy.getAuthor());
704 Scenario scenario = new Scenario(sprop.setOwnerStudy(aStudy));
705 if (sprop.getBaseStep() != null) {
706 copyContentsUpTo(scenario, sprop.getBaseStep());
708 Scenario previous = sprop.getInsertAfter();
710 if (previous == null) {
711 aStudy.getScenariiList().add(scenario);
713 aStudy.getScenariiList().add(
714 aStudy.getScenariiList().indexOf(previous) + 1, scenario);
716 getStudyDAO().update(aStudy); // No need to update the Lucene index
717 getScenarioDAO().create(scenario); // Must be done after updating this study because of the back reference to the study
718 if (sprop.getBaseStep() != null) {
719 // No need to update the Knowledge Element index as Knowledge Elements are not copied
720 getProjectElementService().refresh(scenario); // Because saving the scenario changes the hashcode of copied Publications
722 KnowledgeElementType ucase = getKnowledgeElementTypeService()
723 .selectType("usecase");
724 KnowledgeElement.Properties kprop = new KnowledgeElement.Properties();
725 User admin = getUserService().selectUser(1); // First user created when creating the database
726 kprop.setType(ucase).setTitle(aStudy.getTitle()).setValue(
727 scenario.getTitle()).setAuthor(admin); // Internal Knowledge Element required by the validation process of
729 addKnowledgeElement(scenario, kprop);
734 * Remove a knowledge element from a scenario.
739 * the knowledge element to remove
740 * @return true if removal succeeded
742 public boolean removeKnowledgeElement(final Scenario scenario,
743 final KnowledgeElement kelm) {
744 KnowledgeElement torem = scenario.getKnowledgeElement(kelm.getIndex());
748 boolean done = scenario.getKnowledgeElements().remove(torem);
750 // Update of my transient data
751 // RKV: These transient data are not used indeed.
752 // RKV: List<KnowledgeElement> kelms = scenario.getKnowledgeByType().get(
753 // RKV: kelm.getType().getIndex());
754 // RKV: kelms.remove(torem);
755 if (scenario.getKnowledgeElementsList() != null) {
756 scenario.getKnowledgeElementsList().remove(torem);
758 getScenarioDAO().update(scenario);
759 // TODO: If the owner study is not private, remove the knowledge from the Lucene index
767 * Get the knowledgeElementDAO.
769 * @return the knowledgeElementDAO
771 public KnowledgeElementDAO getKnowledgeElementDAO() {
772 return _knowledgeElementDAO;
776 * Set the knowledgeElementDAO.
778 * @param knowledgeElementDAO
779 * the knowledgeElementDAO to set
781 public void setKnowledgeElementDAO(
782 final KnowledgeElementDAO knowledgeElementDAO) {
783 _knowledgeElementDAO = knowledgeElementDAO;
787 * Get the indexService.
789 * @return the indexService
791 public IndexService getIndexService() {
792 return _indexService;
796 * Set the indexService.
798 * @param indexService
799 * the indexService to set
801 public void setIndexService(final IndexService indexService) {
802 _indexService = indexService;
806 * Get the scenarioDAO.
808 * @return the scenarioDAO
810 public ScenarioDAO getScenarioDAO() {
815 * Set the scenarioDAO.
818 * the scenarioDAO to set
820 public void setScenarioDAO(final ScenarioDAO scenarioDAO) {
821 _scenarioDAO = scenarioDAO;
827 * @return the studyDAO
829 public StudyDAO getStudyDAO() {
837 * the studyDAO to set
839 public void setStudyDAO(final StudyDAO studyDAO) {
840 _studyDAO = studyDAO;
844 * Get the knowledgeElementTypeService.
846 * @return the knowledgeElementTypeService
848 public KnowledgeElementTypeService getKnowledgeElementTypeService() {
849 return _knowledgeElementTypeService;
853 * Set the knowledgeElementTypeService.
855 * @param knowledgeElementTypeService
856 * the knowledgeElementTypeService to set
858 public void setKnowledgeElementTypeService(
859 final KnowledgeElementTypeService knowledgeElementTypeService) {
860 _knowledgeElementTypeService = knowledgeElementTypeService;
864 * Get the studyService.
866 * @return the studyService
868 public StudyService getStudyService() {
869 return _studyService;
873 * Set the studyService.
875 * @param studyService
876 * the studyService to set
878 public void setStudyService(final StudyService studyService) {
879 _studyService = studyService;
883 * Get the userService.
885 * @return the userService
887 public UserService getUserService() {
892 * Set the userService.
895 * the userService to set
897 public void setUserService(final UserService userService) {
898 _userService = userService;
904 * @return the userDAO
906 public UserDAO getUserDAO() {
916 public void setUserDAO(final UserDAO userDAO) {
921 * Get the knowledgeElementTypeDAO.
923 * @return the knowledgeElementTypeDAO
925 public KnowledgeElementTypeDAO getKnowledgeElementTypeDAO() {
926 return _knowledgeElementTypeDAO;
930 * Set the knowledgeElementTypeDAO.
932 * @param knowledgeElementTypeDAO
933 * the knowledgeElementTypeDAO to set
935 public void setKnowledgeElementTypeDAO(
936 final KnowledgeElementTypeDAO knowledgeElementTypeDAO) {
937 _knowledgeElementTypeDAO = knowledgeElementTypeDAO;
941 * Get the simulationContextService.
943 * @return the simulationContextService
945 public SimulationContextService getSimulationContextService() {
946 return _simulationContextService;
950 * Set the simulationContextService.
952 * @param simulationContextService
953 * the simulationContextService to set
955 public void setSimulationContextService(
956 final SimulationContextService simulationContextService) {
957 _simulationContextService = simulationContextService;
961 * Get project settings.
963 * @return Project settings service
965 private ProjectSettingsService getProjectSettings() {
966 return _projectSettings;
970 * Set project settings service.
972 * @param projectSettingsService
973 * project settings service
975 public void setProjectSettings(
976 final ProjectSettingsService projectSettingsService) {
977 _projectSettings = projectSettingsService;
981 * Get the documentTypeService.
983 * @return the documentTypeService
985 public DocumentTypeService getDocumentTypeService() {
986 return _documentTypeService;
990 * Set the documentTypeService.
992 * @param documentTypeService
993 * the documentTypeService to set
995 public void setDocumentTypeService(
996 final DocumentTypeService documentTypeService) {
997 _documentTypeService = documentTypeService;