Maybe this will work better now

This commit is contained in:
Simon Redfern 2011-10-17 17:11:51 +02:00
parent 964a459780
commit a316999c49
18 changed files with 354 additions and 1843 deletions

Binary file not shown.

View File

@ -1,5 +0,0 @@
#FileLock
#Sun Oct 16 15:16:15 CEST 2011
id=1330ce023767fd4174df430bab720d7ccdb97e9e85b
method=file
server=192.168.1.82\:56500

File diff suppressed because it is too large Load Diff

View File

@ -69,8 +69,19 @@ class Boot {
Menu.i("SContact") / "scontact",
Menu.i("SFeedback") / "sfeedback" >> LocGroup("bottom")
)
//, Menu.i("x") / "x" submenus(
// Menu.i("y") / "y"
// )
, Menu.i("Accounts") / "accounts" submenus(
Menu.i("TESOBE") / "accounts" / "tesobe" submenus(
Menu.i("Anonymous") / "accounts" / "tesobe" / "anonymous",
Menu.i("Our Network") / "accounts" / "tesobe" / "our-network",
Menu.i("Authorities") / "accounts" / "tesobe" / "authorities",
Menu.i("Team") / "accounts" / "tesobe" / "team",
Menu.i("Board") / "accounts" / "tesobe" / "board"
)
)
)
def sitemapMutators = User.sitemapMutator

View File

@ -0,0 +1,45 @@
package code.model
import net.liftweb.mongodb.record.field.{BsonRecordField, ObjectIdPk}
import net.liftweb.mongodb.record.{MongoMetaRecord, MongoRecord, BsonMetaRecord, BsonRecord}
/**
* Created by IntelliJ IDEA.
* User: simonredfern
* Date: 10/17/11
* Time: 1:43 AM
* To change this template use File | Settings | File Templates.
*/
class Location private () extends BsonRecord[Location] {
def meta = Location
object longitude extends net.liftweb.record.field.IntField(this)
object latitude extends net.liftweb.record.field.IntField(this)
}
object Location extends Location with BsonMetaRecord[Location]
class OBPTransaction private() extends MongoRecord[OBPTransaction] with ObjectIdPk[OBPTransaction] {
def meta = OBPTransaction
object obp_transaction_date_start extends net.liftweb.record.field.DateTimeField(this)
object obp_transaction_date_complete extends net.liftweb.record.field.DateTimeField(this)
object obp_transaction_type_en extends net.liftweb.record.field.StringField(this, 255)
object obp_transaction_type_de extends net.liftweb.record.field.StringField(this, 255)
object obp_transaction_data_blob extends net.liftweb.record.field.StringField(this, 999999)
object opb_transaction_other_account extends net.liftweb.record.field.StringField(this, 255)
object obp_transaction_currency extends net.liftweb.record.field.StringField(this, 10)
object obp_transaction_amount extends net.liftweb.record.field.DoubleField(this)
object obp_transaction_new_balance extends net.liftweb.record.field.DoubleField(this)
object obp_transaction_location extends BsonRecordField(this, Location)
}
object OBPTransaction extends OBPTransaction with MongoMetaRecord[OBPTransaction]

View File

@ -0,0 +1,22 @@
package code.snippet.BeerSnippet
/**
* Created by IntelliJ IDEA.
* User: simonredfern
* Date: 10/17/11
* Time: 1:21 PM
* To change this template use File | Settings | File Templates.
*/
import net.liftweb.util.Helpers._
import xml.NodeSeq
class BeerSnippet {
def count( xhtml: NodeSeq ) = {
val consumption = ("Tuborg Beer",2) :: ("Harboe pilsner",2) :: ("Red wine",1) :: ("Pan Galactic Gargle Blaster",1) :: Nil
def bindConsumption(template: NodeSeq): NodeSeq = {
consumption.flatMap{ case (bev, count) => bind("beverage", template,"name" -> bev,"count" -> count)}
}
bind("person",xhtml, "name" -> "Mads", "consumption" -> bindConsumption _)
}
}

View File

