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.cocoon.sitemap;
18:
19: import org.apache.avalon.framework.component.Component;
20:
21: import java.io.IOException;
22: import java.io.OutputStream;
23:
24: /**
25: * This interface marks a component as a sitemap component that produces
26: * a response, like a serializer or a reader.
27: *
28: * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
29: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
30: * @version CVS $Id: SitemapOutputComponent.java 452130 2006-10-02 17:17:06Z vgritsenko $
31: */
32: public interface SitemapOutputComponent extends Component {
33:
34: /**
35: * Set the {@link OutputStream} where the requested resource should
36: * be serialized.
37: */
38: void setOutputStream(OutputStream out) throws IOException;
39:
40: /**
41: * Get the media type of the output of this <code>Component</code>
42: * to be used in <code>Content-Type</code> header in the response.
43: * <br>
44: * Example content type value: <code>text/html; charset=utf-8</code>.
45: * <br>
46: * The returned value is used if no <code>mime-type</code> attribute is set
47: * in the sitemap.
48: *
49: * @see org.apache.cocoon.components.pipeline.AbstractProcessingPipeline#setMimeTypeForSerializer
50: * @see org.apache.cocoon.components.pipeline.AbstractProcessingPipeline#setMimeTypeForReader(org.apache.cocoon.environment.Environment)
51: */
52: String getMimeType();
53:
54: /**
55: * Test if the component wants to set the content length
56: */
57: boolean shouldSetContentLength();
58: }
|