Package org.auraframework.system

Examples of org.auraframework.system.AuraContext


      Map<DefType, String> defaultPrefixes, Format format, Authentication access,
      JsonSerializationContext jsonContext,
      Map<ValueProviderType, GlobalValueProvider> globalProviders,
      DefDescriptor<? extends BaseComponentDef> appDesc,
      boolean isDebugToolEnabled) {
      AuraContext context = new AuraContextImpl(mode, masterRegistry, defaultPrefixes, format, access, jsonContext,
                globalProviders, isDebugToolEnabled);
        currentContext.set(context);
       
      context.setApplicationDescriptor(appDesc);
       
        return context;
    }
View Full Code Here


                original.getJsonSerializationContext(), original.getGlobalProviders(), false);
    }
   
    @Override
    public AuraContext pushSystemContext() {
        AuraContext context = systemContext.get();
        MutableInteger count = systemDepth.get();
       
        if (count == null) {
            count = new MutableInteger(1);
            systemDepth.set(count);
View Full Code Here

     */
    public <T extends Definition> Source<T> getSource(DefDescriptor<T> descriptor) {
        // Look up in the registry if a context is available. Otherwise, we're
        // probably running a context-less unit test
        // and better be using StringSourceLoader
        AuraContext context = Aura.getContextService().getCurrentContext();
        if (context != null) {
            return context.getDefRegistry().getSource(descriptor);
        } else {
            return StringSourceLoader.getInstance().getSource(descriptor);
        }
    }
View Full Code Here

    /**
     * Start a context and set up default values.
     */
    protected AuraContext setupContext(Mode mode, Format format, DefDescriptor<? extends BaseComponentDef> desc)
            throws QuickFixException {
        AuraContext ctxt = Aura.getContextService().startContext(mode, format, Authentication.AUTHENTICATED, desc);
        ctxt.setFrameworkUID(Aura.getConfigAdapter().getAuraFrameworkNonce());
        String uid = ctxt.getDefRegistry().getUid(null, desc);
        ctxt.addLoaded(desc, uid);
        return ctxt;
    }
View Full Code Here

    /**
     * restart context.
     */
    public void restartContext() throws QuickFixException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        DefDescriptor<? extends BaseComponentDef> cmp = context.getApplicationDescriptor();
        String uid = context.getUid(cmp);
        Aura.getContextService().endContext();
        AuraContext newctxt = setupContext(context.getMode(), context.getFormat(), cmp);
        newctxt.addLoaded(cmp, uid);
    }
View Full Code Here

     * @param desc the descriptor to set as the primary object.
     * @param modified break the context uid.
     */
    public String getContext(Mode mode, Format format, DefDescriptor<? extends BaseComponentDef> desc,
            boolean modified) throws QuickFixException {
        AuraContext ctxt = setupContext(mode, format, desc);
        String ctxtString;
        if (modified) {
            String uid = modifyUID(ctxt.getLoaded().get(desc));
            ctxt.addLoaded(desc, uid);
        }
        ctxtString = getSerializedAuraContext(ctxt);
        Aura.getContextService().endContext();
        return ctxtString;
    }
View Full Code Here

    @Override
    public AuraContext startContext(Mode mode, Set<SourceLoader> loaders, Format format, Authentication access) {
        // initialize logging context
        Aura.getLoggingService().establish();
        AuraContext context = AuraImpl.getContextAdapter().establish(mode, getDefRegistry(mode, access, loaders),
                getDefaultsProvider().getPrefixDefaults(mode), format, access,
                AuraJsonContext.createContext(mode, true), getGlobalProviders(), null);
        return context;
    }
View Full Code Here

    @Override
    public AuraContext startContext(Mode mode, Set<SourceLoader> loaders, Format format, Authentication access,
            DefDescriptor<? extends BaseComponentDef> appDesc, boolean isDebugToolEnabled) {
        // initialize logging context
        Aura.getLoggingService().establish();
        AuraContext context = AuraImpl.getContextAdapter().establish(mode, getDefRegistry(mode, access, loaders),
                getDefaultsProvider().getPrefixDefaults(mode), format, access,
                AuraJsonContext.createContext(mode, true), getGlobalProviders(), appDesc, isDebugToolEnabled);
        return context;
    }
View Full Code Here

    public static final String IS_IE11 = "isIE11";

    private Map<String, Object> browserDetails;

    protected Map<String, Object> parse() {
        AuraContext context = Aura.getContextService().getCurrentContext();
        Map<String, Object> m = Maps.newHashMapWithExpectedSize(32);
        String ua = context != null ? context.getClient().getUserAgent() : null;
        BrowserInfo b = new BrowserInfo(ua);
        m.put(IS_TABLET, b.isTablet());
        m.put(IS_PHONE, b.isPhone());
        m.put(IS_ANDROID, b.isAndroid());
        m.put(FORM_FACTOR, b.getFormFactor());
View Full Code Here

        }
    }

    @Override
    public void serialize(Json json) throws IOException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        json.writeMapBegin();
        json.writeMapEntry("descriptor", descriptor);

        if (!context.isPreloading() && !context.isPreloaded(getDescriptor())) {
            // Note that if this starts to depend on anything beside the name of
            // the type, StyleDefCSSFormatAdapter needs to know to restructure its cache
            // keys
            String out = getCode();
            json.writeMapEntry("code", out);
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.