1 16 package org.apache.cocoon.webapps.portal.generation; 17 18 import java.io.IOException ; 19 20 import org.apache.avalon.framework.service.ServiceException; 21 import org.apache.cocoon.ProcessingException; 22 import org.apache.cocoon.environment.ObjectModelHelper; 23 import org.apache.cocoon.environment.Request; 24 import org.apache.cocoon.generation.ServiceableGenerator; 25 import org.apache.cocoon.webapps.portal.components.PortalManager; 26 import org.apache.cocoon.webapps.session.FormManager; 27 import org.xml.sax.SAXException ; 28 29 35 public final class PortalGenerator 36 extends ServiceableGenerator { 37 38 public void generate() 39 throws IOException , SAXException , ProcessingException { 40 41 PortalManager portal = null; 42 FormManager formManager = null; 43 try { 44 formManager = (FormManager)this.manager.lookup(FormManager.ROLE); 45 formManager.processInputFields(); 46 47 portal = (PortalManager) this.manager.lookup(PortalManager.ROLE); 48 this.xmlConsumer.startDocument(); 49 50 final Request request = ObjectModelHelper.getRequest(this.objectModel); 51 if (request.getSession(false) != null) { 52 53 portal.showPortal(this.xmlConsumer, false, false); 54 55 } 56 this.xmlConsumer.endDocument(); 57 } catch (ServiceException ce) { 58 throw new ProcessingException("Lookup of PortalManager failed.", ce); 59 } finally { 60 this.manager.release( formManager); 61 this.manager.release(portal); 62 } 63 } 64 65 } 66 | Popular Tags |