cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r126035 - in cocoon/branches/BRANCH_2_1_X/src/blocks: forms/java/org/apache/cocoon/forms/transformation jms/java/org/apache/cocoon/samples/jms portal/java/org/apache/cocoon/portal/event/impl portal/java/org/apache/cocoon/portal/pluto scratchpad/java/org/apache/cocoon/components/source/impl
Date Sat, 22 Jan 2005 12:39:52 GMT
Author: cziegeler
Date: Sat Jan 22 04:39:50 2005
New Revision: 126035

URL: http://svn.apache.org/viewcvs?view=rev&rev=126035
Log:
Code cleanup
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/samples/jms/HTTPTrigger.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderFactory.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/DelayRefresher.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java?view=diff&rev=126035&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java&r1=126034&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java&r2=126035
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java
Sat Jan 22 04:39:50 2005
@@ -36,7 +36,6 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.ext.LexicalHandler;
 import org.xml.sax.helpers.AttributesImpl;
-import org.xml.sax.Locator;
 
 import java.util.HashMap;
 import java.util.LinkedList;

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/samples/jms/HTTPTrigger.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/samples/jms/HTTPTrigger.java?view=diff&rev=126035&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/samples/jms/HTTPTrigger.java&r1=126034&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/samples/jms/HTTPTrigger.java&r2=126035
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/samples/jms/HTTPTrigger.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/samples/jms/HTTPTrigger.java
Sat Jan 22 04:39:50 2005
@@ -17,8 +17,8 @@
 
 import java.net.HttpURLConnection;
 import java.net.URL;
-import java.net.URLEncoder;
 
+import org.apache.cocoon.util.NetUtils;
 import org.hsqldb.Trigger;
 
 /**
@@ -37,11 +37,10 @@
      */
     public void fire(String triggerName, String tableName, Object[] row) {
         try {
-            // FIXME: Method URLEncoder.encode(triggerName.toLowerCase(), "UTF-8") is absent
on JDK1.3
             HttpURLConnection con = (HttpURLConnection) new URL(this.protocol, this.hostname,
this.port, this.path+"?trigger="
-                            + URLEncoder.encode(triggerName.toLowerCase())
+                            + NetUtils.encode(triggerName.toLowerCase(), "utf-8")
                             + "&table="
-                            + URLEncoder.encode(tableName.toLowerCase())).openConnection();
+                            + NetUtils.encode(tableName.toLowerCase(), "utf-8")).openConnection();
             con.connect();
             con.getContent();
             con.disconnect();

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java?view=diff&rev=126035&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java&r1=126034&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java&r2=126035
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java
Sat Jan 22 04:39:50 2005
@@ -20,8 +20,6 @@
 import org.apache.cocoon.portal.event.ConvertableEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.PortalService;
-import org.apache.cocoon.portal.pluto.om.PortletWindowImpl;
-import org.apache.pluto.om.window.PortletWindow;
 
 /**
  * EventSource: copletID

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderFactory.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderFactory.java?view=diff&rev=126035&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderFactory.java&r1=126034&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderFactory.java&r2=126035
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderFactory.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderFactory.java
Sat Jan 22 04:39:50 2005
@@ -19,8 +19,6 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.ConvertableEventFactory;
 import org.apache.cocoon.portal.event.ConvertableEvent;
-import org.apache.cocoon.portal.event.impl.FullScreenCopletEventFactory;
-import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent;
 
 /**
  * Factory to create PortletURLProviderImpl objects from marshalled data

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/DelayRefresher.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/DelayRefresher.java?view=diff&rev=126035&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/DelayRefresher.java&r1=126034&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/DelayRefresher.java&r2=126035
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/DelayRefresher.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/DelayRefresher.java
Sat Jan 22 04:39:50 2005
@@ -19,9 +19,8 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
 import java.io.Writer;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -48,6 +47,7 @@
 import org.apache.cocoon.components.cron.CronJob;
 import org.apache.cocoon.components.cron.JobScheduler;
 import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.util.NetUtils;
 import org.apache.excalibur.source.ModifiableSource;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceException;
@@ -272,26 +272,29 @@
 	 * @throws CascadingException
 	 */
 	private void setupSingleRefreshJob(final Configuration conf) throws ConfigurationException,
CascadingException {
-		
-        final String uri = URLDecoder.decode(conf.getAttribute(ATTR_URI));
-		final String cache = conf.getAttribute(ATTR_CACHE);
-        final int expires = conf.getAttributeAsInteger(ATTR_EXPIRES);
-		final String key = URLDecoder.decode(conf.getAttribute(ATTR_KEY));
-		final IdentifierCacheKey cacheKey = new IdentifierCacheKey(key, false);
-		
-        final Parameters parameters = Parameters.fromConfiguration(conf);
-        
-        final TargetConfiguration tc = new TargetConfiguration(cacheKey, uri, cache, parameters);
-		
-        this.entries.put(key, tc);
-		final String name = cacheKey.getKey();
-		
-		this.scheduler.addPeriodicJob(name,
-                                      this.updateTarget,
-		                              expires,
-		                              true,
-		                              tc.parameters,
-		                              tc.map);
+		try {
+            final String uri = NetUtils.decode(conf.getAttribute(ATTR_URI), "utf-8");
+    		final String cache = conf.getAttribute(ATTR_CACHE);
+            final int expires = conf.getAttributeAsInteger(ATTR_EXPIRES);
+    		final String key = NetUtils.decode(conf.getAttribute(ATTR_KEY), "utf-8");
+    		final IdentifierCacheKey cacheKey = new IdentifierCacheKey(key, false);
+    		
+            final Parameters parameters = Parameters.fromConfiguration(conf);
+            
+            final TargetConfiguration tc = new TargetConfiguration(cacheKey, uri, cache,
parameters);
+    		
+            this.entries.put(key, tc);
+    		final String name = cacheKey.getKey();
+    		
+    		this.scheduler.addPeriodicJob(name,
+                                          this.updateTarget,
+    		                              expires,
+    		                              true,
+    		                              tc.parameters,
+    		                              tc.map);
+        } catch (UnsupportedEncodingException uee) {
+            throw new ConfigurationException("Unsupported encoding.", uee);
+        }
 	}
 
 	/**
@@ -335,13 +338,13 @@
 	 */
 	private void writeRefreshJobConfiguration(Writer writer, final TargetConfiguration c) throws
IOException {
         writer.write("<"+TAGNAME_TARGET+" "+ATTR_URI+"=\"");
-        writer.write(URLEncoder.encode(c.parameters.getParameter(ATTR_URI, "")));
+        writer.write(NetUtils.encode(c.parameters.getParameter(ATTR_URI, ""), "utf-8"));
         writer.write("\" "+ATTR_EXPIRES+"=\"");
         writer.write(c.parameters.getParameter(PARAM_CACHE_EXPIRES, "0"));
         writer.write("\" "+ATTR_CACHE+"=\"");
         writer.write(c.parameters.getParameter(PARAM_CACHE_ROLE, ""));
         writer.write("\" "+ATTR_KEY+"=\"");
-        writer.write(URLEncoder.encode(((IdentifierCacheKey) c.map.get(CACHE_KEY)).getKey()));
+        writer.write(NetUtils.encode(((IdentifierCacheKey) c.map.get(CACHE_KEY)).getKey(),
"utf-8"));
         writer.write("\"/>\n");
 	}
 	

Mime
View raw message