[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 481
  • Last Modified:

Create cfschedule page

I need to create a scheduler "cfschedule" page.  I'd like for the user to select a directory on the server and schedule a date for cf to perform an action from a specified page.   Does anyone have any experience w/ this cf form action?

Thanks in Advance.
0
sl1nger
Asked:
sl1nger
  • 6
  • 5
1 Solution
 
sl1ngerAuthor Commented:
Does anyone have a working example using the cfschedule?  I could use this as a good starting point.
0
 
trailblazzyr55Commented:
Here are a few resources to look at regarding cfschedule that may help you get started using it, they have code examples as well as how to apply it, have a look...

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-a30.htm
http://www.projectpower.com/cfdocs/CFML_Reference/Tags-pt229.html
http://csis.pace.edu/~ctappert/cs615-02/support/Help/CFML_Language_Reference/lang_0285.htm
http://www.cfhub.com/advanced/cfschedule/

regards,
~trail
0
 
sl1ngerAuthor Commented:
Do you know if it's possible to display task items, as they are scheduled?
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
sl1ngerAuthor Commented:
Also, I'm looking for a good way to select a directory path...  All help appreciated..
0
 
trailblazzyr55Commented:
I would say the best way is to setup dynamic variables for the cfschedule, that way you can use those variables to define what task as well as use those variable to display the task like in a confirmation page.

Like this..

Your forms for creating the schedule
__________________________________
<input type="text" name="actionValue" value=""> ......etc
------------------------------------------------

Then you could use cfparams to make sure if a required element is not filed in it is automatically defauklted to a value...
------------------------------------------------
<cfparam name="actionValue" default="update">...... etc
-------------------------------------------------

Then submit that form when it's filled out with all the params you want in the cfschedule to your action page.


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
On your action page get those values to setup the cfschedule I'm not going to go down the list of attributes for the tag, but I'll do the first one...

You may also want to use sessions, that way if they go back they still have the forms filled in, anyway then use the form values to setup your schedule and also insert them to a table in your database, this way you can reference later what tasks have been setup. You may also display a confirmation page when you submit this action page to create your schedule, look below...



<cfschedule    

action = "#Form.actionValue#"  


task = "taskname"  
operation = "HTTPRequest"  
file = "filename"  
path = "path_to_file"  
startDate = "date"  
startTime = "time"  
url = "URL"  
port = "port_number"  
publish = "Yes" or "No"  
endDate = "date"  
endTime = "time"  
interval = "seconds"  
requestTimeOut = "seconds"  
username = "username"  
password = "password"  
proxyServer = "hostname"  
proxyPort = "port_number"  
proxyUser = "username"  
proxyPassword = "password"  
resolveURL = "Yes" or "No" > 


Then insert to database

<cfquery name="insertNewTask" datasource="MyDSN">
INSERT INTO YourTable (taskName, action, ...)
VALUES ("#TaskName#", "#Form.ActionValue#", ....)
</cfquery>

Then have a submit button to the next page to confirm....

Then call pass those same values you're still using to display the info about the task.
This way anytime later you can go back and reference your task by date or however you like from your database, just make sure whatever changes you do to your task you have it edit the database as well.

Do you see what I'm saying basically a three step process...

1) Have a form to set the values for the cfschedule
2) Give the cfschedule it's values and insert those as well to a database table
3) submit step two to insert values to table and start new task, then you can also view the info on this task in this page...

Simple idea, but a few steps to make it work, hope this helps :o)

~trail


0
 
trailblazzyr55Commented:
You can view your directory path as well by this method

You'd do like a cffile in your initial form to get the directory you want to use, and use the value from the cffile, to input a value to this attribute in the cfschedule...

<cffile  action="Read"
           file="#GetTempDirectory()#"
           variable="readText">

<cfschedule name="YourName"
                  path = "#readText#"
                other attribs........>

You can use #readText# later on to display directory path as well.... sessions may help in this...

~trail

0
 
trailblazzyr55Commented:
I haven't tested my last comment, but I believe it should work, give it a try and lemme know...

~trail
0
 
sl1ngerAuthor Commented:
On your last comment... is it possible to connect GetTempDirectory() w/ a browse button?  A way for the user to search for the directory.
0
 
trailblazzyr55Commented:
Actually you can use this instead of cffile...

On first page...
 <input type="file" name="FilePath" size="45"> <!--- this will add a browse button and get ur file path --->
     
On next page
<cfschedule name="YourName"
                  path = "#form.FilePath#"
                other attribs........>
0
 
sl1ngerAuthor Commented:
I'm looking for a way to select the directory and not a file....
0
 
sl1ngerAuthor Commented:
Could cftree be used to select a directory?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now