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 James Liao <ji...@gmail.com> on 2005/08/08 02:56:56 UTC

How to change portlet windowState in Velocity template?

Hi all,
I need your help. As I know, I can write something like this(intercept
from PickANumber.jsp):
<portlet:renderURL var="helpMe" portletMode='help'/>
<portlet:renderURL var="editMe" portletMode='Edit'/>
<portlet:renderURL var="maxMe" windowState='Maximized'/>
<portlet:renderURL var="minMe" windowState='Minimized'/>
to generate some urls which can change the portlet instance's mode or
portlet instance's window state. How to do the same thing in  Velocity
template(*.vm files)?

Another question:
Can I change a portlet's mode or portlet window state in portlet's
doView() or doAction methods directly?

Any help would be appreciated!

- James Liao

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


RE: How to change portlet windowState in Velocity template?

Posted by Scott T Weaver <sc...@binary-designs.net>.
James,

Unfortunately, that's all you can do for now.  If I come up with a better
approach I will let you know.

Regards,
-Scott

> -----Original Message-----
> From: James Liao [mailto:jian.liao@gmail.com]
> Sent: Monday, August 08, 2005 9:20 PM
> To: Jetspeed Users List
> Subject: Re: How to change portlet windowState in Velocity template?
> 
> It works! Thanks, Scott!
> Another question:
> What I want is to control portlet window state. So I did like this:
> 
> 1. Put WindowState constant into velocity context in portlet class:
> // WindowState constants
> context.put(AcacResources.WINDOWSTATE_MINIMIZED, WindowState.MINIMIZED);
> context.put(AcacResources.WINDOWSTATE_MAXIMIZED, WindowState.MAXIMIZED);
> context.put(AcacResources.WINDOWSTATE_NORMAL, WindowState.NORMAL);
> 
> 2. Call it like this(according to you suggestion):
> #set($ActionUrl = $$renderResponse.createActionURL())
> $!ActionUrl.setWindowState($maximizedState)
> <a href="$ActionUrl">Max Me</a>
> 
> Is there any better solution? Since the parameter of setWindowState()
> is not string but an object, do I have to put it into context before I
> can use it. Is that possible to use a java class in vm files directly?
> 
> - James Liao
> 
> On 8/8/05, Scott T Weaver <sc...@binary-designs.net> wrote:
> > Hi James,
> >
> > Try this:
> >
> > #set($editUrl = $response.createRenderURL())
> > $!editUrl.setPortletMode("EDIT")
> >
> > <a href="$editUrl">Edit Me</a>
> >
> > Hth,
> > -Scott
> >
> > > -----Original Message-----
> > > From: James Liao [mailto:jian.liao@gmail.com]
> > > Sent: Sunday, August 07, 2005 8:57 PM
> > > To: Jetspeed Users List
> > > Subject: How to change portlet windowState in Velocity template?
> > >
> > > Hi all,
> > > I need your help. As I know, I can write something like this(intercept
> > > from PickANumber.jsp):
> > > <portlet:renderURL var="helpMe" portletMode='help'/>
> > > <portlet:renderURL var="editMe" portletMode='Edit'/>
> > > <portlet:renderURL var="maxMe" windowState='Maximized'/>
> > > <portlet:renderURL var="minMe" windowState='Minimized'/>
> > > to generate some urls which can change the portlet instance's mode or
> > > portlet instance's window state. How to do the same thing in  Velocity
> > > template(*.vm files)?
> > >
> > > Another question:
> > > Can I change a portlet's mode or portlet window state in portlet's
> > > doView() or doAction methods directly?
> > >
> > > Any help would be appreciated!
> > >
> > > - James Liao
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org



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


Re: How to change portlet windowState in Velocity template?

Posted by James Liao <ji...@gmail.com>.
It works! Thanks, Scott!
Another question:
What I want is to control portlet window state. So I did like this:

1. Put WindowState constant into velocity context in portlet class:
// WindowState constants
context.put(AcacResources.WINDOWSTATE_MINIMIZED, WindowState.MINIMIZED);
context.put(AcacResources.WINDOWSTATE_MAXIMIZED, WindowState.MAXIMIZED);
context.put(AcacResources.WINDOWSTATE_NORMAL, WindowState.NORMAL);

2. Call it like this(according to you suggestion):
#set($ActionUrl = $$renderResponse.createActionURL())
$!ActionUrl.setWindowState($maximizedState)
<a href="$ActionUrl">Max Me</a>

Is there any better solution? Since the parameter of setWindowState()
is not string but an object, do I have to put it into context before I
can use it. Is that possible to use a java class in vm files directly?

- James Liao

On 8/8/05, Scott T Weaver <sc...@binary-designs.net> wrote:
> Hi James,
> 
> Try this:
> 
> #set($editUrl = $response.createRenderURL())
> $!editUrl.setPortletMode("EDIT")
> 
> <a href="$editUrl">Edit Me</a>
> 
> Hth,
> -Scott
> 
> > -----Original Message-----
> > From: James Liao [mailto:jian.liao@gmail.com]
> > Sent: Sunday, August 07, 2005 8:57 PM
> > To: Jetspeed Users List
> > Subject: How to change portlet windowState in Velocity template?
> >
> > Hi all,
> > I need your help. As I know, I can write something like this(intercept
> > from PickANumber.jsp):
> > <portlet:renderURL var="helpMe" portletMode='help'/>
> > <portlet:renderURL var="editMe" portletMode='Edit'/>
> > <portlet:renderURL var="maxMe" windowState='Maximized'/>
> > <portlet:renderURL var="minMe" windowState='Minimized'/>
> > to generate some urls which can change the portlet instance's mode or
> > portlet instance's window state. How to do the same thing in  Velocity
> > template(*.vm files)?
> >
> > Another question:
> > Can I change a portlet's mode or portlet window state in portlet's
> > doView() or doAction methods directly?
> >
> > Any help would be appreciated!
> >
> > - James Liao
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
>

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


RE: How to change portlet windowState in Velocity template?

Posted by Scott T Weaver <sc...@binary-designs.net>.
Hi James,

Try this:

#set($editUrl = $response.createRenderURL())
$!editUrl.setPortletMode("EDIT")

<a href="$editUrl">Edit Me</a>

Hth,
-Scott

> -----Original Message-----
> From: James Liao [mailto:jian.liao@gmail.com]
> Sent: Sunday, August 07, 2005 8:57 PM
> To: Jetspeed Users List
> Subject: How to change portlet windowState in Velocity template?
> 
> Hi all,
> I need your help. As I know, I can write something like this(intercept
> from PickANumber.jsp):
> <portlet:renderURL var="helpMe" portletMode='help'/>
> <portlet:renderURL var="editMe" portletMode='Edit'/>
> <portlet:renderURL var="maxMe" windowState='Maximized'/>
> <portlet:renderURL var="minMe" windowState='Minimized'/>
> to generate some urls which can change the portlet instance's mode or
> portlet instance's window state. How to do the same thing in  Velocity
> template(*.vm files)?
> 
> Another question:
> Can I change a portlet's mode or portlet window state in portlet's
> doView() or doAction methods directly?
> 
> Any help would be appreciated!
> 
> - James Liao
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org



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