|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Role public interface DocumentAccessBridge
Exposes methods for accessing Document data. This is temporary until we remodel the Model classes and the Document services.
| Method Summary | |
|---|---|
boolean |
exists(DocumentReference documentReference)
Check if a document exists or not in the wiki. |
boolean |
exists(String documentReference)
Deprecated. replaced by exists(DocumentReference) since 2.2.1 |
InputStream |
getAttachmentContent(AttachmentReference attachmentReference)
Returns the content of a document attachment. |
byte[] |
getAttachmentContent(String documentReference,
String attachmentName)
Deprecated. use getAttachmentContent(org.xwiki.model.reference.AttachmentReference) instead |
List<AttachmentReference> |
getAttachmentReferences(DocumentReference documentReference)
Retrieves all attachments in the passed document. |
String |
getAttachmentURL(AttachmentReference attachmentReference,
boolean isFullURL)
Retrieves the URL (either relative ie the path without the hostname and port, or the full URL) that can be used to access an attachment. |
String |
getAttachmentURL(AttachmentReference attachmentReference,
String queryString,
boolean isFullURL)
Retrieves the URL (either relative ie the path without the hostname and port, or the full URL) that can be used to access an attachment. |
String |
getAttachmentURL(String documentReference,
String attachmentFilename)
Deprecated. use getAttachmentURL(org.xwiki.model.reference.AttachmentReference , boolean) instead |
List<String> |
getAttachmentURLs(DocumentReference documentReference,
boolean isFullURL)
Deprecated. use getAttachmentReferences(org.xwiki.model.reference.DocumentReference) instead |
String |
getAttachmentVersion(AttachmentReference attachmentReference)
Returns the current version of a document attachment. |
DocumentReference |
getCurrentDocumentReference()
Get the reference to the current document (found in the Context). |
String |
getCurrentUser()
Deprecated. replaced by getCurrentUserReference() since 4.0RC1 |
DocumentReference |
getCurrentUserReference()
Utility method to retrieve the current user document reference. |
String |
getCurrentWiki()
Deprecated. replaced by ModelContext.getCurrentEntityReference() since 2.2M1 |
String |
getDefaultEncoding()
|
DocumentModelBridge |
getDocument(DocumentReference documentReference)
Get the document object associated with the passed document name. |
DocumentModelBridge |
getDocument(String documentReference)
Deprecated. use getDocument(org.xwiki.model.reference.DocumentReference) instead |
String |
getDocumentContent(DocumentReference documentReference,
String language)
Retrieves the textual content of the document, in the given language. |
String |
getDocumentContent(String documentReference)
Deprecated. replaced by getDocument(DocumentReference) and DocumentModelBridge.getContent()
since 2.2.1 |
String |
getDocumentContent(String documentReference,
String language)
Deprecated. replaced by getDocumentContent(DocumentReference, String) since 2.2.1 |
String |
getDocumentContentForDefaultLanguage(DocumentReference documentReference)
Retrieves the textual content of the document, in the document's default language. |
String |
getDocumentContentForDefaultLanguage(String documentReference)
Deprecated. replaced by getDocumentContentForDefaultLanguage(DocumentReference) since 2.2.1 |
String |
getDocumentSyntaxId(String documentReference)
Deprecated. replaced by getDocument(DocumentReference) and DocumentModelBridge.getSyntaxId()
since 2.2.1 |
String |
getDocumentURL(DocumentReference documentReference,
String action,
String queryString,
String anchor)
Retrieves the internal (without the hostname) URL that can be used to access a document, using a specific action. |
String |
getDocumentURL(DocumentReference documentReference,
String action,
String queryString,
String anchor,
boolean isFullURL)
Retrieves the relitive (without the hostname) or absolute (with the hostname) URL that can be used to access a document, using a specific action. |
int |
getObjectNumber(DocumentReference documentReference,
DocumentReference classReference,
String parameterName,
String valueToMatch)
Get the number of the first object that has a property that match the expectation. |
List<Object> |
getProperties(String documentReference,
String className)
|
Object |
getProperty(DocumentReference documentReference,
DocumentReference classReference,
int objectNumber,
String propertyName)
Retrieves the value for an object property, from the Nth object of the given class. |
Object |
getProperty(DocumentReference documentReference,
DocumentReference classReference,
String propertyName)
Retrieves the value for an object property, from the first object of the given class. |
Object |
getProperty(ObjectPropertyReference objectPropertyReference)
Retrieves the value for an object property. |
Object |
getProperty(ObjectReference objectReference,
String propertyName)
Retrieves the value for an object property. |
Object |
getProperty(String documentReference,
String propertyName)
Retrieves the value for an object property, from the first object of any class that has a property with that name. |
Object |
getProperty(String documentReference,
String className,
int objectNumber,
String propertyName)
Retrieves the value for an object property. |
Object |
getProperty(String documentReference,
String className,
String propertyName)
Deprecated. since 2.2M1 use getProperty(DocumentReference, DocumentReference, String) instead |
String |
getPropertyType(String className,
String propertyName)
|
String |
getURL(String documentReference,
String action,
String queryString,
String anchor)
Deprecated. replaced by getDocumentURL(DocumentReference, String, String, String) since 2.2.1 |
boolean |
hasProgrammingRights()
|
boolean |
isDocumentEditable(DocumentReference documentReference)
|
boolean |
isDocumentEditable(String documentReference)
Deprecated. use isDocumentEditable(org.xwiki.model.reference.DocumentReference) instead |
boolean |
isDocumentViewable(DocumentReference documentReference)
|
boolean |
isDocumentViewable(String documentReference)
Deprecated. use isDocumentViewable(org.xwiki.model.reference.DocumentReference) instead |
boolean |
isPropertyCustomMapped(String className,
String propertyName)
|
void |
popDocumentFromContext(Map<String,Object> backupObjects)
Restore values saved in a backup object in the XWiki Context and restore the current document with the same value before pushDocumentInContext(Map, String) was called. |
void |
pushDocumentInContext(Map<String,Object> backupObjects,
DocumentReference documentReference)
Sets the passed document as the current document in the XWiki Context and saves current values related to the current document into a backup object. |
void |
pushDocumentInContext(Map<String,Object> backupObjects,
String documentReference)
Deprecated. use pushDocumentInContext(Map, DocumentReference) instead |
void |
setAttachmentContent(AttachmentReference attachmentReference,
byte[] attachmentData)
Sets the content of a document attachment. |
void |
setAttachmentContent(String documentReference,
String attachmentFilename,
byte[] attachmentData)
Deprecated. replaced by getAttachmentContent(AttachmentReference) since 2.2.1 |
void |
setCurrentUser(String userName)
Utility method to set the current user. |
void |
setDocumentContent(DocumentReference documentReference,
String content,
String editComment,
boolean isMinorEdit)
Updates the target document with the new content provided. |
void |
setDocumentContent(String documentReference,
String content,
String editComment,
boolean isMinorEdit)
Deprecated. replaced by setDocumentContent(DocumentReference, String, String, boolean) since 2.2.1 |
void |
setDocumentParentReference(DocumentReference documentReference,
DocumentReference parentReference)
Sets the parent document name attribute for this document. |
void |
setDocumentSyntaxId(DocumentReference documentReference,
String syntaxId)
Changes the syntax Id of the target document to the given syntaxId. |
void |
setDocumentSyntaxId(String documentReference,
String syntaxId)
Deprecated. replaced by setDocumentSyntaxId(DocumentReference, String) since 2.2.1 |
void |
setDocumentTitle(DocumentReference documentReference,
String title)
Sets the title of this document. |
void |
setProperty(DocumentReference documentReference,
DocumentReference classReference,
String propertyName,
Object propertyValue)
Sets the given property of the first object (of the given class) attached to the document. |
void |
setProperty(String documentReference,
String className,
String propertyName,
Object propertyValue)
Deprecated. use {@link DocumentAccessBridge#setProperty(DocumentReference, DocumentReference, String, Object) |
| Method Detail |
|---|
@Deprecated
DocumentModelBridge getDocument(String documentReference)
throws Exception
getDocument(org.xwiki.model.reference.DocumentReference) instead
documentReference - the String reference of the document to find
Exception - when the storage cannot be accessed
DocumentModelBridge getDocument(DocumentReference documentReference)
throws Exception
documentReference - the name of the document to find
Exception - when the storage cannot be accessedDocumentReference getCurrentDocumentReference()
boolean exists(DocumentReference documentReference)
documentReference - The reference of the document to check.
true if the document already exists, false otherwise.@Deprecated boolean exists(String documentReference)
exists(DocumentReference) since 2.2.1
documentReference - The reference of the document to check.
true if the document already exists, false otherwise.
void setDocumentContent(DocumentReference documentReference,
String content,
String editComment,
boolean isMinorEdit)
throws Exception
documentReference - the reference to the target documentcontent - Content to be set.editComment - Comment describing this particular change.isMinorEdit - Flag indicating if this change is a minor one.
Exception - if the storage cannot be accessed.
@Deprecated
void setDocumentContent(String documentReference,
String content,
String editComment,
boolean isMinorEdit)
throws Exception
setDocumentContent(DocumentReference, String, String, boolean) since 2.2.1
documentReference - the reference to the target documentcontent - Content to be set.editComment - Comment describing this particular change.isMinorEdit - Flag indicating if this change is a minor one.
Exception - if the storage cannot be accessed.
@Deprecated
String getDocumentContent(String documentReference)
throws Exception
getDocument(DocumentReference) and DocumentModelBridge.getContent()
since 2.2.1
documentReference - the reference of the document to access
Exception - If the document cannot be accessed.
@Deprecated
String getDocumentSyntaxId(String documentReference)
throws Exception
getDocument(DocumentReference) and DocumentModelBridge.getSyntaxId()
since 2.2.1
documentReference - the reference of the target document
Exception - If the storage cannot be accessed.
void setDocumentSyntaxId(DocumentReference documentReference,
String syntaxId)
throws Exception
documentReference - the reference of the target documentsyntaxId - New syntax Id.
Exception - If the storage cannot be accessed.
@Deprecated
void setDocumentSyntaxId(String documentReference,
String syntaxId)
throws Exception
setDocumentSyntaxId(DocumentReference, String) since 2.2.1
documentReference - the reference of the target documentsyntaxId - New syntax Id.
Exception - If the storage cannot be accessed.
void setDocumentParentReference(DocumentReference documentReference,
DocumentReference parentReference)
throws Exception
documentReference - the reference of the target documentparentReference - name of the parent document.
Exception - If the storage cannot be accessed.
void setDocumentTitle(DocumentReference documentReference,
String title)
throws Exception
documentReference - the reference of the target documenttitle - the title to be set.
Exception - If the storage cannot be accessed.
String getDocumentContentForDefaultLanguage(DocumentReference documentReference)
throws Exception
Note: you should always use getDocumentContent(String) unless you really need specifically the
document's content for default language of the document.
documentReference - the reference of the document to access
Exception - If the document cannot be accessed.
@Deprecated
String getDocumentContentForDefaultLanguage(String documentReference)
throws Exception
getDocumentContentForDefaultLanguage(DocumentReference) since 2.2.1
Note: you should always use getDocumentContent(String) unless you really need specifically the
document's content for default language of the document.
documentReference - the reference of the document to access
Exception - If the document cannot be accessed.
String getDocumentContent(DocumentReference documentReference,
String language)
throws Exception
documentReference - the referenc of the document to accesslanguage - The desired translation of the document.
Exception - If the document cannot be accessed.
@Deprecated
String getDocumentContent(String documentReference,
String language)
throws Exception
getDocumentContent(DocumentReference, String) since 2.2.1
documentReference - the referenc of the document to accesslanguage - The desired translation of the document.
Exception - If the document cannot be accessed.
int getObjectNumber(DocumentReference documentReference,
DocumentReference classReference,
String parameterName,
String valueToMatch)
documentReference - the reference of the document to look for objects intoclassReference - the reference of the class to look objects ofparameterName - the name of the parameter to check the value forvalueToMatch - the value to match for this parameter
Object getProperty(String documentReference,
String className,
int objectNumber,
String propertyName)
documentReference - the reference of the document to accessclassName - The name of the class.objectNumber - The number of the object from the given class.propertyName - The name of the property to retrieve.
@Deprecated
Object getProperty(String documentReference,
String className,
String propertyName)
getProperty(DocumentReference, DocumentReference, String) instead
documentReference - the reference of the document to accessclassName - The name of the class.propertyName - The name of the property to retrieve.
Object getProperty(ObjectReference objectReference,
String propertyName)
objectReference - the reference of the object to accesspropertyName - The name of the property to retrieve.
Object getProperty(ObjectPropertyReference objectPropertyReference)
objectPropertyReference - the reference of the property to access
Object getProperty(DocumentReference documentReference,
DocumentReference classReference,
String propertyName)
documentReference - the reference of the document to accessclassReference - the reference to the XWiki ClasspropertyName - The name of the property to retrieve.
Object getProperty(DocumentReference documentReference,
DocumentReference classReference,
int objectNumber,
String propertyName)
documentReference - the reference of the document to accessclassReference - the reference to the XWiki ClassobjectNumber - the number of the object to get the property forpropertyName - The name of the property to retrieve.
Object getProperty(String documentReference,
String propertyName)
documentReference - the reference of the document to accesspropertyName - The name of the property to retrieve.
List<Object> getProperties(String documentReference,
String className)
documentReference - the reference of the document to accessclassName - the name of the class in the passed document from which to get the properties
String getPropertyType(String className,
String propertyName)
throws Exception
className - The name of the class.propertyName - The name of the property.
Exception - if class cannot be accessed
boolean isPropertyCustomMapped(String className,
String propertyName)
throws Exception
className - The name of the class.propertyName - The name of the property of the class.
Exception - if class cannot be accessed
@Deprecated
void setProperty(String documentReference,
String className,
String propertyName,
Object propertyValue)
throws Exception
documentReference - the reference of the document to accessclassName - name of the class.propertyName - name of the property to set.propertyValue - value of the property to set.
Exception - if the document cannot be accessed.
void setProperty(DocumentReference documentReference,
DocumentReference classReference,
String propertyName,
Object propertyValue)
throws Exception
documentReference - the reference of the document to accessclassReference - the reference of the class.propertyName - name of the property to set.propertyValue - value of the property to set.
Exception - if the document cannot be accessed.
@Deprecated
byte[] getAttachmentContent(String documentReference,
String attachmentName)
throws Exception
getAttachmentContent(org.xwiki.model.reference.AttachmentReference) instead
documentReference - the reference of the document to accessattachmentName - The filename of the attachment to access.
bytes, which is empty if the attachment does
not exist.
Exception - If the document cannot be accessed.
InputStream getAttachmentContent(AttachmentReference attachmentReference)
throws Exception
attachmentReference - the name of the attachment to access
bytes, which is empty if the attachment does
not exist
Exception - If the document cannot be accessed.
void setAttachmentContent(AttachmentReference attachmentReference,
byte[] attachmentData)
throws Exception
attachmentReference - the name of the attachment to accessattachmentData - Attachment content.
Exception - If the storage cannot be accessed.
@Deprecated
void setAttachmentContent(String documentReference,
String attachmentFilename,
byte[] attachmentData)
throws Exception
getAttachmentContent(AttachmentReference) since 2.2.1
documentReference - the reference to the target document nameattachmentFilename - the name of the attachmentattachmentData - Attachment content.
Exception - If the storage cannot be accessed.
String getAttachmentVersion(AttachmentReference attachmentReference)
throws Exception
attachmentReference - identifies the attachment to access
null if the attachment does not exist
Exception - if the document cannot be accessed
String getDocumentURL(DocumentReference documentReference,
String action,
String queryString,
String anchor)
documentReference - the reference of the document to accessaction - The "mode" in which the document is accessed, for example view to view the document,
edit to open the document for modifications, etc.queryString - An optional query string to append to the URL, use null or an empty string to
skip.anchor - An optional URL fragment to append to the URL, use null or an empty string to skip.
String representation of the URL, starting with the path segment of the URL (without
protocol, host and port), for example /xwiki/bin/save/Main/WebHome?content=abc.
String getDocumentURL(DocumentReference documentReference,
String action,
String queryString,
String anchor,
boolean isFullURL)
documentReference - the reference of the document to accessaction - The "mode" in which the document is accessed, for example view to view the document,
edit to open the document for modifications, etc.queryString - An optional query string to append to the URL, use null or an empty string to
skip.anchor - An optional URL fragment to append to the URL, use null or an empty string to skip.isFullURL - if true then the URL will be an absolute URL which contains the host name, and protocol.
String representation of the URL, starting with the path segment of the URL (without
protocol, host and port), for example /xwiki/bin/save/Main/WebHome?content=abc.
@Deprecated
String getURL(String documentReference,
String action,
String queryString,
String anchor)
getDocumentURL(DocumentReference, String, String, String) since 2.2.1
documentReference - the reference of the document to accessaction - The "mode" in which the document is accessed, for example view to view the document,
edit to open the document for modifications, etc.queryString - An optional query string to append to the URL, use null or an empty string to
skip.anchor - An optional URL fragment to append to the URL, use null or an empty string to skip.
String representation of the URL, starting with the path segment of the URL (without
protocol, host and port), for example /xwiki/bin/save/Main/WebHome?content=abc.
List<AttachmentReference> getAttachmentReferences(DocumentReference documentReference)
throws Exception
documentReference - the reference to the document for which to retrieve all attachment references
Exception - in case of a storage issue finding all attachments for the document matching the passed name
@Deprecated
String getAttachmentURL(String documentReference,
String attachmentFilename)
getAttachmentURL(org.xwiki.model.reference.AttachmentReference , boolean) instead
documentReference - the reference to the document containing the attachment (eg "wiki:Space.Page")attachmentFilename - the attachment name (eg "my.png")
String getAttachmentURL(AttachmentReference attachmentReference,
boolean isFullURL)
attachmentReference - the attachment name for which to find the URLisFullURL - whether the returned URL will a relative URL or the full URL
String getAttachmentURL(AttachmentReference attachmentReference,
String queryString,
boolean isFullURL)
attachmentReference - the attachment name for which to find the URLqueryString - An optional query string to append to the URL, use null or an empty string to
skip.isFullURL - whether the returned URL will a relative URL or the full URL
@Deprecated
List<String> getAttachmentURLs(DocumentReference documentReference,
boolean isFullURL)
throws Exception
getAttachmentReferences(org.xwiki.model.reference.DocumentReference) instead
documentReference - the document for which to retrieve all attachment URLsisFullURL - whether the returned URL will a relative URL or the full URL
Exception - in case of a storage issue finding all attachments for the document matching the passed nameboolean isDocumentViewable(DocumentReference documentReference)
documentReference - the reference of the document to access
@Deprecated boolean isDocumentViewable(String documentReference)
isDocumentViewable(org.xwiki.model.reference.DocumentReference) instead
documentReference - the reference of the document to access
@Deprecated boolean isDocumentEditable(String documentReference)
isDocumentEditable(org.xwiki.model.reference.DocumentReference) instead
documentReference - the reference of the document to be edited
boolean isDocumentEditable(DocumentReference documentReference)
documentReference - the name of the document to be edited.
boolean hasProgrammingRights()
@Deprecated String getCurrentUser()
getCurrentUserReference() since 4.0RC1
DocumentReference getCurrentUserReference()
void setCurrentUser(String userName)
userName - the current userString getDefaultEncoding()
@Deprecated
void pushDocumentInContext(Map<String,Object> backupObjects,
String documentReference)
throws Exception
pushDocumentInContext(Map, DocumentReference) instead
backupObjects - the object in which to some context properties will be saveddocumentReference - the reference to the document to set as the current document
Exception - in case of an error like a problem loading the document from the database
void pushDocumentInContext(Map<String,Object> backupObjects,
DocumentReference documentReference)
throws Exception
backupObjects - the object in which to some context properties will be saveddocumentReference - the reference to the document to set as the current document
Exception - in case of an error like a problem loading the document from the databasevoid popDocumentFromContext(Map<String,Object> backupObjects)
pushDocumentInContext(Map, String) was called.
backupObjects - the object containing the backed-up context properties to restore@Deprecated String getCurrentWiki()
ModelContext.getCurrentEntityReference() since 2.2M1
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||