Examples of MapEntries


Examples of org.apache.myfaces.config.impl.digester.elements.MapEntries

        ListEntries writeOnlyListEntries = makeListEntries();
        writeOnlyList.setListEntries(writeOnlyListEntries);
       
        ManagedProperty managedMap = new ManagedProperty();
        managedMap.setPropertyName("managedMap");
        MapEntries mapEntries = makeMapEntries();
        managedMap.setMapEntries(mapEntries);
       
        ManagedProperty writeOnlyMap = new ManagedProperty();
        writeOnlyMap.setPropertyName("writeOnlyMap");
        MapEntries writeOnlyMapEntries = makeMapEntries();
        writeOnlyMap.setMapEntries(writeOnlyMapEntries);       
       
        managedBean.addProperty(managedProperty);
        managedBean.addProperty(managedList);
        managedBean.addProperty(writeOnlyList);
View Full Code Here

Examples of org.apache.myfaces.config.impl.digester.elements.MapEntries

        }
        return listEntries;
    }
   
    private MapEntries makeMapEntries(){
        MapEntries mapEntries = new MapEntries();
       
        for(int i = 0 ; i < MANAGED_MAP.size(); i++){
            MapEntries.Entry mapEntry = new MapEntries.Entry();
            mapEntry.setKey((String) MANAGED_MAP.get(i + ""));
            mapEntry.setValue((String) MANAGED_MAP.get(i + ""));
            mapEntries.addEntry(mapEntry);
        }
        return mapEntries;
    }
View Full Code Here

