Package org.auraframework.service

Examples of org.auraframework.service.DefinitionService


    }

    @Override
    protected void fix() throws QuickFixException {
        BuilderService builderService = Aura.getBuilderService();
        DefinitionService definitionService = Aura.getDefinitionService();
        String descriptors = (String) getAttributes().get("descriptor");
        String[] split = descriptorPattern.split(descriptors);
        for (String descriptor : split) {
            ComponentDef def = builderService.getComponentDefBuilder().setDescriptor(descriptor).build();
            definitionService.save(def);

            if (getBooleanAttribute("client.css")) {
                DefDescriptor<StyleDef> styleDescriptor = definitionService.getDefDescriptor(def.getDescriptor(),
                        "css", StyleDef.class);
                new CreateStyleDefQuickFix(styleDescriptor).fix();
            }
            resetCache(def.getDescriptor());
        }
View Full Code Here


    @SuppressWarnings("unchecked")
    @Override
    protected void fix() throws QuickFixException {
        BuilderService builderService = Aura.getBuilderService();
        DefinitionService definitionService = Aura.getDefinitionService();

        DefDescriptor<StyleDef> styleDescriptor = (DefDescriptor<StyleDef>) getAttributes().get("descriptor");
        StyleDefBuilder builder = builderService.getStyleDefBuilder();

        builder.setDescriptor(styleDescriptor);
        builder.setClassName(styleDescriptor.getNamespace() + AuraTextUtil.initCap(styleDescriptor.getName()));
        StyleDef styleDef = builder.build();
        definitionService.save(styleDef);
    }
View Full Code Here

    }

    @Override
    protected void fix() throws QuickFixException {
        BuilderService builderService = Aura.getBuilderService();
        DefinitionService definitionService = Aura.getDefinitionService();
        String descriptors = (String) getAttributes().get("descriptor");
        String[] split = CreateComponentDefQuickFix.descriptorPattern.split(descriptors);
        for (String descriptor : split) {
            ApplicationDef def = builderService.getApplicationDefBuilder().setDescriptor(descriptor).build();
            definitionService.save(def);

            if (getBooleanAttribute("client.css")) {
                DefDescriptor<StyleDef> styleDescriptor = definitionService.getDefDescriptor(def.getDescriptor(),
                        "css", StyleDef.class);
                new CreateStyleDefQuickFix(styleDescriptor).fix();
            }
            resetCache(def.getDescriptor());
        }
View Full Code Here

    }

    @Override
    protected void fix() throws Exception {
        BuilderService builderService = Aura.getBuilderService();
        DefinitionService definitionService = Aura.getDefinitionService();
        String descriptors = (String) getAttributes().get("descriptor");
        String[] split = CreateComponentDefQuickFix.descriptorPattern.split(descriptors);
        for (String descriptor : split) {
            ThemeDef def = builderService.getThemeDefBuilder().setDescriptor(descriptor).build();
            definitionService.save(def);
            resetCache(def.getDescriptor());
        }
    }
View Full Code Here

    }

    private <T extends Definition> void populate(Map<DefDescriptor<?>, Map<String, String>> unused,
            Set<DefDescriptor<?>> used, Class<T> type) throws QuickFixException {

        DefinitionService definitionService = Aura.getDefinitionService();
        DefDescriptor<T> matcher = definitionService.getDefDescriptor("markup://*:*", type);
        Set<DefDescriptor<T>> descriptors = definitionService.find(matcher);

        for (DefDescriptor<T> desc : descriptors) {
            Map<String, String> values = Maps.newHashMap();
            values.put("name", desc.getDescriptorName());

            try {
                TestSuiteDef suite = definitionService.getDefDescriptor(desc, "js", TestSuiteDef.class).getDef();
                if (suite.getTestCaseDefs().size() == 0) {
                    unused.put(desc, values);
                }
            } catch (Throwable t) {
                unused.put(desc, values);
View Full Code Here

public class CatalogModel {

    private final List<Map<String, String>> components = Lists.newArrayList();

    public CatalogModel() throws QuickFixException {
        DefinitionService definitionService = Aura.getDefinitionService();

        DefDescriptor<ComponentDef> matcher = definitionService.getDefDescriptor("markup://*:*", ComponentDef.class);
        Set<DefDescriptor<ComponentDef>> descriptors = definitionService.find(matcher);

        for (DefDescriptor<ComponentDef> desc : descriptors) {
            Map<String, String> values = Maps.newHashMap();
            values.put("name", desc.getDescriptorName());
            try {
                ComponentDef def = desc.getDef();
                values.put("support", def.getSupport().name());
            } catch (Throwable t) {
                values.put("support", "ERROR");
            }
            try {
                TestSuiteDef suite = definitionService.getDefDescriptor(desc, "js", TestSuiteDef.class).getDef();
                values.put("tests", "" + suite.getTestCaseDefs().size());
            } catch (Throwable t) {
                values.put("tests", "0");
            }
            components.add(values);
View Full Code Here

    private final List<TestCaseDef> tcds;

    public JSTestModel() throws QuickFixException {
        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); }
        long nonce = System.currentTimeMillis();

        url = String.format("/%s/%s.%s?aura.nonce=%s&aura.mode=AUTO%s&aura.testReset=true", descriptor.getNamespace(),
View Full Code Here

        if (descriptor == null) {
            defsCache.invalidateAll();
            existsCache.invalidateAll();
        } else {
            DefinitionService ds = Aura.getDefinitionService();
            DefDescriptor<ComponentDef> cdesc = ds.getDefDescriptor(descriptor,
                    "markup", ComponentDef.class);
            DefDescriptor<ApplicationDef> adesc = ds.getDefDescriptor(
                    descriptor, "markup", ApplicationDef.class);

            defsCache.invalidate(descriptor);
            existsCache.invalidate(descriptor);
            defsCache.invalidate(cdesc);
View Full Code Here

    @UnAdaptableTest
    public final class NamespacePerfTestSuite extends TestSuite {
        public NamespacePerfTestSuite(String namespace) throws Exception {
            super(namespace);
            ContextService contextService = Aura.getContextService();
            DefinitionService definitionService = Aura.getDefinitionService();

            boolean contextStarted = false;
            if (!contextService.isEstablished()) {
                contextStarted = true;
                contextService.startContext(Mode.PTEST, Format.JSON, Authentication.AUTHENTICATED);
            }

            Map<String, TestSuite> subSuites = Maps.newHashMap();

            try {
                DefDescriptor<ComponentDef> matcher = definitionService.getDefDescriptor(
                        String.format("markup://%s:*", namespace), ComponentDef.class);

                Set<DefDescriptor<ComponentDef>> descriptors = definitionService.find(matcher);

                for (DefDescriptor<ComponentDef> descriptor : descriptors) {
                    if (descriptor.getDef().isAbstract()
                            || getBlacklistedComponents().contains(descriptor.getQualifiedName())) {
                        continue;
View Full Code Here

public class LintModel {
    List<Map<String, String>> errors = new ArrayList<Map<String, String>>();
    String message;

    public LintModel() throws Exception {
        DefinitionService definitionService = Aura.getDefinitionService();

        String name = (String) Aura.getContextService().getCurrentContext().getCurrentComponent().getAttributes()
                .getValue("name");

        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) {
View Full Code Here

TOP

Related Classes of org.auraframework.service.DefinitionService

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.