Working with Exchange

Comments

There aren't any comments for this presentation.

Add Comment

Comments have been closed.

Transcript

no image

Slide Text

Slide Notes


Slide 1


Using ColdFusion with Exchange
Scott Stroz

no notes exist for this slide

Slide 2


Introduction
Who am I?
Senior Software Architect for Alagad.
Web developer for over 7 years.
ColdFusion Developer since ColdFusion 5.
Adobe Community Expert
Author of Flogr
A Flex based tool for viewing ColdFusion log files.
Developing in Flex since version 1.5.

no notes exist for this slide

Slide 3


What Will We Cover?
Getting Exchange Set-up to Talk with CF
Connecting to Exchange from CF
Retrieving and Managing Exchange folders and Items
Using <cfexchagefilter>
When might this be useful?

no notes exist for this slide

Slide 4


Getting Exchange Set-Up to Talk to CF
The Microsoft Exchange Server and Web-based Distributed Authoring and Versioning (WebDAV) are configured in the Internet Information Server (IIS). This is done on the server that is running Exchange.

no notes exist for this slide

Slide 5


Getting Exchange Set-Up to Talk to CF
The Exchange server enables Outlook Web Access to all login users.

no notes exist for this slide

Slide 6


Getting Exchange Set-Up to Talk to CF
If you are using HTTPS to log into your Exchange server, you must have a valid client certificate in the Java Runtime Environment (JRE) certificate store.

no notes exist for this slide

Slide 7


Connecting to Exchange From ColdFusion
You can connect to an Exchange Server using either transient or persistent connections.
Transient - will only exist for the duration of the tag used to interact with the Exchange server.
Can be used when you need to have access to the Exchange server for only one task or tag, such as retrieving a list of tasks.

no notes exist for this slide

Slide 8


Connecting to Exchange From ColdFusion
Transient connections can be used by specifying server, username and password inside of cfexchangecontact, cfexchnagetask, cfexchangecalendar
<cfexchangecontact
action="get"
name="myContacts"
server="#request.servername#"
username="#request.user#"
password="#request.password#" />

no notes exist for this slide

Slide 9


Connecting to Exchange From ColdFusion
Persistent connections will remain open until they are explicitly closed. These connections enable you to use a single connection for multiple tasks, and save processing overhead from having to reopen connections for each interaction with the Exchange server.

no notes exist for this slide

Slide 10


Connecting to Exchange From ColdFusion
You use persistent connections by using the <cfexchangeconnection> tag.
You must specifically close the connection or else CF will throw an error.
<cfexchangeconnection action="open" connection="myExchangeConnection"
server="#serverName#"
username="#username#"
password="#password#" />
<cfexchangeconnection action="close" connection="myExchangeConnection" />

Show persistent connection demo file01.cfm

Slide 11


Connecting to Exchange From ColdFusion
You will need the following information to connect to the Exchange server:
The IP address or domain name of the Exchange server
A username of a user with access to Exchange
The user's password
Optionally, a mailbox name to which you will connect

no notes exist for this slide

Slide 12


Connecting to Exchange From ColdFusion
By default, ColdFusion will connect to the mailbox used by the user specified in the username attribute. If this user has been delegated access to another user's account, this account may be specified in the mailbox attribute.
<cfexchangecontact action="get"
name="myContacts"
server="mail.mydomain.com"
username="scooter"
password="p@ssw0rd"
mailbox=”skippy” />

no notes exist for this slide

Slide 13


Retrieving Folder Info
You can retrieve information about any folders for the mail box you are using.
Folder name
Folder Path
Folder size
Information returned as a ColdFusion query object.
<cfexchangeconnection
action="getSubfolders" connection="myExchangeConnection" name="folderInfo"
recurse="yes">

no notes exist for this slide

Slide 14


Retrieving Folder Info
You can retrieve information about specific folders by specifying the folder attribute.
<cfexchangeconnection action="getSubFolders" connection="myExchangeConnection" name="InboxInfo"
recurse="yes"
folder="Inbox">

Show demo - file02.cfm

Slide 15


Retrieving Mail Items
We can list and modify existing mail items, but to send mail, we still need to use <cfmail>
To retrieve mail items, we use the <cfexchangemail> tag.
<cfexchangemail
action="get" connection="myExchangeConnection" name="myMail" >

Show demo file03.cfm

Slide 16


<cfexchangefilter>
Whenever yo retrieve information from Exchange, you can filter the results using <cfexchangefilter>
<cfexchangefilter
name = "filter type"
value = "filter value">
For dates:
<cfexchangefilter
name = "filter type"
from = "date/time"
to = "date/time">

