commit after merge from trunc wiki_statistics origin/wiki_statistics root/branches/cdmlib/wiki_statistics
authors.buers <s.buers@localhost>
Tue, 22 Oct 2013 14:23:57 +0000 (14:23 +0000)
committers.buers <s.buers@localhost>
Tue, 22 Oct 2013 14:23:57 +0000 (14:23 +0000)
1  2 
.gitattributes
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/CdmUtils.java
cdmlib-print/pom.xml
cdmlib-print/src/test/java/eu/etaxonomy/cdm/print/out/mediawiki/Cdm2MediawikiExporterTest.java
pom.xml

diff --cc .gitattributes
Simple merge
index cf3e551ddb8987b040a36ab97fe18a4f97084d5d,432022219d5fb851b332f4c7157e6bf90254b912..602896d579a96194d7b6ea67b4e82fb13c35e06f
@@@ -71,28 -71,13 +71,26 @@@ public class CdmUtils 
  \r
          return homeDirString;\r
      }\r
-       \r
\r
+     public static File getCdmHomeDir() {\r
+         return new File(System.getProperty("user.home")+File.separator+cdmFolderName+File.separator);\r
+     }\r
\r
 -\r
 +      public static File getCdmSubDir(String dirName) {\r
 +\r
 +              File folder = new File(System.getProperty("user.home") + File.separator\r
 +                              + cdmFolderName + File.separator + dirName + File.separator);\r
 +\r
 +              // if the directory does not exist, create it\r
 +              if (!folder.exists()) {\r
 +                      if (!folder.mkdir()) {\r
 +                              // TODO throw some Exception\r
 +                              return null;\r
 +                      }\r
 +              }\r
 +              return folder;\r
 +      }\r
  \r
-     public static File getCdmHomeDir() {\r
-         return new File(System.getProperty("user.home")+File.separator+cdmFolderName+File.separator);\r
-     }\r
\r
\r
\r
  \r
      /**\r
       * Returns the an InputStream for a read-only source\r
Simple merge
index 1c2af2c9c501570e41951b7443798baa8d368155,0000000000000000000000000000000000000000..6e88e511e6f54ebca65eda0217138ba29304e3e5
mode 100644,000000..100644
--- /dev/null
@@@ -1,95 -1,0 +1,95 @@@
-                               loginName, password, wikiPrefix, false, false, false);
 +package eu.etaxonomy.cdm.print.out.mediawiki;
 +
 +import java.net.MalformedURLException;
 +
 +import org.junit.Before;
 +import org.junit.Ignore;
 +import org.junit.Test;
 +
 +public class Cdm2MediawikiExporterTest {
 +
 +      // ############## parameter###############
 +
 +      // *****************portals and their nodes ********************
 +
 +      // palmweb
 +      String webServiceUrl = "http://dev.e-taxonomy.eu/cdmserver/palmae/";
 +      String taxonName = "Aphandra";// Acrocomia";//"Actinorhytis";
 +      String wikiPrefix = null;
 +      String classificationName = 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 classificationName=null;
 +
 +      // //cichoriae
 +      // private static final String webServiceUrl =
 +      // "http://dev.e-taxonomy.eu/cdmserver/cichorieae/";
 +      // String taxonName = "Askellia alaica";
 +      // String classificationName ="standard view";
 +      // String wikiPrefix = null;
 +
 +      // ******************other parameters **********************
 +
 +      // ..................mediawiki...........................
 +
 +      String wikiUrl = "http://biowikifarm.net/testwiki";
 +      String loginName = "Sybille Bürs";
 +      // String password = CdmUtils.readInputLine("Password: ");
 +      String password = "ssetakil3?";
 +
 +      // inputfiles:
 +      // TODO put a cdm exported file in here:
 +      private String cdmExported = null;
 +      // TODO put a mediawiki xml file in here:
 +      String wikiFile = null;
 +
 +      // #############################################
 +
 +      Cdm2MediawikiExporter exporter;
 +
 +      @Before
 +      public void setUp() throws Exception {
 +              exporter = new Cdm2MediawikiExporter();
 +
 +      }
 +
 +      @Test
 +      public void testExport() throws MalformedURLException {
 +              // do complete export
 +              exporter.export(webServiceUrl, taxonName, classificationName, wikiUrl,
++                              loginName, password, wikiPrefix, true, false, true);
 +
 +      }
 +
 +      // @Test
 +      // public void testExportEntireDatabase() throws MalformedURLException {
 +      // // do complete export
 +      // exporter.export(webServiceUrl, wikiUrl, loginName, password,
 +      // wikiPrefix, true, false, true);
 +      //
 +      // }
 +
 +      @Test
 +      public void testExportFromXmlFile() throws MalformedURLException {
 +              // TODO
 +              cdmExported = "/home/sybille/.cdmLibrary/mediawiki_tmp/20131022-1440-cdm_output.xml";
 +
 +              exporter.exportFromXmlFile(cdmExported, webServiceUrl, wikiUrl,
 +                              loginName, password, wikiPrefix, false, false, false);
 +      }
 +
 +      @Test
 +      public void testUploadToMediawiki() {
 +              // do only wiki import
 +              // TODO
 +              wikiFile = "/home/sybille/.cdmLibrary/mediawiki_tmp/20131022-1533-output.xml";
 +               exporter.uploadToMediawiki(wikiFile, wikiUrl, loginName, password);
 +
 +      }
 +
 +}
diff --cc pom.xml
Simple merge