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/11/20 09:10:01 UTC
svn commit: r882443 - in /labs/magma/trunk/foundation-website: ./
src/main/java/org/apache/magma/website/
Author: simoneg
Date: Fri Nov 20 08:09:59 2009
New Revision: 882443
URL: http://svn.apache.org/viewvc?rev=882443&view=rev
Log:
LABS-365 LABS-494 : added late config to website
Added:
labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducerLateConfigAnnotation.aj
Modified:
labs/magma/trunk/foundation-website/pom.xml
labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj
labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducer.java
Modified: labs/magma/trunk/foundation-website/pom.xml
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/pom.xml?rev=882443&r1=882442&r2=882443&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/pom.xml (original)
+++ labs/magma/trunk/foundation-website/pom.xml Fri Nov 20 08:09:59 2009
@@ -66,6 +66,11 @@
<artifactId>foundation-database</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.magma</groupId>
+ <artifactId>lateconfig-api</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.magma</groupId>
<artifactId>foundation-i18n</artifactId>
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=882443&r1=882442&r2=882443&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 Fri Nov 20 08:09:59 2009
@@ -28,6 +28,9 @@
import org.apache.magma.website.templating.Template;
import org.apache.magma.website.utils.MakeURLRewritingContextBased;
+import org.apache.magma.basics.context.RunningContext;
+import org.apache.magma.lateconfig.LateConfigurable;
+
public aspect CompoundableProducerImpl {
declare precedence : CompoundableProducerImpl, MakeURLRewritingContextBased;
@@ -52,6 +55,7 @@
return this;
}
+ @LateConfigurable
public CompoundableProducer CompoundableProducer.compoundCssClass(String cssClass, CompoundType t) {
if (customCssClasses == null) {
customCssClasses = new HashMap<CompoundType, String>();
@@ -123,21 +127,28 @@
}
private void compoundZone(CompoundableProducer prod, CompoundType side, Writer stream) throws IOException {
- List<Producer> list = prod.findCompoundedOn(side);
- if (!list.isEmpty()) {
- String addcss = null;
- if (prod.customCssClasses != null) {
- addcss = prod.customCssClasses.get(side);
- }
- openWrapper(addcss, stream, side);
- for (Producer producer : list) {
- if (producer instanceof HtmlProducer) {
- openWrapper((HtmlProducer) producer, stream, side);
- ((HtmlProducer)producer).produce(stream);
- closeWrapper(stream);
+ RunningContext.get().push("Compounded");
+ RunningContext.get().push(side.name());
+ try {
+ List<Producer> list = prod.findCompoundedOn(side);
+ if (!list.isEmpty()) {
+ String addcss = null;
+ if (prod.customCssClasses != null) {
+ addcss = prod.customCssClasses.get(side);
+ }
+ openWrapper(addcss, stream, side);
+ for (Producer producer : list) {
+ if (producer instanceof HtmlProducer) {
+ openWrapper((HtmlProducer) producer, stream, side);
+ ((HtmlProducer)producer).produce(stream);
+ closeWrapper(stream);
+ }
}
+ closeWrapper(stream);
}
- closeWrapper(stream);
+ } finally {
+ RunningContext.get().popString();
+ RunningContext.get().popString();
}
}
Modified: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducer.java?rev=882443&r1=882442&r2=882443&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducer.java (original)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducer.java Fri Nov 20 08:09:59 2009
@@ -17,6 +17,7 @@
package org.apache.magma.website;
import org.apache.magma.basics.MagmaException;
+import org.apache.magma.lateconfig.LateConfigurable;
import org.apache.magma.website.templating.Template;
import java.io.IOException;
@@ -28,6 +29,7 @@
import java.util.List;
+@LateConfigurable
public abstract class HtmlProducer extends Producer implements Templatable, CompoundableProducer {
protected boolean repeatable = true;
@@ -88,6 +90,7 @@
return customHtmlId;
}
+ @LateConfigurable
public void setCustomHtmlId(String customHtmlId) {
this.customHtmlId = customHtmlId;
}
@@ -96,10 +99,12 @@
return useDefaultClasses;
}
+ @LateConfigurable
public void setUseDefaultClasses(boolean useDefaultClasses) {
this.useDefaultClasses = useDefaultClasses;
}
+ @LateConfigurable
public void addCustomCssClass(String cssClass) {
if (customCssClasses == null) {
customCssClasses = new ArrayList<String>();
Added: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducerLateConfigAnnotation.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducerLateConfigAnnotation.aj?rev=882443&view=auto
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducerLateConfigAnnotation.aj (added)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/HtmlProducerLateConfigAnnotation.aj Fri Nov 20 08:09:59 2009
@@ -0,0 +1,11 @@
+package org.apache.magma.website;
+
+import org.apache.magma.lateconfig.LateConfigurationTrigger;
+
+public aspect HtmlProducerLateConfigAnnotation {
+
+ // TODO without wildcards gives that the method does not exist in ParametrizableHtmlPRoducerBase
+ // TODO is this https://bugs.eclipse.org/bugs/show_bug.cgi?id=288049 ???
+ declare @method : public void (Html*roducer+).produce(..) : @LateConfigurationTrigger;
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org