org.ofbiz.minilang
Class SimpleMethod

java.lang.Object
  extended by org.ofbiz.minilang.SimpleMethod

public class SimpleMethod
extends java.lang.Object

SimpleMethod Mini Language Core Object


Field Summary
protected  java.lang.String defaultErrorCode
           
protected  java.lang.String defaultSuccessCode
           
protected  java.lang.String delegatorName
           
protected  java.lang.String dispatcherName
           
static java.lang.String err_resource
           
protected  java.lang.String eventErrorMessageListName
           
protected  java.lang.String eventErrorMessageName
           
protected  java.lang.String eventEventMessageListName
           
protected  java.lang.String eventEventMessageName
           
protected  java.lang.String eventRequestName
           
protected  java.lang.String eventResponseCodeName
           
protected  java.lang.String eventResponseName
           
protected  java.lang.String eventSessionName
           
protected  java.lang.String fromLocation
           
protected  java.lang.String localeName
           
protected  boolean loginRequired
           
protected  java.lang.String methodName
           
protected  java.util.List<MethodOperation> methodOperations
           
static java.lang.String module
           
protected  java.lang.String parameterMapName
           
protected  java.util.Map<java.lang.String,SimpleMethod> parentSimpleMethodsMap
           
protected  java.lang.String securityName
           
protected  java.lang.String serviceErrorMessageListName
           
protected  java.lang.String serviceErrorMessageMapName
           
protected  java.lang.String serviceErrorMessageName
           
protected  java.lang.String serviceResponseMessageName
           
protected  java.lang.String serviceSuccessMessageListName
           
protected  java.lang.String serviceSuccessMessageName
           
protected  java.lang.String shortDescription
           
protected static UtilCache<java.lang.String,java.util.Map<java.lang.String,SimpleMethod>> simpleMethodsDirectCache
           
protected static UtilCache<java.lang.String,java.util.Map<java.lang.String,SimpleMethod>> simpleMethodsResourceCache
           
protected static UtilCache<java.net.URL,java.util.Map<java.lang.String,SimpleMethod>> simpleMethodsURLCache
           
protected  java.lang.String userLoginName
           
protected  boolean useTransaction
           
 
Constructor Summary
SimpleMethod(org.w3c.dom.Element simpleMethodElement, java.util.Map<java.lang.String,SimpleMethod> parentSimpleMethodsMap, java.lang.String fromLocation)
           
 
Method Summary
 java.lang.String exec(MethodContext methodContext)
          Execute the Simple Method operations
protected static void findEntityNamesUsed(java.util.List<MethodOperation> methodOperations, java.util.Set<java.lang.String> allEntityNames, java.util.Set<java.lang.String> simpleMethodsVisited)
           
protected static void findServiceNamesCalled(java.util.List<MethodOperation> methodOperations, java.util.Set<java.lang.String> allServiceNames, java.util.Set<java.lang.String> simpleMethodsVisited)
           
protected static java.util.Map<java.lang.String,SimpleMethod> getAllDirectSimpleMethods(java.lang.String name, java.lang.String content, java.lang.String fromLocation)
           
 java.util.Set<java.lang.String> getAllEntityNamesUsed()
           
 java.util.Set<java.lang.String> getAllServiceNamesCalled()
           
protected static java.util.Map<java.lang.String,SimpleMethod> getAllSimpleMethods(java.net.URL xmlURL)
           
 java.lang.String getDefaultErrorCode()
           
 java.lang.String getDefaultSuccessCode()
           
 java.lang.String getDelegatorEnvName()
           
static java.util.Map<java.lang.String,SimpleMethod> getDirectSimpleMethods(java.lang.String name, java.lang.String content, java.lang.String fromLocation)
           
 java.lang.String getDispatcherEnvName()
           
 java.lang.String getEventErrorMessageListName()
           
 java.lang.String getEventErrorMessageName()
           
 java.lang.String getEventEventMessageListName()
           
 java.lang.String getEventEventMessageName()
           
 java.lang.String getEventRequestName()
           
 java.lang.String getEventResponseCodeName()
           
 java.lang.String getEventSessionName()
           
 java.lang.String getFromLocation()
           
 java.lang.String getLocationAndName()
           
 boolean getLoginRequired()
           
 java.lang.String getMethodName()
           
 java.lang.String getParameterMapName()
           
 java.lang.String getSecurityEnvName()
           
 java.lang.String getServiceErrorMessageListName()
           
 java.lang.String getServiceErrorMessageName()
           
 java.lang.String getServiceResponseMessageName()
           
 java.lang.String getServiceSuccessMessageListName()
           
 java.lang.String getServiceSuccessMessageName()
           
 java.lang.String getShortDescription()
           
 SimpleMethod getSimpleMethodInSameFile(java.lang.String simpleMethodName)
           