Examples of org.apache.sling.jcr.resource.internal.helper.MapEntries

            PrivateAccessor.setField(resFac, "mangleNamespacePrefixes", true);

            // setup mapping root
            PrivateAccessor.setField(resFac, "mapRoot", "/etc/map");

            this.mapEntries = new MapEntries(resFac, repository);
            PrivateAccessor.setField(resFac, "mapEntries", mapEntries);

            try {
                NamespaceRegistry nsr = session.getWorkspace().getNamespaceRegistry();
                nsr.registerNamespace(SlingConstants.NAMESPACE_PREFIX, JcrResourceConstants.SLING_NAMESPACE_URI);
View Full Code Here

Examples of org.apache.sling.jcr.resource.internal.helper.MapEntries

                }
            };
            final ServiceTracker voidTracker = mock(ServiceTracker.class);
            when(voidTracker.getService()).thenReturn(mockVoidEA);

            mapEntries = new MapEntries(resFac, mock(BundleContext.class), voidTracker);
            PrivateAccessor.setField(resFac, "mapEntries", mapEntries);

            try {
                NamespaceRegistry nsr = session.getWorkspace().getNamespaceRegistry();
                nsr.registerNamespace(SlingConstants.NAMESPACE_PREFIX, JcrResourceConstants.SLING_NAMESPACE_URI);
View Full Code Here

Examples of org.apache.sling.jcr.resource.internal.helper.MapEntries

        delayedResourceProviders.clear();
        this.processDelayedJcrResourceTypeProviders();

        // set up the map entries from configuration
        try {
            mapEntries = new MapEntries(this, getRepository());
            plugin = new JcrResourceResolverWebConsolePlugin(componentContext.getBundleContext(), this);
        } catch (Exception e) {
            log.error(
                "activate: Cannot access repository, failed setting up Mapping Support",
                e);
View Full Code Here

Examples of org.apache.sling.jcr.resource.internal.helper.MapEntries

        mangeNamespacePrefixesField.setAccessible(true);
        mangeNamespacePrefixesField.set(resFac, true);

        Field mapEntriesField = resFac.getClass().getDeclaredField("mapEntries");
        mapEntriesField.setAccessible(true);
        mapEntries = new MapEntries(resFac, getRepository());
        mapEntriesField.set(resFac, mapEntries);

        try {
            NamespaceRegistry nsr = session.getWorkspace().getNamespaceRegistry();
            nsr.registerNamespace(SlingConstants.NAMESPACE_PREFIX,
View Full Code Here

Examples of org.apache.sling.jcr.resource.internal.helper.MapEntries

        PrintWriter pw = response.getWriter();

        pw.println("<table class='content' cellpadding='0' cellspacing='0' width='100%'>");

        MapEntries mapEntries = resolverFactory.getMapEntries();

        title(
            pw,
            "Configuration Test",
            "To test the configuration, enter an URL or a resource path into the field and click 'Resolve' to resolve the URL or click 'Map' to map the resource path");

        pw.println("<tr class='content'>");
        pw.println("<td class='content'>Test</td>");
        pw.print("<td class='content' colspan='2'>");
        pw.print("<form method='post'>");
        pw.println("<input type='text' name='" + ATTR_TEST + "' value='" + test
            + "' class='input' size='50'>");
        pw.println("&nbsp;&nbsp;<input type='submit' name='" + ATTR_SUBMIT
            + "' value='Resolve' class='submit'>");
        pw.println("&nbsp;&nbsp;<input type='submit' name='" + ATTR_SUBMIT
            + "' value='Map' class='submit'>");
        pw.print("</form>");
        pw.print("</td>");
        pw.println("</tr>");

        if (result != null) {
            pw.println("<tr class='content'>");
            pw.println("<td class='content'>&nbsp;</td>");
            pw.println("<td class='content' colspan='2'>" + result + "</td>");
            pw.println("</tr>");
        }

        separator(pw);

        dumpMap(
            pw,
            "Resolver Map Entries",
            "Lists the entries used by the ResourceResolver.resolve methods to map URLs to Resources",
            mapEntries.getResolveMaps());

        separator(pw);

        dumpMap(
            pw,
            "Mapping Map Entries",
            "Lists the entries used by the ResourceResolver.map methods to map Resource Paths to URLs",
            mapEntries.getMapMaps());

        pw.println("</table>");

    }
View Full Code Here

Examples of org.apache.sling.resourceresolver.impl.mapping.MapEntries

            // setup mapping root
            PrivateAccessor.setField(activator, "mapRoot", "/etc/map");
            ResourceResolverFactoryImpl resFac = new ResourceResolverFactoryImpl(activator);

            mapEntries = new MapEntries(resFac, mock(BundleContext.class), mock(EventAdmin.class));
            PrivateAccessor.setField(resFac, "mapEntries", mapEntries);

            try {
                NamespaceRegistry nsr = session.getWorkspace().getNamespaceRegistry();
                nsr.registerNamespace(SlingConstants.NAMESPACE_PREFIX, JcrResourceConstants.SLING_NAMESPACE_URI);
View Full Code Here

Examples of org.apache.sling.resourceresolver.impl.mapping.MapEntries

        final PrintWriter pw = response.getWriter();

        pw.println("<table class='content' cellpadding='0' cellspacing='0' width='100%'>");

        final MapEntries mapEntries = resolverFactory.getMapEntries();

        titleHtml(pw, "Configuration", null);
        pw.println("<tr class='content'>");
        pw.println("<td class='content'>Resource Search Path</td>");
        pw.print("<td class='content' colspan='2'>");
        pw.print(Arrays.asList(resolverFactory.getSearchPath()).toString());
        pw.print("</td>");
        pw.println("</tr>");
        pw.println("<tr class='content'>");
        pw.println("<td class='content'>Namespace Mangling</td>");
        pw.print("<td class='content' colspan='2'>");
        pw.print(resolverFactory.isMangleNamespacePrefixes() ? "Enabled"
                : "Disabled");
        pw.print("</td>");
        pw.println("</tr>");
        pw.println("<tr class='content'>");
        pw.println("<td class='content'>Mapping Location</td>");
        pw.print("<td class='content' colspan='2'>");
        pw.print(resolverFactory.getMapRoot());
        pw.print("</td>");
        pw.println("</tr>");

        separatorHtml(pw);

        titleHtml(
                pw,
                "Configuration Test",
                "To test the configuration, enter an URL or a resource path into "
                        + "the field and click 'Resolve' to resolve the URL or click 'Map' "
                        + "to map the resource path. To simulate a map call that takes the "
                        + "current request into account, provide a full URL whose "
                        + "scheme/host/port prefix will then be used as the request "
                        + "information. The path passed to map will always be the path part "
                        + "of the URL.");

        pw.println("<tr class='content'>");
        pw.println("<td class='content'>Test</td>");
        pw.print("<td class='content' colspan='2'>");
        pw.print("<form method='post'>");
        pw.print("<input type='text' name='" + ATTR_TEST + "' value='");
        if (test != null) {
            pw.print(ResponseUtil.escapeXml(test));
        }
        pw.println("' class='input' size='50'>");
        pw.println("&nbsp;&nbsp;<input type='submit' name='" + ATTR_SUBMIT
                + "' value='Resolve' class='submit'>");
        pw.println("&nbsp;&nbsp;<input type='submit' name='" + ATTR_SUBMIT
                + "' value='Map' class='submit'>");
        pw.print("</form>");
        pw.print("</td>");
        pw.println("</tr>");

        if (msg != null) {
            pw.println("<tr class='content'>");
            pw.println("<td class='content'>&nbsp;</td>");
            pw.print("<td class='content' colspan='2'>");
            pw.print(ResponseUtil.escapeXml(msg));
            pw.println("</td>");
            pw.println("</tr>");
        }

        separatorHtml(pw);

        dumpMapHtml(
                pw,
                "Resolver Map Entries",
                "Lists the entries used by the ResourceResolver.resolve methods to map URLs to Resources",
                mapEntries.getResolveMaps());

        separatorHtml(pw);

        dumpMapHtml(
                pw,
                "Mapping Map Entries",
                "Lists the entries used by the ResourceResolver.map methods to map Resource Paths to URLs",
                mapEntries.getMapMaps());

        pw.println("</table>");

    }
View Full Code Here

Examples of org.apache.sling.resourceresolver.impl.mapping.MapEntries

    }

    // ---------- ConfigurationPrinter

    public void printConfiguration(PrintWriter pw) {
        final MapEntries mapEntries = resolverFactory.getMapEntries();

        dumpMapText(pw, "Resolver Map Entries", mapEntries.getResolveMaps());

        separatorText(pw);

        dumpMapText(pw, "Mapping Map Entries", mapEntries.getMapMaps());
    }
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.