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

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


        case 407:
            return new CmisProxyAuthenticationException(message, errorContent, t);
        case 409:
            return new CmisConstraintException(message, errorContent, t);
        default:
            return new CmisRuntimeException(message, errorContent, t);
        }
    }
View Full Code Here


        // execute
        ObjectList relationships = service.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
                relationshipDirection, typeId, renditionFilter, includeAllowableActions, maxItems, skipCount, null);

        if (relationships == null) {
            throw new CmisRuntimeException("Relationships are null!");
        }

        TypeCache typeCache = new TypeCache(repositoryId, service);
        JSONObject jsonChildren = JSONConverter.convert(relationships, typeCache);
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

                    }
                    return false;
                }
                catch (RepositoryException e) {
                    log.debug(e.getMessage(), e);
                    throw new CmisRuntimeException(e.getMessage(), e);
                }
            }
        };
    }
View Full Code Here

    public IdentifierMap getIdentifierMap(String typeId) {
        JcrTypeHandler typeHandler = getTypeHandler(typeId);
        IdentifierMap identifierMap = typeHandler.getIdentifierMap();
        if (identifierMap == null) {
            throw new CmisRuntimeException("Not supported: query for type " + typeId);
        }
        return identifierMap;
    }
View Full Code Here

        } else if (typeDefinition instanceof RelationshipTypeDefinition) {
            return new RelationshipTypeImpl(this.session, (RelationshipTypeDefinition) typeDefinition);
        } else if (typeDefinition instanceof PolicyTypeDefinition) {
            return new PolicyTypeImpl(this.session, (PolicyTypeDefinition) typeDefinition);
        } else if (typeDefinition == null) {
            throw new CmisRuntimeException("No base type supplied!");
        } else {
            throw new CmisRuntimeException("Unknown base type! Received " + typeDefinition.getClass().getName());
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    protected <T> Property<T> convertProperty(ObjectType objectType, PropertyData<T> pd) {
        PropertyDefinition<T> definition = (PropertyDefinition<T>) objectType.getPropertyDefinitions().get(pd.getId());
        if (definition == null) {
            // property without definition
            throw new CmisRuntimeException("Property '" + pd.getId() + "' doesn't exist!");
        }
        return createProperty(definition, pd.getValues());
    }
View Full Code Here

        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

                createContentStream(request), versioningState, createPolicies(cp), createAddAcl(cp),
                createRemoveAcl(cp), null);

        ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
        if (object == null) {
            throw new CmisRuntimeException("New document is null!");
        }

        // return object
        JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
View Full Code Here

        TypeCache typeCache = new TypeCacheImpl(repositoryId, service);

        ObjectData sourceDoc = getSimpleObject(service, repositoryId, sourceId);
        PropertyData<?> sourceTypeId = sourceDoc.getProperties().getProperties().get(PropertyIds.OBJECT_TYPE_ID);
        if (sourceTypeId == null || sourceTypeId.getFirstValue() == null) {
            throw new CmisRuntimeException("Source object has no type!?!");
        }

        String newObjectId = service.createDocumentFromSource(repositoryId, sourceId,
                createProperties(cp, sourceTypeId.getFirstValue().toString(), typeCache), folderId, versioningState,
                createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);

        ObjectData object = getSimpleObject(service, repositoryId, newObjectId);
        if (object == null) {
            throw new CmisRuntimeException("New document is null!");
        }

        // return object
        JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
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.