Request Configuration

From Plex-XML

Revision as of 22:37, 27 March 2008 by Guenter (Talk | contribs)
Jump to: navigation, search

Request configuration is a very important part of Plex-XML. The definition of Web- and Job-Request describes the interface and the behavior between external requests, Servlet/Plex-Functions and the response. Most definitions will be done in the Web-Request part.

The main request-config file is defined in the Servlet part of your web.xml.

You are able to combine different request configuration files by the <import> element.

<import url="/WEB-INF/abstract-request-config.xml"/>

Each request configuration has to be framed by the <request-config> element.

Contents

<webrequest>

The <webrequest> element is used for the definition of requests that will be called by URL e.g. form a browser or another application.

See Web-Requests for details.

<jobrequest>

The <jobrequest> element is used for periodic scheduled requests.

See Job-Requests for details.

<abstract-request>

The <abstract-request> element is used to define a parameter structure that should be reused in different web-requests.

See Abstract-Requests for details.

<default-request>

The default request is executed when the given request name e.g. in a URL can't be found.

You could use the default request also for definition of your start page. But in most cases that will be done by an index.html page.

<default-request>UnderConstruction</default-request>

<error-request>

The error request is executed when some of the request parameters have been tampered. the only parameter for the request is a message named "exception", which is passed to the response so it can be displayed.

<error-request>SecurityError</error-request>

<default-response>

The default response is used to define elements (in most cases session values) that should be attached to every XML response. In the example below the session.locale is attached to very XML response.

<default-response>
  <plex-parameter type="session" name="Session-Locale">session.locale</plex-parameter>
  <plex-parameter type="session" name="Session-DateFormat">DateFormat</plex-parameter>
  <plex-parameter type="session" name="Session-UserID">UserID</plex-parameter>
</default-response>

XML response

  <session-attribute name="Session-Locale" value="de" /> 
  <session-attribute name="Session-DateFormat" value="dd.MM.yyyy" /> 
  <session-attribute name="Session-UserID" value="FOO-User" /> 

<default-parameter>

The default-parameter element is used to define parameter that should be passed with every request.

<default-parameter>
  <plex-parameter type="session" name="ControlInput_SessionID">session.ID</plex-parameter>
  <plex-parameter type="request" name="ControlInput_SECIPAddress">remote-address</plex-parameter>
</default-parameter>

<default-stylesheet>

The default-stylesheet element is used to define the last XSLT filter that will be used in dependency of the 'style' parameter given in the request.

E.g. if your request has a parameter like '...aServlet?request=FooFB&style=pdf...' your response will be a PDF-File prepared by the '/WEB-INF/resources/common_fo/createpdf.xsl' XSLT as last filter.

<default-stylesheet>/WEB-INF/resources/@common_html@/aaBaseDoc.xsl</default-stylesheet>
<default-stylesheet type="tab">/WEB-INF/resources/@common_html@/aaBaseDocAJAX.xsl</default-stylesheet>
<default-stylesheet type="ajax">/WEB-INF/resources/@common_html@/aaBaseDocAJAX.xsl</default-stylesheet>
<default-stylesheet type="pdf" mime="application/pdf">/WEB-INF/resources/common_fo/createpdf.xsl</default-stylesheet>