Search in sources :

Example 61 with DataAccessException

use of com.centurylink.mdw.common.exception.DataAccessException 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

DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)61 IOException (java.io.IOException)32 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)25 JSONException (org.json.JSONException)21 XmlException (org.apache.xmlbeans.XmlException)19 RemoteException (java.rmi.RemoteException)18 JSONObject (org.json.JSONObject)12 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)10 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)10 HttpHelper (com.centurylink.mdw.common.utilities.HttpHelper)8 FileNotFoundException (java.io.FileNotFoundException)8 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)7 RestfulServer (com.centurylink.mdw.designer.utils.RestfulServer)6 PackageVO (com.centurylink.mdw.model.value.process.PackageVO)5 Graph (com.centurylink.mdw.designer.display.Graph)4 SubGraph (com.centurylink.mdw.designer.display.SubGraph)4 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)4 File (java.io.File)4 MDWStatusMessageDocument (com.centurylink.mdw.bpm.MDWStatusMessageDocument)3