View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.portletbridge.portlet;
17  
18  import java.io.Reader;
19  import java.net.URI;
20  
21  import javax.portlet.RenderRequest;
22  import javax.portlet.RenderResponse;
23  
24  import org.portletbridge.ResourceException;
25  
26  /***
27   * The portlet uses implementations of this class to transform data 
28   * from the downstream site into the portlet content
29   * 
30   * @author JMcCrindle
31   */
32  public interface BridgeTransformer {
33  
34      /***
35       * Transform the downstream content to portlet content
36       * 
37       * @param memento the portlet memento to use
38       * @param perPortletMemento the memento for the particular portlet instance
39       * @param currentUrl the current url
40       * @param request the render request
41       * @param response the render response to write the result out to
42       * @param in the reader to read the downstream content from
43       * @throws ResourceException if there is a problem transforming the content
44       */
45      void transform(PortletBridgeMemento memento, PerPortletMemento perPortletMemento, URI currentUrl,
46              RenderRequest request, RenderResponse response,
47              Reader in) throws ResourceException;
48  }