org.mmbase.datatypes.handlers.html
Class BinaryHandler

java.lang.Object
  extended by org.mmbase.datatypes.handlers.AbstractHandler<String>
      extended by org.mmbase.datatypes.handlers.html.HtmlHandler
          extended by org.mmbase.datatypes.handlers.html.BinaryHandler
All Implemented Interfaces:
Serializable, Handler<String>

public class BinaryHandler
extends HtmlHandler

The most straight forward implementation in HTML for an input widget for a binary field is a 'input' tag with type 'file'.

Since:
MMBase-1.9.1
Version:
$Id: BinaryHandler.java 40931 2010-02-09 14:04:04Z michiel $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.datatypes.handlers.html.HtmlHandler
SESSIONNAME, XML
 
Constructor Summary
BinaryHandler()
           
 
Method Summary
protected  Object getFieldValue(Request request, Node node, Field field)
          Returns the field value as specified by the client's post.
 String input(Request request, Node node, Field field, boolean search)
          Produces an form input field for the given Node, and Field.
 void setUseSpecificSetter(boolean s)
          IF this is set it true the value is not set with Node.setValue(java.lang.String, java.lang.Object) but with Node.setInputStreamValue(java.lang.String, java.io.InputStream, long).
protected  void setValue(Request request, Node node, String fieldName, Object value)
           
 String toString()
           
 
Methods inherited from class org.mmbase.datatypes.handlers.html.HtmlHandler
appendClasses, appendNameId, check, id, prefixError, setSetIfNotChanged
 
Methods inherited from class org.mmbase.datatypes.handlers.AbstractHandler
cast, findString, getFieldValue, getOperator, getSearchValue, getValue, id, interpretEmptyAsNull, search, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryHandler

public BinaryHandler()
Method Detail

setUseSpecificSetter

public void setUseSpecificSetter(boolean s)
IF this is set it true the value is not set with Node.setValue(java.lang.String, java.lang.Object) but with Node.setInputStreamValue(java.lang.String, java.io.InputStream, long). The effect of this is that the method DataType.cast(java.lang.Object, org.mmbase.bridge.Node, org.mmbase.bridge.Field) is avoided. This may be useful if the set-processor expects an InputStream, and not a byte-array (or another type if this Handler is used on a non-binary field).


input

public String input(Request request,
                    Node node,
                    Field field,
                    boolean search)
Description copied from interface: Handler
Produces an form input field for the given Node, and Field.

Specified by:
input in interface Handler<String>
Specified by:
input in class AbstractHandler<String>
search - if true, then a search field is produced.

setValue

protected void setValue(Request request,
                        Node node,
                        String fieldName,
                        Object value)
Overrides:
setValue in class AbstractHandler<String>

getFieldValue

protected Object getFieldValue(Request request,
                               Node node,
                               Field field)
Returns the field value as specified by the client's post.

Overrides:
getFieldValue in class AbstractHandler<String>
node - This parameter could be used if the client does not fully specify the field's value (possible e.g. with Date fields). The existing specification could be used then.

toString

public String toString()
Overrides:
toString in class Object


MMBase 2.0-SNAPSHOT - null