/** * {@inheritDoc} * * @see DocumentAccessBridge#setDocumentContent(String, String, String, boolean) */ @Deprecated public void setDocumentContent(String documentReference, String content, String editComment, boolean isMinorEdit) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); doc.setContent(content); saveDocument(doc, editComment, isMinorEdit); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#setDocumentSyntaxId(String, String) */ @Deprecated public void setDocumentSyntaxId(String documentReference, String syntaxId) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); String oldSyntaxId = doc.getSyntaxId(); doc.setSyntaxId(syntaxId); saveDocument(doc, String.format("Changed document syntax from [%s] to [%s].", oldSyntaxId, syntaxId), 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); }
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); }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#setProperty(java.lang.String, java.lang.String, java.lang.String, * java.lang.Object) */ @Deprecated public void setProperty(String documentReference, String className, String propertyName, Object propertyValue) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); BaseObject obj = doc.getObject(className, true, xcontext); if (obj != null) { obj.set(propertyName, propertyValue, xcontext); saveDocument(doc, String.format("Property [%s] set.", propertyName), true); } }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#setDocumentSyntaxId(org.xwiki.model.reference.DocumentReference, * java.lang.String) */ public void setDocumentSyntaxId(DocumentReference documentReference, String syntaxId) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); String oldSyntaxId = doc.getSyntaxId(); doc.setSyntaxId(syntaxId); saveDocument(doc, String.format("Changed document syntax from [%s] to [%s].", oldSyntaxId, syntaxId), true); }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#setProperty(DocumentReference, DocumentReference, java.lang.String, java.lang.Object) */ public void setProperty(DocumentReference documentReference, DocumentReference classReference, String propertyName, Object propertyValue) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); BaseObject obj = doc.getXObject(classReference, true, xcontext); if (obj != null) { obj.set(propertyName, propertyValue, xcontext); saveDocument(doc, String.format("Property [%s] set.", propertyName), true); } }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#setDocumentContent(org.xwiki.model.reference.DocumentReference, * java.lang.String, java.lang.String, boolean) */ public void setDocumentContent(DocumentReference documentReference, String content, String editComment, boolean isMinorEdit) throws Exception { XWikiContext xcontext = getContext(); XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext); doc.setContent(content); saveDocument(doc, editComment, isMinorEdit); }