* @param name the registry SkinEntry name
* @return the new PortletSkin object
*/
public PortletSkin getSkin(String name)
{
BasePortletSkin result = new BasePortletSkin();
SkinEntry entry = null;
if (name != null)
{
entry = (SkinEntry) Registry.getEntry(Registry.SKIN, name);
}
// either we don't have any skin defined, the skin reference is null
// or the skin reference is invalid, in all case, retrieve the default
// skin entry
if (entry == null)
{
entry = (SkinEntry) Registry.getEntry(Registry.SKIN, this.defaultSkin);
}
if (entry != null)
{
// build the PortletSkin object
result.setName(entry.getName());
result.putAll(entry.getParameterMap());
}
// Make the skin aware of what the user agent is capable of.
JetspeedRunDataService jrds =
(JetspeedRunDataService) ServiceUtil.getServiceByName(RunDataService.SERVICE_NAME);
JetspeedRunData jData = jrds.getCurrentRunData();
if(jData != null)
{
result.setCapabilityMap(jData.getCapability());
}
return result;
}