|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wewebu.ow.server.ui.OwEventTarget
com.wewebu.ow.server.app.OwSettingsPropertyControl
com.wewebu.ow.server.settingsimpl.OwSettingsPropertyBaseImpl
public abstract class OwSettingsPropertyBaseImpl
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
Field Summary | |
---|---|
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 OwEventTarget |
m_externalFormEventTarget
external form view overrides internal form |
protected boolean |
m_fList
true = value is list of values |
protected Node |
m_propertyDefinitionNode
the defining node from the plugin descriptors setting set |
protected String |
m_strError
a error message for this field, if update failed |
protected String |
m_strSetName
set name |
protected Object |
m_value
current value of property |
Fields inherited from interface com.wewebu.ow.server.app.OwSettingsProperty |
---|
ITEM_VALUE_NODE |
Constructor Summary | |
---|---|
OwSettingsPropertyBaseImpl()
|
Method Summary | |
---|---|
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 |
String |
getDisplayName()
get display name of property |
String |
getFormName()
get the form used for the edit fields |
OwEventTarget |
getFormTarget()
get the target, that is used for form data and renders form |
String |
getHelpPath()
get optional help path for the control |
protected int |
getMaxListSize()
get the maximum count of list items allowed |
String |
getName()
get ID of property |
protected Node |
getPropertyDefinitionNode()
get a reference to the property definition node |
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 |
protected void |
init()
init the target after the context is set. |
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 |
isEditable()
get flag indicating if property can be edited |
boolean |
isList()
get flag indicating list or scalar value |
boolean |
isModified()
true = value was modified, false otherwise |
boolean |
isUser()
get flag indicating the scope of the property |
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 |
setExternalFormTarget(OwEventTarget eventtarget_p)
override the internal form with an external one, must be called BEFORE event target is attached. |
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. |
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 |
---|
protected Node m_propertyDefinitionNode
protected Object m_defaultValue
protected String m_strSetName
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
protected OwEventTarget m_externalFormEventTarget
Constructor Detail |
---|
public OwSettingsPropertyBaseImpl()
Method Detail |
---|
protected void init() throws Exception
init
in class OwEventTarget
Exception
public String getHelpPath()
getHelpPath
in class OwSettingsPropertyControl
public Object getValue()
protected Object createSingleClonedValue(Object oSingleValue_p)
createSingleClonedValue
in class OwSettingsPropertyControl
oSingleValue_p
- single Object value
public 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 save
Exception
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 value
Exception
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 to
Exception
protected void writeAddNewItemButton(Writer w_p) throws Exception
w_p
- - the Writer
object
Exception
protected void writeDeleteButton(Writer w_p, int position_p) throws Exception
w_p
- - the Writer
objectposition_p
- - the position index
Exception
public void onDelete(javax.servlet.http.HttpServletRequest request_p) throws Exception
request_p
- HttpServletRequest
Exception
protected boolean canAdd()
public void onAdd(javax.servlet.http.HttpServletRequest request_p) throws Exception
request_p
- HttpServletRequest
Exception
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 list
Exception
protected Node getPropertyDefinitionNode()
public void setDefault()
public Node getValueNode(Document doc_p)
doc_p
- DOM Document to add to
protected void appendSingleValueNode(Node valueRootNode_p, Object value_p)
valueRootNode_p
- root Node of the propertyvalue_p
- Object to append as DOM Nodepublic boolean isUser()
public boolean isEditable()
public String getDisplayName()
getDisplayName
in class OwSettingsPropertyControl
public String getName()
public String getFormName()
getFormName
in class OwEventTarget
protected 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_p
public void setExternalFormTarget(OwEventTarget eventtarget_p) throws Exception
setExternalFormTarget
in class OwEventTarget
eventtarget_p
- OwEventTarget to be used for form data
Exception
public OwEventTarget getFormTarget()
getFormTarget
in class OwEventTarget
protected int getMaxListSize()
public void init(Node propertyDefinitionNode_p, Node valueNode_p, String strSetName_p) throws Exception
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 created
Exception
protected Object getSingleValue(Node valueNode_p)
protected Object createValue(Node valueNode_p)
protected List createValueList(Node valueNode_p)
valueNode_p
- Node with child value nodes
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |