Interface ContentQueryRow

  • All Known Subinterfaces:
    ContentViewerRowModel

    public interface ContentQueryRow
    A row returned from a ContentQuery.
    • Method Detail

      • getDocumentLevel

        int getDocumentLevel()
        Returns the traversal level of the row. If the query has no traversal specified, always returns 1.
        Returns:
        traversal level of the document
      • getNextLevelRowSet

        ContentQueryRowSet getNextLevelRowSet()
        Traverse to next level and return the row set for that level.

        Applicable if you've included either traverseUp or traverseDown in the query configuration.

        Next level means further into the returned result set:

        • When using traverseUp you will get the ancestors of the current document.
        • When using traverseDown you will get the descendants of the current document.
      • getDocumentId

        int getDocumentId()
        Returns the document id of the underlying document.
        Returns:
        the document id of the underlying document
      • getDocument

        Document getDocument()
        Returns the underlying document.
        Returns:
        the underlying document
      • getStorageType

        ContentQueryRow.STORAGE_TYPE getStorageType()
        Returns the storage type of the underlying document.
        Returns:
        the storage type of the underlying document
      • getItems

        Map<String,​? extends ContentQueryItem> getItems()
        Returns a map of items specified in the ContentQuery select-list. Multiple calls to this method will always return the same map.
        Returns:
        a map of items specified in the ContentQuery select-list
      • getItem

        Optional<ContentQueryItem> getItem​(String externalKey)
        Returns an Optional of an item in the ContentQuery select-list. Multiple calls to this method will return distinct Optionals, but any underlying item will be the same.
        Parameters:
        externalKey - name of item to get
        Returns:
        an Optional of an item in the ContentQuery select-list
      • getValue

        Map<String,​Object> getValue()
        Returns a map of single value elements corresponding to the select-items of a query. If an item is multi-valued, accessing it through this map will cause an error The method returns the same map every time it is called for the same row.
        Returns:
        a map of value-lists corresponding to the select-items of a query
      • getValues

        Map<String,​List<Object>> getValues()
        Returns a map of value-lists corresponding to the select-items of a query. The method returns the same map every time it is called for the same row.
        Returns:
        a map of value-lists corresponding to the select-items of a query
      • getValue

        Optional<Object> getValue​(String externalKey)
        Returns an Optional value of an item in the ContentQuery select-list. This is the equivalent of calling getItem(externalKey).getValue().
        Parameters:
        externalKey - name of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getItem(String)
      • getValues

        List<Object> getValues​(String externalKey)
        Returns a List of values of an item in the ContentQuery select-list. This is the equivalent of calling getItem(externalKey).getValues().
        Parameters:
        externalKey - name of item to get
        Returns:
        a List of values of an item in the ContentQuery select-list
        See Also:
        getItem(String)
      • getValue

        <T> Optional<T> getValue​(ObjectExpressionType<T> expression)
        Returns an Optional value of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getValue(String)
      • getValues

        <T> List<T> getValues​(ObjectExpressionType<T> expression)
        Returns a list of values of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        List of values for the item; may be empty.
        See Also:
        getValues(String)
      • getValue

        Optional<Instant> getValue​(DateExpressionType expression)
        Returns an Optional value of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getValue(String)
      • getValues

        List<Instant> getValues​(DateExpressionType expression)
        Returns a list of values of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        List of values for the item; may be empty.
        See Also:
        getValues(String)
      • getValue

        Optional<Number> getValue​(NumberExpressionType expression)
        Returns an Optional value of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getValue(String)
      • getValues

        List<Number> getValues​(NumberExpressionType expression)
        Returns a list of values of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        List of values for the item; may be empty.
        See Also:
        getValues(String)
      • getValue

        Optional<String> getValue​(StringExpressionType expression)
        Returns an Optional value of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getValue(String)
      • getValues

        List<String> getValues​(StringExpressionType expression)
        Returns a list of values of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        List of values for the item; may be empty.
        See Also:
        getValues(String)
      • getValue

        Optional<Document> getValue​(XmlExpressionType expression)
        Returns an Optional value of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getValue(String)
      • getValues

        List<Document> getValues​(XmlExpressionType expression)
        Returns a list of values of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        List of values for the item; may be empty.
        See Also:
        getValues(String)
      • getValue

        Optional<javax.activation.DataSource> getValue​(FileExpressionType expression)
        Returns an Optional value of an item in the ContentQuery select-list. If there is no such item, the returned optional will be empty.
        Parameters:
        expression - expression of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getValue(String)
      • getValues

        List<javax.activation.DataSource> getValues​(FileExpressionType expression)
        Returns a List of values of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        a List of values of an item in the ContentQuery select-list
        See Also:
        getValues(String)
      • getValue

        Optional<ObjectReference> getValue​(ObjectReferenceExpressionType expression)
        Returns an Optional value of an item in the ContentQuery select-list. If there is no such item, the returned optional will be empty.
        Parameters:
        expression - expression of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getValue(String)
      • getAction

        Map<String,​Object> getAction()
        Returns a map of single value elements corresponding to the select-items of a query. If an item is multi-valued, accessing it through this map will cause an error The method returns the same map every time it is called for the same row.
        Returns:
        a map of value-lists corresponding to the select-items of a query
      • getActions

        Map<String,​List<Object>> getActions()
        Returns a map of value-lists corresponding to the select-items of a query. The method returns the same map every time it is called for the same row.
        Returns:
        a map of value-lists corresponding to the select-items of a query
      • getAction

        Optional<Object> getAction​(String externalKey)
        Returns an Optional value of an item in the ContentQuery select-list. This is the equivalent of calling getItem(externalKey).getAction().
        Parameters:
        externalKey - name of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getItem(String)
      • getActions

        List<Object> getActions​(String externalKey)
        Returns a List of values of an item in the ContentQuery select-list. This is the equivalent of calling getItem(externalKey).getAction().
        Parameters:
        externalKey - name of item to get
        Returns:
        a List of values of an item in the ContentQuery select-list
        See Also:
        getItem(String)
      • getAction

        Optional<ContentQueryFile> getAction​(FileExpressionType expression)
        Returns an Optional value of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        an Optional value of an item in the ContentQuery select-list
        See Also:
        getAction(String)
      • getActions

        List<ContentQueryFile> getActions​(FileExpressionType expression)
        Returns a List of values of an item in the ContentQuery select-list.
        Parameters:
        expression - expression of item to get
        Returns:
        a List of values of an item in the ContentQuery select-list
        See Also:
        getAction(String)
      • setAttribute

        void setAttribute​(String name,
                          Object o)
        Stores an attribute in this row.
        Parameters:
        name - name of the attribute to store
        o - the value to be stored
      • getAttributes

        Map<String,​Object> getAttributes()
        Returns an immutable map with all the attributes set for this row.
        Returns:
        an immutable map of attributes.
      • getEditActionBuilder

        EditActionBuilder getEditActionBuilder()
        Returns a builder for generating edit document link based on build parameters. The builder is an customizable alternative to using the editAction directly
        Returns:
        a builder for edit action
      • getEditAction

        Optional<ContentQueryAction> getEditAction()
        Returns an Optional action for editing the document. The optional will be empty if there is no such action, for example when the user does not have the required permissions. The returned action is an indirect action, pointing at a URL which will redirect to the actual editing URL. The action does therefore not support target-specific window options and the like.
        Returns:
        an Optional action for editing the document
      • getEditWebdavAction

        Optional<ContentQueryAction> getEditWebdavAction()
        Returns an Optional action for editing the document using WebDAV. The optional will be empty if there is no such action, for example when the document type does not support it, or when the user does not have the required permissions.
        Returns:
        an Optional action for editing the document using WebDAV
      • getDeleteAction

        Optional<ContentQueryAction> getDeleteAction()
        Returns an Optional action for deleting the document. The optional will be empty if there is no such action, for example when the user does not have the required permissions.

        For versioned documents: Usage of this action requires that "IKB$VERSION_STATUS" has been selected in the content query.

        Returns:
        an Optional action for deleting the document
        Throws:
        RuntimeException - if "IKB$VERSION_STATUS" is missing for versioned documents
      • getDocumentLink

        Optional<ContentQueryAction> getDocumentLink()
        Returns an Optional action for viewing the document "in context". The returned action is an indirect action, pointing at a URL which will redirect to the actual editing URL. The action does therefore not support target-specific window options and the like.
        Returns:
        an Optional action for viewing the document
      • getContentLinkBuilder

        ContentLinkBuilder getContentLinkBuilder()
        Returns a builder for generating content link based on build parameters. The builder is an customizable alternative to using the contentLink directly
        Returns:
        a builder for content link
      • getTransformationClient

        RowTransformationClient getTransformationClient()
        Returns a builder for performing transformations on file-based content.
        Returns:
        a builder for transformation.
      • getContentLink

        Optional<ContentQueryAction> getContentLink()
        Returns an Optional action for retrieving the document content.
        Returns:
        an Optional action for retrieving the document content.
      • toBean

        <T> T toBean​(Class<T> clazz)
        Returns a view of this ContentQueryRow as a bean with the given type
        Parameters:
        clazz - Java class to map into
        Returns:
        ContentQueryRow mapped into new instance of clazz
      • toBean

        <T> T toBean​(Class<T> clazz,
                     Object... autowireObjects)
        Returns a view of this ContentQueryRow as a bean with the given type

        Supports @Autowired fields using the specified autowireObjects and a @PostConstruct annotated method will be called afterwards if present.

        Parameters:
        clazz - Java class to map into
        autowireObjects - add any additional objects you wish to autowire. ContentQueryRow is always available for autowiring.
        Returns:
        ContentQueryRow mapped into new instance of clazz
      • toBean

        <T> T toBean​(Class<T> clazz,
                     BiConsumer<ContentQueryRow,​T> beanPostProcessor)
        Returns a view of this ContentQueryRow as a bean with the given type
        Parameters:
        clazz - Java class to map into
        beanPostProcessor - BiConsumer allowing additional processing using ContentQueryRow and the mapped bean.
        Returns:
        ContentQueryRow mapped into new instance of clazz