static java.util.Map<java.lang.String,SimpleMethod> getSimpleMethods(java.lang.String xmlResource, java.lang.ClassLoader loader)
           
static java.util.Map<java.lang.String,SimpleMethod> getSimpleMethods(java.net.URL xmlURL)
           
 java.lang.String getUserLoginEnvName()
           
 boolean getUseTransaction()
           
static void readOperations(org.w3c.dom.Element simpleMethodElement, java.util.List<MethodOperation> methodOperations, SimpleMethod simpleMethod)
           
static java.lang.String runSimpleEvent(java.lang.String xmlResource, java.lang.String methodName, HttpServletRequest request, HttpServletResponse response)
           
static java.lang.String runSimpleEvent(java.lang.String xmlResource, java.lang.String methodName, HttpServletRequest request, HttpServletResponse response, java.lang.ClassLoader loader)
           
static java.lang.String runSimpleEvent(java.net.URL xmlURL, java.lang.String methodName, HttpServletRequest request, HttpServletResponse response, java.lang.ClassLoader loader)
           
static java.lang.String runSimpleMethod(java.lang.String xmlResource, java.lang.String methodName, MethodContext methodContext)
           
static java.lang.String runSimpleMethod(java.net.URL xmlURL, java.lang.String methodName, MethodContext methodContext)
           
