Web-Requests
From Plex-XML
Definition of web requests
Contents |
Example
A web request that could be called by the name 'MyUpdate'.
There is only one request with the name 'MyUpdate' defined . It has one extra defined web parameter that could be passed with the name 'HeaderID' and some common parameter that are inherited by the 'extends="Update"' attribute.
The parameter 'HeaderID' is secured against Web Parameter Tampering (only for those requests with secured fields a generated parameter 'h' will be checked).
The response of this request has two reactions. One 'default' reaction that uses the default style and is filtered by the 'DictionaryEdit.xslt' and one reaction the is selected when the return code has the value 'OK'.
<webrequest name="MyUpdate">
<secfields>
<field name="HeaderID"/>
</secfields>
<request name="MyUpdate" extends="Update">
<plex-parameter type="web" name="UpdateKey_HeaderID">HeaderID</plex-parameter>
</request>
<response>
<error type="default" name="DEFAULT"/>
<error type="reaction" name="READY" response="MyUpdate" value="OK"/>
<reaction type="DEFAULT" target="DISPLAY" localized="true" name="/WEB-INF/resources/common/DictionaryEdit.xslt"/>
<reaction type="READY" target="DISPLAY" usedefaultstyle="false" name="/WEB-INF/resources/@common_html@/ready.xslt"/>
</response>
</webrequest>
<webrequest>
<webrequest name="MyWebrequest">
- Attributes
- name :Name of the request as it will be used in the URL. REQUIRED
http://127.0.0.1/MyApp/aServlet?request=MyWebrequest
<secfields>
A list of web parameter names, which should be checked against parameter tampering.
<secfields>
<field name="HeaderID"/>
</secfields>
<field>
- Attributes
- name :Name of parameter REQUIRED
<request>
<request name="MyFindBrowseRequest" extends="FindBrowse">
- Attributes
- name :Name of the request as defined in the Controller Configuration. In most cases the request name is identically to the Plex-XML function the is called by the servlet. REQUIRED
--> There is a special request name 'Echo' that has no Plex-Function as request. You could us it e.g. if you like to get the result of a XSLT-Transformation without running through a Plex-Function before.
- cache :true|refresh|false
- type :static
- localized :true|false
- extends :abstract-request-name
- default-parameter :true|false
- asynchron :true|false
- false: (default) If you have more then one request in you web-request this request is executed synchron and the next request in this web-request will be started after the request is ready.
- true: The request is send to another thread where asynchronous requests are executed one by one. The next request in this web-request won't have to wait until the asynchronous request is ready. The request get's an immediate result :<message>job #xxx submitted.</message>. You can use an asynchronous request e.g. if you like to send an e-mail after a new record has been saved and the user won't have to wait until the e-mail has been prepared and send.
<plex-parameter>
A field / value that is mapped to an input parameter in a Plex function.
<plex-parameter type="web" name="UpdateKey_KeyField">RequestName</plex-parameter>
- Attributes
- type :Type of parameter REQUIRED
- fix :There is a fixed value for this parameter. It can't be submitted by a web request.
<plex-parameter type="fix" name="Input_ParameterFix" value="this value is fix"/>
- fix :There is a fixed value for this parameter. It can't be submitted by a web request.
- web :The value of this parameter is submitted by a web request.
<plex-parameter type="web" name="UpdateKey_KeyField">RequestName</plex-parameter>
- web :The value of this parameter is submitted by a web request.
- response :The value of this parameter is the value of a field from a response of a previous request.
<plex-parameter type="response" name="FindFields_GenWhereValue" field="Output_SearchHeaderID" response="FormSearchHInsUpd"/>
- response :The value of this parameter is the value of a field from a response of a previous request.
- session :The value of this parameter is the value of a session property.
<plex-parameter type="session" name="Input_SessionID">session.ID</plex-parameter>
- session :The value of this parameter is the value of a session property.
- request :The value of this parameter is the value of a request value extracted from the HTML header. Valid values are "request-uri", "protocol", "remote-address", "remote-user", "locale", "user-agent".
<plex-parameter type="request" name="Input_IPAddress">remote-address</plex-parameter>
- request :The value of this parameter is the value of a request value extracted from the HTML header. Valid values are "request-uri", "protocol", "remote-address", "remote-user", "locale", "user-agent".
- name :Name of the parameter in the Plex function. The first part is the variable (e.g. Input, UpdateKey) and the second part after the '_' is the field name.
<parameter>
A parameter that is passed over to the XML result without an input field in the Plex function. Very helpful if you like to control/customize XSLT generation.
<!-- Example for a fixed value that is passed to your XML result --> <parameter type="fix" name="xsl_Mode" value="none"/> <!-- Example for a web request value (refresh) that is passed to your XML result --> <parameter type="web" name="ParRefresh">refresh</parameter>
- Attributes
- type :Type of parameter REQUIRED
- fix :There is a fixed value for this parameter. It can't be submitted by a web request.
- file:Special type for file uploads. See FileUpload for an example.
- name :Name of the parameter in the XML result
- value :Value of the parameter in the XML result
Example parameter type 'file':
<parameter type="file" name="File1" webfield="File1"> <plex-parameter type="web" name="FileInput_DocFileLocalPath">original</plex-parameter> <plex-parameter type="web" name="FileInput_DocFileMimeType">contenttype</plex-parameter> <plex-parameter type="web" name="FileInput_DocFilePath">newname</plex-parameter> <plex-parameter type="web" name="FileInput_DocFileSize">size</plex-parameter> </parameter>
<stoponerror>
- successcode :anerrorcode
<request-list>
- Attributes
- url :Name of the request as defined in the Controller Configuration REQUIRED
<importrequest>
you can use this special type of request to import files previously uploaded ( or otherwise accessible from the Server). The Default-Implementation can import CSV files into the database. it generates a XML request for each row in the file.
<importrequest name="RunImport"> <parameter type='web' targetfield='locale' field='Locale' response='Echo' /> <parameter type='web' targetfield='language' field='Language' response='Echo' /> <parameter type='web' targetfield='filename' field='FilePath' response='Echo' /> <parameter type='web' targetfield='requestname' field='ImportRequestName' response='Echo' /> <parameter type='web' targetfield='type' field='ImportType' response='Echo' /> <parameter type='web' targetfield='separator' field='ImportDelimiter' response='Echo' /> <parameter type='web' targetfield='quotechar' field='ImportQuoteChar' response='Echo' /> <parameter type='web' targetfield='charset' field='ImportCharSet' response='Echo' /> <parameter type='web' targetfield='filterfunction' field='ImportFilterFunction' response='Echo' /> <parameter type='web' targetfield='formatname' field='FunctionFormat' response='Echo' /> </importrequest>
- Parameters
- locale : passed through to the XML request
- language : passed through to the XML request
- filename : the full path to the import file ( must be from the server point of view!)
- requestname : the name of the request generated ( should be the name of an Import Request)
- type : 'CSV' for Default-Implementation
- separator : a character used as field delimiter (default:;)
- quotechar : a character used as String delimiter(default:none)
- charset : a character set name (default: System charset)
- filterfunction: name of an implementation of the Java Interface de.bodow.dataimport.CSVFilter ( default: de.bodow.dataimport.DefaultCSVFilter) to enable some customization
- formatname: format name to be used within the generated request
<response>
... <response> <error type="default" name="DEFAULT" /> <reaction type="DEFAULT" target="NOTHING" /> </response> ...
<error>
- Attributes
- type :default|reaction
- name :einName
- response :einrequestname
- value :ein errorcode-Wert
<reaction>
- Attributes
- target :Kind of reaction that your request should have REQUIRED
- WEBREQUEST : Another Web-Request
<reaction type="DEFAULT" target="WEBREQUEST" name="UserIDTab"> <parameter type="web" response="newLDAPUser" field="Output_UserIdentifier" targetfield="UserIdentifier"/> </reaction>
- DISPLAY : Send the response back to the requester mostly used to display an HTML Page as response
<reaction type="DEFAULT" target="DISPLAY" localized="true" name="/WEB-INF/resources/common/DictionaryEdit.xslt"/>
- BINARY : Send binary data back to the requester
<reaction type="DEFAULT" target="BINARY"> <parameter type="web" response="DocFilShow" field="Output_DocFilePath" targetfield="DocName"/> <parameter type="web" response="DocFilShow" field="Output_DocFileMimeType" targetfield="DocMime"/> <parameter type="web" response="DocFilShow" field="Output_DocTypeStdPath" targetfield="DocPath"/> <parameter type="web" response="DocFilShow" field="Output_DocFilePath" targetfield="LocalName"/> </reaction>
- SENDMAIL : Send an Email (Server, SMTP-User and Password will could be stored in System-Parameter)
<response> <error type="default" name="DEFAULT"/> <reaction type="DEFAULT" mime="text/html" target="SENDMAIL" name="/WEB-INF/helpdesk/style/ActMainSendMailHelp.xslt"> <parameter type="web" targetfield="server" response="MainSendMail" field="ControlOutput_MailServer" /> <parameter type="web" targetfield="user" response="MainSendMail" field="ControlOutput_MailSMTPUser" /> <parameter type="web" targetfield="password" response="MainSendMail" field="ControlOutput_MailSMTPPW" /> <parameter type="web" targetfield="subject" response="MainSendMail" field="ControlOutput_MailSubject" /> <parameter type="web" targetfield="to" response="MainSendMail" field="ControlOutput_MailAddressTo" /> <parameter type="web" targetfield="cc" response="MainSendMail" field="ControlOutput_MailAddressCC" /> <parameter type="web" targetfield="bcc" response="MainSendMail" field="ControlOutput_MailAddressBCC" /> <parameter type="web" targetfield="from" response="MainSendMail" field="ControlOutput_MailAddressFrom" /> <parameter type="web" targetfield="replyto" response="MainSendMail" field="ControlOutput_MailAddressReplyTo" /> <success-page usedefaultstyle="false" name="/WEB-INF/resources/@common_html@/ready.xslt"/> <error-page name="/WEB-INF/resources/common/Error.xslt"/> </reaction> </response>
- NOTHING : no reponse
<reaction type="DEFAULT" target="NOTHING"/>
- EXPORT_OO : Export to OpenOffice/Excel/PDF/.. via OpenOffice
<reaction type="DEFAULT" target="EXPORT_OO"> <parameter type="fix" targetfield="template" value="/WEB-INF/limon/OOTemplates/OOTable.ods"/> <parameter type="fix" targetfield="delete-temp" value="true"/> <parameter type="fix" targetfield="LocalName" value="ExportOOo.pdf"/> <parameter type="fix" targetfield="format" value="PDF"/> <parameter type="fix" targetfield="calc-column-width" value="true"/> </reaction>
- SAVEFILE : save resulting Document to the Server File System
<reaction type="DEFAULT" target="SAVEFILE" localized="true" usedefaultstyle="false" name="/WEB-INF/limon/style/X1_FB_publicView.xslt"> <parameter type="fix" targetfield="filename" value="testpv.html" /> <parameter type="fix" targetfield="directory" value="c:\temp" /> <success-page usedefaultstyle="false" name="/WEB-INF/resources/@common_html@/ready.xslt"/> <error-page name="/WEB-INF/resources/common/Error.xslt"/> </reaction>
- REDIRECT : redirect to an external URL
<reaction type="DEFAULT" target="REDIRECT"> <parameter type="web" targetfield="url" response="ReportSel" field="Output_ReportURL" /> </reaction>
- type :etwas, was als name bei einem error-Element steht
- name :/WEB-INF/Names eines XSL-Filters | Names eines WebRequests
- mime :MIME-Type
- usedefaultstyle :true | false
- localized :true | false --> Use messages-{0}.xslt for translation. See Translation in XSLT for more information about translation in xslt's.
<filter>
<save-parameter>
Save an output parameter in application server session.
<save-parameter response="SessionAndUser" field="ControlInput_SessionID" targetfield="session.ID"/>

