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

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

public class YAMMEditor
extends Editor

This is an example implementation of the EditTag. It extends the implementation class Editor of EditTag. To create your own editor with the edittag you could or rather should also extend Editor.
EditTagYAMMe works together with the editor yammeditor.jsp. It creates an URL that looks something like this:
yammeditor.jsp?nrs=76&fields=76_number;76_title;76_subtitle;76_intro;80_gui();

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

Field Summary
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.editor.Editor
fieldList, nodenrList, parameters, queryList
 
Constructor Summary
YAMMEditor()
           
 
Method Summary
protected  List fillPathList(List ql)
          Generates pathList with the needed paths for the editor from an list with queries.
 void getEditorHTML(PageContext context)
          Create a string containing all the needed html to find the editor.
protected  List getNodesFromQuery(Query query, String nr)
           
protected  Parameter[] getParameterDefinition()
           
protected  String getPathFromQuery(Query query)
          Get the path from this query where the field originated from.
 String makeHTML(String url, String icon)
          Creates a string with the link (and icon) to the editor
protected  String makeList4Url(List al)
          Creates a ; seperated String from a List to create the url to yammeditor with paths, fields, startnodes or whatnot
protected  String makeRelative(String url, PageContext pageContext)
          Copied this method from the UrlTag.
protected  void processField(Query query, String nodenr, String fieldName)
          Processes a field with nodenr and query into several lists
 void registerFields(List queryList, List nodenrList, List fieldList)
          Values passed by the EditTag from the FieldTags.
 
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

YAMMEditor

public YAMMEditor()
Method Detail

getParameterDefinition

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

getEditorHTML

public void getEditorHTML(PageContext context)
                   throws IOException
Create a string containing all the needed html to find the editor. Or rather it calls one of the older methods i wrote, that was easier then rewriting the old method.

Specified by:
getEditorHTML in class Editor
Parameters:
context - PageContext used to write a string with a link and an icon to access yammeditor.jsp
Throws:
IOException

registerFields

public void registerFields(List queryList,
                           List nodenrList,
                           List fieldList)
Values passed by the EditTag from the FieldTags.

Parameters:
queryList - List with SearchQuery objects from fields
nodenrList - List with nodenumbers
fieldList - List with fieldnames

processField

protected void processField(Query query,
                            String nodenr,
                            String fieldName)
Processes a field with nodenr and query into several lists

Parameters:
query - SearchQuery that delivered the field
nodenr - Nodenumber of the node the field belongs to
fieldName - Name of the field

getNodesFromQuery

protected List getNodesFromQuery(Query query,
                                 String nr)

fillPathList

protected List fillPathList(List ql)
Generates pathList with the needed paths for the editor from an list with queries.

Parameters:
ql - List with queries
Returns:
List with paths from #getPathFromQuery

getPathFromQuery

protected String getPathFromQuery(Query query)
Get the path from this query where the field originated from. Returns an empty String when there is no path (startnode f.e.).

Parameters:
query - The query
Returns:
A String containing a path in the form 345_news,posrel,urls meaning: startnode(s)_path

makeList4Url

protected String makeList4Url(List al)
Creates a ; seperated String from a List to create the url to yammeditor with paths, fields, startnodes or whatnot

Parameters:
al - One of the Lists to use
Returns:
A ; seperated String with the elements in the List

makeHTML

public String makeHTML(String url,
                       String icon)
Creates a string with the link (and icon) to the editor

Parameters:
url - An url to an editor
icon - An url to a graphic file
Returns:
An HTML string with a link suitable for the editor yammeditor.jsp

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