public abstract class OwSettingsPropertyBaseImpl extends OwAbstractSettingsPropertyControl
Base Implementation of the OwSettingsProperty class.
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
Modifier and Type | Field and Description |
---|---|
protected static String |
ITEM_PREFIX
ID prefix for list values
|
protected static String |
ITEM_QUERY_KEY
query key for the item parameter for the delete event
|
protected Object |
m_defaultValue
default value of property
|
protected boolean |
m_fList
true = value is list of values
|
protected String |
m_strError
a error message for this field, if update failed
|
protected Object |
m_value
current value of property
|
m_externalFormEventTarget, m_propertyDefinitionNode, m_strSetName
ITEM_VALUE_NODE
Constructor and Description |
---|
OwSettingsPropertyBaseImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendSingleValueNode(Node valueRootNode_p,
Object value_p)
overridable, return the given value as a DOM Node for serialization
|
protected boolean |
canAdd()
check if additional items can be added to the list value
|
protected Object |
createSingleClonedValue(Object oSingleValue_p)
create a clone out of the given single property value
|
protected Object |
createValue(Node valueNode_p)
to create a single value for the given definition node
NOTE: Reads the value from the ITEM_VALUE_NODE node.
|
protected List |
createValueList(Node valueNode_p)
create a list of values, if property is a list
|
protected String |
extractIDIndex(String strID_p,
String indexSeparator_p,
int indexElement_p) |
protected Object |
getDefaultListItemValue()
overridable to create a default value for list properties
|
protected int |
getMaxListSize()
get the maximum count of list items allowed
|
String |
getPropertyError()
Gets a error message for this field
|
String |
getSafePropertyError()
gets a error message for this field, if update failed, clears the message automatically
|
protected Object |
getSingleValue(Node valueNode_p)
overridable to create a single value for the given node
|
protected Object |
getSingleValueFromRequest(javax.servlet.http.HttpServletRequest request_p,
String strID_p)
overridable to apply changes on a submitted form
|
Object |
getValue()
get current value of property
|
Node |
getValueNode(Document doc_p)
return the property value as a DOM Node for serialization
|
boolean |
hasError()
Check if this property has an error associated, without clear the error message
|
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
|
void |
insertLabel(Writer w_p) |
protected void |
insertLabelValue(Writer w_p,
String displayName,
String strID_p,
int iIndex_p) |
boolean |
isList()
get flag indicating list or scalar value
|
boolean |
isModified()
true = value was modified, false otherwise
|
void |
onAdd(javax.servlet.http.HttpServletRequest request_p)
called when user clicked the add item button for a list property
|
void |
onDelete(javax.servlet.http.HttpServletRequest request_p)
called when user clicked a delete button on a list entry
|
void |
saved()
signal that value was saved and modified flag can be reset
|
void |
setDefault()
set the default value
|
void |
setValue(Object value_p)
set current value of property, to be overridden
|
String |
toString() |
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
|
protected void |
writeAddNewItemButton(Writer w_p)
Render the add new item button.
|
protected void |
writeDeleteButton(Writer w_p,
int position_p)
Render the delete button.
|
getDisplayName, getFormName, getFormTarget, getHelpPath, getName, getPropertyDefinitionNode, init, isEditable, isUser, setExternalFormTarget
attach, detach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onFormEvent, onRequest
protected Object m_defaultValue
protected static final String ITEM_QUERY_KEY
protected static final String ITEM_PREFIX
protected boolean m_fList
protected Object m_value
protected String m_strError
public Object getValue()
protected Object createSingleClonedValue(Object oSingleValue_p)
createSingleClonedValue
in class OwSettingsPropertyControl
oSingleValue_p
- single Object valuepublic boolean isModified()
isModified
in class OwSettingsPropertyControl
public void saved()
protected Object getDefaultListItemValue() throws Exception
Exception
public boolean isList()
public void setValue(Object value_p)
value_p
- Objectpublic boolean updateExternalFormTarget(javax.servlet.http.HttpServletRequest request_p, boolean fSave_p) throws Exception
updateExternalFormTarget
in class OwEventTarget
request_p
- HttpServletRequestfSave_p
- boolean true = save the changes of the form data, false = just update the form data, but do not saveException
protected Object getSingleValueFromRequest(javax.servlet.http.HttpServletRequest request_p, String strID_p) throws Exception
request_p
- HttpServletRequest with form data to update the propertystrID_p
- String the HTML form element ID of the requested valueException
public String getSafePropertyError()
getSafePropertyError
in class OwSettingsPropertyControl
public boolean hasError()
OwSettingsPropertyControl
hasError
in class OwSettingsPropertyControl
OwSettingsPropertyControl.hasError()
public String getPropertyError()
OwSettingsPropertyControl
getPropertyError
in class OwSettingsPropertyControl
OwSettingsPropertyControl.getPropertyError()
public void insertFormField(Writer w_p) throws Exception
insertFormField
in class OwSettingsPropertyControl
w_p
- Writer to write HTML code toException
protected void writeAddNewItemButton(Writer w_p) throws Exception
protected void writeDeleteButton(Writer w_p, int position_p) throws Exception
public void onDelete(javax.servlet.http.HttpServletRequest request_p) throws Exception
request_p
- HttpServletRequestException
protected boolean canAdd()
public void onAdd(javax.servlet.http.HttpServletRequest request_p) throws Exception
request_p
- HttpServletRequestException
protected void insertFormValue(Writer w_p, Object value_p, String strID_p, int iIndex_p) throws Exception
w_p
- Writer to write HTML code tovalue_p
- the property value to editstrID_p
- String the ID of the HTML element for use in onApplyiIndex_p
- int Index of item if it is a listException
public void setDefault()
public Node getValueNode(Document doc_p)
doc_p
- DOM Document to add toprotected void appendSingleValueNode(Node valueRootNode_p, Object value_p)
valueRootNode_p
- root Node of the propertyvalue_p
- Object to append as DOM Nodeprotected String extractIDIndex(String strID_p, String indexSeparator_p, int indexElement_p)
strID_p
- a field control ID StringindexSeparator_p
- numeric index separator of the strID_pindexElement_p
- the index of the string index after strID_p split around indexElement_pprotected int getMaxListSize()
public void init(Node propertyDefinitionNode_p, Node valueNode_p, String strSetName_p) throws Exception
init
in interface OwSettingsProperty
init
in class OwAbstractSettingsPropertyControl
propertyDefinitionNode_p
- the node which defines the property in the plugin descriptors settingvalueNode_p
- the node with the current valuestrSetName_p
- name of the property set for which the property is createdException
protected Object getSingleValue(Node valueNode_p)
protected Object createValue(Node valueNode_p)
protected List createValueList(Node valueNode_p)
valueNode_p
- Node with child value nodespublic String toString()
toString
in class OwAbstractSettingsPropertyControl
public void insertLabel(Writer w_p) throws Exception
insertLabel
in class OwSettingsPropertyControl
Exception
protected void insertLabelValue(Writer w_p, String displayName, String strID_p, int iIndex_p) throws IOException
IOException
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.