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/11 17:38:21 UTC

svn commit: r752509 - /labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj

Author: simoneg
Date: Wed Mar 11 16:38:21 2009
New Revision: 752509

URL: http://svn.apache.org/viewvc?rev=752509&view=rev
Log:
LABS-312 : fix for compounded producers being rendered twice

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

Modified: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj?rev=752509&r1=752508&r2=752509&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj (original)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj Wed Mar 11 16:38:21 2009
@@ -16,6 +16,7 @@
 	}
 	
 	private List<CompoundRelation> CompoundableProducer.compound = null;
+	private boolean CompoundableProducer.compounding = false;
 	
 	
 	public CompoundableProducer CompoundableProducer.compoundWith(Producer p, CompoundType t) {
@@ -95,10 +96,11 @@
 			return;
 		}
 		CompoundableProducer prod = (CompoundableProducer)orig;
-		if (prod.compound == null) {
+		if (prod.compound == null || prod.compounding) {
 			proceed(orig, stream);
 			return;
 		}
+		prod.compounding = true;
 		List<Producer> list = prod.findCompoundedOn(CompoundType.HEAD);
 		for (Producer producer : list) {
 			if (producer instanceof HtmlProducer)
@@ -140,6 +142,7 @@
 			if (producer instanceof HtmlProducer)
 				((HtmlProducer)producer).produce(stream);
 		}
+		prod.compounding = false;		
 	}
 	
 	
@@ -148,10 +151,11 @@
 			proceed(prod, stream);
 			return;			
 		}
-		if (prod.compound == null) {
+		if (prod.compound == null || prod.compounding) {
 			proceed(prod, stream);
 			return;
 		}
+		prod.compounding = true;
 		List<Producer> list = prod.findCompoundedOn(CompoundType.HEAD);
 		for (Producer producer : list) {
 			producer.produce(stream);
@@ -184,7 +188,8 @@
 		list = prod.findCompoundedOn(CompoundType.FOOT);
 		for (Producer producer : list) {
 			producer.produce(stream);
-		}		
+		}
+		prod.compounding = false;		
 	}
 	
 }



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