Class DataService

  • All Implemented Interfaces:
    IDataService

    @Service
    public class DataService
    extends java.lang.Object
    implements IDataService
    • Field Detail

      • publisher

        @Autowired
        protected org.springframework.context.ApplicationEventPublisher publisher
      • taskService

        @Autowired
        protected ITaskService taskService
      • userService

        @Autowired
        protected IUserService userService
      • fieldFactory

        @Autowired
        protected FieldFactory fieldFactory
      • imageScale

        @Value("${nae.image.preview.scaling.px:400}")
        protected int imageScale
      • validationEnable

        @Value("${nae.validation.setData.enable:false}")
        protected boolean validationEnable
    • Constructor Detail

      • DataService

        public DataService()
    • Method Detail

      • setData

        public SetDataEventOutcome setData​(java.lang.String taskId,
                                           com.fasterxml.jackson.databind.node.ObjectNode values,
                                           java.util.Map<java.lang.String,​java.lang.String> params)
        Specified by:
        setData in interface IDataService
      • setData

        public SetDataEventOutcome setData​(Task task,
                                           com.fasterxml.jackson.databind.node.ObjectNode values,
                                           java.util.Map<java.lang.String,​java.lang.String> params)
        Specified by:
        setData in interface IDataService
      • setData

        public SetDataEventOutcome setData​(Task task,
                                           com.fasterxml.jackson.databind.node.ObjectNode values,
                                           java.util.Map<java.lang.String,​java.lang.String> params,
                                           boolean runStrict)
        Updates the data field's attributes of the provided task.
        Specified by:
        setData in interface IDataService
        Parameters:
        task - the task object of which the data are updated
        values - information about how to update the data fields
        params - additional information to be injected to the action delegate context
        runStrict - if set to true, additional validations are going to be applied when updating the data fields. If set to false, minimal restrictions are considered.
        Returns:
        outcome containing Case, Task and changes that have been made.
      • getFileByTask

        public FileFieldInputStream getFileByTask​(java.lang.String taskId,
                                                  java.lang.String fieldId,
                                                  boolean forPreview)
                                           throws java.io.FileNotFoundException
        Specified by:
        getFileByTask in interface IDataService
        Throws:
        java.io.FileNotFoundException
      • getFileByTaskAndName

        public FileFieldInputStream getFileByTaskAndName​(java.lang.String taskId,
                                                         java.lang.String fieldId,
                                                         java.lang.String name)
                                                  throws java.io.FileNotFoundException
        Specified by:
        getFileByTaskAndName in interface IDataService
        Throws:
        java.io.FileNotFoundException
      • getFileByTaskAndName

        public FileFieldInputStream getFileByTaskAndName​(java.lang.String taskId,
                                                         java.lang.String fieldId,
                                                         java.lang.String name,
                                                         java.util.Map<java.lang.String,​java.lang.String> params)
                                                  throws java.io.FileNotFoundException
        Specified by:
        getFileByTaskAndName in interface IDataService
        Throws:
        java.io.FileNotFoundException
      • getFileByCase

        public FileFieldInputStream getFileByCase​(java.lang.String caseId,
                                                  Task task,
                                                  java.lang.String fieldId,
                                                  boolean forPreview)
                                           throws java.io.FileNotFoundException
        Specified by:
        getFileByCase in interface IDataService
        Throws:
        java.io.FileNotFoundException
      • getFileByCaseAndName

        public FileFieldInputStream getFileByCaseAndName​(java.lang.String caseId,
                                                         java.lang.String fieldId,
                                                         java.lang.String name)
                                                  throws java.io.FileNotFoundException
        Specified by:
        getFileByCaseAndName in interface IDataService
        Throws:
        java.io.FileNotFoundException
      • getFileByCaseAndName

        public FileFieldInputStream getFileByCaseAndName​(java.lang.String caseId,
                                                         java.lang.String fieldId,
                                                         java.lang.String name,
                                                         java.util.Map<java.lang.String,​java.lang.String> params)
                                                  throws java.io.FileNotFoundException
        Specified by:
        getFileByCaseAndName in interface IDataService
        Throws:
        java.io.FileNotFoundException
      • getFileByName

        public FileFieldInputStream getFileByName​(Case useCase,
                                                  FileListField field,
                                                  java.lang.String name,
                                                  java.util.Map<java.lang.String,​java.lang.String> params)
                                           throws java.io.FileNotFoundException
        Specified by:
        getFileByName in interface IDataService
        Throws:
        java.io.FileNotFoundException
      • getFile

        public FileFieldInputStream getFile​(Case useCase,
                                            Task task,
                                            FileField field,
                                            boolean forPreview,
                                            java.util.Map<java.lang.String,​java.lang.String> params)
                                     throws java.io.FileNotFoundException
        Specified by:
        getFile in interface IDataService
        Throws:
        java.io.FileNotFoundException
      • saveFile

        public SetDataEventOutcome saveFile​(java.lang.String taskId,
                                            java.lang.String fieldId,
                                            org.springframework.web.multipart.MultipartFile multipartFile)
        Specified by:
        saveFile in interface IDataService
      • saveFile

        public SetDataEventOutcome saveFile​(java.lang.String taskId,
                                            java.lang.String fieldId,
                                            org.springframework.web.multipart.MultipartFile multipartFile,
                                            java.util.Map<java.lang.String,​java.lang.String> params)
        Specified by:
        saveFile in interface IDataService
      • saveFiles

        public SetDataEventOutcome saveFiles​(java.lang.String taskId,
                                             java.lang.String fieldId,
                                             org.springframework.web.multipart.MultipartFile[] multipartFiles)
        Specified by:
        saveFiles in interface IDataService
      • saveFiles

        public SetDataEventOutcome saveFiles​(java.lang.String taskId,
                                             java.lang.String fieldId,
                                             org.springframework.web.multipart.MultipartFile[] multipartFiles,
                                             java.util.Map<java.lang.String,​java.lang.String> params)
        Specified by:
        saveFiles in interface IDataService
      • deleteFile

        public SetDataEventOutcome deleteFile​(java.lang.String taskId,
                                              java.lang.String fieldId,
                                              java.util.Map<java.lang.String,​java.lang.String> params)
        Specified by:
        deleteFile in interface IDataService
      • deleteFileByName

        public SetDataEventOutcome deleteFileByName​(java.lang.String taskId,
                                                    java.lang.String fieldId,
                                                    java.lang.String name,
                                                    java.util.Map<java.lang.String,​java.lang.String> params)
        Specified by:
        deleteFileByName in interface IDataService
      • setImmediateFields

        public org.springframework.data.domain.Page<Task> setImmediateFields​(org.springframework.data.domain.Page<Task> tasks)
        Specified by:
        setImmediateFields in interface IDataService
      • validateCaseRefValue

        public void validateCaseRefValue​(java.util.List<java.lang.String> value,
                                         java.util.List<java.lang.String> allowedNets)
                                  throws java.lang.IllegalArgumentException
        Specified by:
        validateCaseRefValue in interface IDataService
        Throws:
        java.lang.IllegalArgumentException