Class TranskribusUtils
java.lang.Object
io.goobi.viewer.model.transkribus.TranskribusUtils
TranskribusUtils class.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jdom2.Documentauth.protected static JobStatuscheckJobStatus(String baseUrl, String sessionId, String jobId) checkJobStatus.protected static StringcreateCollection(String baseUrl, String sessionId, String collectionName) createCollection.static StringgetCollectionId(String baseUrl, String sessionId, String collectionName) Returns the ID of the first collection that has the given collection name.protected static booleangrantCollectionPrivsToViewer(String baseUrl, String sessionId, String collectionId, String recipientUserId, boolean sendMail) grantCollectionPrivsToViewer.static TranskribusJobingestRecord(String restApiUrl, TranskribusSession userSession, String pi, String metsResolverUrlRoot) ingestRecord.protected static TranskribusJobingestRecordToCollections(String baseUrl, TranskribusSession session, String pi, String metsUrl, String userCollectionId, String viewerCollectionId) ingestRecordToCollections.static TranskribusSessionlogin.
-
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- aStringobject.userSession- aTranskribusSessionobject.pi- aStringobject.metsResolverUrlRoot- Root of the METS resolver URL (without the identifier).- Returns:
- a
TranskribusJobobject. - 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- aStringobject.userName- aStringobject.password- aStringobject.- Returns:
- a
TranskribusSessionobject. - 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- aStringobject.userName- aStringobject.password- aStringobject.- 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- aStringobject.sessionId- aStringobject.collectionName- aStringobject.- Returns:
- a
Stringobject. - Throws:
IOException- if any.HTTPException- if any.
-
createCollection
protected static String createCollection(String baseUrl, String sessionId, String collectionName) throws IOException createCollection.
- Parameters:
baseUrl- aStringobject.sessionId- aStringobject.collectionName- aStringobject.- Returns:
- a
Stringobject. - Throws:
IOException- if any.
-
grantCollectionPrivsToViewer
protected static boolean grantCollectionPrivsToViewer(String baseUrl, String sessionId, String collectionId, String recipientUserId, boolean sendMail) throws IOException grantCollectionPrivsToViewer.
- Parameters:
baseUrl- aStringobject.sessionId- aStringobject.collectionId- aStringobject.recipientUserId- aStringobject.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- aStringobject.session- aTranskribusSessionobject.pi- aStringobject.metsUrl- aStringobject.userCollectionId- aStringobject.viewerCollectionId- aStringobject.- Returns:
- a
TranskribusJobobject. - Throws:
IOException- if any. o
-
checkJobStatus
protected static JobStatus checkJobStatus(String baseUrl, String sessionId, String jobId) throws IOException, HTTPException checkJobStatus.
- Parameters:
baseUrl- aStringobject.sessionId- aStringobject.jobId- aStringobject.- Returns:
- a
JobStatusobject. - Throws:
IOException- if any.HTTPException- if any.
-