View Javadoc

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