static java.util.Map<java.lang.String,java.lang.Object> runSimpleService(java.lang.String xmlResource, java.lang.String methodName, DispatchContext ctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
           
static java.util.Map<java.lang.String,java.lang.Object> runSimpleService(java.lang.String xmlResource, java.lang.String methodName, DispatchContext ctx, java.util.Map<java.lang.String,? extends java.lang.Object> context, java.lang.ClassLoader loader)
           
static java.util.Map<java.lang.String,java.lang.Object> runSimpleService(java.net.URL xmlURL, java.lang.String methodName, DispatchContext ctx, java.util.Map<java.lang.String,? extends java.lang.Object> context, java.lang.ClassLoader loader)
           
static boolean runSubOps(java.util.List<MethodOperation> methodOperations, MethodContext methodContext)
          Execs the given operations returning true if all return true, or returning false and stopping if any return false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

err_resource

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

simpleMethodsDirectCache

protected static UtilCache<java.lang.String,java.util.Map<java.lang.String,SimpleMethod>> simpleMethodsDirectCache

simpleMethodsResourceCache

protected static UtilCache<java.lang.String,java.util.Map<java.lang.String,SimpleMethod>> simpleMethodsResourceCache

simpleMethodsURLCache

protected static UtilCache<java.net.URL,java.util.Map<java.lang.String,SimpleMethod>> simpleMethodsURLCache

methodOperations

protected java.util.List<MethodOperation> methodOperations

parentSimpleMethodsMap

protected java.util.Map<java.lang.String,SimpleMethod> parentSimpleMethodsMap

fromLocation

protected java.lang.String fromLocation

methodName

protected java.lang.String methodName

shortDescription

protected java.lang.String shortDescription

defaultErrorCode

protected java.lang.String defaultErrorCode

defaultSuccessCode

protected java.lang.String defaultSuccessCode

parameterMapName

protected java.lang.String parameterMapName

eventRequestName

protected java.lang.String eventRequestName

eventSessionName

protected java.lang.String eventSessionName

eventResponseName

protected java.lang.String eventResponseName

eventResponseCodeName

protected java.lang.String eventResponseCodeName

eventErrorMessageName

protected java.lang.String eventErrorMessageName

eventErrorMessageListName

protected java.lang.String eventErrorMessageListName

eventEventMessageName

protected java.lang.String eventEventMessageName

eventEventMessageListName

protected java.lang.String eventEventMessageListName

serviceResponseMessageName

protected java.lang.String serviceResponseMessageName

serviceErrorMessageName

protected java.lang.String serviceErrorMessageName

serviceErrorMessageListName

protected java.lang.String serviceErrorMessageListName

serviceErrorMessageMapName

protected java.lang.String serviceErrorMessageMapName

serviceSuccessMessageName

protected java.lang.String serviceSuccessMessageName

serviceSuccessMessageListName

protected java.lang.String serviceSuccessMessageListName

loginRequired

protected boolean loginRequired

useTransaction

protected boolean useTransaction

localeName

protected java.lang.String localeName

delegatorName

protected java.lang.String delegatorName

securityName

protected java.lang.String securityName

dispatcherName

protected java.lang.String dispatcherName

userLoginName

protected java.lang.String userLoginName
Constructor Detail

SimpleMethod

public SimpleMethod(org.w3c.dom.Element simpleMethodElement,
                    java.util.Map<java.lang.String,SimpleMethod> parentSimpleMethodsMap,
                    java.lang.String fromLocation)
Method Detail

runSimpleEvent

public static java.lang.String runSimpleEvent(java.lang.String xmlResource,
                                              java.lang.String methodName,
                                              HttpServletRequest request,
                                              HttpServletResponse response)
                                       throws MiniLangException
Throws:
MiniLangException

runSimpleEvent

public static java.lang.String runSimpleEvent(java.lang.String xmlResource,
                                              java.lang.String methodName,
                                              HttpServletRequest request,
                                              HttpServletResponse response,
                                              java.lang.ClassLoader loader)
                                       throws MiniLangException
Throws:
MiniLangException

runSimpleEvent

public static java.lang.String runSimpleEvent(java.net.URL xmlURL,
                                              java.lang.String methodName,
                                              HttpServletRequest request,
                                              HttpServletResponse response,
                                              java.lang.ClassLoader loader)
                                       throws MiniLangException
Throws:
MiniLangException

runSimpleService

public static java.util.Map<java.lang.String,java.lang.Object> runSimpleService(java.lang.String xmlResource,
                                                                                java.lang.String methodName,
                                                                                DispatchContext ctx,
                                                                                java.util.Map<java.lang.String,? extends java.lang.Object> context)
                                                                         throws MiniLangException
Throws:
MiniLangException

runSimpleService

public static java.util.Map<java.lang.String,java.lang.Object> runSimpleService(java.lang.String xmlResource,
                                                                                java.lang.String methodName,
                                                                                DispatchContext ctx,
                                                                                java.util.Map<java.lang.String,? extends java.lang.Object> context,
                                                                                java.lang.ClassLoader loader)
                                                                         throws MiniLangException
Throws:
MiniLangException

runSimpleService

public static java.util.Map<java.lang.String,java.lang.Object> runSimpleService(java.net.URL xmlURL,
                                                                                java.lang.String methodName,
                                                                                DispatchContext ctx,
                                                                                java.util.Map<java.lang.String,? extends java.lang.Object> context,
                                                                                java.lang.ClassLoader loader)
                                                                         throws MiniLangException
Throws:
MiniLangException

runSimpleMethod

public static java.lang.String runSimpleMethod(java.lang.String xmlResource,
                                               java.lang.String methodName,
                                               MethodContext methodContext)
                                        throws MiniLangException
Throws:
MiniLangException

runSimpleMethod

public static java.lang.String runSimpleMethod(java.net.URL xmlURL,
                                               java.lang.String methodName,
                                               MethodContext methodContext)
                                        throws MiniLangException
Throws:
MiniLangException

getSimpleMethods

public static java.util.Map<java.lang.String,SimpleMethod> getSimpleMethods(java.lang.String xmlResource,
                                                                            java.lang.ClassLoader loader)
                                                                     throws MiniLangException
Throws:
MiniLangException

getSimpleMethods

public static java.util.Map<java.lang.String,SimpleMethod> getSimpleMethods(java.net.URL xmlURL)
                                                                     throws MiniLangException
Throws:
MiniLangException

getAllSimpleMethods

protected static java.util.Map<java.lang.String,SimpleMethod> getAllSimpleMethods(java.net.URL xmlURL)
                                                                           throws MiniLangException
Throws:
MiniLangException

getDirectSimpleMethods

public static java.util.Map<java.lang.String,SimpleMethod> getDirectSimpleMethods(java.lang.String name,
                                                                                  java.lang.String content,
                                                                                  java.lang.String fromLocation)
                                                                           throws MiniLangException
Throws:
MiniLangException

getAllDirectSimpleMethods

protected static java.util.Map<java.lang.String,SimpleMethod> getAllDirectSimpleMethods(java.lang.String name,
                                                                                        java.lang.String content,
                                                                                        java.lang.String fromLocation)
                                                                                 throws MiniLangException
Throws:
MiniLangException

getFromLocation

public java.lang.String getFromLocation()

getMethodName

public java.lang.String getMethodName()

getLocationAndName

public java.lang.String getLocationAndName()

getSimpleMethodInSameFile

public SimpleMethod getSimpleMethodInSameFile(java.lang.String simpleMethodName)

getShortDescription

public java.lang.String getShortDescription()

getDefaultErrorCode

public java.lang.String getDefaultErrorCode()

getDefaultSuccessCode

public java.lang.String getDefaultSuccessCode()

getParameterMapName

public java.lang.String getParameterMapName()

getEventRequestName

public java.lang.String getEventRequestName()

getEventSessionName

public java.lang.String getEventSessionName()

getEventResponseCodeName

public java.lang.String getEventResponseCodeName()

getEventErrorMessageName

public java.lang.String getEventErrorMessageName()

getEventErrorMessageListName

public java.lang.String getEventErrorMessageListName()

getEventEventMessageName

public java.lang.String getEventEventMessageName()

getEventEventMessageListName

public java.lang.String getEventEventMessageListName()

getServiceResponseMessageName

public java.lang.String getServiceResponseMessageName()

getServiceErrorMessageName

public java.lang.String getServiceErrorMessageName()

getServiceErrorMessageListName

public java.lang.String getServiceErrorMessageListName()

getServiceSuccessMessageName

public java.lang.String getServiceSuccessMessageName()

getServiceSuccessMessageListName

public java.lang.String getServiceSuccessMessageListName()

getLoginRequired

public boolean getLoginRequired()

getUseTransaction

public boolean getUseTransaction()

getDelegatorEnvName

public java.lang.String getDelegatorEnvName()

getSecurityEnvName

public java.lang.String getSecurityEnvName()

getDispatcherEnvName

public java.lang.String getDispatcherEnvName()

getUserLoginEnvName

public java.lang.String getUserLoginEnvName()

getAllServiceNamesCalled

public java.util.Set<java.lang.String> getAllServiceNamesCalled()
                                                         throws MiniLangException
Throws:
MiniLangException

findServiceNamesCalled

protected static void findServiceNamesCalled(java.util.List<MethodOperation> methodOperations,
                                             java.util.Set<java.lang.String> allServiceNames,
                                             java.util.Set<java.lang.String> simpleMethodsVisited)
                                      throws MiniLangException
Throws:
MiniLangException

getAllEntityNamesUsed

public java.util.Set<java.lang.String> getAllEntityNamesUsed()
                                                      throws MiniLangException
Throws:
MiniLangException

findEntityNamesUsed

protected static void findEntityNamesUsed(java.util.List<MethodOperation> methodOperations,
                                          java.util.Set<java.lang.String> allEntityNames,
                                          java.util.Set<java.lang.String> simpleMethodsVisited)
                                   throws MiniLangException
Throws:
MiniLangException

exec

public java.lang.String exec(MethodContext methodContext)
Execute the Simple Method operations


readOperations

public static void readOperations(org.w3c.dom.Element simpleMethodElement,
                                  java.util.List<MethodOperation> methodOperations,
                                  SimpleMethod simpleMethod)

runSubOps

public static boolean runSubOps(java.util.List<MethodOperation> methodOperations,
                                MethodContext methodContext)
Execs the given operations returning true if all return true, or returning false and stopping if any return false.