1 16 17 package org.apache.jetspeed.modules.actions.controls; 18 19 import org.apache.turbine.modules.Action; 21 import org.apache.turbine.util.DynamicURI; 22 import org.apache.turbine.util.RunData; 23 24 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 26 import org.apache.jetspeed.services.logging.JetspeedLogger; 27 import org.apache.jetspeed.services.rundata.JetspeedRunData; 28 import org.apache.jetspeed.util.template.JetspeedLink; 29 import org.apache.jetspeed.util.template.JetspeedLinkFactory; 30 31 39 public class EndCustomize extends Action 40 { 41 42 45 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(EndCustomize.class.getName()); 46 47 50 public void doPerform( RunData data ) throws Exception 51 { 52 ((JetspeedRunData) data).cleanupFromCustomization(); 53 54 56 try 57 { 58 JetspeedLink jsLink = JetspeedLinkFactory.getInstance(data); 59 DynamicURI duri = jsLink.getLink(JetspeedLink.CURRENT,null,null,JetspeedLink.CURRENT,null); 60 String mtype = data.getParameters().getString("mtype"); 61 if (mtype != null) 62 { 63 jsLink.setMediaType(mtype); 64 duri = jsLink.addQueryData("mtype", mtype); 65 duri = duri.addPathInfo("media-type", mtype); 66 String language = data.getParameters().getString("language"); 67 if(language != null) 68 { 69 duri = duri.addQueryData("language",language); 70 String country = data.getParameters().getString("country"); 71 if(country != null) 72 { 73 duri = duri.addQueryData("country", country); 74 } 75 } 76 } 77 78 data.setRedirectURI(duri.toString()); 79 JetspeedLinkFactory.putInstance(jsLink); 80 jsLink = null; 81 } 82 catch (Exception e) 83 { 84 logger.error("Error while trying to bring user back to home page", e); 85 } 86 } 87 } 88 89 | Popular Tags |