Examples of FilterManager


Examples of org.apache.pdfbox.filter.FilterManager

    public FilterManager getFilterManager()
    {
        /**
         * @todo move this to PDFdocument or something better
         */
        return new FilterManager();
    }
View Full Code Here

Examples of org.apache.pdfbox.filter.FilterManager

   * @return A stream with decoded data.
   * @throws IOException If there is an error processing the stream.
   */
  public InputStream getPartiallyFilteredStream( List stopFilters ) throws IOException
  {
    FilterManager manager = stream.getFilterManager();
    InputStream is = stream.getFilteredStream();
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    List filters = getFilters();
    String nextFilter = null;
    boolean done = false;
    for( int i=0; i<filters.size() && !done; i++ )
    {
      os.reset();
      nextFilter = (String)filters.get( i );
      if( stopFilters.contains( nextFilter ) )
      {
        done = true;
      }
      else
      {
        Filter filter = manager.getFilter( COSName.getPDFName(nextFilter) );
        filter.decode( is, os, stream, i );
        is = new ByteArrayInputStream( os.toByteArray() );
      }
    }
    return is;
View Full Code Here

Examples of org.apache.pdfbox.filter.FilterManager

     * @return A stream with decoded data.
     * @throws IOException If there is an error processing the stream.
     */
    public InputStream getPartiallyFilteredStream( List stopFilters ) throws IOException
    {
        FilterManager manager = stream.getFilterManager();
        InputStream is = stream.getFilteredStream();
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        List filters = getFilters();
        String nextFilter = null;
        boolean done = false;
        for( int i=0; i<filters.size() && !done; i++ )
        {
            os.reset();
            nextFilter = (String)filters.get( i );
            if( stopFilters.contains( nextFilter ) )
            {
                done = true;
            }
            else
            {
                Filter filter = manager.getFilter( COSName.getPDFName(nextFilter) );
                filter.decode( is, os, stream, i );
                is = new ByteArrayInputStream( os.toByteArray() );
            }
        }
        return is;
View Full Code Here

Examples of org.apache.pdfbox.filter.FilterManager

     *             If there is an error processing the stream.
     */
    public InputStream getPartiallyFilteredStream(List<String> stopFilters)
            throws IOException
    {
        FilterManager manager = stream.getFilterManager();
        InputStream is = stream.getFilteredStream();
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        List<COSName> filters = getFilters();
        COSName nextFilter = null;
        boolean done = false;
        for (int i = 0; i < filters.size() && !done; i++)
        {
            os.reset();
            nextFilter = filters.get(i);
            if (stopFilters.contains(nextFilter.getName()))
            {
                done = true;
            }
            else
            {
                Filter filter = manager.getFilter(nextFilter);
                filter.decode(is, os, stream, i);
                is = new ByteArrayInputStream(os.toByteArray());
            }
        }
        return is;
View Full Code Here

Examples of org.apache.pdfbox.filter.FilterManager

        }
        else
        {
            ByteArrayInputStream in = new ByteArrayInputStream( getImageData() );
            ByteArrayOutputStream out = new ByteArrayOutputStream(getImageData().length);
            FilterManager filterManager = new FilterManager();
            for( int i=0; i<filters.size(); i++ )
            {
                out.reset();
                Filter filter = filterManager.getFilter( (String)filters.get( i ) );
                filter.decode( in, out, params.getDictionary(), i );
                in = new ByteArrayInputStream( out.toByteArray() );
            }
            finalData = out.toByteArray();
        }
View Full Code Here

Examples of org.apache.pluto.container.FilterManager

        PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
        PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
        RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
        RenderResponse portletResponse = envService.createRenderResponse(responseContext);

        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RENDER_PHASE);

        try
        {
            invoker.render(requestContext, portletRequest, portletResponse, filterManager);
            // Mark portlet interaction is completed: backend implementation can flush response state now
View Full Code Here

Examples of org.apache.pluto.container.FilterManager

        PortletResourceRequestContext requestContext = rcService.getPortletResourceRequestContext(this, request, response, portletWindow);
        PortletResourceResponseContext responseContext = rcService.getPortletResourceResponseContext(this, request, response, portletWindow);
        ResourceRequest portletRequest = envService.createResourceRequest(requestContext, responseContext);
        ResourceResponse portletResponse = envService.createResourceResponse(responseContext, requestContext.getCacheability());

        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RESOURCE_PHASE);

        try
        {
            invoker.serveResource(requestContext, portletRequest, portletResponse, filterManager);
            // Mark portlet interaction is completed: backend implementation can flush response state now
View Full Code Here

Examples of org.apache.pluto.container.FilterManager

        PortletRequestContext requestContext = rcService.getPortletActionRequestContext(this, request, response, portletWindow);
        PortletActionResponseContext responseContext = rcService.getPortletActionResponseContext(this, request, response, portletWindow);
        ActionRequest portletRequest = envService.createActionRequest(requestContext, responseContext);
        ActionResponse portletResponse = envService.createActionResponse(responseContext);

        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.ACTION_PHASE);

        String location = null;

        try
        {
View Full Code Here

Examples of org.apache.pluto.container.FilterManager

        PortletRequestContext requestContext = rcService.getPortletEventRequestContext(this, request, response, portletWindow);
        PortletEventResponseContext responseContext = rcService.getPortletEventResponseContext(this, request, response, portletWindow);
        EventRequest portletRequest = envService.createEventRequest(requestContext, responseContext, event);
        EventResponse portletResponse = envService.createEventResponse(responseContext);

        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.EVENT_PHASE);

        List<Event> events = null;
        try
        {
            invoker.event(requestContext, portletRequest, portletResponse, filterManager);
View Full Code Here

Examples of org.apache.pluto.container.FilterManager

        final PortletResponse portletResponse = (PortletResponse) request.getAttribute(PortletInvokerService.PORTLET_RESPONSE);

        final PortletRequestContext requestContext = (PortletRequestContext) portletRequest.getAttribute(PortletInvokerService.REQUEST_CONTEXT);
        final PortletResponseContext responseContext = (PortletResponseContext) portletRequest.getAttribute(PortletInvokerService.RESPONSE_CONTEXT);

        final FilterManager filterManager = (FilterManager) request.getAttribute(PortletInvokerService.FILTER_MANAGER);

        request.removeAttribute(PortletInvokerService.METHOD_ID);
        request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
        request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
        request.removeAttribute(PortletInvokerService.FILTER_MANAGER);

        DriverPortletConfig portletConfig = portletConfigs.get(portletName);
        requestContext.init(portletConfig, getServletContext(), request, response);
        responseContext.init(request, response);

        PortletWindow window = requestContext.getPortletWindow();

        PortletInvocationEvent event = new PortletInvocationEvent(portletRequest, window, methodId.intValue());

        notify(event, true, null);

        // FilterManager filtermanager = (FilterManager) request.getAttribute(
        // "filter-manager");

        try {

            // The requested method is RENDER: call Portlet.render(..)
            if (methodId == PortletInvokerService.METHOD_RENDER) {
                RenderRequest renderRequest = (RenderRequest) portletRequest;
                RenderResponse renderResponse = (RenderResponse) portletResponse;
                filterManager.processFilter(renderRequest, renderResponse,
                        portlet, portletContext);
            }

            // The requested method is RESOURCE: call
            // ResourceServingPortlet.serveResource(..)
            else if (methodId == PortletInvokerService.METHOD_RESOURCE) {
                ResourceRequest resourceRequest = (ResourceRequest) portletRequest;
                ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
                filterManager.processFilter(resourceRequest, resourceResponse,
                        resourceServingPortlet, portletContext);
            }

            // The requested method is ACTION: call Portlet.processAction(..)
            else if (methodId == PortletInvokerService.METHOD_ACTION) {
                ActionRequest actionRequest = (ActionRequest) portletRequest;
                ActionResponse actionResponse = (ActionResponse) portletResponse;
                filterManager.processFilter(actionRequest, actionResponse,
                        portlet, portletContext);
            }

            // The request methode is Event: call Portlet.processEvent(..)
            else if (methodId == PortletInvokerService.METHOD_EVENT) {
                EventRequest eventRequest = (EventRequest) portletRequest;
                EventResponse eventResponse = (EventResponse) portletResponse;
                filterManager.processFilter(eventRequest, eventResponse,
                        eventPortlet, portletContext);
            }
            // The requested method is ADMIN: call handlers.
            else if (methodId == PortletInvokerService.METHOD_ADMIN) {
                PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
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.