use of org.wso2.carbon.apimgt.persistence.exceptions.DocumentationPersistenceException in project carbon-apimgt by wso2.
the class AbstractAPIManager method getDocumentationContent.
@Override
public DocumentationContent getDocumentationContent(String apiId, String docId, String organization) throws APIManagementException {
try {
DocumentContent content = apiPersistenceInstance.getDocumentationContent(new Organization(organization), apiId, docId);
DocumentationContent docContent = null;
if (content != null) {
docContent = DocumentMapper.INSTANCE.toDocumentationContent(content);
} else {
String msg = "Failed to get the document content. Artifact corresponding to document id " + docId + " does not exist";
throw new APIMgtResourceNotFoundException(msg);
}
return docContent;
} catch (DocumentationPersistenceException e) {
throw new APIManagementException("Error while retrieving document content ", e);
}
}
Aggregations