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 Dan Moore <mo...@yahoo.com> on 2004/10/20 06:00:35 UTC

customizing the customizer

Hi folks,

I'm interested in changing the customizer.  In particular, some of the
UI requirements are
1.  moving portlets (which will always be done within one column) takes
place in a select box.
2.  removing portlets needs to be checkboxes
3.  Adding portlets needs to happen in one step.  (Well, two steps,
actually--go to a page with a set of portlets, select them, and have
them added.)

I've done #1 by modifying
org.apache.jetspeed.modules.actions.controllers.MultiColumnControllerAction.doSave(),
and I feel like #2 is possible via the same means.

Two questions:
1. Is hacking the source code the best way to implement these changes? 
I looked on the mailing list and in the config files and didn't see any
alternative.

2. Is #3 possible?   Any hints on thois?  From the behavior and
glancing at the source, it looks like the add page modifies a variable
in PageSessionState, which is then saved in the doSave() method.

Thanks for your help,
Dan

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


Re: customizing the customizer

Posted by Dan Moore <mo...@yahoo.com>.
--- Rapha�l Luta <ra...@apache.org> wrote:

> Dan Moore wrote:
> 
> >Hi Raphael,
> >
> >--- Rapha�l Luta <ra...@apache.org> wrote:
> ><snip>
> >
> >  
> >
> >>You'll be better off copying the Action class or whatever class you
> 
> >>customize and register your modified class in the Registry
> >>in A MyCustomizeSetPortlet and update the properties file to use
> this
> >>one instead of the original one.
> >>This way your changes won't be messed if you upgrade to a new
> version
> >>of 
> >>jetspeed.
> >>    
> >>
> >
> >I subclassed the MultiColumnControllerAction and overrode the
> relevant
> >methods.  I changed the value in controllers.xreg--is that the
> registry
> >you're talking about (I also looked in registry.xml and didn't see
> >anything that looked relevant)?  
> >
> >  
> >
> registry.xml is something you should not be concerned about unless
> you 
> need to extend the
> registry schema (deep customization).
> Instead of modifying the entry in conrollers.xreg, I would probably
> have 
> cloned it into a local-controllers.xreg
> and renamed the controller names somewhat differently (ie
> MyTwoColumns 
> instead of TwoColumns).
> Then change the default controller used by Jetspeed in my.properties:
> 
> services.PortalToolkit.default.controller=MyTwoColumns
> 
> and update the existing PSML files with explicit controllers to
> MyTwoColumns instead
> of TwoColumns.
> 
> 
> That way, you preserve all your environment even when you update the 
> controllers.xreg next time you upgrade
> Jetspeed.

Thanks for the advice.

> >Unfortunately, I had to put my subclass in the same package as
> >MultiColumnControllerAction; it wasn't found otherwise.  Jetspeed
> >seemed to ignore the modules.packages property I added to
> >TurbineResources.properties.
> >  
> >
> It should work, otherwise this is a major bug that needs to be fixed
> !

Oops.  I had a portlet that wasn't correctly configured, and I
misdiagnosed the behavior of jetspeed after that.

<snip>

Thanks,
Dan

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


Re: customizing the customizer

Posted by Raphaël Luta <ra...@apache.org>.
Dan Moore wrote:

>Hi Raphael,
>
>--- Raphaël Luta <ra...@apache.org> wrote:
><snip>
>
>  
>
>>You'll be better off copying the Action class or whatever class you 
>>customize and register your modified class in the Registry
>>in A MyCustomizeSetPortlet and update the properties file to use this
>>one instead of the original one.
>>This way your changes won't be messed if you upgrade to a new version
>>of 
>>jetspeed.
>>    
>>
>
>I subclassed the MultiColumnControllerAction and overrode the relevant
>methods.  I changed the value in controllers.xreg--is that the registry
>you're talking about (I also looked in registry.xml and didn't see
>anything that looked relevant)?  
>
>  
>
registry.xml is something you should not be concerned about unless you 
need to extend the
registry schema (deep customization).
Instead of modifying the entry in conrollers.xreg, I would probably have 
cloned it into a local-controllers.xreg
and renamed the controller names somewhat differently (ie MyTwoColumns 
instead of TwoColumns).
Then change the default controller used by Jetspeed in my.properties:

services.PortalToolkit.default.controller=MyTwoColumns

and update the existing PSML files with explicit controllers to MyTwoColumns instead
of TwoColumns.


That way, you preserve all your environment even when you update the 
controllers.xreg next time you upgrade
Jetspeed.

>Unfortunately, I had to put my subclass in the same package as
>MultiColumnControllerAction; it wasn't found otherwise.  Jetspeed
>seemed to ignore the modules.packages property I added to
>TurbineResources.properties.
>  
>
It should work, otherwise this is a major bug that needs to be fixed !

> Right now, here's the process I go through to add a portlet to a pane.
>
>1. Click on the customize button of a pane.
>2. Click on the 'Add Portlet' button.
>3. Choose a portlet or two.
>4. Click 'Apply.'
>5. Click 'Save and Apply.'
>
>I'd like to turn that into this process:
>
>1. Click on the 'add content' button of a pane.
>2. Choose a portlet or two.
>3. Click 'Save and Apply.'
>
>I tried fiddling with the url I'm sent to after clicking the add button
>and going there directly after logging in, but I seem to have to go
>through the intermediate step (when I try to go directly, I'm just
>returned to the home page).  Perhaps the information that the add
>action needs is not present.
>
>  
>
Here's an example that works for me (but you can try it on any jetspeed 
install):

1. Login on the sample jetspeed site:  http://www.bluesunrise.com/jetspeed/
2. Once logged in, type the following URL:
http://www.bluesunrise.com/jetspeed/portal/template/Customize/mode/add?action=controls.Customize

Note:  this screen will not return directly into the "main" page unless 
you modify the range of buttons,
ie you need to copy the "Save and Apply" button and logic from the main 
layout customization screen.

-- 
Raphaël Luta - raphael@apache.org
Apache Portals - Enterprise Portal in Java
http://portals.apache.org/


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


Re: customizing the customizer

Posted by Dan Moore <mo...@yahoo.com>.
Hi Raphael,

--- Rapha�l Luta <ra...@apache.org> wrote:

> Dan Moore wrote:
> 
> > Hi folks,
> > 
> > I'm interested in changing the customizer.  In particular, some of
> the
> > UI requirements are
> > 1.  moving portlets (which will always be done within one column)
> takes
> > place in a select box.
> > 2.  removing portlets needs to be checkboxes
> > 3.  Adding portlets needs to happen in one step.  (Well, two steps,
> > actually--go to a page with a set of portlets, select them, and
> have
> > them added.)
> > 
> > I've done #1 by modifying
> >
>
org.apache.jetspeed.modules.actions.controllers.MultiColumnControllerAction.doSave(),
> > and I feel like #2 is possible via the same means.
> > 
> > Two questions:
> > 1. Is hacking the source code the best way to implement these
> changes? 
> > I looked on the mailing list and in the config files and didn't see
> any
> > alternative.
> > 
> 
> You'll be better off copying the Action class or whatever class you 
> customize and register your modified class in the Registry
> in A MyCustomizeSetPortlet and update the properties file to use this
> one instead of the original one.
> This way your changes won't be messed if you upgrade to a new version
> of 
> jetspeed.

I subclassed the MultiColumnControllerAction and overrode the relevant
methods.  I changed the value in controllers.xreg--is that the registry
you're talking about (I also looked in registry.xml and didn't see
anything that looked relevant)?  

Unfortunately, I had to put my subclass in the same package as
MultiColumnControllerAction; it wasn't found otherwise.  Jetspeed
seemed to ignore the modules.packages property I added to
TurbineResources.properties.

Or are you referring to the PortletSetCustomizer in admin.xreg? 
Doesn't that refer to portlet specific customization, not the
customizer?  Or am I missing something?

> Even if you describe it, I assume you have updated the relevant
> Velocity
> templates in webapp/WEB-INF/templates to show your select boxes.

Yes, I modified
WEB-INF/templates/vm/controllers/html/multicolumn-customize.vm to show
the select boxes. 

> I'm not exactly sure why you had to modify the action class since #1
> and 
> #2 look to me as only simplification of the UI (ie the templates) 
> without major impact on the backend code.

Unfortunately, I couldn't figure out how to do it easily.  It looks
like the templates and java classes have a common data structure, the
customize-columns attribute of the SessionState.  I'm not sure how to
modify that in velocity--I couldn't find a reference to that attribute
in any of the velocity templates.

> > 2. Is #3 possible?   Any hints on thois?  From the behavior and
> > glancing at the source, it looks like the add page modifies a
> variable
> > in PageSessionState, which is then saved in the doSave() method.
> > 
> 
> I don't understand the difference with the current process.
> So I'll say it's pretty simple to implement but you may need to
> explain
> in more details what you're trying to achieve and how it differs from
> 
> the default behavior if you want more information on this.

Right now, here's the process I go through to add a portlet to a pane.

1. Click on the customize button of a pane.
2. Click on the 'Add Portlet' button.
3. Choose a portlet or two.
4. Click 'Apply.'
5. Click 'Save and Apply.'

I'd like to turn that into this process:

1. Click on the 'add content' button of a pane.
2. Choose a portlet or two.
3. Click 'Save and Apply.'

I tried fiddling with the url I'm sent to after clicking the add button
and going there directly after logging in, but I seem to have to go
through the intermediate step (when I try to go directly, I'm just
returned to the home page).  Perhaps the information that the add
action needs is not present.

Thanks for your time.
Dan

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


Re: customizing the customizer

Posted by Raphaël Luta <ra...@apache.org>.
Dan Moore wrote:

> Hi folks,
> 
> I'm interested in changing the customizer.  In particular, some of the
> UI requirements are
> 1.  moving portlets (which will always be done within one column) takes
> place in a select box.
> 2.  removing portlets needs to be checkboxes
> 3.  Adding portlets needs to happen in one step.  (Well, two steps,
> actually--go to a page with a set of portlets, select them, and have
> them added.)
> 
> I've done #1 by modifying
> org.apache.jetspeed.modules.actions.controllers.MultiColumnControllerAction.doSave(),
> and I feel like #2 is possible via the same means.
> 
> Two questions:
> 1. Is hacking the source code the best way to implement these changes? 
> I looked on the mailing list and in the config files and didn't see any
> alternative.
> 

You'll be better off copying the Action class or whatever class you 
customize and register your modified class in the Registry
in A MyCustomizeSetPortlet and update the properties file to use this
one instead of the original one.
This way your changes won't be messed if you upgrade to a new version of 
jetspeed.
Even if you describe it, I assume you have updated the relevant Velocity
templates in webapp/WEB-INF/templates to show your select boxes.
I'm not exactly sure why you had to modify the action class since #1 and 
#2 look to me as only simplification of the UI (ie the templates) 
without major impact on the backend code.

> 2. Is #3 possible?   Any hints on thois?  From the behavior and
> glancing at the source, it looks like the add page modifies a variable
> in PageSessionState, which is then saved in the doSave() method.
> 

I don't understand the difference with the current process.
So I'll say it's pretty simple to implement but you may need to explain
in more details what you're trying to achieve and how it differs from 
the default behavior if you want more information on this.

-- 
Raphaël Luta - raphael@apache.org
Apache Portals - Enterprise Portal in Java
http://portals.apache.org/

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