Interface IRepositoryAccessService
- All Known Implementing Classes:
RepositoryAccessService
public interface IRepositoryAccessService
Interface for class RepositoryAccessService, contains logic for accessing the repository.
-
Method Summary
Modifier and TypeMethodDescriptionList<org.springframework.boot.configurationprocessor.json.JSONObject> getAllManuscripts(int numberManuscripts) Gets all manuscripts in the repository.Gets base url for manuscript repository.getLinkForPage(String pageId, String pageNumber, ResourceType linkType) Construct page link from page id, number and linkTypeorg.springframework.boot.configurationprocessor.json.JSONObjectgetManuscriptById(String manuscriptId) Gets a manuscript from the repository by its unique manuscript identifier.List<org.springframework.boot.configurationprocessor.json.JSONObject> getManuscriptsModifiedAfter(Instant timestamp) Gets all manuscripts in the repository modified after a certain time.org.springframework.boot.configurationprocessor.json.JSONArraygetPageAssignmentForManuscriptId(String manuscriptId) Gets the page assignment from a manuscript by its unique manuscript identifier.org.springframework.boot.configurationprocessor.json.JSONObjectgetPageById(String pageId) Gets the page of a manuscript by its unique identifier.Gets static path for manuscript store.getTypeGeneralByPageId(String pageId) Returns the typeGeneral of a page.getXmlByManuscriptId(String manuscriptId) Gets the metadata of a manuscript that is given in the TEI standard.getXmlByPageId(String pageId, String fileName) Gets the content of a page that is given in the TEI standard.
-
Method Details
-
getManuscriptById
org.springframework.boot.configurationprocessor.json.JSONObject getManuscriptById(String manuscriptId) throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException Gets a manuscript from the repository by its unique manuscript identifier.- Parameters:
manuscriptId- manuscript identifier as String- Returns:
- manuscript as JSONObject
- Throws:
org.springframework.boot.configurationprocessor.json.JSONException- if the response body could not be parsed to JSONIOException- if an error occurs while sending or receivingInterruptedException- if the get request is interrupted
-
getPageById
org.springframework.boot.configurationprocessor.json.JSONObject getPageById(String pageId) throws InterruptedException, IOException, org.springframework.boot.configurationprocessor.json.JSONException Gets the page of a manuscript by its unique identifier.- Parameters:
pageId- page identifier as String- Returns:
- page as JSONObject
- Throws:
org.springframework.boot.configurationprocessor.json.JSONException- if the response body could not be parsed to JSONIOException- if an error occurs while sending or receivingInterruptedException- if the get request is interrupted
-
getPageAssignmentForManuscriptId
org.springframework.boot.configurationprocessor.json.JSONArray getPageAssignmentForManuscriptId(String manuscriptId) throws InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException, IOException Gets the page assignment from a manuscript by its unique manuscript identifier.- Parameters:
manuscriptId- manuscript identifier as String- Returns:
- page assignment as JSONObject
- Throws:
org.springframework.boot.configurationprocessor.json.JSONException- if the response body could not be parsed to JSONIOException- if an error occurs while sending or receivingInterruptedException- if the get request is interrupted
-
getAllManuscripts
List<org.springframework.boot.configurationprocessor.json.JSONObject> getAllManuscripts(int numberManuscripts) throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException Gets all manuscripts in the repository.- Parameters:
numberManuscripts- number of pages you want to get manuscripts from, -1 if you want all- Returns:
- list of manuscripts as JSONObjects
- Throws:
org.springframework.boot.configurationprocessor.json.JSONException- if the response body could not be parsed to JSONIOException- if an error occurs while sending or receivingInterruptedException- if the get request is interrupted
-
getManuscriptsModifiedAfter
List<org.springframework.boot.configurationprocessor.json.JSONObject> getManuscriptsModifiedAfter(Instant timestamp) throws InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException, IOException, ParseException Gets all manuscripts in the repository modified after a certain time.- Parameters:
timestamp- specified time after which all manuscripts should be returned as Date- Returns:
- list of manuscripts modified after a certain time
- Throws:
org.springframework.boot.configurationprocessor.json.JSONException- if the response body could not be parsed to JSONIOException- if an error occurs while sending or receivingInterruptedException- if the get request is interruptedParseException- if there is a problem while parsing the data to a JSONObject
-
getTypeGeneralByPageId
String getTypeGeneralByPageId(String pageId) throws InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException, IOException Returns the typeGeneral of a page.- Parameters:
pageId- page identifier as String- Returns:
- typeGeneral of a page
- Throws:
org.springframework.boot.configurationprocessor.json.JSONException- if the response body could not be parsed to JSONIOException- if an error occurs while sending or receivingInterruptedException- if the get request is interrupted
-
getXmlByManuscriptId
Gets the metadata of a manuscript that is given in the TEI standard.- Parameters:
manuscriptId- the id of the manuscript- Returns:
- the xml as a String
- Throws:
IOException- if an error occurs while sending or receivingInterruptedException- if the get request is interrupted
-
getXmlByPageId
Gets the content of a page that is given in the TEI standard.- Parameters:
pageId- the id of the pagefileName- identifies the file associated to a page- Returns:
- the xml as a String
- Throws:
IOException- if an error occurs while sending or receivingInterruptedException- if the get request is interrupted
-
getBaseUrl
String getBaseUrl()Gets base url for manuscript repository.- Returns:
- base url String
-
getStaticPath
String getStaticPath()Gets static path for manuscript store.- Returns:
- static path String
-
getLinkForPage
Construct page link from page id, number and linkType- Parameters:
pageId- page id in repopageNumber- page number in repo (file name without extension)linkType- link to TEXT file or IMAGE file- Returns:
- the resulting URL
-