Interface SheetBinder


  • @Role
    public interface SheetBinder
    The interface used to bind sheets to documents and classes.
    Since:
    3.2M3
    Version:
    $Id: 44c2acf66c5d8f7e0b9e082ec1b4bcec17ed3401 $
    • Method Detail

      • getSheets

        List<DocumentReference> getSheets​(DocumentModelBridge document)
        Retrieves the list of sheets explicitly bound to a XWiki document. This method doesn't perform any checks on the returned list of sheets. The returned list can contain duplicates, sheets that doesn't exist or sheets that only some users have the right to view.
        Parameters:
        document - a XWiki document
        Returns:
        the list of sheets explicitly bound to the given document
      • getDocuments

        List<DocumentReference> getDocuments​(DocumentReference sheetReference)
        Retrieves the list of XWiki documents explicitly bound to a given sheet. This method doesn't perform any checks on the specified sheet: it may not even exist or it may not be viewable by the current user. This method simply returns the list of documents that explicitly declare they're using the specified sheet.
        Parameters:
        sheetReference - a reference to a sheet
        Returns:
        the list of XWiki documents explicitly bound to the specified sheet.
      • bind

        boolean bind​(DocumentModelBridge document,
                     DocumentReference sheetReference)
        Binds a sheet to a XWiki document. This method doesn't perform any checks on the specified sheet. The sheet may not even exist or may not be viewable by all users. The changes are not persisted until the document is saved.
        Parameters:
        document - a XWiki document
        sheetReference - a reference to a sheet
        Returns:
        true if the sheet was successfully bound to the given document, false otherwise (e.g. if the specified sheet was already bound to the given document)
      • bind

        default boolean bind​(DocumentModelBridge document,
                             EntityReference sheetReference)
        Binds a sheet to a XWiki document. This method doesn't perform any checks on the specified sheet. The sheet may not even exist or may not be viewable by all users. The changes are not persisted until the document is saved.
        Parameters:
        document - a XWiki document
        sheetReference - a reference to a sheet
        Returns:
        true if the sheet was successfully bound to the given document, false otherwise (e.g. if the specified sheet was already bound to the given document)
        Since:
        9.0
      • unbind

        boolean unbind​(DocumentModelBridge document,
                       DocumentReference sheetReference)
        Removes the binding between a sheet and a XWiki document. The changes are not persisted until the document is saved.
        Parameters:
        document - a XWiki document
        sheetReference - a reference to a sheet
        Returns:
        true if the sheet was successfully unbound from the given document, false otherwise (e.g. if the specified sheet wasn't bound to the given document)