You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by dr...@sdf-eu.org on 2007/09/21 14:19:30 UTC
Random page of the day script
Hi,
We want to provide a thumbnail on the home-page which represents and links
to a random page of the day under Lenya. The random pages don't
necessarily have to selected "live" (I was thinking of dumping the URLs
to a file periodically and making some sort of script to select one).
So, has anyone done something similar? What's the easiet way to do it?
Cheers,
James
--
"Hey Microsoft, where do you want to 'SCO' today?" :-)
drseuk@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdf-eu.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Random page of the day script
Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler schrieb:
> On Sat, 2007-09-22 at 14:45 +0000, drseuk@sdf-eu.org wrote:
>> Hi,
>
>
> Hi James,
>
> http://cocoon.apache.org/2.1/userdocs/concepts/actions.html
>
> I reckon you can use a "simple" action to extract a random link and the
> pass it to the xsl via a sitemap parameter.
For a non-Java solution, you could use the random number input module
(http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/input/RandomNumberModule.html)
and pass the number to an XSLT which operates on the sitetree. You can
use the modulo operator with the number of existing nodes in the
sitetree to select the document.
This approach will be terribly slow compared to a Java-based solution as
suggested by Thorsten. Anyway, I'd recommend an input module instead of
an action (less code in the sitemap).
-- Andreas
>
> This way the features described by solprovider should be easy to
> implement with a nice java component.
>
> salu2
>
>> Some interesting ideas here!
>>
>> It doesn't have to be strictly "Page of the day" ("Page of the browser
>> refresh" is fine for our purposes). It would just be leaves, not
>> categories, doesn't have to include every page of a certain document
>> type but rather a hand-picked selection and doesn't have to be
>> especially random.
>>
>> I was thinking of a manually updated file of page URLs maintained by the
>> administrator with a bit of JavaScript(?) that picks a "random" URL from
>> the file and 'somehow' extracts the page title (for use as link text) and
>> the correct thumbnail filename (which should be easy as the primary image
>> filename is a subset of the page URL).
>>
>> Regards,
>>
>> James
>>
>> P.S., You are aware that XSLT is Turing-complete aren't you ;-) Jesting
>> aside, thanks for your HOWTO pages, I refer to them frequently.
>>
>> On Fri, 21 Sep 2007, solprovider@apache.org wrote:
>>
>>> Date: Fri, 21 Sep 2007 14:08:27 -0400
>>> From: solprovider@apache.org
>>> Reply-To: user@lenya.apache.org
>>> To: user@lenya.apache.org
>>> Subject: Re: Random page of the day script
>>>
>>> "Page of the Day" implies daily update so the update function should
>>> be scheduled once each day. Cache the pagelet. Delete the homepage
>>> from cache so it updates to include the new material..
>>>
>>> The selection should exclude the homepage. Only include leaves or
>>> should category pages be included? Should editors set a flag on pages
>>> that should be included? Maintain list of previously chosen pages to
>>> prevent frequent repeats. How many items on recently used list?
>>>
>>> Use XMAP and XSL to create list of possible pages. Add a random
>>> number to each item. Use the page with the lowest number.
>>>
>>> The main design decision is how to create the random numbers. A
>>> completely XSL solution would be fun, but a custom transformer that
>>> adds a "random" attribute to every element (excluding root) would be
>>> simple.
>>>
>>> solprovider
>>>
>>> On 9/21/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
>>>> We want to provide a thumbnail on the home-page which represents and links
>>>> to a random page of the day under Lenya. The random pages don't
>>>> necessarily have to selected "live" (I was thinking of dumping the URLs
>>>> to a file periodically and making some sort of script to select one).
>>>>
>>>> So, has anyone done something similar? What's the easiet way to do it?
>>>>
>>>> Cheers,
>>>> James
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>
>> --
>>
>> "Hey Microsoft, where do you want to 'SCO' today?" :-)
>>
>> drseuk@sdf-eu.org
>> SDF-EU Public Access UNIX System - http://sdf-eu.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: user-help@lenya.apache.org
>>
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Random page of the day script
Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Sat, 2007-09-22 at 14:45 +0000, drseuk@sdf-eu.org wrote:
> Hi,
Hi James,
http://cocoon.apache.org/2.1/userdocs/concepts/actions.html
I reckon you can use a "simple" action to extract a random link and the
pass it to the xsl via a sitemap parameter.
This way the features described by solprovider should be easy to
implement with a nice java component.
salu2
>
> Some interesting ideas here!
>
> It doesn't have to be strictly "Page of the day" ("Page of the browser
> refresh" is fine for our purposes). It would just be leaves, not
> categories, doesn't have to include every page of a certain document
> type but rather a hand-picked selection and doesn't have to be
> especially random.
>
> I was thinking of a manually updated file of page URLs maintained by the
> administrator with a bit of JavaScript(?) that picks a "random" URL from
> the file and 'somehow' extracts the page title (for use as link text) and
> the correct thumbnail filename (which should be easy as the primary image
> filename is a subset of the page URL).
>
> Regards,
>
> James
>
> P.S., You are aware that XSLT is Turing-complete aren't you ;-) Jesting
> aside, thanks for your HOWTO pages, I refer to them frequently.
>
> On Fri, 21 Sep 2007, solprovider@apache.org wrote:
>
> > Date: Fri, 21 Sep 2007 14:08:27 -0400
> > From: solprovider@apache.org
> > Reply-To: user@lenya.apache.org
> > To: user@lenya.apache.org
> > Subject: Re: Random page of the day script
> >
> > "Page of the Day" implies daily update so the update function should
> > be scheduled once each day. Cache the pagelet. Delete the homepage
> > from cache so it updates to include the new material..
> >
> > The selection should exclude the homepage. Only include leaves or
> > should category pages be included? Should editors set a flag on pages
> > that should be included? Maintain list of previously chosen pages to
> > prevent frequent repeats. How many items on recently used list?
> >
> > Use XMAP and XSL to create list of possible pages. Add a random
> > number to each item. Use the page with the lowest number.
> >
> > The main design decision is how to create the random numbers. A
> > completely XSL solution would be fun, but a custom transformer that
> > adds a "random" attribute to every element (excluding root) would be
> > simple.
> >
> > solprovider
> >
> > On 9/21/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
> >> We want to provide a thumbnail on the home-page which represents and links
> >> to a random page of the day under Lenya. The random pages don't
> >> necessarily have to selected "live" (I was thinking of dumping the URLs
> >> to a file periodically and making some sort of script to select one).
> >>
> >> So, has anyone done something similar? What's the easiet way to do it?
> >>
> >> Cheers,
> >> James
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> > For additional commands, e-mail: user-help@lenya.apache.org
> >
>
> --
>
> "Hey Microsoft, where do you want to 'SCO' today?" :-)
>
> drseuk@sdf-eu.org
> SDF-EU Public Access UNIX System - http://sdf-eu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
--
Thorsten Scherler thorsten.at.apache.org
Open Source Java consulting, training and solutions
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Random page of the day script
Posted by so...@apache.org.
This post contains a solution. Please let us know how it works.
On 9/26/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
> The live page URLs are of the form http://www.foo.com/catalog/ItemA01.html
> . Each page is guaranteed to have at least one image named e.g.,
> ItemA01.jpg - that is, the image [thumbnail] filename can be directly
> extracted from the URL (as opposed to parsing the page contents for
> images). The intention is...
> - We create a manually maintained text file with the URLs (one per line) of
> the pages that may be selected as a "random page".
> - The code picks a "random" URL from this text file and generates HTML code
> from it of the form [which gets inserted into the home-page]:
> <div id="randompage">
> <a href="http://www.foo.com/catalog/ItemA01.html"><img src="ItemA01.jpg"
> /><br />Title text drawn from page ItemA01</a>
> </div>
Good specifications should include the expected results. The input is
simply a list of item ids with titles.
<AllItemsForRandomThumbnail>
<item id="ItemA01">Title text drawn from page ItemA01</item>
<item id="123xyz">Wonder Widget</item>
</AllItemsForRandomThumbnail>
List maintenance can be manual or automated using the XPath Directory Generator:
http://solprovider.com/lenya/aggregatefiles
Create a file manually to test the code below. We can discuss
automating the input generation once the function is working.
> I tried adding a map:part to the
> aggregation in publication-sitemap.xmap to run some xsp to generate a
> randompage element with the URL and related information in it such that
> page2xhtml.xsl could pick it up and transform it (it isn't / doesn't work
> yet). Yes, but how? Am I along the right lines with my efforts above?
I checked Cocoon's source code for the Random Number Module. The
official attribute is "randomNumber", but the code will accept any
string. The module has a bug to always return the max when configured
using attributes. Lenya uses the default of 0-9,999,999,999.
The publication XMAP needs:
<map:match pattern="randomthumbnail">
<map:generate src="AllItemsForRandomThumbnail.xml">
<map:transform src="randomthumbnail.xsl">
<map:parameter name="rnd" value="{random:randomNumber}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
The map:part to include the new pipeline:
<map:part src="cocoon:/randomthumbnail"/>
The page2xhtml.xsl needs to place the "thumbnail" div created by...
FILE: "randomthumbnail.xsl:
<xsl:param name="rnd"/>
<xsl:template match="/">
<xsl:apply-template name="thumbnail"
select="item[position()= ({$rnd} mod count(item))]"/>
</xsl:template>
<xsl:template name="thumbnail">
<div id="randompage"><a
href="http://www.foo.com/catalog/{@id}.html"><img src="{@id}.jpg"/>
<br/><xsl:value-of select="."/></a>
</div>
</xsl:template>
The formula slightly favors items earlier in the list. This
favoritism can be significant with more than a couple billion items so
you may need different code.
I typed this material directly into this post and have not tested it
for anything. Use with risk.
> Sorry, if I'm sounding a bit ignorant on this, I am slightly out of
> my depth! (not all of us work in University Computer Science Depts!).
I never worked in a University Computer Science department because
working at a gas station paid much better. My first five years of
college and over 90 credits were towards a CompSci degree. The
curriculum changed because most modern tools (such as Apache httpd and
Java) did not exist during my penultimate attempt at a BS. I just and
finally received a B.S.Management after passing 39 credits in 11
months while running a Fortune 200 company's website.
--
> > I am happy you like my documentation. More should appear. Migrating
> > my websites to Lenya 1.3 has higher priority than posting additional
> > documentation, but most of the Lenya section was collecting and
> > organizing my posts to the mailing lists so new material depends on
> > the level of activity on the MLs.
>
> Lenya is conceptually brilliant, but I would happily drop everything for a
> week to contribute to a "Lenya documentation for dummies" effort. If I'm
> brutally honest, the lack of documentation accessible to intermediates for
> what is a very complex system depending on so many technologies is the
> real gap in what would otherwise be the killer-CMS. Dare I say it, Lenya
> would IMHO benefit greatly with a bit more of an Ubuntu / Shuttleworth -
> style philosophy.
A CMS built on Cocoon is a good obvious idea. Lenya 1.2 has design
flaws making the system needlessly complex. Lenya 1.4/2.0 will be
slightly easier for Java programmers. Lenya 1.3 will be easier for
everybody else. The current documentation for Lenya 1.3 is at the
root of its repository. A PHB should be able to install and use it
easily, and I will write documentation to explain why.
> > XSL is Turing-complete according to the academics. So is COBOL.
> > Turing-completeness is about possibilities. Real world programming is
> > about time to usability and ease of maintenance. The W3C forgot XPath
> > needs a random() function. XPath 2.0 has been a draft for two years.
> > Does anybody know how to make suggestions?
> Well, emailing the CSS team probably won't help with a speedy resolution.
> 10 years and counting ...
> Regards,
> James
One of my projects could supersede the Web and make the W3C
irrelevant. Wish me luck.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Random page of the day script
Posted by dr...@sdf-eu.org.
On Wed, 26 Sep 2007, solprovider@apache.org wrote:
> Date: Wed, 26 Sep 2007 01:56:47 -0400
> From: solprovider@apache.org
> Reply-To: user@lenya.apache.org
> To: user@lenya.apache.org
> Subject: Re: Random page of the day script
>
> We may need more information about the document data: "The correct
> thumbnail filename should be easy as the primary image filename is a
> subset of the page URL"? Are you linking to an HTML page, an image,
> or some other file download?
The live page URLs are of the form http://www.foo.com/catalog/ItemA01.html
. Each page is guaranteed to have at least one image named e.g.,
ItemA01.jpg - that is, the image [thumbnail] filename can be directly
extracted from the URL (as opposed to parsing the page contents for
images).
The intention is as follows:
We create a manually maintained text file with the URLs (one per line) of
the pages that may be selected as a "random page".
The code picks a "random" URL from this text file and generates HTML code
from it of the form [which gets inserted into the home-page]:
<div id="randompage">
<a href="http://www.foo.com/catalog/ItemA01.html"><img src="ItemA01.jpg"
/><br />Title text drawn from page ItemA01</a>
</div>
>
> The first step is to flag the documents while completing any
> additional information such as a summary. Title and filename can be
> calculated from existing data.
No, to keep things simple, the choice of documents will be a simple
manually maintained text file of URLs. I tried adding a map:part to the
aggregation in publication-sitemap.xmap to run some xsp to generate a
randompage element with the URL and related information in it such that
page2xhtml.xsl could pick it up and transform it (it isn't / doesn't work
yet). Sorry, if I'm sounding a bit ignorant on this, I am slightly out of
my depth! (not all of us work in University Computer Science Depts!).
>
> The automation collects all flagged pages to a list. Cache if process
> is slow and frequent. Choose using a random number. (See Andreas
> Hartmann's post in this thread.) Cache the number or the results if
> stability is desired. Add the resulting snippet to the homepage.
Yes, but how? Am I along the right lines with my efforts above?
>
> --
> I am happy you like my documentation. More should appear. Migrating
> my websites to Lenya 1.3 has higher priority than posting additional
> documentation, but most of the Lenya section was collecting and
> organizing my posts to the mailing lists so new material depends on
> the level of activity on the MLs.
Lenya is conceptually brilliant, but I would happily drop everything for a
week to contribute to a "Lenya documentation for dummies" effort. If I'm
brutally honest, the lack of documentation accessible to intermediates for
what is a very complex system depending on so many technologies is the
real gap in what would otherwise be the killer-CMS. Dare I say it, Lenya
would IMHO benefit greatly with a bit more of an Ubuntu / Shuttleworth -
style philosophy.
Regards,
James
>
> XSL is Turing-complete according to the academics. So is COBOL.
> Turing-completeness is about possibilities. Real world programming is
> about time to usability and ease of maintenance. The W3C forgot XPath
> needs a random() function. XPath 2.0 has been a draft for two years.
> Does anybody know how to make suggestions?
Well, emailing the CSS team probably won't help with a speedy resolution.
10 years and counting ...
>
> solprovider
>
>
> On 9/22/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
>> Some interesting ideas here!
>>
>> It doesn't have to be strictly "Page of the day" ("Page of the browser
>> refresh" is fine for our purposes). It would just be leaves, not
>> categories, doesn't have to include every page of a certain document
>> type but rather a hand-picked selection and doesn't have to be
>> especially random.
>>
>> I was thinking of a manually updated file of page URLs maintained by the
>> administrator with a bit of JavaScript(?) that picks a "random" URL from
>> the file and 'somehow' extracts the page title (for use as link text) and
>> the correct thumbnail filename (which should be easy as the primary image
>> filename is a subset of the page URL).
>>
>> Regards,
>> James
>>
>> P.S., You are aware that XSLT is Turing-complete aren't you ;-) Jesting
>> aside, thanks for your HOWTO pages, I refer to them frequently.
>>
>> On Fri, 21 Sep 2007, solprovider@apache.org wrote:
>>> "Page of the Day" implies daily update so the update function should
>>> be scheduled once each day. Cache the pagelet. Delete the homepage
>>> from cache so it updates to include the new material..
>>>
>>> The selection should exclude the homepage. Only include leaves or
>>> should category pages be included? Should editors set a flag on pages
>>> that should be included? Maintain list of previously chosen pages to
>>> prevent frequent repeats. How many items on recently used list?
>>>
>>> Use XMAP and XSL to create list of possible pages. Add a random
>>> number to each item. Use the page with the lowest number.
>>>
>>> The main design decision is how to create the random numbers. A
>>> completely XSL solution would be fun, but a custom transformer that
>>> adds a "random" attribute to every element (excluding root) would be
>>> simple.
>>>
>>> solprovider
>>>
>>> On 9/21/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
>>>> We want to provide a thumbnail on the home-page which represents and links
>>>> to a random page of the day under Lenya. The random pages don't
>>>> necessarily have to selected "live" (I was thinking of dumping the URLs
>>>> to a file periodically and making some sort of script to select one).
>>>>
>>>> So, has anyone done something similar? What's the easiest way to do it?
>>>> James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
--
Maths with Microsoft Excel 2007: 85 times 77.1 = 65535 . Hint: this isn't
even true on Seasame Street.
drseuk@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdf-eu.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Random page of the day script
Posted by so...@apache.org.
We may need more information about the document data: "The correct
thumbnail filename should be easy as the primary image filename is a
subset of the page URL"? Are you linking to an HTML page, an image,
or some other file download?
The first step is to flag the documents while completing any
additional information such as a summary. Title and filename can be
calculated from existing data.
The automation collects all flagged pages to a list. Cache if process
is slow and frequent. Choose using a random number. (See Andreas
Hartmann's post in this thread.) Cache the number or the results if
stability is desired. Add the resulting snippet to the homepage.
--
I am happy you like my documentation. More should appear. Migrating
my websites to Lenya 1.3 has higher priority than posting additional
documentation, but most of the Lenya section was collecting and
organizing my posts to the mailing lists so new material depends on
the level of activity on the MLs.
XSL is Turing-complete according to the academics. So is COBOL.
Turing-completeness is about possibilities. Real world programming is
about time to usability and ease of maintenance. The W3C forgot XPath
needs a random() function. XPath 2.0 has been a draft for two years.
Does anybody know how to make suggestions?
solprovider
On 9/22/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
> Some interesting ideas here!
>
> It doesn't have to be strictly "Page of the day" ("Page of the browser
> refresh" is fine for our purposes). It would just be leaves, not
> categories, doesn't have to include every page of a certain document
> type but rather a hand-picked selection and doesn't have to be
> especially random.
>
> I was thinking of a manually updated file of page URLs maintained by the
> administrator with a bit of JavaScript(?) that picks a "random" URL from
> the file and 'somehow' extracts the page title (for use as link text) and
> the correct thumbnail filename (which should be easy as the primary image
> filename is a subset of the page URL).
>
> Regards,
> James
>
> P.S., You are aware that XSLT is Turing-complete aren't you ;-) Jesting
> aside, thanks for your HOWTO pages, I refer to them frequently.
>
> On Fri, 21 Sep 2007, solprovider@apache.org wrote:
> > "Page of the Day" implies daily update so the update function should
> > be scheduled once each day. Cache the pagelet. Delete the homepage
> > from cache so it updates to include the new material..
> >
> > The selection should exclude the homepage. Only include leaves or
> > should category pages be included? Should editors set a flag on pages
> > that should be included? Maintain list of previously chosen pages to
> > prevent frequent repeats. How many items on recently used list?
> >
> > Use XMAP and XSL to create list of possible pages. Add a random
> > number to each item. Use the page with the lowest number.
> >
> > The main design decision is how to create the random numbers. A
> > completely XSL solution would be fun, but a custom transformer that
> > adds a "random" attribute to every element (excluding root) would be
> > simple.
> >
> > solprovider
> >
> > On 9/21/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
> >> We want to provide a thumbnail on the home-page which represents and links
> >> to a random page of the day under Lenya. The random pages don't
> >> necessarily have to selected "live" (I was thinking of dumping the URLs
> >> to a file periodically and making some sort of script to select one).
> >>
> >> So, has anyone done something similar? What's the easiest way to do it?
> >> James
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Random page of the day script
Posted by dr...@sdf-eu.org.
Hi,
Some interesting ideas here!
It doesn't have to be strictly "Page of the day" ("Page of the browser
refresh" is fine for our purposes). It would just be leaves, not
categories, doesn't have to include every page of a certain document
type but rather a hand-picked selection and doesn't have to be
especially random.
I was thinking of a manually updated file of page URLs maintained by the
administrator with a bit of JavaScript(?) that picks a "random" URL from
the file and 'somehow' extracts the page title (for use as link text) and
the correct thumbnail filename (which should be easy as the primary image
filename is a subset of the page URL).
Regards,
James
P.S., You are aware that XSLT is Turing-complete aren't you ;-) Jesting
aside, thanks for your HOWTO pages, I refer to them frequently.
On Fri, 21 Sep 2007, solprovider@apache.org wrote:
> Date: Fri, 21 Sep 2007 14:08:27 -0400
> From: solprovider@apache.org
> Reply-To: user@lenya.apache.org
> To: user@lenya.apache.org
> Subject: Re: Random page of the day script
>
> "Page of the Day" implies daily update so the update function should
> be scheduled once each day. Cache the pagelet. Delete the homepage
> from cache so it updates to include the new material..
>
> The selection should exclude the homepage. Only include leaves or
> should category pages be included? Should editors set a flag on pages
> that should be included? Maintain list of previously chosen pages to
> prevent frequent repeats. How many items on recently used list?
>
> Use XMAP and XSL to create list of possible pages. Add a random
> number to each item. Use the page with the lowest number.
>
> The main design decision is how to create the random numbers. A
> completely XSL solution would be fun, but a custom transformer that
> adds a "random" attribute to every element (excluding root) would be
> simple.
>
> solprovider
>
> On 9/21/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
>> We want to provide a thumbnail on the home-page which represents and links
>> to a random page of the day under Lenya. The random pages don't
>> necessarily have to selected "live" (I was thinking of dumping the URLs
>> to a file periodically and making some sort of script to select one).
>>
>> So, has anyone done something similar? What's the easiet way to do it?
>>
>> Cheers,
>> James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
--
"Hey Microsoft, where do you want to 'SCO' today?" :-)
drseuk@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdf-eu.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Random page of the day script
Posted by so...@apache.org.
"Page of the Day" implies daily update so the update function should
be scheduled once each day. Cache the pagelet. Delete the homepage
from cache so it updates to include the new material..
The selection should exclude the homepage. Only include leaves or
should category pages be included? Should editors set a flag on pages
that should be included? Maintain list of previously chosen pages to
prevent frequent repeats. How many items on recently used list?
Use XMAP and XSL to create list of possible pages. Add a random
number to each item. Use the page with the lowest number.
The main design decision is how to create the random numbers. A
completely XSL solution would be fun, but a custom transformer that
adds a "random" attribute to every element (excluding root) would be
simple.
solprovider
On 9/21/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
> We want to provide a thumbnail on the home-page which represents and links
> to a random page of the day under Lenya. The random pages don't
> necessarily have to selected "live" (I was thinking of dumping the URLs
> to a file periodically and making some sort of script to select one).
>
> So, has anyone done something similar? What's the easiet way to do it?
>
> Cheers,
> James
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org