*/
public class Cdm2MediawikiExporter {
+ private static final String IMAGES_FOLDER = "images";
+
+ private static final String FILESEPARATOR = File.separator;
+
//constants
private static final String MEDIAWIKI_CDM_SUB_DIR = "mediawiki_tmp";
if (importImages) {
uploadImagesToMediawiki(myBot);
- logger.info("images downloaded to "+temporaryImageExportFolder);
}
// logout
String text = page.getChild("revision").getChild("text")
.getText();
myBot.edit(title, text, PAGE_SUMMARY);
- logger.info("exported page " + i + "/" + length + " " + title);
+ logger.info("exported page " + i + FILESEPARATOR + length + " " + title
+ + " to " + wikiUrl + ".");
i++;
}
private void uploadImage(WikiBot myBot, String url) throws MalformedURLException,
IOException {
URL imageUrl = new URL(url);
- String[] arr = url.split("/");
+ String[] arr = url.split(FILESEPARATOR);
String filename = arr[arr.length - 1];
System.out.println(filename);
//String filePath = temporaryImageExportFolder.getAbsolutePath()
// + File.separator + filename;
-
- //Download image to a local directory first
- String filePath = temporaryExportFolder.getAbsolutePath() + "/images/" + filename;
-
+ String filePath = temporaryExportFolder.getAbsolutePath()
+ +FILESEPARATOR + IMAGES_FOLDER +FILESEPARATOR+ filename;
+ System.out.println(filePath);
File imageFile = new File(filePath);
logger.info("Downloading image " + imageFile.getAbsolutePath());
<xsl:apply-templates select="key" />
<xsl:apply-templates select="descriptions" />
<!-- A change to Gallery: uncomment following line: -->
- <xsl:call-template name="gallery"/>
+ <!-- <xsl:call-template name="gallery"/>-->
<xsl:call-template name="featureGallery" />
<!-- TODO to change to Figure Gallery: call figure gallery in the right
place what else? -->
String wikiPrefix = null;
// flora of c a
- // String webServiceUrl =
- // "http://dev.e-taxonomy.eu/cdmserver/flora_central_africa/";
- // String taxonName="Agarista";
- // // String taxonName="Restionaceae";
- // String wikiPrefix="Internal";
+// String webServiceUrl =
+// "http://dev.e-taxonomy.eu/cdmserver/flora_central_africa/";
+// String taxonName="Agarista";
+// // // String taxonName="Restionaceae";
+// String wikiPrefix="Internal";
// //cichoriae
// private static final String
// ..................mediawiki...........................
String wikiUrl = "http://biowikifarm.net/testwiki";
- String loginName = "Lorna Morris";
+ String loginName = "Sybille Bürs";
// String password = CdmUtils.readInputLine("Password: ");
- String password = "dolfin_69";
+ String password = "ssetakil3?";
// inputfiles:
public void testExport() throws MalformedURLException {
// do complete export
exporter.export(webServiceUrl, taxonName, wikiUrl, loginName, password,
- wikiPrefix, true, false, true);
+ wikiPrefix, false, false, true);
}