You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Frank Villarreal <f_...@tetco.com> on 2005/01/31 15:38:27 UTC

J2 Velocity Error?

FYI:

Not sure if this is a bug .... using Jetspeed 2, I've created a new custom
decorator theme (both for the layout and the portlet).  I essentially copied
an existing folder structure being used for the other J2 themes (minty-blue,
jetspeed, etc) and customized it.  Everything seems to work correctly except
for one minor detail ... the uri for the portlet action buttons (edit, help,
min, max, ect) are somehow still resolving the image directory in the
"jetspeed" theme folder.  I'm baffled as to why this is occurring.  I
believe I have removed all references within the decorator.properties and
decorator.vm files within my custom folder(s).  Anyone else seeing this
behavior ... or am I have I not had enough coffee yet?

- Frank


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: J2 Velocity Error?

Posted by Frank Villarreal <f_...@tetco.com>.
Thanks Randy (and Chris).  I was about to implement something very similar
just so I could proceed ... but your hack works like a charm.  Thanks again.

- Frank




-----Original Message-----
From: watler@wispertel.net [mailto:watler@wispertel.net]
Sent: Monday, January 31, 2005 11:01 AM
To: Jetspeed Users List
Subject: RE: J2 Velocity Error?


Frank,

This is an issue I have known about but i have not gotten around to fixing
yet. I just modify my custom portlet decorator like this:

      #foreach ($action in $actions)
        #set($actionImage = $action.Link)
        #if($actionImage.startsWith("content/images/"))
          #set($actionImage =
"content/myportletdecorator/images/${actionImage.substring(15)}")
        #end
        #if($actionImage.endsWith(".gif"))
          #set($actionImageLength = $actionImage.length() - 4)
          #set($actionImage = "${actionImage.substring(0,
$actionImageLength)}.jpg")
        #end
        <td align="right" valign="middle" class="PTitle"><a
href="${action.Action}" title="${action.Name}"><img
src="${actionImage}" alt="${action.Alt}" border="0"></a><td/>
      #end

I will bump this up my todo list,

Randy




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: J2 Velocity Error?

Posted by wa...@wispertel.net.
Frank,

This is an issue I have known about but i have not gotten around to fixing
yet. I just modify my custom portlet decorator like this:

      #foreach ($action in $actions)
        #set($actionImage = $action.Link)
        #if($actionImage.startsWith("content/images/"))
          #set($actionImage =
"content/myportletdecorator/images/${actionImage.substring(15)}")
        #end
        #if($actionImage.endsWith(".gif"))
          #set($actionImageLength = $actionImage.length() - 4)
          #set($actionImage = "${actionImage.substring(0,
$actionImageLength)}.jpg")
        #end
        <td align="right" valign="middle" class="PTitle"><a
href="${action.Action}" title="${action.Name}"><img
src="${actionImage}" alt="${action.Alt}" border="0"></a><td/>
      #end

I will bump this up my todo list,

Randy


> Chris,
>
> Thanks for taking a stab at my question, but I don't think that's the
> problem.  Layout.vm seems to control the (re)positioning of portlets
> within
> a page.  Upon further inspection, it seems J2 uses a request filter to
> remap
> image requests to the current decorator "theme" folder.  And like I said
> previously, 99% of my custom images and stylesheet customizations are
> showing up correctly ... it's just those pesky portlet window image uris
> that continue to resolve to the "jetspeed" decorator folders.  It appears
> that in the velocity file (decorator.vm), there is a line of code that
> reads
> ...
>
> #set($actions = $jetspeed.DecoratorActions)
>
> The actions are the options available for a specific window/portlet (edit,
> view, max, min, etc).  This action list is then iterated and rendered in
> each portlet's title bar with the following snippet of velocity code ...
>
> #foreach ($action in $actions)
> <td align="right" valign="middle" class="PTitle" >
> <a href="${action.Action}" title="${action.Name}" ><img
> src="${action.Link}"
> alt="${action.Alt}" border="0"></a>
> <td/>
> #end
>
> The problem I am experiencing is that the tag ${action.Link} doesn't
> appear
> to be resolving to my custom theme.  It renders as
> "content/images/minimized.gif" ... which would appear to be correct, since
> the portal should "know" that I'm using a custom theme and "remap" the
> image
> request to the correct folder using the filter ... because I told it to
> use
> my custom theme in the PSML for the page by adding the following entry ...
>
> layout-decorator="mycustomtheme" portlet-decorator="mycustomtheme"
>
> Unfortunately, it doesn't appear to be working.  Gotta love Monday
> mornings
> ... :-)
>
> - Frank
>
>
>
> -----Original Message-----
> From: Christopher Wood [mailto:cwood@epo.org]
> Sent: Monday, January 31, 2005 09:23 AM
> To: Jetspeed Users List
> Subject: Re: J2 Velocity Error?
>
>
> I think the piece you're missing is in
> templates\layout\html\columns\layout.vm. I don't pretend to understand
> fully how the rendering process works, but this template appears to be
> what aggregates the portlet fragments - if you look at the page source,
> you can see by inspection that it generates the html between the layout
> and portlet decorators. I don't understand yet how this template is
> selected, or if it is possible to specify an alternative.
>
> Chris
>
>
> Frank Villareal wrote:
>>
>> Not sure if this is a bug .... using Jetspeed 2, I've created a new
> custom
>> decorator theme (both for the layout and the portlet).  I essentially
> copied
>> an existing folder structure being used for the other J2 themes
> (minty-blue,
>> jetspeed, etc) and customized it.  Everything seems to work correctly
> except
>> for one minor detail ... the uri for the portlet action buttons (edit,
> help,
>> min, max, ect) are somehow still resolving the image directory in the
>> "jetspeed" theme folder.  I'm baffled as to why this is occurring.  I
>> believe I have removed all references within the decorator.properties
> and
>> decorator.vm files within my custom folder(s).  Anyone else seeing this
>> behavior ... or am I have I not had enough coffee yet?
>>
>> - Frank
>
> Chris Wood - my.epoline®Portal Developer
> EUROPEAN PATENT OFFICE
> Patentlaan 2 - 2280HV Rijswijk (ZH) - Netherlands
> Tel: +31 (0)70 340 47 96
> Web: www.epoline.org | email: cwood@epo.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: J2 Velocity Error?

