New Citation Style HowTo

From MPDLMediaWiki
Jump to navigation Jump to search

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 new JUnit test new ctation style testCitationStyleTest.
    3. set testCitationStyles to @Ignore

New citation style configuration[edit]

  • configuration files structure (path prefix src/main/resources/CitationStyles/):
    • globals:
      font-styles.xml: list of available font style definitions, the font styles can be used in any citation style.
      functions.xml: global function definitions, can be used in any citation style
      variables.xml: global variables xml, can be used in any citation style configuration
    • citation style specific:
      Test/CitationStyle.xml: main citation style configuration file.
      Test/variables.xml: local variables xml, available only in Test citation style

Citation Style specifications[edit]

See APA and AJP pages as platform for citation style specifications and discussions.

The test item list XML has two types of publication items, namely Article and Book Chapter, thus Test citation style will have two different layout representations (so-called Citation Style Layout Definitions, CSLDs). Authors and Year blocks will be same for both CSLDs.


Article[edit]

Author, A. A., Author, B. B., & Author, C. C. (Year). Title of article. Title of Periodical, volume(issue number), pages.


Book Chapter[edit]

Author, A. A., & Author, B. B. (Year of publication). Title of book chapter. In A. Editor, & B. Editor (Eds.), Title of book: Alternative Title (Edition, Start Page-End Page). Source.Place of Publication: Source.Name of Publisher.

e.g.: O'Neil, J. M., & Egan, J. (1992). Men's and women's gender role journeys: Metaphor for healing, transition, and transformation . In B. R. Wainrib (Ed.), Gender issues across the life cycle (3rd ed., pp. 107-123). New York: Springer.

Debugging of 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 in order to have a correct output.

  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 and have list of rendered citations.


Substantial tests[edit]