public String encode(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action)
throws UnsupportedEncodingException
{
if ( mode != null || state != null )
{
PortletApplication pa = null;
if (mode != null && !JetspeedActions.getStandardPortletModes().contains(mode))
{
pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getPortletApplicationDefinition();
mode = pa.getMappedPortletMode(mode);
}
if (state != null && !JetspeedActions.getStandardWindowStates().contains(state))
{
if ( pa == null )
{
pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getPortletApplicationDefinition();
}
state = pa.getMappedWindowState(state);
}
}
return codec.encode(requestStates, window, parameters, mode, state, action, isNavigationalParameterStateFull(),
isRenderParameterStateFull());
}