org.makumba.controller
Class Logic

java.lang.Object
  extended by org.makumba.controller.Logic

public class Logic
extends Object

business logic administration


Nested Class Summary
(package private) static class Logic.AuthorizationConstraint
           
 
Field Summary
(package private) static Class<?>[] argDb
           
(package private) static Class<?>[] argDbOld
           
(package private) static int authConstraints
           
(package private) static Class<?>[] deleteArgs
           
(package private) static Class<?>[] deleteArgsOld
           
(package private) static Class<?>[] editArgs
           
(package private) static Class<?>[] editArgsOld
           
(package private) static int logix
           
(package private) static HashMap<String,Object> nameToObject
           
(package private) static Class<?>[] newArgs
           
(package private) static Class<?>[] newArgsOld
           
(package private) static Class<?>[] noClassArgs
           
(package private) static Object[] noObjectArgs
           
(package private) static Class<?>[] opArgs
           
(package private) static Class<?>[] opArgsOld
           
(package private) static String[] separators
           
 
Constructor Summary
Logic()
           
 
Method Summary
static Object computeActor(String attname, Attributes a, String db, DbConnectionProvider dbcp)
           
protected static void computeThickActorSession(String attname, String type, DataDefinition dd, QueryAnalysisProvider qap, Transaction connection, Pointer p, MakumbaActorHashMap ret, String att)
          Computes a thick session of the current actor, by evaluating all functions with no parameters.
static Pointer doAdd(Object controller, String handlerName, String afterHandlerName, String typename, Pointer p, Dictionary<String,Object> data, Attributes a, String dbName, DbConnectionProvider dbcp)
           
static Pointer doDelete(Object controller, String typename, Pointer p, Attributes a, String dbName, DbConnectionProvider dbcp)
           
static Pointer doEdit(Object controller, String handlerName, String afterHandlerName, String typename, Pointer p, Dictionary<String,Object> data, Attributes a, String dbName, DbConnectionProvider dbcp)
           
static void doInit(Object controller, Attributes a, String dbName, DbConnectionProvider dbcp)
           
static void doInit(String path, Attributes a, String dbName, DbConnectionProvider dbcp)
           
static Pointer doNew(Object controller, String handlerName, String afterHandlerName, String typename, Dictionary<String,Object> data, Attributes a, String dbName, DbConnectionProvider dbcp)
           
static Object doOp(Object controller, String opName, Dictionary<String,Object> data, Attributes a, String dbName, DbConnectionProvider dbcp)
           
static String findPackageName(String directory)
          Finds the name of the package to be used for the given directory.
(package private) static String firstUpper(String a)
           
static Object getAttribute(Object controller, String attname, Attributes a, String db, DbConnectionProvider dbcp)
           
static Object getAuthorizationConstraint(String path)
          gets the authorization constraint associated with the given URI path
static Object getController(String className)
           
static String getControllerFile(Object controller)
           
static String getFilePath(URL u)
           
static Object getLogic(String path)
          gets the logic associated with the given package and path according to directory rules
static Method getMethod(String name, Class<?>[] args, Class<?>[] argsOld, Object controller)
           
static Method getMethod(String name, Class<?>[] args, Object controller)
           
static String getSearchMessage(String cls)
           
static TransactionProvider getTransactionProvider(Object controller)
           
static Set<String> logoutActor(DataDefinition dd)
           
