Click here to register.
      
YAPC North America 2008


     Discuss > WebGUI Dev Goto page «Previous Page   1 2    Next Page»

Re: Extending the RandomAssetProxy by a templateID argument

User colink
Date 5/1/2008 3:15 pm
Views 555
Rating 0    Rate [
|
]
Previous · Next
User Message
colink
I would suggest looking at the Shortcut Asset.  It already allows for overriding, and may have a random picker as well.                  


Back to Top
Rate [
|
]
 
 
bernd
Right. In fact, I am using the shortcut asset as well. The idea is to
pick a Collaboration system (CS) randomly from all over the site and
then have a random thread displayed. The first is achieved by an
alternating shortcut. For the second, I need the RandomAssetProxy that
is used within the override template of randomly picked CSs. Since I do
not want to use the default template of threads, however, I need to
extend the RandomAssetProxy.

Am Donnerstag, den 01.05.2008, 15:15 -0500 schrieb ckuskie@sterlink.net:
> colink wrote:
>
> I would suggest looking at the Shortcut Asset.  It already allows for
> overriding, and may have a random picker as well.                  
>
>
> http://www.plainblack.com/webgui/dev/discuss/re-extending-the-randomassetproxy-by-a-templateid-argument
>



Back to Top
Rate [
|
]
 
 
martink
Then why not use the RandomThread macro, which comes with the default
WebGUI distribution? See
http://www.webgui.org/community-wiki/random-thread-macro

Martin

spunky@kashyyyk.de wrote:
> bernd wrote:
>
> Right. In fact, I am using the shortcut asset as well. The idea is to
> pick a Collaboration system (CS) randomly from all over the site and
> then have a random thread displayed. The first is achieved by an
> alternating shortcut. For the second, I need the RandomAssetProxy that
> is used within the override template of randomly picked CSs. Since I do
> not want to use the default template of threads, however, I need to
> extend the RandomAssetProxy.
>
> Am Donnerstag, den 01.05.2008, 15:15 -0500 schrieb ckuskie@sterlink.net:
> > colink wrote:
> >
> > I would suggest looking at the Shortcut Asset.  It already allows for
> > overriding, and may have a random picker as well.                  
> >
> >
> >
> http://www.plainblack.com/webgui/dev/discuss/re-extending-the-randomassetproxy-by-a-templateid-argument
>
> >
>
>
>
> http://www.plainblack.com/webgui/dev/discuss/re-extending-the-randomassetproxy-by-a-templateid-argument/1
>
> ------------------------------------------------------------------------
>
>
>
>  



Back to Top
Rate [
|
]
 
 
bernd

Then why not use the RandomThread macro, which comes with the default
WebGUI distribution? See
http://www.webgui.org/community-wiki/random-thread-macro

Martin

Well, as I said: it needs to be a extended for accepting a template ID as the second argument...



Back to Top
Rate [
|
]
 
 
martink
spunky@kashyyyk.de wrote:
> bernd wrote:
>
>     /Then why not use the RandomThread macro, which comes with the
>     default
>     WebGUI distribution? See
>     http://www.webgui.org/community-wiki/random-thread-macro
>     /
>
>     /Martin/
>
> Well, as I said: it needs to be a extended for accepting a template ID
> as the second argument...
>

Did you read the stuff in the url I sent you? I sais right there:

   /templateURL/ URL of the template to use to display the random thread

Martin
>
>
>
> http://www.plainblack.com/webgui/dev/discuss/re-extending-the-randomassetproxy-by-a-templateid-argument/5
>
> ------------------------------------------------------------------------
>
>
>
>  



Back to Top
Rate [
|
]
 
 
bernd


Did you read the stuff in the url I sent you? I sais right there:

   /templateURL/ URL of the template to use to display the random thread

Martin


Now I did. I had not read your answer carefully enough. I think this is exactly what I need. Thank you very much!



Back to Top
Rate [
|
]
 
 
bartjol

Skip my remark, the RandomThread macro seems the way to go

Just trying to help:
isn't it another way to use a SQL report to pick the thread. Then you can template the SQL report according to your likings?



Back to Top
Rate [
|
]
 
 
bernd

Skip my remark, the RandomThread macro seems the way to go

Just trying to help:
isn't it another way to use a SQL report to pick the thread. Then you can template the SQL report according to your likings?

I have never used SQL-Reports before. How would that work? I assume you suggest to query the table containing threads directly and then pick an entry randomly? Is that really "clean" coding? What if the structure of tables change in future releases?

--
Trying to build a non-profit community portal for free-climbers around Magdeburg/Germany. Check out http://kletterfreunde-md.kashyyyk.de (under construction).



Back to Top
Rate [
|
]
 
 
martink
spunky@kashyyyk.de wrote:
> bernd wrote:
>
> I have never used SQL-Reports before. How would that work? I assume
> you suggest to query the table containing threads directly and then
> pick an entry randomly? Is that really "clean" coding? What if the
> structure of tables change in future releases?
>

That is correct. Whether you can cosider it 'clean' coding depends on if
you view no using the API as clean. If the db schema changes your
SQLReport will indeed break, and you'll have to fix it manually. However
in many cases this is not that big a problem. Obviously creating a Macro
or Asset that uses the API to fetch the data you want is the most
bestedest solution, but it requires you to add plugins to your site,
which is something a lot of people cannot do because they don't host
themselves. In that case a SQLReport is your only choice.

Martin
>
> --
> Trying to build a non-profit community portal for free-climbers around
> Magdeburg/Germany. Check out http://kletterfreunde-md.kashyyyk.de
> (under construction).
>
>
>
> http://www.plainblack.com/webgui/dev/discuss/re-extending-the-randomassetproxy-by-a-templateid-argument/4
>
> ------------------------------------------------------------------------
>
>
>
>  



Back to Top
Rate [
|
]
 
 
bartjol

but the random-thread macro takes a templateurl as 3rd parameter, ok it's not an id, but good enough it seem



Back to Top
Rate [
|
]
 
 
     Discuss > WebGUI Dev Goto page «Previous Page   1 2    Next Page»




Re: Bilingualism by Klaus - Fri @ 07:34am

Re: Bilingualism by bepo - Fri @ 06:00am

Smoketest For nightly_2008-05-16 by Visitor - Fri @ 12:52am

C2: JSON collateral rewrite by colink - Fri @ 12:00am

Smoke Test for SVN (2008-05-16) by botaction - Thu @ 11:48pm

Recommendation for web chat system? by bernd - Thu @ 02:27pm

Re: InnoDB in WRE by BNC - Thu @ 09:56am

Re: Bilingualism by fathertorque - Thu @ 05:58am

Smoketest For nightly_2008-05-15 by Visitor - Thu @ 12:51am

Smoke Test for SVN (2008-05-15) by botaction - Wed @ 11:48pm

Re: The debian openssl/openssh bug by patspam - Wed @ 08:50pm

The debian openssl/openssh bug by patspam - Wed @ 07:00pm

Re: Bilingualism by Klaus - Wed @ 01:29pm

Re: InnoDB in WRE by dionak - Wed @ 01:00pm