public class OwSearchCriteriaView extends OwView implements OwFieldProvider
View Module to display and edit search criteria. The View must be enclosed by a form, or you can use the function setFormName to internally create a form in the view.
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 |
---|---|
static int |
ERRORS_REGION
errors region
|
protected List |
m_CriteriaList
list of the search criteria
|
protected Map |
m_CriteriaMap
map of criteria for fast access when using a layout
|
protected int |
m_iViewMask
filters the views to be displayed
|
protected String |
m_strHtmlFormular
optional HTML form
|
protected String |
m_strJspFormular
optional JSP form
|
protected OwFieldManager |
m_theFieldManager
instance of the property field class
|
static String |
PLACEHOLDER_ERROR_PREFIX
start delimiter for the placeholders
|
static String |
PLACEHOLDER_INSTRUCTION_PREFIX
start delimiter for the placeholders
|
static String |
PLACEHOLDER_VALIDATION_PREFIX
start delimiter for the placeholders
|
static String |
RUNTIME_PLACEHOLDER_BASE_URL
placeholder for the server base url
|
static String |
RUNTIME_PLACEHOLDER_DESIGN_URL
placeholder for the server design url
|
static int |
VIEW_MASK_RENDER_VERTICAL
mask value to enable vertical rendering of criteria
|
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 |
---|
OwSearchCriteriaView() |
Modifier and Type | Method and Description |
---|---|
void |
detach()
remove view and all subviews from context
|
OwField |
getField(String strFieldClassName_p)
implementation for the OwFieldProvider interface
|
String |
getFieldProviderName()
get a name that identifies the field provider, can be used to create IDs
|
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
|
Object |
getSafeFieldValue(String sName_p,
Object defaultvalue_p)
retrieve the value of a Field
|
String |
getSafeInstruction(OwSearchCriteria searchCriteria_p)
get a instruction for the criteria
|
protected boolean |
hasViewMask(int iViewMask_p)
check if view should be displayed or is masked out
|
protected void |
init()
init the view after the context is set.
|
OwSearchCriteria |
lookupCriteria(String strName_p)
lookup a criteria by the unique name
|
void |
onRender(Writer w_p)
render the views of the region
|
protected void |
onRenderHorizontal(Writer w_p)
render the search template normal without a form
|
protected void |
onRenderVertical(Writer w_p)
render the search template normal without a form
|
boolean |
onSubmitSearch(javax.servlet.http.HttpServletRequest request_p)
event called when user submits the form
updates the criteria, does the same as updateEditable
NOTE: Exceptions are handled and displayed automatically
|
protected void |
renderEditCriteria(Writer w_p,
OwSearchCriteria crit_p)
render a single editable criteria
|
void |
renderNamedRegion(Writer w_p,
String strPlaceholder_p)
Called when the form parser finds a placeholder in the HTML input
|
protected void |
renderPropertyLabel(Writer w_p,
OwSearchCriteria criteria_p,
String suffix_p)
Renders a property control label on the given Writer.
The property's read-only status and the value type (array or complex value) are considered at rendering time. |
protected void |
renderReadOnlyCriteria(Writer w_p,
OwSearchCriteria crit_p)
render a single read only criteria
|
void |
renderRegion(Writer w_p,
int region_p)
render only a region in the view, used by derived classes
|
void |
resetErrors()
Reset the errors from
OwFieldManager object |
void |
setCriteriaList(List criteriaList_p)
set list of the search criteria
|
void |
setField(String sName_p,
Object value_p)
modify a Field value, but does not save the value right away
|
void |
setFieldProvider(OwFieldProvider fieldProvider_p)
set an interface to a field provider interface
the field provider interface can be used by the fields to reference other fields.
|
void |
setHTMLFormular(String strFormular_p)
set the optional HTML form to use in the render method
|
void |
setJspFormular(String strJspUrl_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_inst_ <% 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 |
setViewMask(int iViewMask_p)
determine the views to be displayed by masking them with their flag
|
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, isNamedRegion, isRegion, isShowMaximized, isShowMinimized, isShowNormal, onActivate, onUpdate, render, renderHTMLFormular, serverSideDesignInclude, serverSideInclude, setDocument, setExternalFormTarget, setMaximizeView, setParent, showMaximized, showMinimized, showNormal
attach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onFormEvent, onRequest
public static final int VIEW_MASK_RENDER_VERTICAL
public static final String RUNTIME_PLACEHOLDER_BASE_URL
public static final String RUNTIME_PLACEHOLDER_DESIGN_URL
public static final String PLACEHOLDER_ERROR_PREFIX
public static final String PLACEHOLDER_INSTRUCTION_PREFIX
public static final String PLACEHOLDER_VALIDATION_PREFIX
public static final int ERRORS_REGION
protected OwFieldManager m_theFieldManager
protected List m_CriteriaList
protected String m_strHtmlFormular
protected String m_strJspFormular
protected Map m_CriteriaMap
protected int m_iViewMask
public void setViewMask(int iViewMask_p)
iViewMask_p
- bitmask according to VIEW_MASK_... flagsprotected boolean hasViewMask(int iViewMask_p)
iViewMask_p
- bitmask according to VIEW_MASK_... flagsprotected void init() throws Exception
public OwField getField(String strFieldClassName_p) throws Exception
getField
in interface OwFieldProvider
strFieldClassName_p
- String class name of requested fieldsException
public Object getFieldProviderSource()
getFieldProviderSource
in interface OwFieldProvider
public int getFieldProviderType()
getFieldProviderType
in interface OwFieldProvider
public void detach()
public void setFieldProvider(OwFieldProvider fieldProvider_p)
fieldProvider_p
- OwFieldProvider interfacepublic void setCriteriaList(List criteriaList_p)
criteriaList_p
- List with OwSearchCriteria to be edited in the viewpublic void setHTMLFormular(String strFormular_p)
strFormular_p
- String optional HTML layoutpublic void setJspFormular(String strJspUrl_p)
strJspUrl_p
- String optional HTML layoutpublic OwSearchCriteria lookupCriteria(String strName_p) throws Exception
strName_p
- Exception
public void renderNamedRegion(Writer w_p, String strPlaceholder_p) throws Exception
renderNamedRegion
in interface OwBaseView
renderNamedRegion
in class OwView
strPlaceholder_p
- the placeholder string foundw_p
- Writer object, write to replace placeholderException
public void renderRegion(Writer w_p, int region_p) throws Exception
OwView
renderRegion
in interface OwBaseView
renderRegion
in class OwView
w_p
- Writer object to write HTML toregion_p
- ID of the region to renderException
protected String usesFormWithAttributes()
usesFormWithAttributes
in class OwView
public String getSafeInstruction(OwSearchCriteria searchCriteria_p) throws Exception
searchCriteria_p
- OwSearchCriteriaException
protected void renderPropertyLabel(Writer w_p, OwSearchCriteria criteria_p, String suffix_p) throws Exception
w_p
- criteria_p
- suffix_p
- Exception
protected void onRenderHorizontal(Writer w_p) throws Exception
w_p
- Writer object, write to replace placeholderException
protected void onRenderVertical(Writer w_p) throws Exception
w_p
- Writer object, write to replace placeholderException
protected void renderEditCriteria(Writer w_p, OwSearchCriteria crit_p) throws Exception
w_p
- crit_p
- Exception
protected void renderReadOnlyCriteria(Writer w_p, OwSearchCriteria crit_p) throws Exception
w_p
- crit_p
- Exception
public boolean onSubmitSearch(javax.servlet.http.HttpServletRequest request_p) throws Exception
request_p
- HttpServletRequestException
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
public String getFieldProviderName()
getFieldProviderName
in interface OwFieldProvider
public void setField(String sName_p, Object value_p) throws Exception, OwObjectNotFoundException
setField
in interface OwFieldProvider
sName_p
- value_p
- Exception
OwObjectNotFoundException
public Object getSafeFieldValue(String sName_p, Object defaultvalue_p)
getSafeFieldValue
in interface OwFieldProvider
sName_p
- defaultvalue_p
- public Collection getFields() throws Exception
getFields
in interface OwFieldProvider
Exception
public void resetErrors()
OwFieldManager
objectCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.