You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by si...@apache.org on 2009/03/10 22:36:24 UTC

svn commit: r752275 - /labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/producers/TemplatingProducerHook.aj

Author: simoneg
Date: Tue Mar 10 21:36:24 2009
New Revision: 752275

URL: http://svn.apache.org/viewvc?rev=752275&view=rev
Log:
LABS-250 : last second fixes

Modified:
    labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/producers/TemplatingProducerHook.aj

Modified: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/producers/TemplatingProducerHook.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/producers/TemplatingProducerHook.aj?rev=752275&r1=752274&r2=752275&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/producers/TemplatingProducerHook.aj (original)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/producers/TemplatingProducerHook.aj Tue Mar 10 21:36:24 2009
@@ -7,19 +7,25 @@
 
 public aspect TemplatingProducerHook {
 
+	TemplatingProducer around() : call(TemplatingProducer.new()) {
+		return new TemplatingProducer(null);
+	}
+	
 	TemplatingProducer around(String path) : call(TemplatingProducer.new(String)) && args(path) {
+		if (path != null && path.length() == 0) path = null;
 		WebMethodContextElement ele = RunningContext.get().getLast(WebMethodContextElement.class);
-		if (ele == null) return proceed(path);
+		if (ele == null) return proceed("/?/?/" + path);
 
 		if (path == null) {
 			String methodName = ele.getMethod().getName();
 			if (methodName.startsWith("do")) {
 				methodName = methodName.substring(2);
-				methodName = Introspector.decapitalize(methodName);
-				path = methodName;
+			} else if (methodName.startsWith("handle")) {
+				methodName = methodName.substring(6);				
 			}
+			methodName = Introspector.decapitalize(methodName);
+			path = methodName;
 		}
-		if (path == null) return proceed(path);
 		
 		String complete = null;
 		if (!path.startsWith("/")) {
@@ -34,7 +40,7 @@
 		}
 		
 		TemplatingProducer prod = TemplatingProducerFactory.getFor(complete);
-		if (prod == null) return proceed(path);
+		if (prod == null) return proceed(complete + ".??");
 		return prod;
 	}
 	



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org