throw new CmisInvalidArgumentException("Cannot create object, a type with id " + typeId + " is unknown");
}
// check if the given type is a document type
BaseTypeId typeBaseId = typeDefC.getTypeDefinition().getBaseTypeId();
StoredObject so = null;
if (typeBaseId.equals(InMemoryDocumentTypeDefinition.getRootDocumentType().getBaseTypeId())) {
so = createDocumentIntern(context, repositoryId, properties, folderId, contentStream, versioningState, null, null,
null, null);
} else if (typeBaseId.equals(InMemoryFolderTypeDefinition.getRootFolderType().getBaseTypeId())) {
so = createFolderIntern(context, repositoryId, properties, folderId, null, null, null, null);
} else if (typeBaseId.equals(InMemoryPolicyTypeDefinition.getRootPolicyType().getBaseTypeId())) {
so = createPolicyIntern(context, repositoryId, properties, folderId, null, null, null, null);
} else if (typeBaseId.equals(InMemoryRelationshipTypeDefinition.getRootRelationshipType().getBaseTypeId())) {
so = createRelationshipIntern(context, repositoryId, properties, null, null, null, null);
} else {
LOG.error("The type contains an unknown base object id, object can't be created");
}
// Make a call to getObject to convert the resulting id into an
// ObjectData
TypeDefinition td = typeDefC.getTypeDefinition();
ObjectData od = PropertyCreationHelper.getObjectData(td, so, null, context.getUsername(), false,
IncludeRelationships.NONE, null, false, false, extension);
if (context.isObjectInfoRequired()) {
ObjectInfoImpl objectInfo = new ObjectInfoImpl();
fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, od, objectInfo);
objectInfos.addObjectInfo(objectInfo);
}
return so != null ? so.getId() : null;
}