Package org.apache.jackrabbit.ocm.manager.collectionconverter

Examples of org.apache.jackrabbit.ocm.manager.collectionconverter.ManageableObjects


                return null;
            }
            Property property = parentNode.getProperty(jcrName);
            Value[] values = property.getValues();

            ManageableObjects objects = ManageableObjectsUtil.getManageableObjects(collectionFieldClass);
            for (int i = 0; i < values.length; i++) {

              if (objects instanceof ManageableCollection)
                    ((ManageableCollection)objects).addObject(values[i].getString());
              else
                throw new ObjectContentManagerException(
                    "Unsupported data type in ReferenceCollectionConverter : " + objects.getClass().getName());
            }

            return objects;
        }
        catch(ValueFormatException vfe) {
View Full Code Here


    protected ManageableObjects doGetCollection(Session session,
                                                   Node parentNode,
                                                   CollectionDescriptor collectionDescriptor,
                                                   Class collectionFieldClass) throws RepositoryException {
      ClassDescriptor elementClassDescriptor = mapper.getClassDescriptorByClass( ReflectionUtils.forName(collectionDescriptor.getElementClassName()));
        ManageableObjects objects = ManageableObjectsUtil.getManageableObjects(collectionFieldClass);

        NodeIterator nodes = this.getCollectionNodes(session, parentNode, elementClassDescriptor.getJcrType());

        if (nodes == null || nodes.getSize() == 0)
        {
View Full Code Here

        if (parentNode == null || !parentNode.hasNode(jcrName)) {
            return null;
        }

        ManageableObjects objects = ManageableObjectsUtil.getManageableObjects(collectionFieldClass);
        Node collectionNode = parentNode.getNode(jcrName);
        NodeIterator children = collectionNode.getNodes();
        Class elementClass = ReflectionUtils.forName(collectionDescriptor.getElementClassName());

        while (children.hasNext()) {
View Full Code Here

                return null;
            }
            Property property = parentNode.getProperty(jcrName);
            Value[] values = property.getValues();

            ManageableObjects objects = ManageableObjectsUtil.getManageableObjects(collectionFieldClass);
            String elementClassName = collectionDescriptor.getElementClassName();
            Class elementClass = ReflectionUtils.forName(elementClassName);
            // For multi value collections, only Collections are supported
            if (! (objects instanceof ManageableCollection))
            {
View Full Code Here

    if (session == null) {
      throw new IllegalStateException("Session null, probably because bean was serialized. Impossible to lazy load.");
    }

    ManageableObjects objects = collectionConverter.getCollection(session, collectionParentNode, collectionDescriptor,
        collectionFieldClass);
    Object target = objects.getObjects();
    clean();
    return target;
  }
View Full Code Here

            NodeIterator ni = parentNode.getNodes(jcrName);
            if (!ni.hasNext()) {
                return null;
            }

            ManageableObjects objects = ManageableObjectsUtil.getManageableObjects(collectionFieldClass);
            while (ni.hasNext()) {
                Node node = ni.nextNode();

                // ignore protected nodes here
                if (node.getDefinition().isProtected()) {
View Full Code Here

            Value[] values = property.getValues();
            if (values == null || values.length <= 0){
              return null;
            }
           
            ManageableObjects objects = ManageableObjectsUtil.getManageableObjects(collectionFieldClass);
            for (int i = 0; i < values.length; i++) {
                ((ManageableCollection) objects).addObject(enumConverter.getObject(values[i]));
            }

            return objects;
View Full Code Here

            PropertyIterator pi = parentNode.getProperties(jcrName);
            if (!pi.hasNext()) {
                return null;
            }

            ManageableObjects objects = ManageableObjectsUtil.getManageableObjects(collectionFieldClass);
            AtomicTypeConverter atomicTypeConverter = getAtomicTypeConverter(collectionDescriptor);

            while (pi.hasNext()) {
                Property prop = pi.nextProperty();
View Full Code Here

          collectionDescriptor, collectionFieldClass);
      ReflectionUtils.setNestedProperty(object, collectionDescriptor.getFieldName(), proxy);
    }
    else
    {
            ManageableObjects objects = collectionConverter.getCollection(session, parentNode, collectionDescriptor, collectionFieldClass);
      if (objects==null)
      {
        ReflectionUtils.setNestedProperty(object, collectionDescriptor.getFieldName(), null);
      }
      else
      {
        // TODO: find another for managing custom ManageableObjects classes
          if ( ! objects.getClass().equals(ManageableCollectionImpl.class) &&
             ! objects.getClass().equals(ManageableMapImpl.class))
          {
            ReflectionUtils.setNestedProperty(object, collectionDescriptor.getFieldName(), objects);
          }
          else
          {
            ReflectionUtils.setNestedProperty(object, collectionDescriptor.getFieldName(), objects.getObjects());
          }
      }

    }
View Full Code Here

        continue;
      }

      CollectionConverter collectionConverter = this.getCollectionConverter(session, collectionDescriptor);
      Object collection = ReflectionUtils.getNestedProperty(object, collectionDescriptor.getFieldName());
      ManageableObjects manageableCollection = ManageableObjectsUtil.getManageableObjects(collection);

      collectionConverter.insertCollection(session, objectNode, collectionDescriptor, manageableCollection);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.ocm.manager.collectionconverter.ManageableObjects

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.