nl.innovationinvestments.cheyenne.engine
Class Dialog

java.lang.Object
  extended by nl.innovationinvestments.cheyenne.engine.Dialog

public abstract class Dialog
extends Object

This is the base class for every Cheyenne dialog. Legacy mode: - JDBC: autoCommit - SQL: strings, no binding Default mode: - JDBC: transaction (autocommit upon dialog exit) - SQL: all parameters through binding


Nested Class Summary
static class Dialog.ESCAPING
           
 
Field Summary
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
Dialog()
           
 
Method Summary
 Connection borrowJdbcConnection(String id)
          JdbcConnection
 nl.knowledgeplaza.soaptools.client.SoapClient borrowSoapClient(String id)
           
 void commit()
          commit all connections and return them to the pool
protected  String convertToString(Object o)
           
protected  void dialogSection()
           
 void enteringLoop(Loop loop)
           
 List<DataSet> fillAndRememberFlashContext()
           
 DataSet findDataSetById(String id)
          Find the data set by ID
 void generateDialog()
           
 void generateDialog(boolean clearData)
          generate a dialog
 void generateDialogInit()
          prepare running the generate dialog This is a separate method because logically this code belongs in the generateDialog method, however due to multithreading issues it must be run prior to spawning the two thread (generateDialog & XSLT).
 void generateDialogThroughXSLT(String id)
          generate a dialog (using a new thread)
 String getAnnotation(String name)
          get an annotation
 String getApp()
           
 String getContentType()
           
 Context getContext()
           
 Loop getCurrentLoop()
           
 int getDatabaseType()
           
 int getDatabaseType(String id)
           
 String getDefaultJdbcConnectionName()
           
 String getDiagMode()
           
 String getEncoding()
           
 Dialog.ESCAPING getEscaping()
           
 String getId()
          Id
 String getIdFull()
           
 String getLanguage()
           
 int getLanguageIdx(String[] languages)
           
 boolean getLegacyMode()
           
 Loop getLoop(int level)
          Get the loop
 List<Loop> getLoops()
          Return all loops, index = 0 is current loop
 String getNextUrl()
           
 PrintWriter getPrintWriter()
           
 String getRole()
           
 nl.knowledgeplaza.soaptools.client.SoapClient getSoapClient(SOAP soap)
           
 String getTarget()
           
 String getUser()
           
 boolean hasAnnotation(String name)
          true if an annotation is present
protected  void initialize()
           
 boolean isAnnotationTrue(String name)
          true if an annotation is present and its content is equals true, yes, 1, ...
 void leavingLoop(Loop loop)
           
 void loadDialog()
           
 void loadDialog(boolean clearData)
           
protected  void loadSection()
           
 Assign newAssign()
          Return a instance of this tag (optionally from a pool)
 DatasetAction newDatasetAction()
          Return a instance of this tag (optionally from a pool)
 If newIf()
          Return a instance of this tag (optionally from a pool)
 Loop newLoop()
          Return a instance of this tag (optionally from a pool)
 Redirect newRedirect()
          Return a instance of this tag (optionally from a pool)
 SOAP newSOAP()
          Return a instance of this tag (optionally from a pool)
 Sql newSql()
          Return a instance of this tag (optionally from a pool)
 Textfile newTextfile()
          Return a instance of this tag (optionally from a pool)
 XML newXML()
          Return a instance of this tag (optionally from a pool)
 Map<String,String> outParameters()
          outParameters is used for requesting the output parameters and the content for example the soap message receiver
 void pickupFlashContext()
          Pick up an existing flash dataset from the session and move it to the old-flashcontext
