com.wewebu.ow.server.settingsimpl
Class OwSettingsPropertySort

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.app.OwSettingsPropertyControl
          extended by com.wewebu.ow.server.settingsimpl.OwSettingsPropertyBaseImpl
              extended by com.wewebu.ow.server.settingsimpl.OwSettingsPropertySort
All Implemented Interfaces:
OwSettingsProperty

public class OwSettingsPropertySort
extends OwSettingsPropertyBaseImpl

A single settings Sort property that can be configured to sort the columns.

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

Since:
2.5.2.0

Field Summary
static boolean ASC_SORT_ORDER_FLAG
          default sort order
protected static String COLUMN_INFO_NODE_NAME
          node name in the setting set
protected static String COMBO_SELECT_ITEM_DISPLAY_ATTR_NAME
          attribute name of a combo select item display name for list properties
protected static String COMBO_SELECT_ITEM_NODE_NAME
          node name of a combo select item for list properties
protected static String SORT_ATTRIBUTE_NAME
          attribute name of the property sort order
protected static String SORT_PREFIX
          ID prefix for sort list values
 
Fields inherited from class com.wewebu.ow.server.settingsimpl.OwSettingsPropertyBaseImpl
ITEM_PREFIX, ITEM_QUERY_KEY, m_defaultValue, m_externalFormEventTarget, m_fList, m_propertyDefinitionNode, m_strError, m_strSetName, m_value
 
Fields inherited from interface com.wewebu.ow.server.app.OwSettingsProperty
ITEM_VALUE_NODE
 
Constructor Summary
OwSettingsPropertySort()
           
 
Method Summary
protected  boolean canAdd()
          check if additional items can be added to the list value
protected  List createComboSelectList(OwSettingsProperty property_p)
          create a list of values, if property is a list
protected  Object createSingleClonedValue(Object oSingleValue_p)
          create a clone out of the given single property value
protected  List createValueList(Node valueNode_p)
          create a list of values, if property is a list
protected  Object getDefaultListItemValue()
          overridable to create a default value for list properties
 Node getValueNode(Document doc_p)
          return the property value as a DOM Node for serialization
 void init(Node propertyDefinitionNode_p, Node valueNode_p, String strSetName_p)
          set current value of property, to be overridden
 void insertFormField(Writer w_p)
          insert the property into a HTML form for editing
protected  void insertFormValue(Writer w_p, Object value_p, String strID_p, int iIndex_p)
          overridable to insert a single value into a edit HTML form
 boolean isList()
          get flag indicating list or scalar value
 void onAdd(javax.servlet.http.HttpServletRequest request_p)
          called when user clicked the add item button for a list property
 boolean updateExternalFormTarget(javax.servlet.http.HttpServletRequest request_p, boolean fSave_p)
          update the target after a form event, so it can set its form fields
 
Methods inherited from class com.wewebu.ow.server.settingsimpl.OwSettingsPropertyBaseImpl
appendSingleValueNode, createValue, extractIDIndex, getDisplayName, getFormName, getFormTarget, getHelpPath, getMaxListSize, getName, getPropertyDefinitionNode, getPropertyError, getSafePropertyError, getSingleValue, getSingleValueFromRequest, getValue, hasError, init, isEditable, isModified, isUser, onDelete, saved, setDefault, setExternalFormTarget, setValue, toString, writeAddNewItemButton, writeDeleteButton
 
Methods inherited from class com.wewebu.ow.server.ui.OwEventTarget
attach, detach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onFormEvent, onRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMBO_SELECT_ITEM_DISPLAY_ATTR_NAME

protected static final String COMBO_SELECT_ITEM_DISPLAY_ATTR_NAME
attribute name of a combo select item display name for list properties

See Also:
Constant Field Values

COMBO_SELECT_ITEM_NODE_NAME

protected static final String COMBO_SELECT_ITEM_NODE_NAME
node name of a combo select item for list properties

See Also:
Constant Field Values

COLUMN_INFO_NODE_NAME

protected static final String COLUMN_INFO_NODE_NAME
node name in the setting set

See Also:
Constant Field Values

SORT_PREFIX

protected static final String SORT_PREFIX
ID prefix for sort list values

See Also:
Constant Field Values

SORT_ATTRIBUTE_NAME

protected static final String SORT_ATTRIBUTE_NAME
attribute name of the property sort order

See Also:
Constant Field Values

ASC_SORT_ORDER_FLAG

public static final boolean ASC_SORT_ORDER_FLAG
default sort order

