Package com.xpn.xwiki.script.sheet
Class SheetScriptService
- java.lang.Object
-
- com.xpn.xwiki.script.sheet.SheetScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Named("sheet") @Singleton public class SheetScriptService extends Object implements org.xwiki.script.service.ScriptService
ExposesSheetManager
andSheetBinder
to Velocity scripts.- Since:
- 3.2M3
- Version:
- $Id: a711de29f6409093d32f9777ba18e08e40881e3e $
-
-
Constructor Summary
Constructors Constructor Description SheetScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 sheetsaction
- 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 definitionsheetReference
- 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 definitionsheetReference
- 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 documentsheetReference
- 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 documentsheetReference
- 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
-
-