Package org.ctan.site.services.catalogue
Class TopicsImportService
java.lang.Object
org.ctan.site.services.catalogue.AbstractImportService<TopicStore>
org.ctan.site.services.catalogue.TopicsImportService
This service deals with the topics from a file.
The file encoding is UTF-8.
<topics> <topic name='aaa'> <en> <title>aaa-en-title</title> <description>aaa-en-desc</description> <teaser>aaa-en-teaser</teaser> <details>aaa-en-details</details> </en> <de> <title>aaa-de-title</title> <description>aaa-de-desc</description> <teaser>aaa-de-teaser</teaser> <details>aaa-de-details</details> </de> </topic> ... </topics>
- The root node is
topics
. - The first level contains nodes of type
topic
.- The topic node has a mandatory attribute
name
. - The second level contains nodes of type
en
orde
for the locale.- The topic node has a mandatory attribute
name
. - The third level contains nodes for the texts of type
title
,description
,details
, orteaser
.
- The topic node has a mandatory attribute
- The topic node has a mandatory attribute
-
Field Summary
Fields inherited from class org.ctan.site.services.catalogue.AbstractImportService
entries, store
-
Constructor Summary
ConstructorsConstructorDescriptionTopicsImportService
(@NonNull File entries, @NonNull TopicStore store) This is the constructor forTopicsImportService
. -
Method Summary
Methods inherited from class org.ctan.site.services.catalogue.AbstractImportService
neq
-
Constructor Details
-
TopicsImportService
This is the constructor forTopicsImportService
.- Parameters:
entries
- the entries directorystore
- the topics store
-
-
Method Details
-
drop
The methoddrop
provides means to drop some topics.- Parameters:
topicsToBeDropped
- a list of topics to be dropped
-
updateExisting
The methodupdateExisting
provides means to parse an XML file and add the topics found to the database. As a side effect a list of topics is collected which are not in the XML files.- Returns:
- the topics to be dropped
- Throws:
IOException
- in case of an I/O error
-