Package org.auraframework.instance

Examples of org.auraframework.instance.Component


                        if (section instanceof List) {
                            for (Object obj : (List<?>) section) {
                                if (obj instanceof ComponentDefRef) {
                                    ComponentDefRef cdr = (ComponentDefRef) obj;
                                    Component cmp = cdr.newInstance(component.getAttributes().getValueProvider());
                                    Aura.getRenderingService().render(cmp, out);
                                } else if (obj instanceof Component) {
                                    Aura.getRenderingService().render((Component) obj, out);
                                }
                            }
View Full Code Here


            List<?> kids = (List<?>) value;
            for (Object kid : kids) {
                if (kid instanceof BaseComponent) {
                    renderingService.render((BaseComponent<?, ?>) kid, out);
                } else if (kid instanceof ComponentDefRef) {
                    Component cmp = ((ComponentDefRef) kid).newInstance(component);
                    renderingService.render(cmp, out);
                }
            }
        } else if (value != null) {
            out.append(value.toString());
View Full Code Here

@Controller
public class DelayedController {
    @AuraEnabled
    public static Object getComponents(@Key("token") String token) throws Exception {
        Component cmp = Aura.getInstanceService().getInstance("auratest:text", ComponentDef.class);
        Object val = token;
        Map<String, Object> atts = ImmutableMap.of("value", val);
        cmp.getAttributes().set(atts);
        try {
            Thread.sleep(2000);
        } catch (Exception e) {
        }
        return new Component[] { cmp };
View Full Code Here

                Aura.getSerializationService().write(context, null, AuraContext.class, contextWriter, "HTML");
                auraInit.put("context", new Literal(contextWriter.toString()));

                attributes.put("auraInit", Json.serialize(auraInit));
            }
            Component template = instanceService.getInstance(templateDef.getDescriptor(), attributes);
            renderingService.render(template, out);
        } catch (QuickFixException e) {
            throw new AuraRuntimeException(e);
        }
    }
View Full Code Here

            attribs.put("errorMessage", AuraExceptionUtil.getStackTrace(t));
        } else {
            attribs.put("errorMessage", t.getMessage());
        }
        try {
            Component c = Aura.getInstanceService().getInstance("aura:template", ComponentDef.class, attribs);
            Aura.getRenderingService().render(c, out);
        } catch (QuickFixException e) {
            throw new AuraError(e);
        }
    }
View Full Code Here

        if (!remoteProvider) {
            DefDescriptor<ComponentDef> superDefDescriptor = def.getExtendsDescriptor();
            if (superDefDescriptor != null) {
              Aura.getDefinitionService().getDefRegistry().assertAccess(descriptor, superDefDescriptor.getDef());
             
                Component concrete = concreteComponent == null ? this : concreteComponent;
                superComponent = new ComponentImpl(superDefDescriptor, this, this, concrete);
            }
        }
    }
View Full Code Here

                StringWriter sw = new StringWriter();
                t.getCause().printStackTrace(new PrintWriter(sw));
                attribs.put("cause", sw.toString());
            }

            Component cmp = Aura.getInstanceService()
                                .getInstance("auradev:quickFixException", ComponentDef.class, attribs);
            Aura.getSerializationService().write(cmp, attribs, Component.class, out);
        } catch (QuickFixException e) {
            throw new AuraError(e);
        }
View Full Code Here

                attributes.put("body", Lists.<BaseComponent<?, ?>> newArrayList(cmp));
                attributes.put("bodyClass", "");
                attributes.put("autoInitialize", "false");

                Component template = instanceService.getInstance(templateDef.getDescriptor(), attributes);

                renderingService.render(template, out);
            } else {

                attributes.put("auraScriptTags", sb.toString());
                Map<String, Object> auraInit = Maps.newHashMap();
                if (componentAttributes != null && !componentAttributes.isEmpty()) {
                    auraInit.put("attributes", componentAttributes);
                }
                auraInit.put("descriptor", def.getDescriptor());
                auraInit.put("deftype", def.getDescriptor().getDefType());
                auraInit.put("host", contextPath);

                attributes.put("autoInitialize", "false");
                attributes.put("autoInitializeSync", "true");

                auraInit.put("instance", cmp);
                auraInit.put("token", AuraBaseServlet.getToken());

                StringBuilder contextWriter = new StringBuilder();
                Aura.getSerializationService().write(context, null, AuraContext.class, contextWriter, "JSON");
                auraInit.put("context", new Literal(contextWriter.toString()));

                attributes.put("auraInitSync", Json.serialize(auraInit));

                Component template = instanceService.getInstance(templateDef.getDescriptor(), attributes);
                renderingService.render(template, out);
            }
        } catch (QuickFixException e) {
            throw new AuraRuntimeException(e);
        }
View Full Code Here

        sb = new StringBuilder();
        Aura.getSerializationService().write(value, attributes, getType(), sb, "JSON");
        attribs.put("auraInitBlock", String.format("<script>aura.test.init(%s);</script>", sb.toString()));

        try {
            Component c = Aura.getInstanceService().getInstance("aura:template", ComponentDef.class, attribs);
            Aura.getRenderingService().render(c, out);
        } catch (QuickFixException e) {
            throw new AuraError(e);
        }
    }
View Full Code Here

            if (styleDefDesc != null) {
                attributes.put("auraInlineStyle", styleDefDesc.getDef().getCode());
            }

            attributes.put("autoInitialize", false);
            Component template = instanceService.getInstance(templateDef.getDescriptor(), attributes);
            renderingService.render(template, htmlWriter);
        } catch (QuickFixException e) {
            throw new AuraRuntimeException(e);
        } finally {
            htmlWriter.close();
View Full Code Here

TOP

Related Classes of org.auraframework.instance.Component

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.