Skip to content

Instantly share code, notes, and snippets.

@justinbarry
Created July 22, 2011 01:04
Show Gist options
  • Save justinbarry/1098616 to your computer and use it in GitHub Desktop.
Save justinbarry/1098616 to your computer and use it in GitHub Desktop.
<cfcomponent hint="I this is a sample CFC that handles generic Events">
<cffunction name="onEvent" access="public" hint="I handle incomming events from an event gateway." output="false" returntype="void">
<cfargument name="CFEvent" hint="I am the cfevent structure" required="true" type="struct" />
<!---<cfset var EventMessageClass = CreateObject("Java", "java.lang.Class").forName("com.alagad.ImapWatcher.EventMessage") />
<cfdump var="#EventMessageClass#" output="console" />--->
<cfset var Message = CFEvent.data.message />
<cfset var x = 0 />
<cfset var attachment = 0 />
test
<cffile action = "write"
file = "c:\inetput\wwwroot\jira_issue_creator\log.txt"
output = "Created on: #now()#">
<!---
<cflog text="Incomming Message Received:" />
<cflog text="Subject: #Message.getSubject()#" />
<cflog text="From: #Message.getFrom()#" />
<cflog text="To: #Message.getToList()#" />
<cflog text="CC: #Message.getCCList()#" />
<cflog text="Text Body: #Message.getText()#" />
<cflog text="HTML Body: #Message.getHTml()#" />
<cflog text="Attachments: #Message.getAttachments().size()#" />
<cfloop from="0" to="#Message.getAttachments().size()#" index="x">
<cfset attachment = Message.getAttachments().get(x) />
<cflog text="Attachment #x# filename: #attachment.getFileName()#" />
<cfset attachment.writeToDisk("/Users/dhughes/Desktop/temp") />
</cfloop>
---!>
<!---<cfdump var="#arguments.CFEvent#" output="console" />--->
</cffunction>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment