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