1 17 18 19 20 package org.apache.lenya.cms.publication; 21 22 import java.util.Map ; 23 24 import org.apache.cocoon.environment.ObjectModelHelper; 25 import org.apache.cocoon.environment.Request; 26 27 28 31 public class PageEnvelopeFactory { 32 35 protected PageEnvelopeFactory() { 36 } 37 38 private static PageEnvelopeFactory instance; 39 40 44 public static PageEnvelopeFactory getInstance() { 45 if (instance == null) { 46 instance = new PageEnvelopeFactory(); 47 } 48 return instance; 49 } 50 51 57 public PageEnvelope getPageEnvelope(Map objectModel) 58 throws PageEnvelopeException { 59 Request request = ObjectModelHelper.getRequest(objectModel); 60 PageEnvelope envelope = (PageEnvelope) request.getAttribute(PageEnvelope.class.getName()); 61 62 envelope = new PageEnvelope(objectModel, true); 63 request.setAttribute(PageEnvelope.class.getName(), envelope); 64 65 return envelope; 66 } 67 68 } 69 | Popular Tags |