diff --git a/MavLift/src/main/scala/code/model/MongoConfig.scala b/MavLift/src/main/scala/code/model/MongoConfig.scala index 5af86e7f6..c74e6700a 100644 --- a/MavLift/src/main/scala/code/model/MongoConfig.scala +++ b/MavLift/src/main/scala/code/model/MongoConfig.scala @@ -12,10 +12,10 @@ object AdminDb extends MongoIdentifier { object MongoConfig { def init: Unit = { val srvr = new ServerAddress( - Props.get("mongo.host", "127.0.0.1"), + Props.get("mongo.host", "obp_mongodb"), Props.getInt("mongo.port", 27017) ) - MongoDB.defineDb(DefaultMongoIdentifier, new Mongo(srvr), "OBP001") + MongoDB.defineDb(DefaultMongoIdentifier, new Mongo(srvr), "OBP003") MongoDB.defineDb(AdminDb, new Mongo(srvr), "admin") } } diff --git a/MavLift/src/main/scala/code/snippet/OBPTransactionSnippet.scala b/MavLift/src/main/scala/code/snippet/OBPTransactionSnippet.scala index aa2a6f55e..b20bb493b 100644 --- a/MavLift/src/main/scala/code/snippet/OBPTransactionSnippet.scala +++ b/MavLift/src/main/scala/code/snippet/OBPTransactionSnippet.scala @@ -40,20 +40,71 @@ class OBPTransactionSnippet extends StatefulSnippet with PaginatorSnippet[OBPTra //val obp_transactions = OBPTransaction.findAll(qry) - def present_obp_transaction_new_balance(obp_transaction_new_balance: Double, consumer: String): String = { - val result: String = + def present_obp_transaction_new_balance(value: Double, consumer: String): String = { + val show: String = if(consumer == "team") - obp_transaction_new_balance.toString + value.toString else if(consumer == "board") - obp_transaction_new_balance.toString + value.toString + else if(consumer == "tax_office") + value.toString + else if(consumer == "anonymous") + (if (value < 0) "-" else "+") else "---" - result - } + show + } + + def present_obp_transaction_other_account(value: String, consumer: String): String = { + val show: String = + if(consumer == "team") + value.toString + else if(consumer == "board") + value.toString + else if(consumer == "tax_office") + value.toString + else if(consumer == "anonymous") + "---" + else + "---" + show + } + + + def other_account_is_a_client(value: String): Boolean = { + false + } + + def other_account_is_a_team_member(value: String): Boolean = { + false + } + + def other_account_is_a_supplier(value: String): Boolean = { + false + } + + def other_account_is_shy(value: String, consumer: String): Boolean = { + false + } + + def other_account_has_alias(value: String): Boolean = { + false + } + + + def other_account_is_known(value: String): Boolean = { + (other_account_is_a_team_member(value) || + other_account_is_a_client(value) || + other_account_is_a_supplier(value) + ) + } + + def other_account_is_private(value: String): Boolean = { + false + } - //bind("peer",xhtml, "status" -> "excited") // xhtml val consumer = S.attr("consumer") openOr "no param consumer passed" diff --git a/MavLift/src/main/scala/code/snippet/SomeThing.scala b/MavLift/src/main/scala/code/snippet/SomeThing.scala index d839ebfbe..9ce323f36 100644 --- a/MavLift/src/main/scala/code/snippet/SomeThing.scala +++ b/MavLift/src/main/scala/code/snippet/SomeThing.scala @@ -157,6 +157,10 @@ object OBPRest extends RestHelper { val location = Location.createRecord.longitude(2).latitude(51) // Create a ChooseItem object and save it in the mongodb + /* + Works! + + val choose_item_1 = OBPTransaction.createRecord .obp_transaction_amount(-100) .obp_transaction_currency("EU") @@ -164,6 +168,9 @@ object OBPRest extends RestHelper { .opb_transaction_other_account("Print Supplier") .save + */ + + //val choose_items = ChooseItem.findAll // don't seem to need parse. This is a query using the DSL (domain specific language) @@ -240,11 +247,11 @@ object OBPRest extends RestHelper { // Using Casbah..................... // Get a connection to MongoDB (note. Lift uses model/MongoConfig.scala for this config) - val mongoConn = MongoConnection("localhost", 27017) + val mongoConn = MongoConnection("obp_mongodb", 27017) // Get a mongodb database - val mongoDB = mongoConn("test") // we are using the test database. + val mongoDB = mongoConn("OBP003") // Get a collection @@ -278,6 +285,10 @@ object OBPRest extends RestHelper { println ("casbah thinks there are %d records in my_records ".format(my_cursor.count())) + /* + + Works! + // To create a record with Casbah val newObj1 = MongoDBObject("foo" -> "bar", "x" -> "y", @@ -300,6 +311,7 @@ object OBPRest extends RestHelper { // and update a record newObj2 += "OMG" -> "Ponies!" + */ val mongoColl = MongoConnection()("chooseitems") diff --git a/MavLift/src/main/webapp/accounts/tesobe/anonymous.html b/MavLift/src/main/webapp/accounts/tesobe/anonymous.html index 5d66100ff..f8b118d7e 100644 --- a/MavLift/src/main/webapp/accounts/tesobe/anonymous.html +++ b/MavLift/src/main/webapp/accounts/tesobe/anonymous.html @@ -22,29 +22,27 @@ - - - - - - - + + + + + + + + + - - - - diff --git a/MavLift/src/main/webapp/accounts/tesobe/authorities.html b/MavLift/src/main/webapp/accounts/tesobe/tax_office.html similarity index 100% rename from MavLift/src/main/webapp/accounts/tesobe/authorities.html rename to MavLift/src/main/webapp/accounts/tesobe/tax_office.html diff --git a/MavLift/src/main/webapp/templates-hidden/default.html b/MavLift/src/main/webapp/templates-hidden/default.html index 13233be26..6cd56cba2 100755 --- a/MavLift/src/main/webapp/templates-hidden/default.html +++ b/MavLift/src/main/webapp/templates-hidden/default.html @@ -79,8 +79,8 @@

- OpanBank - is (c) 2011 TESOBE and distributed under the Apache 2.0 License.

+ Open Bank Project and OpanBank + is (c)2011 TESOBE and distributed under the Apache 2.0 License.
accountstart dateamountcurrencytransaction typeinfonew balanceAccountPostedClearedAmountCurrencyTypeInfoBalance
start datecompleted date obp_transaction_amount obp_transaction_currency obp_transaction_type_en obp_transaction_data_blob obp_transaction_new_balance