com.bowstreet.webapp.util
Class ModelActionAccess

java.lang.Object
  extended by com.bowstreet.webapp.util.ModelActionAccess

public class ModelActionAccess
extends java.lang.Object

Utility Class used to control the access of model actions from an external request. The control information is specified my the following means 1) A list is stored on the WebApp and populated at regen time by builders that create action references (e.g. Link, Button Builder). There will also be a separate builder that will allow you to add to the specified action so handle the case where there are no references to an action you wish to make public. 2) A global list of Model/Action will be created at runtime and populated by the URL Mappers to handle cases where a URLMapper was manually used to create an action link (i.e. no builder was used).


Field Summary
static java.lang.String BOWSTREET_MODEL_ACCESS_CHECKING_ENABLED
           
static java.lang.String BOWSTREET_PUBLIC_ACTIONS_PROPERTY
           
static boolean enableAccessChecking
           
 
Constructor Summary
ModelActionAccess()
           
 
Method Summary
static void addModelAction(java.lang.String modelName, java.lang.String action)
          Adds a runtime reference for the specified model/action to enable it to be public.
static void addModelAction(WebApp webApp, java.lang.String action)
          Adds a reference for the specified webApp action to enable it to be public.
static boolean isPublicAction(WebApp webApp, java.lang.String action)
          Checks if the specified action is publicly available to be executed from an external request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOWSTREET_MODEL_ACCESS_CHECKING_ENABLED

public static final java.lang.String BOWSTREET_MODEL_ACCESS_CHECKING_ENABLED
See Also:
Constant Field Values

BOWSTREET_PUBLIC_ACTIONS_PROPERTY

public static final java.lang.String BOWSTREET_PUBLIC_ACTIONS_PROPERTY
See Also:
Constant Field Values

enableAccessChecking

public static final boolean enableAccessChecking
Constructor Detail

ModelActionAccess

public ModelActionAccess()
Method Detail

addModelAction

public static void addModelAction(java.lang.String modelName,
                                  java.lang.String action)
Adds a runtime reference for the specified model/action to enable it to be public. This should only be used at runtime. Typically from a URL Mapper class.

Parameters:
modelName - The model name that contains the action.
action - The action to make public.

addModelAction

public static void addModelAction(WebApp webApp,
                                  java.lang.String action)
Adds a reference for the specified webApp action to enable it to be public. This is mostly used at regen, and when the URL mapper knows the WebApp of the model action (itself).

Parameters:
webApp - The WebApp that contains the action.
action - The action to make public.

isPublicAction

public static boolean isPublicAction(WebApp webApp,
                                     java.lang.String action)
Checks if the specified action is publicly available to be executed from an external request.

Parameters:
webApp - The WebApp that contains the action.
action - The action name to check.
Returns:
true if the specified action is public, else false.


Copyright © 2009 IBM. All Rights Reserved.