Package org.auraframework.def.DefDescriptor

Examples of org.auraframework.def.DefDescriptor.DefType


        AuraContext context = Aura.getContextService().getCurrentContext();
        BaseComponent<?, ?> component = context.getCurrentComponent();
        DefinitionService defService = Aura.getDefinitionService();

        String desc = (String)component.getAttributes().getValue("descriptor");
        DefType defType = DefType.valueOf(((String)component.getAttributes().getValue("defType")).toUpperCase());

        desc = "js://" + desc.replace(':', '.');
        descriptor = defService.getDefDescriptor(desc, TestSuiteDef.class);
        def = descriptor.getDef();
        if (def == null) { throw new DefinitionNotFoundException(descriptor); }
View Full Code Here


        AuraContext context = Aura.getContextService().getCurrentContext();
        BaseComponent<?, ?> component = context.getCurrentComponent();

        String desc = (String) component.getAttributes().getValue("descriptor");

        DefType defType = DefType.valueOf(((String) component.getAttributes().getValue("defType")).toUpperCase());
        descriptor = Aura.getDefinitionService().getDefDescriptor(desc, defType.getPrimaryInterface());
        definition = descriptor.getDef();
       
        ReferenceTreeModel.assertAccess(definition);

        String type = null;
View Full Code Here

        if (name != null && !name.isEmpty()) {
            Set<DefDescriptor<?>> descriptors = definitionService.find(new DescriptorFilter("markup://" + name));
            if (descriptors.size() > 0) {
                for (DefDescriptor<?> descriptor : descriptors) {

                    DefType type = descriptor.getDefType();
                    switch (type) {
                    case COMPONENT:
                    case APPLICATION:
                    case INTERFACE:
View Full Code Here

            String contextPath = context.getContextPath();
            Mode mode = context.getMode();

            if (mode.allowLocalRendering() && def.isLocallyRenderable()) {
                DefType defType = def.getDescriptor().getDefType();
                BaseComponent<?, ?> cmp = null;

                if (defType == DefType.APPLICATION) {
                    cmp = (BaseComponent<?, ?>) instanceService.getInstance((ApplicationDef) def, componentAttributes);
                } else {
View Full Code Here

            String contextPath = context.getContextPath();
            Mode mode = context.getMode();

            if (mode.allowLocalRendering() && def.isLocallyRenderable()) {

                DefType defType = def.getDescriptor().getDefType();

                if (defType == DefType.APPLICATION) {
                    cmp = (BaseComponent<?, ?>) instanceService.getInstance((ApplicationDef) def, componentAttributes);
                } else {
                    cmp = (BaseComponent<?, ?>) instanceService.getInstance((ComponentDef) def, componentAttributes);
View Full Code Here

            namespace = desc.getNamespace();
            target = String.format("%s:%s", namespace, desc.getName());
        }

        // Cache key is of the form "referencingNamespace>defNamespace:defName[.subDefName].defTypeOrdinal"
        DefType defType = desc.getDefType();
        String key = String.format("%s>%s.%d", referencingNamespace == null ? "" : referencingNamespace, target,
                defType.ordinal());
        String status = accessCheckCache.getIfPresent(key);
        if (status == null) {
            status = "";

            // Protect against re-entry
            accessCheckCache.put(key, status);

            // System.out.printf("** MDR.miss.assertAccess() cache miss for: %s\n", key);

            DefDescriptor<? extends Definition> descriptor = def.getDescriptor();
            if (!configAdapter.isUnsecuredNamespace(namespace)
                    && !configAdapter.isUnsecuredPrefix(descriptor.getPrefix())) {
                if (referencingNamespace == null || referencingNamespace.isEmpty()) {
                    status = String
                            .format("Access to %s '%s' disallowed by MasterDefRegistry.assertAccess(): referencing namespace was empty or null",
                                    defType, target);
                } else if (!referencingNamespace.equals(namespace)) {
                    // The caller and the def are not in the same namespace
                    status = String
                            .format("Access to %s '%s' from namespace '%s' in '%s(%s)' disallowed by MasterDefRegistry.assertAccess()",
                                    defType.toString().toLowerCase(), target, referencingNamespace,
                                    referencingDescriptor, referencingDescriptor.getDefType());
                }
            }

            if (!status.isEmpty()) {
View Full Code Here

    @Override
    public Set<DefDescriptor<T>> find(DefDescriptor<T> matcher) {
        String namespace = matcher.getNamespace();
        String prefix = matcher.getPrefix();
        DefType defType = matcher.getDefType();
        Set<DefDescriptor<T>> ret = new HashSet<>();
        for (DefDescriptor<T> key : defs.keySet()) {

            if (defType == key.getDefType() && key.getPrefix().equalsIgnoreCase(prefix)
                    && (namespace.equalsIgnoreCase(WILD) || namespace.equalsIgnoreCase(key.getNamespace()))) {
View Full Code Here

                if (compDesc == null || !compDesc.exists()) {
                    compDesc = DefDescriptorImpl.getAssociateDescriptor(
                            descriptor, ApplicationDef.class,
                            DefDescriptor.MARKUP_PREFIX);
                }
                DefType defType = compDesc.getDefType();

                List<Object> caseMocks = (List<Object>) value.get("mocks");

                List<Object> mocks;
                if (suiteMocks == null || suiteMocks.isEmpty()) {
View Full Code Here

    }

    @Override
    public <T extends Definition> Set<DefDescriptor<T>> find(Class<T> primaryInterface, String prefix, String namespace) {
        Set<DefDescriptor<T>> ret = new HashSet<>();
        DefType defType = DefType.getDefType(primaryInterface);
        OneTypeFilter<T> otf = new OneTypeFilter<>(ret, defType);
        findFiles(new File(base, namespace), null, otf);
        //System.out.println("PI="+primaryInterface.getName()+", prefix="+prefix+", ns = "+namespace+", RET="+ret);
        return ret;
    }
View Full Code Here

                    List<Definition> eventDefs = Lists.newArrayList();
                    List<Definition> libraryDefs = Lists.newArrayList();

                    for (Map.Entry<DefDescriptor<? extends Definition>, Definition> entry : defMap.entrySet()) {
                        DefDescriptor<? extends Definition> desc = entry.getKey();
                        DefType dt = desc.getDefType();
                        Definition d = entry.getValue();
                        //
                        // Ignore defs that ended up not being valid. This is arguably something
                        // that the MDR should have done when filtering.
                        //
View Full Code Here

TOP

Related Classes of org.auraframework.def.DefDescriptor.DefType

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.