lipog-commit Mailing List for Little Portal Gizmo (Page 2)
Status: Beta
Brought to you by:
jbu
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(94) |
Jun
(14) |
Jul
(168) |
Aug
(39) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(6) |
Dec
|
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:48
|
Update of /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/requests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11834/src/net/heilancoo/portal/requests Modified Files: FileRequestHandler.java Log Message: support request methods with more flexible parameter lists Index: FileRequestHandler.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/requests/FileRequestHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FileRequestHandler.java 11 May 2009 16:43:11 -0000 1.8 --- FileRequestHandler.java 13 Aug 2009 22:35:34 -0000 1.9 *************** *** 132,136 **** file = new File(file, indexFile); ! serveFile(file, request, response, context, mimeMapper, true); } } --- 132,136 ---- file = new File(file, indexFile); ! serveFile(file, request, response, mimeMapper, true); } } *************** *** 162,166 **** final HttpRequest request, final HttpResponse response, - final HttpContext context, final MimeTypeMapper mapper, boolean doCareAboutMethod) { --- 162,165 ---- |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:43
|
Update of /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/controller In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11834/src/net/heilancoo/portal/controller Modified Files: ControllerManager.java Log Message: support request methods with more flexible parameter lists Index: ControllerManager.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/controller/ControllerManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ControllerManager.java 6 Jul 2009 19:06:04 -0000 1.5 --- ControllerManager.java 13 Aug 2009 22:35:34 -0000 1.6 *************** *** 111,115 **** if(g == null) { ! logger.error("No response generator found."); stateOk = false; } --- 111,115 ---- if(g == null) { ! logger.error("No response generator found for " + methodFullName + "."); stateOk = false; } |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:42
|
Update of /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/responders In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11834/src/net/heilancoo/portal/responders Modified Files: ResponderFactory.java FileResponder.java Responder.java PlainResponder.java PlainResponderFactory.java Added Files: PlainResponderBasic.java ResponderMatcher.java Log Message: support request methods with more flexible parameter lists Index: PlainResponderFactory.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/responders/PlainResponderFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PlainResponderFactory.java 11 May 2009 16:43:11 -0000 1.2 --- PlainResponderFactory.java 13 Aug 2009 22:35:34 -0000 1.3 *************** *** 12,25 **** package net.heilancoo.portal.responders; - import java.lang.reflect.Method; - - import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.htmlforms.FormFieldContainer; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - import org.apache.log4j.Logger; - import org.osgi.framework.Bundle; /** --- 12,19 ---- *************** *** 29,52 **** public class PlainResponderFactory extends ResponderFactory { ! private static final Logger logger = Logger.getLogger(PlainResponderFactory.class); ! ! public PlainResponderFactory() { ! super(new Class<?> [] { ! HttpRequest.class, ! FormFieldContainer.class, ! HttpResponse.class, ! HttpContext.class ! }); ! } ! ! /* ! * (non-Javadoc) ! * @see net.heilancoo.portal.responses.ResponderFactory#makeGeneratorFor(java.lang.reflect.Method, org.osgi.framework.Bundle, net.heilancoo.portal.requests.MimeTypeMapper) ! */ ! @Override ! public Responder makeGeneratorFor(Method method, Bundle bundle, MimeTypeMapper mimeMapper) { ! logger.info("Making plain responder for method " + method.getName() + "."); ! ! return new PlainResponder(method); } --- 23,39 ---- public class PlainResponderFactory extends ResponderFactory { ! public PlainResponderFactory() throws SecurityException, NoSuchMethodException { ! super(new ResponderMatcher [] { ! new ResponderMatcher( ! PlainResponder.class, ! new Class<?> [] { HttpRequest.class, ! FormFieldContainer.class, ! HttpResponse.class } ! ), ! new ResponderMatcher( ! PlainResponderBasic.class, ! new Class<?> [] { FormFieldContainer.class } ! ) ! }); } --- NEW FILE: PlainResponderBasic.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.responders; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.htmlforms.FormFieldContainer; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; import org.osgi.framework.Bundle; /** * @author joerg * */ public class PlainResponderBasic extends Responder { public PlainResponderBasic(Method method, Bundle bundle, MimeTypeMapper mimeMapper) { super(method); } /* (non-Javadoc) * @see net.heilancoo.portal.responses.Responder#execute(net.heilancoo.portal.session.Session, org.apache.http.HttpRequest, net.heilancoo.portal.htmlforms.FormFieldContainer, org.apache.http.HttpResponse, org.apache.http.protocol.HttpContext) */ @Override public Object execute(Controller target, String format, HttpRequest request, FormFieldContainer fields, HttpResponse response) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { return method.invoke(target, fields); } } --- NEW FILE: ResponderMatcher.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.responders; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import net.heilancoo.portal.MimeTypeMapper; import org.apache.log4j.Logger; import org.osgi.framework.Bundle; /** * @author joerg * */ public class ResponderMatcher { private static final Logger logger = Logger.getLogger(ResponderMatcher.class); private final Class<?> [] parameters; private final Constructor<?> constructor; public ResponderMatcher(Class<?> responder, Class<?> [] parameters) throws SecurityException, NoSuchMethodException { this.constructor = responder.getConstructor(Method.class, Bundle.class, MimeTypeMapper.class); this.parameters = parameters; } public Responder make(Method method, Bundle bundle, MimeTypeMapper mimeTypeMapper) { try { Class<?> [] methodParameters = method.getParameterTypes(); if(methodParameters.length != parameters.length) return null; for(int i = 0; i < parameters.length; i++) if(!parameters[i].equals(methodParameters[i])) return null; return (Responder) constructor.newInstance(method, bundle, mimeTypeMapper); } catch (IllegalArgumentException e) { logger.error(e, e); } catch (InstantiationException e) { logger.error(e, e); } catch (IllegalAccessException e) { logger.error(e, e); } catch (InvocationTargetException e) { logger.error(e, e); } catch(Throwable t) { logger.error(t, t); } return null; } } Index: FileResponder.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/responders/FileResponder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileResponder.java 24 Jul 2009 06:40:11 -0000 1.6 --- FileResponder.java 13 Aug 2009 22:35:33 -0000 1.7 *************** *** 21,25 **** import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; /** --- 21,24 ---- *************** *** 44,53 **** @Override public Object execute(Controller target, String format, HttpRequest request, ! FormFieldContainer fields, HttpResponse response, ! HttpContext context) { File f = mapExtension ? new File(file.getAbsolutePath() + "." + format) : file; ! FileRequestHandler.serveFile(f, request, response, context, mimeMapper, false); return null; --- 43,51 ---- @Override public Object execute(Controller target, String format, HttpRequest request, ! FormFieldContainer fields, HttpResponse response) { File f = mapExtension ? new File(file.getAbsolutePath() + "." + format) : file; ! FileRequestHandler.serveFile(f, request, response, mimeMapper, false); return null; Index: ResponderFactory.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/responders/ResponderFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ResponderFactory.java 11 May 2009 16:43:11 -0000 1.2 --- ResponderFactory.java 13 Aug 2009 22:35:33 -0000 1.3 *************** *** 22,62 **** * */ ! public abstract class ResponderFactory { ! private final Class<?> [] parameterTypes; ! ! protected ResponderFactory(Class<?> [] parameterTypes) { ! this.parameterTypes = parameterTypes; ! } ! ! protected boolean matches(Method method) { ! if(method.getParameterTypes().length != parameterTypes.length) ! return false; ! ! for(int i = 0; i < parameterTypes.length; i++) { ! Class<?> meth = method.getParameterTypes()[i]; ! Class<?> gen = parameterTypes[i]; ! ! if(!meth.equals(gen)) ! return false; ! } ! return true; } public Responder tryMakingResponderFor(Method method, Bundle bundle, MimeTypeMapper mimeMapper) { ! if(!matches(method)) ! return null; ! ! try { ! return makeGeneratorFor(method, bundle, mimeMapper); ! } ! catch(ResponderCreationException e) { ! return null; } } - protected abstract Responder makeGeneratorFor(Method method, Bundle bundle, - MimeTypeMapper mimeMapper) throws ResponderCreationException; - } --- 22,43 ---- * */ ! public class ResponderFactory { ! private final ResponderMatcher [] matchers; ! protected ResponderFactory(ResponderMatcher [] matchers) { ! this.matchers = matchers; } public Responder tryMakingResponderFor(Method method, Bundle bundle, MimeTypeMapper mimeMapper) { ! for(ResponderMatcher m : matchers) { ! Responder r = m.make(method, bundle, mimeMapper); ! ! if(r != null) ! return r; } + + return null; } } Index: Responder.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/responders/Responder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Responder.java 24 Jul 2009 06:40:11 -0000 1.5 --- Responder.java 13 Aug 2009 22:35:34 -0000 1.6 *************** *** 19,23 **** import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; /** --- 19,22 ---- *************** *** 39,43 **** public abstract Object execute(Controller target, String format, HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context) throws Exception; } --- 38,42 ---- public abstract Object execute(Controller target, String format, HttpRequest request, FormFieldContainer fields, ! HttpResponse response) throws Exception; } Index: PlainResponder.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/src/net/heilancoo/portal/responders/PlainResponder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PlainResponder.java 24 Jul 2009 06:40:11 -0000 1.5 --- PlainResponder.java 13 Aug 2009 22:35:34 -0000 1.6 *************** *** 15,18 **** --- 15,19 ---- import java.lang.reflect.Method; + import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.htmlforms.FormFieldContainer; *************** *** 20,24 **** import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; ! import org.apache.http.protocol.HttpContext; /** --- 21,25 ---- import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; ! import org.osgi.framework.Bundle; /** *************** *** 28,32 **** public class PlainResponder extends Responder { ! public PlainResponder(Method method) { super(method); } --- 29,33 ---- public class PlainResponder extends Responder { ! public PlainResponder(Method method, Bundle bundle, MimeTypeMapper mimeMapper) { super(method); } *************** *** 37,47 **** @Override public Object execute(Controller target, String format, HttpRequest request, ! FormFieldContainer fields, HttpResponse response, ! HttpContext context) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { ! Object o = method.invoke(target, request, fields, response, context); ! ! return o; } --- 38,45 ---- @Override public Object execute(Controller target, String format, HttpRequest request, ! FormFieldContainer fields, HttpResponse response) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { ! return method.invoke(target, request, fields, response); } |
Update of /cvsroot/lipog/net.heilancoo.portal.freemarker/src/net/heilancoo/portal/freemarker In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11825/src/net/heilancoo/portal/freemarker Modified Files: FreeMarkerResponder.java FreeMarkerResponderFactory.java Added Files: FreeMarkerResponderFull.java FreeMarkerResponderBasic.java Log Message: support request methods with more flexible parameter lists --- NEW FILE: FreeMarkerResponderFull.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.freemarker; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.htmlforms.FormFieldContainer; import net.heilancoo.portal.responders.ResponderCreationException; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; import org.osgi.framework.Bundle; /** * @author joerg * */ public class FreeMarkerResponderFull extends FreeMarkerResponder { public FreeMarkerResponderFull(Method method, Bundle bundle, MimeTypeMapper mimeMapper) throws ResponderCreationException { super(method, bundle, mimeMapper); } /* (non-Javadoc) * @see net.heilancoo.portal.freemarker.FreeMarkerResponder#invoke(net.heilancoo.portal.controller.Controller, org.apache.http.HttpRequest, net.heilancoo.portal.htmlforms.FormFieldContainer, org.apache.http.HttpResponse, net.heilancoo.portal.freemarker.FreeMarkerModel) */ @Override public Object invoke(Controller target, HttpRequest request, FormFieldContainer fields, HttpResponse response, FreeMarkerModel model) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { return method.invoke(target, request, fields, response, model); } } --- NEW FILE: FreeMarkerResponderBasic.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.freemarker; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.htmlforms.FormFieldContainer; import net.heilancoo.portal.responders.ResponderCreationException; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; import org.osgi.framework.Bundle; /** * @author joerg * */ public class FreeMarkerResponderBasic extends FreeMarkerResponder { public FreeMarkerResponderBasic(Method method, Bundle bundle, MimeTypeMapper mimeMapper) throws ResponderCreationException { super(method, bundle, mimeMapper); } /* (non-Javadoc) * @see net.heilancoo.portal.freemarker.FreeMarkerResponder#invoke(net.heilancoo.portal.controller.Controller, org.apache.http.HttpRequest, net.heilancoo.portal.htmlforms.FormFieldContainer, org.apache.http.HttpResponse, net.heilancoo.portal.freemarker.FreeMarkerModel) */ @Override public Object invoke(Controller target, HttpRequest request, FormFieldContainer fields, HttpResponse response, FreeMarkerModel model) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { return method.invoke(target, fields, model); } } Index: FreeMarkerResponder.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.freemarker/src/net/heilancoo/portal/freemarker/FreeMarkerResponder.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FreeMarkerResponder.java 24 Jul 2009 06:58:38 -0000 1.15 --- FreeMarkerResponder.java 13 Aug 2009 22:35:30 -0000 1.16 *************** *** 14,17 **** --- 14,18 ---- import java.io.File; import java.io.StringWriter; + import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; *************** *** 32,36 **** import org.apache.http.HttpResponse; import org.apache.http.nio.entity.NStringEntity; - import org.apache.http.protocol.HttpContext; import org.apache.log4j.Logger; import org.eclipse.core.runtime.Path; --- 33,36 ---- *************** *** 44,48 **** * */ ! public class FreeMarkerResponder extends Responder { private static final Logger logger = Logger.getLogger(FreeMarkerResponder.class); --- 44,48 ---- * */ ! public abstract class FreeMarkerResponder extends Responder { private static final Logger logger = Logger.getLogger(FreeMarkerResponder.class); *************** *** 125,139 **** } /* (non-Javadoc) * @see net.heilancoo.portal.responses.Responder#execute(net.heilancoo.portal.session.Session, org.apache.http.HttpRequest, net.heilancoo.portal.htmlforms.FormFieldContainer, org.apache.http.HttpResponse, org.apache.http.protocol.HttpContext) */ public Object execute(Controller target, String format, HttpRequest request, ! FormFieldContainer fields, HttpResponse response, ! HttpContext context) throws Exception { FreeMarkerModel model = new FreeMarkerModel(); ! Object redirect = method.invoke(target, request, fields, response, context, model); if(redirect == null) { --- 125,142 ---- } + public abstract Object invoke(Controller target, HttpRequest request, + FormFieldContainer fields, HttpResponse response, FreeMarkerModel model) + throws IllegalArgumentException, IllegalAccessException, InvocationTargetException; + /* (non-Javadoc) * @see net.heilancoo.portal.responses.Responder#execute(net.heilancoo.portal.session.Session, org.apache.http.HttpRequest, net.heilancoo.portal.htmlforms.FormFieldContainer, org.apache.http.HttpResponse, org.apache.http.protocol.HttpContext) */ public Object execute(Controller target, String format, HttpRequest request, ! FormFieldContainer fields, HttpResponse response) throws Exception { FreeMarkerModel model = new FreeMarkerModel(); ! Object redirect = invoke(target, request, fields, response, model);//method.invoke(target, request, fields, response, context, model); if(redirect == null) { Index: FreeMarkerResponderFactory.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.freemarker/src/net/heilancoo/portal/freemarker/FreeMarkerResponderFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FreeMarkerResponderFactory.java 6 Jul 2009 16:38:10 -0000 1.8 --- FreeMarkerResponderFactory.java 13 Aug 2009 22:35:30 -0000 1.9 *************** *** 12,27 **** package net.heilancoo.portal.freemarker; - import java.lang.reflect.Method; - - import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.htmlforms.FormFieldContainer; - import net.heilancoo.portal.responders.Responder; - import net.heilancoo.portal.responders.ResponderCreationException; import net.heilancoo.portal.responders.ResponderFactory; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - import org.osgi.framework.Bundle; /** --- 12,21 ---- package net.heilancoo.portal.freemarker; import net.heilancoo.portal.htmlforms.FormFieldContainer; import net.heilancoo.portal.responders.ResponderFactory; + import net.heilancoo.portal.responders.ResponderMatcher; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; /** *************** *** 31,51 **** public class FreeMarkerResponderFactory extends ResponderFactory { ! public FreeMarkerResponderFactory() { ! super(new Class<?> [] { ! HttpRequest.class, ! FormFieldContainer.class, ! HttpResponse.class, ! HttpContext.class, ! FreeMarkerModel.class ! }); ! } ! ! /* (non-Javadoc) ! * @see net.heilancoo.portal.responses.ResponderFactory#makeGeneratorFor(java.lang.reflect.Method, org.eclipse.core.runtime.Plugin) ! */ ! @Override ! public Responder makeGeneratorFor(Method method, Bundle bundle, MimeTypeMapper mimeMapper) ! throws ResponderCreationException { ! return new FreeMarkerResponder(method, bundle, mimeMapper); } --- 25,44 ---- public class FreeMarkerResponderFactory extends ResponderFactory { ! public FreeMarkerResponderFactory() throws SecurityException, NoSuchMethodException { ! super(new ResponderMatcher [] { ! new ResponderMatcher( ! FreeMarkerResponderFull.class, ! new Class<?> [] { HttpRequest.class, ! FormFieldContainer.class, ! HttpResponse.class, ! FreeMarkerModel.class } ! ), ! ! new ResponderMatcher( ! FreeMarkerResponderBasic.class, ! new Class<?> [] { FormFieldContainer.class, ! FreeMarkerModel.class } ! ) ! }); } |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:40
|
Update of /cvsroot/lipog/net.heilancoo.portal.documentation/doc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11816/doc Modified Files: webapp-123.html Log Message: support request methods with more flexible parameter lists Index: webapp-123.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.documentation/doc/webapp-123.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** webapp-123.html 28 Jul 2009 17:04:40 -0000 1.19 --- webapp-123.html 13 Aug 2009 22:35:27 -0000 1.20 *************** *** 153,158 **** @Request ! public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context) { try { --- 153,159 ---- @Request ! public void main(HttpRequest request, ! FormFieldContainer fields, ! HttpResponse response) { try { *************** *** 291,297 **** @Request ! public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { ! accessCounter += 1; --- 292,296 ---- @Request ! public void main(FormFieldContainer fields, FreeMarkerModel model) { accessCounter += 1; |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:35
|
Update of /cvsroot/lipog/net.heilancoo.bingo/src/net/heilancoo/bingo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11792/src/net/heilancoo/bingo Modified Files: BingoSession.java Log Message: support request methods with more flexible parameter lists Index: BingoSession.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.bingo/src/net/heilancoo/bingo/BingoSession.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BingoSession.java 26 Jul 2009 16:44:55 -0000 1.12 --- BingoSession.java 13 Aug 2009 22:35:21 -0000 1.13 *************** *** 19,26 **** import net.heilancoo.portal.session.Session; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - /** * @author joerg --- 19,22 ---- *************** *** 49,55 **** @Request ! public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { ! accessCounter += 1; --- 45,49 ---- @Request ! public void main(FormFieldContainer fields, FreeMarkerModel model) { accessCounter += 1; *************** *** 61,67 **** @Request @ValidResponseFormats({"txt", "html"}) ! public void other(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { ! accessCounter += 1; --- 55,59 ---- @Request @ValidResponseFormats({"txt", "html"}) ! public void other(FormFieldContainer fields, FreeMarkerModel model) { accessCounter += 1; |
Update of /cvsroot/lipog/net.heilancoo.portal.json/src/net/heilancoo/portal/json In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11802/src/net/heilancoo/portal/json Modified Files: JsonResponderFactory.java JsonResponder.java Added Files: JsonResponderFull.java JsonResponderBasic.java Log Message: support request methods with more flexible parameter lists Index: JsonResponderFactory.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.json/src/net/heilancoo/portal/json/JsonResponderFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JsonResponderFactory.java 6 Jul 2009 16:38:16 -0000 1.7 --- JsonResponderFactory.java 13 Aug 2009 22:35:24 -0000 1.8 *************** *** 12,27 **** package net.heilancoo.portal.json; - import java.lang.reflect.Method; - - import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.htmlforms.FormFieldContainer; - import net.heilancoo.portal.responders.Responder; import net.heilancoo.portal.responders.ResponderFactory; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; import org.json.JSONObject; - import org.osgi.framework.Bundle; /** --- 12,22 ---- package net.heilancoo.portal.json; import net.heilancoo.portal.htmlforms.FormFieldContainer; import net.heilancoo.portal.responders.ResponderFactory; + import net.heilancoo.portal.responders.ResponderMatcher; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; import org.json.JSONObject; /** *************** *** 31,51 **** public class JsonResponderFactory extends ResponderFactory { ! public JsonResponderFactory() { ! super(new Class<?> [] { ! HttpRequest.class, ! FormFieldContainer.class, ! HttpResponse.class, ! HttpContext.class, ! JSONObject.class ! }); ! } ! ! /* ! * (non-Javadoc) ! * @see net.heilancoo.portal.responses.ResponderFactory#makeGeneratorFor(java.lang.reflect.Method, org.osgi.framework.Bundle, net.heilancoo.portal.requests.MimeTypeMapper) ! */ ! @Override ! public Responder makeGeneratorFor(Method method, Bundle bundle, MimeTypeMapper mimeMapper) { ! return new JsonResponder(method); } --- 26,45 ---- public class JsonResponderFactory extends ResponderFactory { ! public JsonResponderFactory() throws SecurityException, NoSuchMethodException { ! super(new ResponderMatcher [] { ! new ResponderMatcher( ! JsonResponderFull.class, ! new Class<?> [] { HttpRequest.class, ! FormFieldContainer.class, ! HttpResponse.class, ! JSONObject.class } ! ), ! ! new ResponderMatcher( ! JsonResponderBasic.class, ! new Class<?> [] { FormFieldContainer.class, ! JSONObject.class } ! ) ! }); } Index: JsonResponder.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.json/src/net/heilancoo/portal/json/JsonResponder.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** JsonResponder.java 24 Jul 2009 06:40:04 -0000 1.9 --- JsonResponder.java 13 Aug 2009 22:35:24 -0000 1.10 *************** *** 13,16 **** --- 13,17 ---- import java.io.StringWriter; + import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; *************** *** 22,26 **** import org.apache.http.HttpResponse; import org.apache.http.nio.entity.NStringEntity; - import org.apache.http.protocol.HttpContext; import org.json.JSONObject; --- 23,26 ---- *************** *** 29,33 **** * */ ! public class JsonResponder extends Responder { public JsonResponder(Method method) { --- 29,33 ---- * */ ! public abstract class JsonResponder extends Responder { public JsonResponder(Method method) { *************** *** 35,38 **** --- 35,42 ---- } + public abstract Object invoke(Controller target, HttpRequest request, + FormFieldContainer fields, HttpResponse response, JSONObject model) + throws IllegalArgumentException, IllegalAccessException, InvocationTargetException; + /* (non-Javadoc) * @see net.heilancoo.portal.responses.Responder#execute(net.heilancoo.portal.session.Session, org.apache.http.HttpRequest, net.heilancoo.portal.htmlforms.FormFieldContainer, org.apache.http.HttpResponse, org.apache.http.protocol.HttpContext) *************** *** 40,49 **** @Override public Object execute(Controller target, String format, HttpRequest request, ! FormFieldContainer fields, HttpResponse response, ! HttpContext context) throws Exception { JSONObject model = new JSONObject(); ! Object redirect = method.invoke(target, request, fields, response, context, model); if(redirect == null) { --- 44,52 ---- @Override public Object execute(Controller target, String format, HttpRequest request, ! FormFieldContainer fields, HttpResponse response) throws Exception { JSONObject model = new JSONObject(); ! Object redirect = invoke(target, request, fields, response, model);//method.invoke(target, request, fields, response, model); if(redirect == null) { --- NEW FILE: JsonResponderFull.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.json; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.htmlforms.FormFieldContainer; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; import org.json.JSONObject; import org.osgi.framework.Bundle; /** * @author joerg * */ public class JsonResponderFull extends JsonResponder { public JsonResponderFull(Method method, Bundle bundle, MimeTypeMapper mimeMapper) { super(method); } @Override public Object invoke(Controller target, HttpRequest request, FormFieldContainer fields, HttpResponse response, JSONObject model) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { return method.invoke(target, request, fields, response, model); } } --- NEW FILE: JsonResponderBasic.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.json; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import net.heilancoo.portal.MimeTypeMapper; import net.heilancoo.portal.controller.Controller; import net.heilancoo.portal.htmlforms.FormFieldContainer; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; import org.json.JSONObject; import org.osgi.framework.Bundle; /** * @author joerg * */ public class JsonResponderBasic extends JsonResponder { public JsonResponderBasic(Method method, Bundle bundle, MimeTypeMapper mimeMapper) { super(method); } @Override public Object invoke(Controller target, HttpRequest request, FormFieldContainer fields, HttpResponse response, JSONObject model) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { return method.invoke(target, fields, model); } } |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:31
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/multicontrollers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11701/src/net/heilancoo/portal/examples/multicontrollers Modified Files: TheExport.java ThePreferences.java TheMain.java Log Message: support request methods with more flexible parameter lists Index: TheMain.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/multicontrollers/TheMain.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TheMain.java 3 Jun 2009 20:50:40 -0000 1.1 --- TheMain.java 13 Aug 2009 22:35:15 -0000 1.2 *************** *** 18,25 **** import net.heilancoo.portal.responses.ValidResponseFormats; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - /** * @author joerg --- 18,21 ---- *************** *** 35,41 **** @Request ! public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { ! s.access(); model.put("s", s); --- 31,35 ---- @Request ! public void main(FormFieldContainer fields, FreeMarkerModel model) { s.access(); model.put("s", s); *************** *** 44,50 **** @Request @ValidResponseFormats({"txt", "html"}) ! public void other(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { ! s.access(); model.put("s", s); --- 38,42 ---- @Request @ValidResponseFormats({"txt", "html"}) ! public void other(FormFieldContainer fields, FreeMarkerModel model) { s.access(); model.put("s", s); Index: TheExport.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/multicontrollers/TheExport.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TheExport.java 6 Jul 2009 21:32:39 -0000 1.4 --- TheExport.java 13 Aug 2009 22:35:15 -0000 1.5 *************** *** 17,24 **** import net.heilancoo.portal.htmlforms.FormFieldContainer; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - /** * @author joerg --- 17,20 ---- *************** *** 34,40 **** @Request ! public void export(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { ! s.access(); model.put("s", s); --- 30,34 ---- @Request ! public void export(FormFieldContainer fields, FreeMarkerModel model) { s.access(); model.put("s", s); Index: ThePreferences.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/multicontrollers/ThePreferences.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ThePreferences.java 6 Jul 2009 21:32:39 -0000 1.5 --- ThePreferences.java 13 Aug 2009 22:35:15 -0000 1.6 *************** *** 18,25 **** import net.heilancoo.portal.responses.ResponseTemplateFolder; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - /** * @author joerg --- 18,21 ---- *************** *** 36,42 **** @Request ! public void prefs(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { ! s.access(); model.put("s", s); --- 32,36 ---- @Request ! public void prefs(FormFieldContainer fields, FreeMarkerModel model) { s.access(); model.put("s", s); |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:26
|
Update of /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11774/src/net/heilancoo/portal/webapps/test Modified Files: SessionWithCustomDefaultResponseFormat.java SessionWithMultipleResponseFormats.java SimpleSession.java MainCtrl.java SessionWithCustomTemplateFolder.java SubA.java SubC.java SessionWithCustomEntry.java Log Message: support request methods with more flexible parameter lists Index: SimpleSession.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/SimpleSession.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SimpleSession.java 28 May 2009 18:34:46 -0000 1.7 --- SimpleSession.java 13 Aug 2009 22:35:18 -0000 1.8 *************** *** 19,23 **** import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; /** --- 19,22 ---- *************** *** 29,38 **** @Request public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context) { } @Request public void other(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } } --- 28,37 ---- @Request public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response) { } @Request public void other(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } } Index: SessionWithCustomDefaultResponseFormat.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/SessionWithCustomDefaultResponseFormat.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SessionWithCustomDefaultResponseFormat.java 28 May 2009 18:34:46 -0000 1.8 --- SessionWithCustomDefaultResponseFormat.java 13 Aug 2009 22:35:18 -0000 1.9 *************** *** 21,25 **** import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; /** --- 21,24 ---- *************** *** 33,42 **** @Request public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } @Request public void other(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } --- 32,41 ---- @Request public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } @Request public void other(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } Index: MainCtrl.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/MainCtrl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MainCtrl.java 6 Jul 2009 19:51:04 -0000 1.1 --- MainCtrl.java 13 Aug 2009 22:35:18 -0000 1.2 *************** *** 12,19 **** package net.heilancoo.portal.webapps.test; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - import net.heilancoo.portal.controller.Request; import net.heilancoo.portal.freemarker.FreeMarkerModel; --- 12,15 ---- *************** *** 21,24 **** --- 17,23 ---- import net.heilancoo.portal.responses.ResponseTemplateFolder; + import org.apache.http.HttpRequest; + import org.apache.http.HttpResponse; + /** * @author joerg *************** *** 30,34 **** @Request public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } --- 29,33 ---- @Request public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } Index: SessionWithCustomEntry.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/SessionWithCustomEntry.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SessionWithCustomEntry.java 7 Jul 2009 22:41:59 -0000 1.7 --- SessionWithCustomEntry.java 13 Aug 2009 22:35:18 -0000 1.8 *************** *** 20,24 **** import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; /** --- 20,23 ---- *************** *** 31,40 **** @Request public void hello(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context) { } @Request public void other(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } } --- 30,39 ---- @Request public void hello(HttpRequest request, FormFieldContainer fields, ! HttpResponse response) { } @Request public void other(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } } Index: SessionWithMultipleResponseFormats.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/SessionWithMultipleResponseFormats.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SessionWithMultipleResponseFormats.java 28 May 2009 18:34:46 -0000 1.7 --- SessionWithMultipleResponseFormats.java 13 Aug 2009 22:35:18 -0000 1.8 *************** *** 21,25 **** import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; /** --- 21,24 ---- *************** *** 33,37 **** @ValidResponseFormats({ "html", "txt", "xml" }) public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } } --- 32,36 ---- @ValidResponseFormats({ "html", "txt", "xml" }) public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } } Index: SubC.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/SubC.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubC.java 6 Jul 2009 19:51:04 -0000 1.1 --- SubC.java 13 Aug 2009 22:35:18 -0000 1.2 *************** *** 12,19 **** package net.heilancoo.portal.webapps.test; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - import net.heilancoo.portal.controller.Request; import net.heilancoo.portal.freemarker.FreeMarkerModel; --- 12,15 ---- *************** *** 21,24 **** --- 17,23 ---- import net.heilancoo.portal.responses.ResponseTemplateFolder; + import org.apache.http.HttpRequest; + import org.apache.http.HttpResponse; + /** * @author joerg *************** *** 30,34 **** @Request public void fareYeWell(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } --- 29,33 ---- @Request public void fareYeWell(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } Index: SessionWithCustomTemplateFolder.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/SessionWithCustomTemplateFolder.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SessionWithCustomTemplateFolder.java 28 May 2009 18:34:46 -0000 1.7 --- SessionWithCustomTemplateFolder.java 13 Aug 2009 22:35:18 -0000 1.8 *************** *** 20,24 **** import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; /** --- 20,23 ---- *************** *** 31,35 **** @Request public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } --- 30,34 ---- @Request public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } Index: SubA.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.test/src/net/heilancoo/portal/webapps/test/SubA.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubA.java 6 Jul 2009 19:51:04 -0000 1.1 --- SubA.java 13 Aug 2009 22:35:18 -0000 1.2 *************** *** 12,19 **** package net.heilancoo.portal.webapps.test; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - import net.heilancoo.portal.controller.Request; import net.heilancoo.portal.freemarker.FreeMarkerModel; --- 12,15 ---- *************** *** 21,24 **** --- 17,23 ---- import net.heilancoo.portal.responses.ResponseTemplateFolder; + import org.apache.http.HttpRequest; + import org.apache.http.HttpResponse; + /** * @author joerg *************** *** 30,34 **** @Request public void comeIn(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } --- 29,33 ---- @Request public void comeIn(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, FreeMarkerModel model) { } |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:26
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/customentrypoint In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11701/src/net/heilancoo/portal/examples/customentrypoint Modified Files: CustomEntryPointSession.java CustomEntryPointApplication.java Log Message: support request methods with more flexible parameter lists Index: CustomEntryPointSession.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/customentrypoint/CustomEntryPointSession.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CustomEntryPointSession.java 13 Jul 2009 16:31:41 -0000 1.1 --- CustomEntryPointSession.java 13 Aug 2009 22:35:15 -0000 1.2 *************** *** 21,28 **** import net.heilancoo.portal.session.Session; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - /** * @author joerg --- 21,24 ---- *************** *** 47,52 **** // this example. @Request ! public void riverMain(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { counter += 1; model.put("counter", counter); --- 43,47 ---- // this example. @Request ! public void riverMain(FormFieldContainer fields, FreeMarkerModel model) { counter += 1; model.put("counter", counter); Index: CustomEntryPointApplication.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/customentrypoint/CustomEntryPointApplication.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CustomEntryPointApplication.java 26 Jul 2009 15:19:36 -0000 1.3 --- CustomEntryPointApplication.java 13 Aug 2009 22:35:15 -0000 1.4 *************** *** 14,21 **** import java.util.Date; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - import net.heilancoo.portal.application.Application; import net.heilancoo.portal.application.ApplicationInfo; --- 14,17 ---- *************** *** 72,77 **** @Request ! public void overview(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { model.put("date", new Date().toString()); model.put("sessions", info.getNumSessions()); --- 68,72 ---- @Request ! public void overview(FormFieldContainer fields, FreeMarkerModel model) { model.put("date", new Date().toString()); model.put("sessions", info.getNumSessions()); |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:26
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/json In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11701/src/net/heilancoo/portal/examples/json Modified Files: JsonSession.java Log Message: support request methods with more flexible parameter lists Index: JsonSession.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/json/JsonSession.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JsonSession.java 28 Jun 2009 14:38:43 -0000 1.2 --- JsonSession.java 13 Aug 2009 22:35:15 -0000 1.3 *************** *** 21,27 **** import net.heilancoo.portal.session.Session; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; import org.json.JSONException; import org.json.JSONObject; --- 21,24 ---- *************** *** 46,56 **** @Request ! public void main(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { } @Request ! public void doCounter(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, JSONObject model) throws JSONException { counter += 1; model.put("counter", counter); --- 43,51 ---- @Request ! public void main(FormFieldContainer fields, FreeMarkerModel model) { } @Request ! public void doCounter(FormFieldContainer fields, JSONObject model) throws JSONException { counter += 1; model.put("counter", counter); |
From: Joerg B. <jb...@us...> - 2009-08-13 22:35:25
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/redirect In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11701/src/net/heilancoo/portal/examples/redirect Modified Files: ToDoSession.java Log Message: support request methods with more flexible parameter lists Index: ToDoSession.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/redirect/ToDoSession.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ToDoSession.java 3 Aug 2009 17:08:44 -0000 1.2 --- ToDoSession.java 13 Aug 2009 22:35:15 -0000 1.3 *************** *** 14,21 **** import java.util.List; - import org.apache.http.HttpRequest; - import org.apache.http.HttpResponse; - import org.apache.http.protocol.HttpContext; - import net.heilancoo.portal.controller.Request; import net.heilancoo.portal.examples.redirect.model.Item; --- 14,17 ---- *************** *** 59,64 **** @Request ! public void list(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { model.put("items", items); model.put("user", user); --- 55,59 ---- @Request ! public void list(FormFieldContainer fields, FreeMarkerModel model) { model.put("items", items); model.put("user", user); *************** *** 66,77 **** @Request ! public void add(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) { model.put("user", user); } @Request ! public Object addSubmit(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context) throws FormFieldAccessException { items.add(new Item(fields.getStringValue("text"), nextId++)); return "list"; --- 61,70 ---- @Request ! public void add(FormFieldContainer fields, FreeMarkerModel model) { model.put("user", user); } @Request ! public Object addSubmit(FormFieldContainer fields) throws FormFieldAccessException { items.add(new Item(fields.getStringValue("text"), nextId++)); return "list"; *************** *** 87,92 **** @Request ! public Object editSubmit(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context) throws FormFieldAccessException { Item i = findItemForId(fields.getIntValue("id")); --- 80,84 ---- @Request ! public Object editSubmit(FormFieldContainer fields) throws FormFieldAccessException { Item i = findItemForId(fields.getIntValue("id")); *************** *** 98,103 **** @Request ! public Object edit(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) throws FormFieldAccessException { int id = fields.getIntValue("id"); Item i = findItemForId(id); --- 90,94 ---- @Request ! public Object edit(FormFieldContainer fields, FreeMarkerModel model) throws FormFieldAccessException { int id = fields.getIntValue("id"); Item i = findItemForId(id); *************** *** 122,127 **** @Request ! public String details(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) throws FormFieldAccessException { int id = fields.getIntValue("id"); Item i = findItemForId(id); --- 113,117 ---- @Request ! public String details(FormFieldContainer fields, FreeMarkerModel model) throws FormFieldAccessException { int id = fields.getIntValue("id"); Item i = findItemForId(id); |
From: Joerg B. <jb...@us...> - 2009-08-04 21:07:06
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28009/src/net/heilancoo/portal/examples/redirect/test Added Files: Statistics.java OneUser.java Stress.java Log Message: stress testing example --- NEW FILE: Stress.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.examples.redirect.test; import net.heilancoo.portal.testutils.PortalTest; import org.apache.log4j.Logger; import org.junit.BeforeClass; import org.junit.Test; public class Stress { private static final Logger logger = Logger.getLogger(Stress.class); // First, the web application service is fired up (we // wait 500 ms after kicking it off). @BeforeClass public static void setUpBeforeClass() throws Exception { PortalTest.startPortal(new String [] { "--log=testlog.txt" }, 500); } @Test public void tryAll() throws Exception { doIt(5); doIt(10); doIt(20); doIt(40); doIt(80); doIt(160); doIt(320); } public void doIt(int count) throws Exception { OneUser [] users = new OneUser[count]; for(int i = 0; i < count; i++) users[i] = new OneUser("user_" + i, i); for(OneUser u : users) u.start(); for(OneUser u : users) u.join(); logger.info("==========="); for(OneUser u : users) u.stats(count + " "); logger.info("==========="); } } --- NEW FILE: Statistics.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.examples.redirect.test; import com.gargoylesoftware.htmlunit.Page; /** * @author joerg * */ public class Statistics { private long count; private long min; private long max; private long sum; public Statistics() { this.count = 0; this.min = Long.MAX_VALUE; this.max = Long.MIN_VALUE; this.sum = 0; } public void addValue(long val) { count += 1; sum += val; min = Math.min(min, val); max = Math.max(max, val); } public void addStats(Page page) { addValue(page.getWebResponse().getLoadTime()); } public String toString() { return "count = " + count + ", avg = " + Math.round(sum / (1.0 * count)) + ", min = " + min + ", max = " + max; } public long getCount() { return count; } } --- NEW FILE: OneUser.java --- /* * Copyright (c) 2009 Heilan' Coo -- Joerg Bullmann * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Joerg Bullmann <jb...@he...> */ package net.heilancoo.portal.examples.redirect.test; import java.io.IOException; import java.net.MalformedURLException; import java.util.List; import java.util.Random; import net.heilancoo.portal.application.ApplicationException; import net.heilancoo.portal.testutils.AppUtils; import org.apache.log4j.Logger; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlPage; /** * @author joerg * */ public class OneUser extends Thread { private static final Logger logger = Logger.getLogger(OneUser.class); private String name; private int direction; private int listSize; private HtmlPage loggedIn; private Random randy; private Statistics login; private Statistics logout; private Statistics operation; public OneUser(String name, int seed) { this.name = name; this.direction = 1; this.listSize = 0; this.randy = new Random(seed); this.login = new Statistics(); this.logout = new Statistics(); this.operation = new Statistics(); } public void run() { for(int i = 0; i < 50; i++) { try { useApplication(); } catch (Exception e) { logger.error(e, e); } } } public void stats(String prefix) { logger.info(prefix + "stats -- login(" + name + "): " + login); logger.info(prefix + "stats -- logout(" + name + "): " + logout); logger.info(prefix + "stats -- operation(" + name + "): " + operation); } private void useApplication() throws FailingHttpStatusCodeException, MalformedURLException, IOException, ApplicationException, InterruptedException { loggedIn = AppUtils.doDefaultLogin("http://127.0.0.1:8080", "todo", name, name); login.addStats(loggedIn); if(listSize == 0) listSize = loggedIn.getByXPath("/html/body/table/tbody/tr/td/form").size(); int add; int remove; if(direction == 1) { if(listSize > 20) direction = -1; } else { if(listSize < 5) direction = 1; } if(direction == 1) { add = 4; remove = 2; } else { add = 2; remove = 4; } for(int i = 0; i < add; i++) addItem(); for(int i = 0; i < 3; i++) changeItem(); for(int i = 0; i < remove; i++) removeItem(); logger.info("User: " + name + ", items = " + listSize); logout.addStats(loggedIn.getAnchorByHref("logout").click()); loggedIn = null; } private void changeItem() { // TODO Auto-generated method stub } private void removeItem() throws ElementNotFoundException, IOException { List<?> forms = loggedIn.getByXPath("/html/body/table/tbody/tr/td/form"); int numItems = forms.size(); int item = (int) Math.floor(randy.nextDouble() * numItems); if(numItems != listSize) logger.error("Mismatch: " + numItems + " vs. " + listSize); loggedIn = ((HtmlForm) forms.get(item)).getInputByName("delete").click(); operation.addStats(loggedIn); listSize -= 1; } private void addItem() throws ElementNotFoundException, IOException { HtmlPage addPage = loggedIn.getFormByName("addForm").getInputByName("add").click(); HtmlForm addForm = addPage.getFormByName("addForm"); addForm.getInputByName("text").setValueAttribute(operation.getCount() + ": make a cup of tea the umpteenth time"); loggedIn = addForm.getInputByName("add").click(); operation.addStats(loggedIn); listSize += 1; } } |
From: Joerg B. <jb...@us...> - 2009-08-04 21:06:35
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27927/src/net/heilancoo/portal/examples/redirect/test Modified Files: WebTests.java Log Message: added parameter for standard command line argument passing to portal test service starter Index: WebTests.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test/WebTests.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebTests.java 31 Jul 2009 18:10:58 -0000 1.4 --- WebTests.java 4 Aug 2009 21:06:26 -0000 1.5 *************** *** 38,42 **** @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(500); } --- 38,42 ---- @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(null, 500); } |
From: Joerg B. <jb...@us...> - 2009-08-04 21:06:33
|
Update of /cvsroot/lipog/net.heilancoo.bingo.test/src/net/heilancoo/bingo/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27900/src/net/heilancoo/bingo/test Modified Files: BingoApp.java Log Message: added parameter for standard command line argument passing to portal test service starter Index: BingoApp.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.bingo.test/src/net/heilancoo/bingo/test/BingoApp.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BingoApp.java 31 Jul 2009 18:10:52 -0000 1.3 --- BingoApp.java 4 Aug 2009 21:06:17 -0000 1.4 *************** *** 41,45 **** @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(500); } --- 41,45 ---- @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(null, 500); } |
From: Joerg B. <jb...@us...> - 2009-08-04 21:06:31
|
Update of /cvsroot/lipog/net.heilancoo.portal.documentation/doc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27919/doc Modified Files: apptest-123.html Log Message: added parameter for standard command line argument passing to portal test service starter Index: apptest-123.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.documentation/doc/apptest-123.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** apptest-123.html 31 Jul 2009 18:10:55 -0000 1.4 --- apptest-123.html 4 Aug 2009 21:06:23 -0000 1.5 *************** *** 48,52 **** @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(500); } --- 48,52 ---- @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(null, 500); } *************** *** 60,64 **** @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(500); } --- 60,64 ---- @BeforeClass public static void setUpBeforeClass() throws Exception { ! PortalTest.startPortal(null, 500); } |
From: Joerg B. <jb...@us...> - 2009-08-04 21:06:29
|
Update of /cvsroot/lipog/net.heilancoo.portal.testutils/src/net/heilancoo/portal/testutils In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27909/src/net/heilancoo/portal/testutils Modified Files: PortalTest.java TestUtilsPlugin.java Log Message: added parameter for standard command line argument passing to portal test service starter Index: TestUtilsPlugin.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.testutils/src/net/heilancoo/portal/testutils/TestUtilsPlugin.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestUtilsPlugin.java 25 Jul 2009 06:11:39 -0000 1.1 --- TestUtilsPlugin.java 4 Aug 2009 21:06:20 -0000 1.2 *************** *** 46,55 **** } ! public void startPortal(int waitAfterStart) { if(portalStarted) return; try { ! new ServiceStarter().startWithArgs(null, waitAfterStart); portalStarted = true; } --- 46,55 ---- } ! public void startPortal(String [] args, int waitAfterStart) { if(portalStarted) return; try { ! new ServiceStarter().startWithArgs(args, waitAfterStart); portalStarted = true; } Index: PortalTest.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.testutils/src/net/heilancoo/portal/testutils/PortalTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PortalTest.java 28 Jul 2009 16:40:53 -0000 1.2 --- PortalTest.java 4 Aug 2009 21:06:20 -0000 1.3 *************** *** 26,31 **** */ public class PortalTest { ! public static void startPortal(int waitAfterStart) { ! TestUtilsPlugin.getDefault().startPortal(waitAfterStart); } --- 26,31 ---- */ public class PortalTest { ! public static void startPortal(String [] args, int waitAfterStart) { ! TestUtilsPlugin.getDefault().startPortal(args, waitAfterStart); } |
From: Joerg B. <jb...@us...> - 2009-08-04 21:05:11
|
Update of /cvsroot/lipog/net.heilancoo.portal/config In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27599/config Modified Files: log.properties Log Message: more and larger log files Index: log.properties =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/config/log.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** log.properties 6 Jul 2009 16:34:58 -0000 1.6 --- log.properties 4 Aug 2009 21:04:50 -0000 1.7 *************** *** 20,25 **** log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %p %m%n ! log4j.appender.file.maxFileSize=256KB ! log4j.appender.file.maxBackupIndex=16 log4j.appender.file.File=gizmo.log --- 20,25 ---- log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %p %m%n ! log4j.appender.file.maxFileSize=16384KB ! log4j.appender.file.maxBackupIndex=256 log4j.appender.file.File=gizmo.log |
From: Joerg B. <jb...@us...> - 2009-08-03 17:09:00
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/redirect In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv672/src/net/heilancoo/portal/examples/redirect Modified Files: ToDoSession.java Log Message: names straightened out and added details page Index: ToDoSession.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/src/net/heilancoo/portal/examples/redirect/ToDoSession.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ToDoSession.java 24 Jul 2009 06:40:36 -0000 1.1 --- ToDoSession.java 3 Aug 2009 17:08:44 -0000 1.2 *************** *** 32,36 **** * */ ! @EntryPoint("listItems") @ResponseTemplateFolder("redirect/templates") public class ToDoSession implements Session { --- 32,36 ---- * */ ! @EntryPoint("list") @ResponseTemplateFolder("redirect/templates") public class ToDoSession implements Session { *************** *** 59,63 **** @Request ! public void listItems(HttpRequest request, FormFieldContainer fields, HttpResponse response, HttpContext context, FreeMarkerModel model) { model.put("items", items); --- 59,63 ---- @Request ! public void list(HttpRequest request, FormFieldContainer fields, HttpResponse response, HttpContext context, FreeMarkerModel model) { model.put("items", items); *************** *** 74,80 **** public Object addSubmit(HttpRequest request, FormFieldContainer fields, HttpResponse response, HttpContext context) throws FormFieldAccessException { ! String text = fields.getStringValue("text"); ! items.add(new Item(text, nextId++)); ! return "listItems"; } --- 74,87 ---- public Object addSubmit(HttpRequest request, FormFieldContainer fields, HttpResponse response, HttpContext context) throws FormFieldAccessException { ! items.add(new Item(fields.getStringValue("text"), nextId++)); ! return "list"; ! } ! ! public Item findItemForId(int id) { ! for(Item i : items) ! if(i.getId() == id) ! return i; ! ! return null; } *************** *** 82,120 **** public Object editSubmit(HttpRequest request, FormFieldContainer fields, HttpResponse response, HttpContext context) throws FormFieldAccessException { ! String text = fields.getStringValue("text"); ! int id = fields.getIntValue("id"); ! ! if(fields.hasFieldName("edit")) ! for(Item i : items) ! if(i.getId() == id) { ! i.setText(text); ! break; ! } ! return "listItems"; } @Request ! public Object delEdit(HttpRequest request, FormFieldContainer fields, HttpResponse response, HttpContext context, FreeMarkerModel model) throws FormFieldAccessException { int id = fields.getIntValue("id"); ! if(fields.hasFieldName("del")) { ! for(Item i : items) ! if(i.getId() == id) { ! items.remove(i); ! break; ! } ! return "listItems"; } ! ! for(Item i : items) ! if(i.getId() == id) { ! model.put("user", user); ! model.put("id", id); ! model.put("text", i.getText()); ! break; ! } return null; --- 89,136 ---- public Object editSubmit(HttpRequest request, FormFieldContainer fields, HttpResponse response, HttpContext context) throws FormFieldAccessException { ! Item i = findItemForId(fields.getIntValue("id")); ! ! if(i != null && fields.hasFieldName("edit")) ! i.setText(fields.getStringValue("text")); ! return "list"; } @Request ! public Object edit(HttpRequest request, FormFieldContainer fields, HttpResponse response, HttpContext context, FreeMarkerModel model) throws FormFieldAccessException { int id = fields.getIntValue("id"); + Item i = findItemForId(id); + + if(i == null) + return "list"; ! if(fields.hasFieldName("delete")) { ! items.remove(i); ! return "list"; } ! else if(fields.hasFieldName("details")) ! return "details?id=" + id; ! ! model.put("user", user); ! model.put("id", id); ! model.put("text", i.getText()); ! ! return null; ! } ! ! @Request ! public String details(HttpRequest request, FormFieldContainer fields, ! HttpResponse response, HttpContext context, FreeMarkerModel model) throws FormFieldAccessException { ! int id = fields.getIntValue("id"); ! Item i = findItemForId(id); ! ! if(i == null) ! return "list"; ! ! model.put("user", user); ! model.put("id", id); ! model.put("text", i.getText()); return null; |
From: Joerg B. <jb...@us...> - 2009-08-03 17:08:55
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/redirect/templates In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv672/redirect/templates Added Files: list.html details.html edit.html Removed Files: listItems.html delEdit.html Log Message: names straightened out and added details page --- NEW FILE: edit.html --- <html> <head> <title>Edit To Do Item</title> </head> <body> <link rel="stylesheet" type="text/css" href="/files/default.css" /> <h1>Edit To Do Item</h1> <p>User: ${user.name}</p> <form name="editForm" action="editSubmit"> <p>Text: </p> <input name="id" type="hidden" value="${id}"/> <input name="text" type="text" value="${text}"/> <input name="edit" type="submit" value="Submit"/> <input name="cancel" type="submit" value="Cancel"/> </form> </body> </html> --- delEdit.html DELETED --- --- NEW FILE: details.html --- <html> <head> <title>Single To Do Item</title> </head> <body> <link rel="stylesheet" type="text/css" href="/files/default.css" /> <h1>Single To Do Item</h1> <p>User: ${user.name}</p> <table> <tr><th class="inp">Id:</th><td class="inp">${id}</td></tr> <tr><th class="inp">Text:</th><td class="inp">${text}</td></tr> </table> <p><a href="list">List</a>, <a href="logout">Logout</a></p> </body> </html> --- NEW FILE: list.html --- <html> <head> <title>To Do List</title> </head> <body> <link rel="stylesheet" type="text/css" href="/files/default.css" /> <h1>To Do List</h1> <p>User: ${user.name}, <a id="logout" href="logout">Logout</a></p> <form name="addForm" action="add"> <input name="add" type="submit" value="Add To Do Item"/> </form> <table> <tr> <th class="inp">Id</th><th class="inp">What</th><th class="ctrl"></th> </tr> <#list items as t> <tr><td class="inp">${t.id}</td><td class="inp">${t.text}</td><td class="ctrl"> <form name="delEditForm${t.id}" action="edit"> <input name="id" type="hidden" value="${t.id}"/> <input name="delete" type="submit" value="Delete"/> <input name="edit" type="submit" value="Edit"/> <input name="details" type="submit" value="Details"/> </form> </td></tr> </#list> </table> </body> </html> --- listItems.html DELETED --- |
From: Joerg B. <jb...@us...> - 2009-07-31 18:11:12
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27603/src/net/heilancoo/portal/examples/redirect/test Modified Files: WebTests.java Log Message: use convenience method for login Index: WebTests.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples.test/src/net/heilancoo/portal/examples/redirect/test/WebTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WebTests.java 28 Jul 2009 16:40:59 -0000 1.3 --- WebTests.java 31 Jul 2009 18:10:58 -0000 1.4 *************** *** 20,23 **** --- 20,24 ---- import net.heilancoo.portal.application.ApplicationException; import net.heilancoo.portal.examples.redirect.ToDoSession; + import net.heilancoo.portal.testutils.AppUtils; import net.heilancoo.portal.testutils.PortalTest; *************** *** 26,30 **** import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; - import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlPage; --- 27,30 ---- *************** *** 45,57 **** // =========================================================== // Log into the web application. This is client side activity. ! WebClient cl = new WebClient(); ! HtmlPage pg = cl.getPage("http://127.0.0.1:8080/todo"); ! assertEquals("Login", pg.getTitleText()); ! ! HtmlForm login = pg.getFormByName("input"); ! login.getInputByName("user").setValueAttribute("jimmy"); ! login.getInputByName("password").setValueAttribute("jimmy"); ! ! HtmlPage loggedIn = login.getInputByName("button").click(); // ========================================================== --- 45,49 ---- // =========================================================== // Log into the web application. This is client side activity. ! HtmlPage loggedIn = AppUtils.doDefaultLogin("http://127.0.0.1:8080", "todo", "jimmy", "jimmy"); // ========================================================== *************** *** 80,92 **** // get the login page, fill in the fields and click the button. ! WebClient cl = new WebClient(); ! HtmlPage pg = cl.getPage("http://127.0.0.1:8080/todo"); ! assertEquals("Login", pg.getTitleText()); ! ! HtmlForm login = pg.getFormByName("input"); ! login.getInputByName("user").setValueAttribute("jimmy"); ! login.getInputByName("password").setValueAttribute("jimmy"); ! ! HtmlPage loggedIn = login.getInputByName("button").click(); // After the successful login we now inspect the application on --- 72,76 ---- // get the login page, fill in the fields and click the button. ! HtmlPage loggedIn = AppUtils.doDefaultLogin("http://127.0.0.1:8080", "todo", "jimmy", "jimmy"); // After the successful login we now inspect the application on |
From: Joerg B. <jb...@us...> - 2009-07-31 18:11:05
|
Update of /cvsroot/lipog/net.heilancoo.portal.documentation/doc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27592/doc Modified Files: apptest-123.html Log Message: use convenience method for login Index: apptest-123.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.documentation/doc/apptest-123.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** apptest-123.html 28 Jul 2009 16:55:25 -0000 1.3 --- apptest-123.html 31 Jul 2009 18:10:55 -0000 1.4 *************** *** 67,79 **** // =========================================================== // Log into the web application. This is client side activity. ! WebClient cl = new WebClient(); ! HtmlPage pg = cl.getPage("http://127.0.0.1:8080/bingo"); ! assertEquals("Login", pg.getTitleText()); ! ! HtmlForm login = pg.getFormByName("input"); ! login.getInputByName("user").setValueAttribute("joerg"); ! login.getInputByName("password").setValueAttribute("joerg"); ! ! HtmlPage loggedIn = login.getInputByName("button").click(); // ========================================================== --- 67,71 ---- // =========================================================== // Log into the web application. This is client side activity. ! HtmlPage loggedIn = AppUtils.doDefaultLogin("http://127.0.0.1:8080", "bingo", "jimmy", "jimmy"); // ========================================================== |
From: Joerg B. <jb...@us...> - 2009-07-31 18:11:00
|
Update of /cvsroot/lipog/net.heilancoo.bingo.test/src/net/heilancoo/bingo/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27577/src/net/heilancoo/bingo/test Modified Files: BingoApp.java Log Message: use convenience method for login Index: BingoApp.java =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.bingo.test/src/net/heilancoo/bingo/test/BingoApp.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BingoApp.java 28 Jul 2009 16:40:47 -0000 1.2 --- BingoApp.java 31 Jul 2009 18:10:52 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- import net.heilancoo.bingo.BingoSession; import net.heilancoo.portal.application.ApplicationException; + import net.heilancoo.portal.testutils.AppUtils; import net.heilancoo.portal.testutils.PortalTest; *************** *** 27,32 **** import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; - import com.gargoylesoftware.htmlunit.WebClient; - import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlPage; --- 28,31 ---- *************** *** 49,61 **** // =========================================================== // Log into the web application. This is client side activity. ! WebClient cl = new WebClient(); ! HtmlPage pg = cl.getPage("http://127.0.0.1:8080/bingo"); ! assertEquals("Login", pg.getTitleText()); ! ! HtmlForm login = pg.getFormByName("input"); ! login.getInputByName("user").setValueAttribute("jimmy"); ! login.getInputByName("password").setValueAttribute("jimmy"); ! ! HtmlPage loggedIn = login.getInputByName("button").click(); // ========================================================== --- 48,52 ---- // =========================================================== // Log into the web application. This is client side activity. ! HtmlPage loggedIn = AppUtils.doDefaultLogin("http://127.0.0.1:8080", "bingo", "jimmy", "jimmy"); // ========================================================== |
From: Joerg B. <jb...@us...> - 2009-07-31 18:10:37
|
Update of /cvsroot/lipog/net.heilancoo.portal.examples/templates In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27533/templates Modified Files: login.html Log Message: tidied up form and input field names Index: login.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal.examples/templates/login.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** login.html 25 Jul 2009 06:17:23 -0000 1.2 --- login.html 31 Jul 2009 18:10:21 -0000 1.3 *************** *** 6,15 **** </head> <body> ! <form name="input" action="login-validate" method="post"> <h1>Multi Controller Login!</h1> <table> <tr><td>Username:</td><td><input type="text" name="user"></td></tr> <tr><td>Password:</td><td><input type="password" name="password"></td></tr> ! <tr><td colspan="2" align="center"><input type="submit" name="button" value="Login"></td></tr> </table> </form> --- 6,15 ---- </head> <body> ! <form name="loginForm" action="login-validate" method="post"> <h1>Multi Controller Login!</h1> <table> <tr><td>Username:</td><td><input type="text" name="user"></td></tr> <tr><td>Password:</td><td><input type="password" name="password"></td></tr> ! <tr><td colspan="2" align="center"><input type="submit" name="login" value="Login"></td></tr> </table> </form> |
From: Joerg B. <jb...@us...> - 2009-07-31 18:10:36
|
Update of /cvsroot/lipog/net.heilancoo.portal/statics In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27517/statics Modified Files: login.html Log Message: tidied up form and input field names Index: login.html =================================================================== RCS file: /cvsroot/lipog/net.heilancoo.portal/statics/login.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** login.html 25 Jul 2009 06:17:06 -0000 1.3 --- login.html 31 Jul 2009 18:10:18 -0000 1.4 *************** *** 6,14 **** </head> <body> ! <form name="input" action="login-validate" method="post"> <table> <tr><td>Username:</td><td><input type="text" name="user"></td></tr> <tr><td>Password:</td><td><input type="password" name="password"></td></tr> ! <tr><td colspan="2" align="center"><input type="submit" name="button" value="Login"></td></tr> </table> </form> --- 6,14 ---- </head> <body> ! <form name="loginForm" action="login-validate" method="post"> <table> <tr><td>Username:</td><td><input type="text" name="user"></td></tr> <tr><td>Password:</td><td><input type="password" name="password"></td></tr> ! <tr><td colspan="2" align="center"><input type="submit" name="login" value="Login"></td></tr> </table> </form> |