01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.pluto.util.assemble;
18:
19: import java.io.IOException;
20: import java.io.InputStream;
21: import java.io.OutputStream;
22:
23: import org.apache.pluto.util.assemble.io.JarStreamingAssembly;
24: import org.apache.pluto.util.assemble.io.WebXmlStreamingAssembly;
25:
26: /**
27: * @version $Revision: 539020 $
28: * @todo fix direct dependency on pluto-descriptor-impl
29: */
30: public abstract class WebXmlRewritingAssembler implements Assembler {
31:
32: //protected final JarStreamingAssembly jarAssembler = new JarStreamingAssembly();
33: //protected final WebXmlStreamingAssembly webXmlAssembler = new WebXmlStreamingAssembly();
34:
35: /**
36: * Updates the webapp descriptor by injecting portlet wrapper servlet
37: * definitions and mappings.
38: *
39: * @param webXmlIn input stream to the webapp descriptor, it will be closed before the web xml is written out.
40: * @param portletXmlIn input stream to the portlet app descriptor, it will be closed before the web xml is written out.
41: * @param webXmlOut output stream to the webapp descriptor, it will be flushed and closed.
42: * @param dispatchServletClass The name of the servlet class to use for
43: * handling portlet requests
44: * @throws IOException
45: */
46: protected void updateWebappDescriptor(InputStream webXmlIn,
47: InputStream portletXmlIn, OutputStream webXmlOut,
48: String dispatchServletClass) throws IOException {
49:
50: WebXmlStreamingAssembly.assembleStream(webXmlIn, portletXmlIn,
51: webXmlOut, dispatchServletClass);
52:
53: }
54: }
|