com.dynamide
Class Session

java.lang.Object
  extended by com.dynamide.DynamideObject
      extended by com.dynamide.resource.ContextNode
          extended by com.dynamide.JDOMFile
              extended by com.dynamide.Persistent
                  extended by com.dynamide.Session
All Implemented Interfaces:
IDatasource, IDatasourceBasic, IPropertyProvider, ISession, IContext, IGet, ISessionItem, ISessionTableItem, org.xml.sax.EntityResolver

public class Session
extends Persistent
implements ISession, ISessionItem, ISessionTableItem, IDatasource, IContext

This class manages the user interaction across Page objects, and is the Java-side representation of the application.xml file, which has the page list, page order, and the application-level events.

NOTE: The Session is NOT thread-safe. The DynamideServlet serializes access to the Session for each web request. So each Session is single-threaded while handling a web request, just like the Servlet API spec. For Jobs, the Job runs in a separate thread, but the app programmer must not make any calls that change the state of the session. Legal things to do in a job are tasks such as sending mail, updating external resources, such as files and databases that you have some other synchronization methods for, etc.

To do:
Make an ISession interface.

Nested Class Summary
static class Session.ErrorURI
           
 class Session.HandlerProcItem
           
 class Session.SessionDatasourceIterator
           
 
Nested classes/interfaces inherited from class com.dynamide.Persistent
Persistent.Source
 
Field Summary
static int gHandlerProcItemSeq
           
static int HANDLER_PROC_INDENT_INCR
           
static int HANDLER_PROC_INDENT_INIT
           
static java.lang.String HOOK_EXCEPTION_NO_ERROR_PAGE
          This is returned from hookException if throwIfUnhandled is false and there is no error handler or error page static.
static boolean LOG_EVENTS_TO_HANDLERLOG
           
static int MODE_BATCH
           
static int MODE_DEBUG
           
static int MODE_DESIGN
           
static int MODE_NONE
           
static int MODE_PUBLISH
           
static int MODE_TEST
           
static int MODE_VERBOSE
           
static java.lang.String PROPERTY_NAME_PUBLISH_PARAMS
           
static java.lang.String PROPERTY_NAME_PUBLISH_URLS
           
 
Fields inherited from class com.dynamide.Persistent
DEBUG_PAGE_SAVE, DEBUG_PROPS
 
Fields inherited from class com.dynamide.DynamideObject
m_id
 
Fields inherited from interface com.dynamide.util.ISessionItem
TIMEOUT_CHECK_INTERVAL
 
Fields inherited from interface com.dynamide.db.IDatasource
AFTER, BEFORE, BEFORE_FIRST, BEGIN, END, ROW_COUNT_NOT_ALLOWED, ROW_INDEX_UNKNOWN
 
Method Summary
 void addErrorURI(java.lang.String uri)
           
 Field addField(Field field)
           
 Field addField(java.lang.String fieldName, Field field)
           
 Field addField(java.lang.String fieldName, Field field, boolean logWarnIfExists)
           
 void addPageName(java.lang.String name)
          Just add a page to the list of names in the project.
 void addPublishStatusLine(java.lang.String s)
           
 void addValueBean(java.lang.String name, IValueBean bean)
           
 void assertNotEmpty(java.lang.String test, java.lang.String message, java.lang.Object caller)
           
 void assertNotNull(java.lang.Object test, java.lang.String message, java.lang.Object caller)
           
 ScriptEvent auditEvent(java.lang.String senderID, java.lang.String eventName)
           
 java.lang.Object call(java.lang.String eventFullName)
           
 java.lang.Object call(java.lang.String eventFullName, java.lang.Object inputObject)
           
 ScriptEvent callInterpreter(ScriptEvent event, java.lang.String procName, ScriptEventSource eventSource, java.lang.String language, boolean sourceOnly)
           
 void cancel()
           
 void checkDirectoryWrite(java.lang.String directoryPath)
           
 void checkWebmacroLogRef()
           
 void clear()
           
 void clearLinkOptions()
           
 void clearUSER()
           
 void clearWidgetTypePool()
           
 void clearWidgetTypePool(java.lang.String widgetTypeName)
          %% TODO, you may have a namespace problem if the same name is picked up from the different palette directories.
 void close()
           
 void closeWhenRequestComplete()
           
 void commitInMemoryChangesToDOM()
          Called when persisitence is going to happen: gives subclasses an opportunity to sync the DOM with memory.
 java.lang.String createDialogURL(java.lang.String pageID, java.lang.String appRelativeName, java.lang.String params)
           
 Field createField(java.lang.String fieldName, java.lang.String value)
           
 Field createField(java.lang.String fieldName, java.lang.String value, boolean override)
           
static LinkOptions createLinkOptions()
           
static LinkOptions createLinkOptions(boolean user, boolean relative, boolean sessionid)
           
 java.lang.String createNewSession(java.lang.String uri, boolean designMode, java.lang.String debugQueryString)
          Create a separate session than this one, and start it with startSession() Used by the IDE.
static Session createSession(java.lang.String uri)
          Public factory method using defaults for fullURI, prefix, and not allowing a forcedSessionID, creates and starts session, with designMode==false.
static Session createSession(java.lang.String uri, java.lang.String debugQueryString)
           
static Session createSession(java.lang.String uri, java.lang.String debugQueryString, int modeFlags)
          WARNING: if you set the modeFlags to include MODE_DEBUG, the session won't start.
static Session createSession(java.lang.String uri, java.lang.String fullURI, java.lang.String prefix, java.lang.String forcedSessionID, boolean start, int modeFlags, DynamideHandler handler, java.lang.String debugQueryString, HandlerResult handlerResult)
          Public factory method, creates session, but only starts the Session if param "start" is true.
static TemplateSyntaxException createTemplateSyntaxException(java.lang.String errorMessage, java.lang.String templateText)
           
static TemplateSyntaxException createTemplateSyntaxException(java.lang.String errorMessage, java.lang.String templateText, int linenum)
           
static Session createTestSession(java.lang.String sessionID, java.lang.String applicationPath, java.lang.String appname, boolean callConstructor)
           
 java.lang.String createWidget(java.lang.String widgetType, java.lang.String targetPageID)
          This method is geared for the web IDE that uses the return string; to work with objects, first get a ref to the Page object, then call Page.createWidget, with will return the Widget object.
 ScriptEvent debugApplicationEvent(java.lang.String inputObjectEval, java.lang.String eventName, java.lang.String currentPageID, java.lang.String nextPageID, java.lang.String action, java.lang.String sourceDotName)
           
 ScriptEvent debugPageEvent(java.lang.String sourcePageID, java.lang.String inputObjectEval, java.lang.String eventName, java.lang.String currentPageID, java.lang.String nextPageID, java.lang.String action, java.lang.String sourceDotName)
           
 void destroyDialog(java.lang.String pageID)
           
protected  java.lang.String doPublish()
           
static java.lang.String dumpContext(org.webmacro.Context WEBMACRO_CONTEXT)
          If you want a Map, use $WEBMACRO_CONTEXT.getMap()
 java.lang.String dumpErrorsHTML()
           
 java.lang.String dumpFields()
           
 java.lang.String dumpPages()
           
 java.lang.String dumpRequestInfo()
           
 java.lang.String dumpRequestParams()
           
 java.lang.String dumpWidgetTypePool()
           
 void enterHandlerProc(java.lang.String procName, java.lang.Object info)
           
 java.lang.Object eval(java.lang.String source)
          Evaluate any string in the pluggable Interpreter, the only variable in the context already is a pointer to this session, in a variable called "session".
 java.lang.String expandContainer(java.lang.String pageName)
           
 java.lang.String expandContainer(java.lang.String pageID, java.lang.String pageName, org.webmacro.Context c, AbstractWidget parent)
           
 java.lang.String expandResource(java.lang.String resourceID, java.lang.String logName)
           
 java.lang.String expandResource(java.lang.String resourceID, StringList variables, java.lang.String logName)
           
 java.lang.String expandTemplate(StringList variables, java.lang.String templateText, java.lang.String logName)
           
 java.lang.String expandTemplate(java.lang.String templateText, java.lang.String logName, org.webmacro.Context c)
           
 void finalize()
           
 java.lang.Object find(java.lang.String path)
          Search using "/" as the separator, by simply calling find(path, "/").
 java.lang.String findAppFilename(java.lang.String resourceID)
          Returns a non-zero-length string for the file named by resourceID if found, else returns the empty string.
 java.lang.String findAppFilename(java.lang.String resourceID, boolean quiet)
           
 java.lang.Object findDotted(java.lang.String dottedName)
           
 Field findField(java.lang.String fieldName)
           
 Page findOrCreateDialog(java.lang.String pageID, java.lang.String appRelativeName)
           
 Page findPageByID(java.lang.String pageID)
          silent about exceptions, returns null if not found or error - if you want to see the exceptions, call getPageByID instead.
 Page findPageByID(java.lang.String pageID, DynamideObject newOwner)
           
 java.lang.String findResourceFilename(java.lang.String resourceID)
          Returns a non-zero-length string for the file named by resourceID if found, else returns the empty string.
 java.lang.String findResourcesHtmlFile(java.lang.String pathInfo)
           
 Session findSession(java.lang.String otherSessionID)
           
 Session findSession(java.lang.String otherSessionID, boolean touchLastAccessTime)
           
 WidgetType findWidgetType(java.lang.String type)
           
 ScriptEvent fireApplicationEvent(java.lang.String eventName)
           
 ScriptEvent fireApplicationEvent(java.lang.String eventName, java.lang.String action)
           
 ScriptEvent fireApplicationEvent(java.lang.String eventName, java.lang.String action, java.lang.Object inputObject)
           
protected  ScriptEvent fireEvent(java.lang.Object sender, java.lang.Object inputObject, java.lang.String procName, java.lang.String currentPageID, java.lang.String nextPageID, java.lang.String action, ScriptEventSource eventSource, java.lang.String eventSourceFilename, boolean sourceOnly, IInterpreter detachedInterp, java.lang.String dmFormat)
           
