1 /*****************************************************************************
5 * Creation date 14.11.2012
8 * @copyright OPEN CASCADE 2012
9 *****************************************************************************/
11 package org.splat.service.dto;
13 import java.util.ArrayList;
14 import java.util.List;
17 * Document DTO. This is a container of document files.
19 public class DocumentDTO {
21 * Document persistent id.
27 private String _title;
29 * List of document files.
31 private final List<FileDTO> _files = new ArrayList<FileDTO>(); // RKV: NOPMD: Access to the collection via getter
34 * Constructor with initialization.
37 * the document persistent id
41 public DocumentDTO(final long index, final String title) {
47 * Default constructor.
49 public DocumentDTO() {
57 public List<FileDTO> getFiles() {
76 public void setId(final Long id) {
85 public String getTitle() {
95 public void setTitle(final String title) {
100 * Add a new file DTO.
102 * @param relativePath
107 * processing instruction: file-download or file-import
109 * true if the file is result
110 * @return the added file DTO
112 public FileDTO addFile(final String relativePath, final char state,
113 final String processing, final boolean isResult) {
114 FileDTO fileDTO = new FileDTO(relativePath, state, processing, isResult);
120 * Add a new file DTO.
121 * @param file the file to be added.
123 public void addFile(final FileDTO file) {
130 * @see java.lang.Object#toString()
133 public String toString() {
134 StringBuffer buf = new StringBuffer();
136 buf.append(indent).append("Document: ").append(getTitle()).append('\n')
137 .append(indent).append("Document ID: ").append(getId()).append(
139 for (FileDTO file : getFiles()) {
142 return buf.toString();