Examples of ObjectContentManagerException


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

        Workspace workspace = session.getWorkspace();
        try {
            workspace.copy(srcPath, destPath);

        } catch (javax.jcr.nodetype.ConstraintViolationException cve) {
            throw new ObjectContentManagerException("Cannot copy the object from " + srcPath + " to " + destPath + "."
                    + "Violation of a nodetype or attempt to copy under property detected ", cve);

        } catch (javax.jcr.version.VersionException ve) {
            throw new VersionException("Cannot copy the object from " + srcPath + " to " + destPath + "." + "Parent node of source or destination is versionable and checked in ",
                    ve);

        } catch (javax.jcr.AccessDeniedException ade) {
            throw new ObjectContentManagerException("Cannot copy the object from " + srcPath + " to " + destPath + "." + " Session does not have access permissions", ade);

        } catch (javax.jcr.PathNotFoundException pnf) {
            throw new ObjectContentManagerException("Cannot copy the object from " + srcPath + " to " + destPath + "." + "Node at source or destination does not exist ", pnf);

        } catch (javax.jcr.ItemExistsException ie) {
            throw new ObjectContentManagerException("Cannot copy the object from " + srcPath + " to " + destPath + "." + "It might already exist at destination path.", ie);

        } catch (javax.jcr.lock.LockException le) {
            throw new ObjectContentManagerException("Cannot copy the object from " + srcPath + " to " + destPath + "." + "Violation of a lock detected", le);

        } catch (javax.jcr.RepositoryException re) {
            throw new ObjectContentManagerException("Cannot copy the node from " + srcPath + " to " + destPath + ".", 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

                        value);
                    parentNode.setProperty(name, jcrValue);
                }
            }
        } 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

        AtomicTypeConverter atc = (AtomicTypeConverter) atomicTypeConverters.get(elementClass);
        if (atc != null) {
            return atc;
        }
       
        throw new ObjectContentManagerException(
            "Cannot get AtomicTypeConverter for element class "
                + elementClassName + " of class "
                + collectionDescriptor.getClassDescriptor().getClassName());
    }
View Full Code Here

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

            }

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

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

            }

            parentNode.setProperty(jcrName, values);
        }
        catch(Exception e) {
            throw new ObjectContentManagerException("Cannot insert collection field : "
                    + collectionDescriptor.getFieldName()
                    + " of class "
                    + collectionDescriptor.getClassDescriptor().getClassName(), e);
        }
  }
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

            }

            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

      }
     
      String uuid = (String) ReflectionUtils.getNestedProperty(object, fieldDescriptor.getFieldName());
      parentNode.setProperty(beanDescriptor.getJcrName(), uuid, PropertyType.REFERENCE);
    } catch (Exception e) {
      throw new ObjectContentManagerException("Impossible to insert the bean attribute into the repository", e);
    }
  }
View Full Code Here

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

      if (classDescriptor.usesNodeTypePerHierarchyStrategy() && classDescriptor.hasDiscriminator())
      {
        if (!node.hasProperty(ManagerConstant.DISCRIMINATOR_PROPERTY_NAME))
        {
          throw new ObjectContentManagerException("Class '"
              + classDescriptor.getClassName()
              + "' has not a discriminator property.");
        }
      }     
      while (fieldDescriptorIterator.hasNext()) {
        FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next();

        String fieldName = fieldDescriptor.getFieldName();
        String propertyName = fieldDescriptor.getJcrName();

        if (fieldDescriptor.isPath()) {
          // HINT: lazy initialize target bean - The bean can be null
          // when it is inline
          if (null == initializedBean) {
            initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());
          }

          ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath());

        } else {
          if (fieldDescriptor.isUuid()) {
            if (null == initializedBean) {
              initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());
            }

            ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getUUID());

          } else {
            initializedBean = retrieveSimpleField(classDescriptor, node, initializedBean, fieldDescriptor, fieldName, propertyName);
          }
        }

      }
    } catch (ValueFormatException vfe) {
      throw new ObjectContentManagerException(
          "Cannot retrieve properties of object " + object + " from node " + node, vfe);
    } catch (RepositoryException re) {
      throw new org.apache.jackrabbit.ocm.exception.RepositoryException( "Cannot retrieve properties of object " + object
              + " from node " + node, 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.