1 17 18 19 20 package org.apache.lenya.cms.cocoon.acting; 21 22 import java.util.Map ; 23 24 import org.apache.avalon.framework.parameters.Parameters; 25 import org.apache.cocoon.acting.ConfigurableServiceableAction; 26 import org.apache.cocoon.environment.ObjectModelHelper; 27 import org.apache.cocoon.environment.Redirector; 28 import org.apache.cocoon.environment.Request; 29 import org.apache.cocoon.environment.SourceResolver; 30 import org.apache.lenya.cms.cocoon.uriparameterizer.URIParameterizer; 31 32 38 public class URIParametrizerAction extends ConfigurableServiceableAction { 39 40 43 public Map act( 44 Redirector redirector, 45 SourceResolver resolver, 46 Map objectModel, 47 String src, 48 Parameters parameters) 49 throws Exception { 50 51 Request request = ObjectModelHelper.getRequest(objectModel); 52 String uri = request.getRequestURI(); 53 54 URIParameterizer parameterizer = null; 55 Map map = null; 56 try { 57 parameterizer = (URIParameterizer) manager.lookup(URIParameterizer.ROLE); 58 map = parameterizer.parameterize(uri, src, parameters); 59 } finally { 60 if (parameterizer != null) { 61 manager.release(parameterizer); 62 } 63 } 64 65 return map; 66 67 } 68 69 } 70 | Popular Tags |