1 16 package org.apache.cocoon.portal.event.aspect.impl; 17 18 import org.apache.cocoon.portal.event.Event; 19 import org.apache.cocoon.portal.event.EventManager; 20 import org.apache.cocoon.portal.event.impl.ChangeAspectDataEvent; 21 import org.apache.cocoon.portal.layout.Layout; 22 import org.apache.cocoon.portal.layout.impl.LinkLayout; 23 24 30 public class LinkEventAspect extends AbstractContentEventAspect { 31 32 protected String getRequestParameterName() { 33 return "link"; 35 } 36 37 protected int getRequiredValueCount() { 38 return 4; 39 } 40 41 44 protected void publish(EventManager publisher, 45 Layout layout, 46 String [] values) { 47 if (layout instanceof LinkLayout) { 48 LinkLayout linkLayout = (LinkLayout) layout; 49 Event e = new ChangeAspectDataEvent(linkLayout, 50 "link-layout-key", 51 values[2]); 52 publisher.send(e); 53 e = new ChangeAspectDataEvent(linkLayout, 54 "link-layout-id", 55 values[3]); 56 publisher.send(e); 57 } else { 58 this.getLogger().warn( 59 "the configured layout: " 60 + layout.getName() 61 + " is not a LinkLayout."); 62 } 63 } 64 65 } 66 | Popular Tags |