com.wewebu.ow.server.plug.owdocprops
Class OwFieldsView

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.ui.OwView
          extended by com.wewebu.ow.server.ui.OwLayout
              extended by com.wewebu.ow.server.plug.owdocprops.OwFieldsView
All Implemented Interfaces:
com.wewebu.ow.server.field.OwFieldProvider, com.wewebu.ow.server.ui.OwBaseView, com.wewebu.ow.server.ui.OwMultipanel, com.wewebu.ow.server.ui.OwUpdateTarget

public abstract class OwFieldsView
extends com.wewebu.ow.server.ui.OwLayout
implements com.wewebu.ow.server.ui.OwMultipanel, com.wewebu.ow.server.field.OwFieldProvider

OwFieldsView.

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


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.ui.OwLayout
com.wewebu.ow.server.ui.OwLayout.OwDispatchRegion
 
Field Summary
protected  Map m_fields
          fields to edit
protected  int m_iAppyBtnIndex
          menu ID of the apply button
protected  int m_iViewMask
          set of flags indicating the behavior of the view
protected  com.wewebu.ow.server.app.OwSubMenuView m_MenuView
          Menu for buttons in the view
protected  com.wewebu.ow.server.app.OwFieldManager m_theFieldManager
          instance of the field field class
static int MAIN_REGION
          layout region definition for the main (fieldlist) region
static int MENU_REGION
          layout region definition for the menu region
protected static String QUERY_KEY_PROPNAME
          query string for the fieldname
static int VIEW_MASK_ENABLE_PASTE_METADATA
          flag to activate the paste metadata buttons
static int VIEW_MASK_RENDER_VERTICAL
          flag to render vertical
 
Fields inherited from class com.wewebu.ow.server.ui.OwLayout
m_Regions
 
Fields inherited from class com.wewebu.ow.server.ui.OwView
CURRENT_MODULE_KEY, FORMULAR_PLACEHOLDER_END_DELIMITER, FORMULAR_PLACEHOLDER_START_DELIMITER, m_externalFormEventTarget
 
Fields inherited from interface com.wewebu.ow.server.field.OwFieldProvider
TYPE_AJAX, TYPE_CHECKIN_OBJECT, TYPE_CREATE_OBJECT, TYPE_META_OBJECT, TYPE_RESULT_LIST, TYPE_SEARCH, TYPE_SMALL
 
Fields inherited from interface com.wewebu.ow.server.ui.OwBaseView
EMPTY_STRING
 
Constructor Summary
OwFieldsView()
           
 
Method Summary
protected  boolean activatePasteMetadata()
          check if paste metadata is active and should be displayed for user
protected  Map createCloneFromFields(Map fields_p)
          Create a map with clones of editable fields.
 void detach()
           
protected  com.wewebu.ow.server.app.OwClipboard getClipboard()
          Get current Clipboard, often used in this class.
 com.wewebu.ow.server.field.OwField getField(String name_p)
           
 String getFieldProviderName()
           
 Object getFieldProviderSource()
           
 int getFieldProviderType()
           
 Collection getFields()
           
 com.wewebu.ow.server.app.OwMenuView getMenu()
          (overridable) get the menu of the view you can add menu items or override to have your own menu for the view (see VIEW_MASK_DISABLE_INTERNAL_MENU)
protected  String getRowClassName(int iIndex_p, com.wewebu.ow.server.field.OwField prop_p)
          overridable get the style class name for the row
 Object getSafeFieldValue(String name_p, Object defaultvalue_p)
           
protected  boolean hasViewMask(int iViewMask_p)
          check if a certain view field is enabled
protected  void init()
          init the target after the context is set.
 boolean isValidated()
           
 boolean onApply(javax.servlet.http.HttpServletRequest request_p, Object oReason_p)
          event called when user clicked Apply button in menu call getUpdateStatus() after save to check if fields are invalid
 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
protected  void renderExtraColumnHeader(Writer w_p)
          overridable to render additional columns
protected  void renderExtraColumnRows(Writer w_p, com.wewebu.ow.server.field.OwField field_p, int iIndex_p)
          overridable to render additional columns
protected  void renderMainRegion(Writer w_p)
          render the main region with the field list
 void renderRegion(Writer w_p, int iRegion_p)
          render the views of the region
protected abstract  void saveFields(Map changedFields_p)
          save the fields to be implemented
 void setField(String name_p, Object value_p)
           
 void setFields(Map fields_p)
          set the fields to edit
 void setNextActivateView(com.wewebu.ow.server.ui.OwView nextView_p)
           
 void setPrevActivateView(com.wewebu.ow.server.ui.OwView prevView_p)
           
 void setViewMask(int iViewMask_p)
          set the view fields
 boolean updateExternalFormTarget(javax.servlet.http.HttpServletRequest request_p, boolean fSave_p)
           
