/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#exists(org.xwiki.model.reference.DocumentReference) */ public boolean exists(DocumentReference documentReference) { return getContext().getWiki().exists(documentReference, getContext()); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getCurrentWiki() */ public String getCurrentWiki() { XWikiContext xcontext = getContext(); return xcontext.getDatabase(); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#setCurrentUser(String) */ public void setCurrentUser(String userName) { getContext().setUser(userName); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#popDocumentFromContext(Map) */ public void popDocumentFromContext(Map<String, Object> backupObjects) { XWikiDocument.restoreContext(backupObjects, getContext()); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#exists(String) */ @Deprecated public boolean exists(String documentReference) { return getContext().getWiki().exists(documentReference, getContext()); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getDocumentContent(String) */ @Deprecated public String getDocumentContent(String documentReference) throws Exception { XWikiContext xcontext = getContext(); return getDocumentContent(documentReference, xcontext.getLanguage()); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getDocument(String) */ @Deprecated public DocumentModelBridge getDocument(String documentReference) throws Exception { XWikiContext xcontext = getContext(); return xcontext.getWiki().getDocument(documentReference, xcontext); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getDocument(org.xwiki.model.reference.DocumentReference) */ public DocumentModelBridge getDocument(DocumentReference documentReference) throws Exception { XWikiContext xcontext = getContext(); return xcontext.getWiki().getDocument(documentReference, xcontext); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getDefaultEncoding() */ public String getDefaultEncoding() { return getContext().getWiki().getEncoding(); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getDocumentContentForDefaultLanguage(java.lang.String) */ @Deprecated public String getDocumentContentForDefaultLanguage(String documentReference) throws Exception { XWikiContext xcontext = getContext(); return xcontext.getWiki().getDocument(documentReference, xcontext).getContent(); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getDocumentSyntaxId(java.lang.String) */ @Deprecated public String getDocumentSyntaxId(String documentReference) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); return doc.getSyntaxId(); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#pushDocumentInContext(Map, String) */ @Deprecated public void pushDocumentInContext(Map<String, Object> backupObjects, String documentReference) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument.backupContext(backupObjects, xcontext); xcontext.getWiki().getDocument(documentReference, xcontext).setAsContextDoc(xcontext); }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#getDocumentContentForDefaultLanguage(org.xwiki.model.reference.DocumentReference) */ public String getDocumentContentForDefaultLanguage(DocumentReference documentReference) throws Exception { XWikiContext xcontext = getContext(); return xcontext.getWiki().getDocument(documentReference, xcontext).getContent(); }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#hasProgrammingRights() */ public boolean hasProgrammingRights() { XWikiContext xcontext = getContext(); return xcontext.getWiki().getRightService().hasProgrammingRights(xcontext); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getAttachmentContent(String, String) */ @Deprecated public byte[] getAttachmentContent(String documentReference, String attachmentFilename) throws Exception { XWikiContext xcontext = getContext(); return xcontext.getWiki().getDocument(documentReference, xcontext).getAttachment(attachmentFilename).getContent( xcontext); }
public void setDocumentTitle(DocumentReference documentReference, String title) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); String oldTitle = doc.getTitle(); doc.setTitle(title); saveDocument(doc, String.format("Changed document syntax from [%s] to [%s].", oldTitle, title), true); }
public void setDocumentParentReference(DocumentReference documentReference, DocumentReference parentReference) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); DocumentReference oldParentReference = doc.getParentReference(); doc.setParentReference(parentReference); saveDocument(doc, String.format("Changed document syntax from [%s] to [%s].", oldParentReference, parentReference), true); }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#getCurrentDocumentName() */ @Deprecated public org.xwiki.bridge.DocumentName getCurrentDocumentName() { XWikiDocument currentDocument = getContext().getDoc(); return currentDocument == null ? null : new org.xwiki.bridge.DocumentName(currentDocument.getWikiName(), currentDocument.getSpaceName(), currentDocument.getPageName()); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#pushDocumentInContext(Map, DocumentReference) */ public void pushDocumentInContext(Map<String, Object> backupObjects, DocumentReference documentReference) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument.backupContext(backupObjects, xcontext); xcontext.getWiki().getDocument(documentReference, xcontext).setAsContextDoc(xcontext); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getAttachmentVersion(AttachmentReference) */ public String getAttachmentVersion(AttachmentReference attachmentReference) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(attachmentReference.getDocumentReference(), xcontext); XWikiAttachment attachment = doc.getAttachment(attachmentReference.getName()); return attachment == null ? null : attachment.getVersion(); }