Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/editor
In directory james.mmbase.org:/tmp/cvs-serv32754/editor

Modified Files:
        EditTag.java 
Log Message:
  MMB-1633


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/editor
See also: http://www.mmbase.org/jira/browse/MMB-1633


Index: EditTag.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/editor/EditTag.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- EditTag.java        14 Jul 2007 09:26:49 -0000      1.24
+++ EditTag.java        31 Mar 2008 13:10:47 -0000      1.25
@@ -44,7 +44,7 @@
  *
  * @author André van Toly
  * @author Michiel Meeuwissen
- * @version $Id: EditTag.java,v 1.24 2007/07/14 09:26:49 michiel Exp $
+ * @version $Id: EditTag.java,v 1.25 2008/03/31 13:10:47 michiel Exp $
  * @see Editor
  * @see BasicEditor
  * @see YAMMEditor
@@ -55,6 +55,9 @@
     private static final Logger log = Logging.getLoggerInstance(EditTag.class);
     private static final Map<String, EditorDefinition> edittagTypes = new 
HashMap<String, EditorDefinition>();      // edittagtype -> editordefinition
 
+    public static final String KEY = "org.mmbase.taglib.edit";
+    public static final int SCOPE = PageContext.REQUEST_SCOPE;
+
     static {
         try {
             org.mmbase.util.XMLEntityResolver.registerPublicID("-//MMBase//DTD 
edittagtypes 1.0//EN", "edittagtypes_1_0.dtd", EditTag.class);
@@ -130,6 +133,7 @@
 
     private Attribute type = Attribute.NULL;
 
+    private Object prevEditor = null;
     private Editor editor = null;     // should do all the work
 
     /**
@@ -176,6 +180,7 @@
     public int doStartTag() throws JspTagException {
         if (log.isDebugEnabled()) log.debug("doStartTag of EditTag");
 
+        prevEditor = pageContext.getAttribute(KEY, SCOPE);
 
         EditorDefinition def = edittagTypes.get(getType());
         if (def == null) {
@@ -185,6 +190,7 @@
             log.debug("Using editor: " + def);
         }
         editor = def.newInstance();
+        pageContext.setAttribute(KEY, editor, SCOPE);
 
         return EVAL_BODY;
     }
@@ -203,29 +209,13 @@
         } catch (IOException ioe) {
             log.error("Error writing to PageContext: " + ioe.getMessage(), 
ioe);
         }
+        pageContext.setAttribute(KEY, prevEditor, SCOPE);
         // for gc:
         editor = null;
+        prevEditor = null;
         return super.doEndTag();
     }
 
-    /**
-     * Here is were the FieldTag registers its fields and some associated
-     * and maybe usefull information with the EditTag.
-     *
-     * @param query     SearchQuery object that delivered the field
-     * @param nodenr    int with the number of the node the field belongs to
-     * @param fieldName String with the fieldname
-     */
-    public void registerField(Query query, int nodenr, String fieldName) {
-        if (log.isDebugEnabled()) {
-            log.debug("nodenr: " + nodenr);
-            log.debug("fieldName: " + fieldName);
-            log.debug("query: " + query);
-        }
-        editor.queryList.add(query);
-        editor.nodenrList.add(String.valueOf(nodenr));
-        editor.fieldList.add(fieldName);
-    }
 
 
     // if EVAL_BODY == EVAL_BODY_BUFFERED
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to