com.fatwire.gst.foundation.mobile.action
Class DeviceAwareRenderPageAction

java.lang.Object
  extended by com.fatwire.gst.foundation.controller.BaseRenderPage
      extended by com.fatwire.gst.foundation.controller.action.RenderPage
          extended by com.fatwire.gst.foundation.mobile.action.DeviceAwareRenderPageAction
All Implemented Interfaces:
Action

public class DeviceAwareRenderPageAction
extends RenderPage

RenderPage action extension that handles translations as well as device detection to direct the visitor to the device specific template.

The rule is straight forward. If the template is X then a lookup is done if there is a Template with the name X_mobile and that is used if the visitor is using a mobile device. The same for _desktop and _tablet. If such a template does not exist, the 'normal' template is used.

Author:
Dolf Dijkstra

Field Summary
 DeviceDetector detector
           
 LocaleService localeService
           
 
Fields inherited from class com.fatwire.gst.foundation.controller.BaseRenderPage
aliasCoreFieldDao, CALLTEMPLATE_EXCLUDE_VARS, ics, LOG, PACKEDARGS, pathTranslationService, URL_PATH, VIRTUAL_WEBROOT, wraCoreFieldDao
 
Constructor Summary
DeviceAwareRenderPageAction()
           
 
Method Summary
protected  void callPage(AssetIdWithSite id, String pagename, String packedArgs)
           
protected  void callTemplate(AssetIdWithSite id, String tname)
           
protected  String checkForDevicePagename(AssetIdWithSite id, String pagename, DeviceType type)
           
protected  String checkForDeviceTName(AssetIdWithSite id, String tname, DeviceType type)
           
protected  AssetIdWithSite findTranslation(AssetIdWithSite id)
           
protected  String getPostfix(DeviceType type)
           
protected  AssetIdWithSite resolveAssetId()
          In this method the AssetId and the site are resolved.
 
Methods inherited from class com.fatwire.gst.foundation.controller.action.RenderPage
handleRequest, setAliasCoreFieldDao, setIcs, setWraCoreFieldDao, setWraPathTranslationService
 
Methods inherited from class com.fatwire.gst.foundation.controller.BaseRenderPage
findAndSetP, getCallTemplateArguments, getCallTemplateCallStyle, getWraAndResolveAlias, imposeCallTemplateStyle, massagePackedArgs, recordCompositionalDependencies, renderPage, unpackPackedArgs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

detector

@InjectForRequest
public DeviceDetector detector

localeService

@InjectForRequest
public LocaleService localeService
Constructor Detail

DeviceAwareRenderPageAction

public DeviceAwareRenderPageAction()
Method Detail

resolveAssetId

protected AssetIdWithSite resolveAssetId()
Description copied from class: BaseRenderPage
In this method the AssetId and the site are resolved. Based on either c/cid or the virtual-webroot/url-path arguments the site which this asset belongs to is discovered from the AssetPublication table.

Overrides:
resolveAssetId in class BaseRenderPage
Returns:
the AssetId and the site that the asset belongs to.

callTemplate

protected void callTemplate(AssetIdWithSite id,
                            String tname)
Overrides:
callTemplate in class BaseRenderPage

callPage

protected void callPage(AssetIdWithSite id,
                        String pagename,
                        String packedArgs)
Overrides:
callPage in class BaseRenderPage

findTranslation

protected AssetIdWithSite findTranslation(AssetIdWithSite id)

getPostfix

protected String getPostfix(DeviceType type)

checkForDeviceTName

protected String checkForDeviceTName(AssetIdWithSite id,
                                     String tname,
                                     DeviceType type)

checkForDevicePagename

protected String checkForDevicePagename(AssetIdWithSite id,
                                        String pagename,
                                        DeviceType type)


Copyright © 2010-2013 Oracle Corporation. All Rights Reserved.