public abstract class OwView extends OwEventTarget implements OwBaseView, OwUpdateTarget
View Class, which supports Document View Pattern and acts as an Event Target.
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 String |
CURRENT_MODULE_KEY
request key for to reference the current module in a JSP redirect
|
static String |
FORMULAR_PLACEHOLDER_END_DELIMITER
end delimiter for the formular placeholders, used in onRenderHTMLFormular.
|
static String |
FORMULAR_PLACEHOLDER_START_DELIMITER
start delimiter for the formular placeholders, used in onRenderHTMLFormular.
|
protected OwEventTarget |
m_externalFormEventTarget
external form view overrides internal form
|
EMPTY_STRING
Constructor and Description |
---|
OwView() |
Modifier and Type | Method and Description |
---|---|
void |
activate()
activate this view, i.e.
|
void |
addView(OwView view_p,
String strName_p)
add a view and initialize it
|
void |
detach()
remove view and all subviews from context
|
String |
getBreadcrumbPart()
This method is used to create a "Breadcrumb"
navigation view.
|
OwDocument |
getDocument()
gets the reference to the document
|
OwEventTarget |
getExternalFormEventTarget()
the external form target if set
|
String |
getFormName()
get the form used for the template edit fields
Returns the internal render form or the external one
if you called setFormName.
|
OwEventTarget |
getFormTarget()
get the target, that is used for form date and renders form
|
String |
getIcon()
get the icon URL for this view to be displayed
|
Iterator |
getIterator()
get a iterator object for the child views
|
protected OwView |
getMaximizeView()
overridable function to retrieve the view that is shown maximized if any
|
OwView |
getParent()
the parent view of this view or null if the top view
|
String |
getRenderedNamedRegion(String strRegion_p)
render the region and return a result String
useful function when rendering regions and need the HTML in other functions
|
String |
getRenderedRegion(int iRegion_p)
render the region and return a result String
useful function when rendering regions and need the HTML in other functions
|
String |
getTitle()
overridable title of the view
|
List |
getViewList()
get the list of views
|
protected void |
init()
init the target after the context is set.
|
boolean |
isFormTargetExternal()
check if the form target is external
|
boolean |
isNamedRegion(String strRegion_p)
determine if region exists
|
boolean |
isRegion(int iRegion_p)
determine if region exists
|
boolean |
isShowMaximized()
checks if the view is shown maximized
|
boolean |
isShowMinimized()
checks if the view is shown minimized
|
boolean |
isShowNormal()
checks if the view is shown normal
|
protected void |
onActivate(int iIndex_p,
Object oReason_p)
activate the target from a navigation module.
|
protected void |
onRender(Writer w_p)
called when the view should create its HTML content to be displayed
|
void |
onUpdate(OwEventTarget caller_p,
int iCode_p,
Object param_p)
called by the framework to update the view when OwDocument.Update was called
NOTE: We can not use the onRender method to update,
because we do not know the call order of onRender.
|
void |
render(Writer w_p)
render the view and all contained views.
|
protected void |
renderHTMLFormular(Writer w_p,
String strHTMLFormular_p)
generic function, which can render HTML forms.
|
void |
renderNamedRegion(Writer w_p,
String strRegion_p)
render only a region in the view, used by derived classes
|
void |
renderRegion(Writer w_p,
int iRegion_p)
render only a region in the view, used by derived classes
|
void |
serverSideDesignInclude(String path_p,
Writer w_p)
Include the specified URL writing its output to the current Writer object.
|
void |
serverSideInclude(String path_p,
Writer w_p)
Include the specified URL writing its output to the current Writer object.
|
void |
setDocument(OwDocument doc_p)
Sets the reference to the document.
|
void |
setExternalFormTarget(OwEventTarget eventtarget_p)
override the internal OwEditable with an external one,
must be called BEFORE view is attached.
|
protected void |
setMaximizeView(OwView view_p)
overridable function to set a view as a maximized view, i.e.
|
protected void |
setParent(OwView parent_p)
set the parent to this view
|
void |
showMaximized()
maximize the view
|
void |
showMinimized()
minimize the view
|
void |
showNormal()
show the view normal
|
protected String |
usesFormWithAttributes()
to get additional form attributes used for the form
override if your view needs a form.
|
attach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onFormEvent, onRequest, updateExternalFormTarget
public static final String CURRENT_MODULE_KEY
public static final String FORMULAR_PLACEHOLDER_START_DELIMITER
public static final String FORMULAR_PLACEHOLDER_END_DELIMITER
protected OwEventTarget m_externalFormEventTarget
public String getIcon() throws Exception
Exception
public Iterator getIterator()
public List getViewList()
public String getTitle()
getTitle
in interface OwBaseView
protected void setParent(OwView parent_p)
parent_p
- Parent viewpublic OwView getParent()
protected void setMaximizeView(OwView view_p)
view_p
- OwView that requests to be shown maximizedprotected OwView getMaximizeView()
public void showMaximized()
public void showMinimized()
public void showNormal()
public boolean isShowMaximized()
public boolean isShowMinimized()
public boolean isShowNormal()
public void onUpdate(OwEventTarget caller_p, int iCode_p, Object param_p) throws Exception
OwUpdateTarget
onUpdate
in interface OwUpdateTarget
caller_p
- OwEventTarget target that called updateiCode_p
- int optional reason codeparam_p
- Object optional parameter representing the refresh, depends on the value of iCode_p, can be nullException
public void activate() throws Exception
Exception
public void addView(OwView view_p, String strName_p) throws Exception
view_p
- View to addstrName_p
- Name / ID of the view, can be nullException
public void setDocument(OwDocument doc_p)
For safety reasons, the OwDocument
object can be set only once for a view.
doc_p
- OwDocument
instance to attach to.public void detach()
detach
in class OwEventTarget
public OwDocument getDocument()
public final void render(Writer w_p) throws Exception
render
in interface OwBaseView
w_p
- Writer object to write HTML toException
protected void onRender(Writer w_p) throws Exception
w_p
- Writer object to write HTML toException
public void renderRegion(Writer w_p, int iRegion_p) throws Exception
renderRegion
in interface OwBaseView
w_p
- Writer object to write HTML toiRegion_p
- ID of the region to renderException
public String getRenderedRegion(int iRegion_p) throws Exception
iRegion_p
- ID of the region to renderException
public boolean isRegion(int iRegion_p) throws Exception
isRegion
in interface OwBaseView
iRegion_p
- ID of the region to renderException
public boolean isNamedRegion(String strRegion_p) throws Exception
isNamedRegion
in interface OwBaseView
strRegion_p
- name of the region to renderException
protected void init() throws Exception
init
in class OwEventTarget
Exception
protected void onActivate(int iIndex_p, Object oReason_p) throws Exception
iIndex_p
- int tab iIndex of NavigationoReason_p
- User Object which was submitted when target was attached to the navigation moduleException
public void serverSideInclude(String path_p, Writer w_p) throws Exception
path_p
- - The path to the URL to include.w_p
- - The Writer which will be flushed prior to the include.Exception
public void serverSideDesignInclude(String path_p, Writer w_p) throws Exception
path_p
- - The path to the URL to include. (should not start with slash "/")w_p
- - The Writer which will be flushed prior to the include.Exception
protected void renderHTMLFormular(Writer w_p, String strHTMLFormular_p) throws Exception
w_p
- Writer object to write HTML tostrHTMLFormular_p
- String HTML Formular with {#...#} placeholdersException
public void renderNamedRegion(Writer w_p, String strRegion_p) throws Exception
renderNamedRegion
in interface OwBaseView
w_p
- Writer object to write HTML tostrRegion_p
- named region to renderException
public String getRenderedNamedRegion(String strRegion_p) throws Exception
strRegion_p
- name of the region to renderException
public boolean isFormTargetExternal()
public OwEventTarget getFormTarget()
getFormTarget
in class OwEventTarget
public void setExternalFormTarget(OwEventTarget eventtarget_p) throws Exception
setExternalFormTarget
in class OwEventTarget
eventtarget_p
- OwEventTarget to be used, replaces the internal OwEditableException
public OwEventTarget getExternalFormEventTarget()
OwEventTarget
setExternalFormTarget(OwEventTarget)
protected String usesFormWithAttributes()
public String getFormName()
getFormName
in class OwEventTarget
public String getBreadcrumbPart()
OwBaseView
Example: We have a View A which contains a View B which
has a many views contained.
A.getBreadcrumbPart()
{
return this.getTitle() + " - " + B.getBreadcrumbPart();
}
B.getBreadcrumbPart()
{
return this.getName() + " - " + getMainView().getBreadcrumbPart();
}
null
at
least the OwBaseView.EMPTY_STRING
should be returned.getBreadcrumbPart
in interface OwBaseView
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.