protected  String usesFormWithAttributes()
          to get additional form attributes used for the form override if your view needs a form.
 
Methods inherited from class com.wewebu.ow.server.ui.OwLayout
addRegion, addView, addView, addViewReference, getIterator, getViewRegion, isRegion, isRegionMaximized, isRegionMinimized, isRegionNormal, renderNamedRegion
 
Methods inherited from class com.wewebu.ow.server.ui.OwView
activate, getBreadcrumbPart, getDocument, getExternalFormEventTarget, getFormName, getFormTarget, getIcon, getMaximizeView, getParent, getRenderedNamedRegion, getRenderedRegion, getTitle, getViewList, isFormTargetExternal, isNamedRegion, isShowMaximized, isShowMinimized, isShowNormal, onActivate, onUpdate, render, renderHTMLFormular, serverSideDesignInclude, serverSideInclude, setDocument, setExternalFormTarget, setMaximizeView, setParent, showMaximized, showMinimized, showNormal
 
Methods inherited from class com.wewebu.ow.server.ui.OwEventTarget
attach, 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, toString, wait, wait, wait
 

Field Detail

MAIN_REGION

public static final int MAIN_REGION
layout region definition for the main (fieldlist) region

See Also:
Constant Field Values

MENU_REGION

public static final int MENU_REGION
layout region definition for the menu region

See Also:
Constant Field Values

VIEW_MASK_RENDER_VERTICAL

public static final int VIEW_MASK_RENDER_VERTICAL
flag to render vertical

See Also:
Constant Field Values

VIEW_MASK_ENABLE_PASTE_METADATA

public static final int VIEW_MASK_ENABLE_PASTE_METADATA
flag to activate the paste metadata buttons

See Also:
Constant Field Values

QUERY_KEY_PROPNAME

protected static final String QUERY_KEY_PROPNAME
query string for the fieldname

See Also:
Constant Field Values

m_iViewMask

protected int m_iViewMask
set of flags indicating the behavior of the view


m_theFieldManager

protected com.wewebu.ow.server.app.OwFieldManager m_theFieldManager
instance of the field field class


m_fields

protected Map m_fields
fields to edit


m_MenuView

protected com.wewebu.ow.server.app.OwSubMenuView m_MenuView
Menu for buttons in the view


m_iAppyBtnIndex

protected int m_iAppyBtnIndex
menu ID of the apply button

Constructor Detail

OwFieldsView

public OwFieldsView()
Method Detail

getMenu

public com.wewebu.ow.server.app.OwMenuView getMenu()
(overridable) get the menu of the view you can add menu items or override to have your own menu for the view (see VIEW_MASK_DISABLE_INTERNAL_MENU)


detach

public void detach()
Overrides:
detach in class com.wewebu.ow.server.ui.OwView

setFields

public void setFields(Map fields_p)
               throws Exception
set the fields to edit

Parameters:
fields_p - map of OwField
Throws:
Exception

createCloneFromFields

protected Map createCloneFromFields(Map fields_p)
                             throws Exception
Create a map with clones of editable fields.

Parameters:
fields_p - - the original map
Returns:
the map with cloned objects.
Throws:
Exception
Since:
3.0.0.0

usesFormWithAttributes

protected String usesFormWithAttributes()
to get additional form attributes used for the form override if your view needs a form. Base class will then render a form automatically

Overrides:
usesFormWithAttributes in class com.wewebu.ow.server.ui.OwView
Returns:
String with form attributes, or null if view does not render a form

init

protected void init()
             throws Exception
init the target after the context is set.

Overrides:
init in class com.wewebu.ow.server.ui.OwView
Throws:
Exception

onApply

public boolean onApply(javax.servlet.http.HttpServletRequest request_p,
                       Object oReason_p)
                throws Exception
event called when user clicked Apply button in menu call getUpdateStatus() after save to check if fields are invalid

Parameters:
request_p - a HttpServletRequest
oReason_p - Optional reason object submitted in addMenuItem
Returns:
true = fields have been saved, false = one or more invalid fiels
Throws:
Exception

saveFields

protected abstract void saveFields(Map changedFields_p)
                            throws Exception
save the fields to be implemented

Parameters:
changedFields_p -
Throws:
Exception

renderRegion

public void renderRegion(Writer w_p,
                         int iRegion_p)
                  throws Exception
render the views of the region

Specified by:
renderRegion in interface com.wewebu.ow.server.ui.OwBaseView
Overrides:
renderRegion in class com.wewebu.ow.server.ui.OwLayout
Parameters:
w_p - Writer object to write HTML to
iRegion_p - ID of the region to render
Throws:
Exception

hasViewMask

