Examples of ObjectContentManagerException


Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

        }

        storeSimpleField(object, objectNode, valueFactory, fieldDescriptor, fieldName, jcrName);
      }
    } catch (ValueFormatException vfe) {
      throw new ObjectContentManagerException("Cannot persist properties of object " + object + ". Value format exception.", vfe);
    } catch (VersionException ve) {
      throw new ObjectContentManagerException("Cannot persist properties of object " + object + ". Versioning exception.", ve);
    } catch (LockException le) {
      throw new ObjectContentManagerException("Cannot persist properties of object " + object + " on locked node.", le);
    } catch (ConstraintViolationException cve) {
      throw new ObjectContentManagerException("Cannot persist properties of object " + object + ". Constraint violation.", cve);
    } catch (RepositoryException re) {
      throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Cannot persist properties of object "
          + object, re);
    }
  }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

            }

            return collection;
        }
        catch(ValueFormatException vfe) {
          throw new ObjectContentManagerException("Cannot get the collection field : "
                  + collectionDescriptor.getFieldName()
                  + "for class " + collectionDescriptor.getClassDescriptor().getClassName(),
                  vfe);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

          PropertyDefinition definition = getPropertyDefinition(objectNode, fieldDescriptor.getJcrName());
          if (definition != null)
          {
              if (definition.isMandatory() && !definition.isAutoCreated())
              {
                  throw new ObjectContentManagerException("Class of type:" + fieldDescriptor.getClassDescriptor().getClassName()
                        + " has property: " + fieldDescriptor.getFieldName() + " declared as JCR property: "
                        + fieldDescriptor.getJcrName() + " This property is mandatory but property in bean has value null");
              }
          }
      }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

            }

            parentNode.setProperty(jcrName, values);
        }
        catch(ValueFormatException vfe) {
            throw new ObjectContentManagerException("Cannot insert collection field : "
                    + collectionDescriptor.getFieldName()
                    + " of class "
                    + collectionDescriptor.getClassDescriptor().getClassName(), vfe);
        }
  }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

      String nodeName = NodeUtil.getNodeName(path);
      Node parentNode = (Node) session.getItem(parentPath);
      this.insert(session, parentNode, nodeName, object);

    } catch (PathNotFoundException pnfe) {
      throw new ObjectContentManagerException("Impossible to insert the object at '" + path + "'", pnfe);
    } catch (RepositoryException re) {
      throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to insert the object at '" + path
          + "'", re);
    }
  }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

      objectNode = parentNode.addNode(nodeName, jcrType);

    } catch (NoSuchNodeTypeException nsnte) {
      throw new JcrMappingException("Unknown node type " + jcrType + " for mapped class " + object.getClass(), nsnte);
    } catch (RepositoryException re) {
      throw new ObjectContentManagerException("Cannot create new node of type " + jcrType + " from mapped class "
          + object.getClass(), re);
    }

    String[] mixinTypes = classDescriptor.getJcrMixinTypes();
    String mixinTypeName = null;
    try {

      // Add mixin types
      if (null != classDescriptor.getJcrMixinTypes()) {
        for (int i = 0; i < mixinTypes.length; i++) {
          mixinTypeName = mixinTypes[i].trim();
          objectNode.addMixin(mixinTypeName);
        }
      }

      // Add mixin types defined in the associated interfaces
      if (!classDescriptor.hasDiscriminator() && classDescriptor.hasInterfaces()) {
        Iterator interfacesIterator = classDescriptor.getImplements().iterator();
        while (interfacesIterator.hasNext()) {
          String interfaceName = (String) interfacesIterator.next();
          ClassDescriptor interfaceDescriptor = mapper
              .getClassDescriptorByClass(ReflectionUtils.forName(interfaceName));
          objectNode.addMixin(interfaceDescriptor.getJcrType().trim());
        }
      }

      // If required, add the discriminator node type
      if (classDescriptor.hasDiscriminator()) {
        mixinTypeName = ManagerConstant.DISCRIMINATOR_NODE_TYPE;
        objectNode.addMixin(mixinTypeName);
        objectNode.setProperty(ManagerConstant.DISCRIMINATOR_PROPERTY_NAME, ReflectionUtils.getBeanClass(object)
            .getName());
      }


    } catch (NoSuchNodeTypeException nsnte) {
      throw new JcrMappingException("Unknown mixin type " + mixinTypeName + " for mapped class " + object.getClass(), nsnte);
    } catch (RepositoryException re) {
      throw new ObjectContentManagerException("Cannot create new node of type " + jcrType + " from mapped class "
          + object.getClass(), re);
    }

    simpleFieldsHelp.storeSimpleFields(session, object, classDescriptor, objectNode);
    insertBeanFields(session, object, classDescriptor, objectNode);
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

      String parentPath = NodeUtil.getParentPath(path);
      String nodeName = NodeUtil.getNodeName(path);
      Node parentNode = (Node) session.getItem(parentPath);
      this.update(session, parentNode, nodeName, object);
    } catch (PathNotFoundException pnfe) {
      throw new ObjectContentManagerException("Impossible to update the object at '" + path + "'", pnfe);
    } catch (RepositoryException re) {
      throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to update the object at '" + path
          + "'", re);
    }
  }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

                }
            }

            return collection;
        } catch (ValueFormatException vfe) {
            throw new ObjectContentManagerException("Cannot get the collection field : "
                + collectionDescriptor.getFieldName() + "for class "
                + collectionDescriptor.getClassDescriptor().getClassName(), vfe);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

      simpleFieldsHelp.storeSimpleFields(session, object, classDescriptor, objectNode);
      updateBeanFields(session, object, classDescriptor, objectNode);
      updateCollectionFields(session, object, classDescriptor, objectNode);
    } catch (PathNotFoundException pnfe) {
      throw new ObjectContentManagerException("Impossible to update the object: " + nodeName + " at node : " + parentNode, pnfe);
    } catch (RepositoryException re) {
      throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to update the object: "
          + nodeName + " at node : " + parentNode, re);
    }
  }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.exception.ObjectContentManagerException

      return object;

    } catch (PathNotFoundException pnfe) {
      // HINT should never get here
      throw new ObjectContentManagerException("Impossible to get the object at " + path, pnfe);
    } catch (RepositoryException re) {
      throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to get the object at " + path, re);
    }
  }
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.