show demo file04.cfm

Slide 17


Mail Attachments
You can retrieve attachments to mail items by using the getAttachments action and passing in the UID of the mail item.
If you don’t specify the attachmentPath, CF will only retreive information about attachments and not the attachments themselves.

no notes exist for this slide

Slide 18


Mail Attachments
<cfexchangemail action="getAttachments" uid="#myMail.UID#"
attachmentPath=
"#expandPath("attachments")#"
name="myAttachments" connection="myExchangeConnection" />

Show get attachments demo - file05.cfm

Slide 19


Modifying Mail Items
To modify a mail item, we use the set action and pass a ColdFusion structure as the message attribute.
You only include the values you wish to be changed.
We can only change the following values for mail items:
IsRead - yes, no
importance - high, normal, low
Sensitivity -normal, company-confidential, personal, private

Show demo - file06.cfm

Slide 20


Retrieving Tasks
We use the <cfexchangetask> tag with the get action to retrieve one or more task items.
<cfexchangetask
action="get"
connection="myExchangeConnection"
name="myTasks" >
We use the UID attribute to retrieve a specific task.

show demo file07.cfm

Slide 21


Modifying Tasks
To update a task we use the modify action and pass in the UID of the task and specify the task attribute.
The task attribute takes a structure of the values that you wish to modify.
<cfset taskProps = structNew() />
<cfset taskProps.percentCompelted = 100 />
<cfexchangetask action="modify" task="#newTaskProps#"
uid="{task UID}" connection="myExchangeConnection" />

Show demo file08.cfm

Slide 22


Creating Tasks
To create a task, we use the create action and pass in a structure to the task attribute.
<cfscript>
newTask = structNew();
newTask.startDate = dateAdd('d',2,Now());
newTask.dueDate= dateAdd('d',14,Now());
newTask.reminderDate = dateAdd('d',10,Now());
newTask.message = "This is the message for our ColdFusion generated task";
newTask.subject = "Call Adobe about how cool <cfexchange> is.";
newTask.priority = "high";
newTask.status = "In_Progress";
</cfscript>

<cfexchangetask action="create" connection="myExchangeConnection" result="myNewTask" task="#newTask#">

no notes exist for this slide

Slide 23


Retrieving Contacts &
Calendar Items
The process and syntax for retrieving, modifying and creating contacts and calendal items are similar to that of tasks.
Retrieving Contacts
<cfexchangecontact action="get"
connection="myExchangeConnection"
name="myContacts" >
Retrieving Calendar Items
<cfexchangecalendar action="get"
connection="myExchangeConnection"
name="myEvents" >

no notes exist for this slide

Slide 24


Modifying Contacts &
Calendar Items
Contacts - we use the contact attribute.
The contact attribute is a structure containing the data you wish to modify.
Calendar Items - we use the event attribute.
The event attribute is a structure containing the data you wish to modify.

no notes exist for this slide

Slide 25


Creating Contacts &
Calendar Items
Contacts - we use the contact attribute.
The contact attribute is a structure containing the data you wish to modify.
Calendar Items - we use the event attribute.
The event attribute is a structure containing the data you wish to modify.

show demo file11.cfm & file12.cfm

Slide 26


Recurring Tasks or Events
You can specify if an event or task is recurring.
You have as fine of control over the frequency as you would in Outlook.
To go over all the possible combinations could probably take up a full day session.

no notes exist for this slide

Slide 27


Recurring Tasks or Events
ReccurenceType - daily, weekly, monthly, yearly
RecurrenceCount - the number of times event will occur
RecurrenceFrequency - the frequency of the event, in days
Recurrencedays - what days event will occur on (MON, TUE, ect)
RecurrenceWeek - used to specify ‘the second Tuesday of each month’

no notes exist for this slide

Slide 28


Recurrence Examples
Every 3 days for 20 occurrences:
IsRecurring="true";
RecurrenceType="DAILY";
RecurrenceCount="20";
RecurrenceFrequency="3";
Third Thursday of every other month
IsRecurring="true";
RecurrenceType="Monthly";
RecurrenceFrequency="3";
RecurrenceWeek="third";
RecurrenceDay="THU";

no notes exist for this slide

Slide 29


Questions?

no notes exist for this slide

Slide 30


Resources
http://www.adobe.com/devnet/coldfusion/articles/cfexchange.html
http://livedocs.adobe.com/coldfusion/8/htmldocs/cfexchange_1.html

no notes exist for this slide