cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r468520 - in /cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl: AbstractContentEventAspect.java FrameEventAspect.java LinkEventAspect.java
Date Fri, 27 Oct 2006 20:18:25 GMT
Author: cziegeler
Date: Fri Oct 27 13:18:24 2006
New Revision: 468520

URL: http://svn.apache.org/viewvc?view=rev&rev=468520
Log:
Make event aspects configurable

Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java?view=diff&rev=468520&r1=468519&r2=468520
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java
Fri Oct 27 13:18:24 2006
@@ -50,7 +50,7 @@
         this.manager = aManager;
     }
 
-    protected abstract String getRequestParameterName();
+    protected abstract String getRequestParameterName(EventAspectContext context);
 
     protected abstract int getRequiredValueCount();
 
@@ -86,7 +86,7 @@
      */
     public void process(EventAspectContext context) {
         final Request request = ObjectModelHelper.getRequest(context.getPortalService().getProcessInfoProvider().getObjectModel());
-        String[] values = request.getParameterValues(this.getRequestParameterName());
+        String[] values = request.getParameterValues(this.getRequestParameterName(context));
         if (values != null) {
             final EventManager publisher = context.getPortalService().getEventManager();
             for (int i = 0; i < values.length; i++) {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java?view=diff&rev=468520&r1=468519&r2=468520
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java
Fri Oct 27 13:18:24 2006
@@ -18,6 +18,7 @@
 
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.Event;
+import org.apache.cocoon.portal.event.aspect.EventAspectContext;
 import org.apache.cocoon.portal.event.layout.LayoutInstanceChangeAttributeEvent;
 import org.apache.cocoon.portal.om.FrameLayout;
 import org.apache.cocoon.portal.om.Layout;
@@ -30,11 +31,16 @@
  */
 public class FrameEventAspect extends AbstractContentEventAspect {
 
-    protected String getRequestParameterName() {
-        // TODO - make this configurable
-        return "frame";
+    /**
+     * @see org.apache.cocoon.portal.event.aspect.impl.AbstractContentEventAspect#getRequestParameterName(org.apache.cocoon.portal.event.aspect.EventAspectContext)
+     */
+    protected String getRequestParameterName(EventAspectContext context) {
+        return context.getAspectProperties().getProperty("parameter-name", "frame");
     }
 
+    /**
+     * @see org.apache.cocoon.portal.event.aspect.impl.AbstractContentEventAspect#getRequiredValueCount()
+     */
     protected int getRequiredValueCount() {
         return 2;
     }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java?view=diff&rev=468520&r1=468519&r2=468520
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java
Fri Oct 27 13:18:24 2006
@@ -19,6 +19,7 @@
 import org.apache.cocoon.portal.LayoutException;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.Event;
+import org.apache.cocoon.portal.event.aspect.EventAspectContext;
 import org.apache.cocoon.portal.event.layout.LayoutInstanceChangeAttributeEvent;
 import org.apache.cocoon.portal.om.Layout;
 import org.apache.cocoon.portal.om.LayoutFeatures;
@@ -31,11 +32,16 @@
  */
 public class LinkEventAspect extends AbstractContentEventAspect {
 
-    protected String getRequestParameterName() {
-        // TODO - make this configurable
-        return "link";
+    /**
+     * @see org.apache.cocoon.portal.event.aspect.impl.AbstractContentEventAspect#getRequestParameterName(org.apache.cocoon.portal.event.aspect.EventAspectContext)
+     */
+    protected String getRequestParameterName(EventAspectContext context) {
+        return context.getAspectProperties().getProperty("parameter-name", "link");
     }
 
+    /**
+     * @see org.apache.cocoon.portal.event.aspect.impl.AbstractContentEventAspect#getRequiredValueCount()
+     */
     protected int getRequiredValueCount() {
         return 2;
     }



Mime
View raw message