protected  ScriptEvent fireEvent(java.lang.Object sender, java.lang.String procName, java.lang.String currentPageID, java.lang.String nextPageID, java.lang.String action, ScriptEventSource eventSource, java.lang.String eventSourceFilename, boolean sourceOnly)
          This overload does not pass in an inputObject.
 ScriptEvent fireJobEvent(Job sender, java.lang.String eventName, java.lang.Object inputObject, boolean useDetachedInterpreter)
           
 ScriptEvent fireRegisteredAction(java.lang.String action)
           
 void fireWidgetImports(Widget widget, java.lang.String procName)
           
 ScriptEvent fireWidgetMethod(Widget widget, java.lang.String procName)
           
 java.lang.String formatErrorURIs()
           
 java.lang.String formatQueryStringDetailLink(javax.servlet.http.HttpServletRequest request)
           
 java.lang.String formatRequestLineForLogHandlerProc(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String formatTemplateSyntaxException(java.lang.String errorMessage, java.lang.String templateText, int linenum)
           
 java.lang.Object get(java.lang.String what)
          Returns values by searching in this order: specially named values, named pages, Properties, then registered Field objects.
 java.lang.String getAccount()
           
 java.lang.String getActiveItemTag()
           
 java.lang.String getActivePage()
           
 IContext getAppdata()
           
 java.lang.String getAppDirectory()
           
 byte[] getAppFileBytes(java.lang.String resourceID)
           
 java.lang.String getAppFileContent(java.lang.String resourceID)
           
 java.lang.String getAppFilename(java.lang.String resourceID)
          Always returns a non-zero-length string for the file named by resourceID, or throws a FileNotFoundException.
 Application getApplication()
           
 java.lang.String getApplicationPath()
          This value is always valid after startup, event if no ServletRequest handler is active.
 java.util.Enumeration getApplicationProperties()
           
 java.lang.String getApplicationPropertyEditor(Session session, Session subsession, Property property, java.lang.String onkeydown, java.lang.String onchange)
           
 IContext getApplicationResource(java.lang.String resourceID)
           
 java.lang.String getAppname()
           
 java.lang.String getAppURL()
           
 java.lang.String getAppURL(boolean user, boolean relative, boolean sessionid, java.lang.String moreParams, java.lang.String morePath, java.lang.String extension)
           
 java.lang.String getAppURL(LinkOptions lo, java.lang.String moreParams)
           
 java.lang.String getAppURL(LinkOptions lo, java.lang.String moreParams, java.lang.String morePath)
           
 java.lang.String getAppURL(java.lang.String moreParams)
           
 java.lang.String getAppURL(java.lang.String moreParams, java.lang.String morePath)
           
 Assembly getAssembly()
           
 java.lang.String getAttachToLink()
           
 java.lang.String getAttachToLink(java.lang.String caption)
           
 java.util.List getAutoFieldIDs()
           
 boolean getBatchMode()
           
 int getBrowserID()
           
 java.lang.String getBrowserStringID()
           
 java.lang.String getCategoryID()
           
 java.lang.String getCloseLink()
           
 boolean getCloseWhenRequestComplete()
           
 java.lang.String getConsoleLog()
           
 Page getContainer(java.lang.String pageID, java.lang.String pageName, DynamideObject newOwner)
           
 java.lang.Object getContentFromCache(java.lang.String key, boolean applicationShared)
           
 org.webmacro.Context getContext()
          Don't call this method from outside this class.
 org.webmacro.Context getContext(org.webmacro.WebMacro wm)
          Don't call this method from outside this class.
static org.webmacro.Context getContext(org.webmacro.WebMacro wm, boolean designMode, java.lang.String sessionID, javax.servlet.http.HttpServletRequest request)
          It's OK to call will request == null, but then the request won't be in the context as a variable.
 java.lang.String getCurrentAction()
           
 java.lang.String getCurrentLanguageCode()
           
 java.lang.String getCurrentPageID()
           
 int getCurrentRowIndex()
          The zero-based index of the current row: single-row implementations can always return 0, implementations that don't support row indices should return IDatasource.ROW_INDEX_UNKNOWN;
 IDatasource getDatasource(java.lang.String id)
           
 IDatasource getDatasourceHelper()
          By default, simply return a reference to "this", since the implementing class is an instance of IDatasource.
 java.util.Set getDatasources()
           
 boolean getDebugMode()
           
 java.lang.String getDebugURI()
           
 java.net.URL getDebugURLObject()
           
 java.lang.String getDefaultPage()
           
 boolean getDesignMode()
           
 IInterpreter getDetachedInterpreter(java.lang.String language)
           
 java.lang.String getDotName()
           
 java.lang.String getErrorDump()
           
 Session.ErrorURI[] getErrorURIs()
           
 ExpansionLog getExpansionLog()
           
 java.lang.String getExtraInfo()
           
 Field getField(java.lang.String fieldName)
          Maintain a list of Field objects; return the live Field when asked by this method.
 Field getField(java.lang.String fieldName, java.lang.String fieldIndex)
          This class can support indexed Fields, by any arbitrary String index, which will for tabular datasets, be the zero-based row index; however the index can be any valid string which could itself be a search specifier that is used by this method.
 java.util.Set getFieldNames()
           
 java.lang.Object getFieldObject(java.lang.String fieldName)
          Note: returns null if the field has no "value" object, or if the object is null; use getFieldValue or getFieldStringValue if you want a null-safe method.
 java.util.Map getFields()
           
 java.lang.String getFieldStringValue(java.lang.String fieldName)
          Note: returns an empty string if field is not found or Field value object is null; see getFieldObject to get direct access to the object or null.
 java.lang.Object getFieldValue(java.lang.String fieldName)
          Note: returns an empty string if field is not found or Field value object is null; see getFieldObject to get direct access to the object or null.
 IContext getFromCache(java.lang.String key, boolean applicationShared)
           
 java.lang.String getFullAppname()
           
 DynamideHandler getHandler()
           
 HandlerResult getHandlerResult()
           
 int getHits()
           
 java.lang.String getHome()
           
 java.lang.String getHomeDir()
           
 java.lang.String getHostName()
           
 java.lang.String getInclude_NEW(java.lang.String resourceID)
           
 java.lang.String getInclude(java.lang.String includeName)
           
 IInterpreter getInterpreter()
           
 IInterpreter getInterpreter(java.lang.String language)
           
static int getJDOMExceptionLineNum(java.lang.Exception jdomException)
           
 java.util.List getJobLog()
           
 java.lang.String getKey()
           
 long getLastAccessTime()
           
 java.lang.String getLastErrorDump()
           
 java.lang.String getLastPathInfo()
          When the request is complete, get("pathInfo") will return an empty string -- use this to find out what the value was when you are not in an active ServletRequest handler, e.g. in a Job, or looking at another Session.
 java.lang.String getLastRequestPath()
          When the request is complete, get("requestPath") will return an empty string -- use this to find out what the value was when you are not in an active ServletRequest handler, e.g. in a Job, or looking at another Session.
 LinkOptions getLinkOptions()
           
 java.util.Collection getLoadedPages()
           
 java.util.Map getLoadedPagesMap()
           
 int getModeFlags()
           
 java.lang.String getModeListing()
          Returns the mode listing for the ISessionTableItem interface, by calling getModeStringShort().
 java.lang.String getModeString()
           
 java.lang.String getModeStringShort()
          Shows the modes represented as single-characters, like a Unix file listing: from ----- (no modes) to BDGPT (all modes set).
 java.lang.String getNextPageID()
           
 java.lang.String getNextPageIDInOrder(java.lang.String currentPageID)
           
 java.util.List getObjects()
           
 Page getPage(java.lang.String pageID)
          Finds and loads a Page, given the pageID, which is relative to your project.
 Page getPageByFile(java.io.File f)
           
 Page getPageByID(java.lang.String pageID)
          Finds and loads a Page, given the pageID, which is relative to your project.
 StringList getPageList()
           
 StringList getPageListSorted()
           
 java.lang.String getPagePropertyEditor(Session session, Session subsession, Page page, Property property, java.lang.String onkeydown, java.lang.String onchange)
           
 java.util.List getPages()
           
 java.util.Map getPaletteList()
           
 java.lang.String getParentSessionID()
           
 java.lang.String getPathInfo()
           
 boolean getPooled()
           
static java.lang.String getPropertyEditor(Session session, Session subsession, java.lang.String logName, Property property, Property defaultProperty, java.lang.String onkeydown, java.lang.String onchange, StringList variables)
           
 java.lang.String getPublishCacheName()
           
 boolean getPublishMode()
          There is no setPublishMode() -- use publish() instead -- once you have entered publish mode, getPublishMode will return true.
 PublishParamsDatatype getPublishParams()
           
 java.lang.String getPublishProtoHostPort()
           
 java.lang.String getPublishStatus()
           
 java.lang.String getQueryParam(java.lang.String paramName)
           
 RegisteredActions getRegisteredActions()
           
 java.lang.String getReportLink()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 java.lang.String getRequestPath()
           
 ResourceManager getResourceManager()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 int getRowCount()
          The row count of the current dataset, or IDatasource.ROW_COUNT_NOT_ALLOWED if the operation is not supported.
 boolean getSecure()
           
 org.apache.commons.fileupload.servlet.ServletFileUpload getServletFileUpload()
           
static ServletTools getServletTools()
           
 java.lang.String getSessionID()
           
 long getStartTime()
           
 java.lang.String getStaticDir()
           
 java.lang.String getStaticRoot()
           
 boolean getStdoutEcho()
           
 java.lang.String getString(java.lang.String what)
           
static StringTools getStringTools()
           
 java.util.Set getSubmitActions()
           
 Session getSubsession()
          Looks for the special subsession named in the Session field "SUBSESSIONID".
static int getSyntaxExceptionLineNum(java.lang.Exception parseException)
          Written to support beanshell exception messages.
 java.lang.String getTemplateDirs()
           
 boolean getTestMode()
           
 StringList getTestStringList()
           
 java.lang.String getThreadGroupID()
           
 java.lang.String getThreadID()
           
 java.lang.String getTimestampLocale()
           
static Tools getTools()
           
 java.util.List<org.apache.commons.fileupload.FileItem> getUploadFileItems()
           
 java.util.List<org.apache.commons.fileupload.FileItem> getUploadFileItems(javax.servlet.http.HttpServletRequest request)
          (Note: it is possible that there could be some threading issue, but I think the DynamideServlet doesn't let two requests live in the same session. ) Usage: fileItems[0].getFieldName() fileItems[0].getFileName()
 java.util.List<org.apache.commons.fileupload.FileItem> getUploadFileItemsRaw()
           
 java.lang.String getURIPrefix()
           
 java.lang.String getURLPath()
          Alias for getApplicationPath()
 java.lang.String getUSER()
           
 java.lang.String getUSERAUTH()
           
 java.lang.String getUserName()
           
 java.lang.String getUserToken()
           
 IValueBean getValueBean(java.lang.String name)
           
 ValueBeanHelper getValueBeanHelper(java.lang.String name)
           
 boolean getVerboseMode()
           
 java.lang.String[] getVisitedPages()
           
 int getVisitedPagesCount()
           
 org.webmacro.WebMacro getWebMacro()
          Don't call this method from outside this class.
 java.lang.String getWidgetPropertyEditor(Session session, Session subsession, Page page, Widget widget, Property property, Property defaultProperty, java.lang.String onkeydown, java.lang.String onchange)
           
 boolean go(int distance)
          go(0) should go to the first row in the set, if supported, go(-1) should go back a row, if supported, go(1) should go forward a row if supported, go(IDatasource.END) should go to the last row in the set, leaving the last row active, that is, not after the last row, and all unsupported actions should simply be no-ops.
 HandlerResult handleAction(DynamideHandler handler, java.lang.String action, HandlerResult handlerResult)
          Handles all actions.
static java.lang.String handleEval(java.lang.String SessionID, java.lang.String source, java.lang.String USERID, javax.servlet.http.HttpServletRequest request)
          eval the source, and return a valid html chunk.
 java.lang.String handleLayoutViewChanged(javax.servlet.http.HttpServletRequest request)
           
 void handlerProcComplete(long elapsedMillis, java.lang.String replayURL)
           
 void handlerProcComplete(long elapsedMillis, java.lang.String replayURL, java.lang.Throwable t)
           
 HandlerResult handleURL(java.lang.String url)
           
 boolean hasChildSession(java.lang.String childSessionID)
           
 boolean hasPage(java.lang.String pageID)
           
 boolean hasQueryParam(java.lang.String paramName)
          During a request, this method sees if there is a query parameter by name in the request, either in the URL query string, or in the POST fields, or, if this is an upload, then also checks for POST fields sent within the upload multipart.
 java.lang.String hookException(java.lang.String message, java.lang.Throwable t, int category)
          Throws the exception if not handled.
 java.lang.String hookException(java.lang.String message, java.lang.Throwable t, ScriptEvent event, int category, boolean throwIfUnhandled)
           
 java.lang.String hookWidgetError(AbstractWidget source, java.lang.String widgetID, java.lang.String message, java.lang.Throwable t)
           
 java.lang.String href(java.lang.String resourcePath)
          convenience method, simply calls getInclude(resourcePath)
 boolean insertRow(int index)
           
 java.lang.String internationalize(java.lang.String name, java.lang.String defaultValue)
           
 boolean isBeforeFirstPage()
           
 boolean isBusy()
           
 boolean isClosing()
           
 boolean isCritical()
           
 boolean isCurrentRow()
           
 boolean isHandlerProcLogOn()
           
 boolean isPageLoaded(java.lang.String pageID)
           
 boolean isPoolable()
           
 boolean isPublishComplete()
           
 boolean isReadOnly()
          Updateable datasets should return false.
 boolean isRowCountAllowed()
          Report if calling getRowCount() will be allowed.
 boolean isValueNull(java.lang.Object value)
           
 boolean isValueTrue(java.lang.String fieldName)
          Returns whether a String value of a Field was "true", ignoring case.
 java.util.Iterator iterator()
          Return an Iterator which knows how to properly iterate over your implementation.
 void leaveHandlerProc(java.lang.String procName, java.lang.Object info)
           
 void leavePublishMode()
          WARNING: this method turns off publish mode, batch mode, clears PublishProtoHost and URIPrefix, and nulls out the LinkOptions -- if you wish to preserve these values, do so before calling enterPublishMode().
 java.lang.String link(java.lang.String linkText)
          Create a hyperlink based on the current applicationPath, the current LinkOptions (see setLinkOptions) and the current value of getBatchMode().
 java.lang.String link(java.lang.String moreParams, java.lang.String linkText)
          Format a hyperlink (<A> tag) with the supplied parameters.
 java.lang.String link(java.lang.String moreParams, java.lang.String morePath, java.lang.String linkText)
          Format a hyperlink (<A> tag) with the supplied parameters.
 java.lang.String link(java.lang.String moreParams, java.lang.String morePath, java.lang.String attributes, java.lang.String linkText)
          Format a hyperlink (<A> tag) with the supplied parameters.
 java.lang.String link(java.lang.String moreParams, java.lang.String morePath, java.lang.String attributes, java.lang.String linkText, java.lang.String extension)
           
 java.lang.String linkHref(java.lang.String href, java.lang.String linkText)
          Format a hyperlink (<A> tag) with the supplied parameters.
 java.lang.String linkHref(java.lang.String href, java.lang.String attributes, java.lang.String linkText)
          Format a hyperlink (<A> tag) with the supplied parameters.
 java.lang.String listAllEvents()
           
 java.lang.String listAllEvents(boolean longListing)
           
 java.lang.String listAllEventsHTML(boolean longListing, boolean loadPages)
           
 java.lang.String listAllEventsLong()
           
 java.lang.String listFields()
           
 java.lang.String listPages()
           
 void loadAllPages()
           
static java.lang.Object loadClass(java.lang.String className)
          Use this to load any class with a null contructor (no arguments) from a scripting context.
 boolean loadInternationalization(java.lang.String languageCode)
           
 Page loadPage(java.lang.String pageID)
           
 Page loadPage(java.lang.String pageID, boolean forceReload, DynamideObject newOwner)
           
 java.lang.Object loadWidetBean(java.lang.String className)
          If you have logic or other complications that cannot be handled in WebMacro or JSP or whatever template engine you have plugged in, you can call this method to get a custom bean loaded from your template.
 void log(java.lang.String message)
           
 void logAutoFieldID(java.lang.String id)
           
 void logError(java.lang.String message)
           
 void logError(java.lang.String message, java.lang.String detail)
           
 void logHandlerProc(java.lang.String procName, java.lang.Object info)
          Just add it at one indent in, but don't hang on to the indent: this is one log line.
 void logHandlerProc(java.lang.String procName, java.lang.Object info, boolean doIndent)
           
 void logHandlerProcCollapsed(java.lang.String procName, java.lang.Object message)
           
 void logHandlerProcRequest()
           
 void logJob(java.lang.String eventName, ScriptEvent event, java.lang.String jobName, java.lang.String status)
          event can be null, in which case be sure to pass in status param
 void logJobStart(java.lang.String eventName, java.lang.String jobName)
           
 void logWhichExpansion(java.lang.String msg)
           
 java.lang.String lookupInternationalizedValue(java.lang.String name)
           
static void main(java.lang.String[] args)
           
 Page newPage(java.lang.String pageID, java.lang.String pagetype)
           
 void onJobDone(Job job)
          Fires application_onJobDone with the Job object as the inputObject
 void onRowChanged()
          Provides notification that a seek or go operation has occured.
 void pageVisited(java.lang.String pageID)
           
 boolean post()
          If isReadOnly() returns false, and the underlying data can be updated, return true.
 void print(java.lang.String msg)
           
 java.lang.String printHandlerProcLog()
           
 java.lang.String printJobLog()
           
 void println(java.lang.String msg)
           
static Session publish(java.lang.String applicationPath)
           
static Session publish(java.lang.String applicationPath, PublishParamsDatatype overrideParams, EnumeratedDatatype overridePublishURLs, java.lang.String outputDir, boolean start)
          Publish a dynamic Dynamide web application to a static set of web pages.
static Session publish(java.lang.String applicationPath, java.lang.String outputDir)
           
 IContext putInCache(java.lang.String key, java.lang.Object obj, boolean applicationShared)
           
 java.lang.String queryParam(java.lang.String paramName)
           
 java.lang.String readDataFileToString(java.lang.String relativeToHome)
           
 void readFieldsIntoSession(org.jdom.Element root)
          read the fields from the fielddefs file.
 void readPagesElement()
           
 void registerAction(java.lang.String action, DynamideObject sender, java.lang.String eventName, java.lang.Object inputObject)
           
 java.lang.String registerActionEvent(java.lang.String action, ScriptEventSource scriptEventSource, java.lang.Object inputObject)
           
 void registerDatasource(IDatasource caller)
           
 void registerSubmitAction(java.lang.String fieldID, java.lang.String action)
           
static void releaseContext(org.webmacro.Context c)
           
 Field removeField(java.lang.String fieldName)
           
 java.lang.String renderWidget(java.lang.String widgetName, java.lang.String targetPageID, javax.servlet.http.HttpServletRequest request)
           
 java.lang.String renderWidget(Widget wd, java.lang.String targetPageID, javax.servlet.http.HttpServletRequest request)
           
 java.lang.String renderWidgetHelp(java.lang.String widgetType)
           
 java.lang.Object safeFind(java.lang.String dottedName)
           
 boolean seek(int zeroBasedIndex)
          Jump to the absolute zero based index.
 boolean seekBegin()
           
 boolean seekEnd()
           
 void sendRedirect(java.lang.String url)
           
protected  void setActivePage(java.lang.String pageID)
           
 void setAutoFieldIDs(java.util.List new_value)
           
 void setBatchMode(boolean new_value)
           
 void setBrowserID(int new_value)
          %% OOOPS: this is inherantly un-threadsafe.
 void setCloseWhenRequestComplete(boolean value)
           
 void setCurrentAction(java.lang.String new_value)
           
 void setDebugMode(boolean new_value)
           
 void setDebugURL(java.lang.String url)
           
 void setDesignMode(boolean new_value)
           
 Field setField(Field field)
          You can use this to rebind a Field, or add a new one.
 Field setField(java.lang.String fieldName, Field field)
          You can use this to rebind a Field, or add a new one.
 void setFieldError(java.lang.String fieldName, java.lang.String message)
           
 void setFieldObject(java.lang.String fieldName, java.lang.Object value)
           
 void setFieldValue(java.lang.String fieldName, java.lang.Object value)
          The editable Dynamide Widgets can use this to modify the underlying Fields.
 boolean setFieldValue(java.lang.String fieldName, java.lang.Object value, java.lang.String fieldIndex)
          Permissively sets the field value, ignoring the fieldIndex
 void setHandler(DynamideHandler new_value)
           
 void setHandlerResult(HandlerResult new_value)
           
 void setLinkOptions(boolean user, boolean relative, boolean sessionid)
           
 void setLinkOptions(LinkOptions newOptions)
          Sets options to be used by the link*() methods.
protected  void setModeFlags(int modes)
           
 void setNextPageID(java.lang.String new_value)
           
 void setPooled(boolean new_value)
           
 void setSessionID(java.lang.String new_value)
           
 void setStdoutEcho(boolean new_value)
           
 void setTestMode(boolean new_value)
           
 void setUSER(java.lang.String new_value)
           
 void setUSERAUTH(java.lang.String auth)
           
 void setVerboseMode(boolean new_value)
           
 void setWidgetError(java.lang.String widgetDotName, java.lang.String message)
           
 java.lang.String showErrorPage(java.lang.String message, java.lang.Throwable t, int category, boolean throwIfUnhandled)
           
 java.lang.String showInternationalizationForm(javax.servlet.http.HttpServletRequest request)
           
 java.lang.String showWebMacroLog()
           
 void shutdown()
          The shutdown method is called in a new thread, and you will be out of the session table by the time this gets called.
 java.lang.String startSession()
           
 void throwException(java.lang.String message)
           
 boolean timeout(long now)
           
 java.lang.String toString()
           
 void touchLastAccessTime()
           
 java.lang.String transform(java.lang.String xmlResourceID, java.lang.String xslResourceID)
           
 void unloadPage(java.lang.String pageID)
           
 void unregisterAction(java.lang.String action)
           
 void unregisterDatasource(IDatasource caller)
           
 
Methods inherited from class com.dynamide.Persistent
addProperties, addProperty, clonePropertiesTable, dumpHTML, dumpProperties, findEventElement, getEvents, getEventSignature, getEventSource, getEventSource, getEventSourceBody, getHtmlsrcElement, getHtmlsrcElement, getNamedObject, getProperties, getPropertiesElement, getPropertiesTable, getProperty, getPropertyNames, getPropertyStringValue, getPropertyValue, getRawHTMLSource, getRawHTMLSource, getSession, getSourceElement, getSourceElement, hasProperty, isPropertyTrue, listEvents, listEventsHTML, listProperties, mergeProperties, mergeProperty, removeProperty, removeWidgetContents, removeWidgetContents, resetPropertiesTable, setEventSource, setHTMLSource, setHTMLSourceIE, setNamedObject, setProperty, setProperty, setProperty, setPropertyValue, setSession, sortPropertiesTable
 
Methods inherited from class com.dynamide.JDOMFile
addError, clearErrors, createJDomXMLOutputter, findFirstElement, findFirstElement, findFirstElementWithAttribute, getAttributeValue, getDocument, getErrors, getFilename, getFullXMLSource, getRootElement, hideEntities, isValidXHTML, isValidXHTMLFragment, listNamedElement, output, output, output, output, output, prepare, prettyPrintHTML, prettyPrintHTML, prettyPrintHTMLSafe, read, readFromString, reload, resolveEntity, safeGetElementChildText, saveToFile, saveToFile, select, select, select, selectFirst, selectFirst, setFilename, testPrettyPrint, unHideEntities, valueOf, valueOf
 
Methods inherited from class com.dynamide.resource.ContextNode
bind, bind, bindAll, bindAllAttributes, bindAttribute, dump, dumpAttributes, dumpContext, find, find, firstContext, getAttribute, getAttributeCount, getAttributes, getContext, getContextCount, getContexts, getPermission, hasAttribute, hasContext, listAttributeNames, listAttributeNames, listContextNames, listContextNames, lockPermissions, rebind, rebind, rebindAttribute, remove, removeAttribute, removeFirstContext, setKey, unlockPermissions, update, writeCache
 
Methods inherited from class com.dynamide.DynamideObject
clearProfiler, dump, expand, findParentExpander, findParentPage, findParentSession, findTopParentPage, getID, getNextGetter, getObjectID, getOwner, getProfiler, isDebugEnabled, isInfoEnabled, logDebug, logDebug, logDebug, logDebug, logError, logError, logInfo, logInfo, logInfo, logInfo, logWarn, logWarn, logWarn, logWarn, popLogContext, printf, printProfiler, profileEnter, profileLeave, pushLogContext, setDotName, setID, setNextGetter, setObjectID, setOwner, sprintf, useProfiler, walkParents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.dynamide.db.IDatasource
getID, getProperty, reload, setProperty
 
Methods inherited from interface com.dynamide.resource.IContext
bind, bind, bindAll, bindAllAttributes, bindAttribute, dumpAttributes, dumpContext, find, find, firstContext, getAttribute, getAttributeCount, getAttributes, getContext, getContextCount, getContexts, getPermission, hasAttribute, hasContext, lockPermissions, rebind, rebind, rebindAttribute, remove, removeAttribute, removeFirstContext, setKey, unlockPermissions, update
 

Field Detail

PROPERTY_NAME_PUBLISH_PARAMS

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

PROPERTY_NAME_PUBLISH_URLS

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

LOG_EVENTS_TO_HANDLERLOG

public static final boolean LOG_EVENTS_TO_HANDLERLOG
See Also:
Constant Field Values

MODE_NONE

public static final int MODE_NONE
See Also:
Constant Field Values

MODE_DEBUG

public static final int MODE_DEBUG
See Also:
Constant Field Values

MODE_TEST

public static final int MODE_TEST
See Also:
Constant Field Values

MODE_DESIGN

public static final int MODE_DESIGN
See Also:
Constant Field Values

MODE_BATCH

public static final int MODE_BATCH
See Also:
Constant Field Values

MODE_PUBLISH

public static final int MODE_PUBLISH
See Also:
Constant Field Values

MODE_VERBOSE

public static final int MODE_VERBOSE
See Also:
Constant Field Values

HOOK_EXCEPTION_NO_ERROR_PAGE

public static final java.lang.String HOOK_EXCEPTION_NO_ERROR_PAGE
This is returned from hookException if throwIfUnhandled is false and there is no error handler or error page static.

See Also:
Constant Field Values

HANDLER_PROC_INDENT_INIT

public static final int HANDLER_PROC_INDENT_INIT
See Also:
Constant Field Values

HANDLER_PROC_INDENT_INCR

public static final int HANDLER_PROC_INDENT_INCR
See Also:
Constant Field Values

gHandlerProcItemSeq

public static int gHandlerProcItemSeq
Method Detail

createNewSession

public java.lang.String createNewSession(java.lang.String uri,
                                         boolean designMode,
                                         java.lang.String debugQueryString)
Create a separate session than this one, and start it with startSession() Used by the IDE.

Key Method:
Key method used by the IDE
To do:
Make the IDE be able to pass in the debugQueryString.

createSession

public static Session createSession(java.lang.String uri)
                             throws java.io.IOException,
                                    org.jdom.JDOMException,
                                    java.lang.Exception
Public factory method using defaults for fullURI, prefix, and not allowing a forcedSessionID, creates and starts session, with designMode==false.

Throws:
java.io.IOException - when the application.xml file cannot be read
org.jdom.JDOMException - when the application.xml file is not valid XML
java.lang.Exception
Factory Method:
Create a Session from a URI string.

createSession

public static Session createSession(java.lang.String uri,
                                    java.lang.String debugQueryString)
                             throws java.io.IOException,
                                    org.jdom.JDOMException,
                                    java.lang.Exception
Throws:
java.io.IOException - when the application.xml file cannot be read
org.jdom.JDOMException - when the application.xml file is not valid XML
java.lang.Exception
Factory Method:
Create a Session from a registered URI string, with a debugQueryString

createSession

public static Session createSession(java.lang.String uri,
                                    java.lang.String debugQueryString,
                                    int modeFlags)
                             throws java.io.IOException,
                                    org.jdom.JDOMException,
                                    java.lang.Exception
WARNING: if you set the modeFlags to include MODE_DEBUG, the session won't start. This is a useful feature for debuggers, but the Session won't be truly initialized. Only call this method if you know what you are doing. This public factory method creates a session with modes as specified by modeFlags, which are bitwise combinations of Session.MODE_* constants, e.g.
modeFlags = Session.MODE_DESIGN|Session.MODE_DEBUG.

Throws:
java.io.IOException - when the application.xml file cannot be read
org.jdom.JDOMException - when the application.xml file is not valid XML
java.lang.Exception
Factory Method:
Create session with debugQueryString and modeFlags

createSession

public static Session createSession(java.lang.String uri,
                                    java.lang.String fullURI,
                                    java.lang.String prefix,
                                    java.lang.String forcedSessionID,
                                    boolean start,
                                    int modeFlags,
                                    DynamideHandler handler,
                                    java.lang.String debugQueryString,
                                    HandlerResult handlerResult)
                             throws java.io.IOException,
                                    org.jdom.JDOMException,
                                    java.lang.Exception
Public factory method, creates session, but only starts the Session if param "start" is true.

Throws:
java.io.IOException - when the application.xml file cannot be read
org.jdom.JDOMException - when the application.xml file is not valid XML
java.lang.Exception
Factory Method:
Creates a session with all startup parameters exposed.

createTestSession

public static Session createTestSession(java.lang.String sessionID,
                                        java.lang.String applicationPath,
                                        java.lang.String appname,
                                        boolean callConstructor)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

startSession

public java.lang.String startSession()
                              throws DynamideUncaughtException
Throws:
DynamideUncaughtException

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class DynamideObject
Throws:
java.lang.Throwable

getResourceManager

public ResourceManager getResourceManager()

checkDirectoryWrite

public void checkDirectoryWrite(java.lang.String directoryPath)
                         throws java.lang.SecurityException
Throws:
java.lang.SecurityException

getStaticRoot

public java.lang.String getStaticRoot()
                               throws java.lang.Exception
Throws:
java.lang.Exception

getStaticDir

public java.lang.String getStaticDir()
                              throws java.lang.Exception
Throws:
java.lang.Exception

getSessionID

public java.lang.String getSessionID()
Specified by:
getSessionID in interface ISessionItem
Specified by:
getSessionID in interface ISessionTableItem

setSessionID

public void setSessionID(java.lang.String new_value)

getSecure

public boolean getSecure()

isBusy

public boolean isBusy()

getAppname

public java.lang.String getAppname()

getFullAppname

public java.lang.String getFullAppname()

getAccount

public java.lang.String getAccount()

getHomeDir

public java.lang.String getHomeDir()
                            throws java.lang.Exception
Throws:
java.lang.Exception

getHome

public java.lang.String getHome()

getAppDirectory

public java.lang.String getAppDirectory()

getAssembly

public Assembly getAssembly()

getDotName

public java.lang.String getDotName()
Overrides:
getDotName in class DynamideObject

touchLastAccessTime

public void touchLastAccessTime()

getUserToken

public java.lang.String getUserToken()

getUSER

public java.lang.String getUSER()

setUSER

public void setUSER(java.lang.String new_value)

clearUSER

public void clearUSER()

setUSERAUTH

public void setUSERAUTH(java.lang.String auth)

getUSERAUTH

public java.lang.String getUSERAUTH()

getFieldNames

public java.util.Set getFieldNames()

getLastErrorDump

public java.lang.String getLastErrorDump()

getErrorDump

public java.lang.String getErrorDump()

getErrorURIs

public Session.ErrorURI[] getErrorURIs()

addErrorURI

public void addErrorURI(java.lang.String uri)

formatErrorURIs

public java.lang.String formatErrorURIs()

hasPage

public boolean hasPage(java.lang.String pageID)

getDatasources

public java.util.Set getDatasources()
Returns:
a Set of IDatasource names registered with the Session, use getDatasource(String) with the value returned to get the actual IDatasource.

getSubmitActions

public java.util.Set getSubmitActions()

registerSubmitAction

public void registerSubmitAction(java.lang.String fieldID,
                                 java.lang.String action)

registerActionEvent

public java.lang.String registerActionEvent(java.lang.String action,
                                            ScriptEventSource scriptEventSource,
                                            java.lang.Object inputObject)

getRegisteredActions

public RegisteredActions getRegisteredActions()

fireRegisteredAction

public ScriptEvent fireRegisteredAction(java.lang.String action)

registerAction

public void registerAction(java.lang.String action,
                           DynamideObject sender,
                           java.lang.String eventName,
                           java.lang.Object inputObject)

unregisterAction

public void unregisterAction(java.lang.String action)

getCurrentAction

public java.lang.String getCurrentAction()

setCurrentAction

public void setCurrentAction(java.lang.String new_value)

getStdoutEcho

public boolean getStdoutEcho()

setStdoutEcho

public void setStdoutEcho(boolean new_value)

getPooled

public boolean getPooled()

setPooled

public void setPooled(boolean new_value)

isPoolable

public boolean isPoolable()

getThreadID

public java.lang.String getThreadID()

getThreadGroupID

public java.lang.String getThreadGroupID()

getModeFlags

public int getModeFlags()

setModeFlags

protected void setModeFlags(int modes)

getBatchMode

public boolean getBatchMode()

setBatchMode

public void setBatchMode(boolean new_value)

getDebugMode

public boolean getDebugMode()

setDebugMode

public void setDebugMode(boolean new_value)

getDesignMode

public boolean getDesignMode()

setDesignMode

public void setDesignMode(boolean new_value)

getPublishMode

public boolean getPublishMode()
There is no setPublishMode() -- use publish() instead -- once you have entered publish mode, getPublishMode will return true. It is a true mode, reflected in the modeFlags, but there are a number of side effects that must be set. Use publish() to safely set all the options. The biggest issue is that if you attempt to publish a running session, resources found with Session.getInclude(...) will not be trapped.


getTestMode

public boolean getTestMode()

setTestMode

public void setTestMode(boolean new_value)

getVerboseMode

public boolean getVerboseMode()

setVerboseMode

public void setVerboseMode(boolean new_value)

getModeString

public java.lang.String getModeString()

getModeStringShort

public java.lang.String getModeStringShort()
Shows the modes represented as single-characters, like a Unix file listing: from ----- (no modes) to BDGPT (all modes set).

For example: -D--- would be Debug mode, and B--P- would be Publishing mode and Batch mode. Do NOT parse this string: it is human-readable only and is subject to change if more modes are needed. Instead, use the API calls getBatchMode(), getDesignMode(), getDebugMode, getPublishMode(), and getTestMode().

Modes are encoded as follows:

  Mode Mnemonic
B MODE_BATCH Batch
D MODE_DESIGN Design
G MODE_DEBUG debuG
P MODE_PUBLISH Publish
T MODE_TEST Test
T MODE_VERBOSE Verbose

See Also:
getModeString(), getModeListing()

getPublishProtoHostPort

public java.lang.String getPublishProtoHostPort()

getPublishCacheName

public java.lang.String getPublishCacheName()

getPublishStatus

public java.lang.String getPublishStatus()

addPublishStatusLine

public void addPublishStatusLine(java.lang.String s)

isPublishComplete

public boolean isPublishComplete()

getPublishParams

public PublishParamsDatatype getPublishParams()
                                       throws DynamideException
Throws:
DynamideException

publish

public static Session publish(java.lang.String applicationPath)
                       throws java.lang.Exception
Throws:
java.lang.Exception

publish

public static Session publish(java.lang.String applicationPath,
                              java.lang.String outputDir)
                       throws java.lang.Exception
Throws:
java.lang.Exception

publish

public static Session publish(java.lang.String applicationPath,
                              PublishParamsDatatype overrideParams,
                              EnumeratedDatatype overridePublishURLs,
                              java.lang.String outputDir,
                              boolean start)
                       throws java.lang.Exception
Publish a dynamic Dynamide web application to a static set of web pages.

Parameters:
overrideParams - can be null - if not null, overrides everything set in publishParams in application.xml
outputDir - Specifically override the output directory specified in either the application.xml or the overrideParams.
Throws:
java.lang.Exception

doPublish

protected java.lang.String doPublish()
                              throws java.lang.Exception
Throws:
java.lang.Exception
To do:
make a page showing all applications and whether they can be published and whether they *need* to be published based on filetimestamps. Add this to site audit. See, then you publish to /static. :) An application is publish-able if it has the correct publish property/elements.

leavePublishMode

public void leavePublishMode()
WARNING: this method turns off publish mode, batch mode, clears PublishProtoHost and URIPrefix, and nulls out the LinkOptions -- if you wish to preserve these values, do so before calling enterPublishMode().


getLastPathInfo

public java.lang.String getLastPathInfo()
When the request is complete, get("pathInfo") will return an empty string -- use this to find out what the value was when you are not in an active ServletRequest handler, e.g. in a Job, or looking at another Session.


getURIPrefix

public java.lang.String getURIPrefix()

getLastRequestPath

public java.lang.String getLastRequestPath()
When the request is complete, get("requestPath") will return an empty string -- use this to find out what the value was when you are not in an active ServletRequest handler, e.g. in a Job, or looking at another Session.


getRequestPath

public java.lang.String getRequestPath()

getApplicationPath

public java.lang.String getApplicationPath()
This value is always valid after startup, event if no ServletRequest handler is active.


getURLPath

public java.lang.String getURLPath()
Alias for getApplicationPath()


getPathInfo

public java.lang.String getPathInfo()

getAppURL

public java.lang.String getAppURL()

getAppURL

public java.lang.String getAppURL(java.lang.String moreParams)

getAppURL

public java.lang.String getAppURL(java.lang.String moreParams,
                                  java.lang.String morePath)

getAppURL

public java.lang.String getAppURL(LinkOptions lo,
                                  java.lang.String moreParams)

getAppURL

public java.lang.String getAppURL(LinkOptions lo,
                                  java.lang.String moreParams,
                                  java.lang.String morePath)

getAppURL

public java.lang.String getAppURL(boolean user,
                                  boolean relative,
                                  boolean sessionid,
                                  java.lang.String moreParams,
                                  java.lang.String morePath,
                                  java.lang.String extension)

getLinkOptions

public LinkOptions getLinkOptions()

setLinkOptions

public void setLinkOptions(LinkOptions newOptions)
Sets options to be used by the link*() methods. Clear these by calling setLinkOptions(null) or by calling clearLinkOptions().


clearLinkOptions

public void clearLinkOptions()

setLinkOptions

public void setLinkOptions(boolean user,
                           boolean relative,
                           boolean sessionid)

createLinkOptions

public static LinkOptions createLinkOptions()

createLinkOptions

public static LinkOptions createLinkOptions(boolean user,
                                            boolean relative,
                                            boolean sessionid)

href

public java.lang.String href(java.lang.String resourcePath)
convenience method, simply calls getInclude(resourcePath)


link

public java.lang.String link(java.lang.String linkText)
Create a hyperlink based on the current applicationPath, the current LinkOptions (see setLinkOptions) and the current value of getBatchMode(). You can think of the href as
    [protocol://][host][:port][prefix][applicationPath][morePath][?queryParams]
       protocol, host, and port are present if relative is specified
  

Example:
link("Click me")

Parameters:
linkText - The text the user sees.

link

public java.lang.String link(java.lang.String moreParams,
                             java.lang.String linkText)
Format a hyperlink (<A> tag) with the supplied parameters.
Example:
link("myParam=some+text&my2ndParam=3", "Click me")

Parameters:
linkText - The text the user sees.

link

public java.lang.String link(java.lang.String moreParams,
                             java.lang.String morePath,
                             java.lang.String linkText)
Format a hyperlink (<A> tag) with the supplied parameters.
Example:
link("myParam=some+text&my2ndParam=3", "/doc/help", "Click me")

Parameters:
linkText - The text the user sees.

link

public java.lang.String link(java.lang.String moreParams,
                             java.lang.String morePath,
                             java.lang.String attributes,
                             java.lang.String linkText)
Format a hyperlink (<A> tag) with the supplied parameters.
Example:
link("myParam=some+text&my2ndParam=3", "/doc/help", "target='_blank'", "Click me")
If this were used in an application registered to handle /dynamide/links as its applicaitonURI, then this would display a link such as:
 <a href='/dynamide/links/doc/help?SESSIONID=1234&myParam=some+text&my2ndParam=3' target='blank>Click me</a>
 

Parameters:
linkText - The text the user sees.

link

public java.lang.String link(java.lang.String moreParams,
                             java.lang.String morePath,
                             java.lang.String attributes,
                             java.lang.String linkText,
                             java.lang.String extension)

linkHref

public java.lang.String linkHref(java.lang.String href,
                                 java.lang.String linkText)
Format a hyperlink (<A> tag) with the supplied parameters.
Example:
linkHref("/foo/bar?zanzibar", "Click me")

Parameters:
href - Relative or absolute URL
linkText - The text the user sees.

linkHref

public java.lang.String linkHref(java.lang.String href,
                                 java.lang.String attributes,
                                 java.lang.String linkText)
Format a hyperlink (<A> tag) with the supplied parameters.
Examples:
linkHref("http://mojo.com:8080/foo/bar?zanzibar", "target='_blank' class='biglink'", "Click me")
linkHref("/foo/bar?zanzibar", "target='_blank' class='biglink'", "Click me")

Parameters:
attributes - Send in any extra attributes, such as target and class, but don't send in href.
linkText - The text the user sees.

dumpFields

public java.lang.String dumpFields()

listFields

public java.lang.String listFields()

listAllEventsLong

public java.lang.String listAllEventsLong()

listAllEvents

public java.lang.String listAllEvents()

listAllEvents

public java.lang.String listAllEvents(boolean longListing)

listAllEventsHTML

public java.lang.String listAllEventsHTML(boolean longListing,
                                          boolean loadPages)

dumpPages

public java.lang.String dumpPages()

dumpWidgetTypePool

public java.lang.String dumpWidgetTypePool()

dumpContext

public static java.lang.String dumpContext(org.webmacro.Context WEBMACRO_CONTEXT)
If you want a Map, use $WEBMACRO_CONTEXT.getMap()


dumpRequestInfo

public java.lang.String dumpRequestInfo()

dumpRequestParams

public java.lang.String dumpRequestParams()

handleAction

public HandlerResult handleAction(DynamideHandler handler,
                                  java.lang.String action,
                                  HandlerResult handlerResult)
                           throws java.lang.Exception
Handles all actions. The full documentation for the event model is here: Event Flowchart (local) or here: Event Flowchart (website) Among items permformed here:

Throws:
java.lang.Exception

getUploadFileItemsRaw

public java.util.List<org.apache.commons.fileupload.FileItem> getUploadFileItemsRaw()

getUploadFileItems

public java.util.List<org.apache.commons.fileupload.FileItem> getUploadFileItems()

handleURL

public HandlerResult handleURL(java.lang.String url)
                        throws java.lang.Exception
Throws:
java.lang.Exception

sendRedirect

public void sendRedirect(java.lang.String url)

getHits

public int getHits()

findResourcesHtmlFile

public java.lang.String findResourcesHtmlFile(java.lang.String pathInfo)

getTemplateDirs

public java.lang.String getTemplateDirs()

getPaletteList

public java.util.Map getPaletteList()

findSession

public Session findSession(java.lang.String otherSessionID)

findSession

public Session findSession(java.lang.String otherSessionID,
                           boolean touchLastAccessTime)

getSubsession

public Session getSubsession()
                      throws java.lang.Exception
Looks for the special subsession named in the Session field "SUBSESSIONID". You can have multiple subsessions, but a common pattern is to create a subsession and store its sessionid in the SUBSESSIONID field when you know you'll have exactly one subsession.

Returns:
null if not found.
Throws:
java.lang.Exception

getCloseWhenRequestComplete

public boolean getCloseWhenRequestComplete()

setCloseWhenRequestComplete

public void setCloseWhenRequestComplete(boolean value)

closeWhenRequestComplete

public void closeWhenRequestComplete()
                              throws java.lang.SecurityException
Throws:
java.lang.SecurityException

isClosing

public boolean isClosing()

close

public void close()
           throws java.lang.SecurityException
Throws:
java.lang.SecurityException

toString

public java.lang.String toString()
Overrides:
toString in class Persistent

getCategoryID

public java.lang.String getCategoryID()
Overrides:
getCategoryID in class DynamideObject

readPagesElement

public void readPagesElement()

getInclude

public java.lang.String getInclude(java.lang.String includeName)

findResourceFilename

public java.lang.String findResourceFilename(java.lang.String resourceID)
Returns a non-zero-length string for the file named by resourceID if found, else returns the empty string.


findAppFilename

public java.lang.String findAppFilename(java.lang.String resourceID)
Returns a non-zero-length string for the file named by resourceID if found, else returns the empty string.


findAppFilename

public java.lang.String findAppFilename(java.lang.String resourceID,
                                        boolean quiet)

getAppFilename

public java.lang.String getAppFilename(java.lang.String resourceID)
                                throws java.io.FileNotFoundException
Always returns a non-zero-length string for the file named by resourceID, or throws a FileNotFoundException.

Throws:
java.io.FileNotFoundException

getApplicationResource

public IContext getApplicationResource(java.lang.String resourceID)
                                throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

getAppFileContent

public java.lang.String getAppFileContent(java.lang.String resourceID)
                                   throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

getAppFileBytes

public byte[] getAppFileBytes(java.lang.String resourceID)
                       throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

getInclude_NEW

public java.lang.String getInclude_NEW(java.lang.String resourceID)

getApplication

public Application getApplication()
                           throws java.lang.Exception
Throws:
java.lang.Exception

getAppdata

public IContext getAppdata()

readDataFileToString

public java.lang.String readDataFileToString(java.lang.String relativeToHome)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

putInCache

public IContext putInCache(java.lang.String key,
                           java.lang.Object obj,
                           boolean applicationShared)
                    throws java.lang.Exception
Throws:
java.lang.Exception

getFromCache

public IContext getFromCache(java.lang.String key,
                             boolean applicationShared)
                      throws java.lang.Exception
Throws:
java.lang.Exception

getContentFromCache

public java.lang.Object getContentFromCache(java.lang.String key,
                                            boolean applicationShared)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

commitInMemoryChangesToDOM

public void commitInMemoryChangesToDOM()
                                throws java.lang.Exception
Description copied from class: JDOMFile
Called when persisitence is going to happen: gives subclasses an opportunity to sync the DOM with memory.

Overrides:
commitInMemoryChangesToDOM in class JDOMFile
Throws:
java.lang.Exception

findDotted

public java.lang.Object findDotted(java.lang.String dottedName)
Key Method:
Key method for finding objects in Dynamide, returns null if not found.

safeFind

public java.lang.Object safeFind(java.lang.String dottedName)

throwException

public void throwException(java.lang.String message)
                    throws DynamideException
Throws:
DynamideException

assertNotNull

public void assertNotNull(java.lang.Object test,
                          java.lang.String message,
                          java.lang.Object caller)
                   throws DynamideException
Throws:
DynamideException

assertNotEmpty

public void assertNotEmpty(java.lang.String test,
                           java.lang.String message,
                           java.lang.Object caller)
                    throws DynamideException
Throws:
DynamideException

getString

public java.lang.String getString(java.lang.String what)

get

public java.lang.Object get(java.lang.String what)
                     throws java.lang.Exception
Returns values by searching in this order: specially named values, named pages, Properties, then registered Field objects. These are the specially named values, in order: "SESSIONID", "session", "application", "page", "next", "nextPageID", "USER", "requestPath", "applicationPath", "pathInfo", "account", "RESOURCE_ROOT", "lastAccessTime", "startTime", "currentPageID", "hits", "modeStringShort", "pooled".

Specified by:
get in interface IDatasource
Specified by:
get in interface IDatasourceBasic
Specified by:
get in interface IGet
Overrides:
get in class ContextNode
Throws:
java.lang.Exception

isValueTrue

public boolean isValueTrue(java.lang.String fieldName)
Returns whether a String value of a Field was "true", ignoring case.

Overrides:
isValueTrue in class Persistent

isValueNull

public boolean isValueNull(java.lang.Object value)

getVisitedPages

public java.lang.String[] getVisitedPages()

getVisitedPagesCount

public int getVisitedPagesCount()

setActivePage

protected void setActivePage(java.lang.String pageID)

getActivePage

public java.lang.String getActivePage()

isBeforeFirstPage

public boolean isBeforeFirstPage()

getNextPageID

public java.lang.String getNextPageID()

setNextPageID

public void setNextPageID(java.lang.String new_value)

isPageLoaded

public boolean isPageLoaded(java.lang.String pageID)

getLoadedPages

public java.util.Collection getLoadedPages()

getLoadedPagesMap

public java.util.Map getLoadedPagesMap()

getPages

public java.util.List getPages()

addPageName

public void addPageName(java.lang.String name)
Just add a page to the list of names in the project. No checking is done, and the page will only become part of application.xml if you call saveToFile().


getObjects

public java.util.List getObjects()

getPageList

public StringList getPageList()

listPages

public java.lang.String listPages()

getPageListSorted

public StringList getPageListSorted()

getNextPageIDInOrder

public java.lang.String getNextPageIDInOrder(java.lang.String currentPageID)

getDefaultPage

public java.lang.String getDefaultPage()

getTestStringList

public StringList getTestStringList()

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

getResponse

public javax.servlet.http.HttpServletResponse getResponse()

getUploadFileItems

public java.util.List<org.apache.commons.fileupload.FileItem> getUploadFileItems(javax.servlet.http.HttpServletRequest request)
                                                                          throws org.apache.commons.fileupload.FileUploadException
(Note: it is possible that there could be some threading issue, but I think the DynamideServlet doesn't let two requests live in the same session. ) Usage: fileItems[0].getFieldName() fileItems[0].getFileName()

Throws:
org.apache.commons.fileupload.FileUploadException

getServletFileUpload

public org.apache.commons.fileupload.servlet.ServletFileUpload getServletFileUpload()

getHandler

public DynamideHandler getHandler()

setHandler

public void setHandler(DynamideHandler new_value)

getHandlerResult

public HandlerResult getHandlerResult()

setHandlerResult

public void setHandlerResult(HandlerResult new_value)

getDebugURI

public java.lang.String getDebugURI()

setDebugURL

public void setDebugURL(java.lang.String url)

getDebugURLObject

public java.net.URL getDebugURLObject()
                               throws java.lang.Exception
Throws:
java.lang.Exception

queryParam

public java.lang.String queryParam(java.lang.String paramName)

getQueryParam

public java.lang.String getQueryParam(java.lang.String paramName)

hasQueryParam

public boolean hasQueryParam(java.lang.String paramName)
During a request, this method sees if there is a query parameter by name in the request, either in the URL query string, or in the POST fields, or, if this is an upload, then also checks for POST fields sent within the upload multipart. For POSTs, the query string goes in the action attribute, e.g. <FORM action="/dynamide/doco?page=menu" ...


getBrowserID

public int getBrowserID()

setBrowserID

public void setBrowserID(int new_value)
%% OOOPS: this is inherantly un-threadsafe. Two simultaneous requests from different browsers would trip this up. In theory, you only come in with one browser at a time on one Session, but if someone decided that they wanted a global, shared session this would be a problem. Better to always do this through the request.


getBrowserStringID

public java.lang.String getBrowserStringID()

getWebMacro

public org.webmacro.WebMacro getWebMacro()
                                  throws org.webmacro.InitException
Don't call this method from outside this class. Instead, use expandTemplate().

Throws:
org.webmacro.InitException

getContext

public org.webmacro.Context getContext()
                                throws org.webmacro.InitException
Don't call this method from outside this class. Instead, use expandTemplate().

Throws:
org.webmacro.InitException

getContext

public org.webmacro.Context getContext(org.webmacro.WebMacro wm)
                                throws org.webmacro.InitException
Don't call this method from outside this class. Instead, use expandTemplate().

Throws:
org.webmacro.InitException

getContext

public static org.webmacro.Context getContext(org.webmacro.WebMacro wm,
                                              boolean designMode,
                                              java.lang.String sessionID,
                                              javax.servlet.http.HttpServletRequest request)
                                       throws org.webmacro.InitException
It's OK to call will request == null, but then the request won't be in the context as a variable. So the template you are expanding should not be a widget or page.

Throws:
org.webmacro.InitException

releaseContext

public static void releaseContext(org.webmacro.Context c)

getSyntaxExceptionLineNum

public static int getSyntaxExceptionLineNum(java.lang.Exception parseException)
Written to support beanshell exception messages. There's a different one for webmacro errors. JDOM errors tend not to have linenums.


getJDOMExceptionLineNum

public static int getJDOMExceptionLineNum(java.lang.Exception jdomException)

createTemplateSyntaxException

public static TemplateSyntaxException createTemplateSyntaxException(java.lang.String errorMessage,
                                                                    java.lang.String templateText)

createTemplateSyntaxException

public static TemplateSyntaxException createTemplateSyntaxException(java.lang.String errorMessage,
                                                                    java.lang.String templateText,
                                                                    int linenum)

formatTemplateSyntaxException

public static java.lang.String formatTemplateSyntaxException(java.lang.String errorMessage,
                                                             java.lang.String templateText,
                                                             int linenum)

getContainer

public Page getContainer(java.lang.String pageID,
                         java.lang.String pageName,
                         DynamideObject newOwner)
                  throws java.lang.Exception
Throws:
java.lang.Exception

expandContainer

public java.lang.String expandContainer(java.lang.String pageName)
                                 throws DynamideException
Throws:
DynamideException

expandContainer

public java.lang.String expandContainer(java.lang.String pageID,
                                        java.lang.String pageName,
                                        org.webmacro.Context c,
                                        AbstractWidget parent)
                                 throws DynamideException
Parameters:
c - OK to pass null for param c, the context won't be inherited by the container. Container's entries into the context are never propogated back to the caller.
Throws:
DynamideException

expandResource

public java.lang.String expandResource(java.lang.String resourceID,
                                       java.lang.String logName)
                                throws java.lang.Exception
Throws:
java.lang.Exception

expandResource

public java.lang.String expandResource(java.lang.String resourceID,
                                       StringList variables,
                                       java.lang.String logName)
                                throws java.lang.Exception
Throws:
java.lang.Exception

expandTemplate

public java.lang.String expandTemplate(StringList variables,
                                       java.lang.String templateText,
                                       java.lang.String logName)
                                throws DynamideUncaughtException
Throws:
DynamideUncaughtException

expandTemplate

public java.lang.String expandTemplate(java.lang.String templateText,
                                       java.lang.String logName,
                                       org.webmacro.Context c)
                                throws DynamideUncaughtException
Throws:
DynamideUncaughtException

transform

public java.lang.String transform(java.lang.String xmlResourceID,
                                  java.lang.String xslResourceID)
                           throws java.lang.Exception
Throws:
java.lang.Exception

findWidgetType

public WidgetType findWidgetType(java.lang.String type)

clearWidgetTypePool

public void clearWidgetTypePool()

clearWidgetTypePool

public void clearWidgetTypePool(java.lang.String widgetTypeName)
%% TODO, you may have a namespace problem if the same name is picked up from the different palette directories.


log

public void log(java.lang.String message)
Specified by:
log in interface ISession

logError

public void logError(java.lang.String message)
Overrides:
logError in class DynamideObject

logError

public void logError(java.lang.String message,
                     java.lang.String detail)
Overrides:
logError in class DynamideObject

hookException

public java.lang.String hookException(java.lang.String message,
                                      java.lang.Throwable t,
                                      int category)
                               throws DynamideUncaughtException
Throws the exception if not handled.

Parameters:
t - may be null
Throws:
DynamideUncaughtException

hookException

public java.lang.String hookException(java.lang.String message,
                                      java.lang.Throwable t,
                                      ScriptEvent event,
                                      int category,
                                      boolean throwIfUnhandled)
                               throws DynamideUncaughtException
Parameters:
t - may be null
Throws:
DynamideUncaughtException

showErrorPage

public java.lang.String showErrorPage(java.lang.String message,
                                      java.lang.Throwable t,
                                      int category,
                                      boolean throwIfUnhandled)
                               throws DynamideUncaughtException
Throws:
DynamideUncaughtException
Bug:
Includes workaround for Webmacro bug where it trims last character off stream

hookWidgetError

public java.lang.String hookWidgetError(AbstractWidget source,
                                        java.lang.String widgetID,
                                        java.lang.String message,
                                        java.lang.Throwable t)
                                 throws java.lang.Throwable
Throws:
java.lang.Throwable

print

public void print(java.lang.String msg)

println

public void println(java.lang.String msg)

getConsoleLog

public java.lang.String getConsoleLog()

getStringTools

public static final StringTools getStringTools()

getTools

public static final Tools getTools()

getServletTools

public static final ServletTools getServletTools()

loadClass

public static final java.lang.Object loadClass(java.lang.String className)
                                        throws java.lang.Exception
Use this to load any class with a null contructor (no arguments) from a scripting context.

Throws:
java.lang.Exception

loadWidetBean

public java.lang.Object loadWidetBean(java.lang.String className)
If you have logic or other complications that cannot be handled in WebMacro or JSP or whatever template engine you have plugged in, you can call this method to get a custom bean loaded from your template.

Returns:
a valid class (must have a no-arg constructor) if found by the classloader, else return null.

eval

public java.lang.Object eval(java.lang.String source)
                      throws java.lang.Exception
Evaluate any string in the pluggable Interpreter, the only variable in the context already is a pointer to this session, in a variable called "session". However, the session variable gives you the keys to the kingdom. See also DynamideObject.expand(String) which is used to expand expressions in the Webmacro interpreter.

Throws:
java.lang.Exception

handleEval

public static java.lang.String handleEval(java.lang.String SessionID,
                                          java.lang.String source,
                                          java.lang.String USERID,
                                          javax.servlet.http.HttpServletRequest request)
eval the source, and return a valid html chunk. Even if there is an error, you'll get formatted html, with the offending line highlighted.


setWidgetError

public void setWidgetError(java.lang.String widgetDotName,
                           java.lang.String message)

addValueBean

public void addValueBean(java.lang.String name,
                         IValueBean bean)

getValueBean

public IValueBean getValueBean(java.lang.String name)

getValueBeanHelper

public ValueBeanHelper getValueBeanHelper(java.lang.String name)

fireEvent

protected ScriptEvent fireEvent(java.lang.Object sender,
                                java.lang.String procName,
                                java.lang.String currentPageID,
                                java.lang.String nextPageID,
                                java.lang.String action,
                                ScriptEventSource eventSource,
                                java.lang.String eventSourceFilename,
                                boolean sourceOnly)
This overload does not pass in an inputObject.


fireEvent

protected ScriptEvent fireEvent(java.lang.Object sender,
                                java.lang.Object inputObject,
                                java.lang.String procName,
                                java.lang.String currentPageID,
                                java.lang.String nextPageID,
                                java.lang.String action,
                                ScriptEventSource eventSource,
                                java.lang.String eventSourceFilename,
                                boolean sourceOnly,
                                IInterpreter detachedInterp,
                                java.lang.String dmFormat)
Parameters:
inputObject - is any object the caller would like to pass in as the ScriptEvent.inputObject to the event. If the event calls event.setOutputObject() or sets event.outputObject, then ScriptEvent.outputObject is available. This is the return value used in Session.call(). Otherwise all events return nothing, since they have a signature with void return type.

getInterpreter

public IInterpreter getInterpreter()

getInterpreter

public IInterpreter getInterpreter(java.lang.String language)

getDetachedInterpreter

public IInterpreter getDetachedInterpreter(java.lang.String language)

callInterpreter

public ScriptEvent callInterpreter(ScriptEvent event,
                                   java.lang.String procName,
                                   ScriptEventSource eventSource,
                                   java.lang.String language,
                                   boolean sourceOnly)

fireWidgetMethod

public ScriptEvent fireWidgetMethod(Widget widget,
                                    java.lang.String procName)

fireWidgetImports

public void fireWidgetImports(Widget widget,
                              java.lang.String procName)

fireApplicationEvent

public ScriptEvent fireApplicationEvent(java.lang.String eventName)

fireApplicationEvent

public ScriptEvent fireApplicationEvent(java.lang.String eventName,
                                        java.lang.String action)

fireApplicationEvent

public ScriptEvent fireApplicationEvent(java.lang.String eventName,
                                        java.lang.String action,
                                        java.lang.Object inputObject)

debugApplicationEvent

public ScriptEvent debugApplicationEvent(java.lang.String inputObjectEval,
                                         java.lang.String eventName,
                                         java.lang.String currentPageID,
                                         java.lang.String nextPageID,
                                         java.lang.String action,
                                         java.lang.String sourceDotName)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

debugPageEvent

public ScriptEvent debugPageEvent(java.lang.String sourcePageID,
                                  java.lang.String inputObjectEval,
                                  java.lang.String eventName,
                                  java.lang.String currentPageID,
                                  java.lang.String nextPageID,
                                  java.lang.String action,
                                  java.lang.String sourceDotName)
                           throws java.lang.Exception
Throws:
java.lang.Exception

auditEvent

public ScriptEvent auditEvent(java.lang.String senderID,
                              java.lang.String eventName)
                       throws DynamideException
Throws:
DynamideException

fireJobEvent

public ScriptEvent fireJobEvent(Job sender,
                                java.lang.String eventName,
                                java.lang.Object inputObject,
                                boolean useDetachedInterpreter)

call

public java.lang.Object call(java.lang.String eventFullName)

call

public java.lang.Object call(java.lang.String eventFullName,
                             java.lang.Object inputObject)

createWidget

public java.lang.String createWidget(java.lang.String widgetType,
                                     java.lang.String targetPageID)
                              throws java.lang.Exception
This method is geared for the web IDE that uses the return string; to work with objects, first get a ref to the Page object, then call Page.createWidget, with will return the Widget object.

Throws:
java.lang.Exception
See Also:
Page.createWidget(java.lang.String)

renderWidget

public java.lang.String renderWidget(java.lang.String widgetName,
                                     java.lang.String targetPageID,
                                     javax.servlet.http.HttpServletRequest request)

renderWidget

public java.lang.String renderWidget(Widget wd,
                                     java.lang.String targetPageID,
                                     javax.servlet.http.HttpServletRequest request)

getPageByFile

public Page getPageByFile(java.io.File f)
                   throws java.lang.Exception
Throws:
java.lang.Exception

findPageByID

public Page findPageByID(java.lang.String pageID)
silent about exceptions, returns null if not found or error - if you want to see the exceptions, call getPageByID instead.


findPageByID

public Page findPageByID(java.lang.String pageID,
                         DynamideObject newOwner)

getPageByID

public Page getPageByID(java.lang.String pageID)
                 throws java.io.IOException,
                        org.jdom.JDOMException,
                        PageLoadException,
                        DatatypeException
Finds and loads a Page, given the pageID, which is relative to your project. This method is only for files in a Web Application's project, that is, not for system dialogs or dialogs in libraries. For those, use findOrCreateDialog(...) so that you can specify the local id. If you wish to find if a page is in a project or is loadable from the project without catching the PageLoadException, call findPageByID(...).

Throws:
java.io.IOException
org.jdom.JDOMException
PageLoadException
DatatypeException

getPage

public Page getPage(java.lang.String pageID)
             throws java.io.IOException,
                    org.jdom.JDOMException,
                    PageLoadException,
                    DatatypeException
Finds and loads a Page, given the pageID, which is relative to your project. This method is only for files in a Web Application's project, that is, not for system dialogs or dialogs in libraries. For those, use findOrCreateDialog(...) so that you can specify the local id. If you wish to find if a page is in a project or is loadable from the project without catching the PageLoadException, call findPageByID(...).

Throws:
java.io.IOException
org.jdom.JDOMException
PageLoadException
DatatypeException

findOrCreateDialog

public Page findOrCreateDialog(java.lang.String pageID,
                               java.lang.String appRelativeName)
                        throws java.io.IOException,
                               org.jdom.JDOMException,
                               PageLoadException,
                               DatatypeException
Parameters:
appRelativeName - is the name of the resource relative to the application or library, e.g. findOrCreateDialog("myDialog", "resources/dialogs/com.dynamide.imgview"); Note that appRelativeName contains neither the file extension (.xml) nor the full path, but it does contain the "resources/" part of the path.
Throws:
java.io.IOException
org.jdom.JDOMException
PageLoadException
DatatypeException

destroyDialog

public void destroyDialog(java.lang.String pageID)

createDialogURL

public java.lang.String createDialogURL(java.lang.String pageID,
                                        java.lang.String appRelativeName,
                                        java.lang.String params)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

loadAllPages

public void loadAllPages()

loadPage

public Page loadPage(java.lang.String pageID)
              throws java.io.IOException,
                     org.jdom.JDOMException,
                     PageLoadException,
                     DatatypeException
Throws:
java.io.IOException
org.jdom.JDOMException
PageLoadException
DatatypeException

loadPage

public Page loadPage(java.lang.String pageID,
                     boolean forceReload,
                     DynamideObject newOwner)
              throws java.io.IOException,
                     org.jdom.JDOMException,
                     PageLoadException,
                     DatatypeException
Throws:
java.io.IOException
org.jdom.JDOMException
PageLoadException
DatatypeException

unloadPage

public void unloadPage(java.lang.String pageID)

pageVisited

public void pageVisited(java.lang.String pageID)

newPage

public Page newPage(java.lang.String pageID,
                    java.lang.String pagetype)
             throws java.lang.Exception
Throws:
java.lang.Exception

readFieldsIntoSession

public void readFieldsIntoSession(org.jdom.Element root)
                           throws org.jdom.JDOMException,
                                  DatatypeException
read the fields from the fielddefs file.

Throws:
org.jdom.JDOMException
DatatypeException

handleLayoutViewChanged

public java.lang.String handleLayoutViewChanged(javax.servlet.http.HttpServletRequest request)

renderWidgetHelp

public java.lang.String renderWidgetHelp(java.lang.String widgetType)

getFields

public java.util.Map getFields()
Specified by:
getFields in interface IDatasource
Specified by:
getFields in interface IDatasourceBasic
Returns:
a Map of all the fields owned.

getFieldValue

public java.lang.Object getFieldValue(java.lang.String fieldName)
Note: returns an empty string if field is not found or Field value object is null; see getFieldObject to get direct access to the object or null.


getFieldStringValue

public java.lang.String getFieldStringValue(java.lang.String fieldName)
Note: returns an empty string if field is not found or Field value object is null; see getFieldObject to get direct access to the object or null.


getFieldObject

public java.lang.Object getFieldObject(java.lang.String fieldName)
Note: returns null if the field has no "value" object, or if the object is null; use getFieldValue or getFieldStringValue if you want a null-safe method.


getField

public Field getField(java.lang.String fieldName)
Description copied from interface: IDatasource
Maintain a list of Field objects; return the live Field when asked by this method. IDatasource supports the concept of the "current row", so that getField indexes into a tabular dataset by the fieldName of the column, for the current row. The caller gets different cell values by a) calling next() or some other navigation method, or b) calling getField(fieldName, fieldIndex) if indexed fields are supported.

Specified by:
getField in interface IDatasource
Specified by:
getField in interface IDatasourceBasic

getField

public Field getField(java.lang.String fieldName,
                      java.lang.String fieldIndex)
Description copied from interface: IDatasource
This class can support indexed Fields, by any arbitrary String index, which will for tabular datasets, be the zero-based row index; however the index can be any valid string which could itself be a search specifier that is used by this method.

Specified by:
getField in interface IDatasource

clear

public void clear()
Specified by:
clear in interface IDatasource

dumpErrorsHTML

public java.lang.String dumpErrorsHTML()
Specified by:
dumpErrorsHTML in interface IDatasource

setFieldValue

public void setFieldValue(java.lang.String fieldName,
                          java.lang.Object value)
                   throws DatatypeException
Description copied from interface: IDatasource
The editable Dynamide Widgets can use this to modify the underlying Fields. If the underlying dataset does not support updates, you may wish to implement this as a no-op.

Specified by:
setFieldValue in interface IDatasource
Throws:
DatatypeException

setFieldValue

public boolean setFieldValue(java.lang.String fieldName,
                             java.lang.Object value,
                             java.lang.String fieldIndex)
Permissively sets the field value, ignoring the fieldIndex

Specified by:
setFieldValue in interface IDatasource

setFieldObject

public void setFieldObject(java.lang.String fieldName,
                           java.lang.Object value)
                    throws DatatypeException
Throws:
DatatypeException

setField

public Field setField(Field field)
You can use this to rebind a Field, or add a new one. Calls addField(field.get("name"), field, false).


setField

public Field setField(java.lang.String fieldName,
                      Field field)
You can use this to rebind a Field, or add a new one. Calls addField(fieldName, field, false).


addField

public Field addField(Field field)

addField

public Field addField(java.lang.String fieldName,
                      Field field)

addField

public Field addField(java.lang.String fieldName,
                      Field field,
                      boolean logWarnIfExists)

getAutoFieldIDs

public java.util.List getAutoFieldIDs()

setAutoFieldIDs

public void setAutoFieldIDs(java.util.List new_value)

logAutoFieldID

public void logAutoFieldID(java.lang.String id)

createField

public Field createField(java.lang.String fieldName,
                         java.lang.String value)
                  throws DynamideException
Throws:
DynamideException

createField

public Field createField(java.lang.String fieldName,
                         java.lang.String value,
                         boolean override)
                  throws DynamideException
Throws:
DynamideException

findField

public Field findField(java.lang.String fieldName)

removeField

public Field removeField(java.lang.String fieldName)

setFieldError

public void setFieldError(java.lang.String fieldName,
                          java.lang.String message)

registerDatasource

public void registerDatasource(IDatasource caller)

unregisterDatasource

public void unregisterDatasource(IDatasource caller)

getDatasource

public IDatasource getDatasource(java.lang.String id)

getExpansionLog

public ExpansionLog getExpansionLog()

logHandlerProcCollapsed

public void logHandlerProcCollapsed(java.lang.String procName,
                                    java.lang.Object message)

formatRequestLineForLogHandlerProc

public java.lang.String formatRequestLineForLogHandlerProc(javax.servlet.http.HttpServletRequest request)

logHandlerProcRequest

public void logHandlerProcRequest()

enterHandlerProc

public void enterHandlerProc(java.lang.String procName,
                             java.lang.Object info)

leaveHandlerProc

public void leaveHandlerProc(java.lang.String procName,
                             java.lang.Object info)
Parameters:
info - Can be empty, especially if you already documented something in the enterHandlerProc info proc, for example, the calling URL, since it won't have changed.

logHandlerProc

public void logHandlerProc(java.lang.String procName,
                           java.lang.Object info)
Just add it at one indent in, but don't hang on to the indent: this is one log line.


logHandlerProc

public void logHandlerProc(java.lang.String procName,
                           java.lang.Object info,
                           boolean doIndent)

handlerProcComplete

public void handlerProcComplete(long elapsedMillis,
                                java.lang.String replayURL)

handlerProcComplete

public void handlerProcComplete(long elapsedMillis,
                                java.lang.String replayURL,
                                java.lang.Throwable t)

isHandlerProcLogOn

public boolean isHandlerProcLogOn()

printHandlerProcLog

public java.lang.String printHandlerProcLog()

formatQueryStringDetailLink

public java.lang.String formatQueryStringDetailLink(javax.servlet.http.HttpServletRequest request)

getJobLog

public java.util.List getJobLog()

logJobStart

public void logJobStart(java.lang.String eventName,
                        java.lang.String jobName)
                 throws java.lang.Exception
Throws:
java.lang.Exception

logJob

public void logJob(java.lang.String eventName,
                   ScriptEvent event,
                   java.lang.String jobName,
                   java.lang.String status)
            throws java.lang.Exception
event can be null, in which case be sure to pass in status param

Throws:
java.lang.Exception

printJobLog

public java.lang.String printJobLog()
                             throws java.lang.Exception
Throws:
java.lang.Exception

onJobDone

public void onJobDone(Job job)
Fires application_onJobDone with the Job object as the inputObject


getApplicationProperties

public java.util.Enumeration getApplicationProperties()

getApplicationPropertyEditor

public java.lang.String getApplicationPropertyEditor(Session session,
                                                     Session subsession,
                                                     Property property,
                                                     java.lang.String onkeydown,
                                                     java.lang.String onchange)

getWidgetPropertyEditor

public java.lang.String getWidgetPropertyEditor(Session session,
                                                Session subsession,
                                                Page page,
                                                Widget widget,
                                                Property property,
                                                Property defaultProperty,
                                                java.lang.String onkeydown,
                                                java.lang.String onchange)

getPagePropertyEditor

public java.lang.String getPagePropertyEditor(Session session,
                                              Session subsession,
                                              Page page,
                                              Property property,
                                              java.lang.String onkeydown,
                                              java.lang.String onchange)

getPropertyEditor

public static java.lang.String getPropertyEditor(Session session,
                                                 Session subsession,
                                                 java.lang.String logName,
                                                 Property property,
                                                 Property defaultProperty,
                                                 java.lang.String onkeydown,
                                                 java.lang.String onchange,
                                                 StringList variables)

getTimestampLocale

public java.lang.String getTimestampLocale()

getCurrentLanguageCode

public java.lang.String getCurrentLanguageCode()

loadInternationalization

public boolean loadInternationalization(java.lang.String languageCode)
Returns:
true if languageCode passed in is null or empty, otherwise returns true if found.

lookupInternationalizedValue

public java.lang.String lookupInternationalizedValue(java.lang.String name)
Returns:
a non-null String if found, otherwise a null String.

internationalize

public java.lang.String internationalize(java.lang.String name,
                                         java.lang.String defaultValue)

showInternationalizationForm

public java.lang.String showInternationalizationForm(javax.servlet.http.HttpServletRequest request)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

checkWebmacroLogRef

public void checkWebmacroLogRef()

logWhichExpansion

public void logWhichExpansion(java.lang.String msg)

showWebMacroLog

public java.lang.String showWebMacroLog()

timeout

public boolean timeout(long now)
Specified by:
timeout in interface ISessionItem
Returns:
true if OK to timeout and remove from sessions table. If true, implementing object should perform its cleanup. It does not need to remove itself from the SessionDatabase's session table.

shutdown

public void shutdown()
The shutdown method is called in a new thread, and you will be out of the session table by the time this gets called.

Specified by:
shutdown in interface ISessionItem

isCritical

public boolean isCritical()
Specified by:
isCritical in interface ISessionItem

getParentSessionID

public java.lang.String getParentSessionID()
Specified by:
getParentSessionID in interface ISessionItem

hasChildSession

public boolean hasChildSession(java.lang.String childSessionID)
Specified by:
hasChildSession in interface ISessionItem

getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface ISessionTableItem

getHostName

public java.lang.String getHostName()
Specified by:
getHostName in interface ISessionTableItem

getAttachToLink

public java.lang.String getAttachToLink()
Specified by:
getAttachToLink in interface ISessionTableItem

getAttachToLink

public java.lang.String getAttachToLink(java.lang.String caption)

getActiveItemTag

public java.lang.String getActiveItemTag()
Specified by:
getActiveItemTag in interface ISessionTableItem

getCurrentPageID

public java.lang.String getCurrentPageID()
Specified by:
getCurrentPageID in interface ISessionTableItem

getModeListing

public java.lang.String getModeListing()
Returns the mode listing for the ISessionTableItem interface, by calling getModeStringShort().

Specified by:
getModeListing in interface ISessionTableItem
See Also:
getModeStringShort()

getReportLink

public java.lang.String getReportLink()
Specified by:
getReportLink in interface ISessionTableItem

getCloseLink

public java.lang.String getCloseLink()
Specified by:
getCloseLink in interface ISessionTableItem

getExtraInfo

public java.lang.String getExtraInfo()
Specified by:
getExtraInfo in interface ISessionTableItem

getStartTime

public long getStartTime()
Specified by:
getStartTime in interface ISessionTableItem

getLastAccessTime

public long getLastAccessTime()
Specified by:
getLastAccessTime in interface ISessionTableItem

getDatasourceHelper

public IDatasource getDatasourceHelper()
Description copied from interface: IDatasource
By default, simply return a reference to "this", since the implementing class is an instance of IDatasource. This method exists so that IDatasourceBasic implementations can be wrapped in an IDatasource interface.

Specified by:
getDatasourceHelper in interface IDatasource
Specified by:
getDatasourceHelper in interface IDatasourceBasic
Returns:
A pointer to this Session, since Session is an IDatasource.
See Also:
IDatasourceBasic

iterator

public java.util.Iterator iterator()
Description copied from interface: IDatasourceBasic
Return an Iterator which knows how to properly iterate over your implementation. You can support remove(), or throw an UnsupportedOperationException. Single-row datasource would return an iterator that returned one row, then set hasNext to false. All implementations should provide one row of data, even if this row contains only empty strings for values. For single row datasets, here is a simple implementation, which can be done in an inner class:
  public class MyClass implements IDatasourceBasic{
      public class MyDatasourceIterator implements Iterator {
          private MyClass m_target;
          private int m_iterCount = 0;
          public SessionDatasourceIterator(MyClass target){
              m_target = target;
          }
          public Object next(){
              m_iterCount++;
              return m_target;
          }
          public boolean hasNext(){
              return (m_iterCount < 1);
          }
          public void remove(){
              throw new UnsupportedOperationException();
          }
      }
  }
 

Specified by:
iterator in interface IDatasource
Specified by:
iterator in interface IDatasourceBasic
See Also:
IDatasourceBasic.iterator()

isReadOnly

public boolean isReadOnly()
Description copied from interface: IDatasource
Updateable datasets should return false.

Specified by:
isReadOnly in interface IDatasource

post

public boolean post()
Description copied from interface: IDatasource
If isReadOnly() returns false, and the underlying data can be updated, return true. Otherwise return false.

Specified by:
post in interface IDatasource

cancel

public void cancel()
Specified by:
cancel in interface IDatasource

go

public boolean go(int distance)
Description copied from interface: IDatasource
go(0) should go to the first row in the set, if supported, go(-1) should go back a row, if supported, go(1) should go forward a row if supported, go(IDatasource.END) should go to the last row in the set, leaving the last row active, that is, not after the last row, and all unsupported actions should simply be no-ops.

Specified by:
go in interface IDatasource
Returns:
true if navigation to a different row was achieved.

seek

public boolean seek(int zeroBasedIndex)
Description copied from interface: IDatasource
Jump to the absolute zero based index.

Specified by:
seek in interface IDatasource

seekBegin

public boolean seekBegin()
Specified by:
seekBegin in interface IDatasource

seekEnd

public boolean seekEnd()
Specified by:
seekEnd in interface IDatasource

onRowChanged

public void onRowChanged()
Description copied from interface: IDatasource
Provides notification that a seek or go operation has occured.

Specified by:
onRowChanged in interface IDatasource

insertRow

public boolean insertRow(int index)
Specified by:
insertRow in interface IDatasource
Parameters:
index - Is one of IDatasource.BEGIN, IDatasource.END, IDatasource.AFTER, IDatasource.BEFORE or is an absolute index the new row will occupy. For examle, if there is one row in the dataset, then insertRow(0) would insert the new row at index 0, before the current row, while insertRow(1) would place the new row at index 1, after the current row. IDatasource.AFTER would place the new row after the current row, regardless of absolute index, and IDatasource.BEFORE would place the row before the current row.
Returns:
false if operation is not supported or raises an error.

isRowCountAllowed

public boolean isRowCountAllowed()
Description copied from interface: IDatasource
Report if calling getRowCount() will be allowed. For some datasets it may not be advisable, e.g. for large SQL datasets, to allow getRowCount(), but this method simply tells the caller whether calling getRowCount() will return meaningful data. getRowCount() may return IDatasource.ROW_COUNT_NOT_ALLOWED, but does not throw Exceptions.

Specified by:
isRowCountAllowed in interface IDatasource
Returns:
true if calling getRowCount() is allowed

getRowCount

public int getRowCount()
Description copied from interface: IDatasource
The row count of the current dataset, or IDatasource.ROW_COUNT_NOT_ALLOWED if the operation is not supported. If not supported, be sure to return false from isRowCountAllowed().

Specified by:
getRowCount in interface IDatasource
Returns:
the current row count, or IDatasource.ROW_COUNT_NOT_ALLOWED

getCurrentRowIndex

public int getCurrentRowIndex()
Description copied from interface: IDatasource
The zero-based index of the current row: single-row implementations can always return 0, implementations that don't support row indices should return IDatasource.ROW_INDEX_UNKNOWN;

Specified by:
getCurrentRowIndex in interface IDatasource

isCurrentRow

public boolean isCurrentRow()

find

public java.lang.Object find(java.lang.String path)
Description copied from class: ContextNode
Search using "/" as the separator, by simply calling find(path, "/").

Specified by:
find in interface IContext
Overrides:
find in class ContextNode

getKey

public java.lang.String getKey()
Specified by:
getKey in interface IContext
Overrides:
getKey in class ContextNode

main

public static void main(java.lang.String[] args)


Copyright 2001-2013 DYNAMIDE.COM. All Rights Reserved.