You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by ni...@apache.org on 2004/01/23 10:50:15 UTC

cvs commit: xml-forrest/src/core/context/resources/chaperon/misc edit.xml error.css new.xml view.xml wiki.js java.css mathexp.xsp samples.xml

nicolaken    2004/01/23 01:50:15

  Modified:    src/core/context/resources/chaperon/misc java.css
                        mathexp.xsp samples.xml
  Added:       src/core/context/resources/chaperon/misc edit.xml error.css
                        new.xml view.xml wiki.js
  Log:
  Update chaperon block
  
  Revision  Changes    Path
  1.2       +0 -28     xml-forrest/src/core/context/resources/chaperon/misc/java.css
  
  Index: java.css
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/core/context/resources/chaperon/misc/java.css,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- java.css	28 Nov 2003 11:04:29 -0000	1.1
  +++ java.css	23 Jan 2004 09:50:15 -0000	1.2
  @@ -1,31 +1,3 @@
  -BODY {
  -	FONT-FAMILY: verdana, arial, sans-serif
  -}
  -
  -a:link { 
  -  color: #1F354D;
  -  FONT-SIZE: 12px;
  -}
  -
  -a:visited { 
  -  color: #1F354D;
  -  FONT-SIZE: 12px;
  -}
  -
  -a:hover { 
  -  color: #FF5A00;
  -  FONT-SIZE: 12px;
  -}
  -
  -a:active { 
  -  color: #FF5A00;
  -  FONT-SIZE: 12px;
  -}
  -
  -TABLE {
  -	FONT-SIZE: 9px
  -}
  -
   TD.titleText {
   	 BACKGROUND: #eff7ff; PADDING-left: 5px;
   }
  
  
  
  1.2       +2 -4      xml-forrest/src/core/context/resources/chaperon/misc/mathexp.xsp
  
  Index: mathexp.xsp
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/core/context/resources/chaperon/misc/mathexp.xsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mathexp.xsp	28 Nov 2003 11:04:29 -0000	1.1
  +++ mathexp.xsp	23 Jan 2004 09:50:15 -0000	1.2
  @@ -13,10 +13,8 @@
      <row>
       <column title="Mathematical expression">
   
  -     <p>
  -      <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0"><xsp-request:get-parameter name="text" 
  -            default="3*a-5*6/7 + ( b-c)*5- b"/></text>
  -     </p>
  +     <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0" source="" line="1" column="1"><xsp-request:get-parameter name="text" 
  +           default="3*a-5*6/7 + ( b-c)*5- b"/></text>
   
        <p>
         <form action="mathexp.html" method="post">
  
  
  
  1.2       +4 -4      xml-forrest/src/core/context/resources/chaperon/misc/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/core/context/resources/chaperon/misc/samples.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- samples.xml	28 Nov 2003 11:04:29 -0000	1.1
  +++ samples.xml	23 Jan 2004 09:50:15 -0000	1.2
  @@ -12,11 +12,11 @@
    </group>
   
    <group name="Wiki examples">
  -  <sample name="Wiki editor" href="wiki.html">In this example the parser is used
  +  <sample name="Wiki editor" href="view.do?page=index">In this example the parser is used
      to build an online editor,
      which is based on the very popular syntax of Wiki.
     </sample>
  -  <sample name="Wiki self-test" href="wikitest/selftest.html">
  +  <sample name="Wiki self-test" href="view.do?page=selftest">
     	A self-describing document that demonstrates and tests the Wiki grammar.
     </sample>
    </group>
  @@ -28,11 +28,11 @@
    </group>
   
    <group name="Syntax highlighting example">
  -  <sample name="Example 1" href="test/Grammar.java.html">The parser can also
  +  <sample name="Example 1" href="org/apache/cocoon/Cocoon.java.html">The parser can also
      be used to colorize some source code.
     </sample>
   
  -  <sample name="Example 2" href="test/PatternProcessor.class.html">
  +  <sample name="Example 2" href="org/apache/cocoon/Cocoon.class.html">
      This example show a another view of a java class, similar to javadoc.
      (The first use takes 2-3 minutes, for the parser table generation process.)
     </sample>
  
  
  
  1.1                  xml-forrest/src/core/context/resources/chaperon/misc/edit.xml
  
  Index: edit.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
   <header>
    <title>Wiki example</title>
    <tab title="back" href="."/>
   </header>
   <body>
    <row>
     <column title="Wiki content">
   
      <form action="${cocoon.continuation.id}.kont" method="post">
       <textarea name="text" type="textarea" cols="100" rows="23" style="width: 100%">${text}</textarea><br/>
       <input value="Save" type="submit" class="submit"/>
      </form>
  
     </column>
    </row>
   </body>
  </document>
  
  
  
  1.1                  xml-forrest/src/core/context/resources/chaperon/misc/error.css
  
  Index: error.css
  ===================================================================
  pre.error {
    //font-size: 10pt;
    font-size: 120%;
  }
  
  span.lt { 
    background-color: #e5ffe5; 
    margin: 0px; 
    border: 0px; 
    padding: 0px; 
  }
  
  span.eq { 
    background-color: #ff0000; 
    margin: 0px; 
    border: 0px; 
    padding: 0px; 
  }
  
  span.gt { 
    background-color: #ffe5e5; 
    margin: 0px; 
    border: 0px; 
    padding: 0px; 
  }
  
  
  
  
  1.1                  xml-forrest/src/core/context/resources/chaperon/misc/new.xml
  
  Index: new.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
   <header>
    <title>Wiki example</title>
    <tab title="back" href="."/>
   </header>
   <body>
    <row>
     <column title="Wiki content">
   
      <form action="${cocoon.continuation.id}.kont" method="post">
       <textarea name="text" type="textarea" cols="100" rows="23" style="width: 100%"></textarea><br/>
       <input value="Save" type="submit" class="submit"/>
      </form>
  
     </column>
    </row>
   </body>
  </document>
  
  
  
  1.1                  xml-forrest/src/core/context/resources/chaperon/misc/view.xml
  
  Index: view.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
   <header>
    <title>Wiki example</title>
    <tab title="Edit" href="edit.do?page=${page}"/>
    <tab title="back" href="."/>
   </header>
   <body>
    <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0" source="wikitest/${page}.txt" line="1" column="1">${text}</text>
   </body>
  </document>
  
  
  
  1.1                  xml-forrest/src/core/context/resources/chaperon/misc/wiki.js
  
  Index: wiki.js
  ===================================================================
  importPackage(Packages.org.apache.excalibur.source);
  //importPackage(Packages.java.io);
  
  var resolver = cocoon.getComponent(SourceResolver.ROLE);
  
  function view() {
  
      var page = cocoon.request.getParameter("page");
  
      if (page==null)
          page = "index";
  
      var source = null;
  
      var text = "";
  
      if (!exists(page)) {
  
          cocoon.sendPageAndWait("wiki/new.html", {page:page});
  
          text = cocoon.request.getParameter("text");
  
          write(page, text);
      } else {    
          text = read(page);
      }
  
      cocoon.sendPage("wiki/view.html", {page:page, text:text});
  }
  
  function edit() {
  
      var page = cocoon.request.getParameter("page");
  
      if (page==null)
          page = "index";
  
      var text = read(page);
  
      cocoon.sendPageAndWait("wiki/edit.html", {page:page, text:text});
  
      var text = cocoon.request.getParameter("text");
  
      write(page, text);
  
      cocoon.sendPage("wiki/view.html", {page:page, text:text});
  }
  
  
  function read(page) {
  
      var text = "";
      var source = null;                                                                                                                                       
      try {
          source = resolver.resolveURI("wiki/"+page+".txt");
                                                                                                                                                               
          var input = new Packages.java.io.BufferedReader(new Packages.java.io.InputStreamReader(source.getInputStream()));
          var buffer = new Packages.java.lang.StringBuffer();
          var line;
          while (true) {
              line = input.readLine();
              if (line!=null)
                  buffer.append(line+"\n");
              else
                  break;
          }
          text = buffer.toString();
          input.close();
                                                                                                                                                               
      } finally {
          if (source != null) {
              resolver.release(source);
          }
      }
  
      return text;
  }
  
  function write(page, text) {
  
      var source = null;
      try {
          source = resolver.resolveURI("wiki/"+page+".txt");
                                                                                                                                                               
          var out = new Packages.java.io.PrintStream(source.getOutputStream());
          out.print(text);
          out.flush();
          out.close();
                                                                                                                                                               
      } finally {
          if (source != null) {
              resolver.release(source);
          }
      }
  }
  
  function exists(page)  {
  
      var exists = true;
      var source = null;
      try {
          source = resolver.resolveURI("wiki/"+page+".txt");
          exists = source.exists();
      } finally {
          if (source != null) {
              resolver.release(source);
          }
      }
      return exists;
  }