1 16 package org.apache.cocoon.portal.layout.renderer.aspect.impl; 17 18 import org.apache.cocoon.portal.PortalService; 19 import org.apache.cocoon.portal.coplet.CopletInstanceData; 20 import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent; 21 import org.apache.cocoon.portal.layout.Layout; 22 import org.apache.cocoon.portal.layout.impl.CopletLayout; 23 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext; 24 import org.apache.cocoon.xml.XMLUtils; 25 import org.xml.sax.ContentHandler ; 26 import org.xml.sax.SAXException ; 27 28 52 public class FullScreenCopletAspect extends AbstractAspect { 53 54 57 public void toSAX(RendererAspectContext context, 58 Layout layout, 59 PortalService service, 60 ContentHandler handler) 61 throws SAXException { 62 63 CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData(); 64 65 Boolean supportsFullScreen = (Boolean )cid.getCopletData().getAspectData("full-screen"); 66 if ( supportsFullScreen == null || supportsFullScreen.equals(Boolean.TRUE) ) { 67 final Layout fullScreenLayout = service.getEntryLayout(null); 68 if ( fullScreenLayout != null && fullScreenLayout.equals( layout )) { 69 FullScreenCopletEvent event = new FullScreenCopletEvent( cid, null ); 70 XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event)); 71 } else { 72 FullScreenCopletEvent event = new FullScreenCopletEvent( cid, layout ); 73 XMLUtils.createElement(handler, "fullscreen-uri", service.getComponentManager().getLinkService().getLinkURI(event)); 74 } 75 } 76 context.invokeNext(layout, service, handler); 77 } 78 79 } 80 | Popular Tags |