static String upperCase(String a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameToObject

static HashMap<String,Object> nameToObject

logix

static int logix

authConstraints

static int authConstraints

separators

static String[] separators

argDbOld

static Class<?>[] argDbOld

argDb

static Class<?>[] argDb

editArgsOld

static Class<?>[] editArgsOld

editArgs

static Class<?>[] editArgs

opArgsOld

static Class<?>[] opArgsOld

opArgs

static Class<?>[] opArgs

noClassArgs

static Class<?>[] noClassArgs

noObjectArgs

static Object[] noObjectArgs

deleteArgsOld

static Class<?>[] deleteArgsOld

deleteArgs

static Class<?>[] deleteArgs

newArgsOld

static Class<?>[] newArgsOld

newArgs

static Class<?>[] newArgs
Constructor Detail

Logic

public Logic()
Method Detail

getSearchMessage

public static String getSearchMessage(String cls)

getController

public static Object getController(String className)

findPackageName

public static String findPackageName(String directory)
Finds the name of the package to be used for the given directory.

Parameters:
directory - the directory to find the package for.
Returns:
the package name found, or an empty String in case no package was found.

getAuthorizationConstraint

public static Object getAuthorizationConstraint(String path)
gets the authorization constraint associated with the given URI path


upperCase

public static String upperCase(String a)

firstUpper

static String firstUpper(String a)

getLogic

public static Object getLogic(String path)
gets the logic associated with the given package and path according to directory rules


getAttribute

public static Object getAttribute(Object controller,
                                  String attname,
                                  Attributes a,
                                  String db,
                                  DbConnectionProvider dbcp)
                           throws NoSuchMethodException,
                                  LogicException
Throws:
NoSuchMethodException
LogicException

computeActor

public static Object computeActor(String attname,
                                  Attributes a,
                                  String db,
                                  DbConnectionProvider dbcp)
                           throws LogicException
Throws:
LogicException

computeThickActorSession

protected static void computeThickActorSession(String attname,
                                               String type,
                                               DataDefinition dd,
                                               QueryAnalysisProvider qap,
                                               Transaction connection,
                                               Pointer p,
                                               MakumbaActorHashMap ret,
                                               String att)
                                        throws ProgrammerError
Computes a thick session of the current actor, by evaluating all functions with no parameters.

Throws:
ProgrammerError

logoutActor

public static Set<String> logoutActor(DataDefinition dd)

getControllerFile

public static String getControllerFile(Object controller)

getFilePath

public static String getFilePath(URL u)

getMethod

public static Method getMethod(String name,
                               Class<?>[] args,
                               Object controller)

getMethod

public static Method getMethod(String name,
                               Class<?>[] args,
                               Class<?>[] argsOld,
                               Object controller)

doInit

public static void doInit(String path,
                          Attributes a,
                          String dbName,
                          DbConnectionProvider dbcp)
                   throws LogicException
Throws:
LogicException

doInit

public static void doInit(Object controller,
                          Attributes a,
                          String dbName,
                          DbConnectionProvider dbcp)
                   throws LogicException
Throws:
LogicException

getTransactionProvider

public static TransactionProvider getTransactionProvider(Object controller)
                                                  throws LogicInvocationError
Throws:
LogicInvocationError

doOp

public static Object doOp(Object controller,
                          String opName,
                          Dictionary<String,Object> data,
                          Attributes a,
                          String dbName,
                          DbConnectionProvider dbcp)
                   throws LogicException
Throws:
LogicException

doEdit

public static Pointer doEdit(Object controller,
                             String handlerName,
                             String afterHandlerName,
                             String typename,
                             Pointer p,
                             Dictionary<String,Object> data,
                             Attributes a,
                             String dbName,
                             DbConnectionProvider dbcp)
                      throws LogicException
Throws:
LogicException

doDelete

public static Pointer doDelete(Object controller,
                               String typename,
                               Pointer p,
                               Attributes a,
                               String dbName,
                               DbConnectionProvider dbcp)
                        throws LogicException
Throws:
LogicException

doAdd

public static Pointer doAdd(Object controller,
                            String handlerName,
                            String afterHandlerName,
                            String typename,
                            Pointer p,
                            Dictionary<String,Object> data,
                            Attributes a,
                            String dbName,
                            DbConnectionProvider dbcp)
                     throws LogicException
Throws:
LogicException

doNew

public static Pointer doNew(Object controller,
                            String handlerName,
                            String afterHandlerName,
                            String typename,
                            Dictionary<String,Object> data,
                            Attributes a,
                            String dbName,
                            DbConnectionProvider dbcp)
                     throws LogicException
Throws:
LogicException