com.wewebu.ow.server.app
Class OwMainAppContext

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.ui.OwAppContext
          extended by com.wewebu.ow.server.app.OwMainAppContext
All Implemented Interfaces:
OwComboboxRendererFactory, OwUserOperationExecutor, OwBaseInitializer, OwNetworkContext, OwRepositoryContext, OwHistoryManagerContext, OwMandatorManagerContext, OwRoleManagerContext

public class OwMainAppContext
extends OwAppContext
implements OwHistoryManagerContext, OwRoleManagerContext, OwNetworkContext, OwMandatorManagerContext, OwComboboxRendererFactory

Main Application Context Class Implementation. Instance stays active during session.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.ui.OwAppContext
OwAppContext.OwDialogManagerViewReference
 
Nested classes/interfaces inherited from interface com.wewebu.ow.server.ecm.OwRepositoryContext
OwRepositoryContext.OwConfigChangeEvent, OwRepositoryContext.OwConfigChangeEventListener
 
Field Summary
static String CONFIGNODE_BASE
          the XML node name Base
static String CONFIGNODE_SERVER
          the XML node name Server
static String CONFIGNODE_URLOVERWRITE
          the XML node name UrlOverwrite
static String LITERAL_PLACEHOLDER_TODAY
          placeholder for literals: will be replaced with todays date
static String LITERAL_PLACEHOLDER_USER_DISPLAY_NAME
          placeholder for literals: will be replaced with the user display name
static String LITERAL_PLACEHOLDER_USER_ID
          placeholder for literals: will be replaced with the user ID
static String LITERAL_PLACEHOLDER_USER_LONG_NAME
          placeholder for literals: will be replaced with the user long name
static String LITERAL_PLACEHOLDER_USER_NAME
          placeholder for literals: will be replaced with the user name
static String LITERAL_PLACEHOLDER_USER_SHORT_NAME
          placeholder for literals: will be replaced with the user short name
protected  OwClipboard m_clipboard
          the one and only clipboard for the session
static String PREFIX_DRAGDROP
          prefix for the common DND document import temp directory
protected static String WINDOW_POSITIONS_APP_SETTINGS_NAME
          name of the window positions app setting
 
Fields inherited from class com.wewebu.ow.server.ui.OwAppContext
AJAX_REQUEST_TYPE, CONFIG_JNDI_SUFFIX, CONFIG_STREAM_NAME_PREFIX, EXTERNAL_REQUEST_TARGET_ID, FULLJS_MARKER, INTERNAL_REQUEST_TARGET_ID, KEYBOARD_CTRLKEY_ALT, KEYBOARD_CTRLKEY_CTRL, KEYBOARD_CTRLKEY_NONE, KEYBOARD_CTRLKEY_SHIFT, KEYBOARD_KEY_DEL, KEYBOARD_KEY_DN, KEYBOARD_KEY_END, KEYBOARD_KEY_ESC, KEYBOARD_KEY_F1, KEYBOARD_KEY_F10, KEYBOARD_KEY_F11, KEYBOARD_KEY_F12, KEYBOARD_KEY_F2, KEYBOARD_KEY_F3, KEYBOARD_KEY_F4, KEYBOARD_KEY_F5, KEYBOARD_KEY_F6, KEYBOARD_KEY_F7, KEYBOARD_KEY_F8, KEYBOARD_KEY_F9, KEYBOARD_KEY_INS, KEYBOARD_KEY_LEFT, KEYBOARD_KEY_PAGE_DN, KEYBOARD_KEY_PAGE_UP, KEYBOARD_KEY_POS1, KEYBOARD_KEY_RETURN, KEYBOARD_KEY_RIGHT, KEYBOARD_KEY_SPACE, KEYBOARD_KEY_UP, LOGIN_VIEW_TARGET_ID, m_DEBUG_ActivateViewID, m_DEBUG_NavigationEvent, m_DEBUG_NavigationTargetID, m_ServletContext, MAIN_VIEW_TARGET_ID, PREPARED_REQUEST_URL, RESOURCE_CLASSPATH_PREFIX, RESOURCE_DEPLOYMENT_PREFIX, RESOURCE_FILE_PATH_ENVIRONMENT_VAR_NAME_PARAM, RESOURCE_FILE_PATH_PARAM, SELECTED_ANCHOR, TIME_ZONE_DAYLIGHTSAVINGS_PARAMETER_NAME, TIME_ZONE_ID_PARAMETER_NAME, TIME_ZONE_NORTHERN_HEMISPHERE_PARAMETER_NAME, TIME_ZONE_OFFSET_PARAMETER_NAME, TIME_ZONE_TIME_PARAMETER_NAME, TIME_ZONE_TRANSITIONS_PARAMETER_NAME
 
Constructor Summary
OwMainAppContext()
          Create a new OwMainAppContext.
 
Method Summary
 void addAjaxUpdateContainer(String containerId_p, String ajaxEventHandler_p)
          Add a pair of HTML container ID and the AJAX handler for it.
 void addConfigChangeEventListener(OwRepositoryContext.OwConfigChangeEventListener listener_p)
          add a config change event listener to be notified about config changes
 void addDNDImportedDocumentToStack(OwDocumentImportItem importedDocument_p)
          Add an OwDocumentImportItem to the stack of DND imported documents.
 void addFinalScript(OwScript script_p)
          Adds a single run custom java script The script runs upon m_request end, invoked by the onLoad Body tag handler.
 void addFinalScript(String strScript_p)
          Adds a single run custom java script.
 boolean addUniqueFinalScript(OwScript script_p)
          Add final script only if the same script was not already added.
 void addUserOperationListener(OwUserOperationListener listener_p)
          Adds a user operation listener to this executor.
 void clearDragDropUploadDir()
          delete temporarily drag and drop upload directory
 void clearFinalScript()
          clear the final script for this request
