Difference between revisions of "New Citation Style HowTo"

From MPDLMediaWiki
Jump to navigation Jump to search
m
Line 7: Line 7:
* jEdit
* jEdit


== Steps ==
== Preparations ==
# <pre>$svn co https://zim02.gwdg.de/repos/common/trunk/common_services</pre>
# <pre>$svn co https://zim02.gwdg.de/repos/common/trunk/common_services</pre>
# <pre>$cd common_services/citationmanager</pre>
# <pre>$cd common_services/citationmanager</pre>
Line 15: Line 15:
# <pre>$cp rm Default Test; rm -rf Test/.svn</pre>
# <pre>$cp rm Default Test; rm -rf Test/.svn</pre>
# add new citation style <code>Test</code> in the <code>src/main/resources/Schemas/explain-styles.xml</code>, define <code>output-formats</code>
# add new citation style <code>Test</code> in the <code>src/main/resources/Schemas/explain-styles.xml</code>, define <code>output-formats</code>
#  get nice items-list XML from [http://pubman.mpdl.mpg.de/search/SearchAndExport?cqlQuery=escidoc.objid=escidoc:420912%20or%20%20escidoc.objid=escidoc:417665%20or%20escidoc.objid=escidoc:277899%20or%20escidoc.objid=escidoc:408415%20or%20escidoc.objid=escidoc:357855%20or%20escidoc.objid=escidoc:236884%20or%20escidoc.objid=escidoc:399942%20or%20escidoc.objid=escidoc:66205%20or%20escidoc.objid=escidoc:67079%20or%20escidoc.objid=escidoc:64657&exportFormat=ESCIDOC_XML PubMan live], create src/test/resources/testFiles/Test directory, and save the XML into it.  
#  get nice items-list XML from [http://pubman.mpdl.mpg.de/search/SearchAndExport?cqlQuery=escidoc.objid=escidoc:420912%20or%20%20escidoc.objid=escidoc:417665%20or%20escidoc.objid=escidoc:277899%20or%20escidoc.objid=escidoc:408415%20or%20escidoc.objid=escidoc:357855%20or%20escidoc.objid=escidoc:236884%20or%20escidoc.objid=escidoc:399942%20or%20escidoc.objid=escidoc:66205%20or%20escidoc.objid=escidoc:67079%20or%20escidoc.objid=escidoc:64657&exportFormat=ESCIDOC_XML PubMan live], create src/test/resources/testFiles/Test directory, and save the XML into it under name <code>TestCollection.xml</code>.  
# changes in <code>src/test/java/test/TestCitationManager.java</code>:
# changes in <code>src/test/java/test/TestCitationManager.java</code>:
## define path to the new item list in the <code>itemListsFIleNames</code> hash
## define path to the new item list in the <code>itemListsFIleNames</code> hash
##: put("Test", "target/test-classes/testFiles/Test/TestCollection.xml");
##: put("Test", "target/test-classes/testFiles/Test/TestCollection.xml");
## create new JUnit test: <code>testCitationStyleTest</code> specific for new ctation style test. Life circle: validation, compilation, output.  
## create a new JUnit test new ctation style <code>testCitationStyleTest</code>.  
## set <code>testCitationStyles</code> to <code>@Ignore</code>
## set <code>testCitationStyles</code> to <code>@Ignore</code>
== Creation and debugging of the citation style configuration ==
Debugging life circle consists of 3 consequent steps: validation, compilation and output. Compilation should always take place after any changes in citation style configuration file.
# start test with  
# start test with  
#:<pre>$mvn -Dtest=TestCitationManager test</pre>
#: $mvn -Dtest=TestCitationManager test
## check console output and <code>target/surefire-reports/test.TestCitationManager.txt</code> for errors.
## check console output and <code>target/surefire-reports/test.TestCitationManager.txt</code> for errors.
## check generated outputs in formats: pdf and escidoc_snippet in <code>target/</code> directory. The outputs should not be empty.
## check generated outputs in formats: pdf and escidoc_snippet in <code>target/</code> directory. The outputs should not be empty.
#Substantial tests

Revision as of 10:09, 12 May 2010

This is a protected page.

Prerequisites[edit]

  • java SDK 6
  • svn
  • maven
  • jEdit

Preparations[edit]

  1. $svn co https://zim02.gwdg.de/repos/common/trunk/common_services
  2. $cd common_services/citationmanager
  3. check whether checkout can be compiled:
    $mvn clean install
  4. $cd src/main/resources/CitationStyles
  5. $cp rm Default Test; rm -rf Test/.svn
  6. add new citation style Test in the src/main/resources/Schemas/explain-styles.xml, define output-formats
  7. get nice items-list XML from PubMan live, create src/test/resources/testFiles/Test directory, and save the XML into it under name TestCollection.xml.
  8. changes in src/test/java/test/TestCitationManager.java:
    1. define path to the new item list in the itemListsFIleNames hash
      put("Test", "target/test-classes/testFiles/Test/TestCollection.xml");
    2. create a new JUnit test new ctation style testCitationStyleTest.
    3. set testCitationStyles to @Ignore

Creation and debugging of the citation style configuration[edit]

Debugging life circle consists of 3 consequent steps: validation, compilation and output. Compilation should always take place after any changes in citation style configuration file.

  1. start test with
    $mvn -Dtest=TestCitationManager test
    1. check console output and target/surefire-reports/test.TestCitationManager.txt for errors.
    2. check generated outputs in formats: pdf and escidoc_snippet in target/ directory. The outputs should not be empty.