Examples of NodeTypeCreationException


Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

        {

        }
        else
        {
            throw new NodeTypeCreationException("The MappingDescriptor can't be null or empty.");
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

                createSingleNodeType(session, classDescriptors[i]);
            }
        }
        else
        {
            throw new NodeTypeCreationException("The ClassDescriptor can't be null or empty.");
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

            if (classDescriptor.getJcrType() != null &&
                    (classDescriptor.getJcrType().startsWith("nt:")
                    || classDescriptor.getJcrType().startsWith("mix:")))
            {
                throw new NodeTypeCreationException("Namespace nt and mix are reserved namespaces. Please specify your own.");
            }

            if (checkSuperTypes(session.getWorkspace().getNodeTypeManager(),
                    classDescriptor.getJcrSuperTypes()))
            {
                NodeTypeDef nodeTypeDef = getNodeTypeDef(classDescriptor.getJcrType(),
                        classDescriptor.getJcrSuperTypes(),
                        classDescriptor.getClassName());

                List propDefs = new ArrayList();
                List nodeDefs = new ArrayList();
                if (classDescriptor.getFieldDescriptors() != null)
                {
                    Iterator fieldIterator = classDescriptor.getFieldDescriptors().iterator();
                    while (fieldIterator.hasNext())
                    {
                        FieldDescriptor field = (FieldDescriptor) fieldIterator.next();
                        if (!field.isPath()) {
                            propDefs.add(getPropertyDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        }
                    }
                }

                if (classDescriptor.getBeanDescriptors() != null) {
                    Iterator beanIterator = classDescriptor.getBeanDescriptors().iterator();
                    while (beanIterator.hasNext()) {
                        BeanDescriptor field = (BeanDescriptor) beanIterator.next();
                        if (this.isPropertyType(field.getJcrType())) {
                            propDefs.add(getPropertyDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        } else {
                            nodeDefs.add(getNodeDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        }
                    }
                }

                if (classDescriptor.getCollectionDescriptors() != null) {
                    Iterator collectionIterator = classDescriptor.getCollectionDescriptors().iterator();
                    while (collectionIterator.hasNext()) {
                        CollectionDescriptor field = (CollectionDescriptor) collectionIterator.next();
                        if (this.isPropertyType(field.getJcrType())) {
                            propDefs.add(getPropertyDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        } else {
                            nodeDefs.add(getNodeDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        }
                    }
                }

                nodeTypeDef.setPropertyDefs((PropDef[]) propDefs.toArray(new PropDef[propDefs.size()]));
                nodeTypeDef.setChildNodeDefs((NodeDef[]) nodeDefs.toArray(new NodeDef[nodeDefs.size()]));

                list.add(nodeTypeDef);
                createNodeTypesFromList(session, list);
                log.info("Registered JCR node type '" + nodeTypeDef.getName() +
                        "' for class '" + classDescriptor.getClassName() + "'");
            }
            else
            {
                throw new NodeTypeCreationException("JCR supertypes could not be resolved.");
            }
        }
        catch (Exception e)
        {
            log.error("Could not create node types from class descriptor.", e);
            throw new NodeTypeCreationException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

            log.info("Registered " + list.size() + " nodetypes from xml configuration file.");
        }
        catch (Exception e)
        {
            log.error("Could not create node types from configuration file.", e);
            throw new NodeTypeCreationException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

        {
           
        }
        else
        {
            throw new NodeTypeCreationException("The MappingDescriptor can't be null or empty.");
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

                createSingleNodeType(session, classDescriptors[i]);
            }
        }
        else
        {
            throw new NodeTypeCreationException("The ClassDescriptor can't be null or empty.");
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

           
            if (classDescriptor.getJcrType() != null &&
                    (classDescriptor.getJcrType().startsWith("nt:")
                    || classDescriptor.getJcrType().startsWith("mix:")))
            {
                throw new NodeTypeCreationException("Namespace nt and mix are reserved namespaces. Please specify your own.");
            }
           
            if (checkSuperTypes(session.getWorkspace().getNodeTypeManager(),
                    classDescriptor.getJcrSuperTypes()))
            {
                NodeTypeDef nodeTypeDef = getNodeTypeDef(classDescriptor.getJcrType(),
                        classDescriptor.getJcrSuperTypes(),
                        classDescriptor.getClassName());

                List propDefs = new ArrayList();
                List nodeDefs = new ArrayList();
                if (classDescriptor.getFieldDescriptors() != null)
                {
                    Iterator fieldIterator = classDescriptor.getFieldDescriptors().iterator();
                    while (fieldIterator.hasNext())
                    {
                        FieldDescriptor field = (FieldDescriptor) fieldIterator.next();
                        if (!field.isPath()) {
                            propDefs.add(getPropertyDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        }
                    }
                }

                if (classDescriptor.getBeanDescriptors() != null) {
                    Iterator beanIterator = classDescriptor.getBeanDescriptors().iterator();
                    while (beanIterator.hasNext()) {
                        BeanDescriptor field = (BeanDescriptor) beanIterator.next();
                        if (this.isPropertyType(field.getJcrType())) {
                            propDefs.add(getPropertyDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        } else {
                            nodeDefs.add(getNodeDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        }
                    }
                }
               
                if (classDescriptor.getCollectionDescriptors() != null) {
                    Iterator collectionIterator = classDescriptor.getCollectionDescriptors().iterator();
                    while (collectionIterator.hasNext()) {
                        CollectionDescriptor field = (CollectionDescriptor) collectionIterator.next();
                        if (this.isPropertyType(field.getJcrType())) {
                            propDefs.add(getPropertyDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        } else {
                            nodeDefs.add(getNodeDefinition(field.getFieldName(), field, nodeTypeDef.getName()));
                        }
                    }
                }

                nodeTypeDef.setPropertyDefs((PropDef[]) propDefs.toArray(new PropDef[propDefs.size()]));
                nodeTypeDef.setChildNodeDefs((NodeDef[]) nodeDefs.toArray(new NodeDef[nodeDefs.size()]));

                list.add(nodeTypeDef);
                createNodeTypesFromList(session, list);
                log.info("Registered JCR node type '" + nodeTypeDef.getName() +
                        "' for class '" + classDescriptor.getClassName() + "'");
            }
            else
            {
                throw new NodeTypeCreationException("JCR supertypes could not be resolved.");
            }
        }
        catch (Exception e)
        {
            e.printStackTrace();
            log.error("Could not create node types from class descriptor.", e);
            throw new NodeTypeCreationException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

            log.info("Registered " + list.size() + " nodetypes from xml configuration file.");
        }
        catch (Exception e)
        {
            log.error("Could not create node types from configuration file.", e);
            throw new NodeTypeCreationException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

            final ClassDescriptor[] classDescriptors = (ClassDescriptor[])classDescriptorObjects.toArray(new ClassDescriptor[classDescriptorObjects.size()]);
            createNodeTypes(session, classDescriptors);
        }
        else
        {
            throw new NodeTypeCreationException("The MappingDescriptor can't be null or empty.");
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.nodemanagement.exception.NodeTypeCreationException

                createSingleNodeType(session, classDescriptors[i]);
            }
        }
        else
        {
            throw new NodeTypeCreationException("The ClassDescriptor can't be null or empty.");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.