1 16 package org.apache.cocoon.portal.generation; 17 18 import java.io.IOException ; 19 import java.util.Map ; 20 21 import org.apache.avalon.framework.parameters.Parameters; 22 import org.apache.avalon.framework.service.ServiceException; 23 import org.apache.avalon.framework.service.ServiceManager; 24 import org.apache.cocoon.ProcessingException; 25 import org.apache.cocoon.environment.SourceResolver; 26 import org.apache.cocoon.generation.ServiceableGenerator; 27 import org.apache.cocoon.portal.PortalManager; 28 import org.apache.cocoon.portal.PortalService; 29 import org.xml.sax.SAXException ; 30 31 44 public class PortalGenerator 45 extends ServiceableGenerator { 46 47 48 protected PortalService portalService; 49 50 53 public void dispose() { 54 if ( this.manager != null ) { 55 this.manager.release(this.portalService); 56 this.portalService = null; 57 } 58 super.dispose(); 59 } 60 61 64 public void service(ServiceManager manager) throws ServiceException { 65 super.service(manager); 66 this.portalService = (PortalService)this.manager.lookup(PortalService.ROLE); 67 } 68 69 72 public void generate() 73 throws IOException , SAXException , ProcessingException { 74 PortalManager pm = this.portalService.getComponentManager().getPortalManager(); 78 pm.process(); 79 pm.showPortal(this.xmlConsumer, this.parameters); 80 } 81 82 85 public void setup(SourceResolver resolver, 86 Map objectModel, 87 String src, 88 Parameters par) 89 throws ProcessingException, SAXException , IOException { 90 super.setup(resolver, objectModel, src, par); 91 92 this.portalService.getComponentManager().getLinkService().getRefreshLinkURI(); 95 } 96 97 } 98 | Popular Tags |