You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by "Weaver, Scott" <Sw...@rippe.com> on 2003/01/03 20:30:11 UTC

RE: [PATCH] Root portlet set's skin not recognized by children

Glen,

I had to totally re-think my approach to this issue, as the patch I submitted does not pass the 4 test cases provided.  However, my new solution does.  The only thing that might stop it from being committed is the fact that I had to add 2 methods to the Portlets interface and in turn to the PsmlPortlets class: 

Portlets getParentPortlets();

void setParentPortlets(Portlets portlets);

This allows a Portlets collection to access its parent Portlets collection.  Now for a simple recursive look-up can be performed to locate the proper skin or use the system default if no skins are defined.

I have been using this patch all day and everything seems fine.  The modification is not very invasive as the only class that really needed to implement the 2 methods was PsmlPortlets.

Let me know if this approach sounds acceptable and I will post the patch.

Scott

> -----Original Message-----
> From: Glen Carl [mailto:carl@csc-monterey.com]
> Sent: Tuesday, December 31, 2002 2:13 PM
> To: Jetspeed Developers List
> Subject: Re: [PATCH] Root portlet set's skin not recognized by children
> 
> Scott,
> Below is info from bugzilla, my proposed fix and my test results on Dec.
> 16, 2002. However, Dec. 26, 2002 David said test case 1 did not work
> with my proposed fix. I have not had a chance to verify. It is possible
> your fix is better, and you may want to run through the test cases to
> verify the algorithm matches what is specified in bugzilla.
> Thanks,
> Glen
> 
>  From bugzilla bug 14909,
> When resolving the skin to use on a portlet, the skin is found using the
> global setting, but doesn't check the parent. The algorithm should:
> - first check the current portlet(set), if no skin then
>    - fallback to its parent, if no skin then
>      - fallback to global setting
> 
> proposed changes to fix issue with portlet skin use.
>   /services/portaltoolkit/JetspeedPortalToolkitService.java
> protected PortletConfig getPortletConfig( Portlets portlets )
>              if (portlets.getSkin()!=null)
>              {
>                  pc.setPortletSkin( getSkin( portlets.getSkin() ) );
>              }
>   remove        else
>   remove        {
>   remove            pc.setPortletSkin( getSkin( this.defaultSkin ) );
>   remove        }
> 
> 
> I ran the following tests.
>  >
>  > 1) no skin ref in PSML
>  > RESULT: uses default skin
>  >
>  > 2) skin set a top level, no skin setting for children portlets
>  > RESULT: children portlets use the top level skin setting
>  >
>  > 3) skin set at top level, and skin set in child portlet
>  > RESULT: uses skin assigned for child portlet
>  >
>  > 4) no skin at top level, and skin set in child portlet
>  > RESULT: uses skin assigned for child portlet, and all other portlets
> use
>  > default
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:jetspeed-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:jetspeed-dev-
> help@jakarta.apache.org>

Re: [PATCH] Root portlet set's skin not recognized by children

Posted by Glen Carl <ca...@csc-monterey.com>.
Sounds very good to me. I think the new methods are a better approach. I 
look forward to trying out your new patch. Thank you for your effort and 
  consideration. Please update bug 14909 when you apply your patch, 
since David was planning to work on this after Jan. 6. I think David 
will be happy too.
Glen

Weaver, Scott wrote:
> Glen,
> 
> I had to totally re-think my approach to this issue, as the patch I submitted does not pass the 4 test cases provided.  However, my new solution does.  The only thing that might stop it from being committed is the fact that I had to add 2 methods to the Portlets interface and in turn to the PsmlPortlets class: 
> 
> Portlets getParentPortlets();
> 
> void setParentPortlets(Portlets portlets);
> 
> This allows a Portlets collection to access its parent Portlets collection.  Now for a simple recursive look-up can be performed to locate the proper skin or use the system default if no skins are defined.
> 
> I have been using this patch all day and everything seems fine.  The modification is not very invasive as the only class that really needed to implement the 2 methods was PsmlPortlets.
> 
> Let me know if this approach sounds acceptable and I will post the patch.
> 
> Scott
> 
> 
>>-----Original Message-----
>>From: Glen Carl [mailto:carl@csc-monterey.com]
>>Sent: Tuesday, December 31, 2002 2:13 PM
>>To: Jetspeed Developers List
>>Subject: Re: [PATCH] Root portlet set's skin not recognized by children
>>
>>Scott,
>>Below is info from bugzilla, my proposed fix and my test results on Dec.
>>16, 2002. However, Dec. 26, 2002 David said test case 1 did not work
>>with my proposed fix. I have not had a chance to verify. It is possible
>>your fix is better, and you may want to run through the test cases to
>>verify the algorithm matches what is specified in bugzilla.
>>Thanks,
>>Glen
>>
>> From bugzilla bug 14909,
>>When resolving the skin to use on a portlet, the skin is found using the
>>global setting, but doesn't check the parent. The algorithm should:
>>- first check the current portlet(set), if no skin then
>>   - fallback to its parent, if no skin then
>>     - fallback to global setting
>>
>>proposed changes to fix issue with portlet skin use.
>>  /services/portaltoolkit/JetspeedPortalToolkitService.java
>>protected PortletConfig getPortletConfig( Portlets portlets )
>>             if (portlets.getSkin()!=null)
>>             {
>>                 pc.setPortletSkin( getSkin( portlets.getSkin() ) );
>>             }
>>  remove        else
>>  remove        {
>>  remove            pc.setPortletSkin( getSkin( this.defaultSkin ) );
>>  remove        }
>>
>>
>>I ran the following tests.
>> >
>> > 1) no skin ref in PSML
>> > RESULT: uses default skin
>> >
>> > 2) skin set a top level, no skin setting for children portlets
>> > RESULT: children portlets use the top level skin setting
>> >
>> > 3) skin set at top level, and skin set in child portlet
>> > RESULT: uses skin assigned for child portlet
>> >
>> > 4) no skin at top level, and skin set in child portlet
>> > RESULT: uses skin assigned for child portlet, and all other portlets
>>use
>> > default
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:jetspeed-dev-
>>unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:jetspeed-dev-
>>help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>