View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kew.api.document.search;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.joda.time.DateTime;
20  import org.joda.time.DateTimeZone;
21  import org.kuali.rice.core.api.CoreConstants;
22  import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
23  import org.kuali.rice.core.api.mo.ModelBuilder;
24  import org.kuali.rice.core.api.mo.ModelObjectUtils;
25  import org.kuali.rice.core.api.util.jaxb.DateTimeAdapter;
26  import org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter;
27  import org.kuali.rice.kew.api.document.DocumentStatus;
28  import org.kuali.rice.kew.api.document.DocumentStatusCategory;
29  import org.w3c.dom.Element;
30  
31  import javax.xml.bind.annotation.XmlAccessType;
32  import javax.xml.bind.annotation.XmlAccessorType;
33  import javax.xml.bind.annotation.XmlAnyElement;
34  import javax.xml.bind.annotation.XmlElement;
35  import javax.xml.bind.annotation.XmlElementWrapper;
36  import javax.xml.bind.annotation.XmlRootElement;
37  import javax.xml.bind.annotation.XmlType;
38  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
39  import java.io.Serializable;
40  import java.util.ArrayList;
41  import java.util.Collection;
42  import java.util.Collections;
43  import java.util.HashMap;
44  import java.util.List;
45  import java.util.Map;
46  
47  /**
48   * An immutable data transfer object implementation of the {@link DocumentSearchCriteriaContract}.  Instances of this
49   * class should be constructed using the nested {@link Builder} class.
50   *
51   * @author Kuali Rice Team (rice.collab@kuali.org)
52   */
53  @XmlRootElement(name = DocumentSearchCriteria.Constants.ROOT_ELEMENT_NAME)
54  @XmlAccessorType(XmlAccessType.NONE)
55  @XmlType(name = DocumentSearchCriteria.Constants.TYPE_NAME, propOrder = {
56      DocumentSearchCriteria.Elements.DOCUMENT_ID,
57      DocumentSearchCriteria.Elements.DOCUMENT_STATUSES,
58      DocumentSearchCriteria.Elements.DOCUMENT_STATUS_CATEGORIES,
59      DocumentSearchCriteria.Elements.TITLE,
60      DocumentSearchCriteria.Elements.APPLICATION_DOCUMENT_ID,
61      DocumentSearchCriteria.Elements.APPLICATION_DOCUMENT_STATUS,
62      DocumentSearchCriteria.Elements.INITIATOR_PRINCIPAL_NAME,
63      DocumentSearchCriteria.Elements.VIEWER_PRINCIPAL_NAME,
64      DocumentSearchCriteria.Elements.VIEWER_GROUP_ID,
65      DocumentSearchCriteria.Elements.APPROVER_PRINCIPAL_NAME,
66      DocumentSearchCriteria.Elements.ROUTE_NODE_NAME,
67      DocumentSearchCriteria.Elements.ROUTE_NODE_LOOKUP_LOGIC,
68      DocumentSearchCriteria.Elements.DOCUMENT_TYPE_NAME,
69      DocumentSearchCriteria.Elements.ADDITIONAL_DOCUMENT_TYPE_NAMES,
70      DocumentSearchCriteria.Elements.DATE_CREATED_FROM,
71      DocumentSearchCriteria.Elements.DATE_CREATED_TO,
72      DocumentSearchCriteria.Elements.DATE_LAST_MODIFIED_FROM,
73      DocumentSearchCriteria.Elements.DATE_LAST_MODIFIED_TO,
74      DocumentSearchCriteria.Elements.DATE_APPROVED_FROM,
75      DocumentSearchCriteria.Elements.DATE_APPROVED_TO,
76      DocumentSearchCriteria.Elements.DATE_FINALIZED_FROM,
77      DocumentSearchCriteria.Elements.DATE_FINALIZED_TO,
78      DocumentSearchCriteria.Elements.DATE_APPLICATION_DOCUMENT_STATUS_CHANGED_FROM,
79      DocumentSearchCriteria.Elements.DATE_APPLICATION_DOCUMENT_STATUS_CHANGED_TO,
80      DocumentSearchCriteria.Elements.DOCUMENT_ATTRIBUTE_VALUES,
81      DocumentSearchCriteria.Elements.SAVE_NAME,
82      DocumentSearchCriteria.Elements.START_AT_INDEX,
83      DocumentSearchCriteria.Elements.MAX_RESULTS,
84      CoreConstants.CommonElements.FUTURE_ELEMENTS
85  })
86  public final class DocumentSearchCriteria extends AbstractDataTransferObject implements DocumentSearchCriteriaContract {
87  
88      private static final long serialVersionUID = -221440103480740497L;
89      
90      @XmlElement(name = Elements.DOCUMENT_ID, required = false)
91      private final String documentId;
92  
93      @XmlElementWrapper(name = Elements.DOCUMENT_STATUSES, required = false)
94      @XmlElement(name = Elements.DOCUMENT_STATUS, required = false)
95      private final List<DocumentStatus> documentStatuses;
96  
97      @XmlElementWrapper(name = Elements.DOCUMENT_STATUS_CATEGORIES, required = false)
98      @XmlElement(name = Elements.DOCUMENT_STATUS_CATEGORY, required = false)
99      private final List<DocumentStatusCategory> documentStatusCategories;
100 
101     @XmlElement(name = Elements.TITLE, required = false)
102     private final String title;
103 
104     @XmlElement(name = Elements.APPLICATION_DOCUMENT_ID, required = false)
105     private final String applicationDocumentId;
106 
107     @XmlElement(name = Elements.APPLICATION_DOCUMENT_STATUS, required = false)
108     private final String applicationDocumentStatus;
109 
110     @XmlElement(name = Elements.INITIATOR_PRINCIPAL_NAME, required = false)
111     private final String initiatorPrincipalName;
112 
113     @XmlElement(name = Elements.VIEWER_PRINCIPAL_NAME, required = false)
114     private final String viewerPrincipalName;
115 
116     @XmlElement(name = Elements.VIEWER_GROUP_ID, required = false)
117     private final String viewerGroupId;
118 
119     @XmlElement(name = Elements.APPROVER_PRINCIPAL_NAME, required = false)
120     private final String approverPrincipalName;
121 
122     @XmlElement(name = Elements.ROUTE_NODE_NAME, required = false)
123     private final String routeNodeName;
124 
125     @XmlElement(name = Elements.ROUTE_NODE_LOOKUP_LOGIC, required = false)
126     private final RouteNodeLookupLogic routeNodeLookupLogic;
127 
128     @XmlElement(name = Elements.DOCUMENT_TYPE_NAME, required = false)
129     private final String documentTypeName;
130 
131     @XmlElementWrapper(name = Elements.ADDITIONAL_DOCUMENT_TYPE_NAMES, required = false)
132     @XmlElement(name = Elements.ADDITIONAL_DOCUMENT_TYPE_NAME, required = false)
133     private final List<String> additionalDocumentTypeNames;
134 
135 
136     @XmlElement(name = Elements.DATE_CREATED_FROM, required = false)
137     @XmlJavaTypeAdapter(DateTimeAdapter.class)
138     private final DateTime dateCreatedFrom;
139 
140     @XmlElement(name = Elements.DATE_CREATED_TO, required = false)
141     @XmlJavaTypeAdapter(DateTimeAdapter.class)
142     private final DateTime dateCreatedTo;
143 
144     @XmlElement(name = Elements.DATE_LAST_MODIFIED_FROM, required = false)
145     @XmlJavaTypeAdapter(DateTimeAdapter.class)
146     private final DateTime dateLastModifiedFrom;
147 
148     @XmlElement(name = Elements.DATE_LAST_MODIFIED_TO, required = false)
149     @XmlJavaTypeAdapter(DateTimeAdapter.class)
150     private final DateTime dateLastModifiedTo;
151 
152     @XmlElement(name = Elements.DATE_APPROVED_FROM, required = false)
153     @XmlJavaTypeAdapter(DateTimeAdapter.class)
154     private final DateTime dateApprovedFrom;
155 
156     @XmlElement(name = Elements.DATE_APPROVED_TO, required = false)
157     @XmlJavaTypeAdapter(DateTimeAdapter.class)
158     private final DateTime dateApprovedTo;
159 
160     @XmlElement(name = Elements.DATE_FINALIZED_FROM, required = false)
161     @XmlJavaTypeAdapter(DateTimeAdapter.class)
162     private final DateTime dateFinalizedFrom;
163 
164     @XmlElement(name = Elements.DATE_FINALIZED_TO, required = false)
165     @XmlJavaTypeAdapter(DateTimeAdapter.class)
166     private final DateTime dateFinalizedTo;
167 
168     @XmlElement(name = Elements.DATE_APPLICATION_DOCUMENT_STATUS_CHANGED_FROM, required = false)
169     @XmlJavaTypeAdapter(DateTimeAdapter.class)
170     private final DateTime dateApplicationDocumentStatusChangedFrom;
171 
172     @XmlElement(name = Elements.DATE_APPLICATION_DOCUMENT_STATUS_CHANGED_TO, required = false)
173     @XmlJavaTypeAdapter(DateTimeAdapter.class)
174     private final DateTime dateApplicationDocumentStatusChangedTo;
175 
176     @XmlElement(name = Elements.DOCUMENT_ATTRIBUTE_VALUES, required = false)
177     @XmlJavaTypeAdapter(MultiValuedStringMapAdapter.class)
178     private final Map<String, List<String>> documentAttributeValues;
179 
180     @XmlElement(name = Elements.SAVE_NAME, required = false)
181     private final String saveName;
182 
183     @XmlElement(name = Elements.START_AT_INDEX, required = false)
184     private final Integer startAtIndex;
185 
186     @XmlElement(name = Elements.MAX_RESULTS, required = false)
187     private final Integer maxResults;
188     
189     @SuppressWarnings("unused")
190     @XmlAnyElement
191     private final Collection<Element> _futureElements = null;
192 
193     /**
194      * Private constructor used only by JAXB.
195      */
196     private DocumentSearchCriteria() {
197         this.documentId = null;
198         this.documentStatuses = null;
199         this.documentStatusCategories = null;
200         this.title = null;
201         this.applicationDocumentId = null;
202         this.applicationDocumentStatus = null;
203         this.initiatorPrincipalName = null;
204         this.viewerPrincipalName = null;
205         this.viewerGroupId = null;
206         this.approverPrincipalName = null;
207         this.routeNodeName = null;
208         this.routeNodeLookupLogic = null;
209         this.documentTypeName = null;
210         this.additionalDocumentTypeNames = null;
211         this.dateCreatedFrom = null;
212         this.dateCreatedTo = null;
213         this.dateLastModifiedFrom = null;
214         this.dateLastModifiedTo = null;
215         this.dateApprovedFrom = null;
216         this.dateApprovedTo = null;
217         this.dateFinalizedFrom = null;
218         this.dateFinalizedTo = null;
219         this.dateApplicationDocumentStatusChangedFrom = null;
220         this.dateApplicationDocumentStatusChangedTo = null;
221         this.documentAttributeValues = null;
222         this.saveName = null;
223         this.startAtIndex = null;
224         this.maxResults = null;
225     }
226 
227     private DocumentSearchCriteria(Builder builder) {
228         this.documentId = builder.getDocumentId();
229         this.documentStatuses = ModelObjectUtils.createImmutableCopy(builder.getDocumentStatuses());
230         this.documentStatusCategories = ModelObjectUtils.createImmutableCopy(builder.getDocumentStatusCategories());
231         this.title = builder.getTitle();
232         this.applicationDocumentId = builder.getApplicationDocumentId();
233         this.applicationDocumentStatus = builder.getApplicationDocumentStatus();
234         this.initiatorPrincipalName = builder.getInitiatorPrincipalName();
235         this.viewerPrincipalName = builder.getViewerPrincipalName();
236         this.viewerGroupId = builder.getViewerGroupId();
237         this.approverPrincipalName = builder.getApproverPrincipalName();
238         this.routeNodeName = builder.getRouteNodeName();
239         this.routeNodeLookupLogic = builder.getRouteNodeLookupLogic();
240         this.documentTypeName = builder.getDocumentTypeName();
241         this.additionalDocumentTypeNames = ModelObjectUtils.createImmutableCopy(
242                 builder.getAdditionalDocumentTypeNames());
243         this.dateCreatedFrom = builder.getDateCreatedFrom();
244         this.dateCreatedTo = builder.getDateCreatedTo();
245         this.dateLastModifiedFrom = builder.getDateLastModifiedFrom();
246         this.dateLastModifiedTo = builder.getDateLastModifiedTo();
247         this.dateApprovedFrom = builder.getDateApprovedFrom();
248         this.dateApprovedTo = builder.getDateApprovedTo();
249         this.dateFinalizedFrom = builder.getDateFinalizedFrom();
250         this.dateFinalizedTo = builder.getDateFinalizedTo();
251         this.dateApplicationDocumentStatusChangedFrom = builder.getDateApplicationDocumentStatusChangedFrom();
252         this.dateApplicationDocumentStatusChangedTo = builder.getDateApplicationDocumentStatusChangedTo();
253         this.documentAttributeValues = ModelObjectUtils.createImmutableCopy(builder.getDocumentAttributeValues());
254         this.saveName = builder.getSaveName();
255         this.startAtIndex = builder.getStartAtIndex();
256         this.maxResults = builder.getMaxResults();
257     }
258 
259     @Override
260     public String getDocumentId() {
261         return this.documentId;
262     }
263 
264     @Override
265     public List<DocumentStatus> getDocumentStatuses() {
266         return this.documentStatuses;
267     }
268 
269     @Override
270     public List<DocumentStatusCategory> getDocumentStatusCategories() {
271         return this.documentStatusCategories;
272     }
273 
274     @Override
275     public String getTitle() {
276         return this.title;
277     }
278 
279     @Override
280     public String getApplicationDocumentId() {
281         return this.applicationDocumentId;
282     }
283 
284     @Override
285     public String getApplicationDocumentStatus() {
286         return this.applicationDocumentStatus;
287     }
288 
289     @Override
290     public String getInitiatorPrincipalName() {
291         return this.initiatorPrincipalName;
292     }
293 
294     @Override
295     public String getViewerPrincipalName() {
296         return this.viewerPrincipalName;
297     }
298 
299     @Override
300     public String getViewerGroupId() {
301         return this.viewerGroupId;
302     }
303 
304     @Override
305     public String getApproverPrincipalName() {
306         return this.approverPrincipalName;
307     }
308 
309     @Override
310     public String getRouteNodeName() {
311         return this.routeNodeName;
312     }
313 
314     @Override
315     public RouteNodeLookupLogic getRouteNodeLookupLogic() {
316         return this.routeNodeLookupLogic;
317     }
318 
319     @Override
320     public String getDocumentTypeName() {
321         return this.documentTypeName;
322     }
323 
324     @Override
325     public List<String> getAdditionalDocumentTypeNames() {
326         return this.additionalDocumentTypeNames;
327     }
328 
329     @Override
330     public DateTime getDateCreatedFrom() {
331         return this.dateCreatedFrom;
332     }
333 
334     @Override
335     public DateTime getDateCreatedTo() {
336         return this.dateCreatedTo;
337     }
338 
339     @Override
340     public DateTime getDateLastModifiedFrom() {
341         return this.dateLastModifiedFrom;
342     }
343 
344     @Override
345     public DateTime getDateLastModifiedTo() {
346         return this.dateLastModifiedTo;
347     }
348 
349     @Override
350     public DateTime getDateApprovedFrom() {
351         return this.dateApprovedFrom;
352     }
353 
354     @Override
355     public DateTime getDateApprovedTo() {
356         return this.dateApprovedTo;
357     }
358 
359     @Override
360     public DateTime getDateFinalizedFrom() {
361         return this.dateFinalizedFrom;
362     }
363 
364     @Override
365     public DateTime getDateFinalizedTo() {
366         return this.dateFinalizedTo;
367     }
368 
369     @Override
370     public DateTime getDateApplicationDocumentStatusChangedFrom() {
371         return dateApplicationDocumentStatusChangedFrom;
372     }
373 
374     @Override
375     public DateTime getDateApplicationDocumentStatusChangedTo() {
376         return dateApplicationDocumentStatusChangedTo;
377     }
378 
379     @Override
380     public Map<String, List<String>> getDocumentAttributeValues() {
381         return this.documentAttributeValues;
382     }
383 
384     @Override
385     public String getSaveName() {
386         return saveName;
387     }
388 
389     @Override
390     public Integer getStartAtIndex() {
391         return this.startAtIndex;
392     }
393 
394     @Override
395     public Integer getMaxResults() {
396         return this.maxResults;
397     }
398 
399     /**
400      * A builder which can be used to construct {@link DocumentSearchCriteria} instances.  Enforces the constraints of
401      * the {@link DocumentSearchCriteriaContract}.
402      */
403     public final static class Builder implements Serializable, ModelBuilder, DocumentSearchCriteriaContract {
404 
405         private String documentId;
406         private List<DocumentStatus> documentStatuses;
407         private List<DocumentStatusCategory> documentStatusCategories;
408         private String title;
409         private String applicationDocumentId;
410         private String applicationDocumentStatus;
411         private String initiatorPrincipalName;
412         private String viewerPrincipalName;
413         private String viewerGroupId;
414         private String approverPrincipalName;
415         private String routeNodeName;
416         private RouteNodeLookupLogic routeNodeLookupLogic;
417         private String documentTypeName;
418         private List<String> additionalDocumentTypeNames;
419         private DateTime dateCreatedFrom;
420         private DateTime dateCreatedTo;
421         private DateTime dateLastModifiedFrom;
422         private DateTime dateLastModifiedTo;
423         private DateTime dateApprovedFrom;
424         private DateTime dateApprovedTo;
425         private DateTime dateFinalizedFrom;
426         private DateTime dateFinalizedTo;
427         private DateTime dateApplicationDocumentStatusChangedFrom;
428         private DateTime dateApplicationDocumentStatusChangedTo;
429         private Map<String, List<String>> documentAttributeValues;
430         private String saveName;
431         private Integer startAtIndex;
432         private Integer maxResults;
433 
434         private Builder() {
435             setDocumentStatuses(new ArrayList<DocumentStatus>());
436             setDocumentStatusCategories(new ArrayList<DocumentStatusCategory>());
437             setAdditionalDocumentTypeNames(new ArrayList<String>());
438             setDocumentAttributeValues(new HashMap<String, List<String>>());
439         }
440 
441         /**
442          * Creates an empty builder instance.  All collections on the new instance are initialized to empty collections.
443          *
444          * @return a new builder instance
445          */
446         public static Builder create() {
447             return new Builder();
448         }
449 
450         /**
451          * Creates a new builder instance initialized with copies of the properties from the given contract.
452          *
453          * @param contract the contract from which to copy properties
454          *
455          * @return a builder instance initialized with properties from the given contract
456          *
457          * @throws IllegalArgumentException if the given contract is null
458          */
459         public static Builder create(DocumentSearchCriteriaContract contract) {
460             if (contract == null) {
461                 throw new IllegalArgumentException("contract was null");
462             }
463             Builder builder = create();
464             builder.setDocumentId(contract.getDocumentId());
465             if (contract.getDocumentStatuses() != null) {
466                 builder.setDocumentStatuses(new ArrayList<DocumentStatus>(contract.getDocumentStatuses()));
467             }
468             if (contract.getDocumentStatusCategories() != null) {
469                 builder.setDocumentStatusCategories(new ArrayList<DocumentStatusCategory>(contract.getDocumentStatusCategories()));
470             }
471             builder.setTitle(contract.getTitle());
472             builder.setApplicationDocumentId(contract.getApplicationDocumentId());
473             builder.setApplicationDocumentStatus(contract.getApplicationDocumentStatus());
474             builder.setInitiatorPrincipalName(contract.getInitiatorPrincipalName());
475             builder.setViewerPrincipalName(contract.getViewerPrincipalName());
476             builder.setViewerGroupId(contract.getViewerGroupId());
477             builder.setApproverPrincipalName(contract.getApproverPrincipalName());
478             builder.setRouteNodeName(contract.getRouteNodeName());
479             builder.setRouteNodeLookupLogic(contract.getRouteNodeLookupLogic());
480             builder.setDocumentTypeName(contract.getDocumentTypeName());
481             if (contract.getAdditionalDocumentTypeNames() != null) {
482                 builder.setAdditionalDocumentTypeNames(new ArrayList<String>(contract.getAdditionalDocumentTypeNames()));
483             }
484             builder.setDateCreatedFrom(contract.getDateCreatedFrom());
485             builder.setDateCreatedTo(contract.getDateCreatedTo());
486             builder.setDateLastModifiedFrom(contract.getDateLastModifiedFrom());
487             builder.setDateLastModifiedTo(contract.getDateLastModifiedTo());
488             builder.setDateApprovedFrom(contract.getDateApprovedFrom());
489             builder.setDateApprovedTo(contract.getDateApprovedTo());
490             builder.setDateFinalizedFrom(contract.getDateFinalizedFrom());
491             builder.setDateFinalizedTo(contract.getDateFinalizedTo());
492             builder.setDateApplicationDocumentStatusChangedFrom(contract.getDateApplicationDocumentStatusChangedFrom());
493             builder.setDateApplicationDocumentStatusChangedTo(contract.getDateApplicationDocumentStatusChangedTo());
494             if (contract.getDocumentAttributeValues() != null) {
495                 builder.setDocumentAttributeValues(new HashMap<String, List<String>>(contract.getDocumentAttributeValues()));
496             }
497             builder.setSaveName(contract.getSaveName());
498             builder.setStartAtIndex(contract.getStartAtIndex());
499             builder.setMaxResults(contract.getMaxResults());
500             return builder;
501         }
502 
503         @Override
504         public DocumentSearchCriteria build() {
505             if (StringUtils.isNotBlank(routeNodeName) && StringUtils.isBlank(documentTypeName)) {
506                 throw new IllegalStateException("documentTypeName must be set if routeNodeName is set.");
507             }
508             return new DocumentSearchCriteria(this);
509         }
510 
511         @Override
512         public String getDocumentId() {
513             return this.documentId;
514         }
515 
516         @Override
517         public List<DocumentStatus> getDocumentStatuses() {
518             return this.documentStatuses;
519         }
520 
521         @Override
522         public List<DocumentStatusCategory> getDocumentStatusCategories() {
523             return this.documentStatusCategories;
524         }
525 
526         @Override
527         public String getTitle() {
528             return this.title;
529         }
530 
531         @Override
532         public String getApplicationDocumentId() {
533             return this.applicationDocumentId;
534         }
535 
536         @Override
537         public String getApplicationDocumentStatus() {
538             return this.applicationDocumentStatus;
539         }
540 
541         @Override
542         public String getInitiatorPrincipalName() {
543             return this.initiatorPrincipalName;
544         }
545 
546         @Override
547         public String getViewerPrincipalName() {
548             return this.viewerPrincipalName;
549         }
550 
551         @Override
552         public String getViewerGroupId() {
553             return this.viewerGroupId;
554         }
555 
556         @Override
557         public String getApproverPrincipalName() {
558             return this.approverPrincipalName;
559         }
560 
561         @Override
562         public String getRouteNodeName() {
563             return this.routeNodeName;
564         }
565 
566         @Override
567         public RouteNodeLookupLogic getRouteNodeLookupLogic() {
568             return this.routeNodeLookupLogic;
569         }
570 
571         @Override
572         public String getDocumentTypeName() {
573             return this.documentTypeName;
574         }
575 
576         @Override
577         public List<String> getAdditionalDocumentTypeNames() {
578             return additionalDocumentTypeNames;
579         }
580 
581         @Override
582         public DateTime getDateCreatedFrom() {
583             return this.dateCreatedFrom;
584         }
585 
586         @Override
587         public DateTime getDateCreatedTo() {
588             return this.dateCreatedTo;
589         }
590 
591         @Override
592         public DateTime getDateLastModifiedFrom() {
593             return this.dateLastModifiedFrom;
594         }
595 
596         @Override
597         public DateTime getDateLastModifiedTo() {
598             return this.dateLastModifiedTo;
599         }
600 
601         @Override
602         public DateTime getDateApprovedFrom() {
603             return this.dateApprovedFrom;
604         }
605 
606         @Override
607         public DateTime getDateApprovedTo() {
608             return this.dateApprovedTo;
609         }
610 
611         @Override
612         public DateTime getDateFinalizedFrom() {
613             return this.dateFinalizedFrom;
614         }
615 
616         @Override
617         public DateTime getDateFinalizedTo() {
618             return this.dateFinalizedTo;
619         }
620 
621         @Override
622         public DateTime getDateApplicationDocumentStatusChangedFrom() {
623             return dateApplicationDocumentStatusChangedFrom;
624         }
625 
626         @Override
627         public DateTime getDateApplicationDocumentStatusChangedTo() {
628             return dateApplicationDocumentStatusChangedTo;
629         }
630 
631         @Override
632         public Map<String, List<String>> getDocumentAttributeValues() {
633             return this.documentAttributeValues;
634         }
635 
636         @Override
637         public String getSaveName() {
638             return this.saveName;
639         }
640 
641         @Override
642         public Integer getStartAtIndex() {
643             return this.startAtIndex;
644         }
645 
646         @Override
647         public Integer getMaxResults() {
648             return this.maxResults;
649         }
650 
651         public void setDocumentId(String documentId) {
652             this.documentId = documentId;
653         }
654 
655         public void setDocumentStatuses(List<DocumentStatus> documentStatuses) {
656             this.documentStatuses = documentStatuses;
657         }
658 
659         public void setDocumentStatusCategories(List<DocumentStatusCategory> documentStatusCategories) {
660             this.documentStatusCategories = documentStatusCategories;
661         }
662 
663         public void setTitle(String title) {
664             this.title = title;
665         }
666 
667         public void setApplicationDocumentId(String applicationDocumentId) {
668             this.applicationDocumentId = applicationDocumentId;
669         }
670 
671         public void setApplicationDocumentStatus(String applicationDocumentStatus) {
672             this.applicationDocumentStatus = applicationDocumentStatus;
673         }
674 
675         public void setInitiatorPrincipalName(String initiatorPrincipalName) {
676             this.initiatorPrincipalName = initiatorPrincipalName;
677         }
678 
679         public void setViewerPrincipalName(String viewerPrincipalName) {
680             this.viewerPrincipalName = viewerPrincipalName;
681         }
682 
683         public void setViewerGroupId(String viewerGroupId) {
684             this.viewerGroupId = viewerGroupId;
685         }
686 
687         public void setApproverPrincipalName(String approverPrincipalName) {
688             this.approverPrincipalName = approverPrincipalName;
689         }
690 
691         public void setRouteNodeName(String routeNodeName) {
692             this.routeNodeName = routeNodeName;
693         }
694 
695         public void setRouteNodeLookupLogic(RouteNodeLookupLogic routeNodeLookupLogic) {
696             this.routeNodeLookupLogic = routeNodeLookupLogic;
697         }
698 
699         public void setDocumentTypeName(String documentTypeName) {
700             this.documentTypeName = documentTypeName;
701         }
702 
703         public void setAdditionalDocumentTypeNames(List<String> additionalDocumentTypeNames) {
704             this.additionalDocumentTypeNames = additionalDocumentTypeNames;
705         }
706 
707         public void setDateCreatedFrom(DateTime dateCreatedFrom) {
708             this.dateCreatedFrom = dateCreatedFrom;
709         }
710 
711         public void setDateCreatedTo(DateTime dateCreatedTo) {
712             this.dateCreatedTo = dateCreatedTo;
713         }
714 
715         public void setDateLastModifiedFrom(DateTime dateLastModifiedFrom) {
716             this.dateLastModifiedFrom = dateLastModifiedFrom;
717         }
718 
719         public void setDateLastModifiedTo(DateTime dateLastModifiedTo) {
720             this.dateLastModifiedTo = dateLastModifiedTo;
721         }
722 
723         public void setDateApprovedFrom(DateTime dateApprovedFrom) {
724             this.dateApprovedFrom = dateApprovedFrom;
725         }
726 
727         public void setDateApprovedTo(DateTime dateApprovedTo) {
728             this.dateApprovedTo = dateApprovedTo;
729         }
730 
731         public void setDateFinalizedFrom(DateTime dateFinalizedFrom) {
732             this.dateFinalizedFrom = dateFinalizedFrom;
733         }
734 
735         public void setDateFinalizedTo(DateTime dateFinalizedTo) {
736             this.dateFinalizedTo = dateFinalizedTo;
737         }
738 
739         public void setDateApplicationDocumentStatusChangedFrom(DateTime dateApplicationDocumentStatusChangedFrom) {
740             this.dateApplicationDocumentStatusChangedFrom = dateApplicationDocumentStatusChangedFrom;
741         }
742 
743         public void setDateApplicationDocumentStatusChangedTo(DateTime dateApplicationDocumentStatusChangedTo) {
744             this.dateApplicationDocumentStatusChangedTo = dateApplicationDocumentStatusChangedTo;
745         }
746 
747         public void setDocumentAttributeValues(Map<String, List<String>> documentAttributeValues) {
748             this.documentAttributeValues = documentAttributeValues;
749         }
750 
751         public void addDocumentAttributeValue(String name, String value) {
752             if (StringUtils.isBlank(value)) {
753                 throw new IllegalArgumentException("value was null or blank");
754             }
755             List<String> values = getDocumentAttributeValues().get(name);
756             if (values == null) {
757                 values = new ArrayList<String>();
758                 getDocumentAttributeValues().put(name, values);
759             }
760             values.add(value);
761         }
762 
763         public void setSaveName(String saveName) {
764             this.saveName = saveName;
765         }
766 
767         public void setStartAtIndex(Integer startAtIndex) {
768             this.startAtIndex = startAtIndex;
769         }
770 
771         public void setMaxResults(Integer maxResults) {
772             this.maxResults = maxResults;
773         }
774 
775         /**
776          * Resets DateTimes to local TimeZone (preserving absolute time)
777          * @see {@link http://jira.codehaus.org/browse/JACKSON-279}
778          * @see {@link org.kuali.rice.core.util.JacksonRiceModule}
779          */
780         public void normalizeDateTimes() {
781             if (dateCreatedFrom != null) dateCreatedFrom = dateCreatedFrom.withZone(DateTimeZone.getDefault());
782             if (dateCreatedTo != null) dateCreatedTo = dateCreatedTo.withZone(DateTimeZone.getDefault());
783             if (dateLastModifiedFrom != null) dateLastModifiedFrom = dateLastModifiedFrom.withZone(DateTimeZone.getDefault());
784             if (dateLastModifiedTo != null) dateLastModifiedTo = dateLastModifiedTo.withZone(DateTimeZone.getDefault());
785             if (dateApprovedFrom != null) dateApprovedFrom = dateApprovedFrom.withZone(DateTimeZone.getDefault());
786             if (dateApprovedTo != null) dateApprovedTo = dateApprovedTo.withZone(DateTimeZone.getDefault());
787             if (dateFinalizedFrom != null) dateFinalizedFrom = dateFinalizedFrom.withZone(DateTimeZone.getDefault());
788             if (dateFinalizedTo != null) dateFinalizedTo = dateFinalizedTo.withZone(DateTimeZone.getDefault());
789             if (dateApplicationDocumentStatusChangedFrom != null) dateApplicationDocumentStatusChangedFrom = dateApplicationDocumentStatusChangedFrom.withZone(DateTimeZone.getDefault());
790             if (dateApplicationDocumentStatusChangedTo != null) dateApplicationDocumentStatusChangedTo = dateApplicationDocumentStatusChangedTo.withZone(DateTimeZone.getDefault());
791         }
792 
793     }
794 
795     /**
796      * Defines some internal constants used on this class.
797      */
798     static class Constants {
799         final static String ROOT_ELEMENT_NAME = "documentSearchCriteria";
800         final static String TYPE_NAME = "DocumentSearchCriteriaType";
801     }
802 
803     /**
804      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
805      */
806     static class Elements {
807         final static String DOCUMENT_ID = "documentId";
808         final static String DOCUMENT_STATUSES = "documentStatuses";
809         final static String DOCUMENT_STATUS = "documentStatus";
810         final static String DOCUMENT_STATUS_CATEGORIES = "documentStatusCategories";
811         final static String DOCUMENT_STATUS_CATEGORY = "documentStatusCategory";
812         final static String TITLE = "title";
813         final static String APPLICATION_DOCUMENT_ID = "applicationDocumentId";
814         final static String APPLICATION_DOCUMENT_STATUS = "applicationDocumentStatus";
815         final static String INITIATOR_PRINCIPAL_NAME = "initiatorPrincipalName";
816         final static String VIEWER_PRINCIPAL_NAME = "viewerPrincipalName";
817         final static String VIEWER_GROUP_ID = "viewerGroupId";
818         final static String APPROVER_PRINCIPAL_NAME = "approverPrincipalName";
819         final static String ROUTE_NODE_NAME = "routeNodeName";
820         final static String ROUTE_NODE_LOOKUP_LOGIC = "routeNodeLookupLogic";
821         final static String DOCUMENT_TYPE_NAME = "documentTypeName";
822         final static String ADDITIONAL_DOCUMENT_TYPE_NAMES = "additionalDocumentTypeNames";
823         final static String ADDITIONAL_DOCUMENT_TYPE_NAME = "additionalDocumentTypeName";
824         final static String DATE_CREATED_FROM = "dateCreatedFrom";
825         final static String DATE_CREATED_TO = "dateCreatedTo";
826         final static String DATE_LAST_MODIFIED_FROM = "dateLastModifiedFrom";
827         final static String DATE_LAST_MODIFIED_TO = "dateLastModifiedTo";
828         final static String DATE_APPROVED_FROM = "dateApprovedFrom";
829         final static String DATE_APPROVED_TO = "dateApprovedTo";
830         final static String DATE_FINALIZED_FROM = "dateFinalizedFrom";
831         final static String DATE_FINALIZED_TO = "dateFinalizedTo";
832         final static String DATE_APPLICATION_DOCUMENT_STATUS_CHANGED_FROM = "dateApplicationDocumentStatusChangedFrom";
833         final static String DATE_APPLICATION_DOCUMENT_STATUS_CHANGED_TO = "dateApplicationDocumentStatusChangedTo";
834         final static String DOCUMENT_ATTRIBUTE_VALUES = "documentAttributeValues";
835         final static String SAVE_NAME = "saveName";
836         final static String START_AT_INDEX = "startAtIndex";
837         final static String MAX_RESULTS = "maxResults";
838     }
839 
840 }