protected  String createBaseUrl(javax.servlet.http.HttpServletRequest req_p)
          (overridable) Create base URL which will be used to process the request.
protected  OwClipboard createClipboard()
          Create an instance of the OwClipboard object.
 OwComboboxRenderer createComboboxRenderer()
          Return a new instance of a combobox renderer, will read configuration settings and create the corresponding instance.
 OwComboboxRenderer createComboboxRenderer(OwComboModel model_p, String strID_p, OwFieldDefinition fieldDefinition_p, OwFieldProvider fieldProvider_p, OwString description_p)
          Creates a renderer component for comboboxes.
protected  OwConfiguration createConfiguration()
          Create an instance of the OwConfiguration object.
 OwFieldManager createFieldManager()
          create a new instance of the field manager
protected  String createServerUrl(javax.servlet.http.HttpServletRequest req_p)
          (overridable) Called to create the server URL for current request.
 String createTempDir(String strPrefix_p)
          creates a unique temp directory
 OwAttributeBagWriteable createUserAttributeBag(String sName_p)
          create a attribute bag for scalar settings specific for the current user.
 void deleteTempDir(String strDir_p)
          deletes a temp dir and all files within it
 boolean doShowClipboard()
          flag indicating if clipboard should be displayed
 boolean doShowWildCardDescriptions()
          flag indicating if wild card descriptions should be displayed for searches.
 void dump(Writer w_p)
          write debug dump to Writer
 String getAjaxUpdateURL(String containerId_p)
          Get the AJAX handler, or null for the given HTML container ID.
protected  URL getAppContextResource(String resourcePath_p)
          (overridable) Retrieves a resource for this application context.
 OwBaseConfiguration getBaseConfiguration()
          retrieve the Configuration object
 String getClientID()
          get a ID / name for the calling client
 String getClientWildCard(int wildcardtype_p)
          get a wild card to be used in the client for the given wild card type
 OwClipboard getClipboard()
          get the one and only clipboard for the session
 Collection getClipboardAvailableDocFunctionIds()
          Get the document function plugin IDs available in clipboard.
 OwRepositoryContext.OwConfigChangeEventListener getConfigChangeEvent()
          delegates OwConfigChangeEventListener notifications to the subscribed listeners
 String getConfigPath()
          get the path to the configuration files
 OwConfiguration getConfiguration()
          retrieve the Configuration object
 String getConfigurationName()
          get a name for the configuration to use can be used to distinguish different applications
 OwCredentials getCredentials()
          get the credentials of the logged in user
 String getCurrentMasterPluginID()
          get the current ID to the active master plugin
 OwMasterView getCurrentMasterView()
          get the current active master plugin view
 OwBaseUserInfo getCurrentUser()
          get the current user
 String getDateFormatString()
          get the format string to use for date values
 String getDateFormatStringWithoutDate()
          get the format string to use for time values do not use date tokens
 String getDateFormatStringWithoutTime()
          get the format string to use for date values do not use time tokens
 String getDefaultFolderClassName()
          name of the default class used to create simple folders
 String getDesignDir()
          get the directory of the used design.
 String getDesignURL()
          get the URL of the used design.
 OwDialogManager getDialogManager()
          get a reference to the default dialog manager used to open dialogs from the context in openDialog(...) The dialog manager must be created somewhere in the layout and set in the context.
 String getDNDDocumentImportTempDir()
           
 OwDocumentImportItem getDNDImportedDocument(int i_p)
          Get the i_pth imported document from the DND document import stack.
 int getDNDImportedDocumentsCount()
          Get the size of the DND document import stack.
 String getDragAndDropUploadDir()
          get the path of the current drag and drop upload directory
 Throwable getError()
          get exception to display
 String getFinalScript()
          get the current final script to be executed for this request
 OwHistoryManager getHistoryManager()
          retrieve the network object
 OwInfoProviderRegistry getInfoProviderRegistry()
          Get a info provider registry which is used to request information provider for special context.
 org.springframework.jdbc.core.JdbcTemplate getJDBCTemplate()
          get a spring JDBC template for the default DataSource
 Locale getLocale()
          get the current locale, which can be used as a prefix/postfix to distinguish localization resources
 String getLocalEventURL(String strLangID_p)
          get a event URL to change the language NOTE: This event URL is not checked with request key, so it can be called arbitrary and be stored in the users browser.
 OwMandator getMandator()
          get the mandator interface of the current logged in user
 String getMandatorID()
          get a ID / name for the calling mandator
 OwMandatorManager getMandatorManager()
          retrieve the MandatorManager reference
 int getMaxClipboardSize()
          Get maximum number of items that can be hold in the clipboard
 int getMaxSortCriteriaCount()
          get the maximum number of sort criteria, which can be applied to a list at once
 Collection getMessages()
          Get a collection of messages to display
 OwNetwork getNetwork()
          retrieve the network object
 int getNextDNDDocumentImportFileID()
           
 int getPageSizeForLists()
          number of items in a page for lists which support paging
 OwRoleManager getRoleManager()
          retrieve the RoleManager object
 boolean getSafeBooleanAppSetting(String strName_p, boolean default_p)
          get a setting for the application
 String getSafeCurrentMasterPluginStyleClassID()
          get a ID for the current master plugin that can be used to create a HTML class style ID
 int getSafeIntAppSetting(String strName_p, int iDefault_p)
          get a setting for the application
 Collection getSafeListAppSetting(String strName_p)
          get a setting for the application
 String getSafeStringAppSetting(String strName_p, String strDefault_p)
          get a setting for the application
 String getSessionCookieData(javax.servlet.http.HttpServletRequest httpServletRequest)
          get session cookie name value pairs delimited by whitespace
 List getSessionCookieNames()
          get the list of the session cookie names as configured in owbootstrap.xml (<SessionCookieNames>)
 String getSessionDisplayName()
          get a name for the current session, used for warning and error logs to identify the session later.
 OwSettings getSettings()
          retrieve the settings object
 String getStartupID()
          get the ID of the startup plugin
 String getTimeFormatString()
          get the format string to use for time values
 OwBaseUserInfo getUserInfo()
          get the logged in user
 OwWindowPositions getWindowPositions()
          get a setting for the application
 String getWindowPositionsSaveURL()
          get a event URL to save the viewer and main window position the position values have to be appended as a query string, using the getter / setter names as request parameter names in the following form: "[getter / setter name]" e.g.: for getViewerHeight the Parameter name would be "ViewerHeight"
 boolean handleRequest(javax.servlet.http.HttpServletRequest request_p, javax.servlet.http.HttpServletResponse response_p)
          handles the m_request from the page and dispatches ONLY to the selected target
 boolean hasLabel(String strName_p)
          check if a display label is defined for the given symbol name