@ -0,0 +1,82 @@
package code.snippet
import code.model.OBPTransaction
import net.liftweb.http.{PaginatorSnippet, StatefulSnippet}
//import net.liftweb.http.DispatchSnippet._
//import net.liftweb.http.PaginatorSnippet._
import xml.NodeSeq
import com.mongodb.QueryBuilder
import net.liftweb.mongodb.Limit._
import net.liftweb.mongodb.Skip._
//import net.liftweb.http.Paginator._
import net.liftweb.util.Helpers._
class OBPTransactionSnippet extends StatefulSnippet with PaginatorSnippet[OBPTransaction] {
override def count = OBPTransaction.count
override def itemsPerPage = 5
//override def page = OBPTransaction.findAll(QueryBuilder.start().get(), Limit(itemsPerPage), Skip(curPage*itemsPerPage))
override def obp_transactions = OBPTransaction.findAll(QueryBuilder.start().get())
var dispatch: DispatchIt = {
case "showAll" => showAll _
case "paginate" => paginate _
//case "top" => top _
}
def showAll(xhtml: NodeSeq): NodeSeq = {
// To get records using mongodb record
//val qry = QueryBuilder.start("obp_transaction_currency").is("EU").get
//val obp_transactions = OBPTransaction.findAll(qry)
//bind("peer",xhtml, "status" -> "excited")
// xhtml
// call anonymous function on every transaction in obp_transactions (i.e. what a map does)
// the lambda function here replaces some stuff with the data
obp_transactions.flatMap(obp_transaction => {
(".opb_transaction_other_account *" #> obp_transaction.opb_transaction_other_account).apply(xhtml)
}
)
}
/*
*/
/*
def showAll(xhtml: NodeSeq): NodeSeq = {
page.flatMap(OBPTransaction => {
(".opb_transaction_other_account *" #> OBPTransaction.opb_transaction_other_account).apply(xhtml)
})
*/
/*
def top(xhtml: NodeSeq): NodeSeq = {
val auctions = OBPTransaction.findAll(QueryBuilder.start().get())
//".auction_row *" #> auctions.map { auction => ".opb_transaction_other_account *" #> auction.opb_transaction_other_account }
xhtml
}
*/
}

View File

@ -74,42 +74,26 @@ import java.util.regex.Pattern
import com.foursquare.rogue.MongoHelpers._
////////////
class Location private () extends BsonRecord[Location] {
def meta = Location
object longitude extends net.liftweb.record.field.IntField(this)
object latitude extends net.liftweb.record.field.IntField(this)
}
object Location extends Location with BsonMetaRecord[Location]
class OBPTransaction private() extends MongoRecord[OBPTransaction] with ObjectIdPk[OBPTransaction] {
def meta = OBPTransaction
object obp_transaction_date_start extends net.liftweb.record.field.DateTimeField(this)
object obp_transaction_date_complete extends net.liftweb.record.field.DateTimeField(this)
object obp_transaction_type_en extends net.liftweb.record.field.StringField(this, 255)
object obp_transaction_type_de extends net.liftweb.record.field.StringField(this, 255)
object obp_transaction_data_blob extends net.liftweb.record.field.StringField(this, 999999)
object opb_transaction_other_account extends net.liftweb.record.field.StringField(this, 255)
object obp_transaction_currency extends net.liftweb.record.field.StringField(this, 10)
object obp_transaction_amount extends net.liftweb.record.field.DoubleField(this)
object obp_transaction_new_balance extends net.liftweb.record.field.DoubleField(this)
object obp_transaction_location extends BsonRecordField(this, Location)
}
object OBPTransaction extends OBPTransaction with MongoMetaRecord[OBPTransaction]
import _root_.net.liftweb.common._
import _root_.net.liftweb.util._
import _root_.net.liftweb.http._
import _root_.net.liftweb.mapper._
import _root_.net.liftweb.util.Helpers._
import _root_.net.liftweb.sitemap._
import _root_.scala.xml._
import _root_.net.liftweb.http.S._
import _root_.net.liftweb.http.RequestVar
import _root_.net.liftweb.util.Helpers._
import _root_.net.liftweb.common.Full
import net.liftweb.mongodb.{Skip, Limit}
import _root_.net.liftweb.http.S._
import _root_.net.liftweb.mapper.view._
import com.mongodb._
import code.model._
//import code.model.Location

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>Accounts</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">
<h2>This is accounts</h2>
<p>
<span class="lift:helloWorld.howdy">
Welcome. The time is <span id="time">Time goes here</span>
</span>
</p>
</div>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>TESOBE</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">
<h2>This is tesobe</h2>
<p>
<span class="lift:helloWorld.howdy">
Welcome. The time is <span id="time">Time goes here</span>
</span>
</p>
</div>
</body>
</html>

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>For the Tax Payers</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">
<h2>For the Tax Payers</h2>
<p>
<span class="lift:helloWorld.howdy">
Welcome. The time is <span id="time">Time goes here</span>
</span>
</p>
<div>
<h3>Transactions</h3>
<br>
</div>
<table>
<thead>
<tr>
<th class="span-1">other account</th>
</tr>
</thead>
<tbody>
<tr class="lift:OBPTransactionSnippet.showAll">
<td class="opb_transaction_other_account">other account</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>For the tax Authorities</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">
<h2>For the tax Authorities</h2>
<p>
<span class="lift:helloWorld.howdy">
Welcome. The time is <span id="time">Time goes here</span>
</span>
</p>
</div>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>For the Board</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">
<h2>For the Board</h2>
<p>
<span class="lift:helloWorld.howdy">
Welcome. The time is <span id="time">Time goes here</span>
</span>
</p>
</div>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>For our Network</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">
<h2>For our Network</h2>
<p>
<span class="lift:helloWorld.howdy">
Welcome. The time is <span id="time">Time goes here</span>
</span>
</p>
</div>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>For our Team</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">
<h2>For our Team</h2>
<p>
<span class="lift:helloWorld.howdy">
Welcome. The time is <span id="time">Time goes here</span>
</span>
</p>
</div>
</body>
</html>

View File

@ -6,19 +6,7 @@
</head>
<body class="bla">
<h2>Welcome to Simon! This is simon.html</h2>
<p>test <br /><a href="http://127.0.0.1:8002/static/uploads/2011/09/06/8cd2ce850dfc7cc6ad11502e9474a77de3355ec3.m4v">Boris Häbel.m4v</a></p>
<p> </p>
<p><video autoplay="autoplay" preload="auto" width="500" controls="1">
<source src="http://127.0.0.1:8002/static/uploads/2011/09/06/8cd2ce850dfc7cc6ad11502e9474a77de3355ec3.m4v"> </source>
</video></p>
<h2>Welcome to Simon! This is x/y.html</h2>
<p>
</p>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>X</title>
</head>
<body class="bla">
<h2>This is x.html</h2>
<p>
</p>
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>x/y.xhtml</title>
</head>
<body class="bla">
<h2>Welcome to x/y.xhtml</h2>
</p>
</div>
</body>
</html>