From: axelcl Date: Wed, 15 Dec 2004 20:44:40 +0000 (+0000) Subject: Add predefined Velocity and CSS template if wiki builder is assigned to a project X-Git-Url: http://secure.phpeclipse.com Add predefined Velocity and CSS template if wiki builder is assigned to a project --- diff --git a/archive/net.sourceforge.phpeclipse.wiki/.classpath b/archive/net.sourceforge.phpeclipse.wiki/.classpath index 8f4f2e9..88cef53 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/.classpath +++ b/archive/net.sourceforge.phpeclipse.wiki/.classpath @@ -1,13 +1,14 @@ - + - + + + - diff --git a/archive/net.sourceforge.phpeclipse.wiki/about.html b/archive/net.sourceforge.phpeclipse.wiki/about.html new file mode 100644 index 0000000..e992790 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/about.html @@ -0,0 +1,91 @@ + + + +About + + + +

About This Content

+ +

License

+

PHPeclipse.de makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the +Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at http://www.eclipse.org/legal/cpl-v10.html. +For purposes of the CPL, "Program" will mean the Content.

+ +

Third Party Content

+ +

The Content includes items that have been sourced from third parties as follows:

+ +

radeox

+ +

The plug-in includes software developed by SnipSnap Radeox. Therefore:

