com.xpn.xwiki.doc
Class DefaultDocumentAccessBridge

java.lang.Object
  extended by 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: 3702a9e93d52c12b8cd4473cfe7d47a510a49c32 $

Constructor Summary
DefaultDocumentAccessBridge()
           
 
Method Summary
 boolean exists(DocumentReference documentReference)
           
 boolean exists(String documentReference)
          Deprecated. 
 InputStream getAttachmentContent(AttachmentReference attachmentReference)
           
 byte[] getAttachmentContent(String documentReference, String attachmentFilename)
          Deprecated. 
 List<AttachmentReference> getAttachmentReferences(DocumentReference documentReference)
           
 String getAttachmentURL(AttachmentReference attachmentReference, boolean isFullURL)
           
 String getAttachmentURL(AttachmentReference attachmentReference, String queryString, boolean isFullURL)
           
 String getAttachmentURL(String documentReference, String attachmentName)
          Deprecated. 
 List<String> getAttachmentURLs(DocumentReference documentReference, boolean isFullURL)
          Deprecated. 
 String getAttachmentVersion(AttachmentReference attachmentReference)
           
 DocumentReference getCurrentDocumentReference()
           
 String getCurrentUser()
          Deprecated. 
 DocumentReference getCurrentUserReference()
           
 String getCurrentWiki()
           
 String getDefaultEncoding()
           
 DocumentModelBridge getDocument(DocumentReference documentReference)
           
 DocumentModelBridge getDocument(String documentReference)
          Deprecated. 
 String getDocumentContent(DocumentReference documentReference, String language)
           
 String getDocumentContent(String documentReference)
          Deprecated. 
 String getDocumentContent(String documentReference, String language)
          Deprecated. 
 String getDocumentContentForDefaultLanguage(DocumentReference documentReference)
           
 String getDocumentContentForDefaultLanguage(String documentReference)
          Deprecated. 
 String getDocumentSyntaxId(String documentReference)
          Deprecated. 
 String getDocumentURL(DocumentReference documentReference, String action, String queryString, String anchor)
           
 String getDocumentURL(DocumentReference documentReference, String action, String queryString, String anchor, boolean isFullURL)
           
 int getObjectNumber(DocumentReference documentReference, DocumentReference classReference, String propertyName, String valueToMatch)
           
 List<Object> getProperties(String documentReference, String className)
           
 Object getProperty(DocumentReference documentReference, DocumentReference classReference, int objectNumber, String propertyName)
           
 Object getProperty(DocumentReference documentReference, DocumentReference classReference, String propertyName)
           
 Object getProperty(ObjectPropertyReference objectPropertyReference)
           
 Object getProperty(ObjectReference objectReference, String propertyName)
           
 Object getProperty(String documentReference, String propertyName)
           
 Object getProperty(String documentReference, String className, int objectNumber, String propertyName)
           
 Object getProperty(String documentReference, String className, String propertyName)
          Deprecated. 
 String getPropertyType(String className, String propertyName)
           
 String getURL(String documentReference, String action, String queryString, String anchor)
          Deprecated. 
 boolean hasProgrammingRights()
           
 boolean isDocumentEditable(DocumentReference documentReference)
           
 boolean isDocumentEditable(String documentReference)
          Deprecated. 
 boolean isDocumentViewable(DocumentReference documentReference)
           
 boolean isDocumentViewable(String documentReference)
          Deprecated. 
 boolean isPropertyCustomMapped(String className, String property)
           
 void popDocumentFromContext(Map<String,Object> backupObjects)
           
 void pushDocumentInContext(Map<String,Object> backupObjects, DocumentReference documentReference)
           
 void pushDocumentInContext(Map<String,Object> backupObjects, String documentReference)
          Deprecated. 
 void setAttachmentContent(AttachmentReference attachmentReference, byte[] attachmentData)
           
 void setAttachmentContent(String documentReference, String attachmentFilename, byte[] attachmentData)
          Deprecated. 
 void setCurrentUser(String userName)
           
 void setDocumentContent(DocumentReference documentReference, String content, String editComment, boolean isMinorEdit)
           
 void setDocumentContent(String documentReference, String content, String editComment, boolean isMinorEdit)
          Deprecated. 
 void setDocumentParentReference(DocumentReference documentReference, DocumentReference parentReference)
           
 void setDocumentSyntaxId(DocumentReference documentReference, String syntaxId)
           
 void setDocumentSyntaxId(String documentReference, String syntaxId)
          Deprecated. 
 void setDocumentTitle(DocumentReference documentReference, String title)
           
 void setProperty(DocumentReference documentReference, DocumentReference classReference, String propertyName, Object propertyValue)
           
 void setProperty(String documentReference, String className, String propertyName, Object propertyValue)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDocumentAccessBridge

public DefaultDocumentAccessBridge()
Method Detail

getDocument

@Deprecated
public DocumentModelBridge getDocument(String documentReference)
                                throws Exception
Deprecated. 

Specified by:
getDocument in interface DocumentAccessBridge
Throws:
Exception

getDocument

public DocumentModelBridge getDocument(DocumentReference documentReference)
                                throws Exception
Specified by:
getDocument in interface DocumentAccessBridge
Throws:
Exception

getCurrentDocumentReference

public DocumentReference getCurrentDocumentReference()
Specified by:
getCurrentDocumentReference in interface DocumentAccessBridge

getDocumentContent

@Deprecated
public String getDocumentContent(String documentReference)
                          throws Exception
Deprecated. 

Specified by:
getDocumentContent in interface DocumentAccessBridge
Throws:
Exception

getDocumentContentForDefaultLanguage

public String getDocumentContentForDefaultLanguage(DocumentReference documentReference)
                                            throws Exception
Specified by:
getDocumentContentForDefaultLanguage in interface DocumentAccessBridge
Throws:
Exception

getDocumentContentForDefaultLanguage

@Deprecated
public String getDocumentContentForDefaultLanguage(String documentReference)
                                            throws Exception
Deprecated. 

Specified by:
getDocumentContentForDefaultLanguage in interface DocumentAccessBridge
Throws:
Exception

getDocumentContent

public String getDocumentContent(DocumentReference documentReference,
                                 String language)
                          throws Exception
Specified by:
getDocumentContent in interface DocumentAccessBridge
Throws:
Exception

getDocumentContent

@Deprecated
public String getDocumentContent(String documentReference,
                                            String language)
                          throws Exception
Deprecated. 

Specified by:
getDocumentContent in interface DocumentAccessBridge
Throws:
Exception

exists

public boolean exists(DocumentReference documentReference)
Specified by:
exists in interface DocumentAccessBridge

exists

@Deprecated
public boolean exists(String documentReference)
Deprecated. 

Specified by:
exists in interface DocumentAccessBridge

setDocumentContent

public void setDocumentContent(DocumentReference documentReference,
                               String content,
                               String editComment,
                               boolean isMinorEdit)
                        throws Exception
Specified by:
setDocumentContent in interface DocumentAccessBridge
Throws:
Exception

setDocumentContent

@Deprecated
public void setDocumentContent(String documentReference,
                                          String content,
                                          String editComment,
                                          boolean isMinorEdit)
                        throws Exception
Deprecated. 

Specified by:
setDocumentContent in interface DocumentAccessBridge
Throws:
Exception

getDocumentSyntaxId

@Deprecated
public String getDocumentSyntaxId(String documentReference)
                           throws Exception
Deprecated. 

Specified by:
getDocumentSyntaxId in interface DocumentAccessBridge
Throws:
Exception

setDocumentSyntaxId

public void setDocumentSyntaxId(DocumentReference documentReference,
                                String syntaxId)
                         throws Exception
Specified by:
setDocumentSyntaxId in interface DocumentAccessBridge
Throws:
Exception

setDocumentSyntaxId

@Deprecated
public void setDocumentSyntaxId(String documentReference,
                                           String syntaxId)
                         throws Exception
Deprecated. 

Specified by:
setDocumentSyntaxId in interface DocumentAccessBridge
Throws:
Exception

setDocumentParentReference

