CFML Reference
|
|
ColdFusion Tags
|
cfschedule
Description
Provides a programmatic interface to the ColdFusion scheduling engine. You can run a specified page at scheduled intervals with the option to write out static HTML pages. This lets you offer users access to pages that publish data, such as reports, without forcing users to wait while a database transaction is performed in order to populate the data on the page.
ColdFusion scheduled events are registered using the ColdFusion Administrator. Execution of cfschedule
can be disabled in the Administrator.
Information supplied by the user includes the scheduled ColdFusion page to execute, the time and frequency for executing the page, and whether the output from the task is published. If the output is published, a path and file are specified.
The event submission and its success or failure status is written to the \cfusion\log\schedule.log
file.
Category
Variable manipulation tags
Syntax
<cfschedule action = "update"
task = "taskname"
operation = "HTTPRequest"
file = "filename"
path = "path_to_file"
startDate = "date"
startTime = "time"
url = "URL"
publish = "Yes" or "No"
endDate = "date"
endTime = "time"
interval = "seconds"
requestTimeOut = "seconds"
username = "username"
password = "password"
resolveURL = "Yes" or "No"
proxyServer = "hostname"
port = "port_number"
proxyPort = "port_number">
<cfschedule action = "delete" task = "TaskName">
<cfschedule action = "Run" task = "TaskName">
See also
cfcookie,
cfparam,
cfregistry,
cfsavecontent,
cfset
Attributes
Attribute |
Description |
action
|
Required. Valid entries are:
delete - Deletes task specified by task
update - Creates a task if one does not exist
run - Executes task specified by task
|
task
|
Required. The name of the task to delete, update, or run.
|
operation
|
Required when creating tasks with action = "update" . The type of operation the scheduler performs when executing this task. Only operation = "HTTPRequest" is supported for static page generation.
|
file
|
Required with publish = "Yes." A valid filename for the published file.
|
path
|
Required with publish = "Yes." The path location for the published file.
|
startDate
|
Required when action = "update" . The date when scheduling of the task should start.
|
startTime
|
Required when creating tasks with action = "update" . Enter a value in seconds. The time when scheduling of the task starts.
|
url
|
Required when action = "update" . The URL to be executed.
|
publish
|
Optional. Yes or No. Specifies whether the result should be saved to a file.
|
endDate
|
Optional. The date when the scheduled task ends.
|
endTime
|
Optional. The time when the scheduled task ends. Enter a value in seconds.
|
interval
|
Required when creating tasks with action = "update" . Interval at which task should be scheduled. Can be set in seconds or as Once, Daily, Weekly, and Monthly. The default interval is one hour. The minimum interval is one minute.
|
requestTimeOut
|
Optional. Customizes the requestTimeOut for the task operation. Can be used to extend the default timeout for operations that require more time to execute.
|
username
|
Optional. Username if URL is protected.
|
password
|
Optional. Password if URL is protected.
|
proxyServer
|
Optional. Host name or IP address of a proxy server.
|
resolveURL
|
Optional. Yes or No. Specifies whether to resolve links in the result page to absolute references.
|
port
|
Optional. The port number on the server from which the task is being scheduled. Default is 80. When used with resolveURL , the URLs of retrieved documents that specify a port number are automatically resolved to preserve links in the retrieved document.
|
proxyPort
|
Optional. The port number on the proxy server from which the task is being requested. Default is 80. When used with resolveURL , the URLs of retrieved documents that specify a port number are automatically resolved to preserve links in the retrieved document.
|
Usage
You cannot use cfschedule
and apply the Secure Sockets Layer (SSL) to an application.
Example
<!--- This example shows an example of cfschedule --->
<html>
<head>
<title>cfschedule Example</title>
</head>
<body>
<H3>cfschedule Example</H3>
<P>cfschedule provides a programmatic interface to
the ColdFusion scheduling engine. You can run a specified
page at scheduled intervals with the option to write out
static HTML pages. This allows you to offer users access
to pages that publish data, such as reports, without
forcing users to wait while a database transaction is performed
to populate the data on the page.
<cfschedule action = "update"
task = "TaskName"
operation = "HTTPRequest"
url = "http://127.0.0.1/playpen/history.cfm"
startDate = "8/7/98"
startTime = "12:25 PM"
interval = "3600"
resolveURL = "Yes"
publish = "Yes"
file = "sample.html"
path = "c:\inetpub\wwwroot\playpen"
requestTimeOut = "600">
</body>
</html>
Copyright © 2001, Macromedia Inc. All rights reserved. |
|