Class TextResourceBuilder
java.lang.Object
io.goobi.viewer.api.rest.resourcebuilders.TextResourceBuilder
- Author:
- florian
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.StreamingOutput
getAltoAsZip
(String pi) getAltoDocument
(String pi, String fileName) getCmdiDocument
(String pi, String langCode) getCMDIFile
(String pi, String langCode) getCMDIFile.getCMDIFiles
(String pi) getCMDIFiles.getContentAsText
(String contentFolder, String pi, String fileName) getFulltext
(String pi) getFulltext
(String pi, String fileName) getFulltext.getFulltextAsTEI
(String pi, String filename) javax.ws.rs.core.StreamingOutput
getFulltextMap
(String pi) Collects full-text file paths and content in a map.javax.ws.rs.core.StreamingOutput
getTeiAsZip
(String pi, String langCode) getTeiDocument
(String pi, String langCode) getTEIFiles
(String pi) getTEIFiles.getTEIFiles
(String pi, String langCode) getTEIFiles.
-
Constructor Details
-
TextResourceBuilder
public TextResourceBuilder()Zero-arg constructor.
-
-
Method Details
-
getFulltext
public String getFulltext(String pi) throws IOException, PresentationException, IndexUnreachableException -
getFulltextAsZip
public javax.ws.rs.core.StreamingOutput getFulltextAsZip(String pi) throws IOException, PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
pi
-- Returns:
StreamingOutput
- Throws:
IOException
PresentationException
IndexUnreachableException
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getAltoAsZip
public javax.ws.rs.core.StreamingOutput getAltoAsZip(String pi) throws IOException, PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Throws:
IOException
PresentationException
IndexUnreachableException
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getAltoDocument
public String getAltoDocument(String pi) throws IOException, PresentationException, IndexUnreachableException -
getAltoDocument
public StringPair getAltoDocument(String pi, String fileName) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - Parameters:
pi
-fileName
-- Returns:
- StringPair(ALTO,charset)
- Throws:
PresentationException
IndexUnreachableException
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
-
getFulltextAsTEI
public String getFulltextAsTEI(String pi, String filename) throws PresentationException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, IndexUnreachableException - Parameters:
pi
-filename
-- Returns:
- Plain text extracted from TEI
- Throws:
PresentationException
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
IndexUnreachableException
-
getTeiDocument
public String getTeiDocument(String pi, String langCode) throws PresentationException, IndexUnreachableException, IOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
pi
-langCode
-- Returns:
- TEI document as
String
- Throws:
PresentationException
IndexUnreachableException
IOException
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getTeiAsZip
public javax.ws.rs.core.StreamingOutput getTeiAsZip(String pi, String langCode) throws PresentationException, IndexUnreachableException, IOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
pi
-langCode
-- Returns:
StreamingOutput
- Throws:
PresentationException
IndexUnreachableException
IOException
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getCmdiDocument
public String getCmdiDocument(String pi, String langCode) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException, IOException - Parameters:
pi
-langCode
-- Returns:
- CMDI document as
String
- Throws:
PresentationException
IndexUnreachableException
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
IOException
-
getContentAsText
public String getContentAsText(String contentFolder, String pi, String fileName) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - Throws:
PresentationException
IndexUnreachableException
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
-
getFulltext
public String getFulltext(String pi, String fileName) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException getFulltext.
- Parameters:
pi
- aString
object.fileName
- aString
object.- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
- if any.DAOException
de.unigoettingen.sub.commons.contentlib.exceptions.ServiceNotAllowedException
-
getFulltextMap
public Map<Path,String> getFulltextMap(String pi) throws IOException, PresentationException, IndexUnreachableException Collects full-text file paths and content in a map. Priority is given to files from plaintext resources, with missing files being stuffed with converted ALTO.- Parameters:
pi
- aString
object.- Returns:
- a
Map
object. - Throws:
IOException
- if any.PresentationException
- if any.IndexUnreachableException
- if any.
-
getTEIFiles
getTEIFiles.
-
getTEIFiles
getTEIFiles.
-
getCMDIFile
public Path getCMDIFile(String pi, String langCode) throws IOException, PresentationException, IndexUnreachableException getCMDIFile.
- Parameters:
pi
- aString
object.langCode
- aString
object.- Returns:
- a
Path
object. - Throws:
IOException
- if any.PresentationException
- if any.IndexUnreachableException
- if any.
-
getCMDIFiles
getCMDIFiles.
-