Package org.apache.sling.api.resource

Examples of org.apache.sling.api.resource.ValueMap.keySet()


        if (res != null) {
            final Resource propertiesChild = res.getChild("properties");
            if (propertiesChild != null) {
                final ValueMap properties = propertiesChild.adaptTo(ValueMap.class);
                if (properties != null) {
                    for (Iterator<String> it = properties.keySet().iterator(); it
                            .hasNext();) {
                        String key = it.next();
                        if (!key.equals("jcr:primaryType")) {
                            props.put(key, properties.get(key, String.class));
                        }
View Full Code Here


        this.rootNode.setProperty(Text.escapeIllegalJcrChars(TEST_PATH), VALUE);
        this.rootNode.setProperty(PROP1, VALUE1);
        this.rootNode.setProperty(PROP2, VALUE2);
        final ValueMap vm = this.createPropertyMap(this.rootNode);
        assertTrue(vm.containsKey(TEST_PATH));
        search(vm.keySet().iterator(), TEST_PATH);
        search(vm.keySet().iterator(), PROP1);
        search(vm.keySet().iterator(), PROP2);
        search(vm.values().iterator(), VALUE);
        search(vm.values().iterator(), VALUE1);
        search(vm.values().iterator(), VALUE2);
View Full Code Here

        this.rootNode.setProperty(PROP1, VALUE1);
        this.rootNode.setProperty(PROP2, VALUE2);
        final ValueMap vm = this.createPropertyMap(this.rootNode);
        assertTrue(vm.containsKey(TEST_PATH));
        search(vm.keySet().iterator(), TEST_PATH);
        search(vm.keySet().iterator(), PROP1);
        search(vm.keySet().iterator(), PROP2);
        search(vm.values().iterator(), VALUE);
        search(vm.values().iterator(), VALUE1);
        search(vm.values().iterator(), VALUE2);
    }
View Full Code Here

        this.rootNode.setProperty(PROP2, VALUE2);
        final ValueMap vm = this.createPropertyMap(this.rootNode);
        assertTrue(vm.containsKey(TEST_PATH));
        search(vm.keySet().iterator(), TEST_PATH);
        search(vm.keySet().iterator(), PROP1);
        search(vm.keySet().iterator(), PROP2);
        search(vm.values().iterator(), VALUE);
        search(vm.values().iterator(), VALUE1);
        search(vm.values().iterator(), VALUE2);
    }
View Full Code Here

    public void testIeratorsOld() throws Exception {
        this.rootNode.getSession().refresh(false);
        this.rootNode.setProperty(ISO9075.encodePath(TEST_PATH), VALUE);
        final ValueMap vm = this.createPropertyMap(this.rootNode);
        assertTrue(vm.containsKey(TEST_PATH));
        search(vm.keySet().iterator(), TEST_PATH);
        search(vm.values().iterator(), VALUE);
    }

    public void testDotSlash() throws Exception {
        this.rootNode.getSession().refresh(false);
View Full Code Here

            return null;
        }

        // Collections.disjoint returns true if the collections
        // have nothing in common, so when it is false, use the current resource
        if (!Collections.disjoint(properties.keySet(), PROPERTY_NAMES)) {
            return typeResource;
        } else {
            // otherwise, look at the resource type resource's super type
            return findUrlFilterDefinitionResource(typeResource.getResourceSuperType(), resolver);
        }
View Full Code Here

            if(m != null) {
                w.object();
                w.key("period").value(m.get(MailStatsProcessorImpl.PERIOD_PROP, "NO_PERIOD"));
                w.key("senders");
                w.object();
                for(String key : m.keySet()) {
                    if(key.startsWith(MailStatsProcessorImpl.SOURCE_PROP_PREFIX)) {
                        final String source = key.substring(MailStatsProcessorImpl.SOURCE_PROP_PREFIX.length());
                        layers.add(source);
                        w.key(source).value(m.get(key));
                    }
View Full Code Here

    }

    private void findReferencesInResource(Resource resource,
            Set<Page> pages, PageManager pageManager) {
        ValueMap map = resource.adaptTo(ValueMap.class);
        for (String key : map.keySet()) {
            String[] values = map.get(key, new String[0]);
            for (String value : values) {
                if (pattern.matcher(value).find()) {
                    for (String path : getAllPathsInAProperty(value)) {
                        Page page = pageManager.getContainingPage(path);
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.