[Helma-user] Skin Name in Macro

Maksim Lin for technical support mailling lists maksim_lin at ngv.vic.gov.au
Thu Jul 31 01:25:00 CEST 2008


Hi Julian,

Yes and no.
No, its currently not exposed to JS but Yes the info is all there in the
Java code.

Its actually a little convoluted as:
* the current skin object (Java Skin class) is a private member variable
called "activeSkin" of the ReponseTrans class.
* ReponseTrans is a private member variable called "res" of the
ReponseBean class. 

Because the above 2 variables are private, they are currently not
accessible to JS.
But even if they were, the Skin class has no reference to the resource
(eg. skin file) that created it, which is probably what you actually
want.

Sooooo, I've whipped a quick patch (attached) that gives access to the
current skisn resource name, eg.

function doSomething_macro() {
    writeln("I was called from the
Skin:"+res.getResponseTransaction().activeSkin.getName());
}

The patch is against current helma trunk. I'l also add this to bugzilla
in the hope of getting it into the Helma mainline as this is not the
first time I've needed access to the res.res (ReponseTrans) so would be
nice to have it accessible in JS outside this particular usecase.

thanks,
Maks.

ps. I've updated as well the comment of ResponseTrans which is clearly
out of date and wrong.


> -----Original Message-----
> From: helma-user-bounces at helma.org 
> [mailto:helma-user-bounces at helma.org] On Behalf Of Julian Tree
> Sent: Wednesday, 30 July 2008 22:50
> To: Helma User Mailing List
> Subject: [Helma-user] Skin Name in Macro
> 
> Hi,
> 
> Within a macro can I find out which template it is called from?
> 
> Julian
> 
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: helma-access-activeSkin-patch.diff
Type: application/octet-stream
Size: 3746 bytes
Desc: helma-access-activeSkin-patch.diff
Url : http://helma.org/pipermail/helma-user/attachments/20080731/69889f18/attachment.obj 


More information about the Helma-user mailing list