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 String
getComment()
String
getContent()
String
getCreator()
String
getDefaultLanguage()
String
getDefaultTemplate()
String
getHidden()
String
getLanguage()
String
getName()
Map<String,String[]>
getObject(String prefix)
int
getObjectNumbers(String prefix)
ObjectPolicyType
getObjectPolicy()
Return the object policy given in the HTTP request.Map<String,List<Integer>>
getObjectsToAdd()
Map<String,List<Integer>>
getObjectsToRemove()
String
getParent()
String
getSyntaxId()
String
getTags()
String
getTemplate()
List<String>
getTemporaryUploadedFiles()
Retrieve the list of temporary uploaded files to add as attachment.String
getTitle()
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>
.String
getWeb()
boolean
isConvertSyntax()
boolean
isLockForce()
boolean
isMinorEdit()
void
readRequest()
void
setComment(String comment)
void
setContent(String content)
void
setConvertSyntax(boolean convertSyntax)
Sets whether to convert the document content and meta data to the new syntax specified on the edit form.void
setCreator(String creator)
void
setDefaultLanguage(String defaultLanguage)
void
setDefaultTemplate(String defaultTemplate)
void
setHidden(String hidden)
void
setLanguage(String language)
void
setLockForce(boolean lockForce)
void
setMinorEdit(boolean isMinorEdit)
void
setName(String name)
void
setParent(String parent)
void
setSyntaxId(String syntaxId)
void
setTags(String[] parameter)
void
setTemplate(String template)
void
setTitle(String title)
void
setWeb(String web)
-
Methods inherited from class com.xpn.xwiki.web.XWikiForm
getRequest, reset, reset, setRequest
-
-
-
-
Method Detail
-
readRequest
public void readRequest()
- Specified by:
readRequest
in 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:
true
if the document content and meta data should be converted to the new syntax specified on the edit form,false
otherwise- 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
-true
to convert the document content and meta data to the new syntax,false
to 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. SeeObjectPolicyType
for 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_CREATE
it will return an empty map.- Returns:
- a map containing ordered data or an empty map.
-
-