dpp / liftweb
- Source
- Commits
- Network (41)
- Issues (44)
- Downloads (18)
- Wiki (30)
- Graphs
-
Branch:
master
-
3 comments Created 11 days ago by indrajitrAdjust vscaladoc packageLinkdef baseurl for offline friendly navigationindrajitrxCurrently, vsaladoc generated contents have baseurl for Lift packages point to scala-tools.org.
The packageLinkDefs should be tweaked so that docs generated locally via "scala:doc" point to local contents instead of pointing to remote url.
Comments
-
1 comment Created 11 days ago by indrajitrSimplify maven-scala-plugin configuration for pure scala projectindrajitrxCurrent maven-scala-plugin configuration supports mixed Scala/Java project. The intention is to allow having higher flexibility.
However, Mixed Scala/Java project configuration is useful only when there are classes generated from java source has compile time dependency on classes generated from scala source. Lift doesn't have use case for such scenario currently.
There are some disadvantages of such configuration as well:
- it requires 2 compilation step => longer to compile
- it is not compatible with IDE (e.g., Eclipse likes to have the source directory define via the build.sourceDirectory)
- the build life cycle end up being a hacked one
- it has side effects on other plugins (e.g., maven-source-plugin expects sources via build.sourceDirectory by default)
Comments
- Simplify maven-scala-plugin configuration for pure scala project. Closed by 6e582db
- Plugin version update (scala-plugin:2.13.1, changes-plugin:2.3, jar-plugin:2.3)
- Remove redundant phase for bundle:bundle
- Remove id for simple executions running in default phase
- Prepone resources:copy-resource to process-resources phase (pre-site is too late)
-
1 comment Created 15 days ago by harryhdppxNPE in MappedDateTime when encoding to jsonOn Review BoardxWhen the field is NULL (which happens to be the defaultValue for MappedDateTime)
Message: java.lang.NullPointerException
net.liftweb.mapper.MappedDateTime.asJsonValue(MappedDateTime.scala:49) com.foursquare.model.Venue$mayor_updated$.asJsonValue(Venue.scala:50001) net.liftweb.mapper.BaseMappedField$class.asJsonField(MappedField.scala:92) net.liftweb.mapper.MappedDateTime.asJsonField(MappedDateTime.scala:34) com.foursquare.model.Venue$mayor_updated$.asJsonField(Venue.scala:50001) net.liftweb.mapper.MetaMapper$$anonfun$encodeAsJSON_$bang$1$$anonfun$apply$14.apply(MetaMapper.scala:571) net.liftweb.mapper.MetaMapper$$anonfun$encodeAsJSON_$bang$1$$anonfun$apply$14.apply(MetaMapper.scala:571) scala.List.map(List.scala:812) net.liftweb.mapper.MetaMapper$$anonfun$encodeAsJSON_$bang$1.apply(MetaMapper.scala:571) net.liftweb.mapper.MetaMapper$$anonfun$encodeAsJSON_$bang$1.apply(MetaMapper.scala:568)Comments
-
1 comment Created 15 days ago by pr1001dppxlift-flot tries to push code into <head>On Review BoardxFlot.render() tries to put code into the head of the XHTML document, which is problematic when using Flot within a CometActor.
See http://github.com/pr1001/lift-comet-initialization-example.
>Comments
-
I ran into an issue where Jetty failed to restart because of Derby connection remaining active. I started a discussion on the mailing list (http://groups.google.com/group/liftweb/browse_thread/thread/78454f767280b4b5) to confirm it was an issue and wanted to create an issue along with potential fix.
Sorry I'm a bit new to Git Hub (and Git.. and Lift for that matter). I'm not sure how to submit a patch exactly but the fix is to move the Derby dependency inside of Jetty so that Jetty manages the Derby instance. This not only allows Derby to restart by also maintains database independence from the application. It is also a good idea to remove the Derby dependency or from the project dependencies or at least change to provided.
The resulting jetty configuration should look like this:
<groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <configuration> <contextPath>/</contextPath> <scanIntervalSeconds>5</scanIntervalSeconds> </configuration> <dependencies> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>10.4.2.0</version> </dependency> </dependencies> </plugin>Comments
Derby is no longer the default database for newly created Lift apps.
Ok. Well this is what I had encountered when creating an archetype. I think it may apply to other Databases as well so do keep it in mind for archetype updates.
What are you moving to? H2 perhaps?
Hi. The issue is with the archetype, not with derby. I've update the title of the issue to be more clear. I just created a project using 1.1-M8 archetype and the h2 dependency is also causing this issue. While it's not a major issue it quite annoying to anyone trying to get started.
By configuring Jetty as described above and removing the h2 dependency, I was able to hot deploy class changes. Using the archetype as described I have to stop/start jetty every time.
Not sure if these old issues are combed through. I will open a new issue if I do not get a response back on this. Thanks!
-
Snapshot release lift-webkit: Source jars have only resources and no scala sources
1 comment Created 15 days ago by mwinkels -
1 comment Created 15 days ago by tommyclidppxlift-textile misprocesses a list without a preceding empty lineOn Review BoardxLists work in lift-textile only if there is an empty line preceding it, but this is a deviation from the reference implementation http://textism.com/tools/textile/index.php .
Here's an example:
These are list items: * Item 1 * Item 2incorrectly yields:
<p>These are list items:<br></br>* Item 1<br></br>* Item 2</p>Comments
-
1 comment Created 16 days ago by dpp304 responses shouldn't include a content-type headerdppx -
Lift 1.1 swaps <?xml ...> and <!DOCTYPE ...> when the user agent is MSIE
1 comment Created 19 days ago by ppetrIn this case, <!DOCTYPE ... > is on the first line and <?xml ..> on the second. This violates XML specification, <?xml ...> must be at the first line of a document.
Apparently, this doesn't cause problems with IE itself. But when using other browsers (Opera, FF) set up to mask as IE, the page fails to load and the browsers displays an error.
How to reproduce:
- load the hello-world project using
mvn archetype:generate -U -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-blank -DarchetypeVersion=1.0 -DremoteRepositories=http://scala-tools.org/repo-releases -DgroupId=demo.helloworld -DartifactId=helloworld -Dversion=1.0-SNAPSHOT - set lift version to 1.1-M7 in pom.xml
- run the application by
mvn jetty:run - view the generated HTML page by calling (on Linux):
wget -q -O- --user-agent='Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 10.10' 'http://localhost:8080/?' | head - The page will have swapped <?xml ...> and <!DOCTYPE ...>.
Comments
- load the hello-world project using
-
1 comment Created 21 days ago by jeppenejsumdppxdppxNPE in DB.runQuery if a DECIMAL column is NULLOn Review BoardxExample: id is an INTEGER, tco is a DECIMAL, the table is empty:
scala> DB.runQuery("SELECT SUM(id) FROM contracts") res9: (List[String], List[List[String]]) = (List(sum),List(List(0))) scala> DB.runQuery("SELECT SUM(tco) FROM contracts") java.lang.NullPointerException at net.liftweb.mapper.DB$.net$liftweb$mapper$DB$$asString(DB.scala:265) at net.liftweb.mapper.DB$$anonfun$resultSetTo$1.apply(DB.scala:287) at net.liftweb.mapper.DB$$anonfun$resultSetTo$1.apply(DB.scala:287) at scala.List.map(List.scala:812) at net.liftweb.mapper.DB$.resultSetTo(DB.scala:287) at net.liftweb.mapper.DB$$anonfun$runQuery$2$$anonfun$ap...Comments
-
Mapper logging should catch prepared statement exceptions and log them
1 comment Created 22 days ago by dchenbeckerComments
dchenbecker
Tue Dec 15 10:01:53 -0800 2009
| link
Wrap prepared statement exceptions
This closed by b83b431
Added a try/catch so that if the prepared statement fails for
some reason, it can at least be logged properly. Derby, at least,
doesn't include the original query string in the SQL syntax
error exception, so it can be hard to tell what failed. -
It bases generated key fetches on the dbPrimaryKey? property instead of dbAutogenerated?
Comments
dchenbecker
Tue Dec 15 10:01:53 -0800 2009
| link
Change Mapper to properly support generated keys
Closed by df26238
Behavior was based on the wrong Mapper def. Autogeneration should
be handled for fields marked dbAutogenerate_?. -
1 comment Created 23 days ago by indrajitrKeep build plugin and report plugin configuration consistentindrajitrxEnsure build plugin and report plugin configuration are set up explicitly. Since report plugin configuration doesn't apply to build plugin [1] although it should.
Further, in Maven 3, plugin configuration in the section no longer affects plugins in the section of the POM [2].
[1] http://groups.google.com/group/liftweb/browse_thread/thread/36b4450ec7acb7c9/e26b9f1e460b69d0 [2] http://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-SiteandReporting
Comments
-
2 comments Created 23 days ago by DridusdppxAbility for Attribute binding to not emit an attributeOn Review Boardxhttp://groups.google.com/group/liftweb/browse_thread/thread/2f78c7bf9dcd8c79
Alex Black needs the ability to not emit an attribute conditionally at an attribute binding location.
Giving null use to suppress the attribute, but that has since stopped working, and it's using null besides.
Comments
-
2 comments Created 23 days ago by indrajitrMiscellaneous improvements on archetypesindrajitrxAmong other things take care of:
- Get rid of the Warning message: PT Don't override file .../pom.xml during archetype:generate
- Remove ext.vm parsing and set up velocity-macro variables to do the needful
- Enable setting lift version during archetype:generate
- Remove unnecessary dependencies from the generated archetypes
- Streamline maven-scala-plugin settings
Comments
-
1 comment Created 26 days ago by dppdppxTHe JNDI context object not synchronizedOn Review Boardx -
1 comment Created 26 days ago by dppdppxProvide an eager default for connection poolOn Review Boardx -
1 comment Created 26 days ago by dppdppxAnyVar does far too coarse grained lockOn Review Boardx -
2 comments Created 26 days ago by edgarchandppxcheckboxes not serialized as expected in JSON formsOn Review Boardx -
2 comments Created 26 days ago by PaulSandozdppxS.render was removedOn Review BoardxIt appears S.render was unintentionally commented out and then removed. Can you please insert it back.
Comments
PaulSandoz
Fri Dec 04 04:26:22 -0800 2009
| link
See patch below.
diff --git a/lift-base/lift-webkit/src/main/scala/net/liftweb/http/LiftRules.scala b/lift-base/lift-webkit/src/main/scala/net/liftweb/http/LiftRules.scala
index 2058eab..3f0aceb 100644
--- a/lift-base/lift-webkit/src/main/scala/net/liftweb/http/LiftRules.scala +++ b/lift-base/lift-webkit/src/main/scala/net/liftweb/http/LiftRules.scala @@ -585,6 +585,17 @@ object LiftRules extends Factory with FormVendor {}}
- private[http] def rewriteTable(req: HTTPRequest): List[RewritePF] = {
- req match {
- case null => rewrite.toList
- case _ => SessionMaster.getSession(req, Empty) match {
case Full(s) => S.initIfUninitted(s) {S.sessionRewriter.map(_.rewrite) ::: LiftRules.rewrite.toList}case _ => rewrite.toList- }
- }
- }
/**
* Contains the Ajax URI path used by Lift to process Ajax requests.diff --git a/lift-base/lift-webkit/src/main/scala/net/liftweb/http/S.scala b/lift-base/lift-webkit/src/main/scala/net/liftweb/http/S.scala
index f7c84c6..2d3010b 100644
--- a/lift-base/lift-webkit/src/main/scala/net/liftweb/http/S.scala +++ b/lift-base/lift-webkit/src/main/scala/net/liftweb/http/S.scala @@ -1998,6 +1998,31 @@ for {f(name)}
- def render(xhtml: NodeSeq, httpRequest: HTTPRequest): NodeSeq = {
- def doRender(session: LiftSession): NodeSeq =
- session.processSurroundAndInclude("external render", xhtml)
- if (inS.value) doRender(session.open_!)
- else {
- val req = Req(httpRequest, LiftRules.rewriteTable(httpRequest), System.nanoTime)
- val ses: LiftSession = SessionMaster.getSession(httpRequest, Empty) match {
case Full(ret) =>ret.fixSessionTime()
+retcase _ =>val ret = LiftSession(httpRequest.session, req.contextPath)ret.fixSessionTime()SessionMaster.addSession(ret)ret- } +
- init(req, ses) {
doRender(ses)- }
- }
- } + +
-
When I use ModalDialog I want to setup the css but fail,
My code would be:
ModalDialog(someHtml, "top: '10px'")I found the ModalDialog code at Lift:
class ModalDialog(html: NodeSeq, css: Box[String]) extends JsCmd {
val toJsCmd = "jQuery.blockUI({ message: " + AltXML.toXML(Group(S.session.map(s => s.fixHtml(s.processSurroundAndInclude("Modal Dialog", html))).openOr(html)), false, true, S.ieMode).encJs + (css.map(w => ", css: '" + w + "' ").openOr("")) + "});"}
the css is wrap by " ' ' " ,
but I found http://malsup.com/jquery/block/#demos
the css is wraped by "{ }"Comments
Fixed.
commit c3aa63f
Author: Alex Boisvert alex.boisvert@gmail.com
Date: Fri Dec 4 17:12:43 2009 -0800Issue 218: JqJsCmds.ModalDialog now takes JsObj argument to work with BlockUI v2.x -
0 comments Created 28 days ago by mariusdanciumariusxAllow user's function to determine the suffix splitting rulesWork In ProgressxCurrently Lift's splits the suffix of an URI based on predefined rules and an significant list of known suffixes. Although this is sufficient in most cases it is not very flexible mechanism.
This is why allowing users to specify their own splitting rule though LiftRules would allow such flexibility.
Br's,
MariusComments
-
0 comments Created 29 days ago by DridusImprove error message when JsonParser.parse is called with invalid JSON textjonixscala> parse("\"foobar\"") net.liftweb.json.JsonParser$ParseException: unexpected null Near: "foobar at net.liftweb.json.JsonParser$Parser.fail(JsonParser.scala:166) at net.liftweb.json.JsonParser$ValStack.peek(JsonParser.scala:153) at net.liftweb.json.JsonParser$.newValue$1(JsonParser.scala:110) at net.liftweb.json.JsonParser$.parse0(JsonParser.scala:125) at net.liftweb.json.JsonParser$.parse(JsonParser.s...Joni says:
Hi,
This is from JSON RFC (http://www.ietf.org/rfc/rfc4627.txt): "A JSON
text is a serialized object or array."I checked with another parser (http://www.jsonlint.com) and it fails
too when given just JSON value:
"syntax error, unexpected TNUMBER, expecting '{' or '[' at line 1"So perhaps a better error message is a proper fix here?
Cheers Joni
Comments
-
2 comments Created about 1 month ago by harryhBug in json parsing (doesn't correctly interpret \/)rmellgrenxComments
-
2 comments Created about 1 month ago by harryhIt should be possible to reconstruct a Mapper object from a non RDBMS sourcedppxIf, for example, I have some json:
{ "user": {
"id": 12, "name": "Harry", "age": 31,} }
I should be able to construct a User Mapper object such that I can then do:
val user = // build user object from json
user.age(32).saveand have the data be correctly saved back to the DB.
Comments
-
java.sql.SQLException for MappedBoolean on oracle.jdbc.driver.OracleDriver (Oracle 10g)
1 comment Created about 1 month ago by sulsHi,
Using the default MegaProtoUser trait for my User class, the following query fails on oracle but works just fine on H2:
scala> User.findAll(By(User.superUser, false)) java.sql.SQLException: Invalid column type at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208) at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:9168) at ora...Surprisingly however, the following statement works as it should:
scala> User.findAll.head.superUser res22: object com.mi.ahl.hal.ooh.model.User#superUser = trueIs there a quick fix for this issue?
Regards, Mathias
Comments
dchenbecker
Tue Dec 01 13:35:39 -0800 2009
| link
-
Insert and delete Mapper statements aren't getting deleted
1 comment Created about 1 month ago by dchenbeckerThis appears to be due to a change I made for issue 99. Turns out that I should be logging in runPreparedStatement, not exec.
Comments
dchenbecker
Fri Nov 27 18:54:40 -0800 2009
| link
Moved Mapper logging to runPreparedStatement from exec
Closed by 9feb881
-
0 comments Created about 1 month ago by timperrettOn Review BoardxFile extension defaults need wideningtperrettx -
1 comment Created about 1 month ago by dppFunctions created during an API request are not preserveddppx -
1 comment Created about 1 month ago by dppdppxPut <? XML ?> stuff into LiftRulesOn Review Boardx -
0 comments Created about 1 month ago by mariusdanciumariusxLiftRules exceptionHandler should be applied for Ajax exceptions as wellOn Review Boardxif a Ajax functions throws exceptions these are not provided to LiftRules.exceptionHander.
Br's,
MariusComments
-
2 comments Created about 1 month ago by DridusAdd CRUDify.deleteMenuLocParamsrmellgrenxto match editMenuLocParams, viewMenuLocParams, etc.
original message from the list:
Subject: [Lift] Feature Request: deleteMenuLocParams in CRUDify From: tommycli <tommycli@ucla.edu> Date: November 23, 2009 11:50:09 PM EST To: Lift <liftweb@googlegroups.com> Reply-To: liftweb@googlegroups.com Add deleteMenuLocParams to CRUDify. Patch below. (I tried github, but you guys don't pull apparently).Comments
on review board
http://reviewboard.liftweb.net/r/121/ -
2 comments Created about 1 month ago by DridusUse of S.? or other resource bundles outside of S.init throws NPE instead of helpful errorrmellgrenxIf you use S.? or S.??, etc when not in a valid S scope (e.g. during boot time) you get an NPE from the bowels of S.?! instead of useful exception text.
Comments
on review board:
-
1 comment Created about 1 month ago by indrajitrEnforce Lift build using Maven 2.1.x or above but less than 3.xindrajitrx -
0 comments Created about 1 month ago by mariusdanciumariusxHttpAuthProtected LocParam functionality was somehow removedOn Review BoardxProbably due to Loc refactoring this functionality was accidentally removed.
Br's,
MariusComments
-
2 comments Created about 1 month ago by yejunCheckbox not return all elementsrmellgrenxdef checkbox[T](possible : Seq[T], actual : Seq[T], func : (Seq[T]) => Any, attrs : (String, String)*)
Func will only return first element in possible when it is checked or List().
Comments
On review board: http://reviewboard.liftweb.net/r/117/
-
1 comment Created about 1 month ago by nuttycomdppxStrange form submission behavior with AJAX form elements.Work In ProgressxFrom Paul O'Rorke:
since rebuilding a day or two ago with no recent code or other changes: every second time I go to click on an ajax checkbox or select widget, I get effectively no response. actually, it looks like there is a very quick spinning wheel (almost imperceptible) but the page doesn't get repainted and the database does not change.
If I use another operation that is non ajax (going in and editing an item and doing old fashioned get / posts) everything works fine after that (one time).
Or if I reload the page then if I use an ajax widget after reloading ajax works (once).My experience of the bug:
1) load a page where the snippets are managed by a StatefulSnippet
2) some page elements (in my case select boxes) have their values update by AJAX in response to user events. This appears to work normally.
3) upon submission of the form on the page, the page is re-rendered. Logging in the submission function indicates that it is never called.
4) if I fill in the form again and resubmit after the initial failure, the form submit behaves properly.
5) I believe I've seen at least one instance (though I can't reliably reproduce this) where just a normal AJAX call (modifying one of the select boxes) caused the entire page to reload.
Comments
-
1 comment Created about 1 month ago by dppdppxAdd a second URL re-write phaseOn Review Boardx -
1 comment Created about 1 month ago by dppVars (SessionVars, etc.) should support memoizationdppxCurrently, one can specify the way a Var is precalculated, but they should also support a flag for testing if the current value has been set/calculated and also support a by-name method for calculating the value if it hasn't been calculated.
Comments
-
Currently, the java.util.concurrent package will create a lot of threads for Actor handling. This can lead to thousands of unused threads.
Lift Actors should have a limit for the number of threads created and also support harvesting threads in the thread pool
Comments
-
2 comments Created about 1 month ago by christophedehlingerdppxAutoComplete brokenOn Review BoardxRun lift-examples/example from SNAPSHOT (11/5) on a local server, autocompletion isn't happening on the AJAX Samples page. The rest of the Ajax stuff seems to work fine.
Comments
-
0 comments Created about 1 month ago by mariusdanciumariusxcontextFuncBuilder doesn't capture all request stateOn Review BoardxWhen running asynchronously say from a different actor the state capture when the fork happens does not capture HTTP parameters for example. This is quite useful snapshot information to have when doing parallel processing.
Br's,
Marius
Comments
-
0 comments Created about 1 month ago by rhirschmariusxPossible lift error in <lift:form> tagOn Review BoardxI think I might have found a lift bug in the <lift:form> tag
I just did a update for ESME and certain HTML buttons (for example, "Add" in
creating a new action, etc.) no longer work. A javascript syntax error
is thrown.The file in question is
\trunk\server\src\main\webapp\action_view\index.html. The code is here:<lift:form> <lift:main>
This is code currently generated and which causes the syntax error.
onsubmit="liftAjax.lift_ajaxHandler(jQuery('#'+"F1008082309036RKD").serialize(),
, null, "javascript");return false;">This older generated code is currently deployed on stax are works correctly.
onsubmit="liftAjax.lift_ajaxHandler(jQuery('#'+"F444961682037I0I").serialize(),
null, null, null);return false;">Notice the difference in the onsubmit value.
D.
Comments
1 comment Created about 1 month ago by harryhLift not parsing query params under some circumstancesdppxComments
1 comment Created about 1 month ago by jeppenejsumEmit warning if SessionVars are used with no Lift sessiondppxIt is possible to set/get SessionVars even when there is no Lift session active. It would be nice to get some warnings logged in these cases.
More details here: http://groups.google.com/group/liftweb/browse_thread/thread/efb58c2bd56556ef
Comments
Examples seem to broke now and then and it would be beneficial for the reader of the examples to see how lift applications can be tested automatically.
Comments
Ability to manually create Lift session during rewrite
1 comment Created about 1 month ago by jeppenejsumNormally, the Lift session is not created in the rewrite phase. It could be useful to manually force a lift session to be created.
More details here: http://groups.google.com/group/liftweb/browse_thread/thread/efb58c2bd56556ef
Comments
1 comment Created about 1 month ago by harryhMappedDouble should be able to be set from a Boxdppx
0 comments Created about 1 month ago by nuttycomRequestVarEM is broken with JTA in AJAX requests due to RequestVar persistence.nuttycomxRequestVarEM needs to use TransientRequestVar instead of RequestVar so that a new transaction is initiated on each HTTP request since transactions are scoped to the actual HTTP request by the container.
Comments
1 comment Created about 1 month ago by indrajitrmove changes:changes-validate to verify phaseindrajitrxchanges:changes-validate can be invoked in verify phase instead of waiting till pre-site phase.
Committers updating chages.xml can intercept (and fix) validation issue during the regular "mvn install" workflow.Comments
1 comment Created about 1 month ago by dchenbeckerMetaMegaProtoUser should provide a "menus" alias for "sitemap"dppx
1 comment Created about 1 month ago by dchenbeckerAdd ajaxEditable method to SHtmlderekchenbeckerxComments
dchenbecker
Fri Nov 13 15:30:18 -0800 2009
| link
Added AJAX editing to SHtml and Mapper
Closed by a371fb6
1 comment Created about 1 month ago by hoffrocketMappedString.valUnique should return one FieldErrordppx
10 comments Created about 1 month ago by harryhn.l.http.XmlResponse should take a code: IntaboisvertxPretty simple. I want to be able to send XmlResponses with a HTTP code other than 200.
Comments
Have you tried:
new XmlResponse(xml) { override val code = 202 // ACCEPTED }(Feel free to reopen if that doesn't work for you)
Ya, that will work, but something a bit more convenient seems desirable. Many other response types come with companion objects with apply() methods that take a response code. Doing the same for XmlResponse (and also, while we're at it, JsonResponse) seems reasonable.
What response would you like to send? I'm asking because there's already a lot of pre-defined response classes in the net.liftweb.http package.
You can also easily create your own customized response class by extending NodeResponse:
case class CreatedResponse(xml: Node) extends NodeResponse { def docType = Empty def code = 201 // CREATED def headers = List("Content-Type" -> "text/xml; charset=utf-8") def cookies = Nil def out = xml }I want to send an XmlResponse with a response code other than 200 (400, 401, 501 primarily). I know I can do this with this code as it, but it seems like something like this:
XmlResponse(<error>invalid parameter: foo</error>, 401)
Would be nice, simple, and generally usable.
Ok, then I'm proposing the following for the review-board:
case class XmlCodeResponse(xml: Node, code: Int) extends NodeResponse {
def docType = Empty def headers = List("Content-Type" -> "text/xml; charset=utf-8") def cookies = Nil def out = xml }(I assume we don't want to change the signature of the existing XmlResponse for backward compatibility)
Replacing the XmlResponse case class with a class that takes (xml: Node, code: Int) + a companion object with two apply methods (one that takes a code, one that doesn't) should be fine I think....
You're right. Why didn't I think of that? I already pushed my fix but I'll change it.
Here's the updated code.
class XmlResponse(val xml: Node, val code: Int, mime: String) extends NodeResponse {
def docType = Empty def headers = List("Content-Type" -> mime) def cookies = Nil def out = xml } object XmlResponse { /** Construct XmlResponse with 200 OK response code and "text/xml" mime type */ def apply(xml: Node) = new XmlResponse(xml, 200, "text/xml; charset=utf-8") /** Construct XmlResponse with given response code and "text/xml" mime type */ def apply(xml: Node, code: Int) = new XmlResponse(xml, code, "text/xml; charset=utf-8") /** Construct XmlResponse with 200 OK response code and given mime type */ def apply(xml: Node, mime: String) = new XmlResponse(xml, 200, mime) /** Construct XmlResponse with given response code and mime type */ def apply(xml: Node, code: Int, mime: String) = new XmlResponse(xml, code, mime) }Oh how much shorter this will all be when we get named + default parameters with 2.8!
2 comments Created about 1 month ago by DridusContext rewriting exclusion does not apply to JsCmds.RedirectTodppxFrom JsCommands.scala
case class RedirectTo(where: String) extends JsCmd { private val context = S.contextPath def toJsCmd = "window.location = " + S.encodeURL(context + where).encJs + ";" }It always writes the context in, so the redirect output to the browser has the context path on it even if where is excluded from context rewriting.
Comments
Here is the temporary version I'm using to work around it:
case class MyRedirectTo(where: String) extends JsCmd { private val context = S.contextPath def toJsCmd = "window.location = " + S.encodeURL(if (!LiftRules.excludePathFromContextPathRewriting.vend(where)) context + where else where).encJs + ";" }
2 comments Created about 1 month ago by benkeepingform input names change when changing Lift versionsdppxPlease see thread http://groups.google.com/group/liftweb/browse_thread/thread/1b5f84876b9d16d7
Thanks
Comments
benkeeping
Wed Nov 11 12:38:40 -0800 2009
| link
Hi,
Not sure if its the right thing to do, but basing it on the first user element in the stack might be the way to go :def locateFirstUserStackElement(stack: Array[StackTraceElement]) : StackTraceElement = {
stack.foreach(element => { if (!element.toString.startsWith("net.liftweb")) return element }) stack(0)}
def formFuncName: String = if (Props.testMode) {
val bump: Long = ((_formGroup.is openOr 0) + 1000L) * 10000L val num: Int = formItemNumber.is formItemNumber.set(num + 1) import _root_.java.text._ val prefix: String = new DecimalFormat("00000000000000000").format(bump + num) //M7 - "f" + prefix + "_" + Helpers.hashHex((new Exception).getStackTrace.toList.take(10).map(_.toString).mkString(","))) "f" + prefix + "_" +Helpers.hashHex(locateFirstUserStackElement(new Exception().getStackTrace).getFileName)} else {
_formGroup.is match { case Full(x) => Helpers.nextFuncName(x.toLong * 10000L) case _ => Helpers.nextFuncName }}
2 comments Created about 1 month ago by dppThe current TestKit APIs are hard to usedppxFor Lift-Mapper, when searching for a record, I am using findAll...
JPA makes a distinction between a single result object vs. a List of objects: http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html#getSingleResult() vs. http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html#getResultList()
Certainly, it is convenient with Scala just to call findAll() then take the head -- but a fundamental assertion is missing: when calling getSingleResult, I am expecting only one matching item -- if the List length > 1, then that is a problem!
In the mean time, I will call findAll().head to get the single result. But, I would really like it if Mapper was extended to include this concept so that I could replace it with findOne()... If more than one record returned, an exception should be thrown (or a Failure). A Box would make a lot of sense because then you have a concept for Empty.
Comments
hoffrocket
Tue Nov 10 08:25:16 -0800 2009
| link
what about just "find(key:Any)" or "find(by: QueryParam[A]*)"? both return a box.
Also, take a look at List.firstOption
derby.log file created in ${basedir} for lift-mapper
1 comment Created about 1 month ago by awhitfordAfter doing a build for lift-mapper, I see a derby.log file created in the ${basedir} (beside pom.xml, etc.). This log file was created by the unit tests. This log file should have been created in the target folder (${project.build.directory}, for example) so that a mvn clean destroys any build artifacts.
Comments
1 comment Created about 1 month ago by harryhTypo in Req.scala (very minor bug)aboisvertxMissing a space after "URL" and before "was":
private[liftweb] def defaultCreateNotFound(in: Req) =
XhtmlResponse(( The Requested URL{in.contextPath + in.uri}was not found on this server ), ResponseInfo.docType(in), List("Content-Type" -> "text/html; charset=utf-8"), Nil, 404, S.ieMode)Comments
Fixed.
commit bf31a83
Author: Alex Boisvert boisvert@intalio.com">boisvert@intalio.com
Date: Thu Nov 12 12:33:50 2009 -0800Issue 170: Typo in Req.scala
4 comments Created about 1 month ago by lopexLift should allow injecting custom driver abstractionsaboisvertxIn Driver.scala there is no way to intercept singleton method calcDriver to allow user supported driver abstractions since in DB.scala DriverType object is used explicitly.
Comments
This is not going to change in the near term. If there a particular driver you want to implement?
How about doing someting similar to Bootstrap?
We could look for a class named "net.liftweb.DriverPF", assume that it's a PartialFunction[[Tuple3[dbName,major,minor], DriverType]] and if there's a match then we use the returned DriverType, otherwise we pick according to the static list encoded in Lift.
Probably just a few lines of code.
It's a jt400 (DB2 AS/400) driver, but probably will also play with db2jcc (DB2 Z/OS).
1 comment Created about 1 month ago by awhitfordjavax.activation dependencyindrajitrxIf javax.activation is merely a transitive dependency for javax.mail, then it should not be explicitly declared in http://scala-tools.org/repo-releases/net/liftweb/lift/1.1-M7/lift-1.1-M7.pom
Note that according to this: http://java.sun.com/products/javamail/
the Activation framework dependency is not necessary for Java 6 users because it is included.See thread: http://groups.google.com/group/liftweb/browse_thread/thread/f435fd3a0ddbd08e
Comments
Remove transitive dependency javax.activation as javax.mail will pull that up. Closed by 0cac04c.
Make javax.mail version range narrow to avoid issues when Sun's repo is used by Lift based applications (avoids SNAPSHOT jar being downloaded from Sun's repo).
4 comments Created about 1 month ago by jeppenejsumaboisvertxNo scala source file in *SNAPSHOT-sources.jarindrajitrxThe *SNAPSHOT-sources.jar doesn't seem to contain any scala source files, only static resources
Comments
I'm using Maven 2.2.1 and I can't reproduce this on my machine.
I've checked that lift-util, lift-webkit and lift-common source packages (among others) all have appropriate .scala sources
jeppenejsum
Thu Nov 12 23:18:25 -0800 2009
| link
Strange again :-)
util & common seem to be ok.
If I do rm -rf ~/.m2/repository && mvn clean test && mvn eclipse:eclipse
And the search through all the source jars, these are the only files found:
find ~/.m2/repository/net/liftweb/ -name "*-sources.jar" -print|xargs -n 1 unzip -l|grep scala
6332 10-23-09 03:27 net/liftweb/actor/LiftActor.scala 1321 10-23-09 03:27 net/liftweb/actor/LAFuture.scala 2463 10-23-09 03:27 net/liftweb/actor/LAPinger.scala 1826 10-23-09 03:27 net/liftweb/common/Actor.scala 14352 10-23-09 03:27 net/liftweb/common/Box.scala 4322 10-23-09 03:27 net/liftweb/util/RE.scala 3010 10-23-09 03:27 net/liftweb/util/BindPlus.scala 7769 10-23-09 03:27 net/liftweb/util/CombParserHelpers.scala 2172 10-23-09 03:27 net/liftweb/util/VCardParser.scala 4287 10-23-09 03:27 net/liftweb/util/Lazy.scala 8053 10-23-09 03:27 net/liftweb/util/Mailer.scala 2420 10-23-09 03:27 net/liftweb/util/ThreadGlobal.scala 1333 10-23-09 03:27 net/liftweb/util/ValueHolder.scala 9586 10-23-09 03:27 net/liftweb/util/Log.scala 3264 10-23-09 03:27 net/liftweb/util/Vars.scala 3140 10-23-09 03:27 net/liftweb/util/LD.scala 11432 10-23-09 03:27 net/liftweb/util/SecurityHelpers.scala 6960 10-23-09 03:27 net/liftweb/util/ListHelpers.scala 4599 10-23-09 03:27 net/liftweb/util/Slf4jLog.scala 1749 10-23-09 03:27 net/liftweb/util/EnumWithDescription.scala 17043 10-23-09 03:27 net/liftweb/util/ClassHelpers.scala 8685 10-23-09 03:27 net/liftweb/util/HttpHelpers.scala 4074 10-23-09 03:27 net/liftweb/util/CSSHelpers.scala 3729 10-23-09 03:27 net/liftweb/util/NamedPartialFunction.scala 1628 10-23-09 03:27 net/liftweb/util/Helpers.scala 1829 10-23-09 03:27 net/liftweb/util/KeyedCache.scala 1593 10-23-09 03:27 net/liftweb/util/Misc.scala 1765 10-23-09 03:27 net/liftweb/util/LRU.scala 3272 10-23-09 03:27 net/liftweb/util/HeadHelper.scala 1159 10-23-09 03:27 net/liftweb/util/ConcurrentLock.scala 5006 10-23-09 03:27 net/liftweb/util/Maker.scala 3757 10-23-09 03:27 net/liftweb/util/ActorPing.scala 3194 10-23-09 03:27 net/liftweb/util/IOHelpers.scala 2771 10-23-09 03:27 net/liftweb/util/Currency.scala 1155 10-23-09 03:27 net/liftweb/util/LoanWrapper.scala 6887 10-23-09 03:27 net/liftweb/util/BasicTypesHelpers.scala 7399 10-23-09 03:27 net/liftweb/util/Props.scala 24153 10-23-09 03:27 net/liftweb/util/BindHelpers.scala 5490 10-23-09 03:27 net/liftweb/util/CurrencyZone.scala 6006 10-23-09 03:27 net/liftweb/util/JSON.scala 12572 10-23-09 03:27 net/liftweb/util/TimeHelpers.scala 2183 10-23-09 03:27 net/liftweb/util/CodeHelpers.scala 14901 10-23-09 03:27 net/liftweb/util/PCDataMarkupParser.scala 2030 10-23-09 03:27 net/liftweb/util/TemplateCache.scala 4660 10-23-09 03:27 net/liftweb/util/ControlHelpers.scala 3649 10-23-09 03:27 net/liftweb/util/SoftReferenceCache.scala 8809 10-23-09 03:27 net/liftweb/util/StringHelpers.scalaThis is with Maven 2.2.0, not sure if this changes anything since the jars seem to be downloaded ok?
jeppenejsum
Thu Nov 12 23:19:48 -0800 2009
| link
Also, look at the archive date of those files....
6 comments Created about 1 month ago by jeppenejsumsnapshot jars contains several Box.class fileshseebergerxThere seems to be a build issue after the reorg into common.
I can find e.g. net.liftweb.common.Box.class in both
lift-common-1.1-SNAPSHOT
lift-webkit-1.1-SNAPSHOTThis causes confusion in Eclipse when you try to find the source of a class.
Comments
jeppenejsum
Thu Nov 12 12:54:59 -0800 2009
| link
Strange...I've just done this in a directory with the basic archetype (1.1-SNAPSHOT):
rm -rf ~/.m2/repository/
mvn clean compileunzip -l ~/.m2/repository/net/liftweb/lift-webkit/1.1-SNAPSHOT/lift-webkit-1.1-SNAPSHOT.jar |grep Box
3995 11-11-09 11:58 net/liftweb/common/Box$.class 8461 11-11-09 11:58 net/liftweb/common/Box.class 2520 11-11-09 11:58 net/liftweb/common/EmptyBox.class 1636 11-11-09 12:02 net/liftweb/http/FirstBox$class.class 741 11-11-09 12:02 net/liftweb/http/FirstBox.classunzip -l ~/.m2/repository/net/liftweb/lift-common/1.1-SNAPSHOT/lift-common-1.1-SNAPSHOT.jar |grep Box
3995 11-11-09 11:58 net/liftweb/common/Box$.class 8461 11-11-09 11:58 net/liftweb/common/Box.class 2520 11-11-09 11:58 net/liftweb/common/EmptyBox.classBasically, it seems all the contents of lift-common.jar is included in lift-webkit.jar
Ok, my bad. I was just looking at the target/classes directories. Looking in the generated .jars I can see the same as you.
hseeberger
Thu Nov 12 23:26:08 -0800 2009
| link
It's a problem with the configuration of the maven-bundle-plugin. Fixing should be easy.
hseeberger
Fri Nov 13 08:58:49 -0800 2009
| link
Commit 1e940f5
Fixed.
commit 18a0cc1
Author: Heiko Seeberger heiko.seeberger@googlemail.com">heiko.seeberger@googlemail.com
Date: Fri Nov 13 09:37:45 2009 +0100Issue 166: Snapshot jars contains several Box.class files
1 comment Created about 1 month ago by jeanadrienMappedForeignKey : Access to .obj field after updatedppx- Module
- Mapper
- Request
- When updating the referenced object in a MappedForeignKey column, the .is field returns the new value of the id, but the .obj field still returns the reference of the object originally loaded with the owner. The .is and .obj should be coherent.
- Example
-
val testUser : User = User.find(By(User.id, 1)).open_! val testAddress = testUser.homeAddress.obj; Log.debug("Current FK id is "+testUser.homeAddress.is) // returns 1 testAddress match { case Full(addr) => val anotherAddr : Address = Address.find(By(Address.id,2)).open_! Log.debug("There was an address: "+addr+". Replace it with addr id#2: "+anotherAddr); testUser.homeAddress(anotherAddr).save case _ => [...] } val retestAddress = testUser.homeAddress.obj Log.debug("Now obj is "+retestAddress); // returns a Box with the old address (id == 1) Log.debug("And is is "+testUser.homeAddress.is) // returns 2 - See
- http://groups.google.com/group/liftweb/browse_thread/thread/0041894ec33fc538/0bcb1a85658155af?hl=en#0bcb1a85658155af
Regarding to this thread
Comments
1 comment Created about 1 month ago by DridusdppxS.notice, S.error, etc. broken from within AJAX/JSON callsOn Review BoardxI had some code working where the snippet generates a JSON callback which uses S.notice / S.error to push notifications back to the browser in addition to whatever JS commands the snippet decides to push down, but it seems that this is now broken in 1.1-SNAPSHOT and 1.1-M7. I can confirm that just after I call S.notice within the jsonCall that S.getNotices has the proper thing in it, but by the time LiftRules.noticesToJsCmd gets called it has vanished.
I've created a modified lift-archetype-blank that demonstrates the behavior at http://www.github.com/dridus/test-missing-notices -- here is a overview of the code:
In template:
<lift:surround with="default" at="content"> <lift:helloWorld.callback /> <h2>Welcome to your project!</h2> <p> </p> <lift:Msgs /> <button onclick="testCallback()">Click me</button> </lift:surround>In Boot:
val oldNoticesToJsCmd = LiftRules.noticesToJsCmd LiftRules.noticesToJsCmd = () => { println("at noticesToJsCmd: S.getNotices = " + S.getNotices) oldNoticesToJsCmd() }In snippet:
class HelloWorld extends DispatchSnippet { val dispatch: DispatchIt = { case "callback" => renderCallback _ } def renderCallback(ns: NodeSeq): NodeSeq = { S.notice("this is the test notice from the snippet") <head>{ Script { Function("testCallback", Nil, jsonCall(JsNull, (_: Any) => { S.notice("this is the test notice from the callback") println("in callback: S.getNotices = " + S.getNotices) Noop })._2) } }</head> } }The output from this on the command line is:
INFO - Service request (GET) / took 570 Milliseconds INFO - Service request (GET) /classpath/jquery.js took 15 Milliseconds INFO - Service request (GET) /ajax_request/liftAjax.js took 8 Milliseconds in callback: S.getNotices = List((net.liftweb.http.NoticeType(0),this is the test notice from the snippet,Empty), (net.liftweb.http.NoticeType(0),this is the test notice from the callback,Empty)) at noticesToJsCmd: S.getNotices = List() INFO - Service request (POST) /ajax_request/F1007892194776GPS/ took 59 MillisecondsAnd no notice appears.
Comments
1 comment Created about 1 month ago by jsuerethLift pom needs to be updated for new scala-tools.org hudson policies.indrajitrxLift's pom needs to be changed for the new nexus/hudson policies on scala-tools.org. I have a forked repo (jsuereth/liftweb) with the changes (also shown below):
--- a/pom.xml +++ b/pom.xml @@ -806,16 +806,16 @@ hudson - hudson.scala-tools.org - file:///home/scala-tools.org/www/repo-snapshots + nexus.scala-tools.org + http://nexus.scala-tools.org/content/repositories/releases - hudson.scala-tools.org - file:///home/scala-tools.org/www/repo-snapshots + nexus.scala-tools.org + http://nexus.scala-tools.org/content/repositories/snapshots false - hudson.scala-tools.org + nexus.scala-tools.org file:///home/scala-tools.org/www/mvnsites-snapshots/liftwebComments
1 comment Created about 1 month ago by dppAutomated tests for all archetypesindrajitrxI just noticed OrderBy statements cause Inner selects to break in h2:
I query such as: User.findAll(In(User.id, Dog.owner, OrderBy(Dog.name,
Ascending)), MaxRows(5))Produces:
Message: org.h2.jdbc.JdbcSQLException: Order by expression NAME must
be in the result list in this case; SQL statement:
SELECT DISTINCT OWNER AS _0
FROM PUBLIC.DOG / PUBLIC.DOG_TABLE_SCAN /
ORDER BY =NAME [90068-117]Code to duplicate here:
http://github.com/hoffrocket/lift_1_1_sample/commit/0093e2585e0d9d799b503f32da7496e212efd873
This works in M5. Any chance a workaround or fix could be put out
before M7? Sorry, I didn't notice until today.Comments
1 comment Created about 1 month ago by dppImplement Wizard multi-screen input formsdppx
1 comment Created about 1 month ago by dppUpgrade Lift to build against Specs 1.6.1dppx
1 comment Created about 1 month ago by hseebergerMappedPassword contains misspelled key for unset passwordhseebergerxpassword.must.set should be password.must.be.set, the later is in lift-core.properties
Comments
hseeberger
Tue Nov 03 23:38:22 -0800 2009
| link
Commit 81ebc75
3 comments Created about 1 month ago by econoplasJPADemo update pom dependencies hibernate-em 3.4.0GA and slf4jindrajitrxOpening an issue at Indrajit's request to update JPADemo/spa/pom.xml to use a newer version of hibernate-entitymanager 3.4.0.GA and resolve slf4j-1.4.2 impl dependencies.
The hibernate-entitymanager 3.4.0.GA version update causes an update to hibernate-core to 3.3.0.SP1 which fixes auto-increment column problem with MySQL and H2 databases, which was present in the older hibernate 3.2.4 (which dated back to before they called it hibernate-core) upon which hibernate-entitymanager 3.3.1 was depending.
Below is the configuration that worked for me.
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.4.0.GA</version> <exclusions> <exclusion> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.4.2</version> </dependency>Had to manually install slf4j-simple/1.4.2 into to my local maven repo to avoid runtime exception for missing org.slf4j.impl.StaticLoggerBinder. By putting the slf4j-simple dependency in the spa/pom.xml this allows users to swap out different impl providers (for example slf4j-log4j12) as they see fit, in fact it might not hurt to have an example of switching this over to slf4j-log4j12 or some other provider, perhaps even commented out just below the other one right in the pom.xml such as:
<!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.4.2</version> </dependency> -->Thanks! Troy
Comments
Per Chris's suggestion, I updated the dependency in my description from slf4j-nop to slf4j-simple as that probably makes more sense for most users.
Thank you for super awesome ticket!
Fix on ReviewBoard: http://reviewboard.liftweb.net/r/90/
1 comment Created about 1 month ago by dppMapper's view bounds and conversions to Unit don't mixdppxMappedField's apply methods take view bounds. This causes a nasty interaction with Scala's mechanism for converting to Unit. So:
val u: Unit = myModel.myForiegnKeyField(1L) // causes problems
Fix: concrete apply method without view bound conversion.
Comments
2 comments Created 2 months ago by awhitfordPlease update documentation for MsgsaboisvertxThe documentation suggests that certain elements (like error_class) can be overridden. But I did it using:
<lift:Msgs> <lift:error_class>errorBox</lift:error_class> </lift:Msgs>I'm guessing that the <lift:snippet type="error_report"> is dated?
Comments
P.S. I was really trying to add a class to the <ul> elements (because I am trying to work around an iWebKit bug). Unfortunately, that doesn't look possible.
1 comment Created 2 months ago by jeppenejsumajax-loader not showing during ajax requestsdppxComments
1 comment Created 2 months ago by econoplasdppxMapper MySQLSyntaxErrorException (related to issue #145)Work In ProgressxSorry, unfortunately after issue # 145 fix... I think we have a different kind of breakage now...
Message: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'project_type.val5' in 'field list'
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) com.mysql.jdbc.Connection.execSQL(Connection.java:3283) com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332) com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1467) net.liftweb.mapper.DB$$anonfun$exec$3.apply(DB.scala:323) net.liftweb.mapper.DB$$anonfun$exec$3.apply(DB.scala:322) net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:242) net.liftweb.util.Helpers$.calcTime(Helpers.scala:30) net.liftweb.mapper.DB$.exec(DB.scala:322)net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1$$anonfun$apply$9.apply(MetaMapper.scala:334)
net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1$$anonfun$apply$9.apply(MetaMapper.scala:332) net.liftweb.mapper.DB$.runPreparedStatement(DB.scala:405)I think this happens because my database server (MySQL 5) is case sensitive for column and table names by default, and in this case my table & column name is actually PROJECT_TYPE.val5.
I think we probably always want to preserve the original case of the overridden dbTableName and dbColumnName in SQL statements that you generate so the user can always override & get the right behavior in the resulting SQL.
I think your fix is on the right track though. You probably want to lookup column names using case sensitive search first, then case insensitive search, using an algorithm similar to the following very hackerish pseudo-code (my apologies):
colIndex = findColIndex(colName, columns.fieldName for all prepStmt.columns) orElse findColIndex(colName.lower, columns.fieldName.lower for all prepStmt.columns) orElse -1 value = columns(colIndex)Which would find an exact case match first (for those databases that allow a user to have MyCol1 and mycol1 both in the same table), and then fallback to a case insensitive match, and if that failed... throw some sort of column not found exception or return a null.
I may be way off base, and if so feel free to ignore the suggestion if that leads us on another goose chase.
Thanks, Troy
Comments
1 comment Created 2 months ago by dppdppxConnections never take from poolOn Review BoardxComments
0 comments Created 2 months ago by mariusdanciumariusxAjax and JSON forms do not work well when submitting from JS ...On Review BoardxTim ran into this crappy behavior when calling submit() function on a form the onsubmit event doesn't actually get called. Apparently this is a known browser behavior.
I propose to have alternative helpers in SHtml calls where we feed say the form ID and the actual Ajax call happens immediately outside of onsubmit context. For instance
Assume <form id="login"> ... </form>
Somewhere in a bind we have
<button onclick={submitJsonForm(jsonHandler, "login")}>Press me </button>
def submitJsonForm(jsonHandler: JsonHandler, formId: String): JsCmd = {
jsonHandler.call("processForm", FormToJSON(formId)) }a similar concept for ajaxForms ...
haven't compiled it but you get the idea ...
Br's,
MariusComments
SHtml.ajaxForm should take an optional postSubmit JsCmd
1 comment Created 2 months ago by dchenbeckerThis would allow client-side processing or updates after the form is submitted.
Comments
dchenbecker
Fri Nov 13 08:01:24 -0800 2009
| link
Add ability to call JS code after AJAX form submit
Closed by 2eee0e8
2 comments Created 2 months ago by nafgdppxS.setSnippetForClass does not survive subsequent requests (at least not called from user code)On Review BoardxS.setSnippetForClass does not survive subsequent requests (at least not called from user code) when the same page is reloaded, even via an SHtml.submit button, even if registerThisSnippet is called. Calling setSnippetForClass("name", this) in the submit function works.
To reproduce:
Put in some template:
<lift:MyTestSnippet />Put in some other screen:
def test = {
class Test extends StatefulSnippet {println("Test is now being instantiated!") def dispatch = { case _ => render _ } def render(xhtml: NodeSeq) = SHtml.submit("Submit test", () => {} )} } and
SHtml.link("pathToFirstTemplate", () => S.setSnippetForClass("MyTestSnippet", new Test), Text("A link") )
Comments
Adding println(names) in the submit function (even after calling S.setSnippetForClass)
prints Set().
On the other hand if the snippet was instantiated by Lift then it prints as expected (in my case Set(Clients).
Reference: http://groups.google.com/group/liftweb/browse_thread/thread/e5937eae509ca0ff
Cause: Build plugin settings aren't picked up from reporting plugin
settings unless that appears in <build><plugin/></build>.Comments
1 comment Created 2 months ago by econoplasdppxdbColumnName problem in Mapper, schemify, CRUDify in 1.1-M6 and 1.1-SHAPSHOTOn Review Boardx--- META-QUESTION: How do I attach my project file to this issue?
I created a new scaled down project against 1.1-SNAPSHOT and an embedded Derby database, and it exhibits the following problems for fields with dbColumnName overridden:
Mapper returns the default value all the time both in the CRUDify screen and my own custom screen (click Proj Type List menu item in supplied sample app).
schemify tries to ALTER TABLE to add the columns that override dbColumnName a second time, and of course fails with duplicate column name exception.
CRUDify gets confused when I use a ' def primaryKeyField = projectTypeId' and when projectTypeId uses 'override def dbColumnName = 'PROJECT_TYPE_ID" (see complete DDL below) where it creates all the links in the "List" page with '-1' for the ID such as /PROJECT_TYPE/view/-1 or /PROJECT_TYPE/edit/-1 instead of the proper PROJECT_TYPE_ID such as .../view/1 or .../edit/1. I think it's because these are all coming back as -1 from the Mapper.
Below is schemify's DDL output and stack trace.
INFO - CREATE TABLE todo (priority INTEGER , id BIGINT NOT NULL AUTO_INCREMENT ,
desc_c VARCHAR(128) , done BOOLEAN , owner BIGINT) INFO - ALTER TABLE todo ADD CONSTRAINT todo_PK PRIMARY KEY(id)
INFO - CREATE TABLE PROJECT_TYPE (ACTIVE BOOLEAN , val4 VARCHAR(128) , val3 VARC
HAR(128) , val2 INTEGER , val1 BIGINT , LAST_MODIFIED_BY VARCHAR(30) , GUI_PROJE
BOOLEAN , GUI_TREE_VISIBLE BOOLEAN , GUI_NAME VARCHAR(25) , type name VARCHAR(25) , create_date TIMESTAMP , PROJECT_TYPE_ID BIGINT NOT NULL AUTO
INCREMENT)
INFO - ALTER TABLE PROJECT_TYPE ADD CONSTRAINT PROJECT_TYPE_PK PRIMARY KEY(PROJE
) INFO - ALTER TABLE PROJECT_TYPE ADD COLUMN ACTIVE BOOLEAN
ERROR - Failed to Boot
org.h2.jdbc.JdbcSQLException: Duplicate column name ACTIVE; SQL statement:---> ALTER TABLE PROJECT_TYPE ADD COLUMN ACTIVE BOOLEAN [42121-121]
at org.h2.message.Message.getSQLException(Message.java:106) at org.h2.message.Message.getSQLException(Message.java:117) at org.h2.message.Message.getSQLException(Message.java:76) at org.h2.table.Table.setColumns(Table.java:336) at org.h2.table.TableData.<init>(TableData.java:82) at org.h2.schema.Schema.createTable(Schema.java:492) at org.h2.command.ddl.AlterTableAlterColumn.copyData(AlterTableAlterColumn.java:256)
at org.h2.command.ddl.AlterTableAlterColumn.update(AlterTableAlterColumn.java:162)
at org.h2.command.CommandContainer.update(CommandContainer.java:72) at org.h2.command.Command.executeUpdate(Command.java:208) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:162) at net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier$$maybeWrite(Schemifier.scala:151)
at net.liftweb.mapper.Schemifier$$anonfun$6$$anonfun$apply$10.apply(Schemifier.scala:207)
at net.liftweb.mapper.Schemifier$$anonfun$6$$anonfun$apply$10.apply(Schemifier.scala:206)
at scala.List.foreach(List.scala:841) at net.liftweb.mapper.Schemifier$$anonfun$6.apply(Schemifier.scala:205) at net.liftweb.mapper.Schemifier$$anonfun$6.apply(Schemifier.scala:187) at scala.List.flatMap(List.scala:1132) at net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier$$ensureColumns(Schemifier.scala:186)
at net.liftweb.mapper.Schemifier$$anonfun$schemify$1$$anonfun$2.apply(Schemifier.scala:62)
at net.liftweb.mapper.Schemifier$$anonfun$schemify$1$$anonfun$2.apply(Schemifier.scala:62)
at scala.List.foldLeft(List.scala:1066) at net.liftweb.mapper.Schemifier$$anonfun$schemify$1.apply(Schemifier.scala:62)
at net.liftweb.mapper.Schemifier$$anonfun$schemify$1.apply(Schemifier.scala:55)
at net.liftweb.mapper.DB$.use(DB.scala:419) at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:54) at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:37) at bootstrap.liftweb.Boot.boot(Boot.scala:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:409)
at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:407)
at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply(LiftRules.scala:1188)
at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply(LiftRules.scala:1188)
at net.liftweb.common.Full.map(Box.scala:330) at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1188) at net.liftweb.http.provider.HTTPProvider$class.bootLift(HTTPProvider.scala:70)
at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:516) at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init(ServletFilterProvider.scala:20)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:516) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)Comments
2 comments Created 2 months ago by andythedestroyerProblem splitting last "." when parsing path.dppxHere is a post in the groups regarding the issue.
http://groups.google.com/group/liftweb/browse_thread/thread/fc7244ce54f1768e
I need to parse a path in the following format.
http://domain.com/api/package/my.company.package%3Akey%3DvalueThe following should extract "my.company.package:key=value" into my packageName var
case Req(List("api","package", packageName), _, GetRequest)
It doesn't; only "my" is extracted.
-Andy
Comments
2 comments Created 2 months ago by harryhdppxbad interaction between hostname and path based url rewritesOn Review Boardxrewrite generated parameters are incorrectly disappearing
http://groups.google.com/group/liftweb/browse_thread/thread/e2096c889eb32060
Comments
1 comment Created 2 months ago by dppdppxUpgrade Lift to Scala 2.7.7 finalOn Review Boardx
1 comment Created 2 months ago by dppdppxSimplify certain factory signatures in LiftRulesOn Review BoardxAllow the registration by name of stateful snippets.
Also make the snippetName publicly readable in StatefulSnippet
Comments
More flexibility for pre-defining stateful snippets. Closed by 111e011
Is it a good idea to have a method with such a common name -- "names" -- in a trait used heavily in userland? Does it constitute a breaking change -- if someone defined a PeopleSnippet with a method "names" it won't compile. Added 'override' may allow it to compile but will break Lift's usage of it (if any).
Shouldn't it be something more domain-scoped like "snippetNames"?
Unfortunately I wasn't able to watch it on Review Board, as I have explained.
1 comment Created 2 months ago by nuttycomnuttycomxSitemapxType safety enhancements for LocWork In ProgressxAs discussed on the mailing list, it would be advantageous to:
- Add a type parameter to the base LocParam trait to allow for safety in the association between typeful LocParam instances such as Title and the type parameter of the Loc.
- Remove the overloading of "Param" that currently refers both to LocParam and the value associated with a Loc (potentially provided by a default or rewrite rule)
- Add data-aware instances of If, Unless, and Template LocParams
- Make LocParam a sealed trait with a well-defined extension point to help the compiler catch possible incomplete match statements.
Comments
Lift should warn about unread RequestVars in dev mode
1 comment Created 2 months ago by dchenbeckerThis should be relatively simple to add and may catch some logic errors
Comments
dchenbecker
Thu Oct 29 08:01:24 -0700 2009
| link
Added dev mode warning for set+unused RequestVars
This is added as a possible catch for logic errors in dev mode,
particularly with snippets that communicate with RVs and the
new lazy-load functionality.Closed by bb2e656
1 comment Created 2 months ago by dppUpgrade Specs & ScalaCheck to latest versiondppxPreCache and OrderBy not working for Derby
1 comment Created 2 months ago by hseebergerThe following code using PreCache and OrderBy will cause the below exception on Derby 10.4.2.0
def upcoming(n: Int) = findAll(By_>(date, now),
PreCache(team1), PreCache(team2), OrderBy(date, Ascending), OrderBy(group, Ascending), MaxRows(n))Message: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "ORDER" at line 1, column 213.
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) org.apache.derby.client.am.Connection.prepareStatement(Unknown Source) net.liftweb.mapper.DBLog$.prepareStatement(LoggingStatementWrappers.scala:75) net.liftweb.mapper.DB$.prepareStatement(DB.scala:321) net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply(MetaMapper.scala:330) net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply(MetaMapper.scala:322) net.liftweb.mapper.DB$.use(DB.scala:397) net.liftweb.mapper.MetaMapper$class.findMapFieldDb(MetaMapper.scala:321) com.weiglewilczek.kix.model.Team$.findMapFieldDb(Team.scala:29) net.liftweb.mapper.MetaMapper$class.findMapDb(MetaMapper.scala:317) com.weiglewilczek.kix.model.Team$.findMapDb(Team.scala:29) net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:283) com.weiglewilczek.kix.model.Team$.findAll(Team.scala:29) net.liftweb.mapper.MetaMapper$$anonfun$dealWithPrecache$1.apply(MetaMapper.scala:250) net.liftweb.mapper.MetaMapper$$anonfun$dealWithPrecache$1.apply(MetaMapper.scala:229) scala.Iterator$class.foreach(Iterator.scala:414) scala.runtime.BoxedArray$AnyIterator.foreach(BoxedArray.scala:45) scala.Iterable$class.foreach(Iterable.scala:256) scala.runtime.BoxedArray.foreach(BoxedArray.scala:24) net.liftweb.mapper.MetaMapper$class.dealWithPrecache(MetaMapper.scala:229) net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:283)Comments
I pulled dpp/liftweb today (last commit f29555d) and tried to build the flot demo in lift-examples/flotDemo on github.com/dpp/liftweb. However, it won't compile because of the following errors:
lift/lift-examples/flotDemo/src/main/scala/net/liftweb/flot_demo/web/
comet/FlotCometExample.scala:34: error: type mismatch;
found : net.liftweb.flot_demo.web.comet.FlotCometExample required: scala.actors.ActorSensor.acum !? AddListener(this) match { ^lift/lift-examples/flotDemo/src/main/scala/net/liftweb/flot_demo/web/
comet/FlotCometExample.scala:50: error: type mismatch;
found : net.liftweb.flot_demo.web.comet.FlotCometExample required: scala.actors.ActorSensor.acum ! RemoveListener(this) ^two errors found
I assume this is related to the switch of CometActor to LiftActor.
Comments
1 comment Created 2 months ago by jeppenejsumCapture custom snippet context for ajax requestsdppxWhen rendering ajax requests, the normal SiteMap context is not available, which means dynamic snippets are not rendered. Details here:
http://groups.google.com/group/liftweb/browse_thread/thread/b43ce1948fc8d025#
Comments
1 comment Created 2 months ago by dppIn LoggingStatementWrappers, the wrong values are always returneddppxthe proxy stuff in LoggingStatementWrappers returns the result of paramMap += rather than the result of chain. The chain() call should always be the last in the block
Comments
1 comment Created 2 months ago by jeppenejsumDB Connections should only be acquired when neededdppxComments
1 comment Created 2 months ago by indrajitrStreamline and enrich project build models (pom.xml)indrajitrxInitial action items to start with:
Cleanup and document (inline) the various pom.xml starting with the top level pom.xml
Make better use of and and have much smaller pom.xml OOTB.
Use Maven's model hierarchy and transitive dependencies. Prefer version range for dependencies
Ensure consistent sourceEncoding (default to UTF-8)
Comments
Following up on the restructuring proposal initially put up 1 and the subsequent second round 2 summing up the discussion in 1 and 2, split the codebase broadly into:
- lift-base (lift-common, lift-util, lift-json, lift-actor,lift-webkit)
- lift-persistence (lift-mapper, lift-record, lift-jpa)
- lift-modules (all other packages excluding examples and archetypes)
- lift-archetypes
- lift-examples
- lift-varia (installer, presentations etc.)
Comments
Comments
1 comment Created 2 months ago by dchenbeckerdppxDB.runQuery isn't ConnectionIdentifier-awareMapperx
4 comments Created 2 months ago by jeppenejsumDefault archetype ConnectionManager implementation is brokendppxThe DBVenvdor generated by the archetypes seems broken.
Details here: http://groups.google.com/group/liftweb/msg/de430a256aad5a15
Comments
jeppenejsum
Mon Oct 26 12:56:44 -0700 2009
| link
Just noticed this fix. It seems ProtoDBVendor, while better, still leaks:
Connections are never removed from pool, only added whenever a connection is released.
jeppenejsum
Thu Oct 29 05:50:25 -0700 2009
| link
But note that the "pool" list still keeps growing: Connections are never removed, but always added on release
1 comment Created 2 months ago by hseebergerEnhance Msgs snippet to optionally show all messageshseebergerxThe Msgs built-in snippet will only display messages NOT related to a particular field. This makes using some of the ProtoUser's templates a tough job, e.g. for editing the user or changing the password, because these will bring up errors with and without relation to fields.
This change will add an optional attribute showAll to the Msgs element which lets Msgs display all messages if set to true.
Comments
hseeberger
Fri Oct 23 00:32:00 -0700 2009
| link
Commit d8ed488
1 comment Created 2 months ago by dchenbeckerdppxMetaMegaProtoUser.loginFirst should handle query params in the requested URIMapperx
1 comment Created 2 months ago by tweeknet.liftweb.widgets.autocomplete in version 1.1-M6dppxComments
1 comment Created 2 months ago by harryhMisspelling in field name in ProtoExtendedSessiondppxexperation is wrong
should be expirationhttp://groups.google.com/group/liftweb/browse_thread/thread/f4372b863f369a59
Comments
to reproduce, change the "howdy" function in the Lift archetype to:
def howdy = { System.out.println("FOO") 0 }; // <span>Welcome to hyperview at {new _root_.java.util.Date()}</span>invoke http://localhost:8080/, and you'll see the following in the logfile:
FOO WARN - Snippet Failure: SnippetFailure(/ -> ParsePath(List(index),,true,false),Full(helloWorld.howdy),Method Not Found)
either the method should not be invoked because the signature is wrong (therefore not emitting "FOO"), or the error message to be changed to say that the method was found, but the signature is incorrect.
Comments
Please use Lift 1.1-M6 or 1.1-SNAPSHOT. The error reporting in 1.1 is much, much better than 1.0
3 comments Created 2 months ago by hseebergerMisspelled Key "pasword.changed" in ProtoUser.scalahseebergerxA correct key password.changed is already used in ProtoUser.scala and lift-core.properties.
Comments
hseeberger
Mon Oct 19 01:52:19 -0700 2009
| link
There are some more occourences of "pasword" where there is no matching key in lift-core.properties. Will correct all in both places!
hseeberger
Mon Oct 19 02:02:46 -0700 2009
| link
Fixed in commit 2559f8b
hseeberger
Mon Oct 19 22:37:38 -0700 2009
| link
Reviewed positively and merged into master.
Comments
hseeberger
Mon Oct 19 01:38:21 -0700 2009
| link
Fixed in commit f96ca40
hseeberger
Mon Oct 19 22:37:54 -0700 2009
| link
Reviewed positively and merged into master.
2 comments Created 2 months ago by hseebergerLost password submit button is not rendered correctlyhseebergerxInstead of a standard button some strange "text input like thing" is rendered (at least on Safari) on the "Lost Password" form. This is due to the fact, that in ProtoUser.scala the type of the input is "Submit" instead of "submit" (worng case).
Comments
hseeberger
Mon Oct 19 01:39:03 -0700 2009
| link
Fixed in commit fb18372
hseeberger
Mon Oct 19 22:37:47 -0700 2009
| link
Reviewed positively and merged into master.
1 comment Created 2 months ago by nafgMail should not be multipart when unnecessaryderekchenbeckerx
1 comment Created 2 months ago by luikoredppxupdate lift-openid 's dependency of openid4java to a newer versionOn Review BoardxCurrently lift-openid is using openid4java 0.9.3, which is a little
old and is difficult to find a maven repository to download.I think changing lift-openid's pom with a newer one, like
openid4java-0.9.5 will be better. (works fine on my machine)Comments
0 comments Created 2 months ago by dppSupport for type parameters in collections for JSON deserializationjonixhttp://groups.google.com/group/liftweb/browse_frm/thread/d3430bf7e3c54e80?hl=en#
case class Foo[T](x: String)
case class MustDeserialize(lst: List[Foo[_]])
val test = MustDeserialize(Nil)
read(swrite(test)) must_== test
It would also be good to serialize the class name of a class so that it can be deserialized without any description of the type.
Comments
Unexpected behavior: Snippet Inheritance not respected
1 comment Created 2 months ago by kjetilvI have an abstract snippet class A, and a subclass B. A defines some methods that are referenced from the view, so the view will say, essentially <lift:B.methodInA/>
This doesn't work, unless I define the following in B:
override def methodInA(html: NodeSeq) = super.methodInA(html)
Obviously a hole in the reflection logic, unless it is meant to be this way? If I am supposed to use traits (which I haven't tried yet), it would be nice if the error message pointed that out.
All I can say is, I expected this to work.
Comments
1 comment Created 2 months ago by jeppenejsumDefault FieldIdentifier should be the fieldname, not Emptydppx
1 comment Created 2 months ago by DridusexcludePathFromContextPathRewriting does not apply to Location: header from RedirectResponsedppxRelated to http://github.com/dpp/liftweb/issues/closed/#issue/83
With this code:
LiftRules.excludePathFromContextPathRewriting.default.set(() => path => { path.startsWith("/wombat") }) ... RedirectResponse("/wombat/frizzleboz")And a context path of "/myapp"
The HTTP response generated has Location: /myapp/wombat/frizzleboz
But should have /wombat/frizzlebozMarius says, in http://groups.google.com/group/liftweb/browse_thread/thread/75dc28fce1e4a0fc :
I think this is caused by LiftServlet#sendResponse#fixHeaders code.
Can you please open a ticket or re-open the existent one? I'll fix it
if Dave doesn't do it faster.Br's,
Marius
Comments
1 comment Created 2 months ago by harryhSHtml.link assume to url has no parametersdppx
1 comment Created 2 months ago by harryhelements aren't properly bound inside a <select>dppxIn this <stats:options/> is not bound:
<select name="days"> <stats:options/> </select>
but if I change it to this, the bind works fine (but I no longer have a proper )
<div> <stats:options/> </div>
in my controller I have:
def options(xhtml: NodeSeq): NodeSeq = {
<option value="7">week</option><option value="30">month</option> }bind("stats", xhtml, "options" -> options _)
Comments
2 comments Created 2 months ago by tobihajaxForm executes onSubmit parameter after form transmissiondppxajaxForm(...) with onSubmit parameters execute the JsCmd after serialization of the form.
For an example see:
http://groups.google.com/group/liftweb/browse_thread/thread/1fd366c218b8a8e5Comments
0 comments Created 2 months ago by mariusdanciumariusxComet broken when turning off cookies from containerWork In ProgressxThis is about: http://groups.google.com/group/liftweb/browse_thread/thread/330bc420bfc32ea1?hl=en
Found the problem working on it.
Marius
Comments
1 comment Created 2 months ago by dchenbeckerderekchenbeckerxMapper is double loggingMapperxComments
dchenbecker
Thu Oct 22 07:42:43 -0700 2009
| link
Fixed by fb891ea
But JavaScript (and I don't think JSON) does not.
From JsCommands.scala
trait JsObj extends JsExp {
def props: List[(String,JsExp)]
def toJsCmd = props.map{case (n, v) => n.encJs+": "+v.toJsCmd}.mkString("{", ", ", "}")
def +*(other: JsObj) = {
val np = props ::: other.props new JsObj { def props = np }}
}...
object JsObj {
def apply(members: (String, JsExp)*): JsObj = new JsObj { def props = members.toList }}
Comments
FWIW json object do, in fact, require string keys. See http://json.org/
Allow mapper fields to be defined as val, lazy val, object or even private[this] var/def
Comments
The documentation for MetaData indicates that when the attribute list is empty, it should be scala.xml.Null (not null). Block quotes and footnotes return an element with a null attribute list:
(TextileParser.toHtml("bq. Block quote") \ "p").map(_.attributes).first
Here's a short patch:
--- lift-textile/src/main/scala/net/liftweb/textile/TextileParser.scala Fri Oct 9 23:22:53 2009 +++ lift-textile_patch/src/main/scala/net/liftweb/textile/TextileParser.scala Fri Oct 9 23:22:37 2009 @@ -995,7 +995,7 @@ case class BlockQuote(elems : List[Textile], attrs : List[Attribute]) extends ATextile(elems, attrs) { override def toHtml : NodeSeq = { - val par : NodeSeq = XmlElem(null, "p", null, TopScope, flattenAndDropLastEOL(elems) : _*) ++ Text("\n") + val par : NodeSeq = XmlElem(null, "p", Null, TopScope, flattenAndDropLastEOL(elems) : _*) ++ Text("\n") XmlElem(null, "blockquote", fromStyle(attrs), TopScope, par : _*) ++ Text("\n") } } @@ -1023,7 +1023,7 @@ case class Footnote(elems : List[Textile], attrs : List[Attribute], num : String) extends ATextile(elems, attrs) { override def toHtml : NodeSeq = { XmlElem(null, "p", fromStyle(AnyAttribute("id", "fn"+num) :: attrs), TopScope, - (XmlElem(null, "sup", null, TopScope, Text(num) : _*) :: flattenAndDropLastEOL(elems)) : _*) ++ Text("\n") + (XmlElem(null, "sup", Null, TopScope, Text(num) : _*) :: flattenAndDropLastEOL(elems)) : _*) ++ Text("\n") } }Comments
1 comment Created 2 months ago by dppdppxBinding a snippet in a comet actorOn Review BoardxThe lazy rendering of the Comet Updates causes problems
Comments
3 comments Created 2 months ago by hoffrocketdppxPreCache broken under H2 (possibly others) when used with OrderByWork In Progressxsomething like this: Bar.findAll(PreCache(Bar.foo), OrderBy(Bar.created_at))
org.h2.jdbc.JdbcSQLException: Order by expression CREATED_AT must be
in the result list in this case; SQL statement:
SELECT DISTINCT foos.id, foos.name FROM foos WHERE id IN (SELECT
foo_id FROM bars WHERE (created_by = ?) ORDER BY created_at DESC
LIMIT 100 ) [90068-117]
at org.h2.message.Message.getSQLException(Message.java:105) at org.h2.message.Message.getSQLException(Message.java:116) at org.h2.message.Message.getSQLException(Message.java:75) at org.h2.command.dml.Query.initOrder(Query.java:323) at org.h2.command.dml.Select.init(Select.java:637) at org.h2.command.Parser.parseSelect(Parser.java:1343) at org.h2.command.Parser.parsePrepared(Parser.java:394) at org.h2.command.Parser.parse(Parser.java:290) at org.h2.command.Parser.parse(Parser.java:262) at org.h2.command.Parser.prepare(Parser.java:204) at org.h2.engine.Session.prepare(Session.java:400) at org.h2.engine.Session.prepare(Session.java:387) at org.h2.table.TableView.recompileQuery(TableView.java:70) at org.h2.table.TableView.initColumnsAndTables(TableView.java:83) at org.h2.table.TableView.<init>(TableView.java:60) at org.h2.table.TableView.createTempView(TableView.java:340) at org.h2.expression.ConditionInSelect.optimizeInJoin(ConditionInSelect.java:150)
at org.h2.command.dml.Select.prepare(Select.java:725) at org.h2.command.CommandContainer.recompileIfRequired(CommandContainer.java:62)
at org.h2.command.CommandContainer.query(CommandContainer.java:78) at org.h2.command.Command.executeQueryLocal(Command.java:142) at org.h2.command.Command.executeQuery(Command.java:123) at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:99)
at net.liftweb.mapper.DB$$anonfun$exec$3.apply(DB.scala:295) at net.liftweb.mapper.DB$$anonfun$exec$3.apply(DB.scala:294) at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241) at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29) at net.liftweb.mapper.DB$.exec(DB.scala:294) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1$$anonfun$apply$9.apply(MetaMapper.scala:317)
at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1$$anonfun$apply$9.apply(MetaMapper.scala:315)
at net.liftweb.mapper.DB$$anonfun$runPreparedStatement$1.apply(DB.scala:375)
at net.liftweb.mapper.DB$$anonfun$runPreparedStatement$1.apply(DB.scala:372)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241) at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29) at net.liftweb.mapper.DB$.runPreparedStatement(DB.scala:372) at net.liftweb.mapper.DB$.prepareStatement(DB.scala:316) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply(MetaMapper.scala:314)
at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply(MetaMapper.scala:306)
at net.liftweb.mapper.DB$.use(DB.scala:389) at net.liftweb.mapper.MetaMapper$class.findMapFieldDb(MetaMapper.scala:305)
at me.model.foo$.findMapFieldDb(foo.scala:17) at net.liftweb.mapper.MetaMapper$class.findMapDb(MetaMapper.scala:301)
at me.model.foo$.findMapDb(foo.scala:17) at net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:267) at me.model.foo$.findAll(foo.scala:17) at net.liftweb.mapper.MetaMapper$$anonfun$dealWithPrecache$1.apply(MetaMapper.scala:235)
at net.liftweb.mapper.MetaMapper$$anonfun$dealWithPrecache$1.apply(MetaMapper.scala:228)
at scala.List.foreach(List.scala:841) at net.liftweb.mapper.MetaMapper$class.dealWithPrecache(MetaMapper.scala:228)
at net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:267)Comments
This fails for Derby, but works on PostgreSQL , H2, and MySQL. If you can provide a failing case, I'll look into it further.
"Precache works with OrderBy" in {
if (provider ne DBProviders.DerbyProvider) { // this doesn't work for Derby, but it's a derby bug // try { provider.setupDB } catch { case e => skip(e.getMessage) } Schemifier.destroyTables_!!(ignoreLogger _, SampleModel, SampleTag) Schemifier.schemify(true, ignoreLogger _, SampleModel, SampleTag) val oo = SampleTag.findAll(OrderBy(SampleTag.tag, Ascending), MaxRows(2), PreCache(SampleTag.model)) (oo.length > 0) must beTrue for (t <- oo) t.model.cached_? must beTrue } }Added a case to test issue 91. Only derby fails, so it seems to be a derby issue. Closed by 6e74279
1 comment Created 2 months ago by dppSaved state of a Mapper entity should be based on flag, not primary keydppx
1 comment Created 2 months ago by donahue47On Review BoardxHandle PayPal IPN messages that don't have payment statustperrettxThe PayPal module assumes that all IPN messages have a payment status. However, some don't and those that don't aren't passed to the user defined PaypalIPN.actions method. See discussion at http://groups.google.com/group/liftweb/browse_thread/thread/462644a2b29e2b7f
Comments
timperrett
Sun Oct 11 15:07:25 -0700 2009
| link
Fixed and pushed to master: http://is.gd/4epvs
0 comments Created 2 months ago by hseebergerhseebergerxInaccurate ranges for previous and next (page) in CRUDifyMapperxCRUDify's pagination size is 20, but the ranges for the previous and next links use 21! Stange maths ...
Comments
1 comment Created 2 months ago by pbridgerderekchenbeckerxSchemify SQL-generation problem with OracleMapperxLift (1.0.2) with oracle (10.2, and using latest drivers), schemify fails on adding a column to a model:
INFO - ALTER TABLE table_name ADD COLUMN label VARCHAR(1000)
ERROR - Failed to Boot
java.sql.SQLException: ORA-00904: : invalid identifierThe correct syntax for this in oracle is:
ALTER TABLE table_name ADD label VARCHAR(1000)
Comments
dchenbecker
Tue Oct 27 09:01:12 -0700 2009
| link
Fix Oracle ALTER TABLE syntax for column adds
Closed by 227cb93
Oracle uses the syntax "ADD column_name" instead of
"ADD COLUMN column_name". Added a new def on DriverType to allow different drivers to override the default behavior.
0 comments Created 2 months ago by harryhdppxAdd support for MappedOptLongWork In ProgressxFor long fields that can be set to NULL.
http://groups.google.com/group/liftweb/browse_thread/thread/6ddee18695161ce3
Also MappedOptInter and possibly others would make sense as well.
Comments
There are some labels in CRUDify which are not internationalized, most important the menu labels for viewing, editing and deleting.
Comments
7 comments Created 2 months ago by DridusAbility to exclude certain paths during URL re-writedppxI have deployed a Lift application in a WAR with a context path (e.g. /myapp) alongside a monolithic non-lift application with context path /. This works in general, except constructing links from the Lift app to the other one are hackish -- the method I'm using right now is to write the links as "/../path/in/other/app" which gets rewritten to "/myapp/../path/in/other/app".
Ideally (for me) would be some kind of special URL syntax, such as two leading slashes instead of one that would tell _fixHtml to stop writing in the context path.
Comments
Postponing this feature until the lazy snippet eval code is on master
Allow certain paths to be excluded from the context path rewriting. Closed by cb2292c
I think there might be a place that this change missed, or I'm doing something wrong. Overall, looking at the code I'm not sure why it doesn't work. The problem is RedirectResponse. I have this code in Boot (the contextPath variable is "/emailwizard" -- the context path of the WAR):
LiftRules.excludePathFromContextPathRewriting.default.set(() => path => { path.startsWith("/customer") || path.startsWith("/favicon") || path.startsWith("/images") || path.startsWith("/ivr") || path.startsWith("/login") || path.startsWith("/merchant") || path.startsWith("/pxadmin") || path.startsWith("/static") || path.startsWith("/w3c") || path.startsWith("/webui") || path.startsWith(contextPath) })And then elsewhere, I have a SiteMap LocParam:
val unauthorized: Loc.FailMsg = () => RedirectResponse("/login/errorauth.jsp") /** Test for a role and if it is not found bounces out with a Unauthorized (well, redirect to /login/errorauth.jsp) */ object NeedAnyRole { def apply(fail: Loc.FailMsg, roleNames: String*): If = If(() => roleNames.findIndexOf(roleName => SPx.hasRole(roleName)) >= 0, maybeWrapForLogging("NeedAnyRole(" + roleNames + ")", fail)) def apply(roleNames: String*): If = apply(unauthorized, roleNames: _*) }When I fail this LocParam, here is what gets sent back to the browser (as seen by tcpdump)
HTTP/1.1 302 Moved Temporarily Server: Apache-Coyote/1.1 P3P: policyref="/w3c/p3p.xml", CP="CAO DSP COR CURa ADMa DEVa CONo OUR IND PHY ONL UNI PUR FIN COM NAV DEM STA" Location: /emailwizard/login/errorauth.jsp X-Lift-Version: 1.1-SNAPSHOT Content-Type: text/html;charset=utf-8 Content-Length: 1 Date: Wed, 14 Oct 2009 15:33:36.GMTThe Location: field should be /login/errorauth.jsp since I have it excluded from context rewriting. This works with normal links and other things in HTML, just this redirect isn't working as expected.
I did try to do a quick spelunk in the lift code, and it looks like it should be generating a correct InMemoryResponse with the location header set to whatever I pass in, however there's a comment there that indicates something later will touch it up:
case class RedirectResponse(uri: String, cookies: HTTPCookie*) extends LiftResponse { // The Location URI is not resolved here, instead it is resolved with context path prior of sending the actual response def toResponse = InMemoryResponse(Array(0), List("Location" -> uri), cookies toList, 302) }Oh, and thanks for making the change! It's making my life easier already
oh I realize I forgot the definition for maybeWrapForLogging which is referred to by my LocParam generation. It's trivial, so it shouldn't affect anything, but for completeness of the report here it is:
/** Wrap the given If failure message with logging statements if debug logging is enabled */ def maybeWrapForLogging(reason: String, fail: Loc.FailMsg): Loc.FailMsg = logger.isDebugEnabled match { case true => () => { logger.debug("Failing SiteMap check (" + reason + ") for " + SPx.loggedInUser.pxuser.map(_.getUsername).openOr("<anonymous user>")); fail() } case false => fail }This is not the correct forum for more general questions. Please post such questions to the Lift list.
? comes in two flavors: Without and with parameters for formatting via String.format. In order to support better core resources, ?? also should be overloaded with parameters.
Comments
1 comment Created 2 months ago by hseebergerhseebergerxNo i18n for "Sign Up" in MetaMegaProtoUser.signupXhtmlMapperxIn the following code snippet from MetaMegaProtoUser the heading label for the sign up form is hard coded:
def signupXhtml(user: ModelType) = {
(<td colspan="2">Sign Up</td></tr>...
i18n should be applied according to all other labels, i.e. ??("Sign Up")
Comments
hseeberger
Thu Oct 08 23:58:33 -0700 2009
| link
Done!
0 comments Created 2 months ago by harryhdppxPreCache can return incorrect results when used with non deterministic queriesWork In ProgressxFoos.findAll(OrderBy(Foos.someField, Ascending),
MaxRows(10), PreCache(Foos.userid))If the order by is non deterministic (if, for example, someField can be NULL), then when the query to PreCache the userid is run:
SELECT DISTINC users.id, users.name FROM users WHERE id IN (SELECT userid FROM foos ORDER BY someField ASCENDING LIMIT 10);
It may return a different set of User objects than is required to to the PreCache causing the userid field to be incorrectly populated with null values (so foo.userid.obj.open_! could unexpectedly cause an exception).
Really, rather than using a subquery for the PreCache it would be better to do IN (10, 20, 30) where 10, 20, 30 are read directly from the results of the initial query.
Comments
0 comments Created 2 months ago by pr1001dppxSchemefier Creates a BIGINT for a MappedStringForeignKeyWork In ProgressxSchemifier doesn't seem to respect the MappedStringForeignKey type and creates a BIGINT column, as you can see in the following output:
INFO - CREATE TABLE packets (temp DOUBLE , id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE KEY , mac BIGINT UNSIGNED , dt DATETIME , mah DOUBLE , lux DOUBLE , rssi DOUBLE) ENGINE = InnoDB INFO - ALTER TABLE packets ADD CONSTRAINT packets_PK PRIMARY KEY(id) INFO - CREATE INDEX packets_mac ON packets ( mac )I can override fieldCreatorString for the foreign key but I don't think I should have to. This is with 1.1-SNAPSHOT.
And the relevant parts of my models:
class Node extends KeyedMapper[String, Node] { def getSingleton = Node /* MAC address as primary key */ def primaryKeyField = mac object mac extends MappedStringIndex(this, 17) with IndexedField [String] { override def dbDisplay_? = true override lazy val defaultValue = randomString(maxLen) /* allow user-defined primary key */ override def writePermission_? = true override def dbAutogenerated_? = false private var myDirty = false override def dirty_? = myDirty override def dirty_?(b : Boolean) = { myDirty = b; super.dirty_?(b) } override def fieldCreatorString(dbType: DriverType, colName: String): String = colName+" CHAR("+maxLen+") NOT NULL " } } class Packet extends LongKeyedMapper[Packet] with IdPK { def getSingleton = Packet object node extends MappedStringForeignKey(this, Node, 17) { // Change the default behavior to add a database index for this column. override def dbIndexed_? = true override def dbColumnName = "mac" }Comments
0 comments Created 2 months ago by eharrowdppxDerby Identity column DDL and SQL insert scriptsWork In ProgressxUsing Derby and have hit an issue when running some SQL scripts to
insert data into a fresh mapper DB created by schemifier.
Specifically when inserting records with the id column I get a
violation:Error: Attempt to modify an identity column 'ID'.
SQLState: 42Z23
ErrorCode: -1i.e data can't be inserted into this column which is not helpful when
this id is the primary key and foreign key on another table. Derby
does support auto-incremented sequence values as default only when
you are not providing values as opposed to always providing auto-
incremented sequence values which you are not allowed to specify your
own values. The difference is GENERATED BY DEFAULT AS IDENTITY
instead of GENERATED ALWAYS AS IDENTITY.To this end it looks like net.liftweb.mapper.DerbyDriver.scala needs
updating from
def integerIndexColumnType = "INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY"
def longIndexColumnType = "BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY"to
def integerIndexColumnType = "INTEGER NOT NULL GENERATED BY DEFAULT AS IDENITY"
def longIndexColumnType = "BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY"Hope this helps
-- Ewan
Comments
Change net.liftweb.mapper.ByList to take a Seq[T] instead of a List[T]
1 comment Created 2 months ago by harryhComments
Fixed.
commit c538d5f
Author: Alex Boisvert boisvert@intalio.com">boisvert@intalio.com
Date: Sat Oct 10 16:34:23 2009 -0700Fix issue 77: Change net.liftweb.mapper.ByList to take a Seq[T] instead of a List[T]
1 comment Created 3 months ago by dppdppxBasic Archetype doesn't do DI correctlyWork In Progressx
1 comment Created 3 months ago by kjetilvdppxBetter error reporting when snippet methods can't be foundWork In ProgressxSnippets are matched against methods using reflection. If a method cannot be found, it is sometimes because of a signature mismatch, and useful information about this can be conveyed to the user.
The mismatch is typically either the wrong arguments, or wrong return type. (The latter can easily happen if is not declared explicitly, but inferenced by the compiler!)
Error cases can be tricky to report, because of overloading. However, if there is only a single method by the matching name, the user would benefit greatly from an error message saying that the method WAS in fact found, but it could not be used, for this reason. Simply saying that the method wasn't found is slightly misleading, and suggests that a rebuild is needed, or something.
The case of the wrong return type should be easier to report, since methods cannot be overloaded by return type only. Hence, if there is a method with the correct argument list (which should be checked for first) it could be reported as "the method you probably wanted to use".
Comments
Hello,
I'm implementing a Role in my model to ultimately replace the functionality provided by ProtoUser.superUser
Please let me know what the argument against having this functionality in Lift is, and if you'd like to see this implemented, I'd gladly commit my changes.
Sensible defaults like "0=super, 1=normal" could replace superUser.
Thanks,
JuanComments
Mailer: Consider merging System.properties into Props
1 comment Created 3 months ago by d6yRather than using System.getProperties should Mailer use net.liftweb.util.Props? It seems a little inconsistent as is. -harryh
This makes sense for me too. In our live lift app we have code in Boot to just copy props (that we happen to have named the same as the System mail properties) to System.properties:
// props starting "mail.smtp." just need to be copied to System.properties: Props.props.filter(_._1 startsWith "mail.smtp").foreach( entry => System.setProperty(entry._1, entry._2) ) // Set up SMTP auth if a username and password is supplied Mailer.authenticator = (Props.get("mail.user"), Props.get("mail.password")) match { case (Full(u), Full(p)) => Full(new javax.mail.Authenticator { override def getPasswordAuthentication = new javax.mail.PasswordAuthentication(u,p) }) case _ => Empty }...and that seems a little messy, although not particularly painful.
I'd expect any explicitly set System.properties (-D flags) to take precedence over any in Props, but that's maybe just my taste (and almost the exact opposite of the code we've written!).
Comments
provide access to HttpServletRequest and HttpServletResponse from S
6 comments Created 3 months ago by harryhTitle says it all. Sometimes we need access to the raw request/response objects
Comments
mariusdanciu
Tue Sep 22 16:01:02 -0700 2009
| link
NO please don't do this !!!
It can be done today as:
S.containerRequest.map(r => (r.asInstanceOf[HTTPRequestServlet]).req)
Lift code should not hold explicit javax.servlet references outside of net.liftweb.http.provider.servlet package
mariusdanciu: is there also a way to get the HttpServletResponse?
mariusdanciu
Tue Sep 22 16:17:28 -0700 2009
| link
Lift by design hides HttpServletResponse and this is a very good thing. Lift represents responses as LiftResponse which has many subclasses, XmlResponse, JsonResponse, RedirectResponse etc.
You can still have access to servlet response from LiftRules
LiftRules.beforeSend.append {
case (liftResponse, httpResponse, _ ) => httpResponse.asInstanceOf[HTTPResponseServlet].resp }but before send is called right before sending the response to client. I'm not sure if this will be enough though.
Exposing HTTPResponse to S would open a gate for hacks, as people may use it to directly write things to outputstream ... and this will bypass Lifts processing pipeline. I think we should seriously discuss this on the public list
Br's,
Marius
mariusdanciu
Tue Sep 22 16:25:40 -0700 2009
| link
You can us javax.servlet.http.HttpServletResponseWrapper to pass to the facebook library. Extending HttpServletResponseWrapper you can produce a LiftResponse that Lift would understand and this should be pretty straight forward
And this should not imply Lift changes.
Br's,
Marius
mariusdanciu
Tue Sep 22 16:28:07 -0700 2009
| link
Closing the ticket.
See http://groups.google.com/group/liftweb/browse_frm/thread/bbc8e000b64b8f8f?hl=en# for a description of how to access the raw request.
1 comment Created 3 months ago by Xavi-Add setting that makes lift destroy comet actors as soon as they don't appear on a page.dppxComments
Change support for Lift GC so that the GC code is not added to pages that have no GUIDs that point back to the server.
Comments
mariusdanciu
Mon Sep 21 21:26:17 -0700 2009
| link
Dave, I assigned this to myself. If you really want it, please let me know.
Br's,
Marius
mariusdanciu
Sun Oct 11 04:08:43 -0700 2009
| link
I believe this has been fixed by Dave. Dave, can you confirm?
mariusdanciu
Sat Oct 24 12:40:13 -0700 2009
| link
Fixed,
1 comment Created 3 months ago by dppLift 1.1 does not compiler under JDK 1.5derekchenbeckerx[INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] Checking for multiple versions of scala [INFO] Compiling 37 source files to /home/dpp/Desktop/liftweb/lift-mapper/target/classes [WARNING] Picked up JAVA_TOOL_OPTIONS: -Xmx1024M [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:77: error: value isWrapperFor is not a member of java.sql.Statement [WARNING] case _ => underlying.isWrapperFor(clazz) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:82: error: value unwrap is not a member of java.sql.Statement [WARNING] case _ => underlying.unwrap(clazz) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:237: error: value isClosed is not a member of java.sql.Statement [WARNING] underlying.isClosed() [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:242: error: value isPoolable is not a member of java.sql.Statement [WARNING] underlying.isPoolable() [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:277: error: value setPoolable is not a member of java.sql.Statement [WARNING] underlying.setPoolable(poolable) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:303: error: value isWrapperFor is not a member of java.sql.PreparedStatement [WARNING] case _ => super.isWrapperFor(clazz) || underlying.isWrapperFor(clazz) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:308: error: value unwrap is not a member of java.sql.PreparedStatement [WARNING] case _ => if (super.isWrapperFor(clazz)) super.unwrap(clazz) else underlying.unwrap(clazz) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:370: error: wrong number of arguments for method setAsciiStream: (Int,java.io.InputStream,Int)Unit [WARNING] underlying.setAsciiStream(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:380: error: type mismatch; [WARNING] found : Long [WARNING] required: Int [WARNING] underlying.setAsciiStream(index, x, length) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:390: error: wrong number of arguments for method setBinaryStream: (Int,java.io.InputStream,Int)Unit [WARNING] underlying.setBinaryStream(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:400: error: type mismatch; [WARNING] found : Long [WARNING] required: Int [WARNING] underlying.setBinaryStream(index, x, length) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:410: error: type mismatch; [WARNING] found : java.io.InputStream [WARNING] required: java.sql.Blob [WARNING] underlying.setBlob(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:415: error: wrong number of arguments for method setBlob: (Int,java.sql.Blob)Unit [WARNING] underlying.setBlob(index, x, length) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:435: error: wrong number of arguments for method setCharacterStream: (Int,java.io.Reader,Int)Unit [WARNING] underlying.setCharacterStream(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:445: error: type mismatch; [WARNING] found : Long [WARNING] required: Int [WARNING] underlying.setCharacterStream(index, x, length) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:455: error: type mismatch; [WARNING] found : java.io.Reader [WARNING] required: java.sql.Clob [WARNING] underlying.setClob(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:460: error: wrong number of arguments for method setClob: (Int,java.sql.Clob)Unit [WARNING] underlying.setClob(index, x, length) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:495: error: value setNCharacterStream is not a member of java.sql.PreparedStatement [WARNING] underlying.setNCharacterStream(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:500: error: value setNCharacterStream is not a member of java.sql.PreparedStatement [WARNING] underlying.setNCharacterStream(index, x, length) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:504: error: not found: type NClob [WARNING] def setNClob (index : Int, x : NClob) { [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:505: error: value setNClob is not a member of java.sql.PreparedStatement [WARNING] underlying.setNClob(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:510: error: value setNClob is not a member of java.sql.PreparedStatement [WARNING] underlying.setNClob(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:515: error: value setNClob is not a member of java.sql.PreparedStatement [WARNING] underlying.setNClob(index, x, length) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:520: error: value setNString is not a member of java.sql.PreparedStatement [WARNING] underlying.setNString(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:554: error: not found: type RowId [WARNING] def setRowId (index : Int, x : RowId) { [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:555: error: value setRowId is not a member of java.sql.PreparedStatement [WARNING] underlying.setRowId(index, x) [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:564: error: not found: type SQLXML [WARNING] def setSQLXML (index : Int, x : SQLXML) { [WARNING] ^ [WARNING] /home/dpp/Desktop/liftweb/lift-mapper/src/main/scala/net/liftweb/mapper/LoggingStatementWrappers.scala:565: error: value setSQLXML is not a member of java.sql.PreparedStatement [WARNING] underlying.setSQLXML(index, x) [WARNING] ^ [WARNING] 28 errors found [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] command line returned non-zero value:1 [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 26 seconds [INFO] Finished at: Mon Sep 21 15:33:07 PDT 2009 [INFO] Final Memory: 15M/28M [INFO] ------------------------------------------------------------------------ dpp@david-desktop:~/Desktop/liftweb/lift-mapper$
Comments
dchenbecker
Fri Oct 02 11:57:36 -0700 2009
| link
Refactor logging to work in both Java 5 and 6
Bascially convert the LoggedStatement and LoggedPreparedStatement classes
to java.lang.reflect.Proxy handlers. We had to do this so that we could
dynamically handle methods for both JDBC3 (Java 5) and JDBC4 (Java 6)
interfaces without having to have two code trees. Closed by d0c9706set a flag on snippets that would fork the evaluation of the snippet into a thread pool and then allow the weaving of the responses at page render time. This would be a benefit to systems that need to fork multiple long running threads (e.g., ad servers, etc.) to pull data in.
Comments
mariusdanciu
Mon Sep 21 21:27:22 -0700 2009
| link
Isn't this a duplicate with #56 ?
Marius
No. This is during the render pipeline rather than a snippet that allows the page to render and then push some content after it's been computed. The use case for this is to call an ad server and a "like pages" server during the rendering of a page and have those snippets forked, but they must be joined before the page rendering can complete.
Support for deferred (background) snippet execution, closed by 297078e






FWIW, even after this configuration, one still needs to execute a lifecycle phase that passes through process-resources together with scala:doc for availability of filtered packageLinkDef properties.
In other words, either of
mvn compile scala:docormvn install scala:docormvn test scala:docwould pick up filtered packageLinkDefs and work as expected. But simplemvn scala:docwon't :(I just reported the limitation to maven-scala-plugin. http://github.com/davidB/maven-scala-plugin/issues/23/find
Vscaladoc contents are offline friendly now! The baseurl prefix and path suffix is dynamically setup depending on profile selection.
Closed by 08b3a56.