Package org.auraframework.adapter

Examples of org.auraframework.adapter.ConfigAdapter


        List<TreeNode> ret = Lists.newArrayList();

        Map<String, TreeNode> namespaceTreeNodes = Maps.newHashMap();
        DefDescriptor<E> matcher = definitionService.getDefDescriptor(String.format("%s://*%s*", prefix, sep), type);
        Set<DefDescriptor<E>> descriptors = definitionService.find(matcher);
        ConfigAdapter configAdapter = Aura.getConfigAdapter();
        for (DefDescriptor<E> desc : descriptors) {
            if (desc == null) {
                // Getting null here after commit 2037c31ddc81eae3edaf6ddd5bcfd0009fefe1bd. This causes a NPE and
                // breaks the left nav of the reference tab.
                continue;
            }
            String namespace = desc.getNamespace();
            if (configAdapter.isDocumentedNamespace(namespace)) {
                try {
                    E def = desc.getDef();
                    if (hasAccess(def)) {
                        TreeNode namespaceTreeNode = namespaceTreeNodes.get(desc.getNamespace());
                        if (namespaceTreeNode == null) {
View Full Code Here


        }
        super.tearDown();
    }

    public static MockConfigAdapter getMockConfigAdapter() {
        ConfigAdapter adapter = Aura.getConfigAdapter();
        if (adapter instanceof MockConfigAdapter) {
            return (MockConfigAdapter) adapter;
        }
        throw new Error("MockConfigAdapter is not configured!");
    }
View Full Code Here

        SourceLoader unprivilegedLoader = new UnprivilegedSourceLoader();
        List<SourceLoader> loaders = Lists.newArrayList(friendlyLoader, selectiveLoader, unprivilegedLoader);
        SourceFactory sf = new SourceFactory(loaders);
        assertEquals(Sets.newHashSet("VIP", "Guest", "Friend1", "Friend2", "Custom_1","Custom_2"), sf.getNamespaces());
       
        ConfigAdapter c = Aura.getConfigAdapter();
        //Assert namespaces of PrivilegedNamespaceSourceLoaders are privileged based on isPrivilegedNamespace()
        assertTrue(c.isPrivilegedNamespace("Friend1"));
        assertTrue(c.isPrivilegedNamespace("Friend2"));
       
        assertTrue(c.isPrivilegedNamespace("VIP"));
        assertFalse(c.isPrivilegedNamespace("Guest"));
       
        //Assert namspaces of non-PrivilegedNamespaceSourceLoaders are not privileged
        assertFalse(c.isPrivilegedNamespace("Custom_1"));
        assertFalse(c.isPrivilegedNamespace("Custom_2"));
    }
View Full Code Here

        return getModeParam(request, configMap);
    }

    protected Mode getMode(HttpServletRequest request, Map<String, Object> configMap) {
        Mode m = getModeParam(request, configMap);
        ConfigAdapter configAdapter = Aura.getConfigAdapter();
       
        if (m == null) {
            m = configAdapter.getDefaultMode();
        }
        Set<Mode> allowedModes = configAdapter.getAvailableModes();
        boolean forceProdMode = !allowedModes.contains(m) && allowedModes.contains(Mode.PROD);
        if (forceProdMode) {
            m = Mode.PROD;
        }
View Full Code Here

            throws QuickFixException {
        return Aura.getClientLibraryService().getUrls(context, type);
    }

    public static List<String> getBaseScripts(AuraContext context) throws QuickFixException {
        ConfigAdapter config = Aura.getConfigAdapter();
        Set<String> ret = Sets.newLinkedHashSet();

        String html5ShivURL = config.getHTML5ShivURL();
        if (html5ShivURL != null) {
            ret.add(html5ShivURL);
        }

        ret.add(config.getMomentJSURL());
        ret.add(config.getFastClickJSURL());
        ret.addAll(config.getWalltimeJSURLs());

        ret.addAll(getClientLibraryUrls(context, ClientLibraryDef.Type.JS));
        // framework js should be after other client libraries
        ret.add(config.getAuraJSURL());

        return new ArrayList<String>(ret);
    }
View Full Code Here

TOP

Related Classes of org.auraframework.adapter.ConfigAdapter

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.