1 17 18 19 20 package org.apache.lenya.cms.cocoon.acting; 21 22 import java.util.HashMap ; 23 import java.util.Map ; 24 25 import org.apache.avalon.framework.parameters.Parameters; 26 import org.apache.cocoon.acting.AbstractAction; 27 import org.apache.cocoon.environment.ObjectModelHelper; 28 import org.apache.cocoon.environment.Redirector; 29 import org.apache.cocoon.environment.Request; 30 import org.apache.cocoon.environment.Session; 31 import org.apache.cocoon.environment.SourceResolver; 32 import org.apache.lenya.cms.cocoon.task.CocoonTaskWrapper; 33 import org.apache.lenya.cms.task.TaskWrapper; 34 35 38 public class TaskAction extends AbstractAction { 39 40 53 public java.util.Map act( 54 Redirector redirector, 55 SourceResolver sourceResolver, 56 Map objectModel, 57 String str, 58 Parameters parameters) 59 throws java.lang.Exception { 60 61 TaskWrapper wrapper = new CocoonTaskWrapper(objectModel, parameters); 62 wrapper.execute(); 63 64 Request request = ObjectModelHelper.getRequest(objectModel); 65 66 Session session = request.getSession(true); 70 71 if (session == null) { 72 getLogger().error("No session object"); 73 74 return null; 75 } 76 77 String parent_uri = 81 (String ) session.getAttribute( 82 "org.apache.lenya.cms.cocoon.acting.TaskAction.parent_uri"); 83 HashMap actionMap = new HashMap (); 84 actionMap.put("parent_uri", parent_uri); 85 session.removeAttribute("org.apache.lenya.cms.cocoon.acting.TaskAction.parent_uri"); 86 87 return actionMap; 88 } 89 } 90 | Popular Tags |