protected  void print(String x)
          Output to writer
 void registerDataSet(DataSet dataSet)
          Newest dataset is put at #0
 void registerDataSet(SQLDataSet dataSet)
          Newest dataset is put at #0
 void registerDataSet(XMLDataSet dataSet)
          Newest dataset is put at #0
 void registerSoapClient(SOAP soap, nl.knowledgeplaza.soaptools.client.SoapClient soapClient)
           
 void rememberFlashContext(List<DataSet> flashDataSets)
          Also used by the CheyenneServlet
 void removeAnnotation(String name)
          remove an annotation
 String resolve(String input)
           
 String resolve(String input, Dialog.ESCAPING escaping)
          This will resolve all variables (or even nested variables) in the input string.
 String resolveColumnName(String input)
           
 Object resolveInAssign(String name)
           
 Object resolveInDataSet(String name)
           
 String resolveInParent(String variableName)
           
 Object resolveSingleVariable(String variableName)
          This will resolve a single variable (% are already stripped) First the data set is searched Secondly the input parameters Thirdly the configuration parameters
 String resolveSingleVariableAsString(String variableName)
           
 String resolveWithoutEscapingTheResult(String input)
          This will resolve all variables (or even nested variables) in the input string
 void returnConnection(String id, Connection connection)
           
 void returnSoapClient(String id, nl.knowledgeplaza.soaptools.client.SoapClient client)
           
 void rollback()
          rollback all connections and return them to the pool
 void setAnnotation(String name, String value)
          add an annotation
 void setApp(String value)
          App
 void setAssign(String id, Object value)
           
 void setContentType(String value)
          ContentType
 void setContext(Context value)
          Context
 void setDefaultJdbcConnectionName(String value)
          DefaultJdbcConnectionName
 void setDiagMode(String value)
           
 void setEncoding(String value)
          Encoding @see http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html
 void setEscaping(Dialog.ESCAPING value)
          Escaping
 void setLanguage(String value)
          Language
 void setLegacyMode(boolean value)
          LegacyMode
 void setNextUrl(String value)
          NextUrl
 void setPrintWriter(PrintWriter value)
          PrintWriter
 void setRole(String value)
          Role
 void setTarget(String value)
          Target
protected  void setupFromContext()
           
 void setUser(String value)
          User
 void submitDialog()
           
 void submitDialog(boolean clearData)
          submit a dialog Use this method to optionally clear the data (for unittests)
protected  void submitSection()
           
 void unregisterAllDataSets()
           
 void unregisterDataSet(DataSet dataSet)
           
 void unregisterDataSet(XMLDataSet dataSet)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

Dialog

public Dialog()
Method Detail

setupFromContext

protected void setupFromContext()

setContext

public void setContext(Context value)
Context


getContext

public Context getContext()

setEncoding

public void setEncoding(String value)
Encoding @see http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html


getEncoding

public String getEncoding()

setContentType

public void setContentType(String value)
ContentType


getContentType

public String getContentType()

setDefaultJdbcConnectionName

public void setDefaultJdbcConnectionName(String value)
DefaultJdbcConnectionName


getDefaultJdbcConnectionName

public String getDefaultJdbcConnectionName()

setNextUrl

public void setNextUrl(String value)
NextUrl


getNextUrl

public String getNextUrl()

getId

public String getId()
Id


getIdFull

public String getIdFull()

setPrintWriter

public void setPrintWriter(PrintWriter value)
PrintWriter


getPrintWriter

public PrintWriter getPrintWriter()

setLegacyMode

public void setLegacyMode(boolean value)
LegacyMode


getLegacyMode

public boolean getLegacyMode()

setEscaping

public void setEscaping(Dialog.ESCAPING value)
Escaping


getEscaping

public Dialog.ESCAPING getEscaping()

setTarget

public void setTarget(String value)
Target


getTarget

public String getTarget()

setApp

public void setApp(String value)
App


getApp

public String getApp()

setRole

public void setRole(String value)
Role


getRole

public String getRole()

setUser

public void setUser(String value)
User


getUser

public String getUser()

setLanguage

public void setLanguage(String value)
Language


getLanguage

public String getLanguage()

setDiagMode

public void setDiagMode(String value)

getDiagMode

public String getDiagMode()

borrowJdbcConnection

public Connection borrowJdbcConnection(String id)
JdbcConnection


returnConnection

public void returnConnection(String id,
                             Connection connection)

commit

public void commit()
commit all connections and return them to the pool


rollback

public void rollback()
rollback all connections and return them to the pool


borrowSoapClient

public nl.knowledgeplaza.soaptools.client.SoapClient borrowSoapClient(String id)

returnSoapClient

public void returnSoapClient(String id,
                             nl.knowledgeplaza.soaptools.client.SoapClient client)

initialize

protected void initialize()

loadSection

protected void loadSection()

dialogSection

protected void dialogSection()

submitSection

protected void submitSection()

loadDialog

public void loadDialog(boolean clearData)
Parameters:
clearData -

loadDialog

public void loadDialog()

generateDialogInit

public void generateDialogInit()
prepare running the generate dialog This is a separate method because logically this code belongs in the generateDialog method, however due to multithreading issues it must be run prior to spawning the two thread (generateDialog & XSLT).


generateDialog

public void generateDialog(boolean clearData)
generate a dialog


generateDialog

public void generateDialog()

generateDialogThroughXSLT

public void generateDialogThroughXSLT(String id)
generate a dialog (using a new thread)


submitDialog

public void submitDialog(boolean clearData)
submit a dialog Use this method to optionally clear the data (for unittests)


submitDialog

