com.aoindustries.website
Class SkinAction

java.lang.Object
  extended by Action
      extended by com.aoindustries.website.SiteSettingsAction
          extended by com.aoindustries.website.LocaleAction
              extended by com.aoindustries.website.SkinAction
Direct Known Subclasses:
LogoutAction, ProtocolAction, SetResourceBundleMediaTypeAction, SetResourceBundleValueAction

public class SkinAction
extends LocaleAction

Resolves the current skin, sets the request param skin, and calls subclass implementation.

Author:
Dan Armstrong <dan@aoindustries.com>

Constructor Summary
SkinAction()
           
 
Method Summary
 ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SiteSettings siteSettings, java.util.Locale locale)
          Selects the Skin, sets the request attribute "skin", then the subclass execute method is invoked.
 ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SiteSettings siteSettings, java.util.Locale locale, Skin skin)
          Once the skin is selected, this version of the execute method is invoked.
static Skin getDefaultSkin(java.util.List<Skin> skins, javax.servlet.http.HttpServletRequest req)
          Gets the default skin from the provided list for the provided request.
static Skin getSkin(SiteSettings settings, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Gets the skin for the current request.
 
Methods inherited from class com.aoindustries.website.LocaleAction
execute, getDefaultLocale, getEffectiveLocale
 
Methods inherited from class com.aoindustries.website.SiteSettingsAction
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkinAction

public SkinAction()
Method Detail

getDefaultSkin

public static Skin getDefaultSkin(java.util.List<Skin> skins,
                                  javax.servlet.http.HttpServletRequest req)
Gets the default skin from the provided list for the provided request. Blackberry and Lynx will default to "Text" if in the list, otherwise the first skin is selected.


getSkin

public static Skin getSkin(SiteSettings settings,
                           javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse resp)
                    throws javax.servlet.jsp.JspException
Gets the skin for the current request.
  1. If the parameter "layout" exists, it will get the class name for the skin from the servlet parameters and set the skin.
  2. If the parameter "layout" doesn't exist and a skin has been selected, then it returns the current skin.
  3. Sets the skin from the servlet parameters for "Default".

Throws:
javax.servlet.jsp.JspException

execute

public final ActionForward execute(ActionMapping mapping,
                                   ActionForm form,
                                   javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   SiteSettings siteSettings,
                                   java.util.Locale locale)
                            throws java.lang.Exception
Selects the Skin, sets the request attribute "skin", then the subclass execute method is invoked. It also stores any "su" request for later processing by AuthenticatedAction.

Overrides:
execute in class LocaleAction
Throws:
java.lang.Exception
See Also:
#execute(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse,Locale,Skin)

execute

public ActionForward execute(ActionMapping mapping,
                             ActionForm form,
                             javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             SiteSettings siteSettings,
                             java.util.Locale locale,
                             Skin skin)
                      throws java.lang.Exception
Once the skin is selected, this version of the execute method is invoked. The default implementation of this method simply returns the mapping of "success".

Throws:
java.lang.Exception