Click here to register.
      
irc://irc.freenode.net#webgui

iPhoneGuy: WebGUI is a pile of crap.
rizen: If WebGUI is such a pile of crap, why do you use it?
iPhoneGuy: Because it's the best pile of crap out there.

If this is what people who hate us are saying, imagine what people who love us will say. Come join us on IRC.


     Discuss > WebGUI Dev

Extending the RandomAssetProxy by a templateID argument

User bernd
Date 5/1/2008 3:01 pm
Views 509
Rating 0    Rate [
|
]
Previous · Next
User Message
bernd

Hi there,

I want to extend the RandomAssetProxy such that it takes a template ID as the second argument (for overriding the default one of the proxied asset). In principle, this is similar to the shortcut override functionality.

I  noticed that there is only a get method defined fo retrieving properties of assets, i.e. it does not seem to be possible to change the template ID of an asset object. Is this correct?

If that is the case, I assume one has to define a new class that inherits from Asset and overrides the get method. If the templateID is requested one simply returns the one that has been specified when the constructor was called. Would that work? Or is there an easier way?

--
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 [
|
]
 
 
bernd
I am already stuck. To start with, I copied the file RandomAssetProxy.pm
to N?RandomAssetProxy.pm in the macro folder, changed the package name
to WebGUI::Macro::NRandomAssetProxy and made an entry to the config file
of the site ("NRandomAssetProxy" : "NRandomAssetProxy",). That is
everything described in the wiki. Still, the macro is not resolved and
all I get is a "^NRandomAssetProxy()" when I use it in a template.
The original RandomAssetProxy still works fine. What did I miss?
I did a restart of the whole system. Permissions of the new file are
also fine. WebGUI version is 7.4.34.



Back to Top
Rate [
|
]
 
 
martink
After changing your config you must also restart your mod_perl server.

Martin


spunky@kashyyyk.de wrote:
> bernd wrote:
>
> I am already stuck. To start with, I copied the file RandomAssetProxy.pm
> to N?RandomAssetProxy.pm in the macro folder, changed the package name
> to WebGUI::Macro::NRandomAssetProxy and made an entry to the config file
> of the site ("NRandomAssetProxy" : "NRandomAssetProxy",). That is
> everything described in the wiki. Still, the macro is not resolved and
> all I get is a "^NRandomAssetProxy()" when I use it in a template.
> The original RandomAssetProxy still works fine. What did I miss?
> I did a restart of the whole system. Permissions of the new file are
> also fine. WebGUI version is 7.4.34.
>
>
>
> http://www.plainblack.com/webgui/dev/discuss/extending-the-randomassetproxy-by-a-templateid-argument/1
>
> ------------------------------------------------------------------------
>
>
>
>  



Back to Top
Rate [
|
]
 
 
bernd
> After changing your config you must also restart your mod_perl server.
>
> Martin

I think that is what I did. I used the unix init script that ships with
WRE. I requested a restart with /etc/init.d/webgui restart. The script
than calls "/data/wre/sbin/wreservice.pl --quiet --restart" which
includes a restart of the mod_perl server!?



Back to Top
Rate [
|
]
 
 
     Discuss > WebGUI Dev




Re: News Addon? by knowmad - Thu @ 06:04pm

Re: News Addon? by bepo - Thu @ 08:54am

Re: News Addon? by bepo - Thu @ 03:35am

Smoketest For nightly_2008-07-03 by Visitor - Thu @ 01:37am

Thingy Reporting (pt 2) by knowmad - Wed @ 05:37pm

Re: News Addon? by knowmad - Wed @ 05:12pm

spell checker and tinymce by elnino - Wed @ 04:50pm

Re: WebGUI works on perl 5.10 by knowmad - Wed @ 04:41pm

Re: how the cost installing WebGUI ?? by baylink - Wed @ 12:19pm

Re: News Addon? by bepo - Wed @ 07:38am

Re: News Addon? by bepo - Wed @ 03:38am

Re: External Links by bepo - Wed @ 03:30am

Smoketest For nightly_2008-07-02 by Visitor - Wed @ 01:36am