From: axelcl Date: Sun, 9 Jan 2005 14:37:45 +0000 (+0000) Subject: Added more Wikipedia configurations X-Git-Url: http://secure.phpeclipse.com?hp=f722f5367d57710bf29491541d0fda66bbfd72dc Added more Wikipedia configurations --- diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/DownloadWikipediaAction.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/DownloadWikipediaAction.java index cdbff14..051cce8 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/DownloadWikipediaAction.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/DownloadWikipediaAction.java @@ -1,4 +1,5 @@ package net.sourceforge.phpeclipse.wiki.actions.mediawiki; + //Parts of this sources are copied and modified from the jEdit Wikipedia plugin: //http://www.djini.de/software/wikipedia/index.html // @@ -6,10 +7,12 @@ package net.sourceforge.phpeclipse.wiki.actions.mediawiki; //with permission from the original author: Daniel Wunsch import java.io.StringWriter; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import net.sourceforge.phpeclipse.wiki.actions.mediawiki.config.IWikipedia; import net.sourceforge.phpeclipse.wiki.actions.mediawiki.connect.MediaWikiConnector; import net.sourceforge.phpeclipse.wiki.editor.WikiEditor; import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin; @@ -45,18 +48,23 @@ public class DownloadWikipediaAction implements IEditorActionDelegate { private IWorkbenchWindow window; - - public void dispose() { } - public String generateUrl(Configuration config, String template, String wikiname) { + public String generateUrl(IWikipedia wikipediaProperties, Configuration config, String template, String wikiname) { /* first, we init the runtime engine. Defaults are fine. */ try { Velocity.init(); + if (template == null || template.equals("")) { + // fall back to default settings + // Example: + // http://en.wikipedia.org/w/index.php?title=$text.wikiname&action=raw + template = wikipediaProperties.getActionUrl() + "?title=$text.wikiname&action=raw"; + } + /* lets make a Context and put data into it */ VelocityContext context = new VelocityContext(); @@ -79,12 +87,12 @@ public class DownloadWikipediaAction implements IEditorActionDelegate { return template; } - protected Configuration getConfiguration(){ + protected Configuration getConfiguration() { List allConfigsList = ConfigurationManager.getInstance().getConfigurations(); ArrayList configsList = new ArrayList(); for (int i = 0; i < allConfigsList.size(); i++) { IConfiguration temp = (IConfiguration) allConfigsList.get(i); - if (temp.getType().equals(WikiEditorPlugin.WIKIPEDIA_GET_TEXT)) { + if (temp.getType().startsWith(WikiEditorPlugin.PREFIX_LOAD)) { configsList.add(temp); } } @@ -162,15 +170,24 @@ public class DownloadWikipediaAction implements IEditorActionDelegate { action.setEnabled(window.getActivePage().getActivePart().getClass().equals(WikiEditor.class)); } } - + private void selectWiki(String wikiName) { Configuration configuration = getConfiguration(); if (configuration != null && !configuration.equals("")) { - String url = generateUrl(configuration, configuration.getURL(), wikiName); - String wikiContent = MediaWikiConnector.getWikiRawText(wikiName, url); - if (wikiContent != null) { - IDocument doc = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput()); - doc.set(wikiContent); + try { + String wikiLocale = configuration.getType().substring(WikiEditorPlugin.PREFIX_LOAD.length()); + IWikipedia wikipediaProperties = WikiEditorPlugin.getWikiInstance(wikiLocale); + + String url = generateUrl(wikipediaProperties, configuration, configuration.getURL(), wikiName); + String wikiContent = MediaWikiConnector.getWikiRawText(wikiName, url); + if (wikiContent != null) { + IDocument doc = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput()); + doc.set(wikiContent); + } + } catch (Exception e) { + e.printStackTrace(); + WikiEditorPlugin.getDefault().reportError("Exception occured: ", + e.getMessage() + "\nSee stacktrace in /.metadata/.log file."); } } } diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/LoadWikipediaSQLAction.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/LoadWikipediaSQLAction.java index 06d7894..bc499cf 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/LoadWikipediaSQLAction.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/LoadWikipediaSQLAction.java @@ -108,7 +108,7 @@ public class LoadWikipediaSQLAction implements IEditorActionDelegate { ArrayList configsList = new ArrayList(); for (int i = 0; i < allConfigsList.size(); i++) { IConfiguration temp = (IConfiguration) allConfigsList.get(i); - if (temp.getType().equals(WikiEditorPlugin.WIKIPEDIA_GET_TEXT)) { + if (temp.getType().equals(WikiEditorPlugin.WIKIPEDIA_SQL)) { configsList.add(temp); } } diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/IWikipedia.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/IWikipedia.java index 4d95cb8..bc9ee3e 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/IWikipedia.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/IWikipedia.java @@ -8,6 +8,10 @@ package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; public interface IWikipedia { /** + * @return Returns the default actionUrl. + */ + public String getActionUrl(); + /** * @return Returns the actionPath. */ public String getActionPath(); diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiProperties.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiProperties.java index 2ea10d1..5c6a2b7 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiProperties.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiProperties.java @@ -18,7 +18,7 @@ public class WikiProperties { private ResourceBundle fgResourceBundle = null; protected WikiProperties(String locale) { - RESOURCE_BUNDLE = PACKAGE_NAME + ".WikiProperties" + locale; + RESOURCE_BUNDLE = PACKAGE_NAME + "." + locale; fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE); } diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksDE.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksDE.java new file mode 100644 index 0000000..a65d125 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksDE.java @@ -0,0 +1,54 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + + +public class WikibooksDE extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { + "Media", + "Spezial", + "", + "Diskussion", + "Benutzer", + "Benutzer Diskussion", + "Wikibooks", + "Wikibooks Diskussion", + "Bild", + "Bild Diskussion", + "MediaWiki", + "MediaWiki Diskussion", + "Vorlage", + "Vorlage Diskussion", + "Hilfe", + "Hilfe Diskussion", + "Kategorie", + "Kategorie Diskussion" + }; + private static WikibooksDE instance = new WikibooksDE(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikibooksDE() { + super(new WikiProperties("WikibooksDE")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksDE.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksDE.properties new file mode 100644 index 0000000..6b1fe98 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksDE.properties @@ -0,0 +1,13 @@ +baseURL=http://de.wikibooks.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Spezial +metaNs=Wikibooks +loginSuccess=(?s).*?Sie sind jetzt als ".*?" bei .*? angemeldet.* +loginWrongPw=(?s).*?Das Passwort ist falsch.*? Bitte versuchen Sie es erneut.* +loginNoUser=(?s).*?Der Benutzername ".*?" existiert nicht.*?Überprüfen Sie die Schreibweise, oder melden Sie sich als neuer Benutzer an.* +logoutSuccess=(?s).*?Sie sind nun abgemeldet.*?Sie können .*? jetzt anonym weiterbenutzen, oder sich unter dem selben oder einem anderen Benutzernamen wieder anmelden.* +uploadSuccess=(?s).*?Erfolgreich hochgeladen.* +uploadNoLogin=(?s).*?Sie müssen .*?angemeldet sein.*?um Dateien hochladen zu können.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksEN.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksEN.java new file mode 100644 index 0000000..dd56700 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksEN.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikibooksEN extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "Media", "Special", "", "Talk", "User", "User talk", "Wikibooks", + "Wikibooks talk", "Image", "Image talk", "MediaWiki", "MediaWiki talk", "Template", "Template talk", "Help", "Help talk", + "Category", "Category talk" }; + + private static WikibooksEN instance = new WikibooksEN(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikibooksEN() { + super(new WikiProperties("WikibooksEN")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksEN.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksEN.properties new file mode 100644 index 0000000..0af2af3 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikibooksEN.properties @@ -0,0 +1,13 @@ +baseURL=http://en.wikibooks.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Special +metaNs=Wikibooks +loginSuccess=(?s).*?You are now logged in to .*? as ".*?".* +loginWrongPw=(?s).*?The password you entered is incorrect.*? Please try again.* +loginNoUser=(?s).*?There is no user by the name ".*?".*?Check your spelling, or use the form below to create a new user account.* +logoutSuccess=(?s).*?You are now logged out.*?You can continue to use .*? anonymously, or you can log in.*?again as the same or as a different user.*? Note that some pages may.*?continue to be displayed as if you were still logged in, until you clear.*?your browser cache.* +uploadSuccess=(?s).*?Successful upload.* +uploadNoLogin=(?s).*?You must be .*?logged in.*?to upload files.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsDE.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsDE.java new file mode 100644 index 0000000..9854b1d --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsDE.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikinewsDE extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "Media", "Spezial", "", "Diskussion", "Benutzer", + "Benutzer Diskussion", "Wikinews", "Wikinews Diskussion", "Bild", "Bild Diskussion", "MediaWiki", "MediaWiki Diskussion", + "Vorlage", "Vorlage Diskussion", "Hilfe", "Hilfe Diskussion", "Kategorie", "Kategorie Diskussion" }; + + private static WikinewsDE instance = new WikinewsDE(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikinewsDE() { + super(new WikiProperties("WikinewsDE")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsDE.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsDE.properties new file mode 100644 index 0000000..2a54176 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsDE.properties @@ -0,0 +1,13 @@ +baseURL=http://de.wikinews.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Spezial +metaNs=Wikinews +loginSuccess=(?s).*?Sie sind jetzt als ".*?" bei .*? angemeldet.* +loginWrongPw=(?s).*?Das Passwort ist falsch.*? Bitte versuchen Sie es erneut.* +loginNoUser=(?s).*?Der Benutzername ".*?" existiert nicht.*?Überprüfen Sie die Schreibweise, oder melden Sie sich als neuer Benutzer an.* +logoutSuccess=(?s).*?Sie sind nun abgemeldet.*?Sie können .*? jetzt anonym weiterbenutzen, oder sich unter dem selben oder einem anderen Benutzernamen wieder anmelden.* +uploadSuccess=(?s).*?Erfolgreich hochgeladen.* +uploadNoLogin=(?s).*?Sie müssen .*?angemeldet sein.*?um Dateien hochladen zu können.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsEN.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsEN.java new file mode 100644 index 0000000..d54cf8a --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsEN.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikinewsEN extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "Media", "Special", "", "Talk", "User", "User talk", "Wikinews", + "Wikinews talk", "Image", "Image talk", "MediaWiki", "MediaWiki talk", "Template", "Template talk", "Help", "Help talk", + "Category", "Category talk" }; + + private static WikinewsEN instance = new WikinewsEN(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikinewsEN() { + super(new WikiProperties("WikinewsEN")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsEN.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsEN.properties new file mode 100644 index 0000000..58099e1 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikinewsEN.properties @@ -0,0 +1,13 @@ +baseURL=http://en.wikinews.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Special +metaNs=Wikinews +loginSuccess=(?s).*?You are now logged in to .*? as ".*?".* +loginWrongPw=(?s).*?The password you entered is incorrect.*? Please try again.* +loginNoUser=(?s).*?There is no user by the name ".*?".*?Check your spelling, or use the form below to create a new user account.* +logoutSuccess=(?s).*?You are now logged out.*?You can continue to use .*? anonymously, or you can log in.*?again as the same or as a different user.*? Note that some pages may.*?continue to be displayed as if you were still logged in, until you clear.*?your browser cache.* +uploadSuccess=(?s).*?Successful upload.* +uploadNoLogin=(?s).*?You must be .*?logged in.*?to upload files.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaAR.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaAR.java new file mode 100644 index 0000000..2a0378d --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaAR.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikipediaAR extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "ملف", "خاص", "", "نقاش", "مستخدم", "نقاش المستخدم", "ويكيبيديا", + "نقاش ويكيبيديا", "صورة", "نقاش الصورة", "ميدياويكي", "نقاش ميدياويكي", "Template", "نقاش Template", "مساعدة", + "نقاش المساعدة", "تصنيف", "نقاش التصنيف" }; + + private static WikipediaAR instance = new WikipediaAR(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikipediaAR() { + super(new WikiProperties("WikipediaAR")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaAR.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaAR.properties new file mode 100644 index 0000000..bf5b71d --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaAR.properties @@ -0,0 +1,13 @@ +baseURL=http://ar.wikipedia.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=%D8%AE%D8%A7%D8%B5 +metaNs=Wikipedia +loginSuccess=(?s).*???? ??? ?????? ?????? ?????????? ???? ".*?".* +loginWrongPw=(?s).*????? ???? ???? ??????? ??? ?????? ???? ????? ????????.* +loginNoUser=(?s).*??? ???? ?????? ?????? ".*?".*????? ?? ????? ?????? ?? ?????? ??????? ??????? ?? ?????? ?????? ?????? ????.* +logoutSuccess=(?s).*???? ???? ??? ???? ?????? ??????.*??????? ???????? ???????? ????????? ??????? ?? ?????? ??? ???? ???? ????? ?? ???? ???.*? ?? ?????? ?? ??? ??? ??????? ?? ???????? ??? ???? ???? ?? ??????.*?? ???? ???? ??????? ??????? ??????? Cache ?? ???????? ????.* +uploadSuccess=(?s).*?????? ????? ?????.* +uploadNoLogin=(?s).*???? ?? ???? .*?????? ??????.*??????? ?? ????? ???????.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaCA.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaCA.java new file mode 100644 index 0000000..9777bf0 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaCA.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikipediaCA extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "Media", "Especial", "", "Discussió", "Usuari", "Usuari Discussió", + "Wikipedia", "Wikipedia Discussió", "Imatge", "Imatge Discussió", "MediaWiki", "MediaWiki Discussió", "Template", + "Template Discussió", "Ajuda", "Ajuda Discussió", "Categoria", "Categoria Discussió" }; + + private static WikipediaCA instance = new WikipediaCA(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikipediaCA() { + super(new WikiProperties("WikipediaCA")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaCA.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaCA.properties new file mode 100644 index 0000000..38c7b14 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaCA.properties @@ -0,0 +1,13 @@ +baseURL=http://ca.wikipedia.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Especial +metaNs=Wikipedia +loginSuccess=(?s).*?Heu iniciat la sessió a .*? com a ".*?".* +loginWrongPw=(?s).*?La contrasenya que heu ingressat és incorrecta.*? Torneu-ho a provar.* +loginNoUser=(?s).*?No hi ha cap usuari amb el nom ".*?".*?Reviseu-ne l'ortografia, o empreu el formulari d'avall per crear un nou compte d'usuari.* +logoutSuccess=(?s).*?Heu acabat la vostra sessió.*?Podeu continuar emprant la .*? de forma anònima, o podeu.*?iniciar sessió un altre cop amb el mateix o un altre nom d'usuari.* +uploadSuccess=(?s).*?L'arxiu s'ha carregat amb èxit.* +uploadNoLogin=(?s).*?Deveu haver .*?entrat.*?per carregar arxius.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDA.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDA.java new file mode 100644 index 0000000..77c2a6c --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDA.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikipediaDA extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "Media", "Speciel", "", "Diskussion", "Bruger", "Bruger diskussion", + "Wikipedia", "Wikipedia diskussion", "Billede", "Billede diskussion", "MediaWiki", "MediaWiki diskussion", "Skabelon", + "Skabelon diskussion", "Hjælp", "Hjælp diskussion", "Kategori", "Kategori diskussion" }; + + private static WikipediaDA instance = new WikipediaDA(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikipediaDA() { + super(new WikiProperties("WikipediaDA")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDA.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDA.properties new file mode 100644 index 0000000..e9da113 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDA.properties @@ -0,0 +1,13 @@ +baseURL=http://da.wikipedia.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=ISO-8859-1 +specialNs=Speciel +metaNs=Wikipedia +loginSuccess=(?s).*?Du er nu logget på .*? som ".*?".* +loginWrongPw=(?s).*?Den indtastede adgangskode var forkert.*? Prøv igen.* +loginNoUser=(?s).*?Der er ingen bruger med navnet ".*?".*?Kontrollér stavemåden igen, eller brug formularen herunder til at oprette en ny brugerkonto.* +logoutSuccess=(?s).*?Du er nu logget af.*?Du kan fortsætte med at bruge .*? anonymt, eller du kan logge på.*?igen som den samme eller en anden bruger.* +uploadSuccess=(?s).*?Oplægning er gennemført med succes.* +uploadNoLogin=(?s).*?Du skal være .*? for at kunne lægge filer op.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDE.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDE.java index 2ff3d0b..78876f7 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDE.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDE.java @@ -14,8 +14,10 @@ public class WikipediaDE extends AbstractWikipedia { private static WikipediaDE instance = new WikipediaDE(); - /* + /** * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() */ public static IWikipedia getInstance() { return instance; @@ -23,7 +25,7 @@ public class WikipediaDE extends AbstractWikipedia { // private constructor private WikipediaDE() { - super(new WikiProperties("DE")); + super(new WikiProperties("WikipediaDE")); } /** diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiPropertiesDE.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDE.properties similarity index 81% rename from archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiPropertiesDE.properties rename to archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDE.properties index a377c11..6b80b1c 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiPropertiesDE.properties +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaDE.properties @@ -7,7 +7,7 @@ specialNs=Spezial metaNs=Wikipedia loginSuccess=(?s).*?Du bist jetzt als ".*?" bei Wikipedia angemeldet.* loginWrongPw=(?s).*?Das Passwort ist falsch.*? Bitte versuche es erneut.* -loginNoUser=(?s).*?Der Benutzername \".*?\" existiert nicht.*?Überprüfen Sie die Schreibweise, oder melden Sie sich als neuer Benutzer an.* +loginNoUser=(?s).*?Der Benutzername ".*?" existiert nicht.*?Überprüfen Sie die Schreibweise, oder melden Sie sich als neuer Benutzer an.* logoutSuccess=(?s).*?Du bist nun abgemeldet.*?Du kannst die Wikipedia jetzt weiter mit deiner IP-Adresse benutzen, oder dich unter demselben oder einem anderen Benutzernamen wieder anmelden.* uploadSuccess=(?s).*?Erfolgreich hochgeladen.* uploadNoLogin=(?s).*?Sie müssen .*?angemeldet sein.*?um Dateien hochladen zu können.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEN.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEN.java index d63d445..3c77b43 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEN.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEN.java @@ -13,8 +13,10 @@ public class WikipediaEN extends AbstractWikipedia { private static WikipediaEN instance = new WikipediaEN(); - /* + /** * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() */ public static IWikipedia getInstance() { return instance; @@ -22,7 +24,7 @@ public class WikipediaEN extends AbstractWikipedia { // private constructor private WikipediaEN() { - super(new WikiProperties("EN")); + super(new WikiProperties("WikipediaEN")); } /** diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiPropertiesEN.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEN.properties similarity index 71% rename from archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiPropertiesEN.properties rename to archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEN.properties index 6cbff3d..ac887d3 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikiPropertiesEN.properties +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEN.properties @@ -7,7 +7,7 @@ specialNs=Special metaNs=Wikipedia loginSuccess=(?s).*?You are now logged in to .*? as ".*?".* loginWrongPw=(?s).*?The password you entered is incorrect.*? Please try again.* -loginNoUser=(?s).*?There is no user by the name \".*?\".*?Check your spelling, or use the form below to create a new user account.*? If there is no form below, account creation is temporarily disabled.*? In this case, please accept our apologies and try again later.* +loginNoUser=(?s).*?There is no user by the name ".*?".*?Check your spelling, or use the form below to create a new user account.*? If there is no form below, account creation is temporarily disabled.*? In this case, please accept our apologies and try again later.* logoutSuccess=(?s).*?You are now logged out.*? This computer may be used to browse and edit Wikipedia without a user name, or for another user to log on.*? Note that some pages may continue to be displayed as if you were still logged in; this can be fixed by clearing your browser cache.* uploadSuccess=(?s).*?Successful upload.* uploadNoLogin=(?s).*?You must be .*?logged in.*?to upload files.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEO.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEO.java new file mode 100644 index 0000000..785084d --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEO.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikipediaEO extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "Media", "Speciala", "", "Diskuto", "Vikipediisto", + "Vikipediista diskuto", "Vikipedio", "Wikipedia diskuto", "Dosiero", "Dosiera diskuto", "MediaWiki", "MediaWiki diskuto", + "Ŝablono", "Ŝablona diskuto", "Helpo", "Helpa diskuto", "Kategorio", "Kategoria diskuto" }; + + private static WikipediaEO instance = new WikipediaEO(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikipediaEO() { + super(new WikiProperties("WikipediaEO")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEO.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEO.properties new file mode 100644 index 0000000..eb8c5e8 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaEO.properties @@ -0,0 +1,13 @@ +baseURL=http://eo.wikipedia.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Speciala +metaNs=Wikipedia +loginSuccess=(?s).*?Vi nun estas en la .*? kiel uzulo ".*?".* +loginWrongPw=(?s).*?Vi tajpis mal?ustan pasvorton.*? Bonvolu provi denove.* +loginNoUser=(?s).*?Neniu uzulo nomi?as ".*?".*?Bonvolu kontroli vian literumadon, a? uzu la malsupran formularon por krei novan konton.* +logoutSuccess=(?s).*?Vi elsalutis kaj finis vian seancon.*?Vi rajtas da?re Vikipediumi sennome, a? vi povas reensaluti.*?kiel la sama a? kiel alia uzulo.* +uploadSuccess=(?s).*?Al?uto sukcesis!.* +uploadNoLogin=(?s).*?Se vi volas al?uti dosierojn, vi devas .*?ensaluti.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaES.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaES.java new file mode 100644 index 0000000..1b6819b --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaES.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikipediaES extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "Media", "Especial", "", "Discusión", "Usuario", "Usuario Discusión", + "Wikipedia", "Wikipedia Discusión", "Imagen", "Imagen Discusión", "MediaWiki", "MediaWiki Discusión", "Plantilla", + "Plantilla Discusión", "Ayuda", "Ayuda Discusión", "Categoría", "Categoría Discusión" }; + + private static WikipediaES instance = new WikipediaES(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikipediaES() { + super(new WikiProperties("WikipediaES")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaES.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaES.properties new file mode 100644 index 0000000..19c8829 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaES.properties @@ -0,0 +1,13 @@ +baseURL=http://es.wikipedia.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Especial +metaNs=Wikipedia +loginSuccess=(?s).*?Has iniciado tu sesión en Wikipedia como ".*?".* +loginWrongPw=(?s).*?La contraseña que ingresaste es incorrecta.*? Por favor inténtalo de nuevo.* +loginNoUser=(?s).*?No existe ningún usuario llamado ".*?".*?Asegúrate de que lo has escrito correctamente, o usa el formulario de abajo para crear una nueva cuenta de usuario.* +logoutSuccess=(?s).*?Has terminado tu sesión.*?Puedes continuar usando Wikipedia en forma anónima, o puedes.*?iniciar sesión otra vez como el mismo u otro usuario.* +uploadSuccess=(?s).*?Subida exitosa.* +uploadNoLogin=(?s).*?Tienes que .*?iniciar sesión.*?para subir archivos.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaET.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaET.java new file mode 100644 index 0000000..78ebeb4 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaET.java @@ -0,0 +1,38 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; + +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikipediaET extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { "Media", "Eri", "", "Arutelu", "Kasutaja", "Kasutaja arutelu", + "Wikipedia", "Wikipedia arutelu", "Pilt", "Pildi arutelu", "MediaWiki", "MediaWiki arutelu", "Template", "Template talk", + "Help", "Help talk", "Category", "Category talk" }; + + private static WikipediaET instance = new WikipediaET(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikipediaET() { + super(new WikiProperties("WikipediaET")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaET.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaET.properties new file mode 100644 index 0000000..1080035 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaET.properties @@ -0,0 +1,13 @@ +baseURL=http://et.wikipedia.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Eri +metaNs=Wikipedia +loginSuccess=(?s).*?Te olete sisse loginud.*? Teie kasutajanimi on ".*?".* +loginWrongPw=(?s).*?Vale parool.*? Proovige uuesti.* +loginNoUser=(?s).*?Ei ole kasutajat nimega ".*?".*?Kontrollige kirjapilti või kasutage alljärgnevat vormi uue kasutajakonto loomiseks.* +logoutSuccess=(?s).*?Te olete välja loginud.*?Võite kasutada Vikipeediat anonüümselt või uuesti sisse logida sama või teise kasutajana.* +uploadSuccess=(?s).*?Üleslaadimine õnnestus.* +uploadNoLogin=(?s).*?Kui Te soovite faile üles laadida, peate .*?sisse logima.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFI.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFI.java new file mode 100644 index 0000000..01291e6 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFI.java @@ -0,0 +1,54 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikipediaFI extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { + "Media", + "Toiminnot", + "", + "Keskustelu", + "Käyttäjä", + "Keskustelu käyttäjästä", + "Wikipedia", + "Wikipedia talk", + "Kuva", + "Keskustelu kuvasta", + "MediaWiki", + "MediaWiki talk", + "Template", + "Template talk", + "Ohje", + "Keskustelu ohjeesta", + "Luokka", + "Keskustelu luokasta" +}; + + private static WikipediaFI instance = new WikipediaFI(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikipediaFI() { + super(new WikiProperties("WikipediaFI")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFI.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFI.properties new file mode 100644 index 0000000..dfcb671 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFI.properties @@ -0,0 +1,13 @@ +baseURL=http://fi.wikipedia.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Toiminnot +metaNs=Wikipedia +loginSuccess=(?s).*?Olet nyt kirjautunut .*?}} käyttäjänä ".*?".* +loginWrongPw=(?s).*?Syöttämäsi salasana ei ole oikein.*? Ole hyvä ja yritä uudelleen.* +loginNoUser=(?s).*?Käyttäjänimeä ".*?" ei ole olemassa.*?Tarkista kirjoititko nimen oikein, tai käytä alla olevaa lomaketta uuden käyttäjätunnuksen luomiseksi.* +logoutSuccess=(?s).*?Olet nyt kirjautunut ulos .*?}}.*?Voit jatkaa .*?}} käyttöä nimettömänä, tai.*?kirjautua uudelleen sisään samana tai eri käyttäjänä.* +uploadSuccess=(?s).*?Tallennus onnistui.* +uploadNoLogin=(?s).*?Sinun pitää olla .*?kirjautuneena sisään.*?tallentaaksesi tiedoston.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFR.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFR.java new file mode 100644 index 0000000..19cdee5 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFR.java @@ -0,0 +1,54 @@ +package net.sourceforge.phpeclipse.wiki.actions.mediawiki.config; +//Parts of this sources are copied and modified from the jEdit Wikipedia plugin: +//http://www.djini.de/software/wikipedia/index.html +// +//The modified sources are available under the "Common Public License" +//with permission from the original author: Daniel Wunsch + +public class WikipediaFR extends AbstractWikipedia { + + final private static String[] nameSpaces = new String[] { + "Media", + "Special", + "", + "Discuter", + "Utilisateur", + "Discussion Utilisateur", + "Wikipédia", + "Discussion Wikipedia", + "Image", + "Discussion Image", + "MediaWiki", + "Discussion MediaWiki", + "Modèle", + "Discussion Modèle", + "Aide", + "Discussion Aide", + "Catégorie", + "Discussion Catégorie" +}; + + private static WikipediaFR instance = new WikipediaFR(); + + /** + * Get the singleton instance + * + * @see net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin#getWikiInstance() + */ + public static IWikipedia getInstance() { + return instance; + } + + // private constructor + private WikipediaFR() { + super(new WikiProperties("WikipediaFR")); + } + + /** + * @return Returns the nameSpaces. + */ + public String[] getNameSpaces() { + return nameSpaces; + } + +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFR.properties b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFR.properties new file mode 100644 index 0000000..be23be8 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/config/WikipediaFR.properties @@ -0,0 +1,13 @@ +baseURL=http://fr.wikipedia.org +actionPath=/w/index.php +actionPath2=/w/wiki.phtml +readPath=/wiki/ +charSet=UTF-8 +specialNs=Special +metaNs=Wikipedia +loginSuccess=(?s).*?Vous êtes actuellement connecté sur Wikipédia en tant que « .*? ».* +loginWrongPw=(?s).*?Le mot de passe est incorrect.*? Essayez à nouveau.* +loginNoUser=(?s).*?L'utilisateur « .*? » n'existe pas.*?Vérifiez que vous avez bien orthographié le nom, ou utilisez le formulaire ci-dessous pour créer un nouveau compte utilisateur.* +logoutSuccess=(?s).*?Vous êtes à présent déconnecté.*?e.*?Vous pouvez continuer à utiliser .*? de façon anonyme, ou vous reconnecter, éventuellement sous un autre nom.* +uploadSuccess=(?s).*?Copie réussie.* +uploadNoLogin=(?s).*?Vous devez être .*?connecté.*?pour copier des fichiers sur le serveur.* diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/post/StoreWikipediaAction.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/post/StoreWikipediaAction.java index 0723e23..b796b80 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/post/StoreWikipediaAction.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/mediawiki/post/StoreWikipediaAction.java @@ -7,13 +7,14 @@ package net.sourceforge.phpeclipse.wiki.actions.mediawiki.post; //with permission from the original author: Daniel Wunsch import java.io.StringWriter; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; import net.sourceforge.phpeclipse.wiki.actions.mediawiki.config.IWikipedia; -import net.sourceforge.phpeclipse.wiki.actions.mediawiki.config.WikipediaEN; +import net.sourceforge.phpeclipse.wiki.actions.mediawiki.config.WikipediaDE; import net.sourceforge.phpeclipse.wiki.actions.mediawiki.connect.Content; import net.sourceforge.phpeclipse.wiki.actions.mediawiki.connect.MediaWikiConnector; import net.sourceforge.phpeclipse.wiki.editor.WikiEditor; @@ -87,7 +88,7 @@ public class StoreWikipediaAction implements IEditorActionDelegate { ArrayList configsList = new ArrayList(); for (int i = 0; i < allConfigsList.size(); i++) { IConfiguration temp = (IConfiguration) allConfigsList.get(i); - if (temp.getType().equals(WikiEditorPlugin.WIKIPEDIA_SET_TEXT)) { + if (temp.getType().startsWith(WikiEditorPlugin.PREFIX_STORE)) { configsList.add(temp); } } @@ -172,20 +173,27 @@ public class StoreWikipediaAction implements IEditorActionDelegate { try { IDocument doc = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput()); String url = generateUrl(configuration, configuration.getURL(), wikiName); - IWikipedia w = WikipediaEN.getInstance(); + String wikiLocale = configuration.getType().substring(WikiEditorPlugin.PREFIX_STORE.length()); + IWikipedia wikipediaProperties = WikiEditorPlugin.getWikiInstance(wikiLocale); + MediaWikiConnector connector = new MediaWikiConnector(); + String actionUrl = configuration.getURL(); + if (actionUrl == null || actionUrl.equals("")) { + // fall back to default settings + actionUrl = wikipediaProperties.getActionUrl(); + } Date d = new Date(); Content content = new Content(String.valueOf(d.getTime()), doc.get()); - boolean success = connector.login(w, configuration.getURL(), configuration.getUser(), configuration.getPassword(), false); + boolean success = connector.login(wikipediaProperties, actionUrl, configuration.getUser(), configuration.getPassword(), false); if (success) { - connector.store(w, configuration.getURL(), wikiName, content, "", false, false); - connector.logout(w, configuration.getURL()); + connector.store(wikipediaProperties, actionUrl, wikiName, content, "", false, false); + connector.logout(wikipediaProperties, actionUrl); } } catch (Exception e) { e.printStackTrace(); WikiEditorPlugin.getDefault() - .reportError("Exception occured", e.getMessage() + "\nSee stacktrace in /.metadata/.log file."); + .reportError("Exception occured: ", e.getMessage() + "\nSee stacktrace in /.metadata/.log file."); } } } 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 ee2c4ab..41afec5 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 @@ -1,15 +1,19 @@ package net.sourceforge.phpeclipse.wiki.editor; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.sql.SQLException; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import java.util.MissingResourceException; import java.util.ResourceBundle; +import net.sourceforge.phpeclipse.wiki.actions.mediawiki.config.IWikipedia; import net.sourceforge.phpeclipse.wiki.internal.ConfigurationManager; import net.sourceforge.phpeclipse.wiki.internal.IConfigurationWorkingCopy; import net.sourceforge.phpeclipse.wiki.sql.WikipediaDB; @@ -41,17 +45,37 @@ public class WikiEditorPlugin extends AbstractUIPlugin { public static final String HTTP_QUERY = "HTTP Query"; - public static final String WIKIPEDIA_GET_TEXT = "Wikipedia-Load Text"; - - public static final String WIKIPEDIA_SET_TEXT = "Wikipedia-Store Text"; - + // public static final String WIKIPEDIA_GET_TEXT = "Load WikipediaEN"; + // + // public static final String WIKIPEDIA_SET_TEXT = "Store WikipediaEN"; public static final String WIKIPEDIA_SQL = "Wikipedia SQL access"; - + public static final String BLOG_A_WIKI = "Blog as Wiki Text"; public static final String BLOG_A_HTML = "Blog as HTML Text"; - public static final String[] CONFIGURATION_TYPES = { HTTP_QUERY, WIKIPEDIA_GET_TEXT, WIKIPEDIA_SET_TEXT, WIKIPEDIA_SQL, BLOG_A_WIKI, BLOG_A_HTML }; + public static final String[] PREDEFINED_TYPES = { HTTP_QUERY, WIKIPEDIA_SQL, BLOG_A_WIKI, BLOG_A_HTML }; + + public static final String[] PREDEFINED_WIKIS = { + "WikibooksDE", + "WikibooksEN", + "WikinewsDE", + "WikinewsEN", + "WikipediaAR", + "WikipediaCA", + "WikipediaDE", + "WikipediaEN", + "WikipediaEO", + "WikipediaES", + "WikipediaET", + "WikipediaFI", + "WikipediaFR" }; + + public static final String PREFIX_LOAD = "Load "; + + public static final String PREFIX_STORE = "Store "; + + public static final ArrayList CONFIGURATION_TYPES = new ArrayList(); //image paths public static final String ICON_PATH = "icons/full/"; //$NON-NLS-1$ @@ -70,15 +94,17 @@ public class WikiEditorPlugin extends AbstractUIPlugin { public final static String EXPORT_CSS_URL = "__export_css_url"; - public final static String PREF_STRING_CONFIGURATIONS = "__configurations1"; + public final static String PREF_STRING_CONFIGURATIONS = "__configurations2"; public final static String CONFIG_MEMENTO = "" + "" + "" + "" + "" - + "" - + "" + + "" + + "" + + "" + + "" + "" + ""; @@ -174,6 +200,16 @@ public class WikiEditorPlugin extends AbstractUIPlugin { super(descriptor); initializeImages(); fgPlugin = this; + for (int i = 0; i < PREDEFINED_TYPES.length; i++) { + CONFIGURATION_TYPES.add(PREDEFINED_TYPES[i]); + } + + for (int i = 0; i < PREDEFINED_WIKIS.length; i++) { + CONFIGURATION_TYPES.add(PREFIX_LOAD + PREDEFINED_WIKIS[i]); + } + for (int i = 0; i < PREDEFINED_WIKIS.length; i++) { + CONFIGURATION_TYPES.add(PREFIX_STORE + PREDEFINED_WIKIS[i]); + } manager = ConfigurationManager.getInstance(); try { fResourceBundle = ResourceBundle.getBundle("net.sourceforge.phpeclipse.wiki.editor.WikiEditorMessages"); @@ -376,10 +412,14 @@ public class WikiEditorPlugin extends AbstractUIPlugin { return manager.createConfiguration(); } - public static String[] getTypes() { + public static ArrayList getTypes() { return CONFIGURATION_TYPES; } + public static void addType(String type) { + CONFIGURATION_TYPES.add(type); + } + /* * (non-Javadoc) * @@ -394,7 +434,7 @@ public class WikiEditorPlugin extends AbstractUIPlugin { } super.shutdown(); } - + public static void log(int severity, String message) { Status status = new Status(severity, PLUGIN_ID, IStatus.OK, message, null); log(status); @@ -408,4 +448,41 @@ public class WikiEditorPlugin extends AbstractUIPlugin { log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "PHPeclipsePlugin.internalErrorOccurred", e)); //$NON-NLS-1$ } + /** + * Get a IWikpedia singleton instance through reflection (i.e. Method#invoke() ) + * + * @param wikiLocale + * @return + * @throws NoSuchMethodException + * @throws IllegalAccessException + * @throws ClassNotFoundException + * @throws InvocationTargetException + */ + public static IWikipedia getWikiInstance(String wikiLocale) throws NoSuchMethodException, IllegalAccessException, + ClassNotFoundException, InvocationTargetException { + String className = "net.sourceforge.phpeclipse.wiki.actions.mediawiki.config." + wikiLocale; + Class cls = Class.forName(className); + Method method = cls.getMethod("getInstance", new Class[0]); + return (IWikipedia) method.invoke(null, new Object[0]); + } + + // test code + // public static void main(String[] args) { + // try { + // getWikiInstance("WikipediaEN"); + // } catch (NoSuchMethodException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (IllegalAccessException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (ClassNotFoundException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (InvocationTargetException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // } + } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/ui/internal/ConfigurationDialog.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/ui/internal/ConfigurationDialog.java index 363c427..6fd92a4 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/ui/internal/ConfigurationDialog.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/ui/internal/ConfigurationDialog.java @@ -4,15 +4,16 @@ * 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 - Initial API and implementation **********************************************************************/ package net.sourceforge.phpeclipse.wiki.ui.internal; +import java.util.ArrayList; + import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin; import net.sourceforge.phpeclipse.wiki.internal.IConfigurationWorkingCopy; -import net.sourceforge.phpeclipse.wiki.preferences.Messages; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; @@ -122,14 +123,14 @@ public class ConfigurationDialog extends Dialog { return text; } - protected Combo createTypeCombo(Composite comp, final String[] types, String sel, final TypeModifyListener listener) { + protected Combo createTypeCombo(Composite comp, final ArrayList types, String sel, final TypeModifyListener listener) { final Combo combo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY); - int size = types.length; + int size = types.size(); String[] items = new String[size]; int index = -1; for (int i = 0; i < size; i++) { - items[i] = types[i]; - if (types[i].equals(sel)) + items[i] = (String)types.get(i); + if (items[i].equals(sel)) index = i; } combo.setItems(items); @@ -141,7 +142,7 @@ public class ConfigurationDialog extends Dialog { if (listener != null) combo.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { - listener.valueChanged(types[combo.getSelectionIndex()]); + listener.valueChanged((String)types.get(combo.getSelectionIndex())); } public void widgetDefaultSelected(SelectionEvent e) {