Posted by Frank Villarreal <f_...@tetco.com>.
Chris,

Thanks for taking a stab at my question, but I don't think that's the
problem.  Layout.vm seems to control the (re)positioning of portlets within
a page.  Upon further inspection, it seems J2 uses a request filter to remap
image requests to the current decorator "theme" folder.  And like I said
previously, 99% of my custom images and stylesheet customizations are
showing up correctly ... it's just those pesky portlet window image uris
that continue to resolve to the "jetspeed" decorator folders.  It appears
that in the velocity file (decorator.vm), there is a line of code that reads
...

#set($actions = $jetspeed.DecoratorActions)

The actions are the options available for a specific window/portlet (edit,
view, max, min, etc).  This action list is then iterated and rendered in
each portlet's title bar with the following snippet of velocity code ...

#foreach ($action in $actions)
<td align="right" valign="middle" class="PTitle" >
<a href="${action.Action}" title="${action.Name}" ><img src="${action.Link}"
alt="${action.Alt}" border="0"></a>
<td/>
#end

The problem I am experiencing is that the tag ${action.Link} doesn't appear
to be resolving to my custom theme.  It renders as
"content/images/minimized.gif" ... which would appear to be correct, since
the portal should "know" that I'm using a custom theme and "remap" the image
request to the correct folder using the filter ... because I told it to use
my custom theme in the PSML for the page by adding the following entry ...

layout-decorator="mycustomtheme" portlet-decorator="mycustomtheme"

Unfortunately, it doesn't appear to be working.  Gotta love Monday mornings
... :-)

- Frank



-----Original Message-----
From: Christopher Wood [mailto:cwood@epo.org]
Sent: Monday, January 31, 2005 09:23 AM
To: Jetspeed Users List
Subject: Re: J2 Velocity Error?


I think the piece you're missing is in
templates\layout\html\columns\layout.vm. I don't pretend to understand
fully how the rendering process works, but this template appears to be
what aggregates the portlet fragments - if you look at the page source,
you can see by inspection that it generates the html between the layout
and portlet decorators. I don't understand yet how this template is
selected, or if it is possible to specify an alternative.

Chris


Frank Villareal wrote:
>
> Not sure if this is a bug .... using Jetspeed 2, I've created a new
custom
> decorator theme (both for the layout and the portlet).  I essentially
copied
> an existing folder structure being used for the other J2 themes
(minty-blue,
> jetspeed, etc) and customized it.  Everything seems to work correctly
except
> for one minor detail ... the uri for the portlet action buttons (edit,
help,
> min, max, ect) are somehow still resolving the image directory in the
> "jetspeed" theme folder.  I'm baffled as to why this is occurring.  I
> believe I have removed all references within the decorator.properties
and
> decorator.vm files within my custom folder(s).  Anyone else seeing this
> behavior ... or am I have I not had enough coffee yet?
>
> - Frank

Chris Wood - my.epoline®Portal Developer
EUROPEAN PATENT OFFICE
Patentlaan 2 - 2280HV Rijswijk (ZH) - Netherlands
Tel: +31 (0)70 340 47 96
Web: www.epoline.org | email: cwood@epo.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: J2 Velocity Error?

Posted by Christopher Wood <cw...@epo.org>.
I think the piece you're missing is in 
templates\layout\html\columns\layout.vm. I don't pretend to understand 
fully how the rendering process works, but this template appears to be 
what aggregates the portlet fragments - if you look at the page source, 
you can see by inspection that it generates the html between the layout 
and portlet decorators. I don't understand yet how this template is 
selected, or if it is possible to specify an alternative.

Chris


Frank Villareal wrote:
>
> Not sure if this is a bug .... using Jetspeed 2, I've created a new 
custom
> decorator theme (both for the layout and the portlet).  I essentially 
copied
> an existing folder structure being used for the other J2 themes 
(minty-blue,
> jetspeed, etc) and customized it.  Everything seems to work correctly 
except
> for one minor detail ... the uri for the portlet action buttons (edit, 
help,
> min, max, ect) are somehow still resolving the image directory in the
> "jetspeed" theme folder.  I'm baffled as to why this is occurring.  I
> believe I have removed all references within the decorator.properties 
and
> decorator.vm files within my custom folder(s).  Anyone else seeing this
> behavior ... or am I have I not had enough coffee yet?
>
> - Frank

Chris Wood - my.epoline®Portal Developer 
EUROPEAN PATENT OFFICE
Patentlaan 2 - 2280HV Rijswijk (ZH) - Netherlands 
Tel: +31 (0)70 340 47 96
Web: www.epoline.org | email: cwood@epo.org