Difference between revisions of "Excelreader-call"

From GreenVulcano Wiki
Jump to: navigation, search
(Vulcon Configuration)
({{VULCON}} / {{GVCONSOLE}} Configuration)
 
(114 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Definition ==
+
==Definition==
  
Many IT applications in their business process needs read an excel file.
+
Many IT applications, within their business process, need to read an Excel file. ''ExcelReaderCall'' plug-in helps IT organizations integrating applications that use Excel format to execute their business.
GreenVulcano Gvvcl-excel-reader Plug-in helps IT organizations integrate applications that utilize excel format to execute their business.
 
Gvvcl-excel-reader Plug-in is compatible with all Excel format up to 2003, and is very simple to configure. It receive in input a stream of excel file and give in output an XML structure. At the output of Gvvcl-excel-reader Plug-in is possible apply a [[changeGvBuffer]] operation (with [[ognl script]] or a [[xsl stylesheet]]) to retrieve all interest data.
 
  
GreenVulcano ESB provides two tools, [[GVConsole]] and [[Vulcon]], to configure all GreenVulcano supported Plug-ins in GV services.
+
''ExcelReaderCall'' plug-in is compatible with all Excel formats up to version 2003, and it is very simple to configure. It receives in input a binary stream containing the Excel file, and returns in output a corresponding XML structure.  
  
== Vulcon Configuration ==
+
To the output of ''ExcelReaderCall'' plug-in it is possible to apply a [[ChangeGVBufferNode]] operation (with [http://en.wikipedia.org/wiki/OGNL OGNL] script or an [http://en.wikipedia.org/wiki/XSL XSL] transformation) to retrieve all interested data.
  
 +
{{GVESB}} provides two different tools, {{L_GVCONSOLE}} and {{L_VULCON}}, to configure all supported plug-ins.
  
''excelreader-call'' is the operation that must be configured into Vulcon ''system'' section, to convert a Excel file, in GVBuffer.object field, in a XML document.
+
=={{VULCON}} / {{GVCONSOLE}} Configuration==
[[Image:CreateOperationExcelReader.png|right|thumb|Vulcon system excel-reader configuration ]]
 
To  add an operation excelreader-call user must perform the following operation:
 
* You open Vulcon system section and his channel
 
* You clicks the right mouse button and select "insert before" label --> excelreader-call
 
* In layout you fill in field name, i.e. the name of operation that will be used in Vulcon Service section
 
* Other fields ''class'', ''onlyData'' and ''type'' will be ignored
 
At this point, you have configured an operation of type ''excelreader-call''.
 
  
 +
''excelreader-call'' is the operation that must be configured into {{L_VULCON}} or  {{L_GVCONSOLE}} [[System]] section, to convert an Excel file in [[#GVBuffer|GVBuffer.object]] field, in an XML document.
  
To use an ''excelreader-call'' in a GreenVulcano ESB service, you need to perfom the following steps:
+
In order to add an operation ''excelreader-call'' you must define the following fields:
[[File:Service-GVvcl-excel.png|right|thumb|Vulcon service excel-reader configuration ]]
+
{|class="gvtable"
* In services Section select the services that you want modify or you can create a new Services
+
! Attribute !! Type !! Description
* On flow tag, you clicks the right mouse button and select "insert before"
+
|-
* On the list of GreenVulcano node select ''GvOperationNode''
+
| class || fixed || '''it.greenvulcano.gvesb.virtual.excel.reader.GVExcelReaderCallOperation'''
* On the template that appear, you must  select from drop down list, input fiel, next-node-id and as operation-name the operation configured in the system. Fill in fields id and output.
+
(java class that manage ''ExcelReaderCall'' invocation).
+
|-
At this point you have relate ''excelreader-call'' Operation to GreenVulcano service.
+
| name || required || This field identify the operation name that you will use in service definition.
 +
|-
 +
| onlyData || optional || It is a boolean field, enabled in output cell formatting informations.
 +
If 'false', inserts in the XML document also the cell formatting informations.
 +
Default to 'true'.
 +
|-
 +
| type || fixed || This attribute must assume the value '''call'''
 +
|}
  
== Example use ==
+
The following example shows the configuration generated from {{L_VULCON}} or {{L_GVCONSOLE}} when you configure an ''excelreader-call'' operation:
<ol>
 
  <li>Gvvcl-excel with a simple excel
 
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
 
  
----
+
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 +
<GVSystems name="SYSTEMS" type="module">
 +
    <Systems>
 +
        <System id-system="system-name" system-activation="on">
 +
            <Channel id-channel="CHANNEL_NAME">
 +
                <excelreader-call class="it.greenvulcano.gvesb.virtual.excel.reader.GVExcelReaderCallOperation"
 +
                                  name="ReadExcelInput" type="call" onlyData="true"/>
 +
            </Channel>   
 +
        </System>
 +
    </Systems>
 +
</GVSystems>
 +
</syntaxhighlight>
  
'''''Input'''''
 
[[File:InputSimpleExcel.jpg]]
 
'''''Output'''''
 
[[File:OutputSimpleExcel.xml]]
 
  
</li>
+
To use an ''excelreader-call'' in a {{GVESB}} service, you need to define a node of type [[GVOperationNode]] in [[Service|Service section]] and define in the field ''operation-name'' the name defined in ''excelreader-call'' operation.
  <li>Gvvcl-excel with a complex excel
 
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
 
  
----
+
The following example shows the configuration generated from {{L_VULCON}} or {{L_GVCONSOLE}} when you configure an ''excelreader-call'' operation in {{GVESB}} service:
  
'''''Input'''''
+
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
[[File:InputComplexExcel.jpg]]
+
<GVServices name="SERVICES" type="module">
'''''Output'''''
+
    <Groups>
[[File:OutputComplexExcel.jpg]]
+
        <Group group-activation="on" id-group="DEFAULT_GRP"/>
</li>
+
    </Groups>
</ol>
+
    <Services>
 +
        <Service group-name="DEFAULT_GRP" id-service="SERVICE-NAME"
 +
                service-activation="on">
 +
            <Client id-system="SYSTEM-NAME" statistics="off" system-activation="on">
 +
                <Operation name="RequestReply" operation-activation="on"
 +
                          out-check-type="none" type="operation">
 +
                    <Participant id-channel="CHANNEL-NAME" id-system="SYSTEM-NAME"/>
 +
                    <Flow first-node="excel_reader" point-x="20" point-y="112">
 +
                        <GVOperationNode class="it.greenvulcano.gvesb.core.flow.GVOperationNode"
 +
                                        id="excel_reader" id-system="DAMA"
 +
                                        input="input" next-node-id="end"
 +
                                        op-type="call"
 +
                                        operation-name="ReadExcelInput"
 +
                                        output="excel_xml" point-x="158"
 +
                                        point-y="112" type="flow-node"/>
 +
                        <GVEndNode class="it.greenvulcano.gvesb.core.flow.GVEndNode"
 +
                                  end-business-process="yes" id="end" op-type="end"
 +
                                  output="excel_xml" point-x="358" point-y="112"
 +
                                  type="flow-node"/>
 +
                    </Flow>
 +
                </Operation>
 +
            </Client>   
 +
        </Service>
 +
    </Services>
 +
</GVServices>
 +
</syntaxhighlight>
 +
 
 +
 
 +
At this point you have configured a service with an ''excelreader-call'' operation.
 +
 
 +
==Example==
 +
This example shows an XML document generated by a simple Excel sheet (without cols and rows grouping).
 +
Given an Excel sheet with the following structure:
 +
{| class="gvtable"
 +
|-
 +
! ID1
 +
! ID2
 +
! ID3
 +
! ID4
 +
! ID5
 +
! ID6
 +
! ID7
 +
|-
 +
| 23
 +
| 23232
 +
| 23
 +
| 23333
 +
| 1
 +
| 2
 +
| 3
 +
|-
 +
| 24
 +
| 24444
 +
| 23
 +
| 23332
 +
| 1
 +
| 2
 +
| 3
 +
|}
 +
''excelreader-call'' generates the following XML:
 +
 
 +
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 +
<workbook>
 +
    <sheet number="0">
 +
        <name><![CDATA[Foglio1]]></name>
 +
        <row number="0">
 +
            <col number="0">
 +
                <data><![CDATA[ID1]]></data>
 +
            </col>
 +
            <col number="1">
 +
                <data><![CDATA[ID2]]></data>
 +
            </col>
 +
            <col number="2">
 +
                <data><![CDATA[ID3]]></data>
 +
            </col>
 +
            <col number="3">
 +
                <data><![CDATA[ID4]]></data>
 +
            </col>
 +
            <col number="4">
 +
                <data><![CDATA[ID5]]></data>
 +
            </col>
 +
            <col number="5">
 +
                <data><![CDATA[ID6]]></data>
 +
            </col>
 +
            <col number="6">
 +
                <data><![CDATA[ID7]]></data>
 +
            </col>
 +
        </row>
 +
        <row number="1">
 +
            <col number="0">
 +
                <data><![CDATA[23]]></data>
 +
            </col>
 +
            <col number="1">
 +
                <data><![CDATA[23232]]></data>
 +
            </col>
 +
            <col number="2">
 +
                <data><![CDATA[23]]></data>
 +
            </col>
 +
            <col number="3">
 +
                <data><![CDATA[711]]></data>
 +
            </col>
 +
            <col number="4">
 +
                <data><![CDATA[1]]></data>
 +
            </col>
 +
            <col number="5">
 +
                <data><![CDATA[1]]></data>
 +
            </col>
 +
            <col number="6">
 +
                <data><![CDATA[1]]></data>
 +
            </col>
 +
        </row>
 +
        <row number="2">
 +
            <col number="0">
 +
                <data><![CDATA[23]]></data>
 +
            </col>
 +
            <col number="1">
 +
                <data><![CDATA[711]]></data>
 +
            </col>
 +
            <col number="2">
 +
                <data><![CDATA[23]]></data>
 +
            </col>
 +
            <col number="3">
 +
                <data><![CDATA[23232]]></data>
 +
            </col>
 +
            <col number="4">
 +
                <data><![CDATA[1]]></data>
 +
            </col>
 +
            <col number="5">
 +
                <data><![CDATA[1]]></data>
 +
            </col>
 +
            <col number="6">
 +
                <data><![CDATA[1]]></data>
 +
            </col>
 +
        </row>
 +
    </sheet>
 +
</workbook>
 +
</syntaxhighlight>
 +
 
 +
With a [[ChangeGVBufferNode]] is possible parsing XML and retrieve any tag and value.

Latest revision as of 12:14, 27 February 2012

Definition

Many IT applications, within their business process, need to read an Excel file. ExcelReaderCall plug-in helps IT organizations integrating applications that use Excel format to execute their business.

ExcelReaderCall plug-in is compatible with all Excel formats up to version 2003, and it is very simple to configure. It receives in input a binary stream containing the Excel file, and returns in output a corresponding XML structure.

To the output of ExcelReaderCall plug-in it is possible to apply a ChangeGVBufferNode operation (with OGNL script or an XSL transformation) to retrieve all interested data.

GreenVulcano® ESB provides two different tools, GV Console® and VulCon®, to configure all supported plug-ins.

VulCon / GV Console Configuration

excelreader-call is the operation that must be configured into VulCon® or GV Console® System section, to convert an Excel file in GVBuffer.object field, in an XML document.

In order to add an operation excelreader-call you must define the following fields:

Attribute Type Description
class fixed it.greenvulcano.gvesb.virtual.excel.reader.GVExcelReaderCallOperation

(java class that manage ExcelReaderCall invocation).

name required This field identify the operation name that you will use in service definition.
onlyData optional It is a boolean field, enabled in output cell formatting informations.

If 'false', inserts in the XML document also the cell formatting informations. Default to 'true'.

type fixed This attribute must assume the value call

The following example shows the configuration generated from VulCon® or GV Console® when you configure an excelreader-call operation:

<?xml version="1.0" encoding="UTF-8"?>
<GVSystems name="SYSTEMS" type="module">
    <Systems>
        <System id-system="system-name" system-activation="on">
            <Channel id-channel="CHANNEL_NAME">
                <excelreader-call class="it.greenvulcano.gvesb.virtual.excel.reader.GVExcelReaderCallOperation"
                                  name="ReadExcelInput" type="call" onlyData="true"/>
            </Channel>    
        </System>
    </Systems>
</GVSystems>


To use an excelreader-call in a GreenVulcano® ESB service, you need to define a node of type GVOperationNode in Service section and define in the field operation-name the name defined in excelreader-call operation.

The following example shows the configuration generated from VulCon® or GV Console® when you configure an excelreader-call operation in GreenVulcano® ESB service:

<?xml version="1.0" encoding="UTF-8"?>
<GVServices name="SERVICES" type="module">
    <Groups>
        <Group group-activation="on" id-group="DEFAULT_GRP"/>
    </Groups>
    <Services>
        <Service group-name="DEFAULT_GRP" id-service="SERVICE-NAME"
                 service-activation="on">
            <Client id-system="SYSTEM-NAME" statistics="off" system-activation="on">
                <Operation name="RequestReply" operation-activation="on"
                           out-check-type="none" type="operation">
                    <Participant id-channel="CHANNEL-NAME" id-system="SYSTEM-NAME"/>
                    <Flow first-node="excel_reader" point-x="20" point-y="112">
                        <GVOperationNode class="it.greenvulcano.gvesb.core.flow.GVOperationNode"
                                         id="excel_reader" id-system="DAMA"
                                         input="input" next-node-id="end"
                                         op-type="call"
                                         operation-name="ReadExcelInput"
                                         output="excel_xml" point-x="158"
                                         point-y="112" type="flow-node"/>
                        <GVEndNode class="it.greenvulcano.gvesb.core.flow.GVEndNode"
                                   end-business-process="yes" id="end" op-type="end"
                                   output="excel_xml" point-x="358" point-y="112"
                                   type="flow-node"/>
                    </Flow>
                </Operation>
            </Client>    
        </Service>
    </Services>
</GVServices>


At this point you have configured a service with an excelreader-call operation.

Example

This example shows an XML document generated by a simple Excel sheet (without cols and rows grouping). Given an Excel sheet with the following structure:

ID1 ID2 ID3 ID4 ID5 ID6 ID7
23 23232 23 23333 1 2 3
24 24444 23 23332 1 2 3

excelreader-call generates the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<workbook>
    <sheet number="0">
        <name><![CDATA[Foglio1]]></name>
        <row number="0">
            <col number="0">
                <data><![CDATA[ID1]]></data>
            </col>
            <col number="1">
                <data><![CDATA[ID2]]></data>
            </col>
            <col number="2">
                <data><![CDATA[ID3]]></data>
            </col>
            <col number="3">
                <data><![CDATA[ID4]]></data>
            </col>
            <col number="4">
                <data><![CDATA[ID5]]></data>
            </col>
            <col number="5">
                <data><![CDATA[ID6]]></data>
            </col>
            <col number="6">
                <data><![CDATA[ID7]]></data>
            </col>
        </row>
        <row number="1">
            <col number="0">
                <data><![CDATA[23]]></data>
            </col>
            <col number="1">
                <data><![CDATA[23232]]></data>
            </col>
            <col number="2">
                <data><![CDATA[23]]></data>
            </col>
            <col number="3">
                <data><![CDATA[711]]></data>
            </col>
            <col number="4">
                <data><![CDATA[1]]></data>
            </col>
            <col number="5">
                <data><![CDATA[1]]></data>
            </col>
            <col number="6">
                <data><![CDATA[1]]></data>
            </col>
        </row>
        <row number="2">
            <col number="0">
                <data><![CDATA[23]]></data>
            </col>
            <col number="1">
                <data><![CDATA[711]]></data>
            </col>
            <col number="2">
                <data><![CDATA[23]]></data>
            </col>
            <col number="3">
                <data><![CDATA[23232]]></data>
            </col>
            <col number="4">
                <data><![CDATA[1]]></data>
            </col>
            <col number="5">
                <data><![CDATA[1]]></data>
            </col>
            <col number="6">
                <data><![CDATA[1]]></data>
            </col>
        </row>
    </sheet>
</workbook>

With a ChangeGVBufferNode is possible parsing XML and retrieve any tag and value.