protected  void init()
          init the target after the context is set.
 void init(OwAppContext oldcontext_p)
          init the context BEFORE the user has logged on.
protected  void initializeUserOperationListeners()
          Initialize the listeners for user operations (at the login time)
 boolean isAllowed(int iCategory_p, String strFunctionName_p)
          check if function or plugin is available for the user.
 boolean isContainerBasedAuthenticated()
          check the current user is authenticated container based
 boolean isLogin()
          check the credentials of the logged in user
 boolean isUseHtml5DragAndDrop()
          flag indicating if the application should use the HTML5 implementation of the DnD feature.
 String localizeLabel(String strName_p)
          optionally translate a name into a readable label, used for property class names in ECM adaptors which do not support separate displaynames
 void loginInit()
          init the context AFTER the user has logged in.
 void logout()
          clear the credentials, i.e.
 void onActivateMasterPlugin(OwMasterView view_p)
          notify the context about the new activated master plugin in order to generate context sensitive information
 void onLogin(OwBaseUserInfo user_p)
          called when user gets logged in
 void onSaveWindowPositions(javax.servlet.http.HttpServletRequest request_p)
          called when getWindowPositionsSaveURL was invoked see getWindowPositionsSaveURL for details
 void onSessionTimeOut(javax.servlet.http.HttpSession httpSession_p)
          called when the session times out
 void openHelp(String sHelppath_p)
          opens a help page in the connected help plugin if available
 void postMessage(String sMessage_p)
          add a message to be displayed for user info
 void registerPluginKeyEvent(String strPluginID_p, String strEventURL_p, String strFormName_p, String strDescription_p)
          register a key event for this plugin if defined in key map, call in onRender method only
 void releaseDNDImportedDocuments()
          Release all imported documents of the DND document import stack and remove the current temp dir.
 void removeConfigChangeEventListener(OwRepositoryContext.OwConfigChangeEventListener listener_p)
          add a config change event listener to be notified about config changes
 void removeUserOperationListener(OwUserOperationListener listener_p)
          Removes the given user operation listener from this executor.
 void resetMessages()
          Reset messages collection.
 Object resolveLiteralPlaceholder(String contextname_p, String placeholdername_p)
          resolve the given literal placeholder name to a property / criteria value
 void setError(Throwable exception_p)
          set exception to display
 void setLocale(Locale locale_p)
           
 boolean useJS_DateControl()
          flag indicating if the java script Date control should be used instead of a HTML combobox control
 
Methods inherited from class com.wewebu.ow.server.ui.OwAppContext
activateView, beginRequest, broadcast, clearFocusControlID, closeAllDialogs, createBaseInitializer, createJspPageUrl, createSubmitFunction, createSubmitLink, decodeURL, encodeURL, endRequest, getAjaxEventURL, getApplicationAttribute, getBaseEventURL, getBasePath, getBaseURL, getClientTimeZone, getClientTimeZoneInfo, getConfigURL, getDialogManagerViewReference, getEventTarget, getEventURL, getFocusControlID, getFormEventFunction, getFormEventURL, getHttpRequest, getHttpResponse, getHttpServletContext, getHttpSession, getInfiniteEventURL, getInitParameter, getJSPPageURL, getKeyEvents, getRegisteredInterface, getServerURL, getTargetCount, getXMLConfigDoc, handleAjaxRequest, handleExternalTargetRequest, isAjaxRequest, isExternalTargetRequest, isFormRequest, localize, localize1, localize2, localize3, openDialog, prepareRequest, registerInterface, registerKeyAction, registerKeyAction, registerKeyAction, registerKeyEvent, registerKeyEvent, registerKeyFormEvent, registerRequestTarget, registerTarget, removeTarget, removeTarget, renderJSInclude, renderJSInclude, renderKeyBoardScript, serverSideInclude, setAjaxRequest, setApplicationAttribute, setClientTimeZoneInfo, setFocusControlID, setLocalThreadRequest, setLocalThreadResponse, setRequest, unregisterInterface, unregisterRequestTarget
 
Methods inherited from class com.wewebu.ow.server.ui.OwEventTarget
attach, detach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getFormName, getFormTarget, getID, onExternalRequest, onFormEvent, onRequest, setExternalFormTarget, updateExternalFormTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.wewebu.ow.server.role.OwRoleManagerContext
getBasePath, getInitParameter, getXMLConfigDoc, localize, localize1, localize2, localize3
 
Methods inherited from interface com.wewebu.ow.server.ecm.OwNetworkContext
getClientTimeZone, getClientTimeZoneInfo
 
Methods inherited from interface com.wewebu.ow.server.ecm.OwRepositoryContext
getConfigURL, localize, localize1, localize2, localize3
 
Methods inherited from interface com.wewebu.ow.server.mandator.OwMandatorManagerContext
getBasePath, getInitParameter, getXMLConfigDoc, localize, localize1, localize2, localize3
 

Field Detail

WINDOW_POSITIONS_APP_SETTINGS_NAME

protected static final String WINDOW_POSITIONS_APP_SETTINGS_NAME
name of the window positions app setting

See Also:
Constant Field Values

LITERAL_PLACEHOLDER_TODAY

public static final String LITERAL_PLACEHOLDER_TODAY
placeholder for literals: will be replaced with todays date

See Also:
Constant Field Values

LITERAL_PLACEHOLDER_USER_ID

public static final String LITERAL_PLACEHOLDER_USER_ID
placeholder for literals: will be replaced with the user ID

See Also:
Constant Field Values

LITERAL_PLACEHOLDER_USER_NAME

public static final String LITERAL_PLACEHOLDER_USER_NAME
placeholder for literals: will be replaced with the user name

See Also:
Constant Field Values

LITERAL_PLACEHOLDER_USER_LONG_NAME

public static final String LITERAL_PLACEHOLDER_USER_LONG_NAME
placeholder for literals: will be replaced with the user long name

See Also:
Constant Field Values

LITERAL_PLACEHOLDER_USER_SHORT_NAME

public static final String LITERAL_PLACEHOLDER_USER_SHORT_NAME
placeholder for literals: will be replaced with the user short name

See Also:
Constant Field Values

LITERAL_PLACEHOLDER_USER_DISPLAY_NAME

public static final String LITERAL_PLACEHOLDER_USER_DISPLAY_NAME
placeholder for literals: will be replaced with the user display name

See Also:
Constant Field Values

CONFIGNODE_URLOVERWRITE

public static final String CONFIGNODE_URLOVERWRITE
the XML node name UrlOverwrite

See Also:
Constant Field Values

CONFIGNODE_SERVER

public static final String CONFIGNODE_SERVER
the XML node name Server

See Also:
Constant Field Values

CONFIGNODE_BASE

public static final String CONFIGNODE_BASE
the XML node name Base

See Also:
Constant Field Values

PREFIX_DRAGDROP

public static final String PREFIX_DRAGDROP
prefix for the common DND document import temp directory

See Also:
Constant Field Values

m_clipboard

protected OwClipboard m_clipboard
the one and only clipboard for the session

Constructor Detail

OwMainAppContext

public OwMainAppContext()
Create a new OwMainAppContext. This will create a new OwConfiguration and a new OwClipboard in the background.

Method Detail

createConfiguration

protected OwConfiguration createConfiguration()
Create an instance of the OwConfiguration object. Overwrite this method to change the configuration.

Returns:
An OwConfiguration instance to be used by this OwMainAppContext

createClipboard

protected OwClipboard createClipboard()
Create an instance of the OwClipboard object. Overwrite this method to change the clipboard implementation.

Returns:
An OwClipboard instance to be used by this OwMainAppContext

getCurrentMasterPluginID

public String getCurrentMasterPluginID()
get the current ID to the active master plugin

Returns:
Plugin ID as String

getSafeCurrentMasterPluginStyleClassID

public String getSafeCurrentMasterPluginStyleClassID()
get a ID for the current master plugin that can be used to create a HTML class style ID

Returns:
String ID of plugin or "default" if not plugin is active

getCurrentMasterView

public OwMasterView getCurrentMasterView()
get the current active master plugin view

Returns:
OwMasterView or null if no plugin is active

onActivateMasterPlugin

public void onActivateMasterPlugin(OwMasterView view_p)
                            throws Exception
notify the context about the new activated master plugin in order to generate context sensitive information

Parameters:
view_p - OwMasterView
Throws:
Exception

getDialogManager

public OwDialogManager getDialogManager()
get a reference to the default dialog manager used to open dialogs from the context in openDialog(...) The dialog manager must be created somewhere in the layout and set in the context. If no dialogs are required, you do not need to set it and this function returns null

Specified by:
getDialogManager in class OwAppContext
Returns:
OwDialogManager or null if none is available

getError

public Throwable getError()
get exception to display

Returns:
Throwable object

setError

public void setError(Throwable exception_p)
set exception to display


getMessages

public Collection getMessages()
Get a collection of messages to display

Returns:
Collection

postMessage

public void postMessage(String sMessage_p)
add a message to be displayed for user info

Parameters:
sMessage_p -

init

public void init(OwAppContext oldcontext_p)
          throws Exception
init the context BEFORE the user has logged on. Called once for a session. NOTE: The user is not logged in, when this function is called. If you do not do initialize with valid credentials use LoginInit optionally set a prefix to distinguish several different applications. The rolemanager will filter the allowed plugins, mimesettings and design with the prefix. The default is empty. e.g. used for the Zero-Install Desktop Integration (ZIDI) to display a different set of plugins, MIME table and design for the Zero-Install Desktop Integration (ZIDI)

Overrides:
init in class OwAppContext
Parameters:
oldcontext_p - OwAppContext old context from previous session, used to copy flags, locals. Optional, can be null
Throws:
Exception

initializeUserOperationListeners

protected void initializeUserOperationListeners()
                                         throws Exception
Initialize the listeners for user operations (at the login time)

Throws:
Exception
Since:
3.1.0.3

init

protected void init()
             throws Exception
init the target after the context is set.

Specified by:
init in class OwEventTarget
Throws:
Exception

onLogin

public void onLogin(OwBaseUserInfo user_p)
             throws OwConfigurationException
called when user gets logged in

Specified by:
onLogin in interface OwNetworkContext
Throws:
OwConfigurationException

getLocale

public Locale getLocale()
get the current locale, which can be used as a prefix/postfix to distinguish localization resources

Specified by:
getLocale in interface OwRepositoryContext
Specified by:
getLocale in interface OwMandatorManagerContext
Specified by:
getLocale in interface OwRoleManagerContext
Specified by:
getLocale in class OwAppContext
Returns:
Locale

setLocale

public void setLocale(Locale locale_p)
Specified by:
setLocale in class OwAppContext

isAllowed

public boolean isAllowed(int iCategory_p,
                         String strFunctionName_p)
                  throws Exception
check if function or plugin is available for the user. Checks the user roles.

Parameters:
iCategory_p - Category of the function in question, e.g. "MainPlugin", "TaskFunction", "SearchTemplate"...
strFunctionName_p - Name of Function or Plugin
Returns:
true = function is allowed, false = function is denied
Throws:
Exception

loginInit

public void loginInit()
               throws Exception
init the context AFTER the user has logged in. Called once for a session. NOTE: This function is called only once after login to do special initialization, which can only be performed with valid credentials.

Specified by:
loginInit in class OwAppContext
Throws:
Exception

getNetwork

public OwNetwork getNetwork()
retrieve the network object

Specified by:
getNetwork in interface OwRoleManagerContext
Returns:
OwNetwork or null if not yet defined

getHistoryManager

public OwHistoryManager getHistoryManager()
retrieve the network object

Specified by:
getHistoryManager in interface OwRoleManagerContext
Returns:
OwHistoryManager or null if not yet defined

getRoleManager

public OwRoleManager getRoleManager()
retrieve the RoleManager object


createFieldManager

public OwFieldManager createFieldManager()
                                  throws Exception
create a new instance of the field manager

Throws:
Exception

getConfiguration

public OwConfiguration getConfiguration()
retrieve the Configuration object


getBaseConfiguration

public OwBaseConfiguration getBaseConfiguration()
retrieve the Configuration object

Specified by:
getBaseConfiguration in interface OwHistoryManagerContext
Specified by:
getBaseConfiguration in interface OwRoleManagerContext

getSettings

public OwSettings getSettings()
retrieve the settings object


getCredentials

public OwCredentials getCredentials()
                             throws Exception
get the credentials of the logged in user

Returns:
OwCredentials of the log in user
Throws:
Exception

isLogin

public boolean isLogin()
                throws Exception
check the credentials of the logged in user

Specified by:
isLogin in class OwAppContext
Returns:
true if user is logged in and has valid credentials
Throws:
Exception

isContainerBasedAuthenticated

public boolean isContainerBasedAuthenticated()
                                      throws Exception
check the current user is authenticated container based

Specified by:
isContainerBasedAuthenticated in class OwAppContext
Returns:
true if user is logged in and the login is done with container based authentication
Throws:
Exception

logout

public void logout()
            throws Exception
clear the credentials, i.e. log the user off

Overrides:
logout in class OwAppContext
Throws:
Exception

onSessionTimeOut

public void onSessionTimeOut(javax.servlet.http.HttpSession httpSession_p)
called when the session times out

Parameters:
httpSession_p -

getDesignDir

public String getDesignDir()
                    throws Exception
Description copied from class: OwAppContext
get the directory of the used design. Specifies the subfolder /designs/ where to retrieve the design files. i.e. CSS, images, layouts... This function can be used to make the look & feel dependent on the logged in user.

Specified by:
getDesignDir in class OwAppContext
Returns:
String dir of design directory
Throws:
Exception

getDesignURL

public String getDesignURL()
                    throws Exception
Description copied from class: OwAppContext
get the URL of the used design. Specifies the URL /designs/ where to retrieve the design files. i.e. css, images, layouts... This function can be used to make the look & feel dependent on the logged in user.

Specified by:
getDesignURL in class OwAppContext
Returns:
String URL to the design dir
Throws:
Exception

getLocalEventURL

public String getLocalEventURL(String strLangID_p)
get a event URL to change the language NOTE: This event URL is not checked with request key, so it can be called arbitrary and be stored in the users browser.

Parameters:
strLangID_p - String ID of the language e.g.: "de"
Returns:
String event URL

openHelp

public void openHelp(String sHelppath_p)
              throws Exception
opens a help page in the connected help plugin if available

Parameters:
sHelppath_p - String path to the help page
Throws:
Exception

handleRequest

public boolean handleRequest(javax.servlet.http.HttpServletRequest request_p,
                             javax.servlet.http.HttpServletResponse response_p)
                      throws Exception
handles the m_request from the page and dispatches ONLY to the selected target

Overrides:
handleRequest in class OwAppContext
Parameters:
request_p - HttpServletRequest
response_p - HttpServletResponse
Returns:
boolean true = continue with request and render, false = request is already finished, return to client
Throws:
Exception

addFinalScript

public void addFinalScript(OwScript script_p)
Adds a single run custom java script The script runs upon m_request end, invoked by the onLoad Body tag handler. Scripts run only once and are removed after the m_request. This method also considers the script's priority.

Parameters:
script_p - The new script to be added.
Since:
3.0.0.0

addUniqueFinalScript

public boolean addUniqueFinalScript(OwScript script_p)
Add final script only if the same script was not already added.

Parameters:
script_p - - the OwScript object
Returns:
- true if the script was not added before in scripts list.
Since:
3.1.0.0

addFinalScript

public void addFinalScript(String strScript_p)
Adds a single run custom java script. The script runs upon m_request end, invoked by the onLoad Body tag handler. Scripts run only once and are removed after the m_request. This method also considers the script's priority.

Parameters:
strScript_p - String custom java script code (without tags).

clearFinalScript

public void clearFinalScript()
clear the final script for this request


getFinalScript

public String getFinalScript()
get the current final script to be executed for this request

