Class OpenAnnotationBuilder
java.lang.Object
io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractAnnotationBuilder
io.goobi.viewer.model.iiif.presentation.v2.builder.OpenAnnotationBuilder
- Author:
- florian
-
Field Summary
Fields inherited from class io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractAnnotationBuilder
UGC_SOLR_FIELDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.annotation.IResourcecreateAnnnotationBodyFromUGCDocument(org.apache.solr.common.SolrDocument doc) de.intranda.api.annotation.IResourcecreateFragmentTarget(String pi, int pageOrder, String coordString, boolean urlOnlyTarget) de.intranda.api.annotation.oa.OpenAnnotationcreateUGCOpenAnnotation(String pi, org.apache.solr.common.SolrDocument doc, boolean urlOnlyTarget) createOpenAnnotation.de.intranda.api.annotation.oa.OpenAnnotationcreateUGCOpenAnnotation(org.apache.solr.common.SolrDocument doc, boolean urlOnlyTarget) createOpenAnnotation.de.intranda.api.annotation.IAnnotationde.intranda.api.annotation.IAnnotationCollectiongetCrowdsourcingAnnotationCollection(URI uri, String pi, boolean urlsOnly, jakarta.servlet.http.HttpServletRequest request) de.intranda.api.annotation.IAnnotationCollectiongetCrowdsourcingAnnotationCollection(URI uri, String pi, Integer page, boolean urlsOnly, jakarta.servlet.http.HttpServletRequest request) getCrowdsourcingAnnotations(String pi, boolean urlOnlyTarget, jakarta.servlet.http.HttpServletRequest request) Get all annotations for the given PI from the DAO, sorted by page number.getCrowdsourcingAnnotationsFromSolr(String pi, boolean urlOnlyTarget, jakarta.servlet.http.HttpServletRequest request) Get all annotations for the given PI from the SOLR index, sorted by page number.Methods inherited from class io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractAnnotationBuilder
getAnnotation, getAnnotationCount, getAnnotationDocument, getAnnotationDocuments, getAnnotationDocuments, getAnnotationDocuments, getAnnotationQuery, getAnnotationQuery, getAnnotationQuery, getAnnotationQuery, getRestBuilder
-
Constructor Details
-
OpenAnnotationBuilder
- Parameters:
apiUrlManager-
-
-
Method Details
-
getCrowdsourcingAnnotationsFromSolr
public Map<Integer,List<de.intranda.api.annotation.oa.OpenAnnotation>> getCrowdsourcingAnnotationsFromSolr(String pi, boolean urlOnlyTarget, jakarta.servlet.http.HttpServletRequest request) throws PresentationException, IndexUnreachableException Get all annotations for the given PI from the SOLR index, sorted by page number. The annotations are stored as DOCTYPE:UGC in the SOLR and are converted to OpenAnnotations here- Parameters:
pi- The persistent identifier of the work to queryurlOnlyTarget- a boolean.request-- Returns:
- A map of page numbers (1-based) mapped to a list of associated annotations
- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getCrowdsourcingAnnotations
public Map<Integer,List<de.intranda.api.annotation.oa.OpenAnnotation>> getCrowdsourcingAnnotations(String pi, boolean urlOnlyTarget, jakarta.servlet.http.HttpServletRequest request) throws DAOException Get all annotations for the given PI from the DAO, sorted by page number. The annotations are stored as DOCTYPE:UGC in the SOLR and are converted to OpenAnnotations here- Parameters:
pi- The persistent identifier of the work to queryurlOnlyTarget- a boolean.request-- Returns:
- A map of page numbers (1-based) mapped to a list of associated annotations
- Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException
-
getCrowdsourcingAnnotation
public de.intranda.api.annotation.IAnnotation getCrowdsourcingAnnotation(String id) throws PresentationException, IndexUnreachableException -
createUGCOpenAnnotation
public de.intranda.api.annotation.oa.OpenAnnotation createUGCOpenAnnotation(org.apache.solr.common.SolrDocument doc, boolean urlOnlyTarget) createOpenAnnotation.
- Parameters:
doc- aSolrDocumentobject.urlOnlyTarget- a boolean.- Returns:
- a
OpenAnnotationobject.
-
createUGCOpenAnnotation
public de.intranda.api.annotation.oa.OpenAnnotation createUGCOpenAnnotation(String pi, org.apache.solr.common.SolrDocument doc, boolean urlOnlyTarget) createOpenAnnotation.
- Parameters:
pi- aStringobject.doc- aSolrDocumentobject.urlOnlyTarget- a boolean.- Returns:
- a
OpenAnnotationobject.
-
createFragmentTarget
public de.intranda.api.annotation.IResource createFragmentTarget(String pi, int pageOrder, String coordString, boolean urlOnlyTarget) - Parameters:
pi-pageOrder-coordString-urlOnlyTarget-- Returns:
IResource
-
createAnnnotationBodyFromUGCDocument
public de.intranda.api.annotation.IResource createAnnnotationBodyFromUGCDocument(org.apache.solr.common.SolrDocument doc) - Parameters:
doc-- Returns:
IResource
-
getCrowdsourcingAnnotationCollection
public de.intranda.api.annotation.IAnnotationCollection getCrowdsourcingAnnotationCollection(URI uri, String pi, boolean urlsOnly, jakarta.servlet.http.HttpServletRequest request) throws DAOException - Parameters:
uri-pi-urlsOnly-request-- Returns:
IAnnotationCollection- Throws:
IndexUnreachableExceptionPresentationExceptionDAOException
-
getCrowdsourcingAnnotationCollection
public de.intranda.api.annotation.IAnnotationCollection getCrowdsourcingAnnotationCollection(URI uri, String pi, Integer page, boolean urlsOnly, jakarta.servlet.http.HttpServletRequest request) throws DAOException - Parameters:
uri-pi-page-urlsOnly-request-- Returns:
IAnnotationCollection- Throws:
DAOException
-