org.mmbase.bridge.jsp.taglib.editor
Class BasicEditor

java.lang.Object
  extended byorg.mmbase.bridge.jsp.taglib.editor.Editor
      extended byorg.mmbase.bridge.jsp.taglib.editor.BasicEditor

public class BasicEditor
extends Editor

This is an example implementation of the EditTag. It extends Editor. To create your own editor with the edittag you could or rather should also extend Editor.
BasicEditor accepts two parameters url and icon and returns a link with a nodenr of the very first field the edittag encounters, with an icon to click on.

Since:
MMBase-1.8
Version:
$Id: BasicEditor.java,v 1.9 2006/07/06 11:36:12 michiel Exp $
Author:
André van Toly
See Also:
EditTag, YAMMEditor

Field Summary
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.editor.Editor
fieldList, nodenrList, parameters, queryList
 
Constructor Summary
BasicEditor()
           
 
Method Summary
 void getEditorHTML(PageContext context)
          Makes html with a link to a node in an editor using the parameters url and icon.
protected  Parameter[] getParameterDefinition()
           
protected  String getValue(String param, Cloud cloud, String nodenr, PageContext context)
          Fills parameters of the parameters to be interpreted as PatternNodeFunctions
protected  void makeHTML(String nodenr, PageContext context)
          Creates a string with the link (and icon) to the editor
protected  String makeRelative(String url, PageContext pageContext)
          Copied this method from the UrlTag.
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.editor.Editor
getFieldList, getNodenrList, getParameters, getQueryList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicEditor

public BasicEditor()
Method Detail

getParameterDefinition

protected Parameter[] getParameterDefinition()
Overrides:
getParameterDefinition in class Editor

getEditorHTML

public void getEditorHTML(PageContext context)
                   throws IOException
Makes html with a link to a node in an editor using the parameters url and icon.

Specified by:
getEditorHTML in class Editor
Parameters:
context - The PageContext
Throws:
IOException

getValue

protected String getValue(String param,
                          Cloud cloud,
                          String nodenr,
                          PageContext context)
Fills parameters of the parameters to be interpreted as PatternNodeFunctions


makeHTML

protected void makeHTML(String nodenr,
                        PageContext context)
                 throws IOException
Creates a string with the link (and icon) to the editor

Parameters:
nodenr - Node to make HTML link to.
context - PageContex object, which must be used to write the HTML to.
Throws:
IOException

makeRelative

protected String makeRelative(String url,
                              PageContext pageContext)
Copied this method from the UrlTag. If it would be nice that an URL starting with '/' would be generated relatively to the current request URL, then this method can do it. If the URL is not used to write to (this) page, then you probably don't want that. The behaviour can be overruled by starting the URL with two '/'s.



MMBase build 1.8.1.20060716