vgritsenko 01/08/14 08:51:31
Modified: src/org/apache/cocoon/environment AbstractEnvironment.java
Environment.java
src/org/apache/cocoon/environment/commandline
AbstractCommandLineEnvironment.java
src/org/apache/cocoon/environment/http HttpEnvironment.java
src/org/apache/cocoon/environment/wrapper
EnvironmentWrapper.java
Log:
- add getSourceHandler() method to Environment,
- add getContentType() method to Environment
Revision Changes Path
1.13 +9 -1
xml-cocoon2/src/org/apache/cocoon/environment/AbstractEnvironment.java
Index: AbstractEnvironment.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/AbstractEnvironment.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- AbstractEnvironment.java 2001/08/14 13:12:32 1.12
+++ AbstractEnvironment.java 2001/08/14 15:51:31 1.13
@@ -25,7 +25,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.12 $ $Date: 2001/08/14 13:12:32 $
+ * @version CVS $Revision: 1.13 $ $Date: 2001/08/14 15:51:31 $
*/
public abstract class AbstractEnvironment extends AbstractLoggable implements
Environment {
@@ -96,6 +96,14 @@
this.action = action;
this.objectModel = new HashMap();
this.rootContext = context;
+ }
+
+ /**
+ * Get the <code>SourceHandler</code> for the current request
+ */
+ public SourceHandler getSourceHandler()
+ {
+ return this.sourceHandler;
}
/**
1.6 +11 -1 xml-cocoon2/src/org/apache/cocoon/environment/Environment.java
Index: Environment.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Environment.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Environment.java 2001/07/10 07:44:31 1.5
+++ Environment.java 2001/08/14 15:51:31 1.6
@@ -20,12 +20,17 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.5 $ $Date: 2001/07/10 07:44:31 $
+ * @version CVS $Revision: 1.6 $ $Date: 2001/08/14 15:51:31 $
*/
public interface Environment extends SourceResolver {
/**
+ * Get the <code>SourceHandler</code> for the current request
+ */
+ SourceHandler getSourceHandler();
+
+ /**
* Set the <code>SourceHandler</code> for the current request
*/
void setSourceHandler(SourceHandler sourceHandler);
@@ -64,6 +69,11 @@
* Set the content type of the generated resource
*/
void setContentType(String mimeType);
+
+ /**
+ * Get the content type of the resource
+ */
+ String getContentType();
/**
* Set the length of the generated content
1.5 +2 -2
xml-cocoon2/src/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java
Index: AbstractCommandLineEnvironment.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AbstractCommandLineEnvironment.java 2001/07/04 07:57:23 1.4
+++ AbstractCommandLineEnvironment.java 2001/08/14 15:51:31 1.5
@@ -20,7 +20,7 @@
* This environment is used to save the requested file to disk.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.4 $ $Date: 2001/07/04 07:57:23 $
+ * @version CVS $Revision: 1.5 $ $Date: 2001/08/14 15:51:31 $
*/
public abstract class AbstractCommandLineEnvironment
@@ -64,7 +64,7 @@
}
/**
- * Set the ContentType
+ * Get the ContentType
*/
public String getContentType() {
return this.contentType;
1.6 +11 -0
xml-cocoon2/src/org/apache/cocoon/environment/http/HttpEnvironment.java
Index: HttpEnvironment.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/http/HttpEnvironment.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HttpEnvironment.java 2001/06/12 21:30:55 1.5
+++ HttpEnvironment.java 2001/08/14 15:51:31 1.6
@@ -42,6 +42,9 @@
/** The OutputStream */
private OutputStream outputStream = null;
+ /** Cache content type as there is no getContentType() in reponse object */
+ private String contentType = null;
+
/**
* Constructs a HttpEnvironment object from a HttpServletRequest
* and HttpServletResponse objects
@@ -114,6 +117,14 @@
*/
public void setContentType(String contentType) {
this.response.setContentType(contentType);
+ this.contentType = contentType;
+ }
+
+ /**
+ * Get the ContentType
+ */
+ public String getContentType() {
+ return this.contentType;
}
/**
1.4 +16 -1
xml-cocoon2/src/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
Index: EnvironmentWrapper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EnvironmentWrapper.java 2001/07/12 06:34:17 1.3
+++ EnvironmentWrapper.java 2001/08/14 15:51:31 1.4
@@ -34,7 +34,7 @@
* contains a <code>RequestWrapper</code> object.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version $Id: EnvironmentWrapper.java,v 1.3 2001/07/12 06:34:17 cziegeler Exp $
+ * @version $Id: EnvironmentWrapper.java,v 1.4 2001/08/14 15:51:31 vgritsenko Exp $
*/
public final class EnvironmentWrapper
implements Environment {
@@ -124,6 +124,21 @@
*/
public void setContentType(String contentType) {
// ignore this
+ }
+
+ /**
+ * Get the ContentType
+ */
+ public String getContentType() {
+ // ignore this
+ return null;
+ }
+
+ /**
+ * Get the <code>SourceHandler</code> for the current request
+ */
+ public SourceHandler getSourceHandler() {
+ return this.environment.getSourceHandler();
}
/**
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]