public abstract class AbstractWeblinkService extends RestService
RestService
basis class with helper methods
for the weblink services.LOGGER
Constructor and Description |
---|
AbstractWeblinkService() |
Modifier and Type | Method and Description |
---|---|
static String |
appendToFilename(String filename,
String appendix)
Appends the given appendix to the given filename.
|
protected static InputStream |
getContent(com.saperion.connector.SaClassicConnector connector,
String xhdoc,
String field,
String id,
int element)
Gets the content stream of a document from the backend.
|
protected String |
getFilenameFromDocElement(String xhdoc,
com.saperion.connector.SaClassicConnector connector,
boolean currentRevision,
int element,
String field,
String id)
Gets the filename from doc element.
|
protected static String |
getHDoc(com.saperion.connector.SaClassicConnector connector,
String archive,
String field,
String id,
int element,
boolean released,
boolean currentRevision)
Gets the hdoc.
|
protected static Object |
getTypedId(com.saperion.connector.SaClassicConnector connector,
String archive,
String field,
String id)
Gets the typed id.
|
protected static void |
logAndThrowWebException(String field,
int element,
String id,
Exception e,
javax.ws.rs.core.Response.Status status)
Logs a error message (generated by the given values) and throws a.
|
protected static void |
sendBadRequestMessage() |
checkConnection, getConnection
protected static String getHDoc(com.saperion.connector.SaClassicConnector connector, String archive, String field, String id, int element, boolean released, boolean currentRevision)
connector
- the classic connectorarchive
- the archive/DDC to queryfield
- the fieldid
- the idelement
- the elementreleased
- the releasedcurrentRevision
- the current revisionprotected static void logAndThrowWebException(String field, int element, String id, Exception e, javax.ws.rs.core.Response.Status status)
field
- the fieldelement
- the elementid
- the ide
- the estatus
- the statusjavax.ws.rs.WebApplicationException
- the web application exception WebApplicationException
with the error
message and given status.protected static void sendBadRequestMessage()
protected static Object getTypedId(com.saperion.connector.SaClassicConnector connector, String archive, String field, String id)
connector
- the connector to get DB Definitions of the archivearchive
- the archive / DDC to find out type of given fieldfield
- the field to convert idid
- the id to convertprotected String getFilenameFromDocElement(String xhdoc, com.saperion.connector.SaClassicConnector connector, boolean currentRevision, int element, String field, String id)
xhdoc
- the xhdoc of documentconnector
- the classic connectorcurrentRevision
- true, of current revision of document is neededelement
- the element number of documentfield
- the fieldid
- the idpublic static String appendToFilename(String filename, String appendix)
filename
- The filename to be appended.appendix
- The appendix to append the given filename with.protected static InputStream getContent(com.saperion.connector.SaClassicConnector connector, String xhdoc, String field, String id, int element)
connector
- the classic connectorxhdoc
- the xhdoc of document to get contentfield
- the field to identify documentid
- the id to identify value of document fieldelement
- the element number of documentCopyright © 2020 Hyland Software Germany GmbH. All rights reserved.