• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Dynamic Page Changing

New Here ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

We have some digital TV's that we are streaming info to across the organization and the TV scheduler is really bad for what we are trying to do so Im looking for some help. Basically we are pushing one webpage out for a one minute block of time then we need it to refresh to the next predefined webpage. We have pages set up for each area that we call spots. We have a list created like this.

hr/spot1.html
Marketing/spot1.html
IS/spot1.html
hr/spot2.html

What we would like to do is handle the scheduling in CFML vs. the lame schedulere they gave us and loop through these pages at 1 min intervals. The trick is we need to put one URL reference in the TV scheduler then have the 1 min looping handled by CFML.

Does anyone know or have ideas on how to accoplish this?
TOPICS
Advanced techniques

Views

965

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

google "coldfusion sleep".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

I have about 30 URL to loop through with each one needing to show for 60 secs. Would this tag work for that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: coreygrimm
I have about 30 URL to loop through with each one needing to show for 60 secs. Would this tag work for that?

yes

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

My first thought is that you would have one file called by a scheduled
task every 60 seconds. This file would then be responsible for pushing
out the appropriate next content or however your system works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

I could set a scheduled task to run every 60 seconds but how would it know which URL was presented last and which one is in order to go next? We would need them to run in order.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

coreygrimm wrote:
> I could set a scheduled task to run every 60 seconds but how would it know which URL was presented last and which one is in order to go next? We would need them to run in order.


That would be the logic of the page that is run every minute. A simple
method would be an array that is stored in the application scope so it
is available from one request to the next. Then a simple pointer on
what file was called, and change the pointer after each file is
displayed. When you reach the end start over at the beginning.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

This sounds like it could work. Would you beable to provide some sample code to get me started? This sounds like what Im looking for.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 10, 2007 Aug 10, 2007

Copy link to clipboard

Copied

coreygrimm wrote:
> This sounds like it could work. Would you beable to provide some sample code to get me started? This sounds like what Im looking for.


<cfset application.pointer = application.pointer + 1>
<cfif application.pointer > arrayLen(application.urlAry)>
<cfset application.pointer = 1>
</cfif>

<cfset currentFile = application.urlAry[application.pointer]>

<!--- Do Something with currentFile --->


You will need to have something to defines the application.urlAry. A
simple form would do this easily. You then call this file once a minute
with a scheduled task.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 10, 2007 Aug 10, 2007

Copy link to clipboard

Copied

Update to insure that variable exist.

<cfparam name="application.pointer" value="1">
<cfparam name="application.urlAry" value="#arrayNew(1)#">

<cfset application.pointer = application.pointer + 1>
<cfif application.pointer > arrayLen(application.urlAry)>
<cfset application.pointer = 1>
</cfif>

<cfif arrayLen(application.urlAry) EQ 0>
ERROR: No File Array Defined
<cfelse>
<cfset currentFile = application.urlAry[application.pointer]>
</cfif>

<!--- Do Something with currentFile --->

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2007 Aug 10, 2007

Copy link to clipboard

Copied

LATEST
I like it let me see if I can get it to work. Be back shortly

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

I havn't found enough documentation on how to use the CFX_Sleep function.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

You don't need cfx_sleep.
http://www.petefreitag.com/item/85.cfm

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2007 Aug 10, 2007

Copy link to clipboard

Copied

Like I said not much documentation on that artical. If you could provide some sample code on how that would work using that artical I would be greatful. If not I would like to explore Ian Skinner's idea.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 10, 2007 Aug 10, 2007

Copy link to clipboard

Copied

<cfset thread = CreateObject("java", "java.lang.Thread")>
set other variables you need, such as a list of urls.
determine 1st url
start a loop
load url
<cfset thread.sleep(60000)>
change url
end loop.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 10, 2007 Aug 10, 2007

Copy link to clipboard

Copied

Dan Bracuk wrote:
> <cfset thread = CreateObject("java", "java.lang.Thread")>
> set other variables you need, such as a list of urls.
> determine 1st url
> start a loop
> load url
> <cfset thread.sleep(60000)>
> change url
> end loop.
>

A potential problem with this concept is that the request will have to
run for the duration of displaying the files. The default timeout for a
request processing thread is 60 seconds. I'm not sure I would want to
configure my server to run a thread for minutes, hours and potentially days.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation