Package org.exoplatform.resolver

Examples of org.exoplatform.resolver.ResourceResolver


    @SuppressWarnings("unchecked")
    public Object getMapGroovyObject(WebuiRequestContext context) throws Exception {
        if (object == null) {
            synchronized (this) {
                if (object == null) {
                    ResourceResolver resolver = context.getResourceResolver(value);
                    InputStream is = resolver.getInputStream(value);
                    Binding binding = new Binding();
                    GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(), binding);
                    object = shell.evaluate(is);
                    is.close();
                }
View Full Code Here


        return object;
    }

    public Object getFreshObject(WebuiRequestContext context) throws Exception {
        try {
            ResourceResolver resolver = context.getResourceResolver(value);
            InputStream is = resolver.getInputStream(value);
            Binding binding = new Binding();
            GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(), binding);
            object = shell.evaluate(is);
            is.close();
            return object;
View Full Code Here

    public ResourceResolver getResourceResolver(String uri) {
        Application app = getApplication();
        RequestContext pcontext = this;
        while (app != null) {
            ApplicationResourceResolver appResolver = app.getResourceResolver();
            ResourceResolver resolver = appResolver.getResourceResolver(uri);
            if (resolver != null) {
                return resolver;
            }
            pcontext = pcontext.getParentAppRequestContext();
            if (pcontext != null) {
View Full Code Here

            throw new IllegalStateException("uicomponent " + uicomponent + " with class " + uicomponent.getClass().getName()
                    + " has no template for rendering");
        }

        //
        ResourceResolver resolver = uicomponent.getTemplateResourceResolver(context, template);
        WebuiBindingContext bcontext = new WebuiBindingContext(resolver, context.getWriter(), uicomponent, context);
        bcontext.put(UIComponent.UICOMPONENT, uicomponent);
        bcontext.put(uicomponent.getUIComponentName(), uicomponent);
        renderTemplate(template, bcontext);
    }
View Full Code Here

    protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception {
        WebuiRequestContext context = bcontext.getRequestContext();
        bcontext.put("locale", context.getLocale());
        ExoContainer pcontainer = context.getApplication().getApplicationServiceContainer();
        TemplateService service = (TemplateService) pcontainer.getComponentInstanceOfType(TemplateService.class);
        ResourceResolver resolver = bcontext.getResourceResolver();

        if (PropertyManager.isDevelopping()) {
            WebuiRequestContext rootContext = (WebuiRequestContext) context.getParentAppRequestContext();
            if (rootContext == null)
                rootContext = context;
            long lastAccess = rootContext.getUIApplication().getLastAccessApplication();
            if (resolver.isModified(template, lastAccess)) {
                if (log.isDebugEnabled())
                    log.debug("Invalidate the template: " + template);
                service.invalidateTemplate(template, resolver);
            }
        }
View Full Code Here

    public Object getMapXMLObject(WebuiRequestContext context) throws Exception {
        if (object == null) {
            synchronized (this) {
                if (object == null) {
                    ResourceResolver resolver = context.getResourceResolver(value);
                    InputStream is = resolver.getInputStream(value);
                    object = XMLObject.getObject(is);
                    is.close();
                }
            }
        }
View Full Code Here

    @SuppressWarnings("unchecked")
    public Object getMapGroovyObject(WebuiRequestContext context) throws Exception {
        if (object == null) {
            synchronized (this) {
                if (object == null) {
                    ResourceResolver resolver = context.getResourceResolver(value);
                    InputStream is = resolver.getInputStream(value);
                    Binding binding = new Binding();
                    GroovyShell shell = new GroovyShell(prepareClassLoader(), binding);
                    object = shell.evaluate(is);
                    is.close();
                }
View Full Code Here

        return object;
    }

    public Object getFreshObject(WebuiRequestContext context) throws Exception {
        try {
            ResourceResolver resolver = context.getResourceResolver(value);
            InputStream is = resolver.getInputStream(value);
            Binding binding = new Binding();
            GroovyShell shell = new GroovyShell(prepareClassLoader(), binding);
            object = shell.evaluate(is);
            is.close();
            return object;
View Full Code Here

    public ResourceResolver getResourceResolver(String uri) {
        Application app = getApplication();
        RequestContext pcontext = this;
        while (app != null) {
            ApplicationResourceResolver appResolver = app.getResourceResolver();
            ResourceResolver resolver = appResolver.getResourceResolver(uri);
            if (resolver != null) {
                return resolver;
            }
            pcontext = pcontext.getParentAppRequestContext();
            if (pcontext != null) {
View Full Code Here

   {
      Application app = getApplication();
      while (app != null)
      {
         ApplicationResourceResolver appResolver = app.getResourceResolver();
         ResourceResolver resolver = appResolver.getResourceResolver(uri);
         if (resolver != null)
            return resolver;
         RequestContext pcontext = getParentAppRequestContext();
         if (pcontext != null)
            app = pcontext.getApplication();
View Full Code Here

TOP

Related Classes of org.exoplatform.resolver.ResourceResolver

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.