1 17 18 19 20 package org.apache.lenya.cms.cocoon.components.modules.input; 21 22 import java.util.Map ; 23 24 import org.apache.avalon.framework.configuration.ConfigurationException; 25 import org.apache.cocoon.components.modules.input.AbstractInputModule; 26 import org.apache.cocoon.environment.ObjectModelHelper; 27 import org.apache.cocoon.environment.Request; 28 import org.apache.lenya.cms.publication.PageEnvelope; 29 import org.apache.lenya.cms.publication.PageEnvelopeFactory; 30 31 34 public abstract class AbstractPageEnvelopeModule extends AbstractInputModule { 35 36 45 protected PageEnvelope getEnvelope(Map objectModel) throws ConfigurationException { 46 47 PageEnvelope envelope = null; 48 49 if (getLogger().isDebugEnabled()) { 50 Request request = ObjectModelHelper.getRequest(objectModel); 51 getLogger().debug("Resolving page envelope for URL [" + request.getRequestURI() + "]"); 52 } 53 54 try { 55 envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel); 56 } catch (Exception e) { 57 throw new ConfigurationException("Resolving page envelope failed: ", e); 58 } 59 60 return envelope; 61 } 62 63 } 64 | Popular Tags |