|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WebApp
Interface for WebApp. A WebApp is the main executable object in the WebEngine, with collections of pages, methods, variables, and links to other models.
Field Summary | |
---|---|
static int |
BUILTIN_ACTION
Returned value from getActionType for built-in Factory-defined action |
static java.lang.String |
CACHE_CONTROL_MAP_PROPERTY
WebApp Property name used for Map of CacheControl |
static java.lang.String |
DEBUG_TRACING_MAP_PROPERTY
WebApp Property name used for DebugTracing |
static java.lang.String |
ENABLE_FAILOVER_PROPERTY
WebApp Property name for enabling failover. |
static java.lang.String |
EVENT_ONERROR_ALL_ACTIONS
Pseudo-action name meaning to watch all actions |
static java.lang.String |
EVENT_ONERROR_PREFIX
Prefix for individual action error handlers |
static java.lang.String |
EVENT_ONLOAD
Name of event fired each time an instance of the WebApp is loaded |
static java.lang.String |
EVENT_ONREQUEST
Name of event fired for every external request to the WebApp |
static java.lang.String |
EVENT_ONREQUEST_COMPLETE
Name of event fired for every external request complete to the WebApp |
static java.lang.String |
EVENT_UNHANDLED_ERROR
Name of Error handler event, fired if an error is unhandled |
static java.lang.String |
GENERATION_ERRORS
WebApp Property name for List of generation errors, if any |
static java.lang.String |
GENERATION_WARNINGS
WebApp Property name for List of generation warnings, if any |
static int |
LINKED_MODEL_ACTION
Returned value from getActionType for Linked Model action |
static int |
LJO_METHOD_ACTION
Returned value from getActionType for LJO action |
static int |
METHOD_ACTION
Returned value from getActionType for Method action |
static java.lang.String |
METHOD_CLASS_INSTANCE
Property name used by system |
static java.lang.String |
MULTI_REQUEST_LOCK_ENABLE_PROPERTY
WebApp Property name for enabling multi-request lock of WebApp instance. |
static int |
PAGE_ACTION
Returned value from getActionType for Page action |
static java.lang.String |
SYSTEM_EVENT_PREFIX
prefix for System events |
static int |
UNKNOWN_ACTION
Returned value from getActionType for unknown action |
Method Summary | |
---|---|
ActionList |
addActionList(java.lang.String actionListName)
Add a ActionList |
ClassInfo |
addClass(java.lang.String name)
Adds a Java source class (ClassInfo) object to the WebApp. |
ConfigInfo |
addConfigInfo(java.lang.String name,
java.lang.Object configObject)
Adds a configuration (ConfigInfo) object to the WebApp. |
DataService |
addDataService(java.lang.String name)
Adds a DataService to the WebApp. |
LinkedModel |
addLinkedModel(java.lang.String linkedModelName,
java.lang.String modelName)
Add a Linked Model to model |
Variable |
addLinkedObjectVariable(java.lang.String name,
java.lang.String className)
Add a Java Linked Object variable to the list. |
Method |
addMethod(java.lang.String methodName)
Add a Java method |
ActionListAction |
addMethodCall(java.lang.String methodCallName,
java.lang.String methodName)
Add a method call (internally an ActionList with a single Action) |
Page |
addPage(java.lang.String pageName)
Add a Page to model |
Schema |
addSchema(java.lang.String name,
java.lang.String schemaSource,
java.lang.String importsLoc)
Add a Schema to the webapp, the schema source being supplied in the call. |
Schema |
addSchema(java.lang.String name,
java.lang.String schemaSource,
java.lang.String importsLoc,
java.util.List otherSchemas)
Add a Schema to the webapp, the schema source being supplied in the call. |
Schema |
addSchema(java.lang.String name,
java.net.URL url)
Add a Schema to the webapp, the schema being identified by the supplied URL. |
Variable |
addVariable(java.lang.String name,
java.lang.String type)
Add a variable to the WebApp. |
java.lang.String |
generateIndirectReference(java.lang.String input,
java.lang.String runtimeType)
Create Java source expression for a builder input which can be an indirect reference, for example: ${Variables/strVar} is resolved to: webAppAccess.getVariables().getString("strVar") If "input" is a literal (does not use ${ syntax) it is returned as-is |
java.lang.String |
generateUniqueName(java.lang.String base)
Generate a name which will not conflict with any existing Variable, LinkedModel, or Action names. |
WebAppObject |
getAction(java.lang.String name)
Get any "action" in model (Page, ActionList, Method). |
ActionList |
getActionList(java.lang.String actionListName)
Look up ActionList by name |
java.util.Iterator |
getActionLists()
Get list of all the ActionLists in the WebApp. |
int |
getActionType(java.lang.String actionName)
Gets the Action type for the specified name. |
ClassInfo |
getClass(java.lang.String name)
Gets the specifed ClassInfo by name. |
java.util.Iterator |
getClasses()
Gets an Iterator of the ClassInfo objects on this WebApp. |
java.util.Iterator |
getConfigInfo()
Gets an Iterator of the ConfigInfo objects on this WebApp. |
ConfigInfo |
getConfigInfo(java.lang.String name)
Gets the specifed ConfigInfo by name. |
com.bowstreet.webapp.DataDefinitionManager |
getDataDefinitionManager()
Get the DataDefinitionManager which has been set as the default one. |
DataService |
getDataService(java.lang.String name)
Gets DataService by name. |
java.util.Iterator |
getDataServices()
Get an iterator over the list of DataService objects in this WebApp. |
LinkedModel |
getLinkedModel(java.lang.String linkedModelName)
Look up a linked model by name |
java.util.Iterator |
getLinkedModels()
Get list of all the linked models in this WebApp. |
Method |
getMethod(java.lang.String methodName)
Look up a Method by name. |
java.util.Iterator |
getMethods()
Get list of all the Methods in the WebApp. |
java.lang.String |
getModelName()
Gets the name of the Model |
Page |
getPage(java.lang.String pageName)
Look up a Page by name |
java.util.Iterator |
getPages()
Get list of all the Pages in the WebApp. |
java.util.Iterator |
getProperties()
Gets an iterator to the keys of the properties. |
java.lang.Object |
getProperty(java.lang.String key)
Gets the specified WebApp property. |
RegenSettings |
getRegenSettings()
Get RegenSettings used to create this WebApp. |
Schema |
getSchema(java.lang.String name)
Get the Schema object corresponding to the supplied name in this webapp. |
java.util.Iterator |
getSchemas()
Returns an Iterator over the list of the Schemas in this WebApp. |
java.lang.String |
getUniqueKey()
Gets the unique "key" for this generated version of the WebApp. |
Variable |
getVariable(java.lang.String name)
Get a variable by name |
java.util.Iterator |
getVariables()
Get an iterator over the list of all the variables in this WebApp. |
void |
putProperty(java.lang.String key,
java.lang.Object value)
Sets the specified WebApp property. |
boolean |
renameWebAppObject(java.lang.String name,
java.lang.String newName)
Change the name of a WebApp object, returning true if this was possible. |
void |
setBaseDataDefinitionFile(java.lang.String fileName,
BuilderCall builderCall)
Creates the default DataDefinitionManager from a Rich Data Definition file (usually .xml). |
boolean |
variableExists(java.lang.String variableName)
See if the specified name is already in use as a Variable or LinkedModel (since these must share a namespace). |
Methods inherited from interface com.bowstreet.webapp.WebAppEventContainer |
---|
addEventListener, getEventListeners, getEventListeners |
Field Detail |
---|
static final int BUILTIN_ACTION
static final java.lang.String CACHE_CONTROL_MAP_PROPERTY
static final java.lang.String DEBUG_TRACING_MAP_PROPERTY
static final java.lang.String ENABLE_FAILOVER_PROPERTY
static final java.lang.String EVENT_ONERROR_ALL_ACTIONS
static final java.lang.String EVENT_ONERROR_PREFIX
static final java.lang.String EVENT_ONLOAD
static final java.lang.String EVENT_ONREQUEST
static final java.lang.String EVENT_ONREQUEST_COMPLETE
static final java.lang.String EVENT_UNHANDLED_ERROR
static final java.lang.String GENERATION_ERRORS
static final java.lang.String GENERATION_WARNINGS
static final int LINKED_MODEL_ACTION
static final int LJO_METHOD_ACTION
static final int METHOD_ACTION
static final java.lang.String METHOD_CLASS_INSTANCE
static final java.lang.String MULTI_REQUEST_LOCK_ENABLE_PROPERTY
static final int PAGE_ACTION
static final java.lang.String SYSTEM_EVENT_PREFIX
static final int UNKNOWN_ACTION
Method Detail |
---|
ActionList addActionList(java.lang.String actionListName)
actionListName
- The name for the ActionList
Create a "main" Action List that calls page1. ActionList al = webApp.addActionList("main"); al.addPageAction("page1");
ClassInfo addClass(java.lang.String name)
name
- The name of the ClassInfo object to create and add.ConfigInfo addConfigInfo(java.lang.String name, java.lang.Object configObject)
configObject
- The configuration object to store.DataService addDataService(java.lang.String name)
name
- Name of the operation.
LinkedModel addLinkedModel(java.lang.String linkedModelName, java.lang.String modelName)
linkedModelName
- Local name used in this modelmodelName
- Model name (fully-qualified)
Add a Linked Model called "customerInfo" that links in /acme/portal/editCustomerInfo LinkedModel lm = webApp.addLinkedModel("customerInfo", "/acme/portal/editCustomerInfo");
Variable addLinkedObjectVariable(java.lang.String name, java.lang.String className)
name
- The name for the variableclassName
- The Java class for the variable
Add a linked object to java.util.Date class: Variable dateVar = webApp.addLinkedObjectVariable("dateLJO","java.util.Date");
Method addMethod(java.lang.String methodName)
methodName
- Name for method
Create a method that simply returns an argument value: Method method = webApp.addMethod("sampleMethod"); method.setReturnType("Object"); method.addArgument("dataSource", "Object"); method.setBody("{\nreturn dataSource;\n}");
ActionListAction addMethodCall(java.lang.String methodCallName, java.lang.String methodName)
methodCallName
- Name to give to the ActionList createdmethodName
- Name of method to call
Add a method call to "sampleMethod" passing an indirect reference Object argument: ActionListAction action = webApp.addMethodCall("callSampleMethod", "sampleMethod"); action.addArgumentSource(webApp.generateIndirectReference(dataSource, Variable.TYPE_OBJECT));
Page addPage(java.lang.String pageName)
pageName
- Unique name of page
Add a page with some very simple contents: Page page = webApp.addPage("StartingPage"); IXml html = XmlUtil.create("HTML"); IXml body = html.addChildElement("BODY"); body.addText("This is a simple HTML page"); page.addContents(html);
Schema addSchema(java.lang.String name, java.lang.String schemaSource, java.lang.String importsLoc)
name
- name of the schema, typically the builder nameschemaSource
- the schema sourceimportsLoc
- base path for any relative import statements
Schema addSchema(java.lang.String name, java.lang.String schemaSource, java.lang.String importsLoc, java.util.List otherSchemas)
name
- name of the schema, typically the builder nameschemaSource
- the schema sourceimportsLoc
- if available (maybe null) the URL to this schema source
that can be used to pull in imported schemas with relative paths.otherSchemas
- an optional List of already successfully parsed com.bowstreet.xml.schema.Schema
objects that can be used to resolve references in this schema source.
Schema addSchema(java.lang.String name, java.net.URL url)
name
- name of the schema, typically the builder nameurl
- URL to the schema source, or null if you just want to create the schema object and add DataDefinition elements yourself
Variable addVariable(java.lang.String name, java.lang.String type)
name
- The name for the variabletype
- The type for the variable (e.g. Variable.TYPE_STRING)
Add a String variable with initial value Variable messageVar = webApp.addVariable("message", Variable.TYPE_STRING); messageVar.setValue("This is a test"); Add XML variable with no initial value: Variable dataVar = webApp.addVariable("data", Variable.TYPE_XML); Add XML variable with initial value: Variable city = webApp.addVariable("location", Variable.TYPE_XML); IXml data = XmlUtil.create("Location"); data.addChildWithText("City", "Portsmouth"); data.addChildWithText("State", "NH"); city.setValue(data); Add a read-only XML variable: Variable defaultCity = webApp.addVariable("defaultLocation", Variable.TYPE_XML); IXml data = XmlUtil.create("Location"); data.addChildWithText("City", "New York"); data.addChildWithText("State", "NY"); defaultCity.setValue(data); defaultCity.setPersistFlag(Variable.PERSIST_READONLY);
java.lang.String generateIndirectReference(java.lang.String input, java.lang.String runtimeType)
input
- The indirect literal or reference, e.g. ${Variables/foo}runtimeType
- The runtime type expected (must be one of the Variable.TYPE_ values)
Add a method call to "sampleMethod" passing an indirect reference Object argument: ActionListAction action = webApp.addMethodCall("callSampleMethod", "sampleMethod"); action.addArgumentSource(webApp.generateIndirectReference(dataSource, Variable.TYPE_OBJECT)); Add a method that returns the value for a builder input that can be an indirect reference: String builderName = builderInputs.getString("Name", null); String referenceInput = builderInputs.getString("Value", ""); String javaExpression = webApp.generateIndirectReference(referenceInput, "Object"); String methodName = builderName + "_getValue"; Method method = webApp.addMethod(methodName); method.setReturnType("Object"); method.setBody("{\n return " + javaExpression + ";\n}"); method.setHidden(true); // optional - hide this generated method in Designer // Builder can now generate other code that references the "methodName" method
java.lang.String generateUniqueName(java.lang.String base)
base
- Beginning portion of name
WebAppObject getAction(java.lang.String name)
name
- The unique ID of the Page, ActionList, or Method
ActionList getActionList(java.lang.String actionListName)
actionListName
- The unique name of ActionList
java.util.Iterator getActionLists()
Print the names of all the ActionLists: Iterator i = webApp.getActionLists(); System.out.println("ActionLists:"); while (i.hasNext()) { ActionList al = (ActionList)i.next(); System.out.println("Action List name: " + al.getName()); }
int getActionType(java.lang.String actionName)
actionName
- The local name of the action in the webApp.
ClassInfo getClass(java.lang.String name)
name
- The name of the ClassInfo object to get.
java.util.Iterator getClasses()
java.util.Iterator getConfigInfo()
ConfigInfo getConfigInfo(java.lang.String name)
name
- The name of the ConfigInfo object to get.
com.bowstreet.webapp.DataDefinitionManager getDataDefinitionManager()
DataService getDataService(java.lang.String name)
name
- Name of DataService.
java.util.Iterator getDataServices()
LinkedModel getLinkedModel(java.lang.String linkedModelName)
linkedModelName
- Name of linked model
java.util.Iterator getLinkedModels()
Print the names of all the Linked Models: Iterator i = webApp.getLinkedModels(); System.out.println("Linked Models:"); while (i.hasNext()) { LinkedModel lm = (LinkedModel)i.next(); System.out.println("Linked Model name: " + lm.getName()); }
Method getMethod(java.lang.String methodName)
methodName
- The unique name of method
java.util.Iterator getMethods()
Iterator i = webApp.getMethods(); System.out.println("Methods:"); while (i.hasNext()) { Method m = (Method)i.next(); System.out.println("Method name: " + m.getName()); }
java.lang.String getModelName()
Page getPage(java.lang.String pageName)
pageName
- The unique ID of the page
java.util.Iterator getPages()
Print the names of all the Pages: Iterator i = webApp.getPages(); System.out.println("Pages:"); while (i.hasNext()) { Page p = (Page)i.next(); System.out.println("Page name: " + p.getName()); }
java.util.Iterator getProperties()
java.lang.Object getProperty(java.lang.String key)
key
- The String key.
RegenSettings getRegenSettings()
Schema getSchema(java.lang.String name)
java.util.Iterator getSchemas()
java.lang.String getUniqueKey()
Variable getVariable(java.lang.String name)
name
- The name for the variable
java.util.Iterator getVariables()
Print the names of all the Variables: Iterator i = webApp.getVariables(); System.out.println("Variables:"); while (i.hasNext()) { Variable v = (Variable)i.next(); System.out.println("Variable name: " + v.getName()); }
void putProperty(java.lang.String key, java.lang.Object value)
key
- The String key.value
- The Object value to store with WebApp.boolean renameWebAppObject(java.lang.String name, java.lang.String newName)
name
- the name of the existing WebAppObjectnewName
- the new name for this object.
void setBaseDataDefinitionFile(java.lang.String fileName, BuilderCall builderCall)
fileName
- The filename, relative from WebContent, if null, bowstreet.properties value will be used; may be a semi-colon separated listbuilderCall
- The builderCall invoking this; It can be null, but some RDD operations will not be supported.boolean variableExists(java.lang.String variableName)
variableName
- The name of a Linked Model or Variable.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |