Examples of BridgeContext


Examples of com.liferay.faces.bridge.context.BridgeContext

          }
          else {

            // FACES-1496: Need to get the BridgeContext from the ThreadLocal in order to prevent memory
            // leaks with Mojarra.
            BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
            PortletContainer portletContainer = bridgeContext.getPortletContainer();
            long ifModifiedHeaderInMilliSeconds = portletContainer.getHttpServletRequestDateHeader(
                HEADER_IF_MODIFIED_SINCE);
            ifModifiedHeaderInSeconds = (long) (ifModifiedHeaderInMilliSeconds / 1000);

            if (logger.isDebugEnabled()) {
View Full Code Here

Examples of com.sun.messaging.bridge.service.BridgeContext

         if (b.getState() == Bridge.State.STARTED && args == null) {
             _bc.logInfo(_bmr.getString(_bmr.I_BRIDGE_ALREADY_STARTED, b.getName()), null);
             return true;
         }

         BridgeContext ctx = new BridgeContext(_bc, b.getName());
         StringBuffer sf = new StringBuffer();
         sf.append(_bmr.getString(_bmr.I_STARTING_BRIDGE_WITH_PROPS, b.getName()));
         String key = null;
         Enumeration e = ctx.getConfig().propertyNames();
         while (e.hasMoreElements()) {
             key = (String)e.nextElement();
             sf.append("\t"+key+"="+ctx.getConfig().getProperty(key)+"\n");
         }
         if (args == null) {
             _bc.logInfo(sf.toString(), null);
         }
View Full Code Here

Examples of com.sun.messaging.bridge.service.BridgeContext

        if (b.getState() == Bridge.State.PAUSED && args == null) {
             _bc.logInfo(_bmr.getString(_bmr.I_BRIDGE_ALREADY_PAUSED, b.getName()), null);
             return;
         }

        b.pause(new BridgeContext(_bc, b.getName()), args);
        _bc.logInfo(_bmr.getString(_bmr.I_PAUSED_BRIDGE, b.getName()), null);
    }
View Full Code Here

Examples of com.sun.messaging.bridge.service.BridgeContext

        if (b.getState() == Bridge.State.STARTED && args == null) {
             _bc.logInfo(_bmr.getString(_bmr.I_BRIDGE_IS_RUNNING, b.getName()), null);
             return;
         }

        b.resume(new BridgeContext(_bc, b.getName()), args);
        _bc.logInfo(_bmr.getString(_bmr.I_RESUMED_BRIDGE, b.getName()), null);

    }
View Full Code Here

Examples of com.sun.messaging.bridge.service.BridgeContext

             return;
         }

        _bc.logInfo(_bmr.getString(_bmr.I_STOPPING_BRIDGE, b.getName()), null);

        b.stop(new BridgeContext(_bc, b.getName()), args);
        _bc.logInfo(_bmr.getString(_bmr.I_STOPPED_BRIDGE, b.getName()), null);
    }
View Full Code Here

Examples of com.sun.messaging.bridge.service.BridgeContext

            String emsg = _bmr.getKString(_bmr.X_BRIDGE_NAME_NOT_FOUND, name);
            _bc.logError(emsg, null);
            throw new BridgeException(emsg);
        }

        BridgeContext bc = new BridgeContext(_bc, b.getName());
        return b.list(bc, args, bmr);
    }
View Full Code Here

Examples of juzu.impl.bridge.BridgeContext

    } else {
      servletLogger.info("Using inject implementation " + injectorProvider.getValue());
    }

    //
    BridgeContext bridgeContext = new AbstractBridgeContext() {
      final ResourceResolver resolver = new ResourceResolver() {
        public URL resolve(String uri) {
          try {
            return getServletContext().getResource(uri);
          }
View Full Code Here

Examples of org.apache.batik.bridge.BridgeContext

        Configuration cfg = pdfInfo.cfg;
        if (cfg != null) {
            strokeText = cfg.getChild("stroke-text", true).getValueAsBoolean(strokeText);
        }

        BridgeContext ctx = new PDFBridgeContext(ua,
                (strokeText ? null : pdfInfo.fi),
                userAgent.getFactory().getImageManager(),
                userAgent.getImageSessionContext(),
                new AffineTransform());

        //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
        //to it.
        Document clonedDoc = BatikUtil.cloneSVGDocument(doc);

        GraphicsNode root;
        try {
            GVTBuilder builder = new GVTBuilder();
            root = builder.build(ctx, clonedDoc);
        } catch (Exception e) {
            SVGEventProducer eventProducer = SVGEventProducer.Provider.get(
                    context.getUserAgent().getEventBroadcaster());
            eventProducer.svgNotBuilt(this, e, getDocumentURI(doc));
            return;
        }
        // get the 'width' and 'height' attributes of the SVG document
        float w = (float)ctx.getDocumentSize().getWidth() * 1000f;
        float h = (float)ctx.getDocumentSize().getHeight() * 1000f;

        float sx = pdfInfo.width / w;
        float sy = pdfInfo.height / h;

        //Scaling and translation for the bounding box of the image
        AffineTransform scaling = new AffineTransform(
                sx, 0, 0, sy, xOffset / 1000f, yOffset / 1000f);

        //Transformation matrix that establishes the local coordinate system for the SVG graphic
        //in relation to the current coordinate system
        AffineTransform imageTransform = new AffineTransform();
        imageTransform.concatenate(scaling);
        imageTransform.concatenate(resolutionScaling);

        /*
         * Clip to the svg area.
         * Note: To have the svg overlay (under) a text area then use
         * an fo:block-container
         */
        PDFContentGenerator generator = renderer.getGenerator();
        generator.comment("SVG setup");
        generator.saveGraphicsState();
        generator.setColor(Color.black, false);
        generator.setColor(Color.black, true);

        if (!scaling.isIdentity()) {
            generator.comment("viewbox");
            generator.add(CTMHelper.toPDFString(scaling, false) + " cm\n");
        }

        //SVGSVGElement svg = ((SVGDocument)doc).getRootElement();

        if (pdfInfo.pdfContext == null) {
            pdfInfo.pdfContext = pdfInfo.pdfPage;
        }
        PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi,
                pdfInfo.pdfDoc,
                pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
                pdfInfo.currentFontName, pdfInfo.currentFontSize);
        graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());

        if (!resolutionScaling.isIdentity()) {
            generator.comment("resolution scaling for " + uaResolution
                        + " -> " + deviceResolution + "\n");
            generator.add(
                    CTMHelper.toPDFString(resolutionScaling, false) + " cm\n");
            graphics.scale(1 / s, 1 / s);
        }

        generator.comment("SVG start");

        //Save state and update coordinate system for the SVG image
        generator.getState().save();
        generator.getState().concatenate(imageTransform);

        //Now that we have the complete transformation matrix for the image, we can update the
        //transformation matrix for the AElementBridge.
        PDFAElementBridge aBridge = (PDFAElementBridge)ctx.getBridge(
                SVGDOMImplementation.SVG_NAMESPACE_URI, SVGConstants.SVG_A_TAG);
        aBridge.getCurrentTransform().setTransform(generator.getState().getTransform());

        graphics.setPaintingState(generator.getState());
        graphics.setOutputStream(pdfInfo.outputStream);
View Full Code Here

Examples of org.apache.batik.bridge.BridgeContext

      {
        document = documentFactory.createSVGDocument(null,
            new ByteArrayInputStream(svgData));
      }

      BridgeContext ctx = new BridgeContext(userAgent);
      ctx.setDynamic(true);
      GVTBuilder builder = new GVTBuilder();
      rootNode = builder.build(ctx, document);
      documentSize = ctx.getDocumentSize();
    }
    catch (IOException e)
    {
      throw new JRRuntimeException(e);
    }
View Full Code Here

Examples of org.apache.batik.bridge.BridgeContext

        doc = impl.createDocument(namespaceURI, "svg", doctype);

        // initializes CSS and SVG specific DOM interfaces
        UserAgent userAgent = new UserAgentAdapter();
        DocumentLoader loader = new DocumentLoader(userAgent);
        BridgeContext ctx = new BridgeContext(userAgent, loader);
        ctx.setDynamicState(BridgeContext.DYNAMIC);
        GVTBuilder builder = new GVTBuilder();
        builder.build(ctx, doc);

        // image margin
        graphSheet.setMargin(MARGIN);
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.