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.


     WebGUI Dev > Extending the RandomAssetProxy by a templateID argument

Extending the RandomAssetProxy by a templateID argument

User bernd
Date 5/1/2008 3:01 pm
Views 671
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 [
|
]
 
 

Smoketest For nightly_2008-08-30 by Visitor - Sat @ 01:45am

Re: Config File Changes by pwrightson - Fri @ 04:07pm

Re: IRC Logs by koen - Fri @ 02:08pm

Re: IRC Logs by patspam - Fri @ 02:01pm

Re: IRC Logs by koen - Fri @ 01:42pm

Re: How do I find al my submitted RFE's? by bartjol - Fri @ 01:39pm

Re: IRC Logs by kristi - Fri @ 01:27pm

Re: LastModified question by perlDreamer - Fri @ 12:57pm

Re: How do I find al my submitted RFE's? by bartjol - Fri @ 12:11pm

How do I find al my submitted RFE's? by koen - Fri @ 11:23am

Re: IRC Logs by koen - Fri @ 11:20am

IRC Logs by martink - Fri @ 10:51am

Re: cleaning out the wiki by koen - Fri @ 10:44am

Re: shop in 7.5.21 by kristi - Fri @ 09:03am