Package org.apache.jackrabbit.ocm.manager

Examples of org.apache.jackrabbit.ocm.manager.ObjectContentManager.update()


            map.put("value3", "Value3");
            map.put("value4", "Value4");
            map.put("value5", Arrays.asList(new String[]{ "Value5-1", "Value5-2" }));
            residual.setElements(map);
           
            ocm.update(residual);
            ocm.save();
           
            // --------------------------------------------------------------------------------
            // Get the object
            // --------------------------------------------------------------------------------          
View Full Code Here


      //---------------------------------------------------------------------------------------------------------
      // Update  a descendant object
      //---------------------------------------------------------------------------------------------------------           
      descendant.setAncestorField("anotherAncestorValue");
      descendant.setIntField(123);
      ocm.update(descendant);
      ocm.save();

      //---------------------------------------------------------------------------------------------------------
      // Retrieve the updated descendant object
      //---------------------------------------------------------------------------------------------------------           
View Full Code Here

            // --------------------------------------------------------------------------------
            // Update object B with an null value
            // --------------------------------------------------------------------------------
            b.setA(null);
            ocm.update(b);
            ocm.save();
           
            // --------------------------------------------------------------------------------
            // Retrieve object B
            // --------------------------------------------------------------------------------
View Full Code Here

            map.put("value14", "Value14");
            map.put("value15", "Value15");
            map.put("value16", Arrays.asList(new String[]{ "Value16-1", "Value16-2" }));
            residual.setElements(map);
           
            ocm.update(residual);
            ocm.save();

            // --------------------------------------------------------------------------------
            // Get the object
            // --------------------------------------------------------------------------------          
View Full Code Here

   
    //--------------------------------------------------------------------------------------------------------- 
    // Update
    //--------------------------------------------------------------------------------------------------------- 
    folder2.setChildren(null);
    ocm.update(folder2); // autoupdate = true for the children attribute. So no update on the children collection
    ocm.save();

    //--------------------------------------------------------------------------------------------------------- 
    // Retrieve children attribute
    //---------------------------------------------------------------------------------------------------------     
View Full Code Here

            lock = ocm.lock("/test", true, false);
            assertTrue("the object is not locked", ocm.isLocked("/test"));
            lockable = (Lockable) ocm.getObject("/test");
            assertNotNull("Attribute lockowner is null", lockable.getLockOwner());
            lockable.setA1("new a1 Value");
            ocm.update(lockable);
            ocm.save();
            ocm.unlock("/test", lock.getLockToken());
           
           
            // --------------------------------------------------------------------------------
View Full Code Here

            // --------------------------------------------------------------------------------
            allref.add("12345");
            b.setMultiReferences(allref);
            try
            {
              ocm.update(b);             
              fail("Exception not throw");
            }
            catch(Exception e)
            {
              //Throws an exception due to an invalid uuid
View Full Code Here

           
            // --------------------------------------------------------------------------------
            // Update object B with an null value
            // --------------------------------------------------------------------------------
            b.setMultiReferences(null);
            ocm.update(b);
            ocm.save();
           
            // --------------------------------------------------------------------------------
            // Retrieve object B
            // --------------------------------------------------------------------------------
View Full Code Here

      //---------------------------------------------------------------------------------------------------------     
            propertyTest = (PropertyTest) ocm.getObject("/test");
            propertyTest.setRequiredWithConstraintsProp("invalid value");
            try
            {
              ocm.update(propertyTest);
              ocm.save();
              fail("Invalid value was accepted for requiredWithConstraintsProp");
            }
            catch(Exception e)
            {                 
View Full Code Here

            // --------------------------------------------------------------------------------
            // Update object B with an null value
            // --------------------------------------------------------------------------------
            b.setMultiReferences(null);
            ocm.update(b);
            ocm.save();
           
            // --------------------------------------------------------------------------------
            // Retrieve object B
            // --------------------------------------------------------------------------------
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.