Add predefined Velocity and CSS template if wiki builder is assigned to a project
authoraxelcl <axelcl>
Wed, 15 Dec 2004 20:44:40 +0000 (20:44 +0000)
committeraxelcl <axelcl>
Wed, 15 Dec 2004 20:44:40 +0000 (20:44 +0000)
21 files changed:
archive/net.sourceforge.phpeclipse.wiki/.classpath
archive/net.sourceforge.phpeclipse.wiki/about.html [new file with mode: 0644]
archive/net.sourceforge.phpeclipse.wiki/cpl-v10.html [new file with mode: 0644]
archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar
archive/net.sourceforge.phpeclipse.wiki/plugin.xml
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/NewPostBlogHTMLAction.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/AddBuilderAction.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/CreatePageAction.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/export.vm [new file with mode: 0644]
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/main.css [moved from archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/main.css with 82% similarity]
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/main.vm [new file with mode: 0644]
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorContributor.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorPlugin.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/action/WeblogWikiAction.java [deleted file]
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/WikiExporter.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Messages.properties
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Util.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/WikiProjectPreferences.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/AbstractContentRenderer.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/IContentRenderer.java
archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/WikipediaContentRenderer.java

index 8f4f2e9..88cef53 100644 (file)
@@ -1,13 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="src/"/>
        <classpathentry kind="lib" path="lib/xmlrpc-1.1.jar"/>
-       <classpathentry sourcepath="/radeox.cvs/src" kind="lib" path="lib/radeox.jar"/>
+       <classpathentry kind="lib" path="lib/radeox.jar"/>
        <classpathentry kind="lib" path="lib/commons-logging.jar"/>
        <classpathentry kind="lib" path="lib/commons-httpclient-2.0.2.jar"/>
        <classpathentry kind="lib" path="lib/java2html_4.1.jar"/>