protected boolean hasViewMask(int iViewMask_p)
check if a certain view field is enabled

Parameters:
iViewMask_p - int view mask as defined with VIEW_field_...

setViewMask

public void setViewMask(int iViewMask_p)
set the view fields

Parameters:
iViewMask_p - int view mask (a combination of VIEW_field_... defined flags)

activatePasteMetadata

protected boolean activatePasteMetadata()
check if paste metadata is active and should be displayed for user


renderExtraColumnHeader

protected void renderExtraColumnHeader(Writer w_p)
                                throws Exception
overridable to render additional columns

Parameters:
w_p - Writer
Throws:
Exception

getRowClassName

protected String getRowClassName(int iIndex_p,
                                 com.wewebu.ow.server.field.OwField prop_p)
overridable get the style class name for the row

Parameters:
iIndex_p - int row index
prop_p - an OwField (current OwObject)
Returns:
String with style class name

renderMainRegion

protected void renderMainRegion(Writer w_p)
                         throws Exception
render the main region with the field list

Parameters:
w_p - Writer object to write HTML to
Throws:
Exception

onRender

protected void onRender(Writer w_p)
                 throws Exception
called when the view should create its HTML content to be displayed

Overrides:
onRender in class com.wewebu.ow.server.ui.OwView
Parameters:
w_p - Writer object to write HTML to
Throws:
Exception

onPasteThisMetaData

public void onPasteThisMetaData(javax.servlet.http.HttpServletRequest request_p)
                         throws Exception
called when user presses the paste this metadata button

Throws:
Exception

onPasteAllMetaData

public void onPasteAllMetaData(javax.servlet.http.HttpServletRequest request_p)
                        throws Exception
called when user presses the paste all metadata button

Throws:
Exception

getClipboard

protected com.wewebu.ow.server.app.OwClipboard getClipboard()
Get current Clipboard, often used in this class.

Returns:
OwClipboard the current exist

renderExtraColumnRows

protected void renderExtraColumnRows(Writer w_p,
                                     com.wewebu.ow.server.field.OwField field_p,
                                     int iIndex_p)
                              throws Exception
overridable to render additional columns

Parameters:
w_p - Writer
field_p - current OwField to render
iIndex_p - int row of field
Throws:
Exception

isValidated

public boolean isValidated()
                    throws Exception
Specified by:
isValidated in interface com.wewebu.ow.server.ui.OwMultipanel
Throws:
Exception

setNextActivateView

public void setNextActivateView(com.wewebu.ow.server.ui.OwView nextView_p)
                         throws Exception
Specified by:
setNextActivateView in interface com.wewebu.ow.server.ui.OwMultipanel
Throws:
Exception

setPrevActivateView

public void setPrevActivateView(com.wewebu.ow.server.ui.OwView prevView_p)
                         throws Exception
Specified by:
setPrevActivateView in interface com.wewebu.ow.server.ui.OwMultipanel
Throws:
Exception

getField

public com.wewebu.ow.server.field.OwField getField(String name_p)
                                            throws Exception,
                                                   com.wewebu.ow.server.exceptions.OwObjectNotFoundException
Specified by:
getField in interface com.wewebu.ow.server.field.OwFieldProvider
Throws:
Exception
com.wewebu.ow.server.exceptions.OwObjectNotFoundException

getFieldProviderName

public String getFieldProviderName()
Specified by:
getFieldProviderName in interface com.wewebu.ow.server.field.OwFieldProvider

getFieldProviderSource

public Object getFieldProviderSource()
Specified by:
getFieldProviderSource in interface com.wewebu.ow.server.field.OwFieldProvider

getFieldProviderType

public int getFieldProviderType()
Specified by:
getFieldProviderType in interface com.wewebu.ow.server.field.OwFieldProvider

getFields

public Collection getFields()
                     throws Exception
Specified by:
getFields in interface com.wewebu.ow.server.field.OwFieldProvider
Throws:
Exception

getSafeFieldValue

public Object getSafeFieldValue(String name_p,
                                Object defaultvalue_p)
Specified by:
getSafeFieldValue in interface com.wewebu.ow.server.field.OwFieldProvider

setField

public void setField(String name_p,
                     Object value_p)
              throws Exception,
                     com.wewebu.ow.server.exceptions.OwObjectNotFoundException
Specified by:
setField in interface com.wewebu.ow.server.field.OwFieldProvider
Throws:
Exception
com.wewebu.ow.server.exceptions.OwObjectNotFoundException

updateExternalFormTarget

public boolean updateExternalFormTarget(javax.servlet.http.HttpServletRequest request_p,
                                        boolean fSave_p)
                                 throws Exception
Overrides:
updateExternalFormTarget in class com.wewebu.ow.server.ui.OwEventTarget
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.