public void setDocumentParentReference(DocumentReference documentReference,
                                       DocumentReference parentReference)
                                throws Exception
Specified by:
setDocumentParentReference in interface DocumentAccessBridge
Throws:
Exception

setDocumentTitle

public void setDocumentTitle(DocumentReference documentReference,
                             String title)
                      throws Exception
Specified by:
setDocumentTitle in interface DocumentAccessBridge
Throws:
Exception

getObjectNumber

public int getObjectNumber(DocumentReference documentReference,
                           DocumentReference classReference,
                           String propertyName,
                           String valueToMatch)
Specified by:
getObjectNumber in interface DocumentAccessBridge

getProperty

public Object getProperty(ObjectPropertyReference objectPropertyReference)
Specified by:
getProperty in interface DocumentAccessBridge

getProperty

public Object getProperty(ObjectReference objectReference,
                          String propertyName)
Specified by:
getProperty in interface DocumentAccessBridge

getProperty

public Object getProperty(String documentReference,
                          String className,
                          int objectNumber,
                          String propertyName)
Specified by:
getProperty in interface DocumentAccessBridge

getProperty

@Deprecated
public Object getProperty(String documentReference,
                                     String className,
                                     String propertyName)
Deprecated. 

Specified by:
getProperty in interface DocumentAccessBridge

getProperty

public Object getProperty(DocumentReference documentReference,
                          DocumentReference classReference,
                          String propertyName)
Specified by:
getProperty in interface DocumentAccessBridge

getProperty

public Object getProperty(DocumentReference documentReference,
                          DocumentReference classReference,
                          int objectNumber,
                          String propertyName)
Specified by:
getProperty in interface DocumentAccessBridge

getProperty

public Object getProperty(String documentReference,
                          String propertyName)
Specified by:
getProperty in interface DocumentAccessBridge

getProperties

public List<Object> getProperties(String documentReference,
                                  String className)
Specified by:
getProperties in interface DocumentAccessBridge

getPropertyType

public String getPropertyType(String className,
                              String propertyName)
                       throws Exception
Specified by:
getPropertyType in interface DocumentAccessBridge
Throws:
Exception

isPropertyCustomMapped

public boolean isPropertyCustomMapped(String className,
                                      String property)
                               throws Exception
Specified by:
isPropertyCustomMapped in interface DocumentAccessBridge
Throws:
Exception

setProperty

@Deprecated
public void setProperty(String documentReference,
                                   String className,
                                   String propertyName,
                                   Object propertyValue)
                 throws Exception
Deprecated. 

Specified by:
setProperty in interface DocumentAccessBridge
Throws:
Exception
See Also:
DocumentAccessBridge.setProperty(java.lang.String, java.lang.String, java.lang.String, java.lang.Object)

setProperty

public void setProperty(DocumentReference documentReference,
                        DocumentReference classReference,
                        String propertyName,
                        Object propertyValue)
                 throws Exception
Specified by:
setProperty in interface DocumentAccessBridge
Throws:
Exception

getAttachmentContent

@Deprecated
public byte[] getAttachmentContent(String documentReference,
                                              String attachmentFilename)
                            throws Exception
Deprecated. 

Specified by:
getAttachmentContent in interface DocumentAccessBridge
Throws:
Exception

getAttachmentContent

public InputStream getAttachmentContent(AttachmentReference attachmentReference)
                                 throws Exception
Specified by:
getAttachmentContent in interface DocumentAccessBridge
Throws:
Exception

setAttachmentContent

public void setAttachmentContent(AttachmentReference attachmentReference,
                                 byte[] attachmentData)
                          throws Exception
Specified by:
setAttachmentContent in interface DocumentAccessBridge
Throws:
Exception

setAttachmentContent

@Deprecated
public void setAttachmentContent(String documentReference,
                                            String attachmentFilename,
                                            byte[] attachmentData)
                          throws Exception
Deprecated. 

Specified by:
setAttachmentContent in interface DocumentAccessBridge
Throws:
Exception

getAttachmentReferences

public List<AttachmentReference> getAttachmentReferences(DocumentReference documentReference)
                                                  throws Exception