+ +
+This product includes software developed by the (http://www.radeox.org/). +
+ +
Copyright (c) 2000-2003 Matthias L. Jugel, Stephan J. Schmidt. All rights reserved.
+ +

xmlrpc commons-logging commons-httpclient velocity

+ +

The plug-in includes software developed by The Apache Software Foundation as part of the Jakarta project. Therefore:

+ +
+This product includes software developed by the Apache Software Foundation (http://www.apache.org/). +
+ +
Copyright (c) 2001 The Apache Software Foundation. All rights reserved.
+ +

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 +http://jakarta.apache.org/LICENSE. +More specifically:

+
+ 1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of
+ conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must include the
+ following acknowledgment:
+
+ "This product includes software developed by the Apache Software Foundation
+ (http://www.apache.org/)." +
+ Alternately, this acknowledgment may appear in the software itself, if and wherever such
+ third-party acknowledgments normally appear.
+
+ 4. The names "The Jakarta Project" and "Apache Software Foundation"
+ must not be used to endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may "Apache" appear
+ in their name, without prior written permission of the Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +
+ +

Contributions

+ +

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.

+ +

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or +other code and/or documentation ("Modifications") 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.

+ + + diff --git a/archive/net.sourceforge.phpeclipse.wiki/cpl-v10.html b/archive/net.sourceforge.phpeclipse.wiki/cpl-v10.html new file mode 100644 index 0000000..36aa208 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/cpl-v10.html @@ -0,0 +1,125 @@ + + + +Common Public License - v 1.0 + + + + + + +

Common Public License - v 1.0 +

+

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. +

+

1. DEFINITIONS +

"Contribution" means: + +

+ + + + + + + + + + +

+

"Contributor" means any person or entity that distributes the Program. +

+

"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. +

+

"Program" means the Contributions distributed in accordance with this Agreement. +

+

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. +

+

2. GRANT OF RIGHTS + +

+ + + + + + + + + + + + + + + + + + + + + + +

3. REQUIREMENTS +

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +

+ + + + + + + + + + + + + + + + + + + +

When the Program is made available in source code form: + +

+ + + + +

+

Contributors may not remove or alter any copyright notices contained within the Program. +

+

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. +

+

4. COMMERCIAL DISTRIBUTION +

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. +

+

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. +

+

5. NO WARRANTY +

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 solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. +

+

6. DISCLAIMER OF LIABILITY +

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 (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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. +

+

7. GENERAL +

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. +

+

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. +

+

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. +

+

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 publish new versions (including revisions) of this Agreement from time to 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. 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 version. 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, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. +

+

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. +

+

+ + + + \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar b/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar index abe7273..315e213 100644 Binary files a/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar and b/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar differ diff --git a/archive/net.sourceforge.phpeclipse.wiki/plugin.xml b/archive/net.sourceforge.phpeclipse.wiki/plugin.xml index de70df9..a5e770e 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/plugin.xml +++ b/archive/net.sourceforge.phpeclipse.wiki/plugin.xml @@ -245,12 +245,12 @@ menubarPath="additions" id="net.sourceforge.phpeclipse.wiki.actions.OpenWikiLinkEditorAction"> - - + --> depth 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 index 0000000..9ca51b9 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/export.vm @@ -0,0 +1,18 @@ + + + + + +

+
+
+
+ +$content + +
+
+
+
+ + \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/main.css b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/main.css similarity index 82% rename from archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/main.css rename to archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/main.css index ca8e627..17fe2b9 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/main.css +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/main.css @@ -25,6 +25,7 @@ position: relative; z-index: 2; } + #column-one { padding-top: 160px; } /* the left column width is specified in class .portlet */ @@ -36,7 +37,7 @@ body { font: x-small sans-serif; - background: #f9f9f9 url("headbg.jpg") 0px 0px no-repeat; + background: #f9f9f9; color: Black; margin: 0; padding: 0; @@ -905,4 +906,134 @@ fieldset.operaprefsection { margin-left: 15em } .sharedUploadNotice { font-style: italic; -} \ No newline at end of file +} + + /*Großbuchstaben in den Navigationsbereichen*/ + .portlet h5,.portlet h6,#p-personal ul,#p-cactions li a{text-transform:none;} + + /*Personennamen in Kapitälchen: Name*/ + .Person{display:inline;font-variant:small-caps} + + /*Ausschalten der foundraising-Nachricht*/ + + /*fetter bearbeiten-link*/ + #ca-edit a{font-weight:bold !important;} + + /*sitenotice*/ + /*#siteNotice{font-size: x-small}*/ + + /* Make all non-namespace pages have a light blue content area. This is done by + setting the background color for all #content areas to light blue and then + overriding it for any #content enclosed in a .ns-0 (main namespace). I then + do the same for the "tab" background colors. --Lupo */ + + #content, #mytabs li.selected a, #p-cactions li.selected a { + background-color: #F3F3FF; /* ein leichtes blau */ + } + + .ns-0 #content, .ns-0 #mytabs li.selected a, .ns-0 #p-cactions li.selected a { + background-color: white; + } + + .ns--1 table, .ns-2 table, .ns-4 table, .ns--1 form { + background: inherit; + } + + /* Categorien etwas schöner darstellen */ + #catlinks { + border: 0px; + border-top: 2px dotted #aaaaaa; + } + + /* Metadaten */ + table.metadata { + border:1px solid #AAA; + /* display:none; // ausschalten */ + } + .metadata-label { + color:#AAA; + } + + + + /*SideBox analog Townbox*/ + + div.sideBox { + position:relative; + float:right; + background:White; + margin-left:1em; + border: 1px solid Grey; + + padding:0.3em; + width: 200px; + overflow: hidden; + clear: right; + } + div.sideBox dl { + padding: 0; + margin: 0 0 0.3em 0; + font-size: 96%; + } + div.sideBox dl dt { + background: none; + margin: 0.4em 0 0 0; + } + div.sideBox dl dd { + margin: 0.1em 0 0 1.1em; + background-color: #f3f3f3; + } + + /* Standard Navigationsleisten */ + + div.BoxenVerschmelzen, div.NavFrame { + margin:0px; + padding:2px; + border:1px solid #AAAAAA; + text-align:center; + border-collapse:collapse; + font-size:95%; + } + div.BoxenVerschmelzen div.NavFrame { + border-style:none; + border-style:hidden; + } + div.NavFrame + div.NavFrame { + border-top-style:none; + border-top-style:hidden; + } + div.NavPic { + background-color:#FFFFFF; + margin:0px; + padding:2px; + float:left; + } + div.NavFrame div.NavHead { + height:1.6em; + font-weight:bold; + font-size:100%; + background-color:#EFEFEF; + } + div.NavFrame p { + font-size:100%; + } + div.NavFrame div.NavContent { + font-size:100%; + } + div.NavFrame div.NavContent p { + font-size:100%; + } + div.NavEnd { + margin:0px; + padding:0px; + line-height:1px; + clear:both; + } + + /* Do not print navigation bar elements. They should not appear on paper */ + @media print{ + .NavFrame { display:none; } + .BoxenVerschmelzen { display:none; } + } + + 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 index 0000000..9ca51b9 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/builder/main.vm @@ -0,0 +1,18 @@ + + + + + +
+
+
+
+ +$content + +
+
+
+
+ + \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorContributor.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorContributor.java index f3d93c9..29edcb1 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorContributor.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorContributor.java @@ -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; diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorPlugin.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorPlugin.java index b67d095..b49e15f 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorPlugin.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/WikiEditorPlugin.java @@ -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 = "" + ""+ 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 index db7c908..0000000 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/editor/action/WeblogWikiAction.java +++ /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); - } -} diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/WikiExporter.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/WikiExporter.java index 1463a25..998bdc7 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/WikiExporter.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/WikiExporter.java @@ -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()); diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Messages.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Messages.properties index 5598a72..273da4f 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Messages.properties +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Messages.properties @@ -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 diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Util.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Util.java index 4d154f7..b8d41f4 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Util.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/Util.java @@ -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); } diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/WikiProjectPreferences.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/WikiProjectPreferences.java index 3ce415c..fd11f1b 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/WikiProjectPreferences.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/preferences/WikiProjectPreferences.java @@ -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) diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/AbstractContentRenderer.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/AbstractContentRenderer.java index 4c86952..88f36b1 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/AbstractContentRenderer.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/AbstractContentRenderer.java @@ -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(""); + protected void appendHeader(StringBuffer buf) throws IOException { + buf.append(""); // String basePath = Util.getMiscProjectsPreferenceValue(fProject, WikiConstants.HTML_OUTPUT_PATH); // buffer.append(""); @@ -134,7 +130,7 @@ public abstract class AbstractContentRenderer implements IContentRenderer { // } // appendStyle(); - buffer.append("\n"); + buf.append("\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"); + protected void appendFooter(StringBuffer buf) { + buf.append("\n"); } // 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 ""; } - 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 diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/IContentRenderer.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/IContentRenderer.java index 2ed554f..23dc491 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/IContentRenderer.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/IContentRenderer.java @@ -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 diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/WikipediaContentRenderer.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/WikipediaContentRenderer.java index c2d6e2c..9f3d428 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/WikipediaContentRenderer.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/renderer/WikipediaContentRenderer.java @@ -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 = "

"; - getBuffer().append(headerStartTag); - getBuffer().append(header); - getBuffer().append("

"); - } - - 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 = "

"; +// getBuffer().append(headerStartTag); +// getBuffer().append(header); +// getBuffer().append("

"); +// } + +// 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 "
"; } - 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 "

" + e.getLocalizedMessage() + "

"; }