Package com.xpn.xwiki.doc
Class DefaultDocumentAccessBridge
- java.lang.Object
-
- com.xpn.xwiki.doc.DefaultDocumentAccessBridge
-
- All Implemented Interfaces:
DocumentAccessBridge
@Component @Singleton public class DefaultDocumentAccessBridge extends Object implements DocumentAccessBridge
Exposes methods for accessing Document data. This is temporary until we remodel the Model classes and the Document services. The implementation is inside the old core, and not in a component because it has dependencies on the old core.- Since:
- 1.6M1
- Version:
- $Id: e5fb8263b1567ed0d518a96226a942c09e5f72e1 $
-
-
Constructor Summary
Constructors Constructor Description DefaultDocumentAccessBridge()
-
Method Summary
-
-
-
Method Detail
-
getDocumentReference
public DocumentReference getDocumentReference(EntityReference entityReference)
- Specified by:
getDocumentReference
in interfaceDocumentAccessBridge
-
getDocument
@Deprecated public DocumentModelBridge getDocument(String documentReference) throws Exception
Deprecated.- Specified by:
getDocument
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocument
@Deprecated public DocumentModelBridge getDocument(DocumentReference documentReference) throws Exception
Deprecated.- Specified by:
getDocument
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocumentInstance
public DocumentModelBridge getDocumentInstance(DocumentReference documentReference) throws Exception
- Specified by:
getDocumentInstance
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocumentInstance
public DocumentModelBridge getDocumentInstance(EntityReference reference) throws Exception
- Specified by:
getDocumentInstance
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getTranslatedDocumentInstance
public DocumentModelBridge getTranslatedDocumentInstance(DocumentReference documentReference) throws Exception
- Specified by:
getTranslatedDocumentInstance
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getTranslatedDocumentInstance
public DocumentModelBridge getTranslatedDocumentInstance(EntityReference entityReference) throws Exception
- Specified by:
getTranslatedDocumentInstance
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getTranslatedDocumentInstance
public DocumentModelBridge getTranslatedDocumentInstance(DocumentModelBridge document) throws Exception
- Specified by:
getTranslatedDocumentInstance
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getCurrentDocumentReference
public DocumentReference getCurrentDocumentReference()
- Specified by:
getCurrentDocumentReference
in interfaceDocumentAccessBridge
-
getDocumentContent
@Deprecated public String getDocumentContent(String documentReference) throws Exception
Deprecated.- Specified by:
getDocumentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocumentContentForDefaultLanguage
public String getDocumentContentForDefaultLanguage(DocumentReference documentReference) throws Exception
- Specified by:
getDocumentContentForDefaultLanguage
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocumentContentForDefaultLanguage
@Deprecated public String getDocumentContentForDefaultLanguage(String documentReference) throws Exception
Deprecated.- Specified by:
getDocumentContentForDefaultLanguage
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocumentContent
public String getDocumentContent(DocumentReference documentReference, String language) throws Exception
- Specified by:
getDocumentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocumentContent
@Deprecated public String getDocumentContent(String documentReference, String language) throws Exception
Deprecated.- Specified by:
getDocumentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
exists
public boolean exists(DocumentReference documentReference) throws XWikiException
- Specified by:
exists
in interfaceDocumentAccessBridge
- Throws:
XWikiException
-
exists
@Deprecated public boolean exists(String documentReference) throws XWikiException
Deprecated.- Specified by:
exists
in interfaceDocumentAccessBridge
- Throws:
XWikiException
-
setDocumentContent
public void setDocumentContent(DocumentReference documentReference, String content, String editComment, boolean isMinorEdit) throws Exception
- Specified by:
setDocumentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setDocumentContent
@Deprecated public void setDocumentContent(String documentReference, String content, String editComment, boolean isMinorEdit) throws Exception
Deprecated.- Specified by:
setDocumentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocumentSyntaxId
@Deprecated public String getDocumentSyntaxId(String documentReference) throws Exception
Deprecated.- Specified by:
getDocumentSyntaxId
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setDocumentSyntaxId
public void setDocumentSyntaxId(DocumentReference documentReference, String syntaxId) throws Exception
- Specified by:
setDocumentSyntaxId
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setDocumentSyntaxId
@Deprecated public void setDocumentSyntaxId(String documentReference, String syntaxId) throws Exception
Deprecated.- Specified by:
setDocumentSyntaxId
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setDocumentParentReference
public void setDocumentParentReference(DocumentReference documentReference, DocumentReference parentReference) throws Exception
- Specified by:
setDocumentParentReference
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setDocumentTitle
public void setDocumentTitle(DocumentReference documentReference, String title) throws Exception
- Specified by:
setDocumentTitle
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getObjectNumber
public int getObjectNumber(DocumentReference documentReference, DocumentReference classReference, String propertyName, String valueToMatch)
- Specified by:
getObjectNumber
in interfaceDocumentAccessBridge
-
getProperty
public Object getProperty(ObjectPropertyReference objectPropertyReference)
- Specified by:
getProperty
in interfaceDocumentAccessBridge
-
getProperty
public Object getProperty(ObjectReference objectReference, String propertyName)
- Specified by:
getProperty
in interfaceDocumentAccessBridge
-
getProperty
public Object getProperty(String documentReference, String className, int objectNumber, String propertyName)
- Specified by:
getProperty
in interfaceDocumentAccessBridge
-
getProperty
@Deprecated public Object getProperty(String documentReference, String className, String propertyName)
Deprecated.- Specified by:
getProperty
in interfaceDocumentAccessBridge
-
getProperty
public Object getProperty(DocumentReference documentReference, DocumentReference classReference, String propertyName)
- Specified by:
getProperty
in interfaceDocumentAccessBridge
-
getProperty
public Object getProperty(DocumentReference documentReference, DocumentReference classReference, int objectNumber, String propertyName)
- Specified by:
getProperty
in interfaceDocumentAccessBridge
-
getProperty
public Object getProperty(String documentReference, String propertyName)
- Specified by:
getProperty
in interfaceDocumentAccessBridge
-
getProperties
public List<Object> getProperties(String documentReference, String className)
- Specified by:
getProperties
in interfaceDocumentAccessBridge
-
getPropertyType
public String getPropertyType(String className, String propertyName) throws Exception
- Specified by:
getPropertyType
in interfaceDocumentAccessBridge
- Throws:
Exception
-
isPropertyCustomMapped
public boolean isPropertyCustomMapped(String className, String property) throws Exception
- Specified by:
isPropertyCustomMapped
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setProperty
@Deprecated public void setProperty(String documentReference, String className, String propertyName, Object propertyValue) throws Exception
Deprecated.- Specified by:
setProperty
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setProperty
public void setProperty(DocumentReference documentReference, DocumentReference classReference, String propertyName, Object propertyValue) throws Exception
- Specified by:
setProperty
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getAttachmentContent
@Deprecated public byte[] getAttachmentContent(String documentReference, String attachmentFilename) throws Exception
Deprecated.- Specified by:
getAttachmentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getAttachmentContent
@Deprecated(since="14.7RC1") public InputStream getAttachmentContent(AttachmentReference attachmentReference) throws Exception
Deprecated.- Specified by:
getAttachmentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getAttachmentContent
public InputStream getAttachmentContent(EntityReference reference) throws Exception
- Specified by:
getAttachmentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setAttachmentContent
public void setAttachmentContent(AttachmentReference attachmentReference, byte[] attachmentData) throws Exception
- Specified by:
setAttachmentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
setAttachmentContent
@Deprecated public void setAttachmentContent(String documentReference, String attachmentFilename, byte[] attachmentData) throws Exception
Deprecated.- Specified by:
setAttachmentContent
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getAttachmentReferences
public List<AttachmentReference> getAttachmentReferences(DocumentReference documentReference) throws Exception
- Specified by:
getAttachmentReferences
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getAttachmentVersion
public String getAttachmentVersion(AttachmentReference attachmentReference) throws Exception
- Specified by:
getAttachmentVersion
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getDocumentURL
public String getDocumentURL(DocumentReference documentReference, String action, String queryString, String anchor)
- Specified by:
getDocumentURL
in interfaceDocumentAccessBridge
-
getDocumentURL
public String getDocumentURL(DocumentReference documentReference, String action, String queryString, String anchor, boolean isFullURL)
- Specified by:
getDocumentURL
in interfaceDocumentAccessBridge
-
getDocumentURL
public String getDocumentURL(EntityReference entityReference, String action, String queryString, String anchor)
- Specified by:
getDocumentURL
in interfaceDocumentAccessBridge
-
getDocumentURL
public String getDocumentURL(EntityReference entityReference, String action, String queryString, String anchor, boolean isFullURL)
- Specified by:
getDocumentURL
in interfaceDocumentAccessBridge
-
getURL
@Deprecated public String getURL(String documentReference, String action, String queryString, String anchor)
Deprecated.- Specified by:
getURL
in interfaceDocumentAccessBridge
-
getAttachmentURL
@Deprecated public String getAttachmentURL(String documentReference, String attachmentName)
Deprecated.- Specified by:
getAttachmentURL
in interfaceDocumentAccessBridge
-
getAttachmentURL
public String getAttachmentURL(AttachmentReference attachmentReference, boolean isFullURL)
- Specified by:
getAttachmentURL
in interfaceDocumentAccessBridge
-
getAttachmentURL
public String getAttachmentURL(AttachmentReference attachmentReference, String queryString, boolean isFullURL)
- Specified by:
getAttachmentURL
in interfaceDocumentAccessBridge
-
getAttachmentURLs
@Deprecated public List<String> getAttachmentURLs(DocumentReference documentReference, boolean isFullURL) throws Exception
Deprecated.- Specified by:
getAttachmentURLs
in interfaceDocumentAccessBridge
- Throws:
Exception
-
isDocumentViewable
public boolean isDocumentViewable(DocumentReference documentReference)
- Specified by:
isDocumentViewable
in interfaceDocumentAccessBridge
-
isDocumentViewable
@Deprecated public boolean isDocumentViewable(String documentReference)
Deprecated.- Specified by:
isDocumentViewable
in interfaceDocumentAccessBridge
-
isDocumentEditable
@Deprecated public boolean isDocumentEditable(String documentReference)
Deprecated.- Specified by:
isDocumentEditable
in interfaceDocumentAccessBridge
-
isDocumentEditable
public boolean isDocumentEditable(DocumentReference documentReference)
- Specified by:
isDocumentEditable
in interfaceDocumentAccessBridge
-
hasProgrammingRights
public boolean hasProgrammingRights()
- Specified by:
hasProgrammingRights
in interfaceDocumentAccessBridge
-
getCurrentUser
@Deprecated public String getCurrentUser()
Deprecated.- Specified by:
getCurrentUser
in interfaceDocumentAccessBridge
-
getCurrentUserReference
public DocumentReference getCurrentUserReference()
- Specified by:
getCurrentUserReference
in interfaceDocumentAccessBridge
-
isAdvancedUser
public boolean isAdvancedUser()
- Specified by:
isAdvancedUser
in interfaceDocumentAccessBridge
-
isAdvancedUser
public boolean isAdvancedUser(EntityReference userReference)
- Specified by:
isAdvancedUser
in interfaceDocumentAccessBridge
-
setCurrentUser
public void setCurrentUser(String userName)
- Specified by:
setCurrentUser
in interfaceDocumentAccessBridge
-
getDefaultEncoding
public String getDefaultEncoding()
- Specified by:
getDefaultEncoding
in interfaceDocumentAccessBridge
-
popDocumentFromContext
public void popDocumentFromContext(Map<String,Object> backupObjects)
- Specified by:
popDocumentFromContext
in interfaceDocumentAccessBridge
-
pushDocumentInContext
@Deprecated public void pushDocumentInContext(Map<String,Object> backupObjects, String documentReference) throws Exception
Deprecated.- Specified by:
pushDocumentInContext
in interfaceDocumentAccessBridge
- Throws:
Exception
-
pushDocumentInContext
public void pushDocumentInContext(Map<String,Object> backupObjects, DocumentReference documentReference) throws Exception
- Specified by:
pushDocumentInContext
in interfaceDocumentAccessBridge
- Throws:
Exception
-
pushDocumentInContext
public void pushDocumentInContext(Map<String,Object> backupObjects, DocumentModelBridge document) throws Exception
- Specified by:
pushDocumentInContext
in interfaceDocumentAccessBridge
- Throws:
Exception
-
getCurrentWiki
public String getCurrentWiki()
- Specified by:
getCurrentWiki
in interfaceDocumentAccessBridge
-
getCurrentAuthorReference
public DocumentReference getCurrentAuthorReference()
- Specified by:
getCurrentAuthorReference
in interfaceDocumentAccessBridge
-
-