Package com.xpn.xwiki.web
Class EditForm
- java.lang.Object
-
- com.xpn.xwiki.web.XWikiForm
-
- com.xpn.xwiki.web.EditForm
-
- Direct Known Subclasses:
PreviewForm
public class EditForm extends XWikiForm
An object containing the information sent in an action request to perform changes on a document.- Version:
- $Id: 935231bb13044e78e782afa8915c9f8b02e38d07 $
-
-
Constructor Summary
Constructors Constructor Description EditForm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetComment()StringgetContent()StringgetCreator()StringgetDefaultLanguage()StringgetDefaultTemplate()StringgetHidden()StringgetLanguage()StringgetName()Map<String,String[]>getObject(String prefix)intgetObjectNumbers(String prefix)ObjectPolicyTypegetObjectPolicy()Return the object policy given in the HTTP request.Map<String,List<Integer>>getObjectsToAdd()Map<String,List<Integer>>getObjectsToRemove()StringgetParent()StringgetSyntaxId()StringgetTags()StringgetTemplate()List<String>getTemporaryUploadedFiles()Retrieve the list of temporary uploaded files to add as attachment.StringgetTitle()Map<String,SortedMap<Integer,Map<String,String[]>>>getUpdateOrCreateMap()If current objectPolicyType isObjectPolicyType.UPDATE_OR_CREATE, retrieve a map from the request parameters of the form<spacename>.<classname>_<number>_<propertyname>'Keys of this map will be the reference<spacename>.<classname>to the Class (for example, 'XWiki.XWikiRights'), the content is a list where each element describe property for the object<number>.StringgetWeb()booleanisConvertSyntax()booleanisLockForce()booleanisMinorEdit()voidreadRequest()voidsetComment(String comment)voidsetContent(String content)voidsetConvertSyntax(boolean convertSyntax)Sets whether to convert the document content and meta data to the new syntax specified on the edit form.voidsetCreator(String creator)voidsetDefaultLanguage(String defaultLanguage)voidsetDefaultTemplate(String defaultTemplate)voidsetHidden(String hidden)voidsetLanguage(String language)voidsetLockForce(boolean lockForce)voidsetMinorEdit(boolean isMinorEdit)voidsetName(String name)voidsetParent(String parent)voidsetSyntaxId(String syntaxId)voidsetTags(String[] parameter)voidsetTemplate(String template)voidsetTitle(String title)voidsetWeb(String web)-
Methods inherited from class com.xpn.xwiki.web.XWikiForm
getRequest, reset, reset, setRequest
-
-
-
-
Method Detail
-
readRequest
public void readRequest()
- Specified by:
readRequestin classXWikiForm
-
setTags
public void setTags(String[] parameter)
-
getTags
public String getTags()
-
getContent
public String getContent()
-
setContent
public void setContent(String content)
-
getWeb
public String getWeb()
-
setWeb
public void setWeb(String web)
-
getName
public String getName()
-
setName
public void setName(String name)
-
getLanguage
public String getLanguage()
-
setLanguage
public void setLanguage(String language)
-
getObjectNumbers
public int getObjectNumbers(String prefix)
-
getParent
public String getParent()
-
setParent
public void setParent(String parent)
-
getCreator
public String getCreator()
-
setCreator
public void setCreator(String creator)
-
getTemplate
public String getTemplate()
-
setTemplate
public void setTemplate(String template)
-
getDefaultTemplate
public String getDefaultTemplate()
-
setDefaultTemplate
public void setDefaultTemplate(String defaultTemplate)
-
getDefaultLanguage
public String getDefaultLanguage()
-
setDefaultLanguage
public void setDefaultLanguage(String defaultLanguage)
-
getTitle
public String getTitle()
-
setTitle
public void setTitle(String title)
-
getComment
public String getComment()
-
setComment
public void setComment(String comment)
-
isMinorEdit
public boolean isMinorEdit()
-
setMinorEdit
public void setMinorEdit(boolean isMinorEdit)
-
isLockForce
public boolean isLockForce()
-
setLockForce
public void setLockForce(boolean lockForce)
-
getSyntaxId
public String getSyntaxId()
-
setSyntaxId
public void setSyntaxId(String syntaxId)
-
isConvertSyntax
public boolean isConvertSyntax()
- Returns:
trueif the document content and meta data should be converted to the new syntax specified on the edit form,falseotherwise- Since:
- 12.6.3, 12.9RC1
- See Also:
syntaxId
-
setConvertSyntax
public void setConvertSyntax(boolean convertSyntax)
Sets whether to convert the document content and meta data to the new syntax specified on the edit form.- Parameters:
convertSyntax-trueto convert the document content and meta data to the new syntax,falseto only change the syntax identifier- Since:
- 12.6.3, 12.9RC1
-
getHidden
public String getHidden()
-
setHidden
public void setHidden(String hidden)
-
getObjectPolicy
public ObjectPolicyType getObjectPolicy()
Return the object policy given in the HTTP request. SeeObjectPolicyTypefor more information about what is an object policy.- Returns:
- the Object Policy type
- Since:
- 7.0RC1
-
getTemporaryUploadedFiles
@Unstable public List<String> getTemporaryUploadedFiles()
Retrieve the list of temporary uploaded files to add as attachment.- Returns:
- a list of filenames that should be attached.
- Since:
- 14.3RC1
- See Also:
TemporaryAttachmentSessionsManager
-
getUpdateOrCreateMap
public Map<String,SortedMap<Integer,Map<String,String[]>>> getUpdateOrCreateMap()
If current objectPolicyType isObjectPolicyType.UPDATE_OR_CREATE, retrieve a map from the request parameters of the form<spacename>.<classname>_<number>_<propertyname>'Keys of this map will be the reference<spacename>.<classname>to the Class (for example, 'XWiki.XWikiRights'), the content is a list where each element describe property for the object<number>. Element of the list is a map where key is<propertyname>and content is the array of corresponding values. Example with a list of HTTP parameters:- XWiki.XWikiRights_0_users=XWiki.Admin
- XWiki.XWikiRights_0_users=XWiki.Me
- XWiki.XWikiRights_0_groups=XWiki.XWikiAllGroup
- XWiki.XWikiRights_1_user=XWiki.Admin
- XWiki.XWikiUsers_1_name=Spirou
{ "XWiki.XWikiRights": { "0": { "users": ["XWiki.Admin", "XWiki.Me"], "groups": ["XWiki.XWikiAllGroup"] }, "1": { "users": ["XWiki.Admin"] } ], "XWiki.XWikiUsers": "1": { "name": ["Spirou"] } ] }Note that the resulting map does not guarantee the consistency of the properties in regards with the actual definition of the XClass. For example, the request could containXWiki.XWikiRights_0_foobar=value: the resulting map will always return a parameter "foobar" for XWiki.XWikiRights even if the xclass does not define it or even if the xclass does not exist. If the current objectPolicyType is notObjectPolicyType.UPDATE_OR_CREATEit will return an empty map.- Returns:
- a map containing ordered data or an empty map.
-
-