Coverage Report - org.kuali.rice.kew.docsearch.DocSearchCriteriaDTO
 
Classes in this File Line Coverage Branch Coverage Complexity
DocSearchCriteriaDTO
0%
0/232
0%
0/192
2.022
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  *
 4  
  *
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.docsearch;
 18  
 
 19  
 import org.apache.commons.lang.StringUtils;
 20  
 import org.kuali.rice.kew.engine.node.RouteNode;
 21  
 import org.kuali.rice.kew.service.KEWServiceLocator;
 22  
 import org.kuali.rice.kew.util.Utilities;
 23  
 import org.kuali.rice.kns.bo.BusinessObject;
 24  
 import org.kuali.rice.kns.bo.BusinessObjectBase;
 25  
 import org.kuali.rice.kns.web.ui.Field;
 26  
 import org.kuali.rice.kns.web.ui.Row;
 27  
 
 28  
 import java.util.*;
 29  
 
 30  
 
 31  
 /**
 32  
  * Model bean representing document searches.  Persisted each search as part of the users saved searches.
 33  
  *
 34  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 35  
  */
 36  
 public class DocSearchCriteriaDTO extends BusinessObjectBase implements BusinessObject, DocumentRouteHeaderEBO {
 37  
 
 38  
     private static final long serialVersionUID = -5738747438282249790L;
 39  
 
 40  
     public static final String ADVANCED_SEARCH_INDICATOR_STRING = "YES";
 41  
     public static final String SUPER_USER_SEARCH_INDICATOR_STRING = "YES";
 42  
     public static final int DEFAULT_PAGE_SIZE = 10;
 43  
 
 44  
     private String namedSearch; // if populated the name of the search that they want to save
 45  
     private Integer pageSize; // the number of items to display on a page of results
 46  
     private String routeHeaderId; // id generated by KEW
 47  
     private String docRouteStatus; // route status of the document
 48  
     private String appDocStatus; // application document status
 49  
     private String docTitle; // document title provided by the application
 50  
     private String appDocId; // application provided ID - defaults to routeHeaderId
 51  
     private String overrideInd; // flag to indicate overridden business values - set by app
 52  
     private String initiator; // network Id of the person who initiated the document
 53  
     private String viewer; // network Id of the person who is currently viewing the document
 54  
     private String workgroupViewerNamespace; //group namespace of the group that has had an action request to the document
 55  
     private String workgroupViewerName; // workgroup Id that has had an action request to the document
 56  
     private String approver; // network Id of the person who is approving the document
 57  
     private String docRouteNodeId; // current level of routing, i.e. which route method is the document currently in
 58  
     private String docRouteNodeLogic; // exactly, before or after
 59  
     private String docVersion; // document version
 60  
     private String docTypeFullName; // the fullname for the document's docType
 61  
     private String workgroupViewerId;
 62  
 
 63  
     //date range properties
 64  
     private String fromDateCreated; // the begin range for DateCreated
 65  
     private String fromDateLastModified; // the begin range for LastModified
 66  
     private String fromDateApproved; // the begin range for Approved
 67  
     private String fromDateFinalized; // the begin range for Finalized
 68  
     private String fromStatusTransitionDate;  // the begin range for app doc status transition
 69  
     private String toDateCreated; // the end range for created
 70  
     private String toDateLastModified; // the end range for last modified
 71  
     private String toDateApproved; // the end range for approved
 72  
     private String toDateFinalized; // the end range for finalized
 73  
     private String toStatusTransitionDate;  // the end range for app doc status transition
 74  
     private java.sql.Timestamp dateCreated; //fake date for DD
 75  
     
 76  
     // criteria processing
 77  0
     private List<Row> searchableAttributeRows = new ArrayList<Row>();
 78  
 
 79  
     // searchable attribute properties
 80  0
     private List<SearchAttributeCriteriaComponent> searchableAttributes = new ArrayList<SearchAttributeCriteriaComponent>();
 81  
 
 82  
     //properties to preserve view from saved and history searches as well as generate results
 83  
     private String isAdvancedSearch;
 84  0
     private String superUserSearch = "NO";
 85  
 
 86  
     // used as an "out" parameter to indicate the threshold for the search
 87  0
     private Integer threshold = Integer.valueOf(DocumentSearchGenerator.DEFAULT_SEARCH_RESULT_CAP);
 88  0
     private Integer fetchLimit = Integer.valueOf(0);
 89  
 
 90  
     // used as an "out" parameter to indicate that the rows fetched for this criteria are over the indicated threshold
 91  0
     private boolean isOverThreshold = false;
 92  
 
 93  
     // used as an "out" prameter to indicate the number of rows that were filtered for security
 94  0
     private int securityFilteredRows = 0;
 95  
 
 96  
     // below used when doing a document search from API
 97  0
     private boolean overridingUserSession = false;
 98  0
     private boolean saveSearchForUser = false;
 99  
 
 100  0
     private boolean onlyDocTypeFilled = false;
 101  
     
 102  
     public DocSearchCriteriaDTO() {
 103  0
         super();
 104  0
     }
 105  
 
 106  
     /**
 107  
          * This overridden method ...
 108  
          * 
 109  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#isStandardCriteriaConsideredEmpty(boolean)
 110  
          */
 111  
     public boolean isStandardCriteriaConsideredEmpty(boolean excludeDocumentTypeName) {
 112  0
         boolean docTypeNameIsEmpty = Utilities.isEmpty(this.docTypeFullName);
 113  0
         boolean standardFieldsAreEmpty = ((Utilities.isEmpty(routeHeaderId)) &&
 114  
         /* (Utilities.isEmpty(overrideInd)) && */
 115  
         (Utilities.isEmpty(initiator)) && (Utilities.isEmpty(workgroupViewerName)) &&
 116  
         /* (Utilities.isEmpty(docRouteNodeLogic)) && */
 117  
         (Utilities.isEmpty(docVersion)) && (Utilities.isEmpty(fromDateCreated)) && (Utilities.isEmpty(toDateCreated)) && (Utilities.isEmpty(appDocId)) && (Utilities.isEmpty(approver)) && (Utilities.isEmpty(docRouteNodeId)) && (Utilities.isEmpty(docRouteStatus)) && (Utilities.isEmpty(docTitle)) && (Utilities.isEmpty(viewer)) && (Utilities.isEmpty(fromDateApproved)) && (Utilities.isEmpty(toDateApproved)) && (Utilities.isEmpty(fromDateFinalized)) && (Utilities.isEmpty(toDateFinalized)) && (Utilities.isEmpty(fromDateLastModified)) && (Utilities.isEmpty(toDateLastModified)));
 118  0
         if (excludeDocumentTypeName) {
 119  0
             return standardFieldsAreEmpty;
 120  
         } else {
 121  0
             return docTypeNameIsEmpty && standardFieldsAreEmpty;
 122  
         }
 123  
     }
 124  
 
 125  
     /**
 126  
          * This overridden method ...
 127  
          * 
 128  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getDocRouteNodeLogic()
 129  
          */
 130  
     public String getDocRouteNodeLogic() {
 131  0
         return docRouteNodeLogic;
 132  
     }
 133  
 
 134  
     public void setDocRouteNodeLogic(String docRouteLevelLogic) {
 135  0
         this.docRouteNodeLogic = docRouteLevelLogic;
 136  0
     }
 137  
 
 138  
     /**
 139  
          * This overridden method ...
 140  
          * 
 141  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getAppDocId()
 142  
          */
 143  
     public String getAppDocId() {
 144  0
         return appDocId;
 145  
     }
 146  
 
 147  
     public void setAppDocId(String appDocId) {
 148  0
         this.appDocId = appDocId;
 149  0
     }
 150  
 
 151  
     /**
 152  
          * This overridden method ...
 153  
          * 
 154  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getApprover()
 155  
          */
 156  
     public String getApprover() {
 157  0
         return approver;
 158  
     }
 159  
 
 160  
     public void setApprover(String approver) {
 161  0
         this.approver = approver;
 162  0
     }
 163  
 
 164  
     /**
 165  
          * This overridden method ...
 166  
          * 
 167  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getDocRouteNodeId()
 168  
          */
 169  
     public String getDocRouteNodeId() {
 170  0
         return docRouteNodeId;
 171  
     }
 172  
 
 173  
     public void setDocRouteNodeId(String docRouteLevel) {
 174  0
         this.docRouteNodeId = docRouteLevel;
 175  0
     }
 176  
 
 177  
     /**
 178  
          * This overridden method ...
 179  
          * 
 180  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getDocRouteStatus()
 181  
          */
 182  
     public String getDocRouteStatus() {
 183  0
         return docRouteStatus;
 184  
     }
 185  
 
 186  
     public void setDocRouteStatus(String docRouteStatus) {
 187  0
         this.docRouteStatus = docRouteStatus;
 188  0
     }
 189  
 
 190  
     /**
 191  
          * This overridden method ...
 192  
          * 
 193  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getAppDocStatus()
 194  
          */
 195  
     public String getAppDocStatus() {
 196  0
         return appDocStatus;
 197  
     }
 198  
 
 199  
     public void setAppDocStatus(String appDocStatus) {
 200  0
         this.appDocStatus = appDocStatus;
 201  0
     }
 202  
 
 203  
     /**
 204  
          * This overridden method ...
 205  
          * 
 206  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getDocTitle()
 207  
          */
 208  
     public String getDocTitle() {
 209  0
         return docTitle;
 210  
     }
 211  
 
 212  
     public void setDocTitle(String docTitle) {
 213  0
         this.docTitle = docTitle;
 214  0
     }
 215  
 
 216  
     /**
 217  
          * This overridden method ...
 218  
          * 
 219  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getDocTypeFullName()
 220  
          */
 221  
     public String getDocTypeFullName() {
 222  0
         return docTypeFullName;
 223  
     }
 224  
 
 225  
     public void setDocTypeFullName(String docTypeFullName) {
 226  0
         this.docTypeFullName = docTypeFullName;
 227  0
     }
 228  
 
 229  
     /**
 230  
          * This overridden method ...
 231  
          * 
 232  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getDocVersion()
 233  
          */
 234  
     public String getDocVersion() {
 235  0
         return docVersion;
 236  
     }
 237  
 
 238  
     public void setDocVersion(String docVersion) {
 239  0
         this.docVersion = docVersion;
 240  0
     }
 241  
 
 242  
     /**
 243  
          * This overridden method ...
 244  
          * 
 245  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getInitiator()
 246  
          */
 247  
     public String getInitiator() {
 248  0
         return initiator;
 249  
     }
 250  
 
 251  
     public void setInitiator(String initiator) {
 252  0
         this.initiator = initiator;
 253  0
     }
 254  
 
 255  
     /**
 256  
          * This overridden method ...
 257  
          * 
 258  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getOverrideInd()
 259  
          */
 260  
     public String getOverrideInd() {
 261  0
         return overrideInd;
 262  
     }
 263  
 
 264  
     public void setOverrideInd(String overrideInd) {
 265  0
         this.overrideInd = overrideInd;
 266  0
     }
 267  
 
 268  
     /**
 269  
          * This overridden method ...
 270  
          * 
 271  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getRouteHeaderId()
 272  
          */
 273  
     public String getRouteHeaderId() {
 274  0
         return routeHeaderId;
 275  
     }
 276  
 
 277  
     public void setRouteHeaderId(String routeHeaderId) {
 278  0
         this.routeHeaderId = routeHeaderId;
 279  0
     }
 280  
 
 281  
     /**
 282  
          * This overridden method ...
 283  
          * 
 284  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getViewer()
 285  
          */
 286  
     public String getViewer() {
 287  0
         return viewer;
 288  
     }
 289  
 
 290  
     public void setViewer(String viewer) {
 291  0
         this.viewer = viewer;
 292  0
     }
 293  
 
 294  
     /**
 295  
          * This overridden method ...
 296  
          * 
 297  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getPageSize()
 298  
          */
 299  
     public Integer getPageSize() {
 300  0
         return pageSize;
 301  
     }
 302  
 
 303  
     public void setPageSize(Integer pageSize) {
 304  0
         this.pageSize = pageSize;
 305  0
     }
 306  
 
 307  
     /**
 308  
          * This overridden method ...
 309  
          * 
 310  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getFromDateApproved()
 311  
          */
 312  
     public String getFromDateApproved() {
 313  0
         return fromDateApproved;
 314  
     }
 315  
 
 316  
     /**
 317  
          * This overridden method ...
 318  
          * 
 319  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getFromDateCreated()
 320  
          */
 321  
     public String getFromDateCreated() {
 322  0
         return fromDateCreated;
 323  
     }
 324  
 
 325  
     /**
 326  
          * This overridden method ...
 327  
          * 
 328  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getFromDateFinalized()
 329  
          */
 330  
     public String getFromDateFinalized() {
 331  0
         return fromDateFinalized;
 332  
     }
 333  
 
 334  
     /**
 335  
          * This overridden method ...
 336  
          * 
 337  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getFromDateLastModified()
 338  
          */
 339  
     public String getFromDateLastModified() {
 340  0
         return fromDateLastModified;
 341  
     }
 342  
 
 343  
     public String getFromStatusTransitionDate() {
 344  0
         return fromStatusTransitionDate;
 345  
     }
 346  
     /**
 347  
          * This overridden method ...
 348  
          * 
 349  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getToDateApproved()
 350  
          */
 351  
     public String getToDateApproved() {
 352  0
         return toDateApproved;
 353  
     }
 354  
 
 355  
     /**
 356  
          * This overridden method ...
 357  
          * 
 358  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getToDateCreated()
 359  
          */
 360  
     public String getToDateCreated() {
 361  0
         return toDateCreated;
 362  
     }
 363  
 
 364  
     /**
 365  
          * This overridden method ...
 366  
          * 
 367  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getToDateFinalized()
 368  
          */
 369  
     public String getToDateFinalized() {
 370  0
         return toDateFinalized;
 371  
     }
 372  
 
 373  
     /**
 374  
          * This overridden method ...
 375  
          * 
 376  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getToDateLastModified()
 377  
          */
 378  
     public String getToDateLastModified() {
 379  0
         return toDateLastModified;
 380  
     }
 381  
 
 382  
     public String getToStatusTransitionDate() {
 383  0
         return toStatusTransitionDate;
 384  
     }
 385  
     public void setFromDateApproved(String fromDateApproved) {
 386  0
         this.fromDateApproved = safeTrimmer(fromDateApproved);
 387  0
     }
 388  
 
 389  
     public void setFromDateCreated(String fromDateCreated) {
 390  0
         this.fromDateCreated = safeTrimmer(fromDateCreated);
 391  0
     }
 392  
 
 393  
     public void setFromDateFinalized(String fromDateFinalized) {
 394  0
         this.fromDateFinalized = safeTrimmer(fromDateFinalized);
 395  0
     }
 396  
 
 397  
     public void setFromDateLastModified(String fromDateLastModified) {
 398  0
         this.fromDateLastModified = safeTrimmer(fromDateLastModified);
 399  0
     }
 400  
 
 401  
     public void setFromStatusTransitionDate(String fromStatusTransitionDate) {
 402  0
         this.fromStatusTransitionDate = safeTrimmer(fromStatusTransitionDate);
 403  0
     }
 404  
 
 405  
     public void setToDateApproved(String toDateApproved) {
 406  0
         this.toDateApproved = safeTrimmer(toDateApproved);
 407  0
     }
 408  
 
 409  
     public void setToDateCreated(String toDateCreated) {
 410  0
         this.toDateCreated = safeTrimmer(toDateCreated);
 411  0
     }
 412  
 
 413  
     public void setToDateFinalized(String toDateFinalized) {
 414  0
         this.toDateFinalized = safeTrimmer(toDateFinalized);
 415  0
     }
 416  
 
 417  
     public void setToDateLastModified(String toDateLastModified) {
 418  0
         this.toDateLastModified = safeTrimmer(toDateLastModified);
 419  0
     }
 420  
 
 421  
     public void setToStatusTransitionDate(String toStatusTransitionDate) {
 422  0
         this.toStatusTransitionDate = safeTrimmer(toStatusTransitionDate);
 423  0
     }
 424  
 
 425  
     private String safeTrimmer(String value) {
 426  0
         if (!Utilities.isEmpty(value)) {
 427  0
             return value.trim();
 428  
         }
 429  0
         return value;
 430  
     }
 431  
 
 432  
     /**
 433  
          * This overridden method ...
 434  
          * 
 435  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getNamedSearch()
 436  
          */
 437  
     public String getNamedSearch() {
 438  0
         return namedSearch;
 439  
     }
 440  
 
 441  
     public void setNamedSearch(String namedSearch) {
 442  0
         this.namedSearch = namedSearch;
 443  0
     }
 444  
 
 445  
     /**
 446  
          * This overridden method ...
 447  
          * 
 448  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getDocumentSearchAbbreviatedString()
 449  
          */
 450  
     public String getDocumentSearchAbbreviatedString() {
 451  0
         StringBuffer abbreviatedString = new StringBuffer();
 452  0
         String dateApprovedString = getRangeString(this.toDateApproved, this.fromDateApproved);
 453  0
         String dateCreatedString = getRangeString(this.toDateCreated, this.fromDateCreated);
 454  0
         String dateLastModifiedString = getRangeString(this.toDateLastModified, this.fromDateLastModified);
 455  0
         String dateFinalizedString = getRangeString(this.toDateFinalized, this.fromDateFinalized);
 456  0
         String dateStatusTransitionString = getRangeString(this.toStatusTransitionDate, this.fromStatusTransitionDate);
 457  0
         if (appDocId != null && !"".equals(appDocId.trim())) {
 458  0
             abbreviatedString.append("Application Document Id=").append(appDocId).append("; ");
 459  
         }
 460  0
         if (approver != null && !"".equals(approver.trim())) {
 461  0
             abbreviatedString.append("Approver=").append(approver).append("; ");
 462  
         }
 463  0
         if (docRouteNodeId != null && !"".equals(docRouteNodeId.trim())) {
 464  0
             RouteNode routeNode = KEWServiceLocator.getRouteNodeService().findRouteNodeById(new Long(docRouteNodeId));
 465  0
             abbreviatedString.append("Document Route Node=").append(routeNode.getRouteNodeName()).append("; ");
 466  
         }
 467  0
         if (docRouteStatus != null && !"".equals(docRouteStatus.trim())) {
 468  0
             abbreviatedString.append("Document Route Status=").append(docRouteStatus).append("; ");
 469  
         }
 470  0
         if (docTitle != null && !"".equals(docTitle.trim())) {
 471  0
             abbreviatedString.append("Document Title=").append(docTitle).append("; ");
 472  
         }
 473  0
         if (docTypeFullName != null && !"".equals(docTypeFullName.trim())) {
 474  0
             abbreviatedString.append("Document Type=").append(docTypeFullName).append("; ");
 475  
         }
 476  0
         if (initiator != null && !"".equals(initiator.trim())) {
 477  0
             abbreviatedString.append("Initiator=").append(initiator).append("; ");
 478  
         }
 479  0
         if (routeHeaderId != null) {
 480  0
             abbreviatedString.append("Document Id=").append(routeHeaderId.toString()).append("; ");
 481  
         }
 482  0
         if (viewer != null && !"".equals(viewer.trim())) {
 483  0
             abbreviatedString.append("Viewer=").append(viewer).append("; ");
 484  
         }
 485  0
         if (workgroupViewerName != null) {
 486  0
             abbreviatedString.append("Group Viewer=").append(workgroupViewerName).append(";");
 487  
         }
 488  0
         if (dateLastModifiedString != null) {
 489  0
             abbreviatedString.append("Date Last Modified=").append(dateLastModifiedString).append("; ");
 490  
         }
 491  0
         if (dateFinalizedString != null) {
 492  0
             abbreviatedString.append("Date Finalized=").append(dateFinalizedString).append("; ");
 493  
         }
 494  0
         if (dateCreatedString != null) {
 495  0
             abbreviatedString.append("Date Created=").append(dateCreatedString).append("; ");
 496  
         }
 497  0
         if (dateApprovedString != null) {
 498  0
             abbreviatedString.append("Date Approved=").append(dateApprovedString).append("; ");
 499  
         }
 500  0
         if (dateStatusTransitionString != null) {
 501  0
             abbreviatedString.append("Date Status Transition=").append(dateStatusTransitionString).append("; ");
 502  
         }
 503  
 
 504  0
         Set<String> alreadyAddedRangeAttributes = new HashSet<String>();
 505  0
         for (SearchAttributeCriteriaComponent searchableAttribute : searchableAttributes)
 506  
         {
 507  0
             if (!Utilities.isEmpty(searchableAttribute.getValue()))
 508  
             {
 509  
                 // single value entered
 510  0
                 if (searchableAttribute.isRangeSearch())
 511  
                 {
 512  
                     // if search attribute criteria component is member of a range we must find it's potential matching partner to build the string
 513  0
                     if (!alreadyAddedRangeAttributes.contains(searchableAttribute.getSavedKey()))
 514  
                     {
 515  
                         // the key has not been processed yet
 516  0
                         String lowerSearchAttributeRangeValue = (searchableAttribute.getFormKey().startsWith(SearchableAttribute.RANGE_LOWER_BOUND_PROPERTY_PREFIX)) ? searchableAttribute.getValue() : null;
 517  0
                         String upperSearchAttributeRangeValue = (searchableAttribute.getFormKey().startsWith(SearchableAttribute.RANGE_UPPER_BOUND_PROPERTY_PREFIX)) ? searchableAttribute.getValue() : null;
 518  
                         // loop through the attributes to find this search attribute criteria components potential match
 519  0
                         for (SearchAttributeCriteriaComponent searchableAttribute1 : searchableAttributes)
 520  
                         {
 521  0
                             if ((searchableAttribute1.getSavedKey().equals(searchableAttribute.getSavedKey())) && (!(searchableAttribute1.getFormKey().equals(searchableAttribute.getFormKey()))))
 522  
                             {
 523  
                                 // we found the other side of the range
 524  0
                                 if (lowerSearchAttributeRangeValue == null)
 525  
                                 {
 526  0
                                     lowerSearchAttributeRangeValue = (searchableAttribute1.getFormKey().startsWith(SearchableAttribute.RANGE_LOWER_BOUND_PROPERTY_PREFIX)) ? searchableAttribute1.getValue() : null;
 527  
                                 }
 528  0
                                 if (upperSearchAttributeRangeValue == null)
 529  
                                 {
 530  0
                                     upperSearchAttributeRangeValue = (searchableAttribute1.getFormKey().startsWith(SearchableAttribute.RANGE_UPPER_BOUND_PROPERTY_PREFIX)) ? searchableAttribute1.getValue() : null;
 531  
                                 }
 532  
                                 break;
 533  
                             }
 534  
                         }
 535  
                         // we should have valid values for the 'to' and 'from' range field values by now
 536  0
                         abbreviatedString.append(searchableAttribute.getSavedKey()).append("=").append(getRangeString(lowerSearchAttributeRangeValue, upperSearchAttributeRangeValue)).append(";");
 537  0
                         alreadyAddedRangeAttributes.add(searchableAttribute.getSavedKey());
 538  0
                     }
 539  
                 } else
 540  
                 {
 541  0
                     abbreviatedString.append(searchableAttribute.getSavedKey()).append("=").append(searchableAttribute.getValue()).append(";");
 542  
                 }
 543  0
             } else if (!Utilities.isEmpty(searchableAttribute.getValues()))
 544  
             {
 545  
                 // multiple values entered
 546  0
                 StringBuffer tempAbbreviatedString = new StringBuffer();
 547  0
                 tempAbbreviatedString.append(searchableAttribute.getSavedKey()).append("=");
 548  0
                 boolean firstValue = true;
 549  0
                 for (String value : searchableAttribute.getValues())
 550  
                 {
 551  0
                     if (StringUtils.isNotBlank(value))
 552  
                     {
 553  0
                         if (firstValue)
 554  
                         {
 555  0
                             tempAbbreviatedString.append(value);
 556  0
                             firstValue = false;
 557  
                         } else
 558  
                         {
 559  0
                             tempAbbreviatedString.append(" or ").append(value);
 560  
                         }
 561  
                     }
 562  
                 }
 563  0
                 String testString = tempAbbreviatedString.toString().replaceAll("=", "").replaceAll(" or ", "");
 564  0
                 if (testString.trim().length() > 0)
 565  
                 {
 566  0
                     abbreviatedString.append(tempAbbreviatedString).append(";");
 567  
                 }
 568  0
             }
 569  
         }
 570  
 
 571  0
         return abbreviatedString.toString();
 572  
     }
 573  
 
 574  
     private String getRangeString(String to, String from) {
 575  0
         String dateString = null;
 576  0
         if (to != null && !"".equals(to.trim()) && from != null && !"".equals(from.trim())) {
 577  0
             dateString = "(" + from + " - " + to + ")";
 578  
         } else {
 579  0
             if (to != null && !"".equals(to.trim())) {
 580  0
                 dateString = "to " + to;
 581  0
             } else if (from != null && !"".equals(from.trim())) {
 582  0
                 dateString = "from " + from;
 583  
             } else {
 584  
                 //
 585  
             }
 586  
         }
 587  0
         return dateString;
 588  
     }
 589  
 
 590  
     /**
 591  
      * TODO this is here for historic reasons and has been replaced by a managed state in the CriteriaDTO... eliminate
 592  
      * @deprecated
 593  
      */
 594  
     public boolean isAdvancedSearch() {
 595  0
         return ((appDocId != null && !"".equals(appDocId.trim())) || (approver != null && !"".equals(approver.trim())) || (docRouteNodeId != null && !"".equals(docRouteNodeId.trim())) || (docRouteStatus != null && !"".equals(docRouteStatus.trim())) || (docTitle != null && !"".equals(docTitle.trim())) || (viewer != null && !"".equals(viewer.trim())) || (fromDateApproved != null && !"".equals(fromDateApproved.trim())) || (toDateApproved != null && !"".equals(toDateApproved.trim())) || (toDateFinalized != null && !"".equals(toDateFinalized.trim())) || (fromDateFinalized != null && !"".equals(fromDateFinalized.trim())) || (toDateLastModified != null && !"".equals(toDateLastModified.trim())) || (fromDateLastModified != null && !"".equals(fromDateLastModified.trim())));
 596  
     }
 597  
 
 598  
     /**
 599  
          * This overridden method ...
 600  
          * 
 601  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getWorkgroupViewerName()
 602  
          */
 603  
     public String getWorkgroupViewerName() {
 604  0
         return workgroupViewerName;
 605  
     }
 606  
 
 607  
     public void setWorkgroupViewerName(String workgroupViewerName) {
 608  0
         this.workgroupViewerName = workgroupViewerName;
 609  0
     }
 610  
 
 611  
     /**
 612  
          * This overridden method ...
 613  
          * 
 614  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getIsAdvancedSearch()
 615  
          */
 616  
     public String getIsAdvancedSearch() {
 617  0
         return isAdvancedSearch;
 618  
     }
 619  
 
 620  
     public void setIsAdvancedSearch(String isAdvancedSearch) {
 621  0
         this.isAdvancedSearch = isAdvancedSearch;
 622  0
     }
 623  
 
 624  
     /**
 625  
          * This overridden method ...
 626  
          * 
 627  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getSuperUserSearch()
 628  
          */
 629  
     public String getSuperUserSearch() {
 630  0
         return superUserSearch;
 631  
     }
 632  
 
 633  
     public void setSuperUserSearch(String superUserSearch) {
 634  0
         this.superUserSearch = superUserSearch;
 635  0
     }
 636  
     
 637  
 
 638  
     /**
 639  
          * This overridden method ...
 640  
          * 
 641  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#isOverThreshold()
 642  
          */
 643  
     public boolean isOverThreshold() {
 644  0
         return isOverThreshold;
 645  
     }
 646  
 
 647  
     public void setOverThreshold(boolean isOverThreshold) {
 648  0
         this.isOverThreshold = isOverThreshold;
 649  0
     }
 650  
 
 651  
     /**
 652  
          * This overridden method ...
 653  
          * 
 654  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getSecurityFilteredRows()
 655  
          */
 656  
     public int getSecurityFilteredRows() {
 657  0
         return securityFilteredRows;
 658  
     }
 659  
 
 660  
     public void setSecurityFilteredRows(int securityFilteredRows) {
 661  0
         this.securityFilteredRows = securityFilteredRows;
 662  0
     }
 663  
 
 664  
     /**
 665  
          * This overridden method ...
 666  
          * 
 667  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getThreshold()
 668  
          */
 669  
     public Integer getThreshold() {
 670  0
         return this.threshold;
 671  
     }
 672  
 
 673  
     public void setThreshold(Integer threshold) {
 674  0
         this.threshold = threshold;
 675  0
     }
 676  
 
 677  
     /**
 678  
          * This overridden method ...
 679  
          * 
 680  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getFetchLimit()
 681  
          */
 682  
     public Integer getFetchLimit() {
 683  0
         return this.fetchLimit;
 684  
     }
 685  
 
 686  
     public void setFetchLimit(Integer fetchLimit) {
 687  0
         this.fetchLimit = fetchLimit;
 688  0
     }
 689  
 
 690  
     public void addSearchableAttribute(SearchAttributeCriteriaComponent searchableAttribute) {
 691  0
         searchableAttributes.add(searchableAttribute);
 692  0
     }
 693  
 
 694  
     /**
 695  
      * @param searchableAttributes The searchableAttributes to set.
 696  
      */
 697  
     public void setSearchableAttributes(List<SearchAttributeCriteriaComponent> searchableAttributes) {
 698  0
         this.searchableAttributes = searchableAttributes;
 699  0
     }
 700  
 
 701  
     /**
 702  
          * This overridden method ...
 703  
          * 
 704  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getSearchableAttributes()
 705  
          */
 706  
     public List<SearchAttributeCriteriaComponent> getSearchableAttributes() {
 707  0
         return searchableAttributes;
 708  
     }
 709  
 
 710  
     public void setSearchableAttributeRows(List<Row> searchableAttributeRows) {
 711  0
         this.searchableAttributeRows = searchableAttributeRows;
 712  0
     }
 713  
 
 714  
     /**
 715  
          * This overridden method ...
 716  
          * 
 717  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getSearchableAttributeRows()
 718  
          */
 719  
     public List<Row> getSearchableAttributeRows() {
 720  0
         return searchableAttributeRows;
 721  
     }
 722  
 
 723  
     /**
 724  
          * This overridden method ...
 725  
          * 
 726  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getProcessedSearchableAttributeRows()
 727  
          */
 728  
     public List<Row> getProcessedSearchableAttributeRows() {
 729  0
         return searchableAttributeRows;
 730  
     }
 731  
 
 732  
     public void addSearchableAttributeRow(Row row) {
 733  0
         searchableAttributeRows.add(row);
 734  0
     }
 735  
 
 736  
     /**
 737  
          * This overridden method ...
 738  
          * 
 739  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getSearchableAttributeRow(int)
 740  
          */
 741  
     public Row getSearchableAttributeRow(int index) {
 742  0
         while (getSearchableAttributeRows().size() <= index) {
 743  0
             Row row = new Row(new ArrayList<Field>());
 744  0
             getSearchableAttributeRows().add(row);
 745  0
         }
 746  0
         return (Row) getSearchableAttributeRows().get(index);
 747  
     }
 748  
 
 749  
     public void setSearchableAttributeRow(int index, Row row) {
 750  0
         searchableAttributeRows.set(index, row);
 751  0
     }
 752  
 
 753  
     /**
 754  
          * This overridden method ...
 755  
          * 
 756  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#isOverridingUserSession()
 757  
          */
 758  
     public boolean isOverridingUserSession() {
 759  0
         return this.overridingUserSession;
 760  
     }
 761  
 
 762  
     public void setOverridingUserSession(boolean overridingUserSession) {
 763  0
         this.overridingUserSession = overridingUserSession;
 764  0
     }
 765  
 
 766  
         /**
 767  
          * This overridden method ...
 768  
          * 
 769  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#isSaveSearchForUser()
 770  
          */
 771  
         public boolean isSaveSearchForUser() {
 772  0
                 return this.saveSearchForUser;
 773  
         }
 774  
 
 775  
         public void setSaveSearchForUser(boolean saveSearchForUser) {
 776  0
                 this.saveSearchForUser = saveSearchForUser;
 777  0
         }
 778  
 
 779  
     /**
 780  
          * @deprecated
 781  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getWorkgroupViewerNamespace()
 782  
          */
 783  
     public String getWorkgroupViewerNamespace() {
 784  0
         return this.workgroupViewerNamespace;
 785  
     }
 786  
     /**
 787  
      * 
 788  
      * @deprecated
 789  
      * @param workgroupViewerNamespace
 790  
      */
 791  
     public void setWorkgroupViewerNamespace(String workgroupViewerNamespace) {
 792  0
         this.workgroupViewerNamespace = workgroupViewerNamespace;
 793  0
     }
 794  
 
 795  
         /**
 796  
          * This overridden method ...
 797  
          * 
 798  
          * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
 799  
          */
 800  
         @Override
 801  
         protected LinkedHashMap toStringMapper() {
 802  
                 // TODO chris - THIS METHOD NEEDS JAVADOCS
 803  0
                 return null;
 804  
         }
 805  
 
 806  
         /**
 807  
          * This overridden method ...
 808  
          * 
 809  
          * @see org.kuali.rice.kns.bo.BusinessObject#refresh()
 810  
          */
 811  
         public void refresh() {
 812  
                 // TODO chris - THIS METHOD NEEDS JAVADOCS
 813  
                 
 814  0
         }
 815  
 
 816  
         /**
 817  
          * This overridden method ...
 818  
          * 
 819  
          * @see org.kuali.rice.kew.docsearch.DocumentRouteHeaderEBO#getDateCreated()
 820  
          */
 821  
         public java.sql.Timestamp getDateCreated() {
 822  0
                 return this.dateCreated;
 823  
         }
 824  
 
 825  
         /**
 826  
          * @param dateCreated the dateCreated to set
 827  
          */
 828  
         public void setDateCreated(java.sql.Timestamp dateCreated) {
 829  0
                 this.dateCreated = dateCreated;
 830  0
         }
 831  
 
 832  
         /**
 833  
          * @return the onlyDocTypeFilled
 834  
          */
 835  
         public boolean isOnlyDocTypeFilled() {
 836  0
                 return this.onlyDocTypeFilled;
 837  
         }
 838  
 
 839  
         /**
 840  
          * @param onlyDocTypeFilled the onlyDocTypeFilled to set
 841  
          */
 842  
         public void setOnlyDocTypeFilled(boolean onlyDocTypeFilled) {
 843  0
                 this.onlyDocTypeFilled = onlyDocTypeFilled;
 844  0
         }
 845  
 
 846  
         /**
 847  
          * @return the workgroupViewerId
 848  
          */
 849  
         public String getWorkgroupViewerId() {
 850  0
                 return this.workgroupViewerId;
 851  
         }
 852  
 
 853  
         /**
 854  
          * @param workgroupViewerId the workgroupViewerId to set
 855  
          */
 856  
         public void setWorkgroupViewerId(String workgroupViewerId) {
 857  0
                 this.workgroupViewerId = workgroupViewerId;
 858  0
         }
 859  
 
 860  
 
 861  
 }