Class TextResourceBuilder
java.lang.Object
io.goobi.viewer.api.rest.resourcebuilders.TextResourceBuilder
- Author:
- florian
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.StreamingOutputgetAltoAsZip(String pi, jakarta.servlet.http.HttpServletRequest request) getAltoDocument(String pi, jakarta.servlet.http.HttpServletRequest request) 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, jakarta.servlet.http.HttpServletRequest request) getFulltext(String pi, String fileName) getFulltext.getFulltextAsTEI(String pi, String filename) jakarta.ws.rs.core.StreamingOutputgetFulltextAsZip(String pi, jakarta.servlet.http.HttpServletRequest request) getFulltextMap(String pi, jakarta.servlet.http.HttpServletRequest request) Collects full-text file paths and content in a map.jakarta.ws.rs.core.StreamingOutputgetTeiAsZip(String pi, String langCode, jakarta.servlet.http.HttpServletRequest request) getTeiDocument(String pi, String langCode, jakarta.servlet.http.HttpServletRequest request) 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, jakarta.servlet.http.HttpServletRequest request) throws IOException, PresentationException, IndexUnreachableException -
getFulltextAsZip
public jakarta.ws.rs.core.StreamingOutput getFulltextAsZip(String pi, jakarta.servlet.http.HttpServletRequest request) throws IOException, PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
pi-request-HttpServletRequest- Returns:
StreamingOutput- Throws:
IOExceptionPresentationExceptionIndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getAltoAsZip
public jakarta.ws.rs.core.StreamingOutput getAltoAsZip(String pi, jakarta.servlet.http.HttpServletRequest request) throws IOException, PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Throws:
IOExceptionPresentationExceptionIndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getAltoDocument
public String getAltoDocument(String pi, jakarta.servlet.http.HttpServletRequest request) 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:
PresentationExceptionIndexUnreachableExceptionde.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:
PresentationExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionIndexUnreachableException
-
getTeiDocument
public String getTeiDocument(String pi, String langCode, jakarta.servlet.http.HttpServletRequest request) throws PresentationException, IndexUnreachableException, IOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
pi-langCode-request-HttpServletRequest- Returns:
- TEI document as
String - Throws:
PresentationExceptionIndexUnreachableExceptionIOExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getTeiAsZip
public jakarta.ws.rs.core.StreamingOutput getTeiAsZip(String pi, String langCode, jakarta.servlet.http.HttpServletRequest request) throws PresentationException, IndexUnreachableException, IOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
pi-langCode-request-HttpServletRequest- Returns:
StreamingOutput- Throws:
PresentationExceptionIndexUnreachableExceptionIOExceptionde.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:
PresentationExceptionIndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundExceptionIOException
-
getContentAsText
public String getContentAsText(String contentFolder, String pi, String fileName) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - Throws:
PresentationExceptionIndexUnreachableExceptionde.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- aStringobject.fileName- aStringobject.- Returns:
- a
Stringobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException- if any.DAOExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ServiceNotAllowedException
-
getFulltextMap
public Map<Path,String> getFulltextMap(String pi, jakarta.servlet.http.HttpServletRequest request) 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- aStringobject.request-HttpServletRequest- Returns:
- a
Mapobject. - 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- aStringobject.langCode- aStringobject.- Returns:
- a
Pathobject. - Throws:
IOException- if any.PresentationException- if any.IndexUnreachableException- if any.
-
getCMDIFiles
getCMDIFiles.
-