1 14 15 package webEditor.interfaces; 16 17 import java.io.*; 18 import java.lang.reflect.*; 19 20 import javax.servlet.*; 21 import javax.servlet.http.*; 22 import org.w3c.dom.*; 23 24 import webEditor.core.*; 25 26 30 31 public class presentationMode { 32 33 36 private configuration initValues; 37 38 41 private presentation myEditor= null; 42 43 46 private article myDocument= null; 47 48 52 public presentationMode (configuration initParam) { 53 this.initValues = initParam; 56 } 57 58 64 public void presentation (HttpServletRequest request, PrintWriter out) 65 throws ServletException, 66 IOException { 67 68 this.myEditor = new presentation (this.initValues); 69 this.myDocument = new article (this.initValues); 70 71 String opCode = this.initValues.readValue ("HTTP Parameters", "code"); 72 if (opCode == null) { 73 opCode = "showDoc"; 75 } 76 77 try { 78 Method m = getClass().getMethod(opCode, new Class [] {PrintWriter.class} ); 80 m.invoke(this,new Object [] {out} ); 81 } 82 catch (Exception e) { 83 out.println ("Code not supported"); 84 } 85 } 86 87 91 public void showDoc (PrintWriter out) 92 throws ServletException, IOException 93 { 94 String outputString = null; 95 String docID = this.initValues.readValue ("HTTP Parameters", "docID"); 96 if (docID != null) { 97 Document doc = this.myDocument.docRead (docID); 98 outputString = this.myEditor.showDoc (doc, "show"); 99 } 100 out.println (outputString); 101 } 102 103 } 104 | Popular Tags |