commit after merging
authors.buers <s.buers@localhost>
Thu, 17 Oct 2013 13:30:43 +0000 (13:30 +0000)
committers.buers <s.buers@localhost>
Thu, 17 Oct 2013 13:30:43 +0000 (13:30 +0000)
cdmlib-print/src/main/java/eu/etaxonomy/cdm/print/out/mediawiki/Cdm2MediawikiExporter.java
cdmlib-print/src/main/resources/stylesheets/mediawiki/multipages.xsl
cdmlib-print/src/test/java/eu/etaxonomy/cdm/print/out/mediawiki/Cdm2MediawikiExporterTest.java

index 86003ecdcc18cd876c982efb8e144420064702cc..30542fbf1988c74d9c5a74663f734a0eede6ab3f 100644 (file)
@@ -42,6 +42,10 @@ import org.apache.commons.io.FileUtils;
  */
 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";
 
@@ -267,7 +271,6 @@ public class Cdm2MediawikiExporter {
 
                if (importImages) {
                        uploadImagesToMediawiki(myBot);
-                       logger.info("images downloaded to "+temporaryImageExportFolder);
                }
                
                // logout
@@ -358,7 +361,8 @@ public class Cdm2MediawikiExporter {
                                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++;
                        }
 
@@ -464,15 +468,14 @@ public class Cdm2MediawikiExporter {
        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());
                
index 7d889c9f38a52be4412b20abd3102c47fe85c30a..a1a79971333e78bd25336b235ec13c9b91bf3cca 100644 (file)
                <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? -->
index f6b7bb721a9da702c9d66b492072880e1148b432..7bd6957dc54f90a77fa346af5215b2684b1df41e 100644 (file)
@@ -20,11 +20,11 @@ public class Cdm2MediawikiExporterTest {
                        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
@@ -35,9 +35,9 @@ public class Cdm2MediawikiExporterTest {
                        // ..................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:
@@ -63,7 +63,7 @@ public class Cdm2MediawikiExporterTest {
        public void testExport() throws MalformedURLException {
                // do complete export
                                exporter.export(webServiceUrl, taxonName, wikiUrl, loginName, password,
-                                               wikiPrefix, true, false, true);
+                                               wikiPrefix, false, false, true);
 
        }