Class AuthorsImportService

java.lang.Object
org.ctan.site.services.catalogue.AbstractImportService<AuthorStore>
org.ctan.site.services.catalogue.AuthorsImportService

public class AuthorsImportService extends AbstractImportService<AuthorStore>
This service deals with the authors from a file.

The file encoding is UTF-8.

 <authors>
   <author
     id="the-key"
     familyname="..."
     givenname="..."
     title="..."
     von="..."
     junior="..."
     female="true"
     died="true"
   >
     <email
       inactive="true"
       note="some remarks on the email"
     >
       email@address
     </email>
   </author>
   ...
 </authors>
 
  • The root node is authors.
  • Constructor Details

    • AuthorsImportService

      public AuthorsImportService(File entries, AuthorStore store)
      This is the constructor for AuthorsImportService.
      Parameters:
      entries - the entries directory
      store - the authors store
      Throws:
      IllegalArgumentException - in case of an I/O error
      NullPointerException - in case of a missing value
  • Method Details

    • drop

      public void drop(List<Author> authorsToBeDropped)
      The method drop provides means to drop some authors.
      Parameters:
      authorsToBeDropped - a list of authors to be dropped
    • updateExisting

      public List<Author> updateExisting() throws IOException
      The method updateExisting provides means to parse an XML file and add the authors found to the database. As a side effect a list of authors is collected which are not in the XML files.
      Returns:
      a list of authors to be deleted
      Throws:
      IOException - in case of an I/O error