com.wewebu.ow.server.app
Class OwFunction

java.lang.Object
  extended by com.wewebu.ow.server.app.OwFunction
All Implemented Interfaces:
OwPlugin
Direct Known Subclasses:
OwDocumentFunction, OwRecordFunction

public abstract class OwFunction
extends Object
implements OwPlugin

Base class for all function 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
static String DESCRIPTION_KEY_CLASSES
          key for the classes types node in the plugin description
static String DESCRIPTION_KEY_OBJ_TYPES
          key for the object types node in the plugin description
static String DESCRIPTION_KEY_TYPE
          key for a object type node in the plugin description
static String DRAG_DROP_PROPERTY_MAX_FILESIZE
          drag and drop property,see getDragDropProperties()
protected  OwMainAppContext m_MainContext
          reference to the cast AppContext
 
Constructor Summary
OwFunction()
           
 
Method Summary
 String getBigIcon()
          get the big (24x24 pixels) icon URL for this plugin to be displayed
 OwXMLUtil getConfigNode()
          get the reference to the plugin description node
protected  OwMainAppContext getContext()
          get a reference to the app context
 boolean getContextMenu()
          check if plugin should be displayed in context menu
 Properties getDragDropProperties()
          get the properties for drag and drop like allowed file size and file count or file type...
protected  OwEventManager getEventManager()
          get a reference to the event manager to write history events
 String getHelpPath()
          get the help path to the plugin
 String getIcon()
          get the small (16x16 pixels) icon URL for this plugin to be displayed
 String getName()
          get the name of the function plugin
 boolean getNoEvent()
          check if the plugin handles events with functioncalls, or if it is just used to display an icon.
 String getPluginID()
          get the plugin ID
 String getPluginTitle()
          get a localized display name
 String getPluginTypeDisplayName()
          get a display name for the plugin type
 Object getSafeSetting(String strName_p, Object default_p)
          get a setting for the plugin
protected  Set getSupportedObjectClassesFromDescriptor(String strKey_p)
          utility function to retrieve a set of object class names from a descriptor definition with the given key
protected  Set getSupportedObjectTypesFromDescriptor(String strKey_p)
          utility function to retrieve a set of object types from a descriptor definition with the given key The object types can either be the numbers as defined in OwObjectReference or you can use the field names directly, which will then be converted to the integer numbers.
 String getTooltip()
          Get the tooltip text
 void init(OwXMLUtil node_p, OwMainAppContext context_p)
          set the plugin description node
 boolean isDragDropTarget()
          check if plugin acts as a drag and drop target
 boolean isObjectClassSupported(String strClassName_p)
          check if the object class is supported by the plugin, used to filter out plugins NOTE: Only used to preselect plugins, you will still have to call isEnabled, to find out exactly if plugin supports a specific object
 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
 
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.app.OwPlugin
getPluginType
 

Field Detail

DRAG_DROP_PROPERTY_MAX_FILESIZE

public static final String DRAG_DROP_PROPERTY_MAX_FILESIZE
drag and drop property,see getDragDropProperties()

See Also:
Constant Field Values

DESCRIPTION_KEY_OBJ_TYPES

public static final String DESCRIPTION_KEY_OBJ_TYPES
key for the object types node in the plugin description

See Also:
Constant Field Values

DESCRIPTION_KEY_CLASSES

public static final String DESCRIPTION_KEY_CLASSES
key for the classes types node in the plugin description

See Also:
Constant Field Values

m_MainContext

protected OwMainAppContext m_MainContext
reference to the cast AppContext


DESCRIPTION_KEY_TYPE

public static final String DESCRIPTION_KEY_TYPE
key for a object type node in the plugin description

See Also:
Constant Field Values
Constructor Detail

OwFunction

public OwFunction()
Method Detail

init

public void init(OwXMLUtil node_p,
                 OwMainAppContext context_p)
          throws Exception
set the plugin description node

Parameters:
node_p - OwXMLUtil wrapped DOM Node containing the plugin description
context_p - OwMainAppContext
Throws:
Exception

getIcon

public String getIcon()
               throws Exception
get the small (16x16 pixels) icon URL for this plugin to be displayed

Specified by:
getIcon in interface OwPlugin
Returns:
String icon URL
Throws:
Exception

getBigIcon

public String getBigIcon()
                  throws Exception
get the big (24x24 pixels) icon URL for this plugin to be displayed

Returns:
String icon URL
Throws:
Exception

isObjectClassSupported

public boolean isObjectClassSupported(String strClassName_p)
check if the object class is supported by the plugin, used to filter out plugins NOTE: Only used to preselect plugins, you will still have to call isEnabled, to find out exactly if plugin supports a specific object

Parameters:
strClassName_p - OwObject class name
Returns:
true = object class is supported, false otherwise

getHelpPath

public String getHelpPath()
get the help path to the plugin


getName

public String getName()
get the name of the function plugin


getNoEvent

public boolean getNoEvent()
check if the plugin handles events with functioncalls, or if it is just used to display an icon. The default is false, i.e. plugin handles events.

Returns:
boolean false = handles events, true = does not handle events

isDragDropTarget

public boolean isDragDropTarget()
check if plugin acts as a drag and drop target

Returns:
true = plugin is drag and drop target and can retrieve uploaded files via OwMainAppContext.getDragAndDropUploadDir, false otherwise

getDragDropProperties

public Properties getDragDropProperties()
get the properties for drag and drop like allowed file size and file count or file type...

Returns:
Properties map of properties as defined with DRAG_DROP_PROPERTY_..., or null if not properties are defined

getContextMenu

public boolean getContextMenu()
check if plugin should be displayed in context menu


getConfigNode

public OwXMLUtil getConfigNode()
get the reference to the plugin description node

Specified by:
getConfigNode in interface OwPlugin
Returns:
OwXMLUtil wrapped DOM node

getPluginTitle

public String getPluginTitle()
get a localized display name

Specified by:
getPluginTitle in interface OwPlugin
Returns:
String

getPluginID

public String getPluginID()
get the plugin ID

Specified by:
getPluginID in interface OwPlugin
Returns:
String

getPluginTypeDisplayName

public String getPluginTypeDisplayName()
get a display name for the plugin type

Specified by:
getPluginTypeDisplayName in interface OwPlugin
Returns:
String

getContext

protected OwMainAppContext getContext()
get a reference to the app context

Returns:
OwMainAppContext

getSafeSetting

public Object getSafeSetting(String strName_p,
                             Object default_p)
get a setting 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

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

getEventManager

protected OwEventManager getEventManager()
get a reference to the event manager to write history events


getSupportedObjectTypesFromDescriptor

protected Set getSupportedObjectTypesFromDescriptor(String strKey_p)
                                             throws OwConfigurationException
utility function to retrieve a set of object types from a descriptor definition with the given key The object types can either be the numbers as defined in OwObjectReference or you can use the field names directly, which will then be converted to the integer numbers.

Parameters:
strKey_p - String XML node name for list
Returns:
Set of Integer with object types, or null if none is defined
Throws:
OwConfigurationException

getSupportedObjectClassesFromDescriptor

protected Set getSupportedObjectClassesFromDescriptor(String strKey_p)
                                               throws OwConfigurationException
utility function to retrieve a set of object class names from a descriptor definition with the given key

Parameters:
strKey_p - String XML node name for list
Returns:
Set of String with object class names, or null if none is defined
Throws:
OwConfigurationException

getTooltip

public String getTooltip()
                  throws Exception
Get the tooltip text

Returns:
tooltip code to be inserted for the document function plugin.
Throws:
Exception
Since:
3.0.0.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.