Interface MTDocumentQuery

All Superinterfaces:
MTContextQuery, MTDateFilterQuery, MTMissingTranslationsQuery, MTPatternQuery, MTQuery, MTSortableQuery

  • Method Details

    • selectAll

      MTDocumentQuery selectAll()
      Selects all documents in the workspace.
    • selectUnused

      MTDocumentQuery selectUnused()
      Selects all documents that are not connected to any models or symbols.
    • select

      MTDocumentQuery select(List<Long> ids)
      Selects documents by their ID.
      Parameters:
      ids - The ID:s of the documents to select.
    • selectByUUID

      MTDocumentQuery selectByUUID(List<String> uuids)
      Selects documents by their UUID.
      Parameters:
      uuids - The UUIDS:s of the documents to select.
    • select

      MTDocumentQuery select(MTList list)
      Selects documents by executing a list.
      Parameters:
      list - The list to execute.
      Throws:
      IllegalArgumentException - If list.getResultType() != MTList.ResultType.DOCUMENT.
    • selectByNamedQuery

      MTDocumentQuery selectByNamedQuery(MTNamedQuery namedQuery)
      Selects from a named query. This way you can base queries on other named queries and filter them further.
      Parameters:
      namedQuery - The named query to base this query on.
    • withTypes

      MTDocumentQuery withTypes(boolean includeNoDocumentTypes, MTDocumentTypeHeader... type)
      Exclude all documents that does not have one of the given types.
      Parameters:
      includeNoDocumentTypes - If true then documents with no types will be included in the result.
      type - The types to include
    • withPattern

      MTDocumentQuery withPattern(String pattern, MTLanguage language, boolean exactMatch, boolean ignoreCase)
      Excludes results where the title does not contain pattern as a substring.
      Specified by:
      withPattern in interface MTPatternQuery
      Parameters:
      pattern - The pattern to search for.
      language - The language of the title to find the pattern in.
      exactMatch - Require the pattern to match the title exactly rather than containing the pattern.
      ignoreCase - Ignores case. This makes "exact match" check lowercase strings for equality and "contains match" check lowercase for contains.
    • sort

      MTDocumentQuery sort(MTQuery.SortColumn sortColumn, boolean ascending, MTLanguage language, Locale locale)
      Sorts the selected documents.
      Specified by:
      sort in interface MTSortableQuery
      Parameters:
      sortColumn - The column to sort by
      ascending - true for ascending order, false for descending
      language - The language to sort by
      locale - the locale to use when sorting
    • withChangesSince

      MTDocumentQuery withChangesSince(Date date)
      Excludes documents that have not been modified since a given date.
      Specified by:
      withChangesSince in interface MTDateFilterQuery
      Parameters:
      date - The date to compare against.
    • withCreators

      MTDocumentQuery withCreators(MTUserHeader... creators)
      Retains only documents with at least one of the given users set as creator of the model.
      Parameters:
      creators - The accepted creators.
    • withOwners

      MTDocumentQuery withOwners(MTUserHeader... owners)
      Retains only documents with at least one of the given users set as owner of the model.
      Parameters:
      owners - The accepted owners.
    • withGroups

      MTDocumentQuery withGroups(MTGroupHeader... groups)
      Retains only documents with at least one of the given groups set as group of the document.
      Parameters:
      groups - The accepted groups.
    • withLastModifiedBy

      MTDocumentQuery withLastModifiedBy(MTUserHeader... modifiers)
      Retains only documents that was last modified by one of the given users
      Parameters:
      modifiers - The accepted modifiers.
    • withDocumentRoots

      MTDocumentQuery withDocumentRoots(boolean includeNoRoots, MTVariable... roots)
      Retains only documents that are using at least one of the given document roots.
      Parameters:
      includeNoRoots - If true then documents with no document roots will be included.
      roots - The accepted roots.
    • storeContexts

      MTDocumentQuery storeContexts(MTQuery.ResultContext... contexts)
      Description copied from interface: MTContextQuery
      Stores the selected contexts for the results of the query, for filtering and grouping of results.
      Specified by:
      storeContexts in interface MTContextQuery