Package org.apache.chemistry.opencmis.commons.exceptions

Examples of org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException


        case CMIS_POLICY:
            return new PolicyImpl((SessionImpl) this.session, type, objectData, context);
        case CMIS_RELATIONSHIP:
            return new RelationshipImpl((SessionImpl) this.session, type, objectData, context);
        default:
            throw new CmisRuntimeException("unsupported type: " + objectData.getBaseTypeId());
        }
    }
View Full Code Here


        }

        try {
            m.invoke(null, context, service, repositoryId, request, response);
        } catch (IllegalAccessException e) {
            throw new CmisRuntimeException("Internal error!", e);
        } catch (InvocationTargetException e) {
            if (e.getCause() instanceof CmisBaseException) {
                throw (CmisBaseException) e.getCause();
            } else {
                throw new CmisRuntimeException(e.getMessage(), e);
            }
        }

        return true;
    }
View Full Code Here

     */
    public static void writeObjectEntry(CmisService service, AtomEntry entry, ObjectData object,
            List<ObjectInFolderContainer> children, String repositoryId, String pathSegment,
            String relativePathSegment, UrlBuilder baseUrl, boolean isRoot) throws XMLStreamException, JAXBException {
        if (object == null) {
            throw new CmisRuntimeException("Object not set!");
        }

        ObjectInfo info = service.getObjectInfo(repositoryId, object.getId());
        if (info == null) {
            throw new CmisRuntimeException("Object Info not found for: " + object.getId());
        }

        // start
        entry.startEntry(isRoot);

View Full Code Here

     */
    public static void writeContentChangesObjectEntry(CmisService service, AtomEntry entry, ObjectData object,
            List<ObjectInFolderContainer> children, String repositoryId, String pathSegment,
            String relativePathSegment, UrlBuilder baseUrl, boolean isRoot) throws XMLStreamException, JAXBException {
        if (object == null) {
            throw new CmisRuntimeException("Object not set!");
        }

        ObjectInfo info = null;
        try {
            info = service.getObjectInfo(repositoryId, object.getId());
View Full Code Here

    protected CmisBaseException createCmisException(Exception e) {
        if (e == null) {
            // should never happen
            // if it happens its the fault of the framework...

            return new CmisRuntimeException("Unknown exception!");
        } else if (e instanceof CmisBaseException) {
            return (CmisBaseException) e;
        } else {
            // should not happen if the connector works correctly
            // it's alarming enough to log the exception
            log.warn(e);

            return new CmisRuntimeException(e.getMessage(), e);
        }
    }
View Full Code Here

            // get services factory
            CmisServiceFactory factory = (CmisServiceFactory) getServletContext().getAttribute(
                    CmisRepositoryContextListener.SERVICES_FACTORY);

            if (factory == null) {
                throw new CmisRuntimeException("Service factory not available! Configuration problem?");
            }

            // get the service
            service = factory.getService(context);
View Full Code Here

            } else if (SessionParameter.WEBSERVICES_POLICY_SERVICE.equals(serviceKey)) {
                serviceObject = new PolicyService(wsdlUrl, new QName(CMIS_NAMESPACE, POLICY_SERVICE));
            } else if (SessionParameter.WEBSERVICES_ACL_SERVICE.equals(serviceKey)) {
                serviceObject = new ACLService(wsdlUrl, new QName(CMIS_NAMESPACE, ACL_SERVICE));
            } else {
                throw new CmisRuntimeException("Cannot find Web Services service object [" + serviceKey + "]!");
            }
        } catch (CmisBaseException ce) {
            throw ce;
        } catch (Exception e) {
            String message = "Cannot initalize Web Services service object [" + serviceKey + "]: " + e.getMessage();
View Full Code Here

            } else if (service instanceof PolicyService) {
                portObject = ((PolicyService) service).getPolicyServicePort(new MTOMFeature());
            } else if (service instanceof ACLService) {
                portObject = ((ACLService) service).getACLServicePort(new MTOMFeature());
            } else {
                throw new CmisRuntimeException("Cannot find Web Services service object!");
            }

            // add SOAP and HTTP authentication headers
            AuthenticationProvider authProvider = CmisBindingsHelper.getAuthenticationProvider(getSession());
            Map<String, List<String>> httpHeaders = null;
View Full Code Here

        Holder<String> checkOutId = new Holder<String>(parser.getId());
        service.checkOut(repositoryId, checkOutId, null, null);

        ObjectInfo objectInfo = service.getObjectInfo(repositoryId, checkOutId.getValue());
        if (objectInfo == null) {
            throw new CmisRuntimeException("Object Info is missing!");
        }

        ObjectData object = objectInfo.getObject();
        if (object == null) {
            throw new CmisRuntimeException("Object is null!");
        }

        if (object.getId() == null) {
            throw new CmisRuntimeException("Object Id is null!");
        }

        // set headers
        UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);
        String location = compileUrl(baseUrl, RESOURCE_ENTRY, object.getId());
View Full Code Here

        // execute
        List<ObjectData> versions = service.getAllVersions(repositoryId, objectId, versionSeriesId, filter,
                includeAllowableActions, null);

        if (versions == null || versions.isEmpty()) {
            throw new CmisRuntimeException("Version list is null or empty!");
        }

        // set headers
        response.setStatus(HttpServletResponse.SC_OK);
        response.setContentType(Constants.MEDIATYPE_FEED);
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.