[Wicket-stuff-develop] [ wicket-stuff-Patches-1421178 ] wicket-contrib-database

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Wicket-stuff-develop] [ wicket-stuff-Patches-1421178 ] wicket-contrib-database

SourceForge.net
Patches item #1421178, was opened at 2006-02-01 00:24
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=730670&aid=1421178&group_id=134391

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Wicket Stuff
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Joseph Toth (weazelb0y)
Assigned to: Martijn Dashorst (dashorst)
Summary: wicket-contrib-database

Initial Comment:
Needed to wrap request...


Index: DatabaseWebApplication.java
===================================================================
RCS file:
/cvsroot/wicket-stuff/wicket-contrib-database/src/java/wicket/contrib/database/DatabaseWebApplication.java,v
retrieving revision 1.3
diff -u -r1.3 DatabaseWebApplication.java
--- DatabaseWebApplication.java 7 Jan 2006 16:54:20
-0000 1.3
+++ DatabaseWebApplication.java 1 Feb 2006 05:23:26 -0000
@@ -17,30 +17,42 @@
  */
 package wicket.contrib.database;
 
+import wicket.IRequestCycleFactory;
+import wicket.ISessionFactory;
+import wicket.Request;
+import wicket.RequestCycle;
+import wicket.Response;
+import wicket.Session;
 import wicket.protocol.http.WebApplication;
+import wicket.protocol.http.WebRequest;
+import wicket.protocol.http.WebSession;
 
 /**
  * The main application class for the database driven
web applications.
  *
  * @author Jonathan Locke
  */
-public abstract class DatabaseWebApplication extends
WebApplication implements IDatabaseApplication
-{
+public abstract class DatabaseWebApplication extends
WebApplication implements
+ IDatabaseApplication, ISessionFactory {
+
+ protected void init() {
+ super.init();
+ setSessionFactory(this);
+ }
+
  /** The database for this web application */
  private Database database;
 
  /**
  * Constructor
  */
- public DatabaseWebApplication()
- {
+ public DatabaseWebApplication() {
  }
 
  /**
  * @see
wicket.contrib.database.IDatabaseApplication#getDatabase()
  */
- public Database getDatabase()
- {
+ public Database getDatabase() {
  return database;
  }
 
@@ -48,8 +60,23 @@
  * @param database
  *            The new database
  */
- public void setDatabase(Database database)
- {
+ public void setDatabase(Database database) {
  this.database = database;
  }
+
+ private IRequestCycleFactory requestCycleFactory =
new IRequestCycleFactory() {
+ public RequestCycle newRequestCycle(Session session,
Request request,
+ Response response) {
+ return new DatabaseWebRequestCycle((WebSession)
session,
+ (WebRequest) request, response);
+ }
+ };
+
+ public Session newSession() {
+ return new WebSession(DatabaseWebApplication.this) {
+ protected IRequestCycleFactory
getRequestCycleFactory() {
+ return requestCycleFactory;
+ }
+ };
+ }
 }


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=730670&aid=1421178&group_id=134391


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-stuff-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-stuff-develop