ColdFusion 9.0 Resources |
cfexchangetaskDescriptionCreates, deletes, modifies, and gets Microsoft Exchange tasks, and gets task attachments. Note: For all actions, see cfexchangeconnection for
additional attributes that you use if you do not specify the connection
attribute.
Syntaxcreate <cfexchangetask required action = "create" task = "#task information structure#" optional connection = "connection ID" result = "variable for event UID"> delete <cfexchangetask required action = "delete" uid = "task UID,task UID, ..." optional connection = "connection ID"> deleteAttachments <cfexchangetask required action = "deleteAttachments" uid = "task UID" optional connection = "connection ID"> get <cfexchangetask required action = "get" name = "query identifier" optional connection = "connection ID"> getAttachments <cfexchangetask required action = "getAttachments" name = "query identifier" uid = "task UID" optional attachmentPath = "directory path" connection = "connection ID" generateUniqueFilenames = "no|yes"> modify <cfexchangetask required action = "modify"" task = "#task information structure#" uid = "task UID"> optional connection = "connection ID"> Note: If
you omit the connection attribute, create a temporary
connection by specifying cfexchangeconnection tag
attributes in the cfexchangetask tag. In this case,
ColdFusion closes the connection when the tag completes. For details,
see the cfexchangeconnection tag open action.
Note: You can specify this tag's attributes in an attributeCollection attribute
whose value is a structure. Specify the structure name in the attributeCollection attribute
and use the tag’s attribute names as structure keys.
See alsocfexchangecalendar, cfexchangeconnection,cfexchangecontact, cfexchangefilter, cfexchangemail, Interacting with Microsoft Exchange Servers in the Developing ColdFusion Applications. AttributesThe following table provides detailed information about each attribute. It lists the attribute name, the actions (action attribute values) to which it apples, whether it is required or optional for those actions, and its default value, if any, and provides a detailed description of the attribute and its valid values.
When you specify the create or modify action, the task attribute must specify a structure that contains information that defines the events. The structure can have the following fields. Include only the fields that you are setting or changing.
UsageThe cfexchangetask tag manages task records on the Exchange server. Use the cfexchangetask tag to perform the following actions:
To use this tag, you must have a connection to an Exchange server. If you are using multiple tags that interact with the exchange server, such as if you are creating several task records, use the cfexchangeconnection tag to create a persistent connection. You then specify the connection identifier in each cfexchangetask, or any other ColdFusion Exchange tag, if you are also accessing calendar entries, contacts, or mail. Doing this saves the overhead of creating and closing the connection for each tag. Alternatively, you can create a temporary connection that lasts only for the time that ColdFusion processes the single cfexchangetask tag. To do this, you specify the connection attributes directly in the cfexchangetask tag. For details on the connection attributes, see the cfexchangeconnection tag. The delete actionWhen you specify the delete action, specify a uid attribute with a comma-delimited list of one or more Exchange UIDs that identify the tasks to delete. You can use the get action, with an appropriate filter expression, to determine the UID values to specify. If all UIDs that you specify are invalid, the cfexchangetask tag generates an error. If at least one UID is valid, the tag ignores any invalid UIDs and deletes the items specified by the valid UID. The get actionWhen you specify the get action, the query object specified by the name attribute contains one record for each retrieved task. The query object has columns with the same names and data formats as the fields listed for the task attribute structure, with the following differences:
You use child cfexchangefilter tags to specify the messages to get. For detailed information, see cfexchangefilter. The getAttachments actionWhen you use the getAttachments action, specify a single UID and a name attribute. The cfexchangetask tag populates a query object specified by the name attribute with the specified name. Each record has the following information about an attachment to the specified task:
The tag places the attachments in the directory specified by the attachmentPath attribute. If you omit the attachmentPath attribute, ColdFusion does not get any attachments, it gets the information about the attachments. This lets you determine the attachments without incurring the overhead of getting the attachment files. Use the following syntax to specify an in-memory attachmentPath directory. In-memory files are not written to disk and speed processing of transient data. attachmentpath = "ram:///path" The path can include multiple directories, for example ram:///petStore/orders/messageAttachments. Create all directories in the path before you specify the file. For more information on using in-memory files, see Optimizing transient files in the Developing ColdFusion Applications. The getAttachments action works only if authentication for EWS (Exchange Web Services) is set to basic in the server setup of Exchange. IWA (Integrated Windows Authentication) is not supported. The modify actionIf you specify the modify action, the uid attribute must specify a single Exchange UID. The task structure must specify only the fields that you are changing. Any fields that you do not specify remain unchanged. For a detailed description of the contents of the task structure, see the Attributes section. If a task has attachments and you specify attachments when you modify the task, the new attachments are added to the previous attachments, and do not replace them. Use the deleteAttachments action to remove any attachments. ExampleThe following example uses a transient connection to create a single task: <!--- Create a structure with the task fields ---> <cfscript> stask=StructNew(); stask.Priority="high"; stask.Status="Not_Started"; stask.DueDate="3:00 PM 09/14/2007"; stask.Subject="My New Task"; stask.PercentCompleted=0; Message="Do this NOW!"; </cfscript> <!--- Create the task using a transient connection. ---> <cfexchangetask action="create" username ="#user1#" password="#password1#" server="#exchangeServerIP#" task="#stask#" result="theUID"> <!--- display the UID to confirm that the action completed. ---> <cfdump var="#theUID#"> |