ExtendedInboundParamHandlerFormatter

From GreenVulcano Wiki
Revision as of 16:31, 26 July 2013 by A.capaldo (talk | contribs) (RequestXMLParamMapping)
Jump to: navigation, search

Description

This sub-element formatter is used into the decoding of client request's parameters in order to create the input for a GreenVulcano® ESB service and to convert the service's output into a HTTP response.


DA COMPLETARE


GreenVulcano® ESB Configuration

The GVAdapterHttpConfiguration Element is used by: GVAdapters.

The following table shows the ExtendedInboundParamHandlerFormatter attributes:

Attribute Type Description
type fixed This attribute must keep the value FormatterPlugin.
class fixed Module Id always set to it.greenvulcano.gvesb.adapter.http.formatters.handlers.ExtendedInboundParamHandlerFormatter.
ID required If 'true' reads the request HTTP headers and provide them with the request parameters. Default value is false.
read-request-header optional CharacterEncoding to be used to handle requests from external system. Default to UTF-8.
ReqCharacterEncoding optional CharacterEncoding to handle responses to the external system. Default to UTF-8.
RespCharacterEncoding optional ContentType to be declared while handling HTTP responses to the external system. Default to text/html.
RespContentType optional If true force the POST body to be handled as application/x-www-form-urlencoded content type. Default is false.
HandlePostBodyAsParams optional If != -1 force the adapter to respond with the given http code on case of error. Default is -1 (disabled).
ResponseOnError-HTTPCode optional CharacterEncoding to be used to handle requests from external system. Default to UTF-8.

Template to follow:

        <xsl:template match="GVBufferFieldDefaultValue">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td>Field name:  <i><xsl:value-of select="@FieldName"/></i></td>
                </tr>
                <tr>
                    <td>Field value:  <i><xsl:value-of select="@FieldValue"/></i></td>
                </tr>
            </table>
        </xsl:template>

Contains the sub-elements GVBufferFieldDefaultValue.

Contains the sub-elements GVBufferPropertyDefaultValue.

Contains the sub-elements GVBufferField.

GVBufferFieldDefaultValue

The following table shows the GVBufferFieldDefaultValue attributes:

Attribute Type Description
FieldName required The configured default value of an GVBuffer field. Cannot be left blank.
FieldValue required A configured default value for a property field of an GVBuffer object.

GVBufferPropertyDefaultValue

The name of an GVBuffer extended field. The following table shows the GVBufferPropertyDefaultValue attributes:

Attribute Type Description
FieldName required This element represents a mapping target from/to a property field of an GVBuffer object.
FieldValue required This element represents a mapping target from/to a field of an GVBuffer object.

Template to follow:

        <xsl:template match="GVBufferPropertyDefaultValue">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td>Extended field name:  <i><xsl:value-of select="@FieldName"/></i></td>
                </tr>
                <tr>
                    <td>Extended field value:  <i><xsl:value-of select="@FieldValue"/></i></td>
                </tr>
            </table>
        </xsl:template>

GVBufferField

The name of a field of an GVBuffer object. The following table shows the GVBufferField attributes:

Attribute Type Description
FieldName required The configured default value of an GVBuffer extended field. Cannot be left blank.

Template to follow:

        <xsl:template match="GVBufferProperty">
            <table cellpadding="0" cellspacing="0">
                 <tr>
                    <td>Extended field name: <b><xsl:value-of select="@FieldName"/></b></td>
                </tr>
            </table>
        </xsl:template>

GVBufferProperty

The name of a field of an GVBuffer object. The following table shows the GVBufferProperty attributes:

Attribute Type Description
FieldName required This element represents a plain text value to be assigned as source/target of an handler mapping.

Template to follow:

        <xsl:template match="DefaultValue">
            <table cellpadding="0" cellspacing="0">
                 <tr>
                    <td>Value length: <b><xsl:value-of select="string-length(text())"/></b> characters</td>
                </tr>
            </table>
        </xsl:template>

This element represents a mapping target from/to a list of extended field of an GVBuffer object. Template to follow

        <xsl:template match="GVBufferPropertyList">
            <table cellpadding="0" cellspacing="0">
                 <tr>
                    <td>Excluded Extended fields names: <b><xsl:value-of select="@ExcludeFields"/></b></td>
                </tr>
            </table>
        </xsl:template>

GVBufferPropertyList

The following table shows the GVBufferPropertyList attributes:

Attribute Type Description
URLEncoding required Parameters name-value separator string within list. Possible values are : True, False. Default is ';'
FieldNameValueSeparator optional Parameters entry separator string within list. Default is '='
FieldEntrySeparator optional The comma separated list of extended fields names to ignore.
ExcludeFields required This element represents a plain text value to be assigned as source/target of an handler mapping.

This is the template used:

        <xsl:template match="DefaultValue">
            <table cellpadding="0" cellspacing="0">
                 <tr>
                    <td>Value length: <b><xsl:value-of select="string-length(text())"/></b> characters</td>
                </tr>
            </table>
        </xsl:template>

RequestParams

Contains the sub-elements:

The following table shows the RequestParams attributes:

Attribute Type Description
ParamNameValueSeparator required Parameters name-value separator string within list. Possible values are : True, False. Default is ';'
ParamEntrySeparator optional Parameters entry separator string within list. Default is '='

This is the template used:

        <xsl:template match="RequestContent">
            <table cellpadding="0" cellspacing="0">
                 <tr>
                        <td>Configured handlers:</td>
                        <td width="20"></td>
                        <td><b><xsl:value-of select="count(./*[@ItemType='Handler'])"/></b></td>
                </tr>
            </table>
        </xsl:template>

RequestParam

The following table shows the RequestParam attributes:

Attribute Type Description
Name required If true the request parameter is mandatory. Possible values are : True, False. Default is True.
Type optional This element contains configuration informations about an inbound request XML parameter Handler: a Java object used to extract informations from a single parameter of an inbound http request (in the case that this parameter contains an XML string) and use them to populate one or more fields of an GVBuffer request object to be sent to GreenVulcano.

This is the template used:

      <xsl:template match="RequestXMLParamHandler">
            <table cellpadding="0" cellspacing="0">
                <xsl:choose>
                <xsl:when test="../@Name">
                    <tr>
                        <td>Inbound request parameter handled:</td>
                        <td width="20"></td>
                        <td><b><xsl:value-of select="../@Name"/></b></td>
                    </tr>
                </xsl:when>
                <xsl:otherwise>
                    <tr>
                        <td>Inbound request content handler.</td>
                    </tr>
                </xsl:otherwise>
             </xsl:choose>
               <tr>
                    <td>Output type: <b><xsl:value-of select="@OutputType"/></b></td>
                </tr>
                <tr>
                    <td>Maps parameter contents to:</td>
                    <td width="20"></td>
                </tr>
                <tr>
                    <td>
                        <ul>
                            <xsl:for-each select="RequestXMLParamMapping">
                                <xsl:if test="GVBufferField">
                                    <li>field <b><xsl:value-of select="substring-after(GVBufferField/@FieldName, 'GVBuffer.')"/></b> of GVBuffer</li>
                                </xsl:if>
                                <xsl:if test="GVBufferProperty">
                                    <li>extended field <b><xsl:value-of select="GVBufferProperty/@FieldName"/></b> of GVBuffer</li>
                                </xsl:if>
                                 <xsl:if test="OpType">
                                    <li><i>OperationType</i> variable (GreenVulcano communication paradigm)</li>
                                </xsl:if>
                           </xsl:for-each>
                        </ul>
                   </td>
                </tr>
            </table>
        </xsl:template>

RequestXMLParamHandler

Contains the sub-elements:

The following table shows the RequestXMLParamHandler attributes:

Attribute Type Description
ItemType fixed Inbound request parameter/content format.
Class optional The output type of this inbound request parameter handler (GVBuffer object or communication paradigm string).
OutputType fixed This element contains a mapping between a value extracted by an element or attribute (within XML content of an inbound request parameter) matching a given XPath, and a field of a request GVBuffer object. If mapping target is indicated with the "OpType" keyword, the value is a string indicating the requested communication paradigm (RequestReply, Request, SendReply, GetRequest, GetReply). Possible values are GVBuffer, OpType.

This is the template used:

        <xsl:template match="RequestXMLParamMapping">
            <table cellpadding="0" cellspacing="0">
             <xsl:choose>
                <xsl:when test="../../@Name">
                    <tr>
                        <td>Inbound request parameter handled:</td>
                        <td width="20"></td>
                        <td><b><xsl:value-of select="../../@Name"/></b></td>
                    </tr>
                </xsl:when>
                <xsl:otherwise>
                    <tr>
                        <td>Inbound request content handler mapping.</td>
                    </tr>
                </xsl:otherwise>
             </xsl:choose>
                <tr>
                    <td>Mapping source: <b><xsl:value-of select="@XPath"/></b></td>
                </tr>
                <tr>
                    <td>Mapping target:
                        <xsl:if test="GVBufferField">
                           field <b><xsl:value-of select="substring-after(GVBufferField/@FieldName, 'GVBuffer.')"/></b> of GVBuffer
                        </xsl:if>
                        <xsl:if test="GVBufferProperty">
                            extended field <b><xsl:value-of select="GVBufferProperty/@FieldName"/></b> of GVBuffer
                        </xsl:if>
                        <xsl:if test="OpType">
                            <i>OperationType</i> variable (GreenVulcano communication paradigm)
                        </xsl:if>
                    </td>
                </tr>
            </table>
        </xsl:template>


RequestXMLParamMapping

Element type (used for XPath navigation). Contains the sub-elements:

The following table shows the RequestXMLParamMapping attributes:

Attribute Type Description
ItemType fixed XPath of an element or attribute (within XML content of an inbound request parameter).
XPath required This element contains configuration informations about an inbound request Flat parameter Handler: a Java object used to extract informations from a single parameter of an inbound http request (in the case that this parameter contains a Flat string) and use them to populate one or more fields of an GVBuffer request object to be sent to GreenVulcano.

This is the template used:

       <xsl:template match="RequestFlatParamHandler">
            <table cellpadding="0" cellspacing="0">
                <xsl:choose>
                <xsl:when test="../@Name">
                    <tr>
                        <td>Inbound request parameter handled:</td>
                        <td width="20"></td>
                        <td><b><xsl:value-of select="../@Name"/></b></td>
                    </tr>
                </xsl:when>
                <xsl:otherwise>
                    <tr>
                        <td>Inbound request content handler.</td>
                    </tr>
                </xsl:otherwise>
             </xsl:choose>
               <tr>
                    <td>Output type: <b><xsl:value-of select="@OutputType"/></b></td>
                </tr>
                <tr>
                    <td>Maps parameter contents to:</td>
                    <td width="20"></td>
                </tr>
                <tr>
                    <td>
                        <ul>
                            <xsl:for-each select="RequestFlatParamMapping">
                                <xsl:if test="GVBufferField">
                                    <li>field <b><xsl:value-of select="substring-after(GVBufferField/@FieldName, 'GVBuffer.')"/></b> of GVBuffer</li>
                                </xsl:if>
                                <xsl:if test="GVBufferProperty">
                                    <li>extended field <b><xsl:value-of select="GVBufferProperty/@FieldName"/></b> of GVBuffer</li>
                                </xsl:if>
                                 <xsl:if test="OpType">
                                    <li><i>OperationType</i> variable (GreenVulcano communication paradigm)</li>
                                </xsl:if>
                           </xsl:for-each>
                        </ul>
                   </td>
                </tr>
            </table>
        </xsl:template>


RequestFlatParamHandler

Element type (used for XPath navigation). Contains the sub-elements:

The following table shows the RequestFlatParamHandler attributes:

Attribute Type Description
ItemType fixed Inbound request parameter/content format.
Class fixed The output type of this inbound request parameter handler (GVBuffer object or communication paradigm string).
OutputType required The separator character between fields within the flat string value of this inbound request parameter.

Possible values are GVBuffer, OpType.

SeparatorChar optional This element contains a mapping between a value extracted from a flat string (the content of an inbound request parameter), and a field of a request GVBuffer object. If mapping target is indicated with the "OpType" keyword, the value is a string indicating the requested communication paradigm (RequestReply, Request, SendReply, GetRequest, GetReply).

This is the template used:

    <xsl:template match="RequestFlatParamMapping">
            <table cellpadding="0" cellspacing="0">
             <xsl:choose>
                <xsl:when test="../../@Name">
                    <tr>
                        <td>Inbound request parameter handled:</td>
                        <td width="20"></td>
                        <td><b><xsl:value-of select="../../@Name"/></b></td>
                    </tr>
                </xsl:when>
                <xsl:otherwise>
                    <tr>
                        <td>Inbound request content handler mapping.</td>
                    </tr>
                </xsl:otherwise>
             </xsl:choose>
                <tr>
                    <td>Mapping source offset: <b><xsl:value-of select="@Offset"/></b></td>
                </tr>
                <xsl:if test="@Length">
                <tr>
                    <td>Mapping source Length: <b><xsl:value-of select="@Length"/></b></td>
                </tr>
                </xsl:if>
                <tr>
                    <td>Mapping target:
                        <xsl:if test="GVBufferField">
                           field <b><xsl:value-of select="substring-after(GVBufferField/@FieldName, 'GVBuffer.')"/></b> of GVBuffer
                        </xsl:if>
                        <xsl:if test="GVBufferProperty">
                            extended field <b><xsl:value-of select="GVBufferProperty/@FieldName"/></b> of GVBuffer
                        </xsl:if>
                        <xsl:if test="OpType">
                            <i>OperationType</i> variable (GreenVulcano communication paradigm)
                        </xsl:if>
                    </td>
                </tr>
            </table>
        </xsl:template>