Specified by:
getAttachmentReferences in interface DocumentAccessBridge
Throws:
Exception

getAttachmentVersion

public String getAttachmentVersion(AttachmentReference attachmentReference)
                            throws Exception
Specified by:
getAttachmentVersion in interface DocumentAccessBridge
Throws:
Exception

getDocumentURL

public String getDocumentURL(DocumentReference documentReference,
                             String action,
                             String queryString,
                             String anchor)
Specified by:
getDocumentURL in interface DocumentAccessBridge

getDocumentURL

public String getDocumentURL(DocumentReference documentReference,
                             String action,
                             String queryString,
                             String anchor,
                             boolean isFullURL)
Specified by:
getDocumentURL in interface DocumentAccessBridge

getURL

@Deprecated
public String getURL(String documentReference,
                                String action,
                                String queryString,
                                String anchor)
Deprecated. 

Specified by:
getURL in interface DocumentAccessBridge

getAttachmentURL

@Deprecated
public String getAttachmentURL(String documentReference,
                                          String attachmentName)
Deprecated. 

Specified by:
getAttachmentURL in interface DocumentAccessBridge

getAttachmentURL

public String getAttachmentURL(AttachmentReference attachmentReference,
                               boolean isFullURL)
Specified by:
getAttachmentURL in interface DocumentAccessBridge

getAttachmentURL

public String getAttachmentURL(AttachmentReference attachmentReference,
                               String queryString,
                               boolean isFullURL)
Specified by:
getAttachmentURL in interface DocumentAccessBridge

getAttachmentURLs

@Deprecated
public List<String> getAttachmentURLs(DocumentReference documentReference,
                                                 boolean isFullURL)
                               throws Exception
Deprecated. 

Specified by:
getAttachmentURLs in interface DocumentAccessBridge
Throws:
Exception

isDocumentViewable

public boolean isDocumentViewable(DocumentReference documentReference)
Specified by:
isDocumentViewable in interface DocumentAccessBridge

isDocumentViewable

@Deprecated
public boolean isDocumentViewable(String documentReference)
Deprecated. 

Specified by:
isDocumentViewable in interface DocumentAccessBridge

isDocumentEditable

@Deprecated
public boolean isDocumentEditable(String documentReference)
Deprecated. 

Specified by:
isDocumentEditable in interface DocumentAccessBridge

isDocumentEditable

public boolean isDocumentEditable(DocumentReference documentReference)
Specified by:
isDocumentEditable in interface DocumentAccessBridge

hasProgrammingRights

public boolean hasProgrammingRights()
Specified by:
hasProgrammingRights in interface DocumentAccessBridge

getCurrentUser

@Deprecated
public String getCurrentUser()
Deprecated. 

Specified by:
getCurrentUser in interface DocumentAccessBridge

getCurrentUserReference

public DocumentReference getCurrentUserReference()
Specified by:
getCurrentUserReference in interface DocumentAccessBridge

setCurrentUser

public void setCurrentUser(String userName)
Specified by:
setCurrentUser in interface DocumentAccessBridge

getDefaultEncoding

public String getDefaultEncoding()
Specified by:
getDefaultEncoding in interface DocumentAccessBridge

popDocumentFromContext

public void popDocumentFromContext(Map<String,Object> backupObjects)
Specified by:
popDocumentFromContext in interface DocumentAccessBridge

pushDocumentInContext

@Deprecated
public void pushDocumentInContext(Map<String,Object> backupObjects,
                                             String documentReference)
                           throws Exception
Deprecated. 

Specified by:
pushDocumentInContext in interface DocumentAccessBridge
Throws:
Exception

pushDocumentInContext

public void pushDocumentInContext(Map<String,Object> backupObjects,
                                  DocumentReference documentReference)
                           throws Exception
Specified by:
pushDocumentInContext in interface DocumentAccessBridge
Throws:
Exception

getCurrentWiki

public String getCurrentWiki()
Specified by:
getCurrentWiki in interface DocumentAccessBridge


Copyright © 2004-2013 XWiki. All Rights Reserved.