1 16 package org.apache.cocoon.portal.layout.renderer.impl; 17 18 import org.apache.cocoon.portal.PortalService; 19 import org.apache.cocoon.portal.layout.Layout; 20 import org.apache.cocoon.portal.layout.impl.LinkLayout; 21 import org.xml.sax.ContentHandler ; 22 import org.xml.sax.SAXException ; 23 24 38 public class DefaultLinkRenderer extends AbstractRenderer { 39 40 public void process(Layout layout, PortalService service, ContentHandler handler) 41 throws SAXException { 42 if (layout instanceof LinkLayout) { 43 String layoutKey = (String )layout.getAspectData("link-layout-key"); 44 String layoutId = (String )layout.getAspectData("link-layout-id"); 45 if ( layoutKey == null && layoutId == null){ 46 layoutKey = ((LinkLayout)layout).getLayoutKey(); 48 layoutId = ((LinkLayout)layout).getLayoutId(); 49 } 50 this.processLayout(service.getComponentManager().getProfileManager().getPortalLayout(layoutKey, layoutId), service, handler); 51 } else { 52 throw new SAXException ("Wrong layout type, LinkLayout expected: " + layout.getClass().getName()); 53 } 54 } 55 56 } 57 | Popular Tags |