com.xpn.xwiki.script.sheet
Class SheetScriptService

java.lang.Object
  extended by com.xpn.xwiki.script.sheet.SheetScriptService
All Implemented Interfaces:
org.xwiki.script.service.ScriptService

@Component
@Named(value="sheet")
@Singleton
public class SheetScriptService
extends Object
implements org.xwiki.script.service.ScriptService

Exposes SheetManager and SheetBinder to Velocity scripts.

Since:
3.2M3
Version:
$Id: 78b8e1cf913f16f4b49b7deab44cc6ef45e37dac $

Constructor Summary
SheetScriptService()
           
 
Method Summary
 boolean bindClassSheet(Document classDocument, DocumentReference sheetReference)
          Binds a sheet to a XWiki class.
 boolean bindDocumentSheet(Document document, DocumentReference sheetReference)
          Binds a sheet to a XWiki document.
 List<DocumentReference> getClassSheets(Document classDocument)
          Retrieves the list of sheets explicitly bound to a XWiki class.
 List<DocumentReference> getDocuments(DocumentReference sheetReference)
          Retrieves the list of documents that have explicitly bound the specified sheet.
 List<DocumentReference> getDocumentSheets(Document document)
          Retrieves the list of sheets explicitly bound to a XWiki document.
 List<DocumentReference> getSheets(Document document, String action)
          Returns the list of sheets associated with a XWiki document.
 boolean unbindClassSheet(Document classDocument, DocumentReference sheetReference)
          Removes the binding between a XWiki class and a sheet.
 boolean unbindDocumentSheet(Document document, DocumentReference sheetReference)
          Removes the binding between a XWiki document and a sheet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SheetScriptService

public SheetScriptService()
Method Detail

getSheets

public List<DocumentReference> getSheets(Document document,
                                         String action)
Returns the list of sheets associated with a XWiki document.

Parameters:
document - the document for which to retrieve the sheets
action - the action for which to retrieve the sheets ('view', 'edit' etc.)
Returns:
the list of sheets available for the specified document on the specified action; these are sheets designed to be displayed when the specified action is performed on the given document; only the sheets that the current user has the right to view are returned

getClassSheets

public List<DocumentReference> getClassSheets(Document classDocument)
Retrieves the list of sheets explicitly bound to a XWiki class.

Parameters:
classDocument - a document holding a class definition
Returns:
the list of sheets explicitly bound to the given class; these are sheets designed to be applied to documents that have objects of the given class; only the sheets that the current user has the right to view are returned

bindClassSheet

public boolean bindClassSheet(Document classDocument,
                              DocumentReference sheetReference)
Binds a sheet to a XWiki class. Changes are not persisted until the class document is saved.

Parameters:
classDocument - a document holding a class definition
sheetReference - a reference to a sheet
Returns:
true if the sheet was successfully bound, false otherwise

unbindClassSheet

public boolean unbindClassSheet(Document classDocument,
                                DocumentReference sheetReference)
Removes the binding between a XWiki class and a sheet. Changes are not persisted until the class document is saved.

Parameters:
classDocument - a document holding a class definition
sheetReference - a reference to a sheet
Returns:
true if the sheet was successfully unbound, false otherwise

getDocumentSheets

public List<DocumentReference> getDocumentSheets(Document document)
Retrieves the list of sheets explicitly bound to a XWiki document.

Parameters:
document - a XWiki document
Returns:
the list of sheets explicitly bound to the given document; only the sheets that the current user has the right to view are returned

bindDocumentSheet

public boolean bindDocumentSheet(Document document,
                                 DocumentReference sheetReference)
Binds a sheet to a XWiki document. 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, false otherwise

unbindDocumentSheet

public boolean unbindDocumentSheet(Document document,
                                   DocumentReference sheetReference)
Removes the binding between a XWiki document and a sheet. 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, false otherwise

getDocuments

public List<DocumentReference> getDocuments(DocumentReference sheetReference)
Retrieves the list of documents that have explicitly bound the specified sheet.

Parameters:
sheetReference - a reference to a sheet
Returns:
the list of documents that have the specified sheet explicitly bound


Copyright © 2004–2014 XWiki. All rights reserved.