Author: nextgens
Date: 2007-03-15 22:18:57 +0000 (Thu, 15 Mar 2007)
New Revision: 12151

Modified:
   trunk/freenet/src/freenet/pluginmanager/PluginRespirator.java
Log:
Add a few methods to PluginRespirator

Modified: trunk/freenet/src/freenet/pluginmanager/PluginRespirator.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginRespirator.java       
2007-03-15 21:59:00 UTC (rev 12150)
+++ trunk/freenet/src/freenet/pluginmanager/PluginRespirator.java       
2007-03-15 22:18:57 UTC (rev 12151)
@@ -3,18 +3,22 @@
 import java.net.URISyntaxException;

 import freenet.client.HighLevelSimpleClient;
+import freenet.clients.http.PageMaker;
 import freenet.clients.http.filter.FilterCallback;
 import freenet.node.Node;
 import freenet.node.RequestStarter;
+import freenet.support.HTMLNode;
 import freenet.support.URIPreEncoder;

 public class PluginRespirator {
-       private HighLevelSimpleClient hlsc = null;
-       private Node node;
+       private final HighLevelSimpleClient hlsc;
+       private final Node node;
+       private final PageMaker pageMaker;

        public PluginRespirator(Node node, PluginManager pm) {
                this.node = node;
                this.hlsc = 
node.clientCore.makeClient(RequestStarter.INTERACTIVE_PRIORITY_CLASS);
+               this.pageMaker = new PageMaker("clean");
        }

        //public HighLevelSimpleClient getHLSimpleClient() throws 
PluginSecurityException {
@@ -33,4 +37,18 @@
                        throw new Error(e);
                }
        }
+       
+       public PageMaker getPageMaker(){
+               return pageMaker;
+       }
+       
+       public HTMLNode addFormChild(HTMLNode parentNode, String target, String 
name) {
+               HTMLNode formNode =
+                       parentNode.addChild("form", new String[] { "action", 
"method", "enctype", "id", "name", "accept-charset" }, 
+                                       new String[] { target, "post", 
"multipart/form-data", name, name, "utf-8"} );
+               formNode.addChild("input", new String[] { "type", "name", 
"value" }, 
+                               new String[] { "hidden", "formPassword", 
node.clientCore.formPassword });
+               
+               return formNode;
+       }
 }


Reply via email to