See Also:
Constant Field Values
Constructor Detail

OwSettingsPropertySort

public OwSettingsPropertySort()
Method Detail

init

public void init(Node propertyDefinitionNode_p,
                 Node valueNode_p,
                 String strSetName_p)
          throws Exception
Description copied from class: OwSettingsPropertyBaseImpl
set current value of property, to be overridden

Specified by:
init in interface OwSettingsProperty
Overrides:
init in class OwSettingsPropertyBaseImpl
Parameters:
propertyDefinitionNode_p - the node which defines the property in the plugin descriptors setting
valueNode_p - the node with the current value
strSetName_p - name of the property set for which the property is created
Throws:
Exception

createValueList

protected List createValueList(Node valueNode_p)
Description copied from class: OwSettingsPropertyBaseImpl
create a list of values, if property is a list

Overrides:
createValueList in class OwSettingsPropertyBaseImpl
Parameters:
valueNode_p - Node with child value nodes
Returns:
List of Objects representing values

onAdd

public void onAdd(javax.servlet.http.HttpServletRequest request_p)
           throws Exception
Description copied from class: OwSettingsPropertyBaseImpl
called when user clicked the add item button for a list property

Overrides:
onAdd in class OwSettingsPropertyBaseImpl
Parameters:
request_p - HttpServletRequest
Throws:
Exception

canAdd

protected boolean canAdd()
Description copied from class: OwSettingsPropertyBaseImpl
check if additional items can be added to the list value

Overrides:
canAdd in class OwSettingsPropertyBaseImpl

createSingleClonedValue

protected Object createSingleClonedValue(Object oSingleValue_p)
Description copied from class: OwSettingsPropertyBaseImpl
create a clone out of the given single property value

Overrides:
createSingleClonedValue in class OwSettingsPropertyBaseImpl
Parameters:
oSingleValue_p - single Object value
Returns:
Object

isList

public boolean isList()
Description copied from class: OwSettingsPropertyBaseImpl
get flag indicating list or scalar value

Overrides:
isList in class OwSettingsPropertyBaseImpl
Returns:
boolean true = list value, otherwise scalar

updateExternalFormTarget

public boolean updateExternalFormTarget(javax.servlet.http.HttpServletRequest request_p,
                                        boolean fSave_p)
                                 throws Exception
Description copied from class: OwSettingsPropertyBaseImpl
update the target after a form event, so it can set its form fields

Overrides:
updateExternalFormTarget in class OwSettingsPropertyBaseImpl
Parameters:
request_p - HttpServletRequest
fSave_p - boolean true = save the changes of the form data, false = just update the form data, but do not save
Returns:
true = field data was valid, false = field data was invalid
Throws:
Exception

insertFormField

public void insertFormField(Writer w_p)
                     throws Exception
Description copied from class: OwSettingsPropertyBaseImpl
insert the property into a HTML form for editing

Overrides:
insertFormField in class OwSettingsPropertyBaseImpl
Parameters:
w_p - Writer to write HTML code to
Throws:
Exception

insertFormValue

protected void insertFormValue(Writer w_p,
                               Object value_p,
                               String strID_p,
                               int iIndex_p)
                        throws Exception
Description copied from class: OwSettingsPropertyBaseImpl
overridable to insert a single value into a edit HTML form

Overrides:
insertFormValue in class OwSettingsPropertyBaseImpl
Parameters:
w_p - Writer to write HTML code to
value_p - the property value to edit
strID_p - String the ID of the HTML element for use in onApply
iIndex_p - int Index of item if it is a list
Throws:
Exception

getValueNode

public Node getValueNode(Document doc_p)
Description copied from class: OwSettingsPropertyBaseImpl
return the property value as a DOM Node for serialization

Specified by:
getValueNode in interface OwSettingsProperty
Overrides:
getValueNode in class OwSettingsPropertyBaseImpl
Parameters:
doc_p - DOM Document to add to
Returns:
Node

createComboSelectList

protected List createComboSelectList(OwSettingsProperty property_p)
                              throws Exception
create a list of values, if property is a list

Parameters:
property_p - Node with child value nodes
Returns:
List of Objects representing values
Throws:
Exception

getDefaultListItemValue

protected Object getDefaultListItemValue()
                                  throws Exception
Description copied from class: OwSettingsPropertyBaseImpl
overridable to create a default value for list properties

Overrides:
getDefaultListItemValue in class OwSettingsPropertyBaseImpl
Returns:
Object with default value for a new list item
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.