Class DocumentSearchCriteria.Builder

java.lang.Object
org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder
All Implemented Interfaces:
Serializable, ModelBuilder, DocumentSearchCriteriaContract
Enclosing class:
DocumentSearchCriteria

public static final class DocumentSearchCriteria.Builder extends Object implements Serializable, ModelBuilder, DocumentSearchCriteriaContract
A builder which can be used to construct DocumentSearchCriteria instances. Enforces the constraints of the DocumentSearchCriteriaContract.
See Also:
  • Method Details

    • create

      public static DocumentSearchCriteria.Builder create()
      Creates an empty builder instance. All collections on the new instance are initialized to empty collections.
      Returns:
      a new builder instance
    • create

      Creates a new builder instance initialized with copies of the properties from the given contract.
      Parameters:
      contract - the contract from which to copy properties
      Returns:
      a builder instance initialized with properties from the given contract
      Throws:
      IllegalArgumentException - if the given contract is null
    • build

      public DocumentSearchCriteria build()
      Specified by:
      build in interface ModelBuilder
    • getDocumentId

      public String getDocumentId()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the document id criteria to search against when executing the document search.
      Specified by:
      getDocumentId in interface DocumentSearchCriteriaContract
      Returns:
      the document id criteria
    • getDocumentStatuses

      public List<DocumentStatus> getDocumentStatuses()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns an unmodifiable list of document statuses to search against when executing the document search. If there is more than one of these, then the search should treat this as an "OR" case (i.e. search for documents with one or more of these statuses).
      Specified by:
      getDocumentStatuses in interface DocumentSearchCriteriaContract
      Returns:
      the document status criteria
    • getDocumentStatusCategories

      public List<DocumentStatusCategory> getDocumentStatusCategories()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns an unmodifiable list of document status categories to search against when executing the document search. If there is more than one of these, then the search should treat this as an "OR" case (i.e. search for documents that have a status contained in one or more of these categories).
      Specified by:
      getDocumentStatusCategories in interface DocumentSearchCriteriaContract
      Returns:
      the document status category criteria
    • getTitle

      public String getTitle()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the document title criteria to search against when executing the document search.
      Specified by:
      getTitle in interface DocumentSearchCriteriaContract
      Returns:
      the title criteria
    • getApplicationDocumentId

      public String getApplicationDocumentId()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the application document id criteria to search against when executing the document search.
      Specified by:
      getApplicationDocumentId in interface DocumentSearchCriteriaContract
      Returns:
      the application document id criteria
    • getApplicationDocumentStatus

      @Deprecated public String getApplicationDocumentStatus()
      Deprecated.
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the application document status criteria to search against when executing the document search.
      Specified by:
      getApplicationDocumentStatus in interface DocumentSearchCriteriaContract
      Returns:
      the application document status criteria
    • getInitiatorPrincipalName

      @Deprecated public String getInitiatorPrincipalName()
      Deprecated.
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the criteria for the principal name of the document initiator to search against when executing the document search. Follows the rules for principal name criteria (see class-level documentation).
      Specified by:
      getInitiatorPrincipalName in interface DocumentSearchCriteriaContract
      Returns:
      the initiator principal name criteria
    • getInitiatorPrincipalId

      public String getInitiatorPrincipalId()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the criteria for the principal id of the document initiator to search against when executing the document search.
      Specified by:
      getInitiatorPrincipalId in interface DocumentSearchCriteriaContract
      Returns:
      the initiator principal id criteria
    • getViewerPrincipalName

      @Deprecated public String getViewerPrincipalName()
      Deprecated.
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the criteria for the principal name of a "viewer" of a document (someone who received an action request related to the document) to search against when executing the document search. Follows the rules for principal name criteria (see class-level documentation).
      Specified by:
      getViewerPrincipalName in interface DocumentSearchCriteriaContract
      Returns:
      the viewer principal name criteria
    • getViewerPrincipalId

      public String getViewerPrincipalId()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the criteria for the principal id of a "viewer" of a document (someone who received an action request related to the document) to search against when executing the document search.
      Specified by:
      getViewerPrincipalId in interface DocumentSearchCriteriaContract
      Returns:
      the viewer principal id criteria
    • getGroupViewerId

      public String getGroupViewerId()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the criteria for the id of a group who is a "viewer" of a document (a group who received an action request related to the document) to search against when executing the document search. Group id criteria follows rules similar to principal name criteria:
      • only literal group ids that resolve to a valid group are allowed
      • however, if the group ids don't resolve to valid groups, this simply means the search will return no results
      • "!" is allowed before a group id
      • when wanting to search on more than one viewer group id, use of "|" and "&&" is allowed, though they cannot be used together
      Specified by:
      getGroupViewerId in interface DocumentSearchCriteriaContract
      Returns:
      the viewer principal name criteria
    • getGroupViewerName

      public String getGroupViewerName()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the criteria for the name of a group who is a "viewer" of a document (a group who received an action request related to the document) to search against when executing the document search. Group name criteria follows rules similar to principal name criteria:
      • only literal group names that resolve to a valid group are allowed
      • however, if the group names don't resolve to valid groups, this simply means the search will return no results
      • "!" is allowed before a group id
      • when wanting to search on more than one viewer group name, use of "|" and "&&" is allowed, though they cannot be used together
      Specified by:
      getGroupViewerName in interface DocumentSearchCriteriaContract
      Returns:
      the viewer principal name criteria
    • getApproverPrincipalName

      @Deprecated public String getApproverPrincipalName()
      Deprecated.
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the criteria for the principal name of an "approver" of a document (someone who took action against the document) to search against when executing the document search. Follows the rules for principal name criteria (see class-level documentation).
      Specified by:
      getApproverPrincipalName in interface DocumentSearchCriteriaContract
      Returns:
      the viewer principal name criteria
    • getApproverPrincipalId

      public String getApproverPrincipalId()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the criteria for the principal id of an "approver" of a document (someone who took action against the document) to search against when executing the document search.
      Specified by:
      getApproverPrincipalId in interface DocumentSearchCriteriaContract
      Returns:
      the viewer principal id criteria
    • getRouteNodeName

      public String getRouteNodeName()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the route node name criteria to search against when executing the document search. By default this will match only documents which are at the node with the given name, unless DocumentSearchCriteriaContract.getRouteNodeLookupLogic() returns a non-null value that specifies different criteria for how the route node-based lookup should be performed.
      Specified by:
      getRouteNodeName in interface DocumentSearchCriteriaContract
      Returns:
      the route node name criteria
    • getRouteNodeLookupLogic

      public RouteNodeLookupLogic getRouteNodeLookupLogic()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the logic that should be used when performing a document search against the route name. This essentially allows for the criteria to specify whether or not it should look at documents which are currently before, exactly at, or after the specified route node. This value only has an effect if the route node name is also defined on this criteria.
      Specified by:
      getRouteNodeLookupLogic in interface DocumentSearchCriteriaContract
      Returns:
      the route node lookup logic to use in conjunction with the route node name criteria
    • getDocumentTypeName

      public String getDocumentTypeName()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the document type name criteria to search against when executing the document search. If the document type name matches a single document type exactly, this might trigger document search customizations which are tied to that document type (assuming the document type has such customizations configured).

      In order for the map of document attribute values to be properly searchable, this document type name should result to a valid document type. This is because the document type itself defines information about custom document attributes and the parameters around how searches against those attributes can be executed.

      Note that searches against a document type name should be document type hierarchy-aware. Meaning that the search should also return results for any documents that have document types that are children of the specified document type name (assuming that the specified document type name is valid and not wildcarded at all).

      Specified by:
      getDocumentTypeName in interface DocumentSearchCriteriaContract
      Returns:
      the document type name criteria
    • getAdditionalDocumentTypeNames

      public List<String> getAdditionalDocumentTypeNames()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns an optional list of additional document type name criteria against which to search. The search should effectively return all documents that have a document type name within the set of the main document type name on the criteria as well as any additional document type names.

      As with DocumentSearchCriteriaContract.getDocumentTypeName(), the additional document type name criteria is document type hierarchy aware.

      Specified by:
      getAdditionalDocumentTypeNames in interface DocumentSearchCriteriaContract
      Returns:
      the list of additional document type names to use on the search criteria
    • getDateCreatedFrom

      public org.joda.time.DateTime getDateCreatedFrom()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive lower end of the date created criteria to search against when executing the document search.
      Specified by:
      getDateCreatedFrom in interface DocumentSearchCriteriaContract
      Returns:
      the date created "from" criteria
    • getDateCreatedTo

      public org.joda.time.DateTime getDateCreatedTo()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive upper end of the date created criteria to search against when executing the document search.
      Specified by:
      getDateCreatedTo in interface DocumentSearchCriteriaContract
      Returns:
      the date created "to" criteria
    • getDateLastModifiedFrom

      public org.joda.time.DateTime getDateLastModifiedFrom()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive lower end of the date last modified criteria to search against when executing the document search.
      Specified by:
      getDateLastModifiedFrom in interface DocumentSearchCriteriaContract
      Returns:
      the date last modified "from" criteria
    • getDateLastModifiedTo

      public org.joda.time.DateTime getDateLastModifiedTo()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive upper end of the date last modified criteria to search against when executing the document search.
      Specified by:
      getDateLastModifiedTo in interface DocumentSearchCriteriaContract
      Returns:
      the date last modified "to" criteria
    • getDateApprovedFrom

      public org.joda.time.DateTime getDateApprovedFrom()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive lower end of the date approved criteria to search against when executing the document search.
      Specified by:
      getDateApprovedFrom in interface DocumentSearchCriteriaContract
      Returns:
      the date approved "from" criteria
    • getDateApprovedTo

      public org.joda.time.DateTime getDateApprovedTo()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive upper end of the date approved criteria to search against when executing the document search.
      Specified by:
      getDateApprovedTo in interface DocumentSearchCriteriaContract
      Returns:
      the date approved "tp" criteria
    • getDateFinalizedFrom

      public org.joda.time.DateTime getDateFinalizedFrom()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive lower end of the date finalized criteria to search against when executing the document search.
      Specified by:
      getDateFinalizedFrom in interface DocumentSearchCriteriaContract
      Returns:
      the date finalized "from" criteria
    • getDateFinalizedTo

      public org.joda.time.DateTime getDateFinalizedTo()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive upper end of the date finalized criteria to search against when executing the document search.
      Specified by:
      getDateFinalizedTo in interface DocumentSearchCriteriaContract
      Returns:
      the date finalized "to" criteria
    • getDateApplicationDocumentStatusChangedFrom

      public org.joda.time.DateTime getDateApplicationDocumentStatusChangedFrom()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive lower end of the date of application document status change criteria to search against when executing the document search.
      Specified by:
      getDateApplicationDocumentStatusChangedFrom in interface DocumentSearchCriteriaContract
      Returns:
      the date application document status changed "from" criteria
    • getDateApplicationDocumentStatusChangedTo

      public org.joda.time.DateTime getDateApplicationDocumentStatusChangedTo()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the inclusive upper end of the date of application document status change criteria to search against when executing the document search.
      Specified by:
      getDateApplicationDocumentStatusChangedTo in interface DocumentSearchCriteriaContract
      Returns:
      the date application document status changed "to" criteria
    • getDocumentAttributeValues

      public Map<String,List<String>> getDocumentAttributeValues()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns a map of document attribute values to search against when executing the document search. The key of the map is the name of the document attribute, while the list of values contains values of those attributes to search against. These individual attribute values support the different search operations where appropriate. The resulting List of criteria values however should ultimately be "or"-ed together when executing the document search.

      In order for the document attribute values to be processed as part of the criteria during the search, the DocumentSearchCriteriaContract.getDocumentTypeName() must return a valid name of a document type which is configured to understand the attributes passed as part of the document attribute values map.

      Specified by:
      getDocumentAttributeValues in interface DocumentSearchCriteriaContract
      Returns:
    • getSearchOptions

      public Map<String,List<String>> getSearchOptions()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns a map of custom options for document search when either executing the document search or returning results. The key of the map is the name of the document attribute, while the list of values contains values of those attributes to customize against.

      In order for the search options to be processed as part of the criteria during the search, a custom document search customizer must be used to fill and process these values.

      Specified by:
      getSearchOptions in interface DocumentSearchCriteriaContract
      Returns:
    • getSaveName

      public String getSaveName()
      Description copied from interface: DocumentSearchCriteriaContract
      Return the name under which to save this criteria so that it can be recalled and used again in the future. If no save name is specified, then this criteria will not be saved for future use.
      Specified by:
      getSaveName in interface DocumentSearchCriteriaContract
      Returns:
    • getStartAtIndex

      public Integer getStartAtIndex()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the 0-based index in the result set at which to start returning results from a document search which is performed using this criteria. If not specified, results from the search should be returned starting at the beginning of the result set. If this index is larger then the total number of results returned by the actual search, then no values should be returned.
      Specified by:
      getStartAtIndex in interface DocumentSearchCriteriaContract
      Returns:
      the index in the result set at which to begin returning results
    • getMaxResults

      public Integer getMaxResults()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the requested maximum number of documents that should be returned from a document search performed using this criteria. If not specified, it is up to the document search implementation to decide how many results to return. It is likely in such cases that the implementation will use a default result cap in order to prevent too many documents from being returned.

      It is important to note that this value is meant simply as a request to the document search for the number of results to return. The implementation may return fewer results then requested if it decides to impose it's own internal cap on results.

      Specified by:
      getMaxResults in interface DocumentSearchCriteriaContract
      Returns:
      the requested number of maximum document results that should be returned from the search
    • getIsAdvancedSearch

      public String getIsAdvancedSearch()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns a string that indicates if a query was run in advanced mode.
      Specified by:
      getIsAdvancedSearch in interface DocumentSearchCriteriaContract
      Returns:
      whether or not the search was run in advanced mode
    • getApplicationDocumentStatuses

      public List<String> getApplicationDocumentStatuses()
      Description copied from interface: DocumentSearchCriteriaContract
      Return the list of application document statuses to match when executing the document search.
      Specified by:
      getApplicationDocumentStatuses in interface DocumentSearchCriteriaContract
      Returns:
      the list of application document statuses to match
    • getDocSearchUserId

      public String getDocSearchUserId()
      Description copied from interface: DocumentSearchCriteriaContract
      Returns the principalId of the user performing the search
      Specified by:
      getDocSearchUserId in interface DocumentSearchCriteriaContract
      Returns:
    • setDocumentId

      public void setDocumentId(String documentId)
    • setDocumentStatuses

      public void setDocumentStatuses(List<DocumentStatus> documentStatuses)
    • setDocumentStatusCategories

      public void setDocumentStatusCategories(List<DocumentStatusCategory> documentStatusCategories)
    • setTitle

      public void setTitle(String title)
    • setApplicationDocumentId

      public void setApplicationDocumentId(String applicationDocumentId)
    • setApplicationDocumentStatus

      @Deprecated public void setApplicationDocumentStatus(String applicationDocumentStatus)
    • setInitiatorPrincipalName

      @Deprecated public void setInitiatorPrincipalName(String initiatorPrincipalName)
      Deprecated.
      Parameters:
      initiatorPrincipalName -
    • setInitiatorPrincipalId

      public void setInitiatorPrincipalId(String initiatorPrincipalId)
    • setViewerPrincipalName

      @Deprecated public void setViewerPrincipalName(String viewerPrincipalName)
      Deprecated.
      Parameters:
      viewerPrincipalName -
    • setViewerPrincipalId

      public void setViewerPrincipalId(String viewerPrincipalId)
    • setGroupViewerId

      public void setGroupViewerId(String groupViewerId)
    • setGroupViewerName

      public void setGroupViewerName(String groupViewerName)
    • setApproverPrincipalName

      @Deprecated public void setApproverPrincipalName(String approverPrincipalName)
      Deprecated.
      Parameters:
      approverPrincipalName -
    • setApproverPrincipalId

      public void setApproverPrincipalId(String approverPrincipalId)
    • setRouteNodeName

      public void setRouteNodeName(String routeNodeName)
    • setRouteNodeLookupLogic

      public void setRouteNodeLookupLogic(RouteNodeLookupLogic routeNodeLookupLogic)
    • setDocumentTypeName

      public void setDocumentTypeName(String documentTypeName)
    • setAdditionalDocumentTypeNames

      public void setAdditionalDocumentTypeNames(List<String> additionalDocumentTypeNames)
    • setDateCreatedFrom

      public void setDateCreatedFrom(org.joda.time.DateTime dateCreatedFrom)
    • setDateCreatedTo

      public void setDateCreatedTo(org.joda.time.DateTime dateCreatedTo)
    • setDateLastModifiedFrom

      public void setDateLastModifiedFrom(org.joda.time.DateTime dateLastModifiedFrom)
    • setDateLastModifiedTo

      public void setDateLastModifiedTo(org.joda.time.DateTime dateLastModifiedTo)
    • setDateApprovedFrom

      public void setDateApprovedFrom(org.joda.time.DateTime dateApprovedFrom)
    • setDateApprovedTo

      public void setDateApprovedTo(org.joda.time.DateTime dateApprovedTo)
    • setDateFinalizedFrom

      public void setDateFinalizedFrom(org.joda.time.DateTime dateFinalizedFrom)
    • setDateFinalizedTo

      public void setDateFinalizedTo(org.joda.time.DateTime dateFinalizedTo)
    • setDateApplicationDocumentStatusChangedFrom

      public void setDateApplicationDocumentStatusChangedFrom(org.joda.time.DateTime dateApplicationDocumentStatusChangedFrom)
    • setDateApplicationDocumentStatusChangedTo

      public void setDateApplicationDocumentStatusChangedTo(org.joda.time.DateTime dateApplicationDocumentStatusChangedTo)
    • setDocumentAttributeValues

      public void setDocumentAttributeValues(Map<String,List<String>> documentAttributeValues)
    • addDocumentAttributeValue

      public void addDocumentAttributeValue(String name, String value)
      add document attribute value to an internal map
      Parameters:
      name - - the attribute name
      value - - the attribute value
    • setSearchOptions

      public void setSearchOptions(Map<String,List<String>> searchOptions)
    • setSaveName

      public void setSaveName(String saveName)
    • setStartAtIndex

      public void setStartAtIndex(Integer startAtIndex)
    • setMaxResults

      public void setMaxResults(Integer maxResults)
    • setIsAdvancedSearch

      public void setIsAdvancedSearch(String isAdvancedSearch)
    • setApplicationDocumentStatuses

      public void setApplicationDocumentStatuses(List<String> applicationDocumentStatuses)
      Since:
      2.1.2
    • setDocSearchUserId

      public void setDocSearchUserId(String docSearchUserId)
    • normalizeDateTimes

      public void normalizeDateTimes()
      Resets DateTimes to local TimeZone (preserving absolute time)
      See Also: