Difference between revisions of "TestFileAttachment"

From GreenVulcano Wiki
Jump to: navigation, search
Line 30: Line 30:
 
:: filePattern=".*"  
 
:: filePattern=".*"  
 
:: returnFullPath="true"
 
:: returnFullPath="true"
:: sourcePath="${{gv.app.home}}/TEST/TESTFS/TestAttach/input"
+
:: sourcePath="<nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestAttach/input"
 
|}
 
|}
 
* [[filemanager-call]]
 
* [[filemanager-call]]
Line 37: Line 37:
 
|-
 
|-
 
| name || MoveAttachments
 
| name || MoveAttachments
|-
+
FileCommands:
| FileCommands:
 
 
: FileMoveCommand:
 
: FileMoveCommand:
 
:: filePattern=".*"
 
:: filePattern=".*"
:: sourcePath="${{gv.app.home}}/TEST/TESTFS/TestAttach/input"
+
:: sourcePath="<nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestAttach/input"
:: targetPath="${{gv.app.home}}/TEST/TESTFS/TestAttach/sent"
+
:: targetPath="<nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestAttach/sent"
 
|}
 
|}
 
* [[smtp-call]]  
 
* [[smtp-call]]  
Line 57: Line 56:
 
::: mail-address: address="gv2@gv.com"/>
 
::: mail-address: address="gv2@gv.com"/>
 
: message-body: gvBuffer-dump="false">
 
: message-body: gvBuffer-dump="false">
:: message-text: ${&apos;Attachment file list:\n&apos;+property[&apos;GV_SMTP_ATTACHMENTS&apos;]}</message-text>
+
:: message-text: ${'Attachment file list:\n'+property['GV_SMTP_ATTACHMENTS']}
 
|}
 
|}
  
[[File:GVExamplesTestFileAttachment.jpg|thumb|TestFileAttachment flow]]
+
[[File:GVExamplesTestFileAttachmentFlow.jpg|thumb|TestFileAttachment flow]]

Revision as of 15:46, 15 February 2012

Description

TestFileAttachment description

This example shows how use GreenVulcano® ESB to send an email containing attachments.


TestFileAttachment services executes the following operations:

  • Reads a file from a directory of input (in this case TestAttach/input)
  • Sends an email with this file as attachment
  • Moves sent file to another directory (we choose TestAttach/sent)

VulCon Configuration

To configure TestFileAttachment service follow these steps:

  1. Define the System, Channel and Operations required
  2. Define the Services
  3. Implement the flows.

Defining System, Channel and Operations

To define a System, go to VulCon core view and, into Systems element, insert the System GVESB if it is not already present. Inside of it create the Channel TEST_CHANNEL_FILE in which the following operations will be configured:

Attribute/Subelement Value
name ScanAttachments

FileCommands:

FileSearchCommand
filePattern=".*"
returnFullPath="true"
sourcePath="${{gv.app.home}}/TEST/TESTFS/TestAttach/input"
Attribute/Subelement Value
name MoveAttachments

FileCommands:

FileMoveCommand:
filePattern=".*"
sourcePath="${{gv.app.home}}/TEST/TESTFS/TestAttach/input"
targetPath="${{gv.app.home}}/TEST/TESTFS/TestAttach/sent"
Attribute Value
jndi-name gvesb.mailServer
name SendEmail
mail-message content-type="text-html"
high-priority="true"
sender-display-name="GV ESB"
subject="Test send attachments"
destinations:
to:
mail-address: address="gv2@gv.com"/>
message-body: gvBuffer-dump="false">
message-text: ${'Attachment file list:\n'+property['GV_SMTP_ATTACHMENTS']}
TestFileAttachment flow