|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bowstreet.builders.webapp.foundation.BaseWebAppControlBuilder
public class BaseWebAppControlBuilder
Base class typical WebApp control builders will want to override.
Field Summary | |
---|---|
protected BuilderCall |
builderCall
|
protected BuilderInputs |
builderInputs
|
protected static java.lang.String |
DOJO_ADDED
|
protected static java.lang.String |
DOJO_TYPE
|
protected GenContext |
genContext
|
protected com.bowstreet.webapp.PageContentInserter |
pageContentInserter
|
protected PageLocation |
pageLocation
|
protected java.util.Collection |
pageLocationEntries
|
protected static boolean |
removeDojoType
|
protected static java.lang.String |
TRUE
|
protected WebApp |
webApp
|
Constructor Summary | |
---|---|
BaseWebAppControlBuilder()
|
Method Summary | |
---|---|
protected void |
addCommonHTMLAttributes(IXml element)
Used to set common HTML elements in an automated fashion. |
boolean |
containsSpecialCharacters(java.lang.String candidate)
Method to determine if a string input contains special characters that may need to be escaped to avoid a JSP compile issue. |
boolean |
deferSelfFirst()
This determines whether or not this builder will defer itself before calling handleConstruction. |
void |
doBuilderCall(GenContext genContext,
WebApp webApp,
BuilderCall builderCall,
BuilderInputs builderInputs,
PageLocation pageLocation)
doBuilderCall - WebApp builders do their regen work here, getting inputs from builderInputs and adding/modifying elements in 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 |
generatePageIndirectReference(java.lang.String input,
java.lang.String runtimeType)
Transform a ${...} reference to an equivalent JSP expression. |
protected BuilderCall |
getBuilderCall()
Return BuilderCall object for this builder invocation. |
protected BuilderInputs |
getBuilderInputs()
Return the builder inputs specified in builder call |
protected com.bowstreet.webapp.structures.PageDomainObject |
getDomainObjectForBuilderCall(java.lang.String pageName,
java.lang.String builderId,
IXml node)
Finds a domain object that pertains to ther curent builder call. |
protected GenContext |
getGenContext()
Return the GenContext object for this builder invocation. |
java.lang.String |
getHtmlSafePageIndirectInput(java.lang.String inputName,
java.lang.String defaultValue)
Transform a builder input which might contain a ${...} reference to an equivalent JSP expression. |
java.lang.String |
getIndirectInput(java.lang.String inputName,
java.lang.String defaultValue,
java.lang.String type)
Transform a builder input which might contain a ${...} reference to equivalent Java code. |
java.lang.String |
getIndirectStringInput(java.lang.String inputName,
java.lang.String defaultValue)
Transform a builder input which might contain a ${...} reference to equivalent Java code. |
protected java.lang.String |
getIndirectText(java.lang.String inputName,
java.lang.String defaultValue)
Transform a builder input which might contain a ${...} reference to an equivalent Java code. |
java.lang.String |
getIndirectXmlInput(java.lang.String inputName,
java.lang.String defaultValue)
Transform a builder input which might contain a ${...} reference to equivalent Java code. |
static java.lang.String |
getJavaFromJSP(java.lang.String inp)
Extract the Java code from inside a JSP expression. |
java.lang.String |
getPageIndirectInput(java.lang.String inputName,
java.lang.String defaultValue)
Transform a builder input which might contain a ${...} reference to an equivalent JSP expression. |
protected java.lang.String |
getPageIndirectText(java.lang.String inputName,
java.lang.String defaultValue)
Transform a builder input which might contain a ${...} reference to an equivalent JSP expression. |
protected java.util.Collection |
getPageLocationEntries()
|
protected java.lang.String |
getPreferredPhase()
Get preferred phase, to run the handlePage and handleControl methods in; Return PHASE_POSTCONSTRUCTION, PHASE_MODIFICATION or PHASE_VALIDATION. |
protected WebApp |
getWebApp()
Return the top-level object under contstruction. |
protected void |
handleConstruction()
Called once per invocation, to handle non-page/control work in the contsruction phase. |
protected void |
handleControl(Page page,
IXml element)
Called for each location needing modification. |
protected void |
handleModification()
Called once per invocation, to handle non-page/control work in the modification phase. |
protected void |
handlePage(Page page)
Called for each page needing modification. |
protected void |
handlePostConstruction()
Called once per invocation, to handle non-page/control work in the post-contsruction phase. |
protected void |
handleValidation()
Called once per invocation, to handle validation and other operations which must happen very late. |
protected void |
preprocessControl(Page page,
IXml element)
Hook for base classes to pre-process an element before it is passed off to handleControl(). |
protected void |
preprocessElement(IXml element)
If a control builder is being applied then remove the existing dojoType, if one of our builder has added it. |
protected void |
processCommonInputs(IXml element)
Common input handling support - called just before handleControl. |
static void |
replaceElement(IXml element,
IXml newNode)
Convenience routine: replace element with new node, if possible. |
static void |
replaceElement(IXml element,
java.util.List newNodes)
Convenience routine: replace element with new nodes, if possible. |
java.lang.String |
resolvePageIndirectReference(java.lang.String input,
java.lang.String runtimeType)
Transform a ${...} reference to an equivalent JSP expression. |
static boolean |
tagDisplaysChildContent(java.lang.String tagName)
Returns false if the specified HTML tag isn't allowed to have child elements (e.g., <INPUT>) or won't directly display contained content (e.g., <SELECT>) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BuilderCall builderCall
protected BuilderInputs builderInputs
protected static final java.lang.String DOJO_ADDED
protected static final java.lang.String DOJO_TYPE
protected GenContext genContext
protected com.bowstreet.webapp.PageContentInserter pageContentInserter
protected PageLocation pageLocation
protected java.util.Collection pageLocationEntries
protected static boolean removeDojoType
protected static final java.lang.String TRUE
protected WebApp webApp
Constructor Detail |
---|
public BaseWebAppControlBuilder()
Method Detail |
---|
protected void addCommonHTMLAttributes(IXml element)
public boolean containsSpecialCharacters(java.lang.String candidate)
candidate
- The string to check for special characters.
public boolean deferSelfFirst()
public void doBuilderCall(GenContext genContext, WebApp webApp, BuilderCall builderCall, BuilderInputs builderInputs, PageLocation pageLocation)
doBuilderCall
in interface WebAppControlBuilder
genContext
- The GenContext for this regenwebApp
- The WebApp under constructionbuilderCall
- Use this to set errors, get BuilderDef, etc.builderInputs
- The inputs for this builder callpageLocation
- A PageLocation instance describing where to insert the controlpublic 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)
public java.lang.String generatePageIndirectReference(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)
protected BuilderCall getBuilderCall()
protected BuilderInputs getBuilderInputs()
protected com.bowstreet.webapp.structures.PageDomainObject getDomainObjectForBuilderCall(java.lang.String pageName, java.lang.String builderId, IXml node)
pageName
- nam eof the page objectbuilderId
- builder call ID to filter out other domain objects in the same page.
PageDomainObject
if one is found or null
otherwise.protected GenContext getGenContext()
public java.lang.String getHtmlSafePageIndirectInput(java.lang.String inputName, java.lang.String defaultValue)
public java.lang.String getIndirectInput(java.lang.String inputName, java.lang.String defaultValue, java.lang.String type)
type
- One of the Variable.TYPE_ Stringspublic java.lang.String getIndirectStringInput(java.lang.String inputName, java.lang.String defaultValue)
protected java.lang.String getIndirectText(java.lang.String inputName, java.lang.String defaultValue)
inputName
- The name of the builder inputdefaultValue
- the value to return use if the specified inputName does not exist.
public java.lang.String getIndirectXmlInput(java.lang.String inputName, java.lang.String defaultValue)
public static java.lang.String getJavaFromJSP(java.lang.String inp)
public java.lang.String getPageIndirectInput(java.lang.String inputName, java.lang.String defaultValue)
protected java.lang.String getPageIndirectText(java.lang.String inputName, java.lang.String defaultValue)
inputName
- The name of the builder inputdefaultValue
- the value to return use if the specified inputName does not exist.
protected java.util.Collection getPageLocationEntries()
protected java.lang.String getPreferredPhase()
protected WebApp getWebApp()
protected void handleConstruction()
protected void handleControl(Page page, IXml element)
page
- The page hosting the elementelement
- The element to be modifiedprotected void handleModification()
protected void handlePage(Page page)
page
- The page to be modifiedprotected void handlePostConstruction()
protected void handleValidation()
protected void preprocessControl(Page page, IXml element)
page
- The page hosting the elementelement
- The element to be modified by the builderprotected void preprocessElement(IXml element)
element
- protected void processCommonInputs(IXml element)
public static void replaceElement(IXml element, IXml newNode)
public static void replaceElement(IXml element, java.util.List newNodes)
public java.lang.String resolvePageIndirectReference(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)
public static boolean tagDisplaysChildContent(java.lang.String tagName)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |