com.wewebu.ow.server.app
Class OwMasterDocument

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.ui.OwDocument
          extended by com.wewebu.ow.server.app.OwMasterDocument
All Implemented Interfaces:
OwAttributeBag, OwAttributeBagWriteable

public class OwMasterDocument
extends OwDocument

Document Module base class for the Main Area Plugins.

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


Field Summary
 
Fields inherited from class com.wewebu.ow.server.ui.OwDocument
m_ViewList
 
Constructor Summary
OwMasterDocument()
           
 
Method Summary
 Object dispatch(int iCode_p, Object param1_p, Object param2_p)
          dispatch an event to the master plugin by calling onDispatch in the master document
 OwXMLUtil getConfigNode()
          get the plugin description node
 OwConfiguration getConfiguration()
          get the configuration object
 OwMasterView getMasterView()
          get the corresponding masterview
 OwAttributeBagWriteable getPersistentAttributeBagWriteable()
          get the plugin scalar settings specific for the current user.
 OwConfiguration.OwMasterPluginInstance getPlugin()
          set the plugin instance
 String getPluginID()
          get the plugin ID
 Object getSafeSetting(String strName_p, Object default_p)
          get a settings value for the plugin
protected  void init()
          init the target after the context is set.
protected  Object onDispatch(int iCode_p, Object param1_p, Object param2_p)
          This function can be overloaded to dispatch generic calls from other plugins this is a generic function, used for communication of plugins, which do not know about the interfaces of each other.
 void setPlugin(OwConfiguration.OwMasterPluginInstance plugin_p)
          set the plugin instance
 void setSafeSetting(String strName_p, Object value_p)
          set a settings value for the plugin NOTE: You must call OwMainAppContext.saveUserPrefs(); to serialize the new value This function serializes against the XML Preferences and takes a lot of runtime.
 
Methods inherited from class com.wewebu.ow.server.ui.OwDocument
attachView, attributecount, clear, detachView, getAttribute, getAttribute, getAttributeNames, getSafeAttribute, hasAttribute, remove, save, setAttribute, update
 
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
 

Constructor Detail

OwMasterDocument

public OwMasterDocument()
Method Detail

init

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

Overrides:
init in class OwDocument
Throws:
Exception

setPlugin

public void setPlugin(OwConfiguration.OwMasterPluginInstance plugin_p)
set the plugin instance

Parameters:
plugin_p - OwPlugin

getPlugin

public OwConfiguration.OwMasterPluginInstance getPlugin()
set the plugin instance


getPluginID

public String getPluginID()
get the plugin ID


getConfigNode

public OwXMLUtil getConfigNode()
get the plugin description node

Returns:
WcmXMLUtil DOM Node containing the plugin description

getConfiguration

public OwConfiguration getConfiguration()
get the configuration object

Returns:
OwConfiguration

getSafeSetting

public Object getSafeSetting(String strName_p,
                             Object default_p)
get a settings value for the plugin

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

setSafeSetting

public void setSafeSetting(String strName_p,
                           Object value_p)
                    throws Exception
set a settings value for the plugin NOTE: You must call OwMainAppContext.saveUserPrefs(); to serialize the new value This function serializes against the XML Preferences and takes a lot of runtime. ==> If possible rather use ...getConfiguration().getUserAttributeBag() to serialize application state.

Parameters:
strName_p - name of property to retrieve
value_p - Object to set
Throws:
Exception

getPersistentAttributeBagWriteable

public OwAttributeBagWriteable getPersistentAttributeBagWriteable()
                                                           throws Exception
get the plugin 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)

Overrides:
getPersistentAttributeBagWriteable in class OwDocument
Returns:
OwAttributeBagWriteable to read and write scalars
Throws:
Exception

onDispatch

protected Object onDispatch(int iCode_p,
                            Object param1_p,
                            Object param2_p)
                     throws Exception
This function can be overloaded to dispatch generic calls from other plugins this is a generic function, used for communication of plugins, which do not know about the interfaces of each other.

Parameters:
iCode_p - enumerator designating the requested action
param1_p - Placeholder for optional parameter
param2_p - Placeholder for optional parameter
Returns:
Object depending on derived implementation
Throws:
Exception

dispatch

public Object dispatch(int iCode_p,
                       Object param1_p,
                       Object param2_p)
                throws Exception
dispatch an event to the master plugin by calling onDispatch in the master document

Parameters:
iCode_p - enumerator designating the requested action
param1_p - Placeholder for optional parameter
param2_p - Placeholder for optional parameter
Returns:
Object depending on derived implementation
Throws:
Exception

getMasterView

public OwMasterView getMasterView()
get the corresponding masterview

Returns:
OwMasterView


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.