Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1227

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
<!--- Initialize the form.eventID to 0, to indicate a new event. --->
<!--- The EventID field is a hidden field managed by this application. --->
<cfparam name="form.eventID" default="0">
<!--- If the form was submitted, populate an event structure from it. --->
<cfif isDefined("Form.Submit")>
<cfscript>
sEvent=StructNew();
sEvent.AllDayEvent="false";
sEvent.Subject=Form.subject;
if (IsDefined("Form.allDay")) {
sEvent.AllDayEvent="true";
sEvent.StartTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), 8, 0, 0);
}
else {
sEvent.StartTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), Hour(Form.startTime), Minute(Form.startTime), 0);
sEvent.EndTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), Hour(Form.endTime), Minute(Form.endTime), 0);
}
sEvent.Location=Form.location;
sEvent.RequiredAttendees=Form.requiredAttendees;
sEvent.OptionalAttendees=Form.optionalAttendees;
//sEvent.Resources=Form.resources;
if (Form.reminder NEQ "") {
sEvent.Reminder=Form.reminder;
}
else {
sEvent.Reminder=0;
}
sEvent.Importance=Form.importance;
sEvent.Sensitivity=Form.sensitivity;
sEvent.message=Form.Message;
</cfscript>
<!--- If the form is being submitted for the first time,
create an event. --->
<cfif form.eventID EQ 0>
<!--- Create the event in Exchange --->
<cfexchangecalendar action="create"
username ="#user1#"
password="#password1#"
server="#exchangeServerIP#"
event="#sEvent#"
result="theUID">
<!--- Display the new event UID and set form.eventID to it. --->
<cfif isDefined("theUID")>
<cfoutput>Event Added. UID is #theUID#</cfoutput>
<cfset Form.eventID = theUID >
</cfif>
<cfelse>
<!--- The form is being resubmitted with new data; update the event. --->
<cfexchangecalendar action="modify"
username ="#user1#"
password="#password1#"
Last updated 1/20/2012
1222

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents