1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service;
12 import java.util.List;
14 import org.splat.dal.bo.som.DocumentType;
15 import org.splat.service.technical.ProjectSettingsService;
21 public class DocumentTypeServiceImpl implements DocumentTypeService {
23 private ProjectSettingsService _projectSettingsService;
26 * Checks if documents of this type are result of a study.
27 * A document is the result of a study when it is the result of the last step of the study.
29 * @return true if documents of this type are result of a study.
30 * @see #isStepResult()
31 * @see #isResultOf(org.splat.service.technical.ProjectSettingsServiceImpl.Step)
33 public boolean isStudyResult (DocumentType aType) {
34 // -------------------------------
35 List<ProjectSettingsService.Step> step = getProjectSettings().getAllSteps();
36 ProjectSettingsService.Step lastep = step.get( step.size()-1 );
37 return (aType.isResultOf(lastep));
43 public ProjectSettingsService getProjectSettings() {
44 return _projectSettingsService;
47 public void setProjectSettings(
48 ProjectSettingsService projectSettingsService) {
49 _projectSettingsService = projectSettingsService;