raphael 2002/11/11 05:01:17
Modified: src/java/org/apache/jetspeed/modules/layouts
JetspeedLayout.java
src/java/org/apache/jetspeed/modules/pages
JetspeedTemplatePage.java JetspeedVelocityPage.java
Log:
Initial fix for bug 13244: CharSet hard-coded to UTF-8 in MimeType class.
Changed to use the "content.defaultencoding" key in JR.p
Revision Changes Path
1.9 +4 -1
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/layouts/JetspeedLayout.java
Index: JetspeedLayout.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/layouts/JetspeedLayout.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- JetspeedLayout.java 7 Nov 2002 20:22:15 -0000 1.8
+++ JetspeedLayout.java 11 Nov 2002 13:01:16 -0000 1.9
@@ -74,7 +74,10 @@
import org.apache.ecs.xml.*;
/**
+ * Legacy jetspeed Layout used when handling ECS-only content.
+ * You should not use it if you want to use Velocity or JSPs.
*
+ * @deprecated This layout is not used anymore in Jetspeed
* @author <a href="mailto:burton@;apache.org">Kevin A. Burton</a>
* @author <a href="mailto:raphael@;apache.org">Rapha�l Lute</a>
* @version $Id$
1.19 +14 -5
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/pages/JetspeedTemplatePage.java
Index: JetspeedTemplatePage.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/pages/JetspeedTemplatePage.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- JetspeedTemplatePage.java 7 Nov 2002 20:22:15 -0000 1.18
+++ JetspeedTemplatePage.java 11 Nov 2002 13:01:17 -0000 1.19
@@ -68,14 +68,11 @@
import org.apache.turbine.services.*;
// Jetspeed Classes
+import org.apache.jetspeed.capability.CapabilityMap;
import org.apache.jetspeed.services.TemplateLocator;
import org.apache.jetspeed.services.rundata.JetspeedRunData;
import org.apache.jetspeed.services.resources.JetspeedResources;
-//<Temporary FIX: new turbine will make it obsolete>
-import org.apache.turbine.services.localization.LocaleDetector;
-//</Temporary FIX: new turbine will make it obsolete>
-
/**
* When building sites using templates, Screens need only be defined
* for templates which require dynamic (database or object) data.
@@ -155,6 +152,18 @@
data.getResponse().setDateHeader("Expires",
System.currentTimeMillis() + (httpLifetime * 1000));
data.getResponse().setDateHeader("Last-Modified",
System.currentTimeMillis());
break;
+ }
+
+ //Set the ContentType of the page
+ CapabilityMap cm = ((JetspeedRunData)data).getCapability();
+ data.setContentType( cm.getPreferredType().getContentType() );
+ data.setCharSet(
JetspeedResources.getString(JetspeedResources.CONTENT_ENCODING_KEY,"utf-8") );
+
+ if (Log.getLogger().isDebugEnabled())
+ {
+ Log.debug( "JetspeedTemplatePage: Setting type to: " +
cm.getPreferredType().getContentType()
+ + "; charset=" +
JetspeedResources.getString(JetspeedResources.CONTENT_ENCODING_KEY,"utf-8")
+ );
}
}
1.7 +3 -36
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/pages/JetspeedVelocityPage.java
Index: JetspeedVelocityPage.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/pages/JetspeedVelocityPage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JetspeedVelocityPage.java 14 Jul 2002 17:18:57 -0000 1.6
+++ JetspeedVelocityPage.java 11 Nov 2002 13:01:17 -0000 1.7
@@ -59,11 +59,7 @@
import org.apache.turbine.services.velocity.TurbineVelocity;
import org.apache.turbine.services.velocity.VelocityService;
import org.apache.velocity.context.Context;
-import org.apache.jetspeed.util.template.*;
-import org.apache.jetspeed.services.resources.JetspeedResources;
-import org.apache.jetspeed.capability.CapabilityMap;
-import org.apache.jetspeed.capability.CapabilityMapFactory;
-import org.apache.jetspeed.util.MimeType;
+import org.apache.jetspeed.util.template.JetspeedTemplateNavigation;
/**
* Extends JetspeedTemplatePage to set the Velocity template Context.
@@ -74,7 +70,7 @@
public class JetspeedVelocityPage extends JetspeedTemplatePage
{
/**
- * Stuffs the Context into the RunData so that it is available to
+ * Stuffs the Context into the RunData so that it is available to
* the Action module and the Screen module via getContext().
*
* Add a couple of default jetspeed context objects.
@@ -88,37 +84,8 @@
Context context = TurbineVelocity.getContext(data);
-
-/* FIXME: this tools are now in TR.p file, as standard request tools instantiated
by turbine.
- All tools but jnavigation are there, jnavigation need to be instantiated
here
- because TemplateNavigation in which depends does have a no args
constructor..and
- turbine need one to be able to instantiate such class as request tool
-*/
-/*
- // the jetspeed application tool
- context.put("jetspeed", new JetspeedTool(data));
- // utility class for building link to other jetspeed components
- context.put("jlink", new JetspeedTemplateLink(data));
- // utility class for building link to external webapp resources
- context.put("clink", new ContentTemplateLink(data));
- // the jetspeed configuration elements
- context.put("config", new JetspeedResources());
-*/
- // New JetSpeed NAvigation Generator
-
context.put("jnavigation", new JetspeedTemplateNavigation(data));
data.getTemplateInfo().setTemplateContext(VelocityService.CONTEXT, context);
-
- //Set the ContentType of the page
- CapabilityMap cm = CapabilityMapFactory.getCapabilityMap( data );
- MimeType mt = cm.getPreferredType();
- data.setContentType( mt.getContentType() );
- data.setCharSet( mt.getCharSet() );
-
- Log.debug( "JetspeedVelocityPage: Setting type to: " + mt );
-
-
-
}
/**
--
To unsubscribe, e-mail: <mailto:jetspeed-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@;jakarta.apache.org>