Class TranskribusUtils
java.lang.Object
io.goobi.viewer.model.transkribus.TranskribusUtils
TranskribusUtils class.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.jdom2.Document
auth.protected static JobStatus
checkJobStatus
(String baseUrl, String sessionId, String jobId) checkJobStatus.protected static String
createCollection
(String baseUrl, String sessionId, String collectionName) createCollection.static String
getCollectionId
(String baseUrl, String sessionId, String collectionName) Returns the ID of the first collection that has the given collection name.protected static boolean
grantCollectionPrivsToViewer
(String baseUrl, String sessionId, String collectionId, String recipientUserId, boolean sendMail) grantCollectionPrivsToViewer.static TranskribusJob
ingestRecord
(String restApiUrl, TranskribusSession userSession, String pi, String metsResolverUrlRoot) ingestRecord.protected static TranskribusJob
ingestRecordToCollections
(String baseUrl, TranskribusSession session, String pi, String metsUrl, String userCollectionId, String viewerCollectionId) ingestRecordToCollections.static TranskribusSession
login.
-
Field Details
-
TRANSRIBUS_REST_URL
ConstantTRANSRIBUS_REST_URL="https://transkribus.eu/TrpServer/rest/"
.- See Also:
-
TRANSRIBUS_REST_TESTING_URL
ConstantTRANSRIBUS_REST_TESTING_URL="https://transkribus.eu/TrpServerTesting"{trunked}
.- See Also:
-
-
Method Details
-
ingestRecord
public static TranskribusJob ingestRecord(String restApiUrl, TranskribusSession userSession, String pi, String metsResolverUrlRoot) throws IOException, HTTPException, org.jdom2.JDOMException, DAOException ingestRecord.
- Parameters:
restApiUrl
- aString
object.userSession
- aTranskribusSession
object.pi
- aString
object.metsResolverUrlRoot
- Root of the METS resolver URL (without the identifier).- Returns:
- a
TranskribusJob
object. - Throws:
IOException
- if any.HTTPException
- if any.org.jdom2.JDOMException
- if any.DAOException
- if any.
-
login
public static TranskribusSession login(String baseUrl, String userName, String password) throws IOException, org.jdom2.JDOMException login.
- Parameters:
baseUrl
- aString
object.userName
- aString
object.password
- aString
object.- Returns:
- a
TranskribusSession
object. - Throws:
IOException
- if any.org.jdom2.JDOMException
- if any.
-
auth
public static org.jdom2.Document auth(String baseUrl, String userName, String password) throws IOException, org.jdom2.JDOMException auth.
- Parameters:
baseUrl
- aString
object.userName
- aString
object.password
- aString
object.- Returns:
- JDOM object containing the API response
- Throws:
IOException
- if any.org.jdom2.JDOMException
- if any.
-
getCollectionId
public static String getCollectionId(String baseUrl, String sessionId, String collectionName) throws IOException, HTTPException Returns the ID of the first collection that has the given collection name.- Parameters:
baseUrl
- aString
object.sessionId
- aString
object.collectionName
- aString
object.- Returns:
- a
String
object. - Throws:
IOException
- if any.HTTPException
- if any.
-
createCollection
protected static String createCollection(String baseUrl, String sessionId, String collectionName) throws IOException createCollection.
- Parameters:
baseUrl
- aString
object.sessionId
- aString
object.collectionName
- aString
object.- Returns:
- a
String
object. - Throws:
IOException
- if any.
-
grantCollectionPrivsToViewer
protected static boolean grantCollectionPrivsToViewer(String baseUrl, String sessionId, String collectionId, String recipientUserId, boolean sendMail) throws IOException grantCollectionPrivsToViewer.
- Parameters:
baseUrl
- aString
object.sessionId
- aString
object.collectionId
- aString
object.recipientUserId
- aString
object.sendMail
- a boolean.- Returns:
- a boolean.
- Throws:
IOException
- if any.
-
ingestRecordToCollections
protected static TranskribusJob ingestRecordToCollections(String baseUrl, TranskribusSession session, String pi, String metsUrl, String userCollectionId, String viewerCollectionId) throws IOException ingestRecordToCollections.
- Parameters:
baseUrl
- aString
object.session
- aTranskribusSession
object.pi
- aString
object.metsUrl
- aString
object.userCollectionId
- aString
object.viewerCollectionId
- aString
object.- Returns:
- a
TranskribusJob
object. - Throws:
IOException
- if any. o
-
checkJobStatus
protected static JobStatus checkJobStatus(String baseUrl, String sessionId, String jobId) throws IOException, HTTPException checkJobStatus.
- Parameters:
baseUrl
- aString
object.sessionId
- aString
object.jobId
- aString
object.- Returns:
- a
JobStatus
object. - Throws:
IOException
- if any.HTTPException
- if any.
-