Returns:
String with JavaScript code

getSessionDisplayName

public String getSessionDisplayName()
get a name for the current session, used for warning and error logs to identify the session later. Do not mix up with session identifier from HTTP session.

Specified by:
getSessionDisplayName in class OwAppContext
Returns:
String name of Session, usually the name of the logged on user

getUserInfo

public OwBaseUserInfo getUserInfo()
get the logged in user

Overrides:
getUserInfo in class OwAppContext
Returns:
OwBaseUserInfo or null if no user is logged in

dump

public void dump(Writer w_p)
          throws Exception
write debug dump to Writer

Overrides:
dump in class OwAppContext
Parameters:
w_p - HTML Writer
Throws:
Exception

getClipboard

public OwClipboard getClipboard()
get the one and only clipboard for the session

Returns:
OwClibboard

getConfigurationName

public String getConfigurationName()
get a name for the configuration to use can be used to distinguish different applications

Specified by:
getConfigurationName in interface OwRepositoryContext
Specified by:
getConfigurationName in interface OwMandatorManagerContext
Specified by:
getConfigurationName in interface OwRoleManagerContext
Returns:
String a name for the configuration, or "default" to use default

localizeLabel

public String localizeLabel(String strName_p)
optionally translate a name into a readable label, used for property class names in ECM adaptors which do not support separate displaynames

Specified by:
localizeLabel in interface OwRepositoryContext
Specified by:
localizeLabel in interface OwMandatorManagerContext
Specified by:
localizeLabel in interface OwRoleManagerContext
Parameters:
strName_p - name e.g. attribute name to look for
Returns:
translated Display name if found in label file or the given attribute name if nothing could be translated.

hasLabel

public boolean hasLabel(String strName_p)
check if a display label is defined for the given symbol name

Specified by:
hasLabel in interface OwRepositoryContext
Specified by:
hasLabel in interface OwMandatorManagerContext
Specified by:
hasLabel in interface OwRoleManagerContext
Parameters:
strName_p - name e.g. attribute name to look for
Returns:
true = displayname is defined for symbol

registerPluginKeyEvent

public void registerPluginKeyEvent(String strPluginID_p,
                                   String strEventURL_p,
                                   String strFormName_p,
                                   String strDescription_p)
                            throws Exception
register a key event for this plugin if defined in key map, call in onRender method only

Parameters:
strPluginID_p - String ID of the plugin to register
strEventURL_p - String event URL of plugin to open
strFormName_p - String optional form name
strDescription_p - String description for key table
Throws:
Exception

getSafeIntAppSetting

public int getSafeIntAppSetting(String strName_p,
                                int iDefault_p)
get a setting for the application

Parameters:
strName_p - name of property to retrieve
iDefault_p - default int value
Returns:
int

getSafeStringAppSetting

public String getSafeStringAppSetting(String strName_p,
                                      String strDefault_p)
get a setting for the application

Parameters:
strName_p - name of property to retrieve
strDefault_p - default String value
Returns:
String

getSafeListAppSetting

public Collection getSafeListAppSetting(String strName_p)
get a setting for the application

Parameters:
strName_p - name of property to retrieve
Returns:
List

getSafeBooleanAppSetting

public boolean getSafeBooleanAppSetting(String strName_p,
                                        boolean default_p)
get a setting for the application

Parameters:
strName_p - name of property to retrieve
default_p - Object if setting is not defined in plugin descriptor
Returns:
Object Settings Property

useJS_DateControl

public boolean useJS_DateControl()
flag indicating if the java script Date control should be used instead of a HTML combobox control

Returns:
boolean true = use java script control, false = use combobox control

getDateFormatString

public String getDateFormatString()
get the format string to use for date values

Returns:
date format String e.g.: "dd.MM.yyyy (HH:mm)"

getTimeFormatString

public String getTimeFormatString()
get the format string to use for time values

Returns:
date format String e.g.: "HH:mm:ss"

getDateFormatStringWithoutTime

public String getDateFormatStringWithoutTime()
get the format string to use for date values do not use time tokens

Returns:
date format String e.g.: "dd.MM.yyyy"

getDateFormatStringWithoutDate

public String getDateFormatStringWithoutDate()
get the format string to use for time values do not use date tokens

Returns:
date format String e.g.: "HH:mm:ss"

getMaxClipboardSize

public int getMaxClipboardSize()
Get maximum number of items that can be hold in the clipboard

Returns:
the number of items that can be hold in the clipboard.
Since:
3.0.0.0

getClipboardAvailableDocFunctionIds

public Collection getClipboardAvailableDocFunctionIds()
Get the document function plugin IDs available in clipboard. These document functions can be executed on clipboard items.

Returns:
Collection - a collection containing plugin IDs.
Since:
3.0.0.0

doShowClipboard

public boolean doShowClipboard()
flag indicating if clipboard should be displayed

Returns:
boolean

doShowWildCardDescriptions

public boolean doShowWildCardDescriptions()
flag indicating if wild card descriptions should be displayed for searches.

Returns:
boolean

isUseHtml5DragAndDrop

public boolean isUseHtml5DragAndDrop()
flag indicating if the application should use the HTML5 implementation of the DnD feature. If false, the DnD Applet will be used instead.

Returns:
boolean
Since:
4.1.1.0

getPageSizeForLists

public int getPageSizeForLists()
number of items in a page for lists which support paging

Returns:
int

getStartupID

public String getStartupID()
get the ID of the startup plugin

Returns:
String ID

getMaxSortCriteriaCount

public int getMaxSortCriteriaCount()
get the maximum number of sort criteria, which can be applied to a list at once

Returns:
int max number of sort criteria

getWindowPositions

public OwWindowPositions getWindowPositions()
get a setting for the application

