Difference between revisions of "New Citation Style HowTo"

From MPDLMediaWiki
Jump to navigation Jump to search
m
Line 22: Line 22:
## set <code>testCitationStyles</code> to <code>@Ignore</code>
## set <code>testCitationStyles</code> to <code>@Ignore</code>


== New citation style configuration ==
== Citation Style specifications ==
* configuration files structure (path prefix <code>src/main/resources/CitationStyles/</code>):
** globals:
**: <code>font-styles.xml</code>: list of available font style definitions, the font styles can be used in any citation style.
**: <code>functions.xml</code>: global function definitions, can be used in any citation style
**: <code>variables.xml</code>: global variables xml, can be used in any citation style configuration
** citation style specific:
**: <code>Test/CitationStyle.xml</code>: main citation style configuration file.
**: <code>Test/variables.xml</code>: local variables xml, available only in Test citation style
 
=== Citation Style specifications ===
See [[PubMan_Func_Spec_Export/APA|APA]] and [[PubMan_Func_Spec_Export/AJP|AJP]] pages as platform for citation style specifications and discussions.
See [[PubMan_Func_Spec_Export/APA|APA]] and [[PubMan_Func_Spec_Export/AJP|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 basic for both CSLDs.
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 basic for both CSLDs.


==== Authors ====
=== Authors ===
* family name, initials (blank separated), e.g.: Morfill, G. E.  
* family name, initials (blank separated), e.g.: Morfill, G. E.  
* if there are two authors, connect them with ", &", e.g.: Morfill, G. E., & Khrapak S. A.
* if there are two authors, connect them with ", &", e.g.: Morfill, G. E., & Khrapak S. A.
* if there are more than 3 authors: commas separate author names, while the last author name is preceded again by ampersand. E.g.: Kernis, M. H., Cornell, D. P., Sun, C. R., Berry, A., & Harlow, T.
* if there are more than 3 authors: commas separate author names, while the last author name is preceded again by ampersand. E.g.: Kernis, M. H., Cornell, D. P., Sun, C. R., Berry, A., & Harlow, T.


==== Year ====
=== Year ===
issued or published online. issued has higher priority.
issued or published online. issued has higher priority.


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


==== Book Chapter ====
=== Book Chapter ===
Author, A. A., & Author, B. B. (Year). Title of book chapter. In ''Title of book''. Source.Place of Publication: Source.Name of Publisher.
Author, A. A., & Author, B. B. (Year). Title of book chapter. In ''Title of book''. Source.Place of Publication: Source.Name of Publisher.


== Debugging of citation style configuration ==
 
== Citation style configuration ==
Citation style is configured by means of set of XML files, they are located in <code>src/main/resources/CitationStyles/</code> directory
* global XMLs, i.e. all specified elements can be used overall in citation styles:
*: <code>font-styles.xml</code>: list of available font style definitions.
*: <code>functions.xml</code>: global function definitions
*: <code>variables.xml</code>: global variables
* citation style specific XMLs:
*: <code>Test/CitationStyle.xml</code>: main citation style configuration file
*: <code>Test/variables.xml</code>: local variables xml, available only in Test citation style
 
===  ===
 
 
== Debugging procedure ==
=== Plain tests ===
=== Plain tests ===
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.
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.
Line 58: Line 62:
## 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 and have list of rendered citations.
## check generated outputs in formats: pdf and escidoc_snippet in <code>target/</code> directory. The outputs should not be empty and have list of rendered citations.


=== Substantial tests ===
=== Substantial tests ===

Revision as of 21:23, 13 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 new JUnit test new ctation style testCitationStyleTest.
    3. set testCitationStyles to @Ignore

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 basic for both CSLDs.

Authors[edit]

  • family name, initials (blank separated), e.g.: Morfill, G. E.
  • if there are two authors, connect them with ", &", e.g.: Morfill, G. E., & Khrapak S. A.
  • if there are more than 3 authors: commas separate author names, while the last author name is preceded again by ampersand. E.g.: Kernis, M. H., Cornell, D. P., Sun, C. R., Berry, A., & Harlow, T.

Year[edit]

issued or published online. issued has higher priority.

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). Title of book chapter. In Title of book. Source.Place of Publication: Source.Name of Publisher.


Citation style configuration[edit]

Citation style is configured by means of set of XML files, they are located in src/main/resources/CitationStyles/ directory

  • global XMLs, i.e. all specified elements can be used overall in citation styles:
    font-styles.xml: list of available font style definitions.
    functions.xml: global function definitions
    variables.xml: global variables
  • citation style specific XMLs:
    Test/CitationStyle.xml: main citation style configuration file
    Test/variables.xml: local variables xml, available only in Test citation style

[edit]

Debugging procedure[edit]

Plain tests[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]

make possible to check the citations content. It helps to avoid some by-effects due to changes in the global functions and variables. It makes sense to run the tests after the plain tests.

  1. update
  2. generate escidoc_snippet output
  3. copy
  4. update items in testFiles/Test/TestCollection.xml
  5. start test with
    $mvn -Dtest=TestCitationStylesSubstantial test