Examples of AuraError


Examples of org.auraframework.throwable.AuraError

            throw new AuraRuntimeException("Invalid var name:'" + name
                    + "', Refer to Auradocs for valid attribute names");
        }

        if (!source.exists()) {
            throw new AuraError("Cannot find source for " + desc.getQualifiedName());
        }

        String s = source.getContents();
        Matcher m = TAG.matcher(s);
        if (m.find()) {
            StringBuilder sb = new StringBuilder(s.length() + 50);
            sb.append(s.subSequence(0, m.end()));
            sb.append("\n    <aura:var name=\"");
            sb.append(name);
            sb.append("\" value=\"");
            sb.append(defaultValue);
            sb.append("\"/>\n");
            sb.append(s.substring(m.end() + 1));
            Writer writer = source.getWriter();
            try {
                writer.write(sb.toString());
            } finally {
                writer.close();
            }
        } else {
            throw new AuraError("Could not locate opening tag for " + desc.getQualifiedName());
        }

    }
View Full Code Here

Examples of org.auraframework.throwable.AuraError

    }

    protected Source<?> getSource(DefDescriptor<?> desc) {
        Source<?> source = Aura.getContextService().getCurrentContext().getDefRegistry().getSource(desc);
        if (!source.exists()) {
            throw new AuraError("Cannot find source for " + desc.getQualifiedName());
        }
        return source;
    }
View Full Code Here

Examples of org.auraframework.throwable.AuraError

        } catch (AuraRuntimeException e) {
            throw new AuraRuntimeException("Invalid attribute type:" + type);
        }

        if (!source.exists()) {
            throw new AuraError("Cannot find source for " + desc.getQualifiedName());
        }
        Pattern p = intf ? INTF_TAG : CMP_TAG;
        String s = source.getContents();
        Matcher m = p.matcher(s);
        if (m.find()) {
            StringBuilder sb = new StringBuilder(s.length() + 50);
            sb.append(s.subSequence(0, m.end()));
            sb.append("\n    <aura:attribute name=\"");
            sb.append(attName);
            sb.append("\" type=\"");
            sb.append(type);
            sb.append("\"/>\n");
            sb.append(s.substring(m.end() + 1));
            Writer writer = source.getWriter();
            try {
                writer.write(sb.toString());
            } finally {
                writer.close();
            }
        } else {
            throw new AuraError("Could not locate opening tag for " + desc.getQualifiedName());
        }

    }
View Full Code Here

Examples of org.auraframework.throwable.AuraError

                cur = cur.getSuperclass();
                ret = formatAdapters.get(new IndexKey(key.format, cur));
            }

            if (ret == null) {
                throw new AuraError("No FormatAdapter found for IndexKey " + key);
            }

            return ret;
        }
View Full Code Here

Examples of org.auraframework.throwable.AuraError

        try {
            tempGroup = newAuraJavascriptGroup();
            try {
                tempGroup.parse();
            } catch (IOException x) {
                throw new AuraError("Unable to initialize aura client javascript", x);
            }
            tempGroup.postProcess();
        } catch (IOException x) {
            /*
             * js source wasn't found, we must be in jar land, just let the files be accessed from there... however, we
             * do want a hash. Question: hypothetically, could we have a hybrid with a subset of files as files, and the
             * rest in jars? This wouldn't be accounted for here.
             */
            tempGroup = new CompiledGroup(AuraJavascriptGroup.GROUP_NAME, AuraJavascriptGroup.FILE_NAME);
        }
        jsGroup = tempGroup;

        // Aura Resources
        FileGroup tempResourcesGroup;
        try {
            tempResourcesGroup = newAuraResourcesHashingGroup();
            tempResourcesGroup.getGroupHash();
        } catch (IOException e) {
            tempResourcesGroup = new CompiledGroup(AuraResourcesHashingGroup.GROUP_NAME,
                    AuraResourcesHashingGroup.FILE_NAME);
        }
        resourcesGroup = tempResourcesGroup;

        Properties props = (jsGroup == null) ? loadProperties() : null;
        if (props == null) {
            // If we don't get the framework version from properties, the default is a development build:
            auraVersionString = "development";
            buildTimestamp = System.currentTimeMillis();
        } else {
            // If we do get our version info from properties, then try to do that.
            auraVersionString = props.getProperty(VERSION_PROPERTY);
            if (auraVersionString == null || auraVersionString.isEmpty()) {
                throw new AuraError("Unable to read build version from version.prop file");
            }

            buildTimestamp = readBuildTimestamp(props);
        }

View Full Code Here

Examples of org.auraframework.throwable.AuraError

        Properties props = new Properties();
        try {
            loadProperties("/version.prop", props);
        } catch (IOException e) {
            throw new AuraError("Could not read version.prop information");
        }
        return props;
    }
View Full Code Here

Examples of org.auraframework.throwable.AuraError

    private Long readBuildTimestamp(Properties props) {
        String timestamp = (String) props.get(TIMESTAMP_PROPERTY);
        String timestampFormat = (String) props.get(TIMESTAMP_FORMAT_PROPERTY);
        if (timestamp == null || timestamp.isEmpty() || timestampFormat == null || timestampFormat.isEmpty()) {
            throw new AuraError(String.format("Couldn't find %s or %s", TIMESTAMP_PROPERTY, TIMESTAMP_FORMAT_PROPERTY));
        }
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timestampFormat);
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
        try {
            if (MAVEN_TIMESTAMP_PROPERTY.equals(timestamp)) {
                // We're in an Eclipse-only or similar environment: Maven didn't filter version.prop
                return System.currentTimeMillis();
            }
            return simpleDateFormat.parse(timestamp).getTime();
        } catch (ParseException e) {
            throw new AuraError("Couldn't parse timestamp " + timestamp, e);
        }
    }
View Full Code Here

Examples of org.auraframework.throwable.AuraError

        }
        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

Examples of org.auraframework.throwable.AuraError

            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

Examples of org.auraframework.throwable.AuraError

        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
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.