+       <classpathentry kind="lib" path="lib/plog4u.jar"/>
+       <classpathentry kind="lib" path="lib/velocity-dep-1.4.jar"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="lib" path="lib/plog4u.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/archive/net.sourceforge.phpeclipse.wiki/about.html b/archive/net.sourceforge.phpeclipse.wiki/about.html
new file mode 100644 (file)
index 0000000..e992790
--- /dev/null
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<h3>License</h3>
+<p>PHPeclipse.de makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Common Public License Version 1.0 (&quot;CPL&quot;).  A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
+For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Third Party Content</h3>
+
+<p>The Content includes items that have been sourced from third parties as follows:</p>
+
+<p><b>radeox</b></p>
+
+<p>The plug-in includes software developed by SnipSnap Radeox.  Therefore:</p>
+
+<blockquote>
+This product includes software developed by the (<a href="http://www.radeox.org/">http://www.radeox.org/</a>).
+</blockquote>
+
+<blockquote>Copyright (c) 2000-2003 Matthias L. Jugel, Stephan J. Schmidt. All rights reserved.</blockquote>
+
+<p><b>xmlrpc commons-logging commons-httpclient velocity</b></p>
+
+<p>The plug-in includes software developed by The Apache Software Foundation as part of the Jakarta project.  Therefore:</p>
+
+<blockquote>
+This product includes software developed by the Apache Software Foundation (<a href="http://www.apache.org/">http://www.apache.org/</a>).
+</blockquote>
+
+<blockquote>Copyright (c) 2001 The Apache Software Foundation. All rights reserved.</blockquote>
+
+<p>Your use of the Lucene and HTML Parser code is subject to the terms and conditions of the Apache Software License 1.1 which is available at
+<a href="http://jakarta.apache.org/LICENSE">http://jakarta.apache.org/LICENSE</a>.
+More specifically:</p>
+<blockquote>
+       1. Redistributions of source code must retain the above copyright notice, this list of<br>
+       conditions and the following disclaimer.<br>
+<br>
+       2. Redistributions in binary form must reproduce the above copyright notice, this list of<br>
+       conditions and the following disclaimer in the documentation and/or other materials<br>
+       provided with the distribution.<br>
+<br>
+       3. The end-user documentation included with the redistribution, if any, must include the<br>
+       following acknowledgment:<br>
+       <blockquote>
+               &quot;This product includes software developed by the Apache Software Foundation<br>
+               (<a href="http://www.apache.org/">http://www.apache.org/</a>).&quot;
+       </blockquote>
+       Alternately, this acknowledgment may appear in the software itself, if and wherever such<br>
+       third-party acknowledgments normally appear.<br>
+<br>
+       4. The names &quot;The Jakarta Project&quot; and &quot;Apache Software Foundation&quot;<br>
+       must not be used to endorse or  promote products derived from this software without prior<br>
+       written permission. For written permission, please contact <a href="mailto:apache@apache.org">apache@apache.org</a>.<br>
+<br>
+       5. Products derived from this software may not be called &quot;Apache&quot;, nor may &quot;Apache&quot; appear<br>
+       in their name, without prior written permission of the Apache Software Foundation.<br>
+<br>
+       THIS SOFTWARE IS PROVIDED &quot;AS IS&quot; AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT<br>
+       LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR<br>
+       PURPOSE ARE     DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS<br>
+       CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR<br>
+       SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON<br>
+       ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING<br>
+       NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF<br>
+       ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+</blockquote>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
+made available to PHPeclipse.de, members of PHPeclipse.de and/or the host of PHPeclipse.de web site, by you that relate to such
+Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
+<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to PHPeclipse.de, members of PHPeclipse.de and/or the
+host of PHPeclipse.de, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License.  In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
+the CPL.</p>
+
+</body>
+</html>
diff --git a/archive/net.sourceforge.phpeclipse.wiki/cpl-v10.html b/archive/net.sourceforge.phpeclipse.wiki/cpl-v10.html
new file mode 100644 (file)
index 0000000..36aa208
--- /dev/null
@@ -0,0 +1,125 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+<HEAD>
+<TITLE>Common Public License - v 1.0</TITLE>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+
+<BODY BGCOLOR="#FFFFFF" VLINK="#800000">
+
+
+<P ALIGN="CENTER"><B>Common Public License - v 1.0</B>
+<P><B></B><FONT SIZE="3"></FONT>
+<P><FONT SIZE="3"></FONT><FONT SIZE="2">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT").  ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.</FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"><B>1.  DEFINITIONS</B></FONT>
+<P><FONT SIZE="2">"Contribution" means:</FONT>
+
+<UL><FONT SIZE="2">a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and<BR CLEAR="LEFT">
+b) in the case of each subsequent Contributor:</FONT></UL>
+
+
+<UL><FONT SIZE="2">i)          changes to the Program, and</FONT></UL>
+
+
+<UL><FONT SIZE="2">ii)         additions to the Program;</FONT></UL>
+
+
+<UL><FONT SIZE="2">where such changes and/or additions to the Program originate from and are distributed by that particular Contributor.  </FONT><FONT SIZE="2">A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf.  </FONT><FONT SIZE="2">Contributions do not include additions to the Program which:  (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.  </FONT></UL>
+
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2">"Contributor" means any person or entity that distributes the Program.</FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2">"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.  </FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2">"Program" means the Contributions distributed in accordance with this Agreement.</FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2">"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.</FONT>
+<P><FONT SIZE="2"><B></B></FONT>
+<P><FONT SIZE="2"><B>2.  GRANT OF RIGHTS</B></FONT>
+
+<UL><FONT SIZE="2"></FONT><FONT SIZE="2">a)    </FONT><FONT SIZE="2">Subject to the terms of this Agreement, each Contributor hereby grants</FONT><FONT SIZE="2"> Recipient a non-exclusive, worldwide, royalty-free copyright license to</FONT><FONT SIZE="2" COLOR="#FF0000"> </FONT><FONT SIZE="2">reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.</FONT></UL>
+
+
+<UL><FONT SIZE="2"></FONT></UL>
+
+
+<UL><FONT SIZE="2"></FONT><FONT SIZE="2">b)    Subject to the terms of this Agreement, each Contributor hereby grants </FONT><FONT SIZE="2">Recipient a non-exclusive, worldwide,</FONT><FONT SIZE="2" COLOR="#008000"> </FONT><FONT SIZE="2">royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form.  This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents.  The patent license shall not apply to any other combinations which include the Contribution.  No hardware per se is licensed hereunder.   </FONT></UL>
+
+
+<UL><FONT SIZE="2"></FONT></UL>
+
+
+<UL><FONT SIZE="2">c)  Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity.  Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise.  As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any.  For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.</FONT></UL>
+
+
+<UL><FONT SIZE="2"></FONT></UL>
+
+
+<UL><FONT SIZE="2">d)  Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. </FONT></UL>
+
+
+<UL><FONT SIZE="2"></FONT></UL>
+
+<P><FONT SIZE="2"><B>3.  REQUIREMENTS</B></FONT>
+<P><FONT SIZE="2"><B></B>A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:</FONT>
+
+<UL><FONT SIZE="2">a)  it complies with the terms and conditions of this Agreement; and</FONT></UL>
+
+
+<UL><FONT SIZE="2">b)  its license agreement:</FONT></UL>
+
+
+<UL><FONT SIZE="2">i)  effectively disclaims</FONT><FONT SIZE="2"> on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; </FONT></UL>
+
+
+<UL><FONT SIZE="2">ii)         effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; </FONT></UL>
+
+
+<UL><FONT SIZE="2">iii)</FONT><FONT SIZE="2">  states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and</FONT></UL>
+
+
+<UL><FONT SIZE="2">iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.</FONT><FONT SIZE="2" COLOR="#0000FF"> </FONT><FONT SIZE="2" COLOR="#FF0000"></FONT></UL>
+
+
+<UL><FONT SIZE="2" COLOR="#FF0000"></FONT><FONT SIZE="2"></FONT></UL>
+
+<P><FONT SIZE="2">When the Program is made available in source code form:</FONT>
+
+<UL><FONT SIZE="2">a)  it must be made available under this Agreement; and </FONT></UL>
+
+
+<UL><FONT SIZE="2">b)  a copy of this Agreement must be included with each copy of the Program.  </FONT></UL>
+
+<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT>
+<P><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT><FONT SIZE="2">Contributors may not remove or alter any copyright notices contained within the Program.  </FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2">Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.  </FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"><B>4.  COMMERCIAL DISTRIBUTION</B></FONT>
+<P><FONT SIZE="2">Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like.  While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors.   Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering.  The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement.  In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations.  The Indemnified Contributor may participate in any such claim at its own expense.</FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2">For example, a Contributor might include the Program in a commercial product offering, Product X.  That Contributor is then a Commercial Contributor.  If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone.  Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.</FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"></FONT>
+<P><FONT SIZE="2" COLOR="#0000FF"></FONT><FONT SIZE="2"><B>5.  NO WARRANTY</B></FONT>
+<P><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is</FONT><FONT SIZE="2"> solely responsible for determining the appropriateness of using and distributing </FONT><FONT SIZE="2">the Program</FONT><FONT SIZE="2"> and assumes all risks associated with its exercise of rights under this Agreement</FONT><FONT SIZE="2">, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, </FONT><FONT SIZE="2">programs or equipment, and unavailability or interruption of operations</FONT><FONT SIZE="2">.  </FONT><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2"><B>6.  DISCLAIMER OF LIABILITY</B></FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES </FONT><FONT SIZE="2">(INCLUDING WITHOUT LIMITATION LOST PROFITS),</FONT><FONT SIZE="2"> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"><B>7.  GENERAL</B></FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2">If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.</FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2">If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed.  In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. </FONT><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2">All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance.  If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable.  However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.  </FONT><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2">Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted  and may only be modified in the following manner. The Agreement Steward reserves the right to </FONT><FONT SIZE="2">publish new versions (including revisions) of this Agreement from time to </FONT><FONT SIZE="2">time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward.   IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity.  </FONT><FONT SIZE="2">Each new version of the Agreement will be given a distinguishing version number.  The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new </FONT><FONT SIZE="2">version.  </FONT><FONT SIZE="2">Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, </FONT><FONT SIZE="2">by implication, estoppel or otherwise</FONT><FONT SIZE="2">.</FONT><FONT SIZE="2">  All rights in the Program not expressly granted under this Agreement are reserved.</FONT>
+<P><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2">This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose.  Each party waives its rights to a jury trial in any resulting litigation.</FONT>
+<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT>
+<P><FONT SIZE="2"></FONT>
+
+</BODY>
+
+</HTML>
\ No newline at end of file
index abe7273..315e213 100644 (file)
Binary files a/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar and b/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar differ
index de70df9..a5e770e 100644 (file)
                menubarPath="additions"
                id="net.sourceforge.phpeclipse.wiki.actions.OpenWikiLinkEditorAction">
          </action>