Returns:
Object Settings Property

getWindowPositionsSaveURL

public String getWindowPositionsSaveURL()
get a event URL to save the viewer and main window position the position values have to be appended as a query string, using the getter / setter names as request parameter names in the following form: "[getter / setter name]" e.g.: for getViewerHeight the Parameter name would be "ViewerHeight"


onSaveWindowPositions

public void onSaveWindowPositions(javax.servlet.http.HttpServletRequest request_p)
                           throws Exception
called when getWindowPositionsSaveURL was invoked see getWindowPositionsSaveURL for details

Throws:
Exception

deleteTempDir

public void deleteTempDir(String strDir_p)
deletes a temp dir and all files within it

Specified by:
deleteTempDir in interface OwRepositoryContext
Specified by:
deleteTempDir in interface OwMandatorManagerContext
Specified by:
deleteTempDir in interface OwRoleManagerContext
Parameters:
strDir_p - String directory

createTempDir

public String createTempDir(String strPrefix_p)
                     throws OwConfigurationException
creates a unique temp directory

Specified by:
createTempDir in interface OwRepositoryContext
Specified by:
createTempDir in interface OwMandatorManagerContext
Specified by:
createTempDir in interface OwRoleManagerContext
Parameters:
strPrefix_p - String prefix to use for name
Returns:
Returns the created tempDir.
Throws:
OwConfigurationException

getDragAndDropUploadDir

public String getDragAndDropUploadDir()
get the path of the current drag and drop upload directory

Returns:
path drag and drop upload directory path, or null if not available

clearDragDropUploadDir

public void clearDragDropUploadDir()
                            throws Exception
delete temporarily drag and drop upload directory

Throws:
Exception

addDNDImportedDocumentToStack

public void addDNDImportedDocumentToStack(OwDocumentImportItem importedDocument_p)
Add an OwDocumentImportItem to the stack of DND imported documents.

Parameters:
importedDocument_p - the new OwDocumentImportItem to add to the stack

getDNDImportedDocument

public OwDocumentImportItem getDNDImportedDocument(int i_p)
Get the i_pth imported document from the DND document import stack.

Parameters:
i_p - the (0-based) index of the imported document to return
Returns:
the i_pth imported document from the DND document import stack

getDNDImportedDocumentsCount

public int getDNDImportedDocumentsCount()
Get the size of the DND document import stack.

Returns:
the size of the DND document import stack

releaseDNDImportedDocuments

public void releaseDNDImportedDocuments()
                                 throws Exception
Release all imported documents of the DND document import stack and remove the current temp dir.

Throws:
Exception

getDNDDocumentImportTempDir

public String getDNDDocumentImportTempDir()
                                   throws OwConfigurationException
Throws:
OwConfigurationException

getNextDNDDocumentImportFileID

public int getNextDNDDocumentImportFileID()

createUserAttributeBag

public OwAttributeBagWriteable createUserAttributeBag(String sName_p)
                                               throws Exception
create a attribute bag for scalar settings specific for the current user. Unlike the OwSettings the AttributeBag allows simple scalar values but with high performance. NOTE: The OwSettings are used for complex settings for the plugins which are manually changed from time to time by the user or the Administrator. ==> Performance is negligible, but values are highly structured. ==> OwSettings are usually based on a XML document. (depends on adapter implementation) The OwAttributeBagWriteable is used by the application itself to persist state. ==> Structure is negligible, but performance is important ==> OwAttributeBagWriteable is usually based on a DB table. (depends on adapter implementation)

Parameters:
sName_p - String name of the attribute bag
Returns:
OwAttributeBagWriteable to read and write scalars
Throws:
Exception

getCurrentUser

public OwBaseUserInfo getCurrentUser()
                              throws Exception
Description copied from interface: OwHistoryManagerContext
get the current user

Specified by:
getCurrentUser in interface OwNetworkContext
Specified by:
getCurrentUser in interface OwHistoryManagerContext
Specified by:
getCurrentUser in interface OwMandatorManagerContext
Specified by:
getCurrentUser in interface OwRoleManagerContext
Returns:
OwUserInfo
Throws:
Exception

getClientID

public String getClientID()
get a ID / name for the calling client

Specified by:
getClientID in interface OwRepositoryContext
Specified by:
getClientID in interface OwMandatorManagerContext
Specified by:
getClientID in interface OwRoleManagerContext
Returns:
String

getDefaultFolderClassName

public String getDefaultFolderClassName()
name of the default class used to create simple folders

Specified by:
getDefaultFolderClassName in interface OwNetworkContext
Returns:
String classname/id of default folder class or null if not defined

getClientWildCard

public String getClientWildCard(int wildcardtype_p)
get a wild card to be used in the client for the given wild card type

Specified by:
getClientWildCard in interface OwRepositoryContext
Parameters:
wildcardtype_p - as defined in OwWildCardDefinition.WILD_CARD_TYPE_...
Returns:
wildcard string or null if not wildcard is defined on the client

getConfigChangeEvent

public OwRepositoryContext.OwConfigChangeEventListener getConfigChangeEvent()
delegates OwConfigChangeEventListener notifications to the subscribed listeners

Returns:
an OwRepositoryContext.OwConfigChangeEventListener

addConfigChangeEventListener

public void addConfigChangeEventListener(OwRepositoryContext.OwConfigChangeEventListener listener_p)
add a config change event listener to be notified about config changes

Specified by:
addConfigChangeEventListener in interface OwRepositoryContext
Parameters:
listener_p -

removeConfigChangeEventListener

public void removeConfigChangeEventListener(OwRepositoryContext.OwConfigChangeEventListener listener_p)
add a config change event listener to be notified about config changes

Parameters:
listener_p -

getMandatorID

public String getMandatorID()
get a ID / name for the calling mandator

