From: Anjo K. <an...@us...> - 2003-06-07 00:02:17
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv15242 Modified Files: ERXComponentActionRedirector.java Log Message: fixed using wrong page Index: ERXComponentActionRedirector.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXComponentActionRedirector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ERXComponentActionRedirector.java 6 Jun 2003 22:55:04 -0000 1.2 --- ERXComponentActionRedirector.java 7 Jun 2003 00:02:13 -0000 1.3 *************** *** 70,74 **** public WOActionResults invokeAction(WORequest request, WOContext context) { WOActionResults results = super.invokeAction(request, context); ! ERXComponentActionRedirector.createRedirectorInContext(context); return results; } --- 70,74 ---- public WOActionResults invokeAction(WORequest request, WOContext context) { WOActionResults results = super.invokeAction(request, context); ! ERXComponentActionRedirector.createRedirectorInContext(results, context); return results; } *************** *** 101,104 **** --- 101,109 ---- */ public class ERXComponentActionRedirector { + + /** logging support */ + public static final ERXLogger log = ERXLogger.getERXLogger(ERXComponentActionRedirector.class); + + public static interface Restorable { public String urlForCurrentState(); *************** *** 119,133 **** } sessionRef.setObjectForKey(redirector, redirector.url()); } public static ERXComponentActionRedirector redirectorForRequest(WORequest request) { ! return (ERXComponentActionRedirector)responses.valueForKeyPath(request.sessionID() + "." + request.uri()); } ! public static void createRedirectorInContext(WOContext context) { ERXThreadStorage.removeValueForKey("redirector"); ! if(context.request().requestHandlerKey().equals("wo")) { ! if(context.page() instanceof Restorable) { ! ERXComponentActionRedirector r = new ERXComponentActionRedirector((Restorable)context.page()); ! ERXComponentActionRedirector.storeRedirector(r); } } --- 124,151 ---- } sessionRef.setObjectForKey(redirector, redirector.url()); + log.info("Stored URL: " + redirector.url()); } public static ERXComponentActionRedirector redirectorForRequest(WORequest request) { ! ERXComponentActionRedirector redirector = (ERXComponentActionRedirector)responses.valueForKeyPath(request.sessionID() + "." + request.uri()); ! if(redirector != null) { ! log.info("Retrieved URL: " + redirector.url()); ! } else { ! log.info("No Redirector for request: " + request.uri()); ! } ! return redirector; } ! public static void createRedirector(WOActionResults results) { ERXThreadStorage.removeValueForKey("redirector"); ! if(results instanceof WOComponent) { ! WOComponent component = (WOComponent)results; ! WOContext context = component.context(); ! if(context.request().requestHandlerKey().equals("wo")) { ! if(component instanceof Restorable) { ! ERXComponentActionRedirector r = new ERXComponentActionRedirector((Restorable)component); ! ERXComponentActionRedirector.storeRedirector(r); ! } else { ! log.info("Not restorable: " + context.request().uri() + ", " + component); ! } } } |