public class OwObjectPropertyFormularView extends OwView implements OwFieldProvider, OwJspConfigurable
Form View for Object Properties. Can take JSP or HTML based forms.
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 | Class and Description |
---|---|
static class |
OwObjectPropertyFormularView.OwPropertyPlaceholder
tuple after a successful placeholder scan
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_enablesaveall
Flag to enable save all button option when more than one documents are selected.
The save all button will be rendered if this m_saveAllActive is set to true ,
the m_enablesaveall is set to true and OwObjectPropertyFormView.isReadOnly
flag is false . |
protected int |
m_iSaveButton
index of the save button
|
protected OwPasteMetadataHandler |
m_pasteMetadataHandler
paste metadata handler
|
protected OwPropertyCollection |
m_properties
the properties from the work item
|
protected boolean |
m_saveAllActive
flag specify if save all feature is active
|
protected int |
m_saveAllButtonIndex
save all button index
|
protected OwFieldManager |
m_theFieldManager
instance of the property field class
|
CURRENT_MODULE_KEY, FORMULAR_PLACEHOLDER_END_DELIMITER, FORMULAR_PLACEHOLDER_START_DELIMITER, m_externalFormEventTarget
TYPE_AJAX, TYPE_CHECKIN_OBJECT, TYPE_CREATE_OBJECT, TYPE_META_OBJECT, TYPE_RESULT_LIST, TYPE_SEARCH, TYPE_SMALL
EMPTY_STRING
Constructor and Description |
---|
OwObjectPropertyFormularView() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSaveAllButton(String saveAllText_p)
Add Save All button
|
protected void |
changeSaveAllButtonState()
Establish the enabled state for saveAll button
|
protected OwBatchPropertiesHandler |
createBatchPropertiesHandler()
Creates the batch properties handler
|
protected OwPasteMetadataHandler |
createPasteMetadataHandler()
Create a
OwPasteMetadataHandler object |
void |
detach()
remove view and all subviews from context
|
boolean |
displayNoSaveMsg()
Display "no save" message.
|
void |
filterProperties(Collection<OwPropertyInfo> propertyInfos_p)
Filter properties based on provided collection.
|
OwField |
getField(String strFieldClassName_p)
implementation for the OwFieldProvider interface
|
OwFieldManager |
getFieldManager()
get a reference to the internal field manager
|
String |
getFieldProviderName()
get a name that identifies the field provider
|
Object |
getFieldProviderSource()
get the source object that originally provided the fields.
|
int |
getFieldProviderType()
implementation for the OwFieldProvider interface
get the type of field provider as defined with TYPE_...
|
Collection |
getFields()
get all the properties in the form
|
OwJspFormConfigurator |
getJspConfigurator()
Get the associated
OwJspFormConfigurator object. |
OwMenuView |
getMenu()
get the menu
|
OwObject |
getObjectRef()
get the current object to use for property rendering
|
protected int |
getReadOnlyContext()
get context to be used for the read-only property
|
Object |
getSafeFieldValue(String sName_p,
Object defaultvalue_p)
retrieve the value of a Field
|
protected int |
getSaveBtnIndex()
get the index of the save button
|
boolean |
getUpdateStatus()
get the status after the last update
|
protected void |
informUserOnSuccess()
Post a message for informing user about a successfully save operation.
|
protected void |
init()
init the target after the context is set.
|
void |
insertLabel(Writer w_p,
String strPlaceHolder_p,
String displayName,
String styleClass) |
boolean |
isFieldMandatory(String strPlaceHolder_p)
Checks if a field is mandatory or not.
|
boolean |
isNamedRegion(String strRegion_p)
determine if region exists
|
boolean |
isPasteMetadataActivated()
Get the status of "paste metadata" feature.
|
boolean |
isPropertyReadOnly(boolean readOnly) |
boolean |
isReadOnly() |
boolean |
isSystemPropertyView()
Always returns
false . |
void |
onBatchIndex()
Update the specified properties (from owplugins->EditBatchPropertyList) with the
values from previous view.
|
void |
onPasteAllMetaData(javax.servlet.http.HttpServletRequest request_p)
called when user presses the paste all metadata button
|
void |
onPasteThisMetaData(javax.servlet.http.HttpServletRequest request_p)
called when user presses the paste this metadata button
|
protected void |
onRender(Writer w_p)
called when the view should create its HTML content to be displayed
|
boolean |
onSave(javax.servlet.http.HttpServletRequest request_p,
Object oReason_p)
called when the user wants to save the modified properties
call getUpdateStatus() after save to check if fields are invalid
|
protected boolean |
onSaveInternal(javax.servlet.http.HttpServletRequest request_p,
Object oReason_p)
called to save the modified properties
call getUpdateStatus() after save to check if fields are invalid
|
protected void |
renderMenuRegion(Writer w_p)
render the menu region
|
void |
renderNamedRegion(Writer w_p,
String strPlaceHolder_p)
Called when the form parser finds a placeholder in the HTML / JSP input
|
void |
renderPasteAll(Writer w_p)
Utility method to render "paste all" symbol.
|
void |
renderPasteProperty(Writer w_p,
String propName_p)
Utility method to render "paste" symbol.
|
protected void |
renderProperty(Writer w_p,
OwProperty prop_p,
boolean fReadOnly_p)
overridable to render a property
|
protected boolean |
save(OwPropertyCollection changedProperties_p)
save the properties to the object
|
void |
setBatchProperties(Collection batchIndexProperties_p)
Set the collection of property names for batch feature.
|
void |
setDisplayNoSaveMsg(boolean display_p)
Set the flag if "no save" message(s) should be displayed or not.
|
void |
setField(String sName_p,
Object value_p)
modify a Field value, but does not save the value right away
|
void |
setHTMLFormular(String strHTMLPage_p)
set the JSP page to use as a form
|
void |
setJspConfigurator(OwJspFormConfigurator jspFormConfigurator_p)
Set the associated
OwJspFormConfigurator object. |
void |
setJspFormular(String strJspPage_p)
set the optional JSP form to use in the render method
In the JSP Form you can use the following statements to display and manipulate Properties // get a reference to the calling view OwView m_View = (OwView)request.getAttribute(OwView.CURRENT_MODULE_KEY); <% m_View.renderNamedRegion(out, <% m_View.renderNamedRegion(out,ow_err_ <% m_View.renderNamedRegion(out,ow_ro_ <% m_View.renderNamedRegion(out,ow_menu); %> : renders a function menu to save changes You can also cast the m_View to OwFieldProvider to retrieve a OwField instance and manipulate or program a field directly. |
void |
setObjectRef(OwObject objectRef_p) |
void |
setPasteMetadataEnabled(boolean enabled_p)
Set the enabled status for paste metadata feature.
|
void |
setReadOnlyContext(int context_p)
set context to be used for the read-only property
|
void |
setSaveAllActive(boolean saveAllEnabled_p)
Setter for saveAll button state.
|
protected OwPropertyCollection |
update(javax.servlet.http.HttpServletRequest request_p)
update view from request
to save the changes call save
|
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 String |
usesFormWithAttributes()
to get additional form attributes used for the form
override if your view needs a form.
|
activate, addView, getBreadcrumbPart, getDocument, getExternalFormEventTarget, getFormName, getFormTarget, getIcon, getIterator, getMaximizeView, getParent, getRenderedNamedRegion, getRenderedRegion, getTitle, getViewList, isFormTargetExternal, isRegion, isShowMaximized, isShowMinimized, isShowNormal, onActivate, onUpdate, render, renderHTMLFormular, renderRegion, serverSideDesignInclude, serverSideInclude, setDocument, setExternalFormTarget, setMaximizeView, setParent, showMaximized, showMinimized, showNormal
attach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onFormEvent, onRequest
protected boolean m_enablesaveall
m_saveAllActive
is set to true
,
the m_enablesaveall
is set to true
and OwObjectPropertyFormView.isReadOnly
flag is false
.protected int m_iSaveButton
protected OwPasteMetadataHandler m_pasteMetadataHandler
protected OwPropertyCollection m_properties
protected boolean m_saveAllActive
protected int m_saveAllButtonIndex
protected OwFieldManager m_theFieldManager
protected void addSaveAllButton(String saveAllText_p) throws Exception
saveAllText_p
- - the text to be displayed in the buttonException
protected void changeSaveAllButtonState()
protected OwBatchPropertiesHandler createBatchPropertiesHandler()
OwBatchPropertiesHandler
objectprotected OwPasteMetadataHandler createPasteMetadataHandler()
OwPasteMetadataHandler
objectpublic void detach()
public boolean displayNoSaveMsg()
setDisplayNoSaveMsg(boolean)
public void filterProperties(Collection<OwPropertyInfo> propertyInfos_p) throws Exception
propertyInfos_p
- - can be null - no filter is applied.Exception
public OwField getField(String strFieldClassName_p) throws Exception
getField
in interface OwFieldProvider
strFieldClassName_p
- String class name of requested fieldsException
public OwFieldManager getFieldManager()
public String getFieldProviderName()
getFieldProviderName
in interface OwFieldProvider
public Object getFieldProviderSource()
getFieldProviderSource
in interface OwFieldProvider
public int getFieldProviderType()
getFieldProviderType
in interface OwFieldProvider
public Collection getFields() throws Exception
getFields
in interface OwFieldProvider
Exception
public OwJspFormConfigurator getJspConfigurator()
OwJspConfigurable
OwJspFormConfigurator
object. Can be null
.getJspConfigurator
in interface OwJspConfigurable
OwJspFormConfigurator
object or null
.public OwMenuView getMenu()
public OwObject getObjectRef()
protected int getReadOnlyContext()
public Object getSafeFieldValue(String sName_p, Object defaultvalue_p)
getSafeFieldValue
in interface OwFieldProvider
sName_p
- defaultvalue_p
- protected int getSaveBtnIndex()
public boolean getUpdateStatus()
protected void informUserOnSuccess()
protected void init() throws Exception
public boolean isNamedRegion(String strRegion_p) throws Exception
isNamedRegion
in interface OwBaseView
isNamedRegion
in class OwView
strRegion_p
- name of the region to render
of the following form:
[ow_err_ | ow_ro_]Exception
public boolean isPasteMetadataActivated()
true
if the JSP should render the Paste All and Paste buttons.public boolean isReadOnly()
public boolean isSystemPropertyView()
false
.false
public void onBatchIndex() throws Exception
Exception
public void onPasteAllMetaData(javax.servlet.http.HttpServletRequest request_p) throws Exception
Exception
public void onPasteThisMetaData(javax.servlet.http.HttpServletRequest request_p) throws Exception
Exception
protected void onRender(Writer w_p) throws IOException, Exception
onRender
in class OwView
w_p
- Writer object to write HTML toException
IOException
public boolean onSave(javax.servlet.http.HttpServletRequest request_p, Object oReason_p) throws Exception
Exception
protected boolean onSaveInternal(javax.servlet.http.HttpServletRequest request_p, Object oReason_p) throws Exception
Exception
protected void renderMenuRegion(Writer w_p) throws Exception
Exception
public boolean isFieldMandatory(String strPlaceHolder_p) throws Exception
strPlaceHolder_p
- The name of the field (usually this is the same with the name of the property). It has to be a fully qualified name (include the name of the class too);Exception
renderNamedRegion(Writer, String)
public void renderNamedRegion(Writer w_p, String strPlaceHolder_p) throws Exception
renderNamedRegion
in interface OwBaseView
renderNamedRegion
in class OwView
strPlaceHolder_p
- the placeholder string found
of the following form:
[ow_err_ | ow_ro_]w_p
- Writer object, write to replace placeholderException
public void renderPasteAll(Writer w_p) throws Exception
public void renderPasteProperty(Writer w_p, String propName_p) throws Exception
protected void renderProperty(Writer w_p, OwProperty prop_p, boolean fReadOnly_p) throws Exception
Exception
protected boolean save(OwPropertyCollection changedProperties_p) throws Exception
changedProperties_p
- OwPropertyCollection see updateException
public void setBatchProperties(Collection batchIndexProperties_p)
batchIndexProperties_p
- public void setDisplayNoSaveMsg(boolean display_p)
display_p
- boolean flagpublic void setField(String sName_p, Object value_p) throws Exception, OwObjectNotFoundException
setField
in interface OwFieldProvider
sName_p
- value_p
- Exception
OwObjectNotFoundException
public void setHTMLFormular(String strHTMLPage_p)
public void setJspConfigurator(OwJspFormConfigurator jspFormConfigurator_p)
OwJspConfigurable
OwJspFormConfigurator
object. Can be null
.setJspConfigurator
in interface OwJspConfigurable
public void setJspFormular(String strJspPage_p) throws Exception
strJspPage_p
- Exception
public void setObjectRef(OwObject objectRef_p) throws Exception
objectRef_p
- The objectRef to set.Exception
public void setPasteMetadataEnabled(boolean enabled_p)
enabled_p
- public void setReadOnlyContext(int context_p)
context_p
- int as defined with OwPropertyClass.CONTEXT_...public void setSaveAllActive(boolean saveAllEnabled_p)
saveAllEnabled_p
- protected OwPropertyCollection update(javax.servlet.http.HttpServletRequest request_p) throws Exception
Exception
public 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 String usesFormWithAttributes()
usesFormWithAttributes
in class OwView
public void insertLabel(Writer w_p, String strPlaceHolder_p, String displayName, String styleClass) throws Exception
Exception
public boolean isPropertyReadOnly(boolean readOnly)
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.