1 5 6 package com.raptus.owxv3.api; 7 8 import java.io.IOException ; 9 import java.util.Locale ; 10 11 import javax.servlet.ServletException ; 12 import javax.servlet.http.*; 13 14 import org.apache.struts.action.*; 15 16 import com.raptus.owxv3.*; 17 18 40 public class VModuleAnonAction extends OmniaWebAction 41 { 42 57 public ActionForward perform(ActionMapping mapping, 58 ActionForm form, 59 HttpServletRequest request, 60 HttpServletResponse response) 61 throws IOException , ServletException 62 { 63 String element = getSelectedElement(form, request); 64 if(element == null || element.length() == 0) 65 { 66 LoggingManager.log("Parameter <element> not specified. Displaying " + 67 "error screen.", this); 68 return mapping.findForward(Constants.SCREEN_ERROR_UNKNOWNELEMENT); 69 } 70 71 String vmid = getSelectedVModule(form, request); 72 if(vmid == null || vmid.length() == 0) 73 { 74 LoggingManager.log("Parameter <vmodule> not specified. Element was " + element 75 + Constants.DEFAULT_SPACER + " Displaying error screen.", this); 76 return mapping.findForward(Constants.SCREEN_ERROR_UNKNOWNVMODULE); 77 } 78 79 Locale locale = getSelectedLocale(form, request); 80 if(locale == null) 81 { 82 LoggingManager.log("Parameter <locale> not specified. Element was " + element 83 + Constants.DEFAULT_SPACER + " Displaying error screen.", this); 84 return mapping.findForward(Constants.SCREEN_ERROR_UNKNOWNLOCALE); 85 } 86 87 HttpSession session = request.getSession(); 89 VModule vm = cachedVModuleAccess(session, vmid); 90 if(vm == null) 91 { 92 LoggingManager.log("FAILED to retrieve a valid virtual module from session.", this); 93 return mapping.findForward(Constants.SCREEN_ERROR_UNKNOWNVMODULE); 94 } 95 96 if(vm.isLocaleAvailable(locale)) 98 setLocale(request, locale); 99 100 String fwdTo = dispatchVModuleElement(request, element, form, vm, locale); 101 if(fwdTo == null) 102 { 103 LoggingManager.log("Dispatcher wasn't able to dispatch element " + element, this); 104 return mapping.findForward(Constants.SCREEN_ERROR_UNKNOWNELEMENT); 105 } 106 107 return mapping.findForward(vm.getIdentification() + Constants.DEFAULT_SPACER + fwdTo); 108 } 109 110 113 protected String dispatchVModuleElement(HttpServletRequest request, 114 String element, 115 ActionForm form, 116 VModule vm, 117 Locale locale) 118 { 119 return null; 120 } 121 122 } 123 124 | Popular Tags |