Click here to register.
      
YAPC North America 2008


     Re: Extending the RandomAssetProxy by a templateID argument > Re: Extending the RandomAssetProxy by a templateID argument

Extending the RandomAssetProxy by a templateID argument

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

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