Specified by:
getMandatorID in interface OwRepositoryContext
Specified by:
getMandatorID in interface OwRoleManagerContext
Returns:
String mandator or null if no mandator is supported

getMandatorManager

public OwMandatorManager getMandatorManager()
retrieve the MandatorManager reference

Specified by:
getMandatorManager in interface OwRepositoryContext
Specified by:
getMandatorManager in interface OwRoleManagerContext
Returns:
an OwMandatorManager

getMandator

public OwMandator getMandator()
get the mandator interface of the current logged in user

Specified by:
getMandator in interface OwRepositoryContext
Specified by:
getMandator in interface OwRoleManagerContext
Returns:
OwMandator or null if not yet defined

getJDBCTemplate

public org.springframework.jdbc.core.JdbcTemplate getJDBCTemplate()
Description copied from interface: OwRepositoryContext
get a spring JDBC template for the default DataSource

Specified by:
getJDBCTemplate in interface OwRepositoryContext
Specified by:
getJDBCTemplate in interface OwRoleManagerContext
Returns:
the Spring JdbcTemplate

resolveLiteralPlaceholder

public Object resolveLiteralPlaceholder(String contextname_p,
                                        String placeholdername_p)
                                 throws Exception
Description copied from interface: OwNetworkContext
resolve the given literal placeholder name to a property / criteria value

Specified by:
resolveLiteralPlaceholder in interface OwNetworkContext
Parameters:
contextname_p - String name of calling context, e.g. searchtemplate name
placeholdername_p - String name of placeholder to retrieve value for
Returns:
an Object
Throws:
Exception

getAppContextResource

protected URL getAppContextResource(String resourcePath_p)
(overridable) Retrieves a resource for this application context.

Specified by:
getAppContextResource in class OwAppContext
Parameters:
resourcePath_p - the classpath sub-path to retrieve
Returns:
the URL of the requested resource relative to this class classpath
Since:
2.5.2

createComboboxRenderer

public OwComboboxRenderer createComboboxRenderer(OwComboModel model_p,
                                                 String strID_p,
                                                 OwFieldDefinition fieldDefinition_p,
                                                 OwFieldProvider fieldProvider_p,
                                                 OwString description_p)
Creates a renderer component for comboboxes.

Parameters:
model_p - - the OwComboModel object
strID_p - - the HTML id of this combo.
fieldDefinition_p - - the OwFieldDefinition object
fieldProvider_p - - the OwFieldProvider object
description_p - - the OwString description of the field . If null the description of the field definition will be used.
Returns:
a OwComboboxRenderer object.
Since:
3.0.0.0

addAjaxUpdateContainer

public void addAjaxUpdateContainer(String containerId_p,
                                   String ajaxEventHandler_p)
Add a pair of HTML container ID and the AJAX handler for it.

Parameters:
containerId_p - - the HTML container id
ajaxEventHandler_p - - the AJAX handler
Since:
3.1.0.0

getAjaxUpdateURL

public String getAjaxUpdateURL(String containerId_p)
Get the AJAX handler, or null for the given HTML container ID.

Parameters:
containerId_p - - the HTML container id
Returns:
the AJAX handler, or null for the given HTML container ID.
Since:
3.1.0.0

getInfoProviderRegistry

public OwInfoProviderRegistry getInfoProviderRegistry()
Description copied from class: OwAppContext
Get a info provider registry which is used to request information provider for special context.

Specified by:
getInfoProviderRegistry in class OwAppContext
Returns:
OwInfoProviderRegistry

resetMessages

public void resetMessages()
Reset messages collection.

Since:
3.1.0.0

addUserOperationListener

public void addUserOperationListener(OwUserOperationListener listener_p)
Description copied from interface: OwUserOperationExecutor
Adds a user operation listener to this executor.

Specified by:
addUserOperationListener in interface OwUserOperationExecutor
Parameters:
listener_p - - the listener to be added.

removeUserOperationListener

public void removeUserOperationListener(OwUserOperationListener listener_p)
Description copied from interface: OwUserOperationExecutor
Removes the given user operation listener from this executor.

Specified by:
removeUserOperationListener in interface OwUserOperationExecutor

createComboboxRenderer

public OwComboboxRenderer createComboboxRenderer()
Description copied from interface: OwComboboxRendererFactory
Return a new instance of a combobox renderer, will read configuration settings and create the corresponding instance.

Specified by:
createComboboxRenderer in interface OwComboboxRendererFactory
Returns:
OwComboboxRenderer specific to the configuration

getSessionCookieNames

public List getSessionCookieNames()
get the list of the session cookie names as configured in owbootstrap.xml (<SessionCookieNames>)

Returns:
List
Since:
3.2.0.2

getSessionCookieData

public String getSessionCookieData(javax.servlet.http.HttpServletRequest httpServletRequest)
get session cookie name value pairs delimited by whitespace

Returns:
String
Since:
3.2.0.2

createServerUrl

protected String createServerUrl(javax.servlet.http.HttpServletRequest req_p)
Description copied from class: OwAppContext
(overridable) Called to create the server URL for current request.

Overrides:
createServerUrl in class OwAppContext
Parameters:
req_p - HttpRequest
Returns:
String representing server URL

createBaseUrl

protected String createBaseUrl(javax.servlet.http.HttpServletRequest req_p)
Description copied from class: OwAppContext
(overridable) Create base URL which will be used to process the request.

Overrides:
createBaseUrl in class OwAppContext
Parameters:
req_p - HttpServletRequest
Returns:
String

getConfigPath

public String getConfigPath()
Description copied from interface: OwMandatorManagerContext
get the path to the configuration files

Specified by:
getConfigPath in interface OwMandatorManagerContext
Returns:
String fully qualified path


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.