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

Examples of org.apache.jackrabbit.ocm.manager.collectionconverter.impl.ManagedHashMap


     * This method returns a new instance of a <code>ManagedHashMap</code>
     * containing a copy of the current properties on each call.
     */
    public ManagedHashMap getProperties() {
        // a copy of this map with the special properties removed
        ManagedHashMap properties = new ManagedHashMap(this);
        properties.remove(FIELD_PATH);
        properties.remove(FIELD_PRIMARY_TYPE);
        properties.remove(FIELD_MIXIN_TYPES);
        return properties;
    }
View Full Code Here


            // Update an object graph in the repository
            // --------------------------------------------------------------------------------
            residual = new Residual.ResidualNodes();
            residual.setPath("/test");
           
            ManagedHashMap map = new ManagedHashMap();
            map.put("value1", new Paragraph("Value1"));
            map.put("value2", new Paragraph("Value2"));
            map.put("value3", new Paragraph("Value3"));
            map.put("value4", new Paragraph("Value4"));
            residual.setElements(map);
           
            ocm.update(residual);
            ocm.save();
           
            // --------------------------------------------------------------------------------
            // Get the object
            // --------------------------------------------------------------------------------          
            residual = (Residual) ocm.getObject( "/test");
            assertNotNull("Object is null", residual);
            assertTrue("Incorrect number of values", residual.getElements().size() == 4);           
            assertTrue("Incorrect collection element type", (residual.getElements().get("value2") instanceof Paragraph));
            assertEquals("Incorrect collection element text", ((Paragraph) residual.getElements().get("value2")).getText(), "Value2");
           
            // --------------------------------------------------------------------------------
            // Update the object
            // --------------------------------------------------------------------------------
            map = new ManagedHashMap();
            map.put("value11", new Paragraph("Value11"));
            map.put("value12", new Paragraph("Value12"));
            map.put("value13", new Paragraph("Value13"));
            map.put("value14", new Paragraph("Value14"));
            map.put("value15", new Paragraph("Value15"));
            residual.setElements(map);
           
            ocm.update(residual);
            ocm.save();
View Full Code Here

            // --------------------------------------------------------------------------------

            residual = new Residual.ResidualProperties();
            residual.setPath("/test");
           
            ManagedHashMap map = new ManagedHashMap();
            map.put("value1", "Value1");
            map.put("value2", "Value2");
            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
            // --------------------------------------------------------------------------------          
            residual = (Residual) ocm.getObject( "/test");
            assertNotNull("Object is null", residual);
            assertTrue("Incorrect number of values", residual.getElements().size() == 5);           
            assertTrue("Incorrect collection element", residual.getElements().get("value2").equals("Value2"));
            assertNotNull("Missing collection element", residual.getElements().get("value5"));
            assertTrue("Incorrect collection element type", (residual.getElements().get("value5") instanceof List));
            assertEquals("Incorrect collection element list size", ((List) residual.getElements().get("value5")).size(), 2);
            assertEquals("Incorrect collection element list value", ((List) residual.getElements().get("value5")).get(0), "Value5-1");
           
            // --------------------------------------------------------------------------------
            // Update the object
            // --------------------------------------------------------------------------------
            map = new ManagedHashMap();
            map.put("value11", "Value11");
            map.put("value12", "Value12");
            map.put("value13", "Value13");
            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();
View Full Code Here

            // --------------------------------------------------------------------------------

            residual = new Residual.ResidualProperties();
            residual.setPath("/test");
           
            ManagedHashMap map = new ManagedHashMap();
            map.put("value1", "Value1");
            map.put("value2", "Value2");
            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
            // --------------------------------------------------------------------------------          
            residual = (Residual) ocm.getObject( "/test");
            assertNotNull("Object is null", residual);
            assertTrue("Incorrect number of values", residual.getElements().size() == 5);           
            assertTrue("Incorrect collection element", residual.getElements().get("value2").equals("Value2"));
            assertNotNull("Missing collection element", residual.getElements().get("value5"));
            assertTrue("Incorrect collection element type", (residual.getElements().get("value5") instanceof List));
            assertEquals("Incorrect collection element list size", ((List) residual.getElements().get("value5")).size(), 2);
            assertEquals("Incorrect collection element list value", ((List) residual.getElements().get("value5")).get(0), "Value5-1");
           
            // --------------------------------------------------------------------------------
            // Update the object
            // --------------------------------------------------------------------------------
            map = new ManagedHashMap();
            map.put("value11", "Value11");
            map.put("value12", "Value12");
            map.put("value13", "Value13");
            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();
View Full Code Here

            // Update an object graph in the repository
            // --------------------------------------------------------------------------------
            residual = new Residual.ResidualNodes();
            residual.setPath("/test");
           
            ManagedHashMap map = new ManagedHashMap();
            map.put("value1", new Paragraph("Value1"));
            map.put("value2", new Paragraph("Value2"));
            map.put("value3", new Paragraph("Value3"));
            map.put("value4", new Paragraph("Value4"));
            residual.setElements(map);
           
            ocm.update(residual);
            ocm.save();
           
            // --------------------------------------------------------------------------------
            // Get the object
            // --------------------------------------------------------------------------------          
            residual = (Residual) ocm.getObject( "/test");
            assertNotNull("Object is null", residual);
            assertTrue("Incorrect number of values", residual.getElements().size() == 4);           
            assertTrue("Incorrect collection element type", (residual.getElements().get("value2") instanceof Paragraph));
            assertEquals("Incorrect collection element text", ((Paragraph) residual.getElements().get("value2")).getText(), "Value2");
           
            // --------------------------------------------------------------------------------
            // Update the object
            // --------------------------------------------------------------------------------
            map = new ManagedHashMap();
            map.put("value11", new Paragraph("Value11"));
            map.put("value12", new Paragraph("Value12"));
            map.put("value13", new Paragraph("Value13"));
            map.put("value14", new Paragraph("Value14"));
            map.put("value15", new Paragraph("Value15"));
            residual.setElements(map);
           
            ocm.update(residual);
            ocm.save();
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.ocm.manager.collectionconverter.impl.ManagedHashMap

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.