Package org.auraframework.system

Examples of org.auraframework.system.AuraContext


        return hasLocalDependencies;
    }

    @Override
    public Object getValue(PropertyReference expr) throws QuickFixException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        BaseComponent<?, ?> oldComponent = context.setCurrentComponent(this);
        try {
            String prefix = expr.getRoot();
            if ("c".equals(prefix)) {
                prefix.toString();
            }
            PropertyReference stem = expr.getStem();

            Object root = valueProviders.get(prefix);
            if (root == null) {
                ValueProviderType vpt = ValueProviderType.getTypeByPrefix(prefix);
                if (vpt != null) {
                    root = context.getGlobalProviders().get(vpt);
                }
            }
            if (root != null) {
                if (stem != null) {
                    if (root instanceof ValueProvider) {
                        return ((ValueProvider) root).getValue(stem);
                    } else {
                        return JavaModel.getValue(root, stem, null);
                        // no throw error at runtime even though expression
                        // reference nothing
                        // return null;
                    }
                } else {
                    // they asked for just the root.
                    // TODO: this should only work for foreach, shouldn't be
                    // able to {!m}
                    return root;
                }
            }
            return null;
        } finally {
            context.setCurrentComponent(oldComponent);
        }
    }
View Full Code Here


        return (Action) Aura.getInstanceService().getInstance((String) map.get("descriptor"), ActionDef.class, params);
    }

    @Override
    public void writeCollection(Collection<? extends Action> values, Appendable out) throws IOException {
        AuraContext c = Aura.getContextService().getCurrentContext();
        Map<String, Object> m = new HashMap<String, Object>();
        m.put("actions", values);
        m.put("context", c);
        Json.serialize(m, out, c.getJsonSerializationContext());
    }
View Full Code Here

    }

    @Override
    public void writeCollection(Collection<? extends EventDef> values, Appendable out) throws IOException,
            QuickFixException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        Json.serialize(values, out, context.getJsonSerializationContext());
    }
View Full Code Here

        return AuraContext.class;
    }

    @Override
    public void write(Object value, Map<String, Object> attributes, Appendable out) throws IOException {
        AuraContext ctx = (AuraContext) value;
        JsonSerializationContext s = ctx.getJsonSerializationContext();
        Json.serialize(ctx, out, s);
    }
View Full Code Here

*/
@Provider
public class IterationProvider implements ComponentConfigProvider {
    @Override
    public ComponentConfig provide() throws QuickFixException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        BaseComponent<?, ?> component = context.getCurrentComponent();
        ComponentConfig cc = new ComponentConfig();
        List<Component> components = Lists.newArrayList();
        InstanceStack iStack = context.getInstanceStack();
        Map<String, Object> m = Maps.newHashMapWithExpectedSize(1);
        m.put("body", components);
        cc.setAttributes(m);

        AttributeSet atts = component.getAttributes();
View Full Code Here

        return TestSuiteDef.class;
    }

    @Override
    public void write(Object value, Map<String, Object> attributes, Appendable out) throws IOException {
        AuraContext c = Aura.getContextService().getCurrentContext();
        Json.serialize(value, out, c.getJsonSerializationContext());
    }
View Full Code Here

            Map<String, Object> attributes = Maps.newHashMap();

            StringBuilder sb = new StringBuilder();
            writeHtmlStyles(AuraServlet.getStyles(), sb);
            attributes.put("auraStyleTags", sb.toString());
            AuraContext context = Aura.getContextService().getCurrentContext();

            DefDescriptor<StyleDef> styleDefDesc = templateDef.getStyleDescriptor();
            if (styleDefDesc != null) {
                attributes.put("auraInlineStyle", styleDefDesc.getDef().getCode());
            }

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

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

        return Component.class;
    }

    @Override
    public void write(Object value, Map<String, Object> attributes, Appendable out) throws IOException {
        AuraContext c = Aura.getContextService().getCurrentContext();
        Json.serialize(value, out, c.getJsonSerializationContext());
    }
View Full Code Here

        Json.serialize(value, out, c.getJsonSerializationContext());
    }

    @Override
    public void writeCollection(Collection<? extends Component> values, Appendable out) throws IOException {
        AuraContext c = Aura.getContextService().getCurrentContext();
        Map<String, Object> m = new LinkedHashMap<String, Object>();
        m.put("components", values);
        m.put("context", c);
        Json.serialize(m, out, c.getJsonSerializationContext());
    }
View Full Code Here

    }

    @Override
    public void writeCollection(Collection<? extends BaseComponentDef> values, Appendable out) throws IOException,
            QuickFixException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        Json.serialize(values, out, context.getJsonSerializationContext());
    }
View Full Code Here

TOP

Related Classes of org.auraframework.system.AuraContext

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.