}
public static MappingAndController getActionMapping(HttpServletRequest request, FlowController flowController, String action)
{
ActionConfig mapping = null;
FlowController fc = null;
if (flowController != null) {
//
// If there's a '.' delimiter, it's a shared flow action.
//
int dot = action.indexOf('.');
if (dot == -1) {
//
// It's an action in the current page flow, or in the (deprecated) Global.app.
//
if (action.charAt(0) != '/') action = '/' + action;
mapping = flowController.theModuleConfig().findActionConfig(action);
fc = flowController;
//
// If we don't find it in the current page flow, look in Global.app.
//
if (mapping == null) {
FlowController globalApp =
PageFlowUtils.getSharedFlow(InternalConstants.GLOBALAPP_CLASSNAME, request);
if (globalApp != null) {
mapping = globalApp.theModuleConfig().findActionConfig(action);
fc = globalApp;
}
}
}
else if (dot < action.length() - 1) {
//
// It's an action in a shared flow.
//
String sharedFlowName = action.substring(0, dot);
if (sharedFlowName.length() > 0 && sharedFlowName.charAt(0) == '/') {
sharedFlowName = sharedFlowName.substring(1);
}
FlowController sharedFlow = (FlowController) PageFlowUtils.getSharedFlows(request).get(sharedFlowName);
if (sharedFlow != null) {
String actionPath = '/' + action.substring(dot + 1);
mapping = sharedFlow.theModuleConfig().findActionConfig(actionPath);
fc = sharedFlow;
}
}
}