Search in sources :

Example 21 with DataAccessOfflineException

use of com.centurylink.mdw.dataaccess.DataAccessOfflineException in project mdw-designer by CenturyLinkCloud.

the class RuntimeDataAccessRest method getDocument.

public DocumentVO getDocument(Long documentId) throws DataAccessException {
    try {
        String pathWithArgs = "DocumentValues/" + documentId;
        if (!getServer().isSchemaVersion61())
            pathWithArgs = "DocumentValue?format=json&id=" + documentId;
        String response = getServer().invokeResourceServiceRaw(pathWithArgs);
        DocumentVO docVO = new DocumentVO();
        docVO.setContent(response);
        docVO.setDocumentId(documentId);
        return docVO;
    } catch (IOException ex) {
        throw new DataAccessOfflineException(ex.getMessage(), ex);
    } catch (Exception ex) {
        throw new DataAccessException(ex.getMessage(), ex);
    }
}
Also used : DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) DocumentVO(com.centurylink.mdw.model.value.variable.DocumentVO) IOException(java.io.IOException) JSONException(org.json.JSONException) DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) IOException(java.io.IOException) XmlException(org.apache.xmlbeans.XmlException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Aggregations

DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)21 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)19 IOException (java.io.IOException)19 XmlException (org.apache.xmlbeans.XmlException)14 JSONException (org.json.JSONException)14 JSONObject (org.json.JSONObject)7 FileNotFoundException (java.io.FileNotFoundException)4 RemoteException (java.rmi.RemoteException)4 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)3 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)3 ProcessList (com.centurylink.mdw.model.value.process.ProcessList)3 ActionRequestMessage (com.centurylink.mdw.common.service.types.ActionRequestMessage)2 ActionCancelledException (com.centurylink.mdw.common.utilities.timer.ActionCancelledException)2 ProgressMonitor (com.centurylink.mdw.common.utilities.timer.ProgressMonitor)2 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)2 SwtProgressMonitor (com.centurylink.mdw.plugin.designer.SwtProgressMonitor)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ArrayList (java.util.ArrayList)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)2