Interface IRepositoryAccessService

All Known Implementing Classes:
RepositoryAccessService

public interface IRepositoryAccessService
Interface for class RepositoryAccessService, contains logic for accessing the repository.
  • 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 JSON
      IOException - if an error occurs while sending or receiving
      InterruptedException - 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 JSON
      IOException - if an error occurs while sending or receiving
      InterruptedException - 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 JSON
      IOException - if an error occurs while sending or receiving
      InterruptedException - 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 JSON
      IOException - if an error occurs while sending or receiving
      InterruptedException - 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 JSON
      IOException - if an error occurs while sending or receiving
      InterruptedException - if the get request is interrupted
      ParseException - 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 JSON
      IOException - if an error occurs while sending or receiving
      InterruptedException - if the get request is interrupted
    • getXmlByManuscriptId

      String getXmlByManuscriptId(String manuscriptId) throws IOException, InterruptedException
      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 receiving
      InterruptedException - if the get request is interrupted
    • getXmlByPageId

      String getXmlByPageId(String pageId, String fileName) throws IOException, InterruptedException
      Gets the content of a page that is given in the TEI standard.
      Parameters:
      pageId - the id of the page
      fileName - identifies the file associated to a page
      Returns:
      the xml as a String
      Throws:
      IOException - if an error occurs while sending or receiving
      InterruptedException - 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

      String getLinkForPage(String pageId, String pageNumber, ResourceType linkType)
      Construct page link from page id, number and linkType
      Parameters:
      pageId - page id in repo
      pageNumber - page number in repo (file name without extension)
      linkType - link to TEXT file or IMAGE file
      Returns:
      the resulting URL