com.wewebu.ow.server.fieldctrlimpl
Class OwFieldManagerControlImageInsteadOfValue

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.app.OwFieldManagerControl
          extended by com.wewebu.ow.server.fieldctrlimpl.OwFieldManagerControlImageInsteadOfValue

public class OwFieldManagerControlImageInsteadOfValue
extends OwFieldManagerControl

Control to display an image depending of an property value.

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

Since:
4.0.0.0


Constructor Summary
OwFieldManagerControlImageInsteadOfValue()
           
 
Method Summary
 String getUrl(String value_p, int urlPart)
          Generates and returns the appropriate URL in dependence server URL and path configured in bootstrap configuration.
 void init(OwFieldManager fieldmanager_p, Node configNode_p)
          Initializes the field control from configuration node
 void insertEditField(Writer w_p, OwFieldDefinition fieldDef_p, OwField field_p, String strID_p)
          Formats and displays the value attached to the fieldClass in HTML for use in a HTML Form.
 void insertReadOnlyField(Writer w_p, OwFieldDefinition fieldDef_p, Object value_p)
          Formats and displays the value attached to the PropertyClass in HTML
 String insertUpdateFunction(String strID_p)
          Inserts a Java Script function for updating the icon respectively image on changing the value in drop down.
 void renderImage(Writer w_p, OwFieldDefinition fieldDef_p, Object value_p, String id_p)
          render an image depending on provided value
 Object updateField(javax.servlet.http.HttpServletRequest request_p, OwFieldDefinition fieldDef_p, Object value_p, String strID_p)
          update the property value upon request and validates the new value.
 
Methods inherited from class com.wewebu.ow.server.app.OwFieldManagerControl
getFieldManager, getFormEventFunction, getFormEventURL, getFormTarget, init, insertLabel
 
Methods inherited from class com.wewebu.ow.server.ui.OwEventTarget
attach, detach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormName, getID, onExternalRequest, onFormEvent, onRequest, setExternalFormTarget, updateExternalFormTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwFieldManagerControlImageInsteadOfValue

public OwFieldManagerControlImageInsteadOfValue()
Method Detail

init

public void init(OwFieldManager fieldmanager_p,
                 Node configNode_p)
          throws Exception
Initializes the field control from configuration node

Overrides:
init in class OwFieldManagerControl
Parameters:
fieldmanager_p - OwFieldManager reference to the fieldmanager containing the field control
configNode_p - DOM Node to the configuration XML for the control, or null to use defaults
Throws:
Exception
See Also:
OwFieldManagerControl.init(com.wewebu.ow.server.app.OwFieldManager, org.w3c.dom.Node)

getUrl

public String getUrl(String value_p,
                     int urlPart)
              throws Exception
Generates and returns the appropriate URL in dependence server URL and path configured in bootstrap configuration. In dependence of Parameter urlPart the respective part of URL will be returned.

Parameters:
value_p - represents the value of field selected in drop down list coming from ECM backend. This Parameter represents also the part of filename so for example value "New" is selected then the file name could be in dependence of configuration "status_new.png".
urlPart - represents the URL part which will be returned. - Parameter "BEGIN_URL" returns the first part of URL without value/wildcard - Parameter "END_URL returns the last part of URL without value/wildcard (".png") - Parameter "COMPLETE_URL returns the complete URL including complete filename in dependence of selected value
Returns:
returns in dependence of Parameter urlPart a complete URL or only a part of it
Throws:
Exception

insertUpdateFunction

public String insertUpdateFunction(String strID_p)
                            throws Exception
Inserts a Java Script function for updating the icon respectively image on changing the value in drop down. This JS Function will be returned as String will be included/written in the respective JSP Page.

Parameters:
strID_p - identifies Drop Down element in JSP Page
Returns:
returns the Java Script Function as String.
Throws:
Exception

renderImage

public void renderImage(Writer w_p,
                        OwFieldDefinition fieldDef_p,
                        Object value_p,
                        String id_p)
                 throws Exception
render an image depending on provided value

Parameters:
w_p - Writer object to write HTML to
fieldDef_p - OwFieldDefinition definition of field
value_p - Object Value to be displayed
id_p - String id which should be provided to rendered image tag (can be null, then no Id is rendered)
Throws:
Exception

insertReadOnlyField

public void insertReadOnlyField(Writer w_p,
                                OwFieldDefinition fieldDef_p,
                                Object value_p)
                         throws Exception
Formats and displays the value attached to the PropertyClass in HTML

Specified by:
insertReadOnlyField in class OwFieldManagerControl
Parameters:
w_p - Writer object to write HTML to
fieldDef_p - OwFieldDefinition definition of field
value_p - Object Value to be displayed
Throws:
Exception

insertEditField

public void insertEditField(Writer w_p,
                            OwFieldDefinition fieldDef_p,
                            OwField field_p,
                            String strID_p)
                     throws Exception
Formats and displays the value attached to the fieldClass in HTML for use in a HTML Form. It also creates the necessary code to update the value in the form upon request.

Specified by:
insertEditField in class OwFieldManagerControl
Parameters:
w_p - Writer object to write HTML to
fieldDef_p - OwFieldDefinition
field_p - OwField Value to be displayed
strID_p - ID of the HTML element
Throws:
Exception

updateField

public Object updateField(javax.servlet.http.HttpServletRequest request_p,
                          OwFieldDefinition fieldDef_p,
                          Object value_p,
                          String strID_p)
                   throws Exception
update the property value upon request and validates the new value. Updates the object, which was displayed in a form using the getEditHTML(...) code. Throws Exception if new value could not be validated

Specified by:
updateField in class OwFieldManagerControl
Parameters:
request_p - HttpServletRequest
fieldDef_p - OwFieldDefinition
value_p - Object old Value
strID_p - ID of the HTML element
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.