public void submitDialog()

pickupFlashContext

public void pickupFlashContext()
Pick up an existing flash dataset from the session and move it to the old-flashcontext


fillAndRememberFlashContext

public List<DataSet> fillAndRememberFlashContext()

rememberFlashContext

public void rememberFlashContext(List<DataSet> flashDataSets)
Also used by the CheyenneServlet


newIf

public If newIf()
Return a instance of this tag (optionally from a pool)


newLoop

public Loop newLoop()
Return a instance of this tag (optionally from a pool)


newSql

public Sql newSql()
Return a instance of this tag (optionally from a pool)


newTextfile

public Textfile newTextfile()
Return a instance of this tag (optionally from a pool)


newRedirect

public Redirect newRedirect()
Return a instance of this tag (optionally from a pool)


newAssign

public Assign newAssign()
Return a instance of this tag (optionally from a pool)


newDatasetAction

public DatasetAction newDatasetAction()
Return a instance of this tag (optionally from a pool)


newXML

public XML newXML()
Return a instance of this tag (optionally from a pool)


newSOAP

public SOAP newSOAP()
Return a instance of this tag (optionally from a pool)


registerDataSet

public void registerDataSet(DataSet dataSet)
Newest dataset is put at #0


unregisterDataSet

public void unregisterDataSet(DataSet dataSet)
Parameters:
dataSet -

findDataSetById

public DataSet findDataSetById(String id)
Find the data set by ID

Parameters:
id -
Returns:

unregisterAllDataSets

public void unregisterAllDataSets()

resolveInDataSet

public Object resolveInDataSet(String name)
Parameters:
name -
Returns:

registerDataSet

public void registerDataSet(SQLDataSet dataSet)
Newest dataset is put at #0


registerDataSet

public void registerDataSet(XMLDataSet dataSet)
Newest dataset is put at #0


unregisterDataSet

public void unregisterDataSet(XMLDataSet dataSet)
Parameters:
dataSet -

setAssign

public void setAssign(String id,
                      Object value)

resolveInAssign

public Object resolveInAssign(String name)
Parameters:
name -
Returns:

resolve

public String resolve(String input,
                      Dialog.ESCAPING escaping)
This will resolve all variables (or even nested variables) in the input string.


resolve

public String resolve(String input)

resolveColumnName

public String resolveColumnName(String input)
                         throws CheyenneEngineException
Throws:
CheyenneEngineException

resolveWithoutEscapingTheResult

public String resolveWithoutEscapingTheResult(String input)
This will resolve all variables (or even nested variables) in the input string


resolveSingleVariable

public Object resolveSingleVariable(String variableName)
This will resolve a single variable (% are already stripped) First the data set is searched Secondly the input parameters Thirdly the configuration parameters


resolveSingleVariableAsString

public String resolveSingleVariableAsString(String variableName)

resolveInParent

public String resolveInParent(String variableName)
Parameters:
variableName -
Returns:

convertToString

protected String convertToString(Object o)
Parameters:
o -
Returns:

enteringLoop

public void enteringLoop(Loop loop)

leavingLoop

public void leavingLoop(Loop loop)

getCurrentLoop

public Loop getCurrentLoop()
Returns:

getLoop

public Loop getLoop(int level)
Get the loop

Parameters:
level - 0 = current loop, 1 = one level below current, etc
Returns:

getLoops

public List<Loop> getLoops()
Return all loops, index = 0 is current loop

Returns:

print

protected void print(String x)
Output to writer


getLanguageIdx

public int getLanguageIdx(String[] languages)

setAnnotation

public void setAnnotation(String name,
                          String value)
add an annotation


getAnnotation

public String getAnnotation(String name)
get an annotation


removeAnnotation

public void removeAnnotation(String name)
remove an annotation


hasAnnotation

public boolean hasAnnotation(String name)
true if an annotation is present


isAnnotationTrue

public boolean isAnnotationTrue(String name)
true if an annotation is present and its content is equals true, yes, 1, ...


outParameters

public Map<String,String> outParameters()
outParameters is used for requesting the output parameters and the content for example the soap message receiver


getSoapClient

public nl.knowledgeplaza.soaptools.client.SoapClient getSoapClient(SOAP soap)
Parameters:
WSDL -
action -
Returns:

registerSoapClient

public void registerSoapClient(SOAP soap,
                               nl.knowledgeplaza.soaptools.client.SoapClient soapClient)
Parameters:
WSDL -
action -

getDatabaseType

public int getDatabaseType(String id)

getDatabaseType

public int getDatabaseType()


Copyright © 2013 InnovationInvestments. All rights reserved.