-         <action
+ <!--        <action
                label="Post to pLog4U.de"
                class="net.sourceforge.phpeclipse.wiki.actions.NewPostBlogEditorAction"
                menubarPath="additions"
                id="net.sourceforge.phpeclipse.wiki.actions.NewPostBlogEditorAction">
-         </action>
+         </action>  -->
       </viewerContribution>
       
       <viewerContribution
index 510eba4..fc3f721 100644 (file)
@@ -61,7 +61,7 @@ public final class NewPostBlogHTMLAction implements IEditorActionDelegate {
         IFile file = ei.getFile();
         IContentRenderer renderer = RendererFactory.createContentRenderer(file.getProject());
         StringBuffer htmlBuffer = new StringBuffer();
-        CreatePageAction.convertWikiBuffer(htmlBuffer, file, renderer, false);
+        CreatePageAction.convertWikiBuffer(null, htmlBuffer, file, renderer, false);
 
         String[] result = new String[2];
         boolean cache = config.promptForPassword(config.getUser(), "Insert Config", true, result);
index ef06dc8..e615b20 100644 (file)
@@ -1,14 +1,20 @@
 package net.sourceforge.phpeclipse.wiki.builder;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 import java.util.Iterator;
 
 import net.sourceforge.phpeclipse.wiki.preferences.Util;
 
 import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IProjectDescription;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
@@ -96,9 +102,18 @@ public class AddBuilderAction implements IObjectActionDelegate {
         // add some default wiki project settings
         Util.setWikiTextsPath(project);
 
+        createVelocityFile(project, "main.vm");
+        createVelocityFile(project, "export.vm");
+        createVelocityFile(project, "main.css");
       }
     } catch (CoreException e) {
       e.printStackTrace();
     }
   }
+
+  private void createVelocityFile(IProject project, String filename) throws CoreException {
+    InputStream is = AddBuilderAction.class.getResourceAsStream(filename);
+    final IFile file = project.getFile(new Path("wpsrc/" + filename));
+    file.create(is, true, null);
+  }
 }
\ No newline at end of file
index 9fc589c..c1590a8 100644 (file)
@@ -88,17 +88,18 @@ public class CreatePageAction implements IObjectActionDelegate {
   }
 
   public static void createPage(IFile file) {
+    String templateFileName = Util.getLocalTemplate(file);
     String srcBasePath = Util.getWikiTextsPath(file);
     String binBasePath = Util.getProjectsWikiOutputPath(file.getProject(), WikiEditorPlugin.HTML_OUTPUT_PATH);
-    createPage(file, binBasePath, srcBasePath);
+    createPage(templateFileName, file, binBasePath, srcBasePath);
   }
 
-  public static void createPage(IFile file, String binBasepath, String srcBasePath) {
+  public static void createPage(String templateFileName, IFile file, String binBasepath, String srcBasePath) {
     //         only interested in files with the "wp" extension
     if ("wp".equalsIgnoreCase(file.getFileExtension())) {
       try {
         IContentRenderer renderer = RendererFactory.createContentRenderer(file.getProject());
-        convertWikiFile(file, binBasepath, srcBasePath, renderer);
+        convertWikiFile(templateFileName, file, binBasepath, srcBasePath, renderer);
       } catch (InstantiationException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
@@ -159,10 +160,10 @@ public class CreatePageAction implements IObjectActionDelegate {
     }
   }
 
-  public static void convertWikiFile(IFile file, String binBasePath, String srcBasePath, IContentRenderer renderer)
+  public static void convertWikiFile(String templateFileName, IFile file, String binBasePath, String srcBasePath, IContentRenderer renderer)
       throws CoreException {
     StringBuffer htmlBuffer = new StringBuffer();
-    convertWikiBuffer(htmlBuffer, file, renderer, true);
+    convertWikiBuffer(templateFileName, htmlBuffer, file, renderer, true);
     String htmlName = Util.getHTMLFileName(file, binBasePath, srcBasePath);
     if (htmlName != null) {
       writeHTMLFile(htmlBuffer, htmlName);
@@ -188,7 +189,7 @@ public class CreatePageAction implements IObjectActionDelegate {
     return;
   }
 
-  public static void convertWikiBuffer(StringBuffer htmlBuffer, IFile file, IContentRenderer renderer, boolean completeHTML)
+  public static void convertWikiBuffer(String templateFileName, StringBuffer htmlBuffer, IFile file, IContentRenderer renderer, boolean completeHTML)
       throws CoreException {
     BufferedInputStream stream = new BufferedInputStream(file.getContents());
     try {
@@ -198,7 +199,7 @@ public class CreatePageAction implements IObjectActionDelegate {
       if (filePath.startsWith(srcPath)) {
         filePath = filePath.substring(srcPath.length()+1);
       }
-      createWikiBuffer(htmlBuffer, filePath, content, renderer, completeHTML);
+      createWikiBuffer(templateFileName, htmlBuffer, filePath, content, renderer, completeHTML);
     } catch (IOException e) {
       e.printStackTrace();
     } finally {
@@ -217,7 +218,7 @@ public class CreatePageAction implements IObjectActionDelegate {
    * @param content
    * @param renderer
    */
-  public static void createWikiBuffer(StringBuffer htmlBuffer, String fileName, String content, IContentRenderer renderer,
+  public static void createWikiBuffer(String templateFileName, StringBuffer htmlBuffer, String fileName, String content, IContentRenderer renderer,
       boolean completeHTML) {
     // calculate the <i>depth</i> of the file (i.e. ../../../ as much as needed)
     int index = 0;
@@ -229,7 +230,7 @@ public class CreatePageAction implements IObjectActionDelegate {
         index++;
       }
     }
-    renderer.render(content, htmlBuffer, level, completeHTML);
+    renderer.render(templateFileName, content, htmlBuffer, level, completeHTML);
   }
 
   public static void writeHTMLFile(StringBuffer buffer, String filename) {
diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/export.vm b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/export.vm
new file mode 100644 (file)
index 0000000..9ca51b9
--- /dev/null
@@ -0,0 +1,18 @@
+<html>\r
+<head>\r
+<link rel="STYLESHEET" type="text/css" href="file://C:\eclipse3\runtime-workbench-workspace\wikibook\wpsrc\main.css" />\r
+</head>\r
+<body class="ns-0">\r
+<div id="column-content">\r
+<div id="content">\r
+<div id="bodyContent">\r
+<div id="contentSub">\r
+\r
+$content  \r
+\r
+</div> \r
+</div>\r
+</div>\r
+</div>\r
+</body>\r
+</html>
\ No newline at end of file
@@ -25,6 +25,7 @@
     position: relative;\r
     z-index: 2;\r
 }\r
+\r
 #column-one { padding-top: 160px; }\r
 /* the left column width is specified in class .portlet */\r
 \r
@@ -36,7 +37,7 @@
 \r
 body {\r
     font: x-small sans-serif;\r
-    background: #f9f9f9 url("headbg.jpg") 0px 0px no-repeat;\r
+    background: #f9f9f9;\r
     color: Black;\r
     margin: 0;\r
     padding: 0;\r
@@ -905,4 +906,134 @@ fieldset.operaprefsection { margin-left: 15em }
 \r
 .sharedUploadNotice {\r
         font-style: italic;\r
-}
\ No newline at end of file
+}\r
+\r
+ /*Großbuchstaben in den Navigationsbereichen*/\r
+ .portlet h5,.portlet h6,#p-personal ul,#p-cactions li a{text-transform:none;}\r
+\r
+ /*Personennamen in Kapitälchen: <font class="Person">Name</font>*/\r
+ .Person{display:inline;font-variant:small-caps}\r
+\r
+ /*Ausschalten der foundraising-Nachricht*/\r
+\r
+ /*fetter bearbeiten-link*/\r
+ #ca-edit a{font-weight:bold !important;}\r
+\r
+ /*sitenotice*/\r
+ /*#siteNotice{font-size: x-small}*/\r
+\r
+ /* Make all non-namespace pages have a light blue content area. This is done by\r
+    setting the background color for all #content areas to light blue and then\r
+    overriding it for any #content enclosed in a .ns-0 (main namespace). I then\r
+    do the same for the "tab" background colors. --Lupo */\r
+\r
+ #content, #mytabs li.selected a, #p-cactions li.selected a {\r
+    background-color: #F3F3FF; /* ein leichtes blau */\r
+ }\r
+\r
+ .ns-0 #content, .ns-0 #mytabs li.selected a,  .ns-0 #p-cactions li.selected a {\r
+    background-color: white;\r
+ }\r
+\r
+ .ns--1 table, .ns-2 table, .ns-4 table, .ns--1 form { \r
+    background: inherit;\r
+  }\r
+  \r
+ /* Categorien etwas schöner darstellen */\r
+ #catlinks {\r
+   border: 0px;\r
+   border-top: 2px dotted #aaaaaa;\r
+ }\r
\r
+ /* Metadaten */\r
+ table.metadata {\r
+   border:1px solid #AAA;\r
+   /* display:none; // ausschalten */\r
+ }\r
+ .metadata-label {\r
+   color:#AAA;\r
+ }\r
+  \r
+\r
\r
+ /*SideBox analog Townbox*/\r
+\r
+ div.sideBox {\r
+    position:relative;\r
+    float:right;\r
+    background:White;\r
+    margin-left:1em;\r
+    border: 1px solid Grey;\r
+\r
+    padding:0.3em;\r
+    width: 200px;\r
+    overflow: hidden;\r
+    clear: right;\r
+ }\r
+ div.sideBox dl {\r
+    padding: 0;\r
+    margin: 0 0 0.3em 0; \r
+    font-size: 96%;\r
+ }\r
+ div.sideBox dl dt {\r
+    background: none;\r
+    margin: 0.4em 0 0 0;\r
+ }\r
+ div.sideBox dl dd {\r
+    margin: 0.1em 0 0 1.1em;\r
+    background-color: #f3f3f3;\r
+ }\r
+\r
+ /* Standard Navigationsleisten */\r
\r
+ div.BoxenVerschmelzen, div.NavFrame {\r
+     margin:0px;\r
+     padding:2px;\r
+     border:1px solid #AAAAAA;\r
+     text-align:center;\r
+     border-collapse:collapse;\r
+     font-size:95%;\r
+ }\r
+ div.BoxenVerschmelzen div.NavFrame {\r
+     border-style:none;\r
+     border-style:hidden;\r
+ }\r
+ div.NavFrame + div.NavFrame {\r
+     border-top-style:none;\r
+     border-top-style:hidden;\r
+ }\r
+ div.NavPic {\r
+     background-color:#FFFFFF;\r
+     margin:0px;\r
+     padding:2px;\r
+     float:left;\r
+ }\r
+ div.NavFrame div.NavHead {\r
+     height:1.6em;\r
+     font-weight:bold;\r
+     font-size:100%;\r
+     background-color:#EFEFEF;\r
+ }\r
+ div.NavFrame p {\r
+     font-size:100%;\r
+ }\r
+ div.NavFrame div.NavContent {\r
+     font-size:100%;\r
+ }\r
+ div.NavFrame div.NavContent p {\r
+     font-size:100%;\r
+ }\r
+ div.NavEnd {\r
+     margin:0px;\r
+     padding:0px;\r
+     line-height:1px;\r
+     clear:both;\r
+ }\r
\r
+  /* Do not print navigation bar elements. They should not appear on paper */\r
+ @media print{\r
+    .NavFrame { display:none; }\r
+    .BoxenVerschmelzen { display:none; }\r
+ }\r
\r
+ caption { font-size: 105%; font-weight: bold; }
\ No newline at end of file
diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/main.vm b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/main.vm
new file mode 100644 (file)
index 0000000..9ca51b9
--- /dev/null
@@ -0,0 +1,18 @@
+<html>\r
+<head>\r
+<link rel="STYLESHEET" type="text/css" href="file://C:\eclipse3\runtime-workbench-workspace\wikibook\wpsrc\main.css" />\r
+</head>\r
+<body class="ns-0">\r
+<div id="column-content">\r
+<div id="content">\r
+<div id="bodyContent">\r
+<div id="contentSub">\r
+\r
+$content  \r
+\r
+</div> \r
+</div>\r
+</div>\r
+</div>\r
+</body>\r
+</html>
\ No newline at end of file
index f3d93c9..29edcb1 100644 (file)
@@ -9,12 +9,10 @@
 package net.sourceforge.phpeclipse.wiki.editor;
 
 import net.sourceforge.phpeclipse.webbrowser.views.BrowserView;
-import net.sourceforge.phpeclipse.wiki.editor.action.WeblogWikiAction;
 import net.sourceforge.phpeclipse.wiki.preferences.Util;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
index b67d095..b49e15f 100644 (file)
@@ -53,6 +53,10 @@ public class WikiEditorPlugin extends AbstractUIPlugin {
   public final static String HTML_OUTPUT_PATH = "__static_wiki_folder";
 
   public final static String WIKI_TEXTS_BASE_PATH = "__wiki_texts_base_path";
+  
+  public final static String LOCAL_TEMPLATE_FILE_NAME = "__local_template_file_name";
+  public final static String EXPORT_TEMPLATE_FILE_NAME = "__export_template_file_name";
+  
   public final static String  PREF_STRING_CONFIGURATIONS ="configurations";
   public final static String CONFIG_MEMENTO = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
                "<configurations>"+
diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/action/WeblogWikiAction.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/action/WeblogWikiAction.java
deleted file mode 100644 (file)
index db7c908..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package net.sourceforge.phpeclipse.wiki.editor.action;
-
-import net.sourceforge.phpeclipse.wiki.editor.WikiEditor;
-import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
-
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-
-
-public class WeblogWikiAction extends TextEditorAction {
-               
-       private boolean fForward;
-       
-       public WeblogWikiAction(String prefix, boolean forward) {
-               super(WikiEditorPlugin.getDefault().getResourceBundle(), prefix, null);
-       }
-       
-       public void run() {
-
-       }
-       
-       public void setEditor(ITextEditor editor) {
-               if (editor instanceof WikiEditor) 
-                       super.setEditor(editor);
-               update();
-       }
-       
-       public void update() {
-               setEnabled(getTextEditor() instanceof WikiEditor);
-       }
-}
index 1463a25..998bdc7 100644 (file)
@@ -12,6 +12,7 @@ import java.util.TreeSet;
 
 import net.sourceforge.phpeclipse.wiki.builder.CreatePageAction;
 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
+import net.sourceforge.phpeclipse.wiki.preferences.Util;
 
 import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
@@ -45,11 +46,12 @@ public final class WikiExporter {
       InstantiationException, IllegalAccessException, ClassNotFoundException {
     //    exportDirectory = new File(exportDirectoryName);
     IResource[] resources = folder.members(IResource.FILE);
+    String templateFileName = Util.getExportTemplate(folder);
 //    monitor.beginTask(WikiEditorPlugin.getResourceString("Export.wikiPages"), resources.length + 1);
     for (int i = 0; i < resources.length; i++) {
       if (resources[i] instanceof IFile) {
         monitor.subTask(WikiEditorPlugin.getResourceString("Export.exportFile")+resources[i].getLocation());
-        CreatePageAction.createPage((IFile) resources[i], exportDirectoryName, srcBasePath);
+        CreatePageAction.createPage(templateFileName, (IFile) resources[i], exportDirectoryName, srcBasePath);
         monitor.worked(1);
       } else if (resources[i] instanceof IFolder) {
         monitor.subTask(WikiEditorPlugin.getResourceString("Export.exportFolder")+resources[i].getLocation());
index 5598a72..273da4f 100644 (file)
@@ -1,6 +1,8 @@
 WikiProjectPreferences.StaticWikiFolder=Projects Wikipedia to HTML output path:  
 WikiProjectPreferences.WikiTextsFolder=Projects associated Wikipedia texts path: 
+WikiProjectPreferences.LocalTemplateFile=Preview renderer template file name: 
+WikiProjectPreferences.ExportTemplateFile=Export template file name: 
+
 OverlayPage.Use_Workspace_Settings=Use &workspace settings
 OverlayPage.Use_Project_Settings=Use pr&oject settings
 OverlayPage.Use_File_Settings=Use &file settings
index 4d154f7..b8d41f4 100644 (file)
@@ -116,16 +116,19 @@ public class Util {
     String globalBasePath = store.getString(WikiEditorPlugin.WIKI_TEXTS_BASE_PATH);
     if (globalBasePath == null || globalBasePath.equals("")) {
       store.setValue(WikiEditorPlugin.WIKI_TEXTS_BASE_PATH, value + "/wpsrc");
+      store.setValue(WikiEditorPlugin.LOCAL_TEMPLATE_FILE_NAME, value + "/wpsrc/main.vm");
+      store.setValue(WikiEditorPlugin.EXPORT_TEMPLATE_FILE_NAME, value + "/wpsrc/export.vm");
     }
     String htmlFolder = store.getString(WikiEditorPlugin.HTML_OUTPUT_PATH);
-    if (htmlFolder == null || htmlFolder.equals("")) {
-      // set a global default
+    if (htmlFolder == null || htmlFolder.equals("")) {  
+      // set a global default 
       store.setValue(WikiEditorPlugin.HTML_OUTPUT_PATH, value + "/wpbin");
     }
     setProperty(project, WikiProjectPreferences.PREF_ID, FieldEditorOverlayPage.USEPROJECTSETTINGS, "true");
     setProperty(project, WikiProjectPreferences.PREF_ID, WikiEditorPlugin.WIKI_TEXTS_BASE_PATH, value + "/wpsrc");
     setProperty(project, WikiProjectPreferences.PREF_ID, WikiEditorPlugin.HTML_OUTPUT_PATH, value + "/wpbin");
-
+    setProperty(project, WikiProjectPreferences.PREF_ID, WikiEditorPlugin.LOCAL_TEMPLATE_FILE_NAME, value + "/wpsrc/main.vm");
+    setProperty(project, WikiProjectPreferences.PREF_ID, WikiEditorPlugin.EXPORT_TEMPLATE_FILE_NAME, value + "/wpsrc/export.vm");
     //    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
     //    IResource resource = root.findMember(project.getLocation());
     NullProgressMonitor _monitor = new NullProgressMonitor();
@@ -153,6 +156,14 @@ public class Util {
     return Util.getPreferenceValue(file.getProject(), WikiEditorPlugin.WIKI_TEXTS_BASE_PATH);
   }
 
+  public static String getLocalTemplate(IResource file) {
+    return Util.getPreferenceValue(file.getProject(), WikiEditorPlugin.LOCAL_TEMPLATE_FILE_NAME);
+  }
+  
+  public static String getExportTemplate(IResource file) {
+    return Util.getPreferenceValue(file.getProject(), WikiEditorPlugin.EXPORT_TEMPLATE_FILE_NAME);
+  }
+  
   public static String getProjectsWikiTextsPath(IProject project) {
     return Util.getPreferenceValue(project, WikiEditorPlugin.WIKI_TEXTS_BASE_PATH);
   }
index 3ce415c..fd11f1b 100644 (file)
@@ -3,8 +3,8 @@ package net.sourceforge.phpeclipse.wiki.preferences;
 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
 
 import org.eclipse.jface.preference.DirectoryFieldEditor;
+import org.eclipse.jface.preference.FileFieldEditor;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PathEditor;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -35,7 +35,10 @@ public class WikiProjectPreferences extends FieldEditorOverlayPage implements IW
 
     addField(new DirectoryFieldEditor(WikiEditorPlugin.HTML_OUTPUT_PATH, Messages.getString("WikiProjectPreferences.StaticWikiFolder"), composite));
     addField(new DirectoryFieldEditor(WikiEditorPlugin.WIKI_TEXTS_BASE_PATH, Messages.getString("WikiProjectPreferences.WikiTextsFolder"), composite));
-  }
+    addField(new FileFieldEditor(WikiEditorPlugin.LOCAL_TEMPLATE_FILE_NAME, Messages.getString("WikiProjectPreferences.LocalTemplateFile"), composite));
+    addField(new FileFieldEditor(WikiEditorPlugin.EXPORT_TEMPLATE_FILE_NAME, Messages.getString("WikiProjectPreferences.ExportTemplateFile"), composite));  
+  
+    }
 
   /*
    * (non-Javadoc)
index 4c86952..88f36b1 100644 (file)
@@ -1,15 +1,11 @@
 package net.sourceforge.phpeclipse.wiki.renderer;
 
 import java.io.IOException;
-import java.util.StringTokenizer;
 
 import net.sourceforge.phpeclipse.wiki.editor.WikiEditor;
 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
-import net.sourceforge.phpeclipse.wiki.preferences.Util;
 
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 
@@ -122,8 +118,8 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
 
   protected abstract void initialise();
 
-  protected void appendHeader() throws IOException {
-    buffer.append("<html><head>");
+  protected void appendHeader(StringBuffer buf) throws IOException {
+    buf.append("<html><head>");
     //    String basePath = Util.getMiscProjectsPreferenceValue(fProject, WikiConstants.HTML_OUTPUT_PATH);
     //    buffer.append("<base href=\"" + basePath + "/" + fProject.getName() + "\"/>");
 
@@ -134,7 +130,7 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
     //    }
     //    appendStyle();
 
-    buffer.append("</head><body>\n");
+    buf.append("</head><body>\n");
   }
 
   private void appendContents() {
@@ -174,8 +170,8 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
     return lineNumber < editor.getDocument().getNumberOfLines();
   }
 
-  protected void appendFooter() {
-    buffer.append("\n</body></html>");
+  protected void appendFooter(StringBuffer buf) {
+    buf.append("\n</body></html>");
   }
 
   //  protected void appendStyle() throws IOException {
@@ -321,7 +317,7 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
 
   protected abstract boolean isHeader(String line);
 
-  protected abstract void appendHeader(String line);
+//  protected abstract void appendHeader(String line);
 
   protected abstract boolean isList(String line);
 
@@ -402,15 +398,15 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
     return "<table>";
   }
 
-  public void forEachHeader(IDocument document, StructureClosure closure) throws BadLocationException {
-    for (int i = 0; i < document.getNumberOfLines(); i++) {
-      String line = getLine(document, i);
-      if (isHeader(line)) {
-        String header = getHeaderText(line);
-        closure.acceptHeader(header, document.getLineOffset(i));
-      }
-    }
-  }
+//  public void forEachHeader(IDocument document, StructureClosure closure) throws BadLocationException {
+//    for (int i = 0; i < document.getNumberOfLines(); i++) {
+//      String line = getLine(document, i);
+//      if (isHeader(line)) {
+//        String header = getHeaderText(line);
+//        closure.acceptHeader(header, document.getLineOffset(i));
+//      }
+//    }
+//  }
 
   /**
    * Get the header from a line with header markup
@@ -418,7 +414,7 @@ public abstract class AbstractContentRenderer implements IContentRenderer {
    * @param line
    *          guaranteed to be a valid header as defined by b {@link #isHeader(String) isHeader(String)}
    */
-  protected abstract String getHeaderText(String line);
+//  protected abstract String getHeaderText(String line);
 
   /**
    * @param project
index 2ed554f..23dc491 100644 (file)
@@ -1,16 +1,14 @@
 package net.sourceforge.phpeclipse.wiki.renderer;
 
-import net.sourceforge.phpeclipse.wiki.editor.WikiEditor;
-
 import org.eclipse.core.resources.IProject;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 
 
 public interface IContentRenderer {
-       void forEachHeader(IDocument document, StructureClosure closure) throws BadLocationException;
+//     void forEachHeader(IDocument document, StructureClosure closure) throws BadLocationException;
 
        // new interface methods
-       public void render(String content, StringBuffer buf, int level, boolean completeHTMLPage);
+       public void render(String templateFileName, String content, StringBuffer buf, int level, boolean completeHTMLPage);
        public void setProject(IProject project);
 }
\ No newline at end of file
index c2d6e2c..9f3d428 100644 (file)
@@ -5,12 +5,18 @@ package net.sourceforge.phpeclipse.wiki.renderer;
 
 import java.io.IOException;
 import java.io.StringWriter;
+import java.util.Properties;
 
 import net.sourceforge.phpeclipse.wiki.builder.BuilderRenderEngine;
 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
 
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.app.VelocityEngine;
 import org.eclipse.core.resources.IProject;
-import org.radeox.api.engine.RenderEngine;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.radeox.api.engine.context.InitialRenderContext;
 import org.radeox.engine.context.BaseInitialRenderContext;
 import org.radeox.macro.MacroRepository;
@@ -28,40 +34,40 @@ public final class WikipediaContentRenderer extends AbstractContentRenderer {
 
   }
 
-  protected void appendHeader(String line) {
-    String header = getHeaderText(line);
-    String headerStartTag = "<h1 " + getHeaderCss(getHeaderSize(line)) + ">";
-    getBuffer().append(headerStartTag);
-    getBuffer().append(header);
-    getBuffer().append("</h1>");
-  }
-
-  private int getHeaderSize(String line) {
-    int size = 0;
-    int index = 0;
-    while (index < line.length() && line.charAt(index) != ' ') {
-      if (line.charAt(index) == '1') {
-        size++;
-      }
-      index++;
-    }
-    return size;
-  }
-
-  private String getHeaderCss(int size) {
-    int max = Math.min(3, size);
-    StringBuffer css = new StringBuffer();
-    css.append("class=\"").append("heading");
-    for (int i = 0; i < max; i++) {
-      css.append("-1");
-    }
-    css.append("\"");
-    return css.toString();
-  }
-
-  protected String getHeaderText(String line) {
-    return line.substring(line.indexOf(' ')).trim();
-  }
+//  protected void appendHeader(String line) {
+//    String header = getHeaderText(line);
+//    String headerStartTag = "<h1 " + getHeaderCss(getHeaderSize(line)) + ">";
+//    getBuffer().append(headerStartTag);
+//    getBuffer().append(header);
+//    getBuffer().append("</h1>");
+//  }
+
+//  private int getHeaderSize(String line) {
+//    int size = 0;
+//    int index = 0;
+//    while (index < line.length() && line.charAt(index) != ' ') {
+//      if (line.charAt(index) == '1') {
+//        size++;
+//      }
+//      index++;
+//    }
+//    return size;
+//  }
+//
+//  private String getHeaderCss(int size) {
+//    int max = Math.min(3, size);
+//    StringBuffer css = new StringBuffer();
+//    css.append("class=\"").append("heading");
+//    for (int i = 0; i < max; i++) {
+//      css.append("-1");
+//    }
+//    css.append("\"");
+//    return css.toString();
+//  }
+
+//  protected String getHeaderText(String line) {
+//    return line.substring(line.indexOf(' ')).trim();
+//  }
 
   protected int getListDepth(String line) {
     char bullet = getBullet(line);
@@ -117,26 +123,57 @@ public final class WikipediaContentRenderer extends AbstractContentRenderer {
     return "<table class=\"wiki-table\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
   }
 
-  public final void render(String content, StringBuffer buf, int level, boolean completeHTMLPage) {
+  public final void render(String templateFileName, String content, StringBuffer buf, int level, boolean completeHTMLPage) {
     try {
-      buffer = buf;
-      if (completeHTMLPage) {
-        appendHeader();
-      }
-      StringWriter writer = new StringWriter();
-      try {
+      if (templateFileName == null||templateFileName.equals("")) {
+        if (completeHTMLPage) {
+          appendHeader(buf);
+        }
+        StringWriter writer = new StringWriter();
+        try {
+          engine.setLevel(level);
+          engine.render(writer, content, context);
+          buf.append(writer);
+        } catch (IOException e) {
+          // never reach
+        }
+        if (completeHTMLPage) {
+          appendFooter(buf);
+        }
+      } else {
+        StringWriter writer = new StringWriter();
         engine.setLevel(level);
         engine.render(writer, content, context);
-        buffer.append(writer);
-      } catch (IOException e) {
-        // never reach
-      }
-      if (completeHTMLPage) {
-        appendFooter();
+
+        int index = 0;
+        IPath path = new Path(templateFileName);
+        String fileName = path.toString();
+        String pathName = fileName;
+        index = fileName.lastIndexOf('/');
+        if (index>=0) {
+          pathName = new Path(fileName.substring(0,index)).toOSString();
+          fileName = fileName.substring(index+1);
+        }
+        Properties p = new Properties();
+        p.setProperty("resource.loader", "file");
+        p.setProperty("file.resource.loader.description", "Default Wikipedia Plugin Loader");
+        p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
+        p.setProperty("file.resource.loader.path", pathName);
+        p.setProperty("file.resource.loader.cache", "false");
+        p.setProperty("file.resource.loader.modificationCheckInterval", "0");
+        VelocityEngine ve = new VelocityEngine();
+        ve.init(p);
+        
+        VelocityContext velocityContext = new VelocityContext();
+        velocityContext.put("content", String.valueOf(writer) );
+        Template template = ve.getTemplate(fileName);
+
+        StringWriter sw = new StringWriter();
+        template.merge(velocityContext, sw);
+        buf.append(sw);
       }
-      //             return buffer.toString();
     } catch (Exception e) {
-      WikiEditorPlugin.getDefault().log(buffer.toString());
+      WikiEditorPlugin.getDefault().log(buf.toString());
       WikiEditorPlugin.getDefault().log(e.getLocalizedMessage(), e);
       //             return "<html><body><p>" + e.getLocalizedMessage() + "</p></body></html>";
     }