public class XWikiDocument extends Object implements DocumentModelBridge, Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
XWikiDocument.XWikiAttachmentToRemove
An attachment waiting to be deleted at next document save.
|
Modifier and Type | Field and Description |
---|---|
static String |
CKEY_SDOC
The name of the key in the XWikiContext which contains the document used to check for programming rights.
|
static EntityReference |
COMMENTSCLASS_REFERENCE |
static String |
DB_SPACE_SEP
Separator string between database name and space name.
|
static int |
HAS_ATTACHMENTS |
static int |
HAS_CLASS |
static int |
HAS_OBJECTS |
static EntityReference |
SHEETCLASS_REFERENCE |
static String |
SPACE_NAME_SEP
Separator string between space name and page name.
|
protected org.suigeneris.jrcs.rcs.Version |
version |
Constructor and Description |
---|
XWikiDocument()
Deprecated.
since 2.2M1 use
XWikiDocument(org.xwiki.model.reference.DocumentReference) instead |
XWikiDocument(DocumentReference reference)
Create a document for the given reference, with the
Locale.ROOT even if the reference contains a locale. |
XWikiDocument(DocumentReference reference,
Locale locale) |
XWikiDocument(String space,
String name)
Deprecated.
since 2.2M1 use
XWikiDocument(org.xwiki.model.reference.DocumentReference) instead |
XWikiDocument(String wiki,
String space,
String name)
Deprecated.
since 2.2M1 use
XWikiDocument(org.xwiki.model.reference.DocumentReference) instead |
Modifier and Type | Method and Description |
---|---|
XWikiAttachment |
addAttachment(String fileName,
byte[] content,
XWikiContext context)
Deprecated.
use
setAttachment(String, InputStream, XWikiContext) instead |
XWikiAttachment |
addAttachment(String fileName,
InputStream content,
XWikiContext context)
Deprecated.
since 9.10RC1, use
setAttachment(String, InputStream, XWikiContext) instead |
void |
addAttachment(XWikiAttachment attachment)
Deprecated.
since 9.10RC1, use
setAttachment(XWikiAttachment) instead |
void |
addObject(String className,
BaseObject object)
Deprecated.
since 2.2M1 use
addXObject(BaseObject) instead |
BaseObject |
addObjectFromRequest(String className,
int num,
XWikiContext context)
Deprecated.
since 2.2M2 use
addXObjectFromRequest(DocumentReference, int, XWikiContext) |
BaseObject |
addObjectFromRequest(String className,
String prefix,
int num,
XWikiContext context)
Deprecated.
|
BaseObject |
addObjectFromRequest(String className,
String prefix,
XWikiContext context)
Deprecated.
since 2.2M2 use
addXObjectFromRequest(DocumentReference, String, XWikiContext) |
BaseObject |
addObjectFromRequest(String className,
XWikiContext context)
Deprecated.
since 2.2M2 use
addXObjectFromRequest(EntityReference, XWikiContext) |
List<BaseObject> |
addObjectsFromRequest(String className,
String pref,
XWikiContext context)
Deprecated.
since 2.2M2 use
addXObjectsFromRequest(DocumentReference, String, XWikiContext) |
List<BaseObject> |
addObjectsFromRequest(String className,
XWikiContext context)
Deprecated.
since 2.2M2 use
addXObjectsFromRequest(DocumentReference, XWikiContext) |
void |
addObjectsToRemove(BaseObject object)
Deprecated.
since 2.2M2 use
addXObjectToRemove(BaseObject) )} instead |
void |
addToZip(ZipOutputStream zos,
boolean withVersions,
XWikiContext context)
Deprecated.
since 4.2M2
|
void |
addToZip(ZipOutputStream zos,
String zipname,
boolean withVersions,
XWikiContext context)
Deprecated.
since 4.1M2
|
void |
addToZip(ZipOutputStream zos,
XWikiContext context)
Deprecated.
since 4.1M2
|
void |
addXObject(BaseObject object)
Add the object to the document.
|
void |
addXObject(DocumentReference classReference,
BaseObject object)
Deprecated.
use
addXObject(BaseObject) instead |
BaseObject |
addXObjectFromRequest(DocumentReference classReference,
int num,
XWikiContext context)
Adds object from an new object creation form.
|
BaseObject |
addXObjectFromRequest(DocumentReference classReference,
String prefix,
XWikiContext context)
Adds an object from an new object creation form.
|
BaseObject |
addXObjectFromRequest(EntityReference classReference,
String prefix,
int num,
XWikiContext context)
Adds object from an new object creation form.
|
BaseObject |
addXObjectFromRequest(EntityReference classReference,
XWikiContext context)
Adds an object from an new object creation form.
|
BaseObject |
addXObjectFromRequest(XWikiContext context)
Adds an object from an new object creation form.
|
List<BaseObject> |
addXObjectsFromRequest(DocumentReference classReference,
String pref,
XWikiContext context)
Adds multiple objects from an new objects creation form.
|
List<BaseObject> |
addXObjectsFromRequest(DocumentReference classReference,
XWikiContext context)
Adds multiple objects from an new objects creation form.
|
void |
addXObjectsToRemoveFromVersion(XWikiDocument previousVersion)
Automatically add objects present in the old version, but not in the current document, to the list of objects
marked for removal from the database.
|
void |
addXObjectToRemove(BaseObject object) |
void |
appendMeta(String meta) |
boolean |
apply(XWikiDocument document)
Apply modification comming from provided document.
|
boolean |
apply(XWikiDocument document,
boolean clean)
Apply modification comming from provided document.
|
static void |
backupContext(Map<String,Object> backup,
XWikiContext context) |
void |
clearAttachmentsToRemove()
Clear the list of attachments planned for removal.
|
XWikiDocument |
clone() |
void |
clone(XWikiDocument document)
Use the document passed as parameter as the new identity for the current document.
|
XWikiDocument |
cloneRename(DocumentReference newDocumentReference,
XWikiContext context)
Clone a document and change its reference.
|
void |
cloneXObjects(XWikiDocument templatedoc) |
static boolean |
containsXMLWikiDocument(org.dom4j.Document domdoc)
Check if provided xml document is a wiki document.
|
void |
convertSyntax(String targetSyntaxId,
XWikiContext context)
Convert the current document content from its current syntax to the new syntax passed as parameter.
|
void |
convertSyntax(org.xwiki.rendering.syntax.Syntax targetSyntax,
XWikiContext context)
Convert the current document content from its current syntax to the new syntax passed as parameter.
|
void |
copyAttachments(XWikiDocument sourceDocument)
Copy attachments from one document to another.
|
XWikiDocument |
copyDocument(DocumentReference newDocumentReference,
XWikiContext context) |
XWikiDocument |
copyDocument(String newDocumentName,
XWikiContext context)
Deprecated.
since 2.2M1 use
copyDocument(DocumentReference, XWikiContext) instead |
int |
createNewObject(String className,
XWikiContext context)
Deprecated.
since 2.2M1 use
createXObject(EntityReference, XWikiContext) instead |
int |
createXObject(EntityReference classReference,
XWikiContext context)
Create and add a new object to the document with the provided class.
|
String |
display(String fieldname,
BaseObject obj,
XWikiContext context) |
String |
display(String fieldname,
String type,
BaseObject obj,
boolean isolated,
XWikiContext context) |
String |
display(String fieldname,
String type,
BaseObject obj,
String wrappingSyntaxId,
XWikiContext context) |
String |
display(String fieldname,
String type,
BaseObject obj,
XWikiContext context) |
String |
display(String fieldname,
String type,
String pref,
BaseObject obj,
boolean isolated,
XWikiContext context) |
String |
display(String fieldname,
String type,
String pref,
BaseObject obj,
String wrappingSyntaxId,
boolean isolated,
XWikiContext context) |
String |
display(String fieldname,
String type,
String pref,
BaseObject obj,
String wrappingSyntaxId,
XWikiContext context) |
String |
display(String fieldname,
String type,
String pref,
BaseObject obj,
XWikiContext context) |
String |
display(String fieldname,
String mode,
String prefix,
XWikiContext context) |
String |
display(String fieldname,
String mode,
XWikiContext context) |
String |
display(String fieldname,
XWikiContext context) |
String |
displayDocument(boolean restricted,
XWikiContext context)
Execute and render the current document in the current context.
|
String |
displayDocument(org.xwiki.rendering.syntax.Syntax targetSyntax,
boolean restricted,
XWikiContext context)
Execute and render the current document in the current context.
|
String |
displayDocument(org.xwiki.rendering.syntax.Syntax targetSyntax,
XWikiContext context)
Execute and render the current document in the current context.
|
String |
displayDocument(XWikiContext context)
Execute and render the current document in the current context.
|
String |
displayEdit(PropertyClass pclass,
String prefix,
BaseCollection object,
XWikiContext context) |
String |
displayForm(DocumentReference classReference,
String header,
String format,
boolean linebreak,
XWikiContext context) |
String |
displayForm(DocumentReference classReference,
String header,
String format,
XWikiContext context) |
String |
displayForm(DocumentReference classReference,
XWikiContext context) |
String |
displayForm(String className,
String header,
String format,
boolean linebreak,
XWikiContext context)
Deprecated.
since 2.2M1, use
displayForm(DocumentReference, String, String, boolean, XWikiContext)
instead |
String |
displayForm(String className,
String header,
String format,
XWikiContext context)
Deprecated.
since 2.2M1, use
displayForm(DocumentReference, String, String, XWikiContext) instead |
String |
displayForm(String className,
XWikiContext context)
Deprecated.
since 2.2M1, use
displayForm(DocumentReference, XWikiContext) instead |
String |
displayHidden(PropertyClass pclass,
String prefix,
BaseCollection object,
XWikiContext context) |
String |
displayPrettyName(String fieldname,
BaseObject obj,
XWikiContext context) |
String |
displayPrettyName(String fieldname,
boolean showMandatory,
BaseObject obj,
XWikiContext context) |
String |
displayPrettyName(String fieldname,
boolean showMandatory,
boolean before,
BaseObject obj,
XWikiContext context) |
String |
displayPrettyName(String fieldname,
boolean showMandatory,
boolean before,
XWikiContext context) |
String |
displayPrettyName(String fieldname,
boolean showMandatory,
XWikiContext context) |
String |
displayPrettyName(String fieldname,
XWikiContext context) |
String |
displayRendered(PropertyClass pclass,
String prefix,
BaseCollection object,
XWikiContext context) |
String |
displayTooltip(String fieldname,
BaseObject obj,
XWikiContext context) |
String |
displayTooltip(String fieldname,
XWikiContext context) |
String |
displayView(PropertyClass pclass,
String prefix,
BaseCollection object,
XWikiContext context) |
XWikiDocument |
duplicate(DocumentReference newDocumentReference)
Duplicate this document and give it a new name.
|
void |
duplicateXObjects(XWikiDocument templatedoc) |
protected String |
encodedXMLStringAsUTF8(String xmlString) |
boolean |
equals(Object object) |
boolean |
equalsData(XWikiDocument otherDocument)
Same as
equals(Object) but only for actual datas of the document. |
void |
fromXML(org.dom4j.Document domdoc,
boolean withArchive)
Deprecated.
since 9.0RC1, use
fromXML(InputStream) instead |
void |
fromXML(org.xwiki.filter.input.InputSource source,
boolean withArchive) |
void |
fromXML(InputStream is) |
void |
fromXML(InputStream source,
boolean withArchive) |
void |
fromXML(String xml) |
void |
fromXML(String source,
boolean withArchive) |
XWikiAttachment |
getAttachment(String filename) |
List<AttachmentDiff> |
getAttachmentDiff(XWikiDocument fromDoc,
XWikiDocument toDoc,
XWikiContext context) |
List<XWikiAttachment> |
getAttachmentList() |
String |
getAttachmentRevisionURL(String filename,
String revision,
String querystring,
XWikiContext context) |
String |
getAttachmentRevisionURL(String filename,
String revision,
XWikiContext context) |
XWikiAttachmentStoreInterface |
getAttachmentStore(XWikiContext context)
Deprecated.
since 9.9RC1, use
XWiki.getDefaultAttachmentContentStore() instead |
List<XWikiDocument.XWikiAttachmentToRemove> |
getAttachmentsToRemove() |
String |
getAttachmentURL(String filename,
String action,
String querystring,
XWikiContext context) |
String |
getAttachmentURL(String filename,
String action,
XWikiContext context) |
String |
getAttachmentURL(String filename,
XWikiContext context) |
String |
getAuthor()
Deprecated.
since 3.0M3 use
getAuthorReference() instead |
DocumentReference |
getAuthorReference() |
List<String> |
getBackLinkedPages(XWikiContext context)
Deprecated.
since 2.2M2 use
getBackLinkedReferences(XWikiContext) |
List<DocumentReference> |
getBackLinkedReferences(XWikiContext context)
Get the wiki document references pointing to this document.
|
List<String> |
getChildren(int nb,
int start,
XWikiContext context)
Deprecated.
since 2.2M2 use
getChildrenReferences(XWikiContext) |
List<String> |
getChildren(XWikiContext context)
Deprecated.
since 2.2M2 use
getChildrenReferences(XWikiContext) |
List<DocumentReference> |
getChildrenReferences(int nb,
int start,
XWikiContext context)
Returns a list of references of all documents which list this document as their parent, in the current wiki.
|
List<DocumentReference> |
getChildrenReferences(XWikiContext context)
Returns a list of references of all documents which list this document as their parent, in the current wiki.
|
List<List<ObjectDiff>> |
getClassDiff(XWikiDocument fromDoc,
XWikiDocument toDoc,
XWikiContext context) |
String |
getComment() |
Vector<BaseObject> |
getComments() |
Vector<BaseObject> |
getComments(boolean asc) |
String |
getContent() |
String |
getContentAuthor()
Deprecated.
since 3.0M3 use
getContentAuthorReference() instead |
DocumentReference |
getContentAuthorReference() |
List<org.suigeneris.jrcs.diff.delta.Delta> |
getContentDiff(String fromRev,
String toRev,
XWikiContext context) |
List<org.suigeneris.jrcs.diff.delta.Delta> |
getContentDiff(String fromRev,
XWikiContext context) |
List<org.suigeneris.jrcs.diff.delta.Delta> |
getContentDiff(XWikiDocument fromDoc,
XWikiDocument toDoc,
XWikiContext context) |
String |
getContentOfSection(int sectionNumber)
Return the content of a section.
|
Date |
getContentUpdateDate() |
Date |
getCreationDate() |
String |
getCreator()
Deprecated.
since 3.0M2 use
getCreatorReference() instead |
DocumentReference |
getCreatorReference() |
String |
getCustomClass() |
String |
getDatabase()
Deprecated.
since 2.2M1 use
getDocumentReference() instead |
Date |
getDate() |
String |
getDefaultEditMode(XWikiContext context)
Gets the default edit mode for this document.
|
String |
getDefaultEditURL(XWikiContext context) |
String |
getDefaultLanguage()
Deprecated.
since 4.3M2 use
getDefaultLocale() instead |
Locale |
getDefaultLocale() |
String |
getDefaultTemplate() |
protected List<org.suigeneris.jrcs.diff.delta.Delta> |
getDeltas(org.suigeneris.jrcs.diff.Revision rev) |
XWikiDocumentArchive |
getDocumentArchive() |
XWikiDocumentArchive |
getDocumentArchive(XWikiContext context) |
DocumentReference |
getDocumentReference() |
DocumentReference |
getDocumentReferenceWithLocale() |
DocumentSection |
getDocumentSection(int sectionNumber)
Return a Document section with parameter is sectionNumber.
|
String |
getEditURL(String action,
String mode,
String language,
XWikiContext context) |
String |
getEditURL(String action,
String mode,
XWikiContext context) |
protected String |
getElement(org.dom4j.Element docel,
String name) |
int |
getElements() |
String |
getEscapedContent(XWikiContext context) |
String |
getExternalAttachmentURL(String filename,
String action,
XWikiContext context) |
String |
getExternalURL(String action,
String querystring,
XWikiContext context) |
String |
getExternalURL(String action,
XWikiContext context) |
BaseObject |
getFirstObject(String fieldname) |
BaseObject |
getFirstObject(String fieldname,
XWikiContext context) |
String |
getFormat() |
String |
getFullName()
Deprecated.
since 2.2M1 use
getDocumentReference() instead |
long |
getId() |
List<String> |
getIncludedMacros(XWikiContext context) |
List<String> |
getIncludedPages(XWikiContext context) |
String |
getInternalProperty(String propname) |
static String |
getInternalPropertyName(String propname,
XWikiContext context) |
int |
getIntValue(DocumentReference classReference,
String fieldName) |
int |
getIntValue(DocumentReference classReference,
String fieldName,
int defaultValue)
Retrieve the int value of the given property of the first object of the given class.
|
int |
getIntValue(String fieldName) |
int |
getIntValue(String className,
String fieldName)
Deprecated.
since 2.2M2 use
getIntValue(DocumentReference, String) instead |
String |
getKey()
Helper to produce and cache a uid serialization of this document reference, including the language.
|
String |
getLanguage()
Deprecated.
since 4.3M2 use
getLocale() instead |
List<org.suigeneris.jrcs.diff.delta.Delta> |
getLastChanges(XWikiContext context) |
List |
getListValue(DocumentReference classReference,
String fieldName) |
List |
getListValue(String fieldName) |
List |
getListValue(String className,
String fieldName)
Deprecated.
since 2.2M2 use
getListValue(DocumentReference, String) instead |
Locale |
getLocale() |
int |
getLocalReferenceMaxLength()
Compute and return the maximum authorized length for the full name (i.e.
|
XWikiLock |
getLock(XWikiContext context) |
long |
getLongValue(DocumentReference classReference,
String fieldName) |
long |
getLongValue(String fieldName) |
long |
getLongValue(String className,
String fieldName)
Deprecated.
since 2.2M2 use
getLongValue(DocumentReference, String) instead |
String |
getMeta() |
List<MetaDataDiff> |
getMetaDataDiff(String fromRev,
String toRev,
XWikiContext context) |
List<MetaDataDiff> |
getMetaDataDiff(String fromRev,
XWikiContext context) |
List<MetaDataDiff> |
getMetaDataDiff(XWikiDocument fromDoc,
XWikiDocument toDoc,
XWikiContext context) |
protected Boolean |
getMinorEdit1() |
String |
getName()
Deprecated.
since 2.2M1 used
getDocumentReference() instead |
static org.suigeneris.jrcs.rcs.Version |
getNextVersion(org.suigeneris.jrcs.rcs.Version version,
boolean minorEdit)
This method computes the next version and returns it, but won't change the current version.
|
BaseObject |
getObject(String className)
Deprecated.
since 2.2M1 use
getXObject(DocumentReference) instead |
BaseObject |
getObject(String className,
boolean create,
XWikiContext context)
Deprecated.
since 2.2M2 use
getXObject(DocumentReference, boolean, XWikiContext) |
BaseObject |
getObject(String className,
int nb)
Deprecated.
since 2.2M1 use
getXObject(DocumentReference, int) instead |
BaseObject |
getObject(String className,
String key,
String value)
Deprecated.
since 2.2M1 use
getXObject(DocumentReference, String, String) instead |
BaseObject |
getObject(String className,
String key,
String value,
boolean failover)
Deprecated.
since 2.2M1 use
getXObject(DocumentReference, String, String, boolean) instead |
List<List<ObjectDiff>> |
getObjectDiff(String fromRev,
String toRev,
XWikiContext context) |
List<List<ObjectDiff>> |
getObjectDiff(String fromRev,
XWikiContext context) |
List<List<ObjectDiff>> |
getObjectDiff(XWikiDocument fromDoc,
XWikiDocument toDoc,
XWikiContext context)
Return the object differences between two document versions.
|
int |
getObjectNumbers(String className)
Deprecated.
since 2.2M1 use
getXObjectSize(DocumentReference) instead |
Vector<BaseObject> |
getObjects(String className)
Deprecated.
since 2.2M1 use
getXObjects(DocumentReference) instead |
ArrayList<BaseObject> |
getObjectsToRemove()
Deprecated.
since 2.2M2 use
getObjectsToRemove() instead |
XWikiDocument |
getOriginalDocument() |
String |
getPageName()
Deprecated.
since 2.2M1 use
getDocumentReference() instead |
PageReference |
getPageReference() |
PageReference |
getPageReferenceWithLocale() |
String |
getParent()
Deprecated.
since 2.2M1 use
getParentReference() instead |
XWikiDocument |
getParentDoc()
Deprecated.
since 2.2M1 use
getParentReference() instead |
DocumentReference |
getParentReference() |
String |
getParentURL(XWikiContext context) |
String |
getPrefixedFullName()
Deprecated.
since 2.2M1 use
getDocumentReference() instead |
String |
getPreviousVersion() |
org.suigeneris.jrcs.rcs.Version |
getRCSVersion() |
String |
getRealLanguage()
Deprecated.
since 4.3M1 use
getRealLocale() instead |
String |
getRealLanguage(XWikiContext context)
Deprecated.
since 4.3M1 use
getRealLocale() instead |
Locale |
getRealLocale() |
String[] |
getRecentRevisions(int nb,
XWikiContext context) |
EntityReference |
getRelativeParentReference()
Return the reference of the parent document as it stored and passed to
setParentReference(EntityReference) . |
String |
getRenderedContent(boolean transformationContextIsolated,
XWikiContext context) |
String |
getRenderedContent(String text,
String syntaxId,
boolean restrictedTransformationContext,
XWikiContext context) |
String |
getRenderedContent(String text,
String syntaxId,
boolean restrictedTransformationContext,
XWikiDocument sDocument,
XWikiContext context) |
String |
getRenderedContent(String text,
String sourceSyntaxId,
String targetSyntaxId,
boolean restrictedTransformationContext,
XWikiContext context) |
String |
getRenderedContent(String text,
String sourceSyntaxId,
String targetSyntaxId,
boolean restrictedTransformationContext,
XWikiDocument sDocument,
XWikiContext context) |
String |
getRenderedContent(String text,
String sourceSyntaxId,
String targetSyntaxId,
XWikiContext context) |
String |
getRenderedContent(String text,
String syntaxId,
XWikiContext context) |
String |
getRenderedContent(String text,
org.xwiki.rendering.syntax.Syntax sourceSyntaxId,
org.xwiki.rendering.syntax.Syntax targetSyntaxId,
boolean restrictedTransformationContext,
XWikiDocument sDocument,
boolean isolated,
XWikiContext context) |
String |
getRenderedContent(String text,
org.xwiki.rendering.syntax.Syntax sourceSyntaxId,
XWikiDocument sDocument,
boolean isolated,
XWikiContext context) |
String |
getRenderedContent(org.xwiki.rendering.syntax.Syntax targetSyntax,
boolean transformationContextIsolated,
XWikiContext context)
Execute and render the document or its translation in the current context.
|
String |
getRenderedContent(org.xwiki.rendering.syntax.Syntax targetSyntax,
XWikiContext context) |
String |
getRenderedContent(XWikiContext context) |
List<org.suigeneris.jrcs.diff.delta.Delta> |
getRenderedContentDiff(String fromRev,
String toRev,
XWikiContext context) |
List<org.suigeneris.jrcs.diff.delta.Delta> |
getRenderedContentDiff(String fromRev,
XWikiContext context) |
List<org.suigeneris.jrcs.diff.delta.Delta> |
getRenderedContentDiff(XWikiDocument fromDoc,
XWikiDocument toDoc,
XWikiContext context) |
String |
getRenderedTitle(org.xwiki.rendering.syntax.Syntax outputSyntax,
XWikiContext context)
Get the rendered version of the document title.
|
String |
getRenderedTitle(XWikiContext context)
Similar to
getRenderedTitle(Syntax, XWikiContext) but the output Syntax used is XHTML 1.0 unless the
current skin defines another output Syntax in which case it's the one used. |
XWikiRCSNodeInfo |
getRevisionInfo(String version,
XWikiContext context) |
List<String> |
getRevisions(RevisionCriteria criteria,
XWikiContext context)
Get document versions matching criterias like author, minimum creation date, etc.
|
org.suigeneris.jrcs.rcs.Version[] |
getRevisions(XWikiContext context) |
List<DocumentSection> |
getSections()
Get the top sections contained in the document.
|
String |
getSpace()
Deprecated.
since 2.2M1 used
getDocumentReference() instead |
String |
getSpaceName()
Deprecated.
since 2.2M1 use
getDocumentReference() instead |
XWikiStoreInterface |
getStore() |
XWikiStoreInterface |
getStore(XWikiContext context) |
String |
getStringValue(DocumentReference classReference,
String fieldName) |
String |
getStringValue(EntityReference classReference,
String fieldName) |
String |
getStringValue(String fieldName) |
String |
getStringValue(String className,
String fieldName)
Deprecated.
since 2.2M2 use
getStringValue(DocumentReference, String) instead |
org.xwiki.rendering.syntax.Syntax |
getSyntax() |
String |
getSyntaxId()
Deprecated.
since 2.3M1, use {link #getSyntax()} instead
|
String |
getTags(XWikiContext context) |
List<String> |
getTagsList(XWikiContext context) |
List<String> |
getTagsPossibleValues(XWikiContext context) |
String |
getTemplate()
Deprecated.
since 2.2M1 use
getTemplateDocumentReference() instead |
DocumentReference |
getTemplateDocumentReference() |
String |
getTitle() |
String |
getTranslatedContent(String locale,
XWikiContext context) |
String |
getTranslatedContent(XWikiContext context) |
XWikiDocument |
getTranslatedDocument(Locale locale,
XWikiContext context)
Return the document in the provided language.
|
XWikiDocument |
getTranslatedDocument(String language,
XWikiContext context)
Deprecated.
since 4.3M2 use
getTranslatedDocument(Locale, XWikiContext) insead |
XWikiDocument |
getTranslatedDocument(XWikiContext context) |
int |
getTranslation() |
List<String> |
getTranslationList(XWikiContext context)
Deprecated.
since 5.1M2 use
getTranslationLocales(XWikiContext) instead |
List<Locale> |
getTranslationLocales(XWikiContext context)
The locales of the translation of this document (the default locale is not included).
|
Set<String> |
getUniqueLinkedPages(XWikiContext context)
Extract all the unique static (i.e.
|
Set<XWikiLink> |
getUniqueWikiLinkedPages(XWikiContext context)
Get a list of unique links from this document to others documents.
|
String |
getURL(String action,
boolean redirect,
XWikiContext context) |
String |
getURL(String action,
String params,
boolean redirect,
XWikiContext context) |
String |
getURL(String action,
String querystring,
String anchor,
XWikiContext context) |
String |
getURL(String action,
String querystring,
XWikiContext context) |
String |
getURL(String action,
XWikiContext context) |
String |
getValidationScript() |
String |
getVersion() |
String |
getVersionHashCode(XWikiContext context)
Computes a document hash, taking into account all document data: content, objects, attachments, metadata...
|
XWikiVersioningStoreInterface |
getVersioningStore(XWikiContext context) |
String |
getWeb()
Deprecated.
use
getDocumentReference() instead |
String |
getWikiName()
Deprecated.
since 2.2M1 use
getDocumentReference() instead |
Object |
getWikiNode() |
BaseClass |
getXClass() |
List<BaseClass> |
getXClasses(XWikiContext context) |
String |
getXClassXML() |
org.xwiki.rendering.block.XDOM |
getXDOM()
NOTE: This method caches the XDOM and returns a clone that can be safely modified.
|
String |
getXMLContent(XWikiContext context)
Retrieve the document in the current context language as an XML string.
|
List<org.suigeneris.jrcs.diff.delta.Delta> |
getXMLDiff(XWikiDocument fromDoc,
XWikiDocument toDoc,
XWikiContext context) |
BaseObject |
getXObject() |
BaseObject |
getXObject(DocumentReference classReference) |
BaseObject |
getXObject(DocumentReference classReference,
boolean create,
XWikiContext context) |
BaseObject |
getXObject(DocumentReference classReference,
int nb) |
BaseObject |
getXObject(DocumentReference classReference,
String key,
String value) |
BaseObject |
getXObject(DocumentReference classReference,
String key,
String value,
boolean failover) |
BaseObject |
getXObject(EntityReference reference) |
BaseObject |
getXObject(EntityReference classReference,
boolean create,
XWikiContext context) |
BaseObject |
getXObject(EntityReference classReference,
int nb) |
BaseObject |
getXObject(EntityReference classReference,
int number,
boolean create,
XWikiContext xcontext)
Get an xobject with the passed xclass at the passed location.
|
BaseObject |
getXObject(EntityReference reference,
String key,
String value,
boolean failover) |
BaseObject |
getXObject(ObjectReference objectReference)
Get an object of this document based on its reference.
|
BaseProperty<ObjectPropertyReference> |
getXObjectProperty(ObjectPropertyReference objectPropertyReference)
Get an object property of this document based on its reference.
|
Map<DocumentReference,List<BaseObject>> |
getXObjects() |
List<BaseObject> |
getXObjects(DocumentReference classReference) |
List<BaseObject> |
getXObjects(EntityReference reference) |
int |
getXObjectSize(DocumentReference classReference) |
int |
getXObjectSize(EntityReference classReference) |
List<BaseObject> |
getXObjectsToRemove() |
String |
getxWikiClassXML()
Deprecated.
since 2.2M1 use
getXClassXML() instead Hibernate uses this through reflection. It cannot be
removed without altering hibernate.cfg.xml |
BaseObject |
getxWikiObject()
Deprecated.
since 2.2M1 use
getXObject() instead |
boolean |
hasElement(int element) |
int |
hashCode() |
void |
incrementVersion()
Increment the current document version.
|
void |
insertText(String text,
String marker,
XWikiContext context) |
boolean |
is10Syntax() |
boolean |
is10Syntax(String syntaxId) |
boolean |
isAdvancedContent() |
boolean |
isContentDirty() |
boolean |
isCreator(DocumentReference username) |
boolean |
isCreator(String username)
Deprecated.
use
isCreator(DocumentReference) instead |
boolean |
isCurrentLocalUserPage(XWikiContext context) |
boolean |
isCurrentUserCreator(XWikiContext context) |
boolean |
isCurrentUserPage(XWikiContext context) |
boolean |
isFromCache() |
Boolean |
isHidden()
Indicates whether the document is 'hidden' or not, meaning that it should not be returned in public search
results.
|
boolean |
isMetaDataDirty() |
boolean |
isMinorEdit() |
boolean |
isMostRecent() |
boolean |
isNew() |
boolean |
isProgrammaticContent() |
void |
loadArchive(XWikiContext context) |
void |
loadAttachmentContent(XWikiAttachment attachment,
XWikiContext context)
Deprecated.
since 9.9RC1, use
XWikiAttachment.loadContent(XWikiContext) |
void |
loadAttachments(XWikiContext context) |
void |
loadAttachmentsContent(XWikiContext context)
Load attachment content from database.
|
void |
loadAttachmentsContentSafe(XWikiContext context)
Same as
loadAttachmentContent(XWikiAttachment, XWikiContext) but in some context we don't really care if
an attachment content could not be loaded (we are going to overwrite or ignore it). |
XWikiDocumentArchive |
loadDocumentArchive() |
MergeResult |
merge(XWikiDocument previousDocument,
XWikiDocument newDocument,
MergeConfiguration configuration,
XWikiContext context)
Deprecated.
|
void |
mergeXClass(XWikiDocument templatedoc) |
void |
mergeXObjects(XWikiDocument templateDoc) |
void |
mergexWikiClass(XWikiDocument templatedoc)
Deprecated.
since 2.2M1 use
mergeXClass(XWikiDocument) instead |
void |
mergexWikiObjects(XWikiDocument templatedoc)
Deprecated.
since 2.2M1 use
mergeXObjects(XWikiDocument) instead |
Document |
newDocument(Class<?> customClass,
XWikiContext context)
Create a new protected
Document public API to access page information and actions from
scripting. |
Document |
newDocument(String customClassName,
XWikiContext context)
Create a new protected
Document public API to access page information and actions from
scripting. |
Document |
newDocument(XWikiContext context) |
BaseObject |
newObject(String className,
XWikiContext context)
Deprecated.
since 2.2M2 use
newXObject(EntityReference, XWikiContext) |
BaseObject |
newXObject(EntityReference classReference,
XWikiContext context)
Create, add and return a new object with the provided class.
|
void |
readDocMetaFromForm(EditForm eform,
XWikiContext context) |
void |
readFromForm(EditForm eform,
XWikiContext context) |
void |
readFromTemplate(DocumentReference templateDocumentReference,
XWikiContext context) |
void |
readFromTemplate(EditForm eform,
XWikiContext context) |
void |
readFromTemplate(String template,
XWikiContext context)
Deprecated.
since 2.2M1 use
readFromTemplate(DocumentReference, XWikiContext) instead |
void |
readObjectsFromForm(EditForm eform,
XWikiContext context) |
void |
readObjectsFromFormUpdateOrCreate(EditForm eform,
XWikiContext context)
Create and/or update objects in a document given a list of HTTP parameters of the form
<spacename>.<classname>_<number>_<propertyname> . |
void |
readTranslationMetaFromForm(EditForm eform,
XWikiContext context) |
XWikiAttachment |
removeAttachment(XWikiAttachment attachment)
Remove the attachment from the document attachment list and put it in the list of attachments to remove for next
document save.
|
XWikiAttachment |
removeAttachment(XWikiAttachment attachmentToRemove,
boolean toRecycleBin)
Remove the attachment from the document attachment list and put it in the list of attachments to remove for next
document save.
|
void |
removeLock(XWikiContext context) |
boolean |
removeObject(BaseObject object)
Deprecated.
since 2.2M1, use
removeXObject(com.xpn.xwiki.objects.BaseObject) instead |
boolean |
removeObjects(String className)
Deprecated.
since 2.2M1 use
removeXObjects(org.xwiki.model.reference.DocumentReference) instead |
boolean |
removeXObject(BaseObject object)
Remove an XObject from the document.
|
boolean |
removeXObjects(DocumentReference classReference)
Remove all the objects of a given type (XClass) from the document.
|
boolean |
removeXObjects(EntityReference reference)
Remove all the objects of a given type (XClass) from the document.
|
void |
rename(DocumentReference newDocumentReference,
List<DocumentReference> backlinkDocumentReferences,
List<DocumentReference> childDocumentReferences,
XWikiContext context)
Deprecated.
Since 12.5RC1 prefer using
XWiki.renameDocument(DocumentReference, DocumentReference, boolean, List, List, XWikiContext) . |
void |
rename(DocumentReference newDocumentReference,
List<DocumentReference> backlinkDocumentReferences,
XWikiContext context)
Deprecated.
Since 12.5RC1 prefer using
XWiki.renameDocument(DocumentReference, DocumentReference, boolean, List, List, XWikiContext) . |
void |
rename(DocumentReference newDocumentReference,
XWikiContext context)
Deprecated.
Since 12.5RC1 prefer using
XWiki.renameDocument(DocumentReference, DocumentReference, boolean, List, List, XWikiContext) . |
void |
renameProperties(DocumentReference classReference,
Map<String,String> fieldsToRename) |
void |
renameProperties(String className,
Map<String,String> fieldsToRename)
Deprecated.
since 2.2M2 use
renameProperties(DocumentReference, Map) instead |
protected static String |
renderXDOM(org.xwiki.rendering.block.XDOM content,
org.xwiki.rendering.syntax.Syntax targetSyntax)
Render provided XDOM into content of the provided syntax identifier.
|
void |
resetArchive(XWikiContext context) |
DocumentReference |
resolveClassReference(String documentName)
Backward-compatibility method to use in order to resolve a class reference passed as a String into a
DocumentReference proper.
|
static void |
restoreContext(Map<String,Object> backup,
XWikiContext context) |
void |
saveAllAttachments(boolean updateParent,
boolean transaction,
XWikiContext context)
Deprecated.
should not be used, save the document instead
|
void |
saveAllAttachments(XWikiContext context)
Deprecated.
should not be used, save the document instead
|
void |
saveAttachmentContent(XWikiAttachment attachment,
boolean updateParent,
boolean transaction,
XWikiContext context)
Deprecated.
should not be used, save the document instead
|
void |
saveAttachmentContent(XWikiAttachment attachment,
XWikiContext context)
Deprecated.
should not be used, save the document instead
|
void |
saveAttachmentsContent(List<XWikiAttachment> attachments,
XWikiContext context)
Deprecated.
should not be used, save the document instead
|
void |
setAsContextDoc(XWikiContext context) |
XWikiAttachment |
setAttachment(String fileName,
InputStream content,
XWikiContext context)
Create or update attachment with the passed name with the passed content.
|
XWikiAttachment |
setAttachment(XWikiAttachment attachment)
Insert passed attachment in the document and return any pre-existing attachment with the same name.
|
void |
setAttachmentList(List<XWikiAttachment> list) |
void |
setAuthor(String author)
Deprecated.
since 3.0M3 use
setAuthorReference(org.xwiki.model.reference.DocumentReference) instead |
void |
setAuthorReference(DocumentReference authorReference) |
void |
setComment(String comment) |
void |
setContent(String content) |
void |
setContent(org.xwiki.rendering.block.XDOM content) |
void |
setContentAuthor(String contentAuthor)
Deprecated.
since 3.0M3 use
setContentAuthorReference(org.xwiki.model.reference.DocumentReference) instead |
void |
setContentAuthorReference(DocumentReference contentAuthorReference) |
void |
setContentDirty(boolean contentDirty) |
void |
setContentUpdateDate(Date date) |
void |
setCreationDate(Date date) |
void |
setCreator(String creator)
Deprecated.
since 3.0M2 use
setCreatorReference(org.xwiki.model.reference.DocumentReference) instead |
void |
setCreatorReference(DocumentReference creatorReference) |
void |
setCustomClass(String customClass) |
void |
setDatabase(String database)
Deprecated.
since 2.2M1 use
setDocumentReference(DocumentReference) instead |
void |
setDate(Date date) |
void |
setDBStringListValue(EntityReference classReference,
String fieldName,
List value) |
void |
setDBStringListValue(String className,
String fieldName,
List value)
Deprecated.
since 2.2M2 use
setDBStringListValue(EntityReference, String, List) instead |
void |
setDefaultLanguage(String defaultLanguage)
Deprecated.
since 4.3M2 use
setDefaultLocale(Locale) instead |
void |
setDefaultLocale(Locale defaultLocale) |
void |
setDefaultTemplate(String defaultTemplate) |
void |
setDocumentArchive(String sarch) |
void |
setDocumentArchive(XWikiDocumentArchive arch) |
void |
setDocumentReference(DocumentReference reference)
Deprecated.
since 2.2.3 don't change the reference of a document once it's been constructed. Instead you can
clone the doc, rename it or copy it.
|
void |
setElement(int element,
boolean toggle) |
void |
setElements(int elements) |
void |
setFormat(String format) |
void |
setFromCache(boolean fromCache) |
void |
setFullName(String name)
Deprecated.
since 2.2M1 use
setDocumentReference(org.xwiki.model.reference.DocumentReference) instead |
void |
setFullName(String fullName,
XWikiContext context)
Deprecated.
since 2.2M1 use
setDocumentReference(org.xwiki.model.reference.DocumentReference) instead |
void |
setHidden(Boolean hidden)
Indicates whether the document should be 'hidden' or not, meaning that it should not be returned in public search
results.
|
void |
setId(long id) |
void |
setIntValue(EntityReference classReference,
String fieldName,
int value) |
void |
setIntValue(String className,
String fieldName,
int value)
Deprecated.
since 2.2M2 use
setIntValue(EntityReference, String, int) instead |
void |
setLanguage(String language)
Deprecated.
since 4.3M2 use
setLocale(Locale) instead |
void |
setLargeStringValue(EntityReference classReference,
String fieldName,
String value) |
void |
setLargeStringValue(String className,
String fieldName,
String value)
Deprecated.
since 2.2M2 use
setLargeStringValue(EntityReference, String, String) instead |
void |
setLocale(Locale locale) |
void |
setLock(String userName,
XWikiContext context) |
void |
setMeta(String meta) |
void |
setMetaDataDirty(boolean metaDataDirty) |
void |
setMinorEdit(boolean isMinor) |
protected void |
setMinorEdit1(Boolean isMinor) |
void |
setMostRecent(boolean mostRecent)
must not be used unless in store system.
|
void |
setName(String name)
Deprecated.
since 2.2M1 used
setDocumentReference(DocumentReference) instead |
void |
setNew(boolean aNew) |
void |
setObject(String className,
int nb,
BaseObject object)
Deprecated.
since 2.2M1 use
setXObject(DocumentReference, int, BaseObject) instead |
void |
setOriginalDocument(XWikiDocument originalDocument) |
void |
setParent(String parent)
Deprecated.
since 2.2M1, use
setParentReference(EntityReference) instead |
void |
setParentReference(EntityReference parentReference) |
void |
setProperty(EntityReference classReference,
String fieldName,
BaseProperty value) |
void |
setProperty(String className,
String fieldName,
BaseProperty value)
Deprecated.
since 2.2M2 use
setProperty(EntityReference, String, BaseProperty) instead |
void |
setRCSVersion(org.suigeneris.jrcs.rcs.Version version) |
void |
setSpace(String spaces)
Deprecated.
since 2.2M1 used
setDocumentReference(DocumentReference) instead |
void |
setStore(XWikiStoreInterface store) |
void |
setStringListValue(EntityReference classReference,
String fieldName,
List value) |
void |
setStringListValue(String className,
String fieldName,
List value)
Deprecated.
since 2.2M2 use
setStringListValue(EntityReference, String, List) instead |
void |
setStringValue(EntityReference classReference,
String fieldName,
String value) |
void |
setStringValue(String className,
String fieldName,
String value)
Deprecated.
since 2.2M2 use
setStringValue(EntityReference, String, String) instead |
void |
setSyntax(org.xwiki.rendering.syntax.Syntax syntax) |
void |
setSyntaxId(String syntaxId)
Deprecated.
since 2.3M1, use {link #setSyntax(Syntax)} instead
|
void |
setTags(String tagsStr,
XWikiContext context)
add tags to the document.
|
void |
setTemplate(String template)
Deprecated.
since 2.2M1 use
setTemplateDocumentReference(DocumentReference) instead |
void |
setTemplateDocumentReference(DocumentReference templateDocumentReference) |
void |
setTitle(String title) |
void |
setTranslation(int translation)
Deprecated.
since 5.4.6, stored in the database to speedup some queries (really ?) but in
XWikiDocument
it's calculated based on the document locale |
void |
setValidationScript(String validationScript) |
void |
setVersion(String version) |
void |
setWeb(String space)
Deprecated.
use
setDocumentReference(DocumentReference) instead |
void |
setWikiNode(Object wikiNode) |
void |
setXClass(BaseClass xwikiClass) |
void |
setXClassXML(String xClassXML) |
void |
setXObject(DocumentReference classReference,
int nb,
BaseObject object)
Deprecated.
use
setXObject(int, BaseObject) instead |
void |
setXObject(int nb,
BaseObject object)
Replaces the object at the specified position and for the specified object's xclass.
|
void |
setXObjects(DocumentReference classReference,
List<BaseObject> objects) |
void |
setXObjects(Map<DocumentReference,List<BaseObject>> objects) |
void |
setXObjectsToRemove(List<BaseObject> objectsToRemove) |
void |
setxWikiClassXML(String xClassXML)
Deprecated.
since 2.2M1 use
setXClassXML(String) ()} instead Hibernate uses this through reflection. It
cannot be removed without altering hibernate.cfg.xml |
String |
toFullXML(XWikiContext context)
Retrieve the document as an XML string.
|
String |
toString() |
String |
toXML(boolean bWithObjects,
boolean bWithRendering,
boolean bWithAttachmentContent,
boolean bWithVersions,
XWikiContext context)
Serialize the document to an XML string.
|
void |
toXML(DocumentInstanceInputProperties documentProperties,
XAROutputProperties xarProperties)
Serialize the document to an OutputStream.
|
void |
toXML(OutputStream out,
boolean bWithObjects,
boolean bWithRendering,
boolean bWithAttachmentContent,
boolean bWithVersions,
XWikiContext context)
Serialize the document to an OutputStream.
|
void |
toXML(org.xwiki.filter.output.OutputTarget out,
boolean bWithObjects,
boolean bWithRendering,
boolean bWithAttachmentContent,
boolean bWithVersions,
boolean format,
String encoding)
Serialize the document to an OutputStream.
|
void |
toXML(com.xpn.xwiki.internal.xml.XMLWriter wr,
boolean bWithObjects,
boolean bWithRendering,
boolean bWithAttachmentContent,
boolean bWithVersions,
XWikiContext context)
Deprecated.
since 9.0RC1, use
toXML(OutputTarget, boolean, boolean, boolean, boolean, boolean, String)
instead |
String |
toXML(XWikiContext context)
Retrieve the document as an XML string.
|
org.dom4j.Document |
toXMLDocument(boolean bWithObjects,
boolean bWithRendering,
boolean bWithAttachmentContent,
boolean bWithVersions,
XWikiContext context)
Deprecated.
since 9.0RC1, use
toXML(OutputTarget, boolean, boolean, boolean, boolean, boolean, String)
instead |
org.dom4j.Document |
toXMLDocument(XWikiContext context)
Deprecated.
since 9.0RC1, use
toXML(OutputTarget, boolean, boolean, boolean, boolean, boolean, String)
instead |
String |
updateDocumentSection(int sectionNumber,
String newSectionContent)
Update a section content in document.
|
BaseObject |
updateObjectFromRequest(String className,
String prefix,
int num,
XWikiContext context)
Deprecated.
|
BaseObject |
updateObjectFromRequest(String className,
String prefix,
XWikiContext context)
Deprecated.
since 2.2M2 use
updateXObjectFromRequest(EntityReference, String, XWikiContext) |
BaseObject |
updateObjectFromRequest(String className,
XWikiContext context)
Deprecated.
since 2.2M2 use
updateXObjectFromRequest(EntityReference, XWikiContext) |
List<BaseObject> |
updateObjectsFromRequest(String className,
String pref,
XWikiContext context)
Deprecated.
since 2.2M2 use
updateXObjectsFromRequest(EntityReference, String, XWikiContext) |
List<BaseObject> |
updateObjectsFromRequest(String className,
XWikiContext context)
Deprecated.
since 2.2M2 use
updateXObjectsFromRequest(EntityReference, XWikiContext) |
BaseObject |
updateXObjectFromRequest(EntityReference classReference,
String prefix,
int num,
XWikiContext context)
Adds an object from an new object creation form.
|
BaseObject |
updateXObjectFromRequest(EntityReference classReference,
String prefix,
XWikiContext context)
Adds an object from an new object creation form.
|
BaseObject |
updateXObjectFromRequest(EntityReference classReference,
XWikiContext context)
Adds an object from an new object creation form.
|
List<BaseObject> |
updateXObjectsFromRequest(EntityReference classReference,
String pref,
XWikiContext context)
Adds multiple objects from an new objects creation form.
|
List<BaseObject> |
updateXObjectsFromRequest(EntityReference classReference,
XWikiContext context)
Adds an object from an new object creation form.
|
boolean |
validate(String[] classNames,
XWikiContext context) |
boolean |
validate(XWikiContext context) |
public static final EntityReference COMMENTSCLASS_REFERENCE
public static final EntityReference SHEETCLASS_REFERENCE
public static final int HAS_ATTACHMENTS
public static final int HAS_OBJECTS
public static final int HAS_CLASS
public static final String CKEY_SDOC
public static final String DB_SPACE_SEP
public static final String SPACE_NAME_SEP
protected org.suigeneris.jrcs.rcs.Version version
public XWikiDocument(DocumentReference reference)
Locale.ROOT
even if the reference contains a locale.
If you want to create a document for another locale, use XWikiDocument(DocumentReference, Locale)
.public XWikiDocument(DocumentReference reference, Locale locale)
@Deprecated public XWikiDocument()
XWikiDocument(org.xwiki.model.reference.DocumentReference)
instead@Deprecated public XWikiDocument(String space, String name)
XWikiDocument(org.xwiki.model.reference.DocumentReference)
insteadsetDatabase(String)
must be called afterwards to specify the wiki name.space
- the space this document belongs toname
- the name of the document@Deprecated public XWikiDocument(String wiki, String space, String name)
XWikiDocument(org.xwiki.model.reference.DocumentReference)
insteadwiki
- The wiki this document belongs to.space
- The space this document belongs to.name
- The name of the document (can contain either the page name or the space and page name)public XWikiStoreInterface getStore(XWikiContext context)
@Deprecated public XWikiAttachmentStoreInterface getAttachmentStore(XWikiContext context)
XWiki.getDefaultAttachmentContentStore()
insteadpublic XWikiVersioningStoreInterface getVersioningStore(XWikiContext context)
public XWikiStoreInterface getStore()
public void setStore(XWikiStoreInterface store)
public String getKey()
public long getId()
public void setId(long id)
getId()
@Deprecated public String getSpace()
getDocumentReference()
insteadspace11
of space
space1
will return space1.space11
.
Note that this method cannot be removed for now since it's used by Hibernate for saving a XWikiDocument.
@Deprecated public void setSpace(String spaces)
setDocumentReference(DocumentReference)
insteadNote that this method cannot be removed for now since it's used by Hibernate for loading a XWikiDocument.
getSpace()
@Deprecated public String getWeb()
getDocumentReference()
insteadgetSpace()
@Deprecated public void setWeb(String space)
setDocumentReference(DocumentReference)
insteadpublic String getVersion()
getVersion
in interface DocumentModelBridge
public void setVersion(String version)
public org.suigeneris.jrcs.rcs.Version getRCSVersion()
public void setRCSVersion(org.suigeneris.jrcs.rcs.Version version)
public XWikiDocument getOriginalDocument()
getOriginalDocument
in interface DocumentModelBridge
public void setOriginalDocument(XWikiDocument originalDocument)
originalDocument
- the original document representing this document instance before any change was made to
it, prior to the last time it was savedgetOriginalDocument()
public DocumentReference getParentReference()
@Deprecated public String getParent()
getParentReference()
insteadgetParentReference()
@Deprecated public XWikiDocument getParentDoc()
getParentReference()
insteadpublic void setParentReference(EntityReference parentReference)
@Deprecated public void setParent(String parent)
setParentReference(EntityReference)
insteadparent
- the reference of the parent relative to the documentpublic String getContent()
getContent
in interface DocumentModelBridge
public void setContent(String content)
public void setContent(org.xwiki.rendering.block.XDOM content) throws XWikiException
XWikiException
public String getRenderedContent(org.xwiki.rendering.syntax.Syntax targetSyntax, XWikiContext context) throws XWikiException
XWikiException
public String getRenderedContent(boolean transformationContextIsolated, XWikiContext context) throws XWikiException
XWikiException
public String displayDocument(XWikiContext context) throws XWikiException
context
- the XWiki Context objectXWikiException
- in case of error during the rendering.public String displayDocument(boolean restricted, XWikiContext context) throws XWikiException
context
- the XWiki Context objectrestricted
- see DocumentDisplayerParameters.isTransformationContextRestricted()
.XWikiException
- in case of error during the rendering.public String displayDocument(org.xwiki.rendering.syntax.Syntax targetSyntax, XWikiContext context) throws XWikiException
targetSyntax
- the syntax to use to render the documentcontext
- the XWiki Context objectXWikiException
- in case of error during the rendering.public String displayDocument(org.xwiki.rendering.syntax.Syntax targetSyntax, boolean restricted, XWikiContext context) throws XWikiException
targetSyntax
- the syntax to use to render the documentcontext
- the XWiki Context objectrestricted
- see DocumentDisplayerParameters.isTransformationContextRestricted()
.XWikiException
- in case of error during the rendering.public String getRenderedContent(org.xwiki.rendering.syntax.Syntax targetSyntax, boolean transformationContextIsolated, XWikiContext context) throws XWikiException
getTranslatedDocument(XWikiContext)
).targetSyntax
- the syntax to use to render the documenttransformationContextIsolated
- see DocumentDisplayerParameters.isTransformationContextIsolated()
context
- the XWiki Context objectXWikiException
- in case of error during the rendering.public String getRenderedContent(XWikiContext context) throws XWikiException
XWikiException
public String getRenderedContent(String text, String syntaxId, XWikiContext context)
text
- the text to rendersyntaxId
- the id of the Syntax used by the passed text (e.g. xwiki/2.1
)context
- the XWiki Context objectpublic String getRenderedContent(String text, String syntaxId, boolean restrictedTransformationContext, XWikiContext context)
text
- the text to rendersyntaxId
- the id of the Syntax used by the passed text (e.g. xwiki/2.1
)restrictedTransformationContext
- see DocumentDisplayerParameters.isTransformationContextRestricted()
.context
- the XWiki Context objectpublic String getRenderedContent(String text, String syntaxId, boolean restrictedTransformationContext, XWikiDocument sDocument, XWikiContext context)
text
- the text to rendersyntaxId
- the id of the Syntax used by the passed text (e.g. xwiki/2.1
)restrictedTransformationContext
- see DocumentDisplayerParameters.isTransformationContextRestricted()
.sDocument
- the XWikiDocument
to use as secure document, if null keep the current onecontext
- the XWiki Context objectpublic String getRenderedContent(String text, String sourceSyntaxId, String targetSyntaxId, XWikiContext context)
text
- the text to rendersourceSyntaxId
- the id of the Syntax used by the passed text (e.g. xwiki/2.1
)targetSyntaxId
- the id of the syntax in which to render the document contentcontext
- the XWiki contextpublic String getRenderedContent(String text, String sourceSyntaxId, String targetSyntaxId, boolean restrictedTransformationContext, XWikiContext context)
text
- the text to rendersourceSyntaxId
- the id of the Syntax used by the passed text (e.g. xwiki/2.1
)targetSyntaxId
- the id of the syntax in which to render the document contentrestrictedTransformationContext
- see DocumentDisplayerParameters.isTransformationContextRestricted()
.context
- the XWiki contextpublic String getRenderedContent(String text, String sourceSyntaxId, String targetSyntaxId, boolean restrictedTransformationContext, XWikiDocument sDocument, XWikiContext context)
text
- the text to rendersourceSyntaxId
- the id of the Syntax used by the passed text (e.g. xwiki/2.1
)targetSyntaxId
- the id of the syntax in which to render the document contentrestrictedTransformationContext
- see DocumentDisplayerParameters.isTransformationContextRestricted()
.sDocument
- the XWikiDocument
to use as secure document, if null keep the current onecontext
- the XWiki contextpublic String getRenderedContent(String text, org.xwiki.rendering.syntax.Syntax sourceSyntaxId, XWikiDocument sDocument, boolean isolated, XWikiContext context)
text
- the text to rendersourceSyntaxId
- the id of the Syntax used by the passed text (e.g. xwiki/2.1
)sDocument
- the XWikiDocument
to use as secure document, if null keep the current oneisolated
- true of the content should be executed in this document's contextcontext
- the XWiki contextpublic String getRenderedContent(String text, org.xwiki.rendering.syntax.Syntax sourceSyntaxId, org.xwiki.rendering.syntax.Syntax targetSyntaxId, boolean restrictedTransformationContext, XWikiDocument sDocument, boolean isolated, XWikiContext context)
text
- the text to rendersourceSyntaxId
- the id of the Syntax used by the passed text (e.g. xwiki/2.1
)targetSyntaxId
- the id of the syntax in which to render the document contentrestrictedTransformationContext
- see DocumentDisplayerParameters.isTransformationContextRestricted()
.sDocument
- the XWikiDocument
to use as secure document, if null keep the current oneisolated
- true of the content should be executed in this document's contextcontext
- the XWiki contextpublic String getEscapedContent(XWikiContext context) throws XWikiException
XWikiException
@Deprecated public String getName()
getDocumentReference()
instead@Deprecated public void setName(String name)
setDocumentReference(DocumentReference)
insteadpublic DocumentReference getDocumentReference()
getDocumentReference
in interface DocumentModelBridge
public PageReference getPageReference()
PageReference
public PageReference getPageReferenceWithLocale()
PageReference
including the Locale
public DocumentReference getDocumentReferenceWithLocale()
DocumentReference
of the document also containing the document Locale
@Deprecated public String getFullName()
getDocumentReference()
insteadgetFullName
in interface DocumentModelBridge
@Deprecated public String getPrefixedFullName()
getDocumentReference()
instead@Deprecated public void setDocumentReference(DocumentReference reference)
@Deprecated public void setFullName(String name)
setDocumentReference(org.xwiki.model.reference.DocumentReference)
instead@Deprecated public void setFullName(String fullName, XWikiContext context)
setDocumentReference(org.xwiki.model.reference.DocumentReference)
instead@Deprecated public String getWikiName()
getDocumentReference()
insteadgetWikiName
in interface DocumentModelBridge
DocumentModelBridge.getWikiName()
@Deprecated public String getSpaceName()
getDocumentReference()
insteadgetSpaceName
in interface DocumentModelBridge
DocumentModelBridge.getSpaceName()
@Deprecated public String getPageName()
getDocumentReference()
insteadgetPageName
in interface DocumentModelBridge
DocumentModelBridge.getSpaceName()
public String getTitle()
getTitle
in interface DocumentModelBridge
public String getRenderedTitle(org.xwiki.rendering.syntax.Syntax outputSyntax, XWikiContext context)
xwiki.title.compatibility=1
in
xwiki.cfg
) then an attempt is made to extract the title from the first heading found in the document's
contentoutputSyntax
- the syntax to render to; this is not taken into account for XWiki 1.0 syntaxcontext
- the XWiki contextpublic String getRenderedTitle(XWikiContext context)
getRenderedTitle(Syntax, XWikiContext)
but the output Syntax used is XHTML 1.0 unless the
current skin defines another output Syntax in which case it's the one used.context
- the XWiki contextpublic void setTitle(String title)
public String getFormat()
public void setFormat(String format)
public DocumentReference getAuthorReference()
public void setAuthorReference(DocumentReference authorReference)
@Deprecated public String getAuthor()
getAuthorReference()
instead@Deprecated public void setAuthor(String author)
setAuthorReference(org.xwiki.model.reference.DocumentReference)
insteadpublic DocumentReference getContentAuthorReference()
getContentAuthorReference
in interface DocumentModelBridge
public void setContentAuthorReference(DocumentReference contentAuthorReference)
@Deprecated public String getContentAuthor()
getContentAuthorReference()
instead@Deprecated public void setContentAuthor(String contentAuthor)
setContentAuthorReference(org.xwiki.model.reference.DocumentReference)
insteadpublic DocumentReference getCreatorReference()
public void setCreatorReference(DocumentReference creatorReference)
@Deprecated public String getCreator()
getCreatorReference()
instead@Deprecated public void setCreator(String creator)
setCreatorReference(org.xwiki.model.reference.DocumentReference)
insteadpublic Date getDate()
public void setDate(Date date)
public Date getCreationDate()
getCreationDate
in interface DocumentModelBridge
public void setCreationDate(Date date)
public Date getContentUpdateDate()
public void setContentUpdateDate(Date date)
public String getMeta()
public void setMeta(String meta)
public void appendMeta(String meta)
public boolean isContentDirty()
public void incrementVersion()
getNextVersion(Version, boolean)
to compute the new version.public static org.suigeneris.jrcs.rcs.Version getNextVersion(org.suigeneris.jrcs.rcs.Version version, boolean minorEdit)
incrementVersion()
.version
- the based version from which to compute the next one.minorEdit
- true means it's a minor edition.public void setContentDirty(boolean contentDirty)
public boolean isMetaDataDirty()
public void setMetaDataDirty(boolean metaDataDirty)
public String getAttachmentURL(String filename, XWikiContext context)
public String getAttachmentURL(String filename, String action, XWikiContext context)
public String getExternalAttachmentURL(String filename, String action, XWikiContext context)
public String getAttachmentURL(String filename, String action, String querystring, XWikiContext context)
public String getAttachmentRevisionURL(String filename, String revision, XWikiContext context)
public String getAttachmentRevisionURL(String filename, String revision, String querystring, XWikiContext context)
public String getURL(String action, String params, boolean redirect, XWikiContext context)
action
- the action, see the struts-config.xml
file for a list of all existing action namesparams
- the URL query stringredirect
- true if the URL is going to be used in HttpServletResponse.sendRedirect(String)
context
- the XWiki contextpublic String getURL(String action, boolean redirect, XWikiContext context)
public String getURL(String action, XWikiContext context)
public String getURL(String action, String querystring, XWikiContext context)
public String getURL(String action, String querystring, String anchor, XWikiContext context)
public String getExternalURL(String action, XWikiContext context)
public String getExternalURL(String action, String querystring, XWikiContext context)
public String getParentURL(XWikiContext context) throws XWikiException
XWikiException
public XWikiDocumentArchive getDocumentArchive(XWikiContext context) throws XWikiException
XWikiException
public Document newDocument(String customClassName, XWikiContext context)
Document
public API to access page information and actions from
scripting.customClassName
- the name of the custom Document
class of the object to create.context
- the XWiki context.public Document newDocument(Class<?> customClass, XWikiContext context)
Document
public API to access page information and actions from
scripting.customClass
- the custom Document
class the object to create.context
- the XWiki context.public Document newDocument(XWikiContext context)
public void loadArchive(XWikiContext context) throws XWikiException
XWikiException
public XWikiDocumentArchive getDocumentArchive()
XWikiDocumentArchive
for this document. If it is not stored in the document, null is
returned.public XWikiDocumentArchive loadDocumentArchive()
XWikiDocumentArchive
for this document. If it is not stored in the document, we get it using
the current context. If there is an exception, null is returned.public void setDocumentArchive(XWikiDocumentArchive arch)
public void setDocumentArchive(String sarch) throws XWikiException
XWikiException
public org.suigeneris.jrcs.rcs.Version[] getRevisions(XWikiContext context) throws XWikiException
XWikiException
public String[] getRecentRevisions(int nb, XWikiContext context) throws XWikiException
XWikiException
public List<String> getRevisions(RevisionCriteria criteria, XWikiContext context) throws XWikiException
criteria
- criteria used to match versionsXWikiException
public XWikiRCSNodeInfo getRevisionInfo(String version, XWikiContext context) throws XWikiException
XWikiException
public boolean isMostRecent()
public void setMostRecent(boolean mostRecent)
mostRecent
- - mark document as most recent.public BaseClass getXClass()
public void setXClass(BaseClass xwikiClass)
public Map<DocumentReference,List<BaseObject>> getXObjects()
public void setXObjects(Map<DocumentReference,List<BaseObject>> objects)
public BaseObject getXObject()
@Deprecated public BaseObject getxWikiObject()
getXObject()
insteadpublic List<BaseClass> getXClasses(XWikiContext context)
public int createXObject(EntityReference classReference, XWikiContext context) throws XWikiException
Note that absolute reference are not supported for xclasses which mean that the wiki part (whatever the wiki is) of the reference will be systematically removed.
classReference
- the reference of the classcontext
- the XWiki contextXWikiException
- error when creating the new object@Deprecated public int createNewObject(String className, XWikiContext context) throws XWikiException
createXObject(EntityReference, XWikiContext)
insteadXWikiException
public int getXObjectSize(DocumentReference classReference)
public int getXObjectSize(EntityReference classReference)
@Deprecated public int getObjectNumbers(String className)
getXObjectSize(DocumentReference)
insteadpublic List<BaseObject> getXObjects(DocumentReference classReference)
public List<BaseObject> getXObjects(EntityReference reference)
@Deprecated public Vector<BaseObject> getObjects(String className)
getXObjects(DocumentReference)
insteadpublic void setXObjects(DocumentReference classReference, List<BaseObject> objects)
public BaseObject getXObject(EntityReference reference)
public BaseObject getXObject(DocumentReference classReference)
public BaseObject getXObject(ObjectReference objectReference)
objectReference
- the reference of the objectpublic BaseProperty<ObjectPropertyReference> getXObjectProperty(ObjectPropertyReference objectPropertyReference)
objectPropertyReference
- the reference of the object property@Deprecated public BaseObject getObject(String className)
getXObject(DocumentReference)
insteadpublic BaseObject getXObject(DocumentReference classReference, int nb)
public BaseObject getXObject(EntityReference classReference, int number, boolean create, XWikiContext xcontext) throws XWikiException
If create
is true and the is no xobject at the passed located, it's created.
classReference
- the xlcass of the object to retrievenumber
- the location of the xobjectcreate
- if true the xobject is created when it does not existxcontext
- the XWiki contextBaseObject
stored at passed locationXWikiException
- when failing to create new xobject instancepublic BaseObject getXObject(EntityReference classReference, int nb)
@Deprecated public BaseObject getObject(String className, int nb)
getXObject(DocumentReference, int)
insteadpublic BaseObject getXObject(DocumentReference classReference, String key, String value)
@Deprecated public BaseObject getObject(String className, String key, String value)
getXObject(DocumentReference, String, String)
insteadpublic BaseObject getXObject(EntityReference reference, String key, String value, boolean failover)
public BaseObject getXObject(DocumentReference classReference, String key, String value, boolean failover)
@Deprecated public BaseObject getObject(String className, String key, String value, boolean failover)
getXObject(DocumentReference, String, String, boolean)
instead@Deprecated public void addXObject(DocumentReference classReference, BaseObject object)
addXObject(BaseObject)
insteadpublic void addXObject(BaseObject object)
object
- the xobject to addNullPointerException
- if the specified object is null because we need the get the class reference from the
object@Deprecated public void addObject(String className, BaseObject object)
addXObject(BaseObject)
instead@Deprecated public void setXObject(DocumentReference classReference, int nb, BaseObject object)
setXObject(int, BaseObject)
insteadpublic void setXObject(int nb, BaseObject object)
nb
- index of the element to replaceobject
- the xobject to insertNullPointerException
- if the specified object is null because we need the get the class reference from the
object@Deprecated public void setObject(String className, int nb, BaseObject object)
setXObject(DocumentReference, int, BaseObject)
insteadpublic boolean isNew()
public void setNew(boolean aNew)
public void mergeXClass(XWikiDocument templatedoc)
@Deprecated public void mergexWikiClass(XWikiDocument templatedoc)
mergeXClass(XWikiDocument)
insteadpublic void mergeXObjects(XWikiDocument templateDoc)
@Deprecated public void mergexWikiObjects(XWikiDocument templatedoc)
mergeXObjects(XWikiDocument)
insteadpublic void cloneXObjects(XWikiDocument templatedoc)
public void duplicateXObjects(XWikiDocument templatedoc)
public DocumentReference getTemplateDocumentReference()
@Deprecated public String getTemplate()
getTemplateDocumentReference()
insteadpublic void setTemplateDocumentReference(DocumentReference templateDocumentReference)
@Deprecated public void setTemplate(String template)
setTemplateDocumentReference(DocumentReference)
insteadpublic String displayPrettyName(String fieldname, XWikiContext context)
public String displayPrettyName(String fieldname, boolean showMandatory, XWikiContext context)
public String displayPrettyName(String fieldname, boolean showMandatory, boolean before, XWikiContext context)
public String displayPrettyName(String fieldname, BaseObject obj, XWikiContext context)
public String displayPrettyName(String fieldname, boolean showMandatory, BaseObject obj, XWikiContext context)
public String displayPrettyName(String fieldname, boolean showMandatory, boolean before, BaseObject obj, XWikiContext context)
public String displayTooltip(String fieldname, XWikiContext context)
public String displayTooltip(String fieldname, BaseObject obj, XWikiContext context)
public String display(String fieldname, XWikiContext context)
fieldname
- the name of the field to displaycontext
- the XWiki contextpublic String display(String fieldname, BaseObject obj, XWikiContext context)
fieldname
- the name of the field to displayobj
- the object containing the field to displaycontext
- the XWiki contextpublic String display(String fieldname, String mode, XWikiContext context)
fieldname
- the name of the field to displaymode
- the mode to use ("view", "edit", ...)context
- the XWiki contextpublic String display(String fieldname, String type, BaseObject obj, XWikiContext context)
fieldname
- the name of the field to displaytype
- the type of the field to displayobj
- the object containing the field to displaycontext
- the XWiki contextpublic String display(String fieldname, String type, BaseObject obj, boolean isolated, XWikiContext context)
fieldname
- the name of the field to displaytype
- the type of the field to displayobj
- the object containing the field to displayisolated
- true if the property should be displayed in it's own document contextcontext
- the XWiki contextpublic String display(String fieldname, String mode, String prefix, XWikiContext context)
fieldname
- the name of the field to displaymode
- the mode to use ("view", "edit", ...)prefix
- the prefix to add in the field identifier in edit display for examplecontext
- the XWiki contextpublic String display(String fieldname, String type, BaseObject obj, String wrappingSyntaxId, XWikiContext context)
fieldname
- the name of the field to displaytype
- the type of the field to displayobj
- the object containing the field to displaywrappingSyntaxId
- the syntax of the content in which the result will be included. This to take care of some
escaping depending of the syntax.context
- the XWiki contextpublic String display(String fieldname, String type, String pref, BaseObject obj, XWikiContext context)
fieldname
- the name of the field to displaytype
- the type of the field to displaypref
- the prefix to add in the field identifier in edit display for exampleobj
- the object containing the field to displaycontext
- the XWiki contextpublic String display(String fieldname, String type, String pref, BaseObject obj, boolean isolated, XWikiContext context)
fieldname
- the name of the field to displaytype
- the type of the field to displaypref
- the prefix to add in the field identifier in edit display for exampleobj
- the object containing the field to displayisolated
- true if the property should be displayed in it's own document contextcontext
- the XWiki contextpublic String display(String fieldname, String type, String pref, BaseObject obj, String wrappingSyntaxId, XWikiContext context)
fieldname
- the name of the field to displaytype
- the type of the field to displaypref
- the prefix to add in the field identifier in edit display for exampleobj
- the object containing the field to displaywrappingSyntaxId
- the syntax of the content in which the result will be included. This to take care of some
escaping depending of the syntax.context
- the XWiki contextpublic String display(String fieldname, String type, String pref, BaseObject obj, String wrappingSyntaxId, boolean isolated, XWikiContext context)
fieldname
- the name of the field to displaytype
- the type of the field to displaypref
- the prefix to add in the field identifier in edit display for exampleobj
- the object containing the field to displaywrappingSyntaxId
- the syntax of the content in which the result will be included. This to take care of some
escaping depending of the syntax.isolated
- true if the property should be displayed in it's own document contextcontext
- the XWiki contextpublic String displayForm(DocumentReference classReference, String header, String format, XWikiContext context)
@Deprecated public String displayForm(String className, String header, String format, XWikiContext context)
displayForm(DocumentReference, String, String, XWikiContext)
insteadpublic String displayForm(DocumentReference classReference, String header, String format, boolean linebreak, XWikiContext context)
@Deprecated public String displayForm(String className, String header, String format, boolean linebreak, XWikiContext context)
displayForm(DocumentReference, String, String, boolean, XWikiContext)
insteadpublic String displayForm(DocumentReference classReference, XWikiContext context)
@Deprecated public String displayForm(String className, XWikiContext context)
displayForm(DocumentReference, XWikiContext)
insteadpublic boolean isFromCache()
public void setFromCache(boolean fromCache)
public void readDocMetaFromForm(EditForm eform, XWikiContext context) throws XWikiException
XWikiException
public void setTags(String tagsStr, XWikiContext context) throws XWikiException
XWikiException
public String getTags(XWikiContext context)
public List<String> getTagsList(XWikiContext context)
public List<String> getTagsPossibleValues(XWikiContext context)
public void readTranslationMetaFromForm(EditForm eform, XWikiContext context) throws XWikiException
XWikiException
public void readObjectsFromForm(EditForm eform, XWikiContext context) throws XWikiException
XWikiException
public void readObjectsFromFormUpdateOrCreate(EditForm eform, XWikiContext context) throws XWikiException
<spacename>.<classname>_<number>_<propertyname>
. If the object already exists, the field is replace by the given
value. If the object doesn't exist in the document, it is created then the property <propertyname>
is
initialized with the given value. An object is only created if the given <number>
is 'one-more' than the
existing number of objects. For example, if the document already has 2 objects of type Space.Class
, then
it will create a new object only with Space.Class_2_prop=something
. Every other parameter like Space.Class_42_prop=foobar
for example, will be ignore.eform
- is form information that contains all the query parameterscontext
- XWikiException
public void readFromForm(EditForm eform, XWikiContext context) throws XWikiException
XWikiException
public void readFromTemplate(EditForm eform, XWikiContext context) throws XWikiException
XWikiException
public void readFromTemplate(DocumentReference templateDocumentReference, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public void readFromTemplate(String template, XWikiContext context) throws XWikiException
readFromTemplate(DocumentReference, XWikiContext)
insteadXWikiException
public void clone(XWikiDocument document)
document
- the document containing the new identitypublic XWikiDocument clone()
public XWikiDocument duplicate(DocumentReference newDocumentReference)
public void copyAttachments(XWikiDocument sourceDocument)
sourceDocument
- an XWikiDocument to copy attachments frompublic void loadAttachmentsContent(XWikiContext context) throws XWikiException
context
- the XWiki contextXWikiException
- when failing to load attachmentspublic void loadAttachmentsContentSafe(XWikiContext context)
loadAttachmentContent(XWikiAttachment, XWikiContext)
but in some context we don't really care if
an attachment content could not be loaded (we are going to overwrite or ignore it).context
- the XWiki contextpublic void loadAttachments(XWikiContext context) throws XWikiException
XWikiException
public boolean equalsData(XWikiDocument otherDocument)
equals(Object)
but only for actual datas of the document.
The goal being to compare two versions of the same document this method skip every version/reference/author related information. For example it allows to compare a document comming from a another wiki and easily check if thoses actually are the same thing whatever the plumbing differences.
otherDocument
- the document to comparepublic String getXMLContent(XWikiContext context) throws XWikiException
context
- current XWikiContextXWikiException
- when an error occurs during wiki operationpublic String toXML(XWikiContext context) throws XWikiException
context
- current XWikiContextXWikiException
- when an error occurs during wiki operationpublic String toFullXML(XWikiContext context) throws XWikiException
context
- current XWikiContextXWikiException
- when an error occurs during wiki operation@Deprecated public void addToZip(ZipOutputStream zos, String zipname, boolean withVersions, XWikiContext context) throws XWikiException, IOException
zos
- the ZipOutputStream to write tozipname
- the name of the new entry to createwithVersions
- if true, also include archived version of the documentcontext
- current XWikiContextXWikiException
- when an error occurs during xwiki operationsIOException
- when an error occurs during streaming operations@Deprecated public void addToZip(ZipOutputStream zos, boolean withVersions, XWikiContext context) throws XWikiException, IOException
zos
- the ZipOutputStream to write towithVersions
- if true, also include archived version of the documentcontext
- current XWikiContextXWikiException
- when an error occurs during xwiki operationsIOException
- when an error occurs during streaming operations@Deprecated public void addToZip(ZipOutputStream zos, XWikiContext context) throws XWikiException, IOException
zos
- the ZipOutputStream to write tocontext
- current XWikiContextXWikiException
- when an error occurs during xwiki operationsIOException
- when an error occurs during streaming operationspublic String toXML(boolean bWithObjects, boolean bWithRendering, boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context) throws XWikiException
toXML(OutputStream, boolean, boolean, boolean, boolean, XWikiContext)
or
toXML(com.xpn.xwiki.internal.xml.XMLWriter, boolean, boolean, boolean, boolean, XWikiContext)
when
possible to reduce memory load.bWithObjects
- include XObjectsbWithRendering
- include the rendered contentbWithAttachmentContent
- include attachments contentbWithVersions
- include archived versionscontext
- current XWikiContextXWikiException
- when an errors occurs during wiki operations@Deprecated public org.dom4j.Document toXMLDocument(XWikiContext context) throws XWikiException
toXML(OutputTarget, boolean, boolean, boolean, boolean, boolean, String)
insteadDOMDocument
. All XObject are included. Rendered content, attachments and
archived version are excluded. You should prefer toXML(OutputStream, true, false, false, false, XWikiContext)} or
toXML(com.xpn.xwiki.util.XMLWriter, true, false, false, false, XWikiContext) when possible to reduce memory load.context
- current XWikiContextDOMDocument
containing the serialized document.XWikiException
- when an errors occurs during wiki operations@Deprecated public org.dom4j.Document toXMLDocument(boolean bWithObjects, boolean bWithRendering, boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context) throws XWikiException
toXML(OutputTarget, boolean, boolean, boolean, boolean, boolean, String)
insteadDOMDocument
. You should prefer
toXML(OutputStream, boolean, boolean, boolean, boolean, XWikiContext)
or
toXML(com.xpn.xwiki.internal.xml.XMLWriter, boolean, boolean, boolean, boolean, XWikiContext)
when
possible to reduce memory load.bWithObjects
- include XObjectsbWithRendering
- include the rendered contentbWithAttachmentContent
- include attachments contentbWithVersions
- include archived versionscontext
- current XWikiContextDOMDocument
containing the serialized document.XWikiException
- when an errors occurs during wiki operations@Deprecated public void toXML(com.xpn.xwiki.internal.xml.XMLWriter wr, boolean bWithObjects, boolean bWithRendering, boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context) throws XWikiException, IOException
toXML(OutputTarget, boolean, boolean, boolean, boolean, boolean, String)
insteadXMLWriter
.bWithObjects
- include XObjectsbWithRendering
- include the rendered contentbWithAttachmentContent
- include attachments contentbWithVersions
- include archived versionscontext
- current XWikiContextXWikiException
- when an errors occurs during wiki operationsIOException
- when an errors occurs during streaming operationspublic void toXML(OutputStream out, boolean bWithObjects, boolean bWithRendering, boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context) throws XWikiException, IOException
bWithObjects
- include XObjectsbWithRendering
- include the rendered contentbWithAttachmentContent
- include attachments contentbWithVersions
- include archived versionscontext
- current XWikiContextXWikiException
- when an errors occurs during wiki operationsIOException
- when an errors occurs during streaming operationspublic void toXML(org.xwiki.filter.output.OutputTarget out, boolean bWithObjects, boolean bWithRendering, boolean bWithAttachmentContent, boolean bWithVersions, boolean format, String encoding) throws XWikiException
out
- the output where to write the XMLbWithObjects
- include XObjectsbWithRendering
- include the rendered contentbWithAttachmentContent
- include attachments contentbWithVersions
- include archived versionsformat
- true if the XML should be formatedencoding
- the encoding to use to write the XMLXWikiException
- when an errors occurs during wiki operationspublic void toXML(DocumentInstanceInputProperties documentProperties, XAROutputProperties xarProperties) throws XWikiException
xarProperties
- the configuration of the output filterdocumentProperties
- the configuration of the input filterXWikiException
- when an errors occurs during wiki operationspublic void fromXML(String xml) throws XWikiException
XWikiException
public void fromXML(InputStream is) throws XWikiException
XWikiException
public void fromXML(org.xwiki.filter.input.InputSource source, boolean withArchive) throws XWikiException
XWikiException
public void fromXML(String source, boolean withArchive) throws XWikiException
XWikiException
public void fromXML(InputStream source, boolean withArchive) throws XWikiException
XWikiException
@Deprecated public void fromXML(org.dom4j.Document domdoc, boolean withArchive) throws XWikiException
fromXML(InputStream)
insteadXWikiException
public static boolean containsXMLWikiDocument(org.dom4j.Document domdoc)
domdoc
- the xml document.public void setAttachmentList(List<XWikiAttachment> list)
public List<XWikiAttachment> getAttachmentList()
@Deprecated public void saveAllAttachments(XWikiContext context) throws XWikiException
XWikiException
@Deprecated public void saveAllAttachments(boolean updateParent, boolean transaction, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public void saveAttachmentsContent(List<XWikiAttachment> attachments, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public void saveAttachmentContent(XWikiAttachment attachment, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public void saveAttachmentContent(XWikiAttachment attachment, boolean updateParent, boolean transaction, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public void loadAttachmentContent(XWikiAttachment attachment, XWikiContext context) throws XWikiException
XWikiAttachment.loadContent(XWikiContext)
XWikiException
public XWikiAttachment removeAttachment(XWikiAttachment attachment)
The attachment will be move to recycle bin.
attachment
- the attachment to removepublic XWikiAttachment removeAttachment(XWikiAttachment attachmentToRemove, boolean toRecycleBin)
attachmentToRemove
- the attachment to removetoRecycleBin
- indicate if the attachment should be moved to recycle binpublic List<XWikiDocument.XWikiAttachmentToRemove> getAttachmentsToRemove()
public void clearAttachmentsToRemove()
public List<DocumentReference> getBackLinkedReferences(XWikiContext context) throws XWikiException
Theses links are stored to the database when documents are saved. You can use "backlinks" in XWikiPreferences or "xwiki.backlinks" in xwiki.cfg file to enable links storage in the database.
context
- the XWiki context.XWikiException
- error when getting pages names from database.@Deprecated public List<String> getBackLinkedPages(XWikiContext context) throws XWikiException
getBackLinkedReferences(XWikiContext)
XWikiException
public Set<XWikiLink> getUniqueWikiLinkedPages(XWikiContext context) throws XWikiException
getUniqueLinkedPages(XWikiContext)
and generate the List.context
- the XWiki contextXWikiException
- error when getting links from database when xwiki/1.0 content.public Set<String> getUniqueLinkedPages(XWikiContext context)
context
- the XWiki context.public List<DocumentReference> getChildrenReferences(XWikiContext context) throws XWikiException
getChildren(int, int, com.xpn.xwiki.XWikiContext)
XWikiException
@Deprecated public List<String> getChildren(XWikiContext context) throws XWikiException
getChildrenReferences(XWikiContext)
XWikiException
public List<DocumentReference> getChildrenReferences(int nb, int start, XWikiContext context) throws XWikiException
nb
- The number of results to return.start
- The number of results to skip before we begin returning results.context
- The context
.XWikiException
- If there's an error querying the database.@Deprecated public List<String> getChildren(int nb, int start, XWikiContext context) throws XWikiException
getChildrenReferences(XWikiContext)
XWikiException
public void renameProperties(DocumentReference classReference, Map<String,String> fieldsToRename)
@Deprecated public void renameProperties(String className, Map<String,String> fieldsToRename)
renameProperties(DocumentReference, Map)
insteadpublic void addXObjectToRemove(BaseObject object)
public void addXObjectsToRemoveFromVersion(XWikiDocument previousVersion)
previousVersion
- the version of the document present in the database@Deprecated public void addObjectsToRemove(BaseObject object)
addXObjectToRemove(BaseObject)
)} insteadpublic List<BaseObject> getXObjectsToRemove()
@Deprecated public ArrayList<BaseObject> getObjectsToRemove()
getObjectsToRemove()
insteadpublic void setXObjectsToRemove(List<BaseObject> objectsToRemove)
public List<String> getIncludedPages(XWikiContext context)
public List<String> getIncludedMacros(XWikiContext context)
public String displayRendered(PropertyClass pclass, String prefix, BaseCollection object, XWikiContext context) throws XWikiException
XWikiException
public String displayView(PropertyClass pclass, String prefix, BaseCollection object, XWikiContext context)
public String displayEdit(PropertyClass pclass, String prefix, BaseCollection object, XWikiContext context)
public String displayHidden(PropertyClass pclass, String prefix, BaseCollection object, XWikiContext context)
public XWikiAttachment getAttachment(String filename)
filename
- the file name of the attachment with or without the extensionXWikiAttachment
corresponding to the file name, null if none can be found@Deprecated public void addAttachment(XWikiAttachment attachment)
setAttachment(XWikiAttachment)
insteadattachment
- the attachment to addpublic XWikiAttachment setAttachment(XWikiAttachment attachment)
attachment
- the attachment to insert in the document@Deprecated public XWikiAttachment addAttachment(String fileName, byte[] content, XWikiContext context) throws XWikiException
setAttachment(String, InputStream, XWikiContext)
insteadXWikiException
@Deprecated public XWikiAttachment addAttachment(String fileName, InputStream content, XWikiContext context) throws XWikiException, IOException
setAttachment(String, InputStream, XWikiContext)
insteadfileName
- the name of the attachmentcontent
- the content of the attachmentcontext
- the XWiki contextXWikiException
- never sentIOException
- when failing to read the passed contentpublic XWikiAttachment setAttachment(String fileName, InputStream content, XWikiContext context) throws IOException
fileName
- the name of the attachmentcontent
- the content of the attachmentcontext
- the XWiki contextIOException
- when failing to read the passed contentpublic BaseObject getFirstObject(String fieldname)
public BaseObject getFirstObject(String fieldname, XWikiContext context)
public void setProperty(EntityReference classReference, String fieldName, BaseProperty value)
@Deprecated public void setProperty(String className, String fieldName, BaseProperty value)
setProperty(EntityReference, String, BaseProperty)
insteadpublic int getIntValue(DocumentReference classReference, String fieldName)
public int getIntValue(DocumentReference classReference, String fieldName, int defaultValue)
classReference
- the reference of the object to findfieldName
- the property to get the value fromdefaultValue
- the default value to return if the object doesn't exist, or if the property is not set@Deprecated public int getIntValue(String className, String fieldName)
getIntValue(DocumentReference, String)
insteadpublic long getLongValue(DocumentReference classReference, String fieldName)
@Deprecated public long getLongValue(String className, String fieldName)
getLongValue(DocumentReference, String)
insteadpublic String getStringValue(EntityReference classReference, String fieldName)
public String getStringValue(DocumentReference classReference, String fieldName)
@Deprecated public String getStringValue(String className, String fieldName)
getStringValue(DocumentReference, String)
insteadpublic int getIntValue(String fieldName)
public long getLongValue(String fieldName)
public void setStringValue(EntityReference classReference, String fieldName, String value)
@Deprecated public void setStringValue(String className, String fieldName, String value)
setStringValue(EntityReference, String, String)
insteadpublic List getListValue(DocumentReference classReference, String fieldName)
@Deprecated public List getListValue(String className, String fieldName)
getListValue(DocumentReference, String)
insteadpublic void setStringListValue(EntityReference classReference, String fieldName, List value)
@Deprecated public void setStringListValue(String className, String fieldName, List value)
setStringListValue(EntityReference, String, List)
insteadpublic void setDBStringListValue(EntityReference classReference, String fieldName, List value)
@Deprecated public void setDBStringListValue(String className, String fieldName, List value)
setDBStringListValue(EntityReference, String, List)
insteadpublic void setLargeStringValue(EntityReference classReference, String fieldName, String value)
@Deprecated public void setLargeStringValue(String className, String fieldName, String value)
setLargeStringValue(EntityReference, String, String)
insteadpublic void setIntValue(EntityReference classReference, String fieldName, int value)
@Deprecated public void setIntValue(String className, String fieldName, int value)
setIntValue(EntityReference, String, int)
instead@Deprecated public String getDatabase()
getDocumentReference()
instead@Deprecated public void setDatabase(String database)
setDocumentReference(DocumentReference)
instead@Deprecated public String getLanguage()
getLocale()
instead@Deprecated public void setLanguage(String language)
setLocale(Locale)
insteadpublic Locale getLocale()
public void setLocale(Locale locale)
locale
- the locale of the document@Deprecated public String getDefaultLanguage()
getDefaultLocale()
instead@Deprecated public void setDefaultLanguage(String defaultLanguage)
setDefaultLocale(Locale)
insteadpublic Locale getDefaultLocale()
public void setDefaultLocale(Locale defaultLocale)
public int getTranslation()
@Deprecated public void setTranslation(int translation)
XWikiDocument
it's calculated based on the document localepublic String getTranslatedContent(XWikiContext context) throws XWikiException
XWikiException
public String getTranslatedContent(String locale, XWikiContext context) throws XWikiException
XWikiException
public XWikiDocument getTranslatedDocument(XWikiContext context) throws XWikiException
XWikiException
@Deprecated public XWikiDocument getTranslatedDocument(String language, XWikiContext context) throws XWikiException
getTranslatedDocument(Locale, XWikiContext)
inseadThis method return this if the provided language does not exists. See
language
- the language of the document to returncontext
- the XWiki ContextXWikiException
- error when loading the documentpublic XWikiDocument getTranslatedDocument(Locale locale, XWikiContext context) throws XWikiException
This method return this if the provided language does not exists. See
locale
- the locale of the document to returncontext
- the XWiki ContextXWikiException
- error when loading the document@Deprecated public String getRealLanguage(XWikiContext context) throws XWikiException
getRealLocale()
insteadXWikiException
@Deprecated public String getRealLanguage()
getRealLocale()
insteadgetRealLanguage
in interface DocumentModelBridge
DocumentModelBridge.getRealLanguage()
public Locale getRealLocale()
@Deprecated public List<String> getTranslationList(XWikiContext context) throws XWikiException
getTranslationLocales(XWikiContext)
insteadXWikiException
public List<Locale> getTranslationLocales(XWikiContext context) throws XWikiException
context
- the XWiki contextXWikiException
- if retriving the translations from the database failedpublic List<org.suigeneris.jrcs.diff.delta.Delta> getXMLDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context) throws XWikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException
public List<org.suigeneris.jrcs.diff.delta.Delta> getContentDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context) throws XWikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException
public List<org.suigeneris.jrcs.diff.delta.Delta> getContentDiff(String fromRev, String toRev, XWikiContext context) throws XWikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException
public List<org.suigeneris.jrcs.diff.delta.Delta> getContentDiff(String fromRev, XWikiContext context) throws XWikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException
public List<org.suigeneris.jrcs.diff.delta.Delta> getLastChanges(XWikiContext context) throws XWikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException
public List<org.suigeneris.jrcs.diff.delta.Delta> getRenderedContentDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context) throws XWikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException
public List<org.suigeneris.jrcs.diff.delta.Delta> getRenderedContentDiff(String fromRev, String toRev, XWikiContext context) throws XWikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException
public List<org.suigeneris.jrcs.diff.delta.Delta> getRenderedContentDiff(String fromRev, XWikiContext context) throws XWikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException
protected List<org.suigeneris.jrcs.diff.delta.Delta> getDeltas(org.suigeneris.jrcs.diff.Revision rev)
public List<MetaDataDiff> getMetaDataDiff(String fromRev, String toRev, XWikiContext context) throws XWikiException
XWikiException
public List<MetaDataDiff> getMetaDataDiff(String fromRev, XWikiContext context) throws XWikiException
XWikiException
public List<MetaDataDiff> getMetaDataDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context) throws XWikiException
XWikiException
public List<List<ObjectDiff>> getObjectDiff(String fromRev, String toRev, XWikiContext context) throws XWikiException
XWikiException
public List<List<ObjectDiff>> getObjectDiff(String fromRev, XWikiContext context) throws XWikiException
XWikiException
public List<List<ObjectDiff>> getObjectDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context)
fromDoc
- The old ('before') version of the document.toDoc
- The new ('after') version of the document.context
- The context
.ObjectDiff
elements, one object for each changed property of the object.
Additionally, if the object was added or removed, then the first entry in the list will be an
"object-added" or "object-removed" marker.public List<List<ObjectDiff>> getClassDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context)
public List<AttachmentDiff> getAttachmentDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context)
fromDoc
- toDoc
- context
- @Deprecated public void rename(DocumentReference newDocumentReference, XWikiContext context) throws XWikiException
XWiki.renameDocument(DocumentReference, DocumentReference, boolean, List, List, XWikiContext)
.
See rename(DocumentReference, List, List, XWikiContext)
for more details.
newDocumentReference
- the new document referencecontext
- the ubiquitous XWiki ContextXWikiException
- in case of an error@Deprecated public void rename(DocumentReference newDocumentReference, List<DocumentReference> backlinkDocumentReferences, XWikiContext context) throws XWikiException
XWiki.renameDocument(DocumentReference, DocumentReference, boolean, List, List, XWikiContext)
.Note: links without a space are renamed with the space added and all documents which have the document being renamed as parent have their parent field set to "currentwiki:CurrentSpace.Page".
newDocumentReference
- the new document referencebacklinkDocumentReferences
- the list of references of documents to parse and for which links will be
modified to point to the new document referencecontext
- the ubiquitous XWiki ContextXWikiException
- in case of an error@Deprecated public void rename(DocumentReference newDocumentReference, List<DocumentReference> backlinkDocumentReferences, List<DocumentReference> childDocumentReferences, XWikiContext context) throws XWikiException
XWiki.renameDocument(DocumentReference, DocumentReference, boolean, List, List, XWikiContext)
.rename(DocumentReference, List, XWikiContext)
but the list of documents having the current
document as their parent is passed in parameter.newDocumentReference
- the new document referencebacklinkDocumentReferences
- the list of references of documents to parse and for which links will be
modified to point to the new document referencechildDocumentReferences
- the list of references of document whose parent field will be set to the new
document referencecontext
- the ubiquitous XWiki ContextXWikiException
- in case of an error@Unstable public XWikiDocument cloneRename(DocumentReference newDocumentReference, XWikiContext context) throws XWikiException
newDocumentReference
- the new reference of the cloned document.context
- the current context.XWikiException
- in case of problem during the clone operation.public XWikiDocument copyDocument(DocumentReference newDocumentReference, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public XWikiDocument copyDocument(String newDocumentName, XWikiContext context) throws XWikiException
copyDocument(DocumentReference, XWikiContext)
insteadXWikiException
public XWikiLock getLock(XWikiContext context) throws XWikiException
XWikiException
public void setLock(String userName, XWikiContext context) throws XWikiException
XWikiException
public void removeLock(XWikiContext context) throws XWikiException
XWikiException
public void insertText(String text, String marker, XWikiContext context) throws XWikiException
XWikiException
public Object getWikiNode()
public void setWikiNode(Object wikiNode)
public String getXClassXML()
@Deprecated public String getxWikiClassXML()
getXClassXML()
instead Hibernate uses this through reflection. It cannot be
removed without altering hibernate.cfg.xmlpublic void setXClassXML(String xClassXML)
@Deprecated public void setxWikiClassXML(String xClassXML)
setXClassXML(String)
()} instead Hibernate uses this through reflection. It
cannot be removed without altering hibernate.cfg.xmlpublic int getElements()
public void setElements(int elements)
public void setElement(int element, boolean toggle)
public boolean hasElement(int element)
public String getDefaultEditMode(XWikiContext context) throws XWikiException
XWiki.EditModeClass
object in the current document, with the appropriate value for the
defaultEditMode property, or by adding this object in a sheet included by the document. This function also falls
back on the old SheetClass
, deprecated since 3.1M2, which can be attached to included documents to
specify that the current document should be edited inline.context
- the context of the request for this documentXWikiException
- since XWiki 6.3M1 it's not used anymore and "edit" is returned in case of error, with an
error logpublic String getDefaultEditURL(XWikiContext context) throws XWikiException
XWikiException
public String getEditURL(String action, String mode, XWikiContext context) throws XWikiException
XWikiException
public String getEditURL(String action, String mode, String language, XWikiContext context)
public String getDefaultTemplate()
public void setDefaultTemplate(String defaultTemplate)
public Vector<BaseObject> getComments()
public org.xwiki.rendering.syntax.Syntax getSyntax()
getSyntax
in interface DocumentModelBridge
@Deprecated public String getSyntaxId()
Note that this method cannot be removed for now since it's used by Hibernate for saving a XWikiDocument.
getSyntaxId
in interface DocumentModelBridge
DocumentModelBridge.getSyntaxId()
public void setSyntax(org.xwiki.rendering.syntax.Syntax syntax)
syntax
- the new syntax to set for this documentgetSyntax()
@Deprecated public void setSyntaxId(String syntaxId)
syntaxId
- the new syntax id to set (e.g. xwiki/2.0
, xwiki/2.1
, etc)getSyntaxId()
public Vector<BaseObject> getComments(boolean asc)
public boolean isCurrentUserCreator(XWikiContext context)
@Deprecated public boolean isCreator(String username)
isCreator(DocumentReference)
insteadpublic boolean isCreator(DocumentReference username)
public boolean isCurrentUserPage(XWikiContext context)
public boolean isCurrentLocalUserPage(XWikiContext context)
public void resetArchive(XWikiContext context) throws XWikiException
XWikiException
public BaseObject addXObjectFromRequest(XWikiContext context) throws XWikiException
XWikiException
public BaseObject addXObjectFromRequest(EntityReference classReference, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public BaseObject addObjectFromRequest(String className, XWikiContext context) throws XWikiException
addXObjectFromRequest(EntityReference, XWikiContext)
XWikiException
public BaseObject addXObjectFromRequest(DocumentReference classReference, String prefix, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public BaseObject addObjectFromRequest(String className, String prefix, XWikiContext context) throws XWikiException
addXObjectFromRequest(DocumentReference, String, XWikiContext)
XWikiException
public List<BaseObject> addXObjectsFromRequest(DocumentReference classReference, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public List<BaseObject> addObjectsFromRequest(String className, XWikiContext context) throws XWikiException
addXObjectsFromRequest(DocumentReference, XWikiContext)
XWikiException
public List<BaseObject> addXObjectsFromRequest(DocumentReference classReference, String pref, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public List<BaseObject> addObjectsFromRequest(String className, String pref, XWikiContext context) throws XWikiException
addXObjectsFromRequest(DocumentReference, String, XWikiContext)
XWikiException
public BaseObject addXObjectFromRequest(DocumentReference classReference, int num, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public BaseObject addObjectFromRequest(String className, int num, XWikiContext context) throws XWikiException
addXObjectFromRequest(DocumentReference, int, XWikiContext)
XWikiException
public BaseObject addXObjectFromRequest(EntityReference classReference, String prefix, int num, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public BaseObject addObjectFromRequest(String className, String prefix, int num, XWikiContext context) throws XWikiException
addXObjectFromRequest(EntityReference, String, int, XWikiContext)
XWikiException
public BaseObject updateXObjectFromRequest(EntityReference classReference, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public BaseObject updateObjectFromRequest(String className, XWikiContext context) throws XWikiException
updateXObjectFromRequest(EntityReference, XWikiContext)
XWikiException
public BaseObject updateXObjectFromRequest(EntityReference classReference, String prefix, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public BaseObject updateObjectFromRequest(String className, String prefix, XWikiContext context) throws XWikiException
updateXObjectFromRequest(EntityReference, String, XWikiContext)
XWikiException
public BaseObject updateXObjectFromRequest(EntityReference classReference, String prefix, int num, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public BaseObject updateObjectFromRequest(String className, String prefix, int num, XWikiContext context) throws XWikiException
updateXObjectFromRequest(EntityReference, String, int, XWikiContext)
XWikiException
public List<BaseObject> updateXObjectsFromRequest(EntityReference classReference, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public List<BaseObject> updateObjectsFromRequest(String className, XWikiContext context) throws XWikiException
updateXObjectsFromRequest(EntityReference, XWikiContext)
XWikiException
public List<BaseObject> updateXObjectsFromRequest(EntityReference classReference, String pref, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public List<BaseObject> updateObjectsFromRequest(String className, String pref, XWikiContext context) throws XWikiException
updateXObjectsFromRequest(EntityReference, String, XWikiContext)
XWikiException
public boolean isAdvancedContent()
public boolean isProgrammaticContent()
public boolean removeXObject(BaseObject object)
object
- the object to removetrue
if the object was successfully removed, false
if the object was not found in the
current document.@Deprecated public boolean removeObject(BaseObject object)
removeXObject(com.xpn.xwiki.objects.BaseObject)
insteadobject
- the object to removetrue
if the object was successfully removed, false
if the object was not found in the
current document.public boolean removeXObjects(DocumentReference classReference)
classReference
- The XClass reference of the XObjects to be removed.true
if the objects were successfully removed, false
if no object from the target class
was in the current document.public boolean removeXObjects(EntityReference reference)
reference
- The XClass reference of the XObjects to be removed.true
if the objects were successfully removed, false
if no object from the target class
was in the current document.@Deprecated public boolean removeObjects(String className)
removeXObjects(org.xwiki.model.reference.DocumentReference)
insteadclassName
- The class name of the objects to be removed.true
if the objects were successfully removed, false
if no object from the target class
was in the current document.public List<DocumentSection> getSections() throws XWikiException
The section are filtered by xwiki.section.depth property on the maximum depth of the sections to return. This method is usually used to get "editable" sections.
XWikiException
public DocumentSection getDocumentSection(int sectionNumber) throws XWikiException
sectionNumber
- the index (+1) of the section in the list of all sections in the document.XWikiException
- error when extracting sections from documentpublic String getContentOfSection(int sectionNumber) throws XWikiException
sectionNumber
- the index (+1) of the section in the list of all sections in the document.XWikiException
- error when trying to extract section contentpublic String updateDocumentSection(int sectionNumber, String newSectionContent) throws XWikiException
sectionNumber
- the index (starting at 1) of the section in the list of all sections in the document.newSectionContent
- the new section content.XWikiException
- error when updating contentpublic String getVersionHashCode(XWikiContext context)
public static String getInternalPropertyName(String propname, XWikiContext context)
public String getCustomClass()
public void setCustomClass(String customClass)
public void setValidationScript(String validationScript)
public String getValidationScript()
public String getComment()
public void setComment(String comment)
public boolean isMinorEdit()
public void setMinorEdit(boolean isMinor)
protected Boolean getMinorEdit1()
protected void setMinorEdit1(Boolean isMinor)
public BaseObject newXObject(EntityReference classReference, XWikiContext context) throws XWikiException
Note that absolute reference are not supported for xclasses which mean that the wiki part (whatever the wiki is) of the reference will be systematically removed.
classReference
- the reference of the classcontext
- the XWiki contextXWikiException
- error when creating the new object@Deprecated public BaseObject newObject(String className, XWikiContext context) throws XWikiException
newXObject(EntityReference, XWikiContext)
XWikiException
public BaseObject getXObject(DocumentReference classReference, boolean create, XWikiContext context)
public BaseObject getXObject(EntityReference classReference, boolean create, XWikiContext context)
@Deprecated public BaseObject getObject(String className, boolean create, XWikiContext context)
getXObject(DocumentReference, boolean, XWikiContext)
public boolean validate(XWikiContext context) throws XWikiException
XWikiException
public boolean validate(String[] classNames, XWikiContext context) throws XWikiException
XWikiException
public static void backupContext(Map<String,Object> backup, XWikiContext context)
public static void restoreContext(Map<String,Object> backup, XWikiContext context)
public void setAsContextDoc(XWikiContext context)
public String getPreviousVersion()
public void setHidden(Boolean hidden)
hidden
- The new value of the hidden
property.public Boolean isHidden()
isHidden
in interface DocumentModelBridge
true
if the document is hidden and does not appear among the results of
XWiki.searchDocuments(String)
, false
otherwise.public void convertSyntax(String targetSyntaxId, XWikiContext context) throws XWikiException
targetSyntaxId
- the syntax to convert to (e.g. xwiki/2.0
, xhtml/1.0
, etc)XWikiException
- if an exception occurred during the conversion processpublic void convertSyntax(org.xwiki.rendering.syntax.Syntax targetSyntax, XWikiContext context) throws XWikiException
targetSyntax
- the syntax to convert to (e.g. xwiki/2.0
, xhtml/1.0
, etc)XWikiException
- if an exception occurred during the conversion processpublic org.xwiki.rendering.block.XDOM getXDOM()
getXDOM
in interface DocumentModelBridge
public boolean is10Syntax()
public boolean is10Syntax(String syntaxId)
protected static String renderXDOM(org.xwiki.rendering.block.XDOM content, org.xwiki.rendering.syntax.Syntax targetSyntax) throws XWikiException
content
- the XDOM content to rendertargetSyntax
- the syntax identifier of the rendered contentXWikiException
- if an exception occurred during the rendering processpublic DocumentReference resolveClassReference(String documentName)
public EntityReference getRelativeParentReference()
setParentReference(EntityReference)
.
You should use getParentReference()
reference if you want the complete parent reference.
@Deprecated public MergeResult merge(XWikiDocument previousDocument, XWikiDocument newDocument, MergeConfiguration configuration, XWikiContext context)
MergeManager.mergeDocument(DocumentModelBridge, DocumentModelBridge, DocumentModelBridge,
MergeConfiguration)
.All 3 documents are supposed to have the same document reference and language already since that's what makes them uniques.
previousDocument
- the previous version of the documentnewDocument
- the next version of the documentconfiguration
- the configuration of the merge indicates how to deal with some conflicts use cases, etc.context
- the XWiki contextpublic boolean apply(XWikiDocument document)
Thid method does not take into account versions and author related informations and the provided document should
have the same reference. Like merge(XWikiDocument, XWikiDocument, MergeConfiguration, XWikiContext)
,
this method is dealing with "real" data and should not change anything related to version management and document
identifier.
Important note: this method does not take care of attachments contents related operations and only remove attachments which need to be removed from the list. For memory handling reasons all attachments contents related operations should be done elsewhere.
document
- the document to applypublic boolean apply(XWikiDocument document, boolean clean)
Thid method does not take into account versions and author related informations and the provided document should
have the same reference. Like merge(XWikiDocument, XWikiDocument, MergeConfiguration, XWikiContext)
,
this method is dealing with "real" data and should not change everything related to version management and
document identifier.
document
- the document to applypublic int getLocalReferenceMaxLength()
Copyright © 2004–2021 XWiki. All rights reserved.