You are viewing a plain text version of this content. The canonical link for it is here.
Posted to stonehenge-commits@incubator.apache.org by sh...@apache.org on 2008/11/26 10:55:41 UTC
svn commit: r720802 [3/4] - in /incubator/stonehenge/contrib/stocktrader:
perl/ perl/trader_client/ perl/trader_client/images/ python/
python/trader_client/ python/trader_client/media/
python/trader_client/media/images/ python/trader_client/templates/
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-link-bg-hover.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-link-bg-hover.gif?rev=720802&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-link-bg-hover.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-link-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-link-bg.gif?rev=720802&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-link-bg.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-links-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-links-bg.gif?rev=720802&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/header-links-bg.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/logo.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/logo.gif?rev=720802&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/logo.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/middle-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/middle-bg.gif?rev=720802&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/middle-bg.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/powered-by-logo.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/powered-by-logo.gif?rev=720802&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/powered-by-logo.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/red-arrow.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/red-arrow.gif?rev=720802&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/images/red-arrow.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/media/style.css
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/media/style.css?rev=720802&view=auto
==============================================================================
--- incubator/stonehenge/contrib/stocktrader/python/trader_client/media/style.css (added)
+++ incubator/stonehenge/contrib/stocktrader/python/trader_client/media/style.css Wed Nov 26 02:55:38 2008
@@ -0,0 +1,373 @@
+body {
+background-image: url(images/bg.gif);
+background-repeat: repeat-x;
+background-position: left top;
+background-attachment: scroll;
+font-size: 11px;
+font-family: Verdana, Arial, Helvetica, san-serif;
+padding: 0px;
+margin: 0px;
+}
+
+p { }
+
+h3 {
+margin-top:5px;
+font-size: 16px;
+font-weight: normal;
+color: #F47B20;
+}
+
+td { }
+
+a:link {
+color: #0054A6;
+text-decoration: none;
+}
+
+a:visited {
+
+}
+
+a:hover {
+text-decoration: underline;
+}
+
+a:active { }
+
+input {
+border-left: solid 1px #999;
+border-bottom: solid 1px #333;
+border-right: solid 1px #333;
+border-top: solid 1px #999;
+margin-right: 7px;
+}
+input.button {
+background-image: url(images/button-bg.gif);
+background-repeat: repeat-x;
+background-position: left top;
+background-attachment: scroll;
+border-left: solid 1px #FDBB30;
+border-bottom: solid 2px #F47B20;
+border-right: solid 2px #F47B20;
+border-top: solid 1px #FDBB30;
+height: 22px;
+font-weight: bold;
+padding-left: 10px;
+padding-right: 10px;
+cursor: pointer;
+}
+td {
+vertical-align: top;
+}
+
+div#content {
+width: 902px;
+margin: auto;
+margin-top: 15px;
+}
+div#header {
+background-image: url(images/header-bg.gif);
+background-repeat: no-repeat;
+background-position: left top;
+background-attachment: scroll;
+background-color: #fff;
+height: 57px;
+}
+div#header div.logo {
+float: left;
+margin-top: 0px;
+margin-left: 20px;
+}
+div#header div.powered {
+float: right;
+margin-top: 10px;
+margin-right: 20px;
+}
+div#header-links {
+border-left: solid 2px #3E739D;
+border-right: solid 2px #3E739D;
+height: 35px;
+padding-left: 60px;
+padding-right: 20px;
+padding-top: 0px;
+background-image: url(images/header-links-bg.gif);
+background-repeat: no-repeat;
+background-position: left top;
+background-attachment: scroll;
+}
+div#header-links table {
+height: 30px;
+
+}
+div#header-links table td {
+}
+div#header-links table td a {
+display: block;
+text-decoration: none;
+color: #fff;
+padding-left: 15px;
+padding-right: 15px;
+padding-top: 7px;
+background-image: url(images/header-link-bg.gif);
+background-repeat: repeat-x;
+background-position: left top;
+background-attachment: scroll;
+height: 23px;
+font-size: 12px;
+font-weight: bold;
+}
+div#header-links table td a:hover {
+background-image: url(images/header-link-bg-hover.gif);
+background-repeat: repeat-x;
+background-position: left top;
+background-attachment: scroll;
+}
+div#middle {
+background-image: url(images/middle-bg.gif);
+background-repeat: repeat-y;
+background-position: left top;
+background-attachment: scroll;
+background-color: #fff;
+min-height: 300px;
+padding-left: 40px;
+padding-right: 40px;
+padding-top: 20px;
+padding-bottom: 20px;
+}
+div#middle div.main-title {
+border-bottom: solid 1px #3E739D;
+text-align: right;
+vertical-align: bottom;
+height: 30px;
+margin-bottom: 20px;
+}
+div#middle div.main-title h1{
+margin-top: 0px;
+padding-top: 0px;
+font-size: 22px;
+color: #3E739D;
+float: left;
+}
+div#middle div.main-title span.time {
+}
+div.left {
+width: 400px;
+}
+div.right {
+border: solid 1px #3E739D;
+margin-left: 40px;
+width: 373px;
+}
+div.right p {
+padding-left: 10px;
+padding-right: 10px;
+}
+div.right h3{
+margin: 0px;
+background-color: #3E739D;
+color: #fff;
+padding: 5px;
+font-size: 12px;
+}
+
+div.login {
+text-align: center;
+}
+div.login table {
+margin: auto;
+font-size: 12px;
+}
+div.login p.new-user {
+font-size: 12px;
+font-weight: bold;
+}
+div.quotes {
+text-align: center;
+width: auto;
+margin: auto;
+}
+div#middle table.normal {
+margin-bottom: 20px;
+}
+div#middle table.normal tr{
+text-align: left;
+font-size: 12px;
+}
+div#middle table.normal tr th {
+font-size: 12px;
+border-bottom: solid 1px #333;
+border-left: 0px;
+border-right: 0px;
+border-top: 0px;
+padding-bottom: 3px;
+color: #3E739D;
+}
+div#middle table.normal tr td.left {
+text-align: right;
+color: #3E739D;
+padding-top: 3px;
+vertical-align: top;
+}
+
+table.table-inner {
+border: solid 1px #999;
+width: 100%;
+}
+table.table-inner tr td,th{
+border: solid 1px #333;
+padding: 5px;
+}
+table.table-inner tr th {
+background-color: #999;
+color: #fff;
+}
+table.table-inner tbody tr td {
+background-color: #ccc;
+text-align: right;
+}
+
+table.table-outer {
+border: solid 0px #333;
+width: auto;
+}
+table.table-outer tr td,th{
+ border: solid 1px #fff;
+ padding: 5px;
+}
+table.table-outer thead tr th {
+background-color: #999;
+border: solid 1px #fff;
+color: #fff;
+padding: 3px;
+}
+table.table-outer tbody tr td {
+background-color: #ededed;
+text-align: center;
+}
+table.table-outer tbody tr td.special {
+background-color: #ccc;
+font-weight: bold;
+text-align: left;
+}
+table.table-outer tbody tr td.currency {
+text-align: right;
+}
+table.table-outer tbody tr.total td{
+background-color: #BCBEC0;
+font-weight: bold;
+text-align: right;
+}
+span.price {
+color: #5E8823;
+}
+span.price-gain {
+color: #5E8823;
+background-image: url(images/green-arrow.gif);
+background-repeat: no-repeat;
+background-position: right top;
+background-attachment: scroll;
+padding-right: 17px;
+}
+span.price-loss {
+color: #C0272D;
+background-image: url(images/red-arrow.gif);
+background-repeat: no-repeat;
+background-position: right bottom;
+background-attachment: scroll;
+padding-right: 17px;
+}
+table.profile {
+border: solid 1px #3E739D;
+width: 100%;
+margin-top: 15px;
+background-color: #ededed;
+}
+table.profile tr td,th{
+padding: 2px;
+}
+table.profile thead tr th {
+color: #3E739D;
+border-bottom: solid 1px #3E739D;
+font-size: 12px;
+padding: 5px;
+}
+table.profile tbody tr td {
+background-color: #ededed;
+text-align: right;
+}
+table.profile tbody tr td.button {
+text-align: center;
+padding: 7px;
+}
+table.profile-content {
+width: auto;
+margin-bottom: 10px;
+}
+table.profile-content tbody tr td {
+padding: 5px;
+border: solid 1px #999;
+}
+table.profile-content tbody tr td.left {
+color: #3E739D;
+}
+table.glossary {
+width: 80%;
+background-color: #ccc;
+}
+table.glossary thead tr th {
+background-color: #666;
+color: #fff;
+border: 0px;
+padding: 5px;
+}
+table.glossary tbody tr td {
+background-color: #fff;
+padding: 5px;
+}
+table.glossary td.left {
+font-weight: bold;
+}
+div#confirm {
+margin-top: 7%;
+margin-bottom: 7%;
+width: 60%;
+margin-left: auto;
+margin-right: auto;
+}
+div#confirm h2 {
+color: #3E739D;
+text-align: center;
+font-size: 18px;
+}
+div#confirm div.confirm-content {
+background-color: #E7EAEE;
+border-top: solid 1px #3E739D;
+border-left: solid 1px #3E739D;
+border-right: solid 2px #3E739D;
+border-bottom: solid 2px #3E739D;
+padding-top: 10px;
+padding-bottom: 20px;
+padding-left: 20px;
+padding-right: 20px;
+text-align: center;
+}
+div.bottom {
+margin-top: 10px;
+border-top: solid 1px #3E739D;
+padding-top: 10px;
+padding-bottom: 0px;
+text-align: center;
+vertical-align: middle;
+}
+div#footer {
+background-image: url(images/footer-bg.gif);
+background-repeat: no-repeat;
+background-position: left top;
+background-attachment: scroll;
+background-color: #fff;
+height: 30px;
+padding-top: 25px;
+padding-left: 20px;
+color: #3E739D;
+}
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/request_processor.py
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/request_processor.py?rev=720802&view=auto
==============================================================================
--- incubator/stonehenge/contrib/stocktrader/python/trader_client/request_processor.py (added)
+++ incubator/stonehenge/contrib/stocktrader/python/trader_client/request_processor.py Wed Nov 26 02:55:38 2008
@@ -0,0 +1,932 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import wso2.wsf
+
+import xml.dom.minidom
+import time
+
+LOG_DIR = '/tmp/'
+LOG_LEVEL = 4
+WSFC_HOME = '/home/milinda/wso2/wsfc/deploy'
+
+CONFIG_SERVICE_NS = 'http://wso2.org/interop/stocktrader/xsd'
+BS_NS = 'http://trade.samples.websphere.ibm.com'
+
+class OrderDataBean():
+
+ def __init__(self, order_id, order_type, order_status, open_date, completed_date, quantity, price, order_fee, symbol):
+ self.order_id = order_id
+ self.order_type = order_type
+ self.order_status = order_status
+ self.open_date = open_date
+ self.completed_date = completed_date
+ self.quantity = quantity
+ self.price = price
+ self.order_fee = order_fee
+ self.symbol = symbol
+ self.total = float(price)*float(quantity) + float(order_fee)
+
+ def getOrderID(self):
+ return self.order_id
+
+ def getOrderType(self):
+ return self.order_type
+
+ def getOrderStatus(self):
+ return self.order_status
+
+ def getOpenDate(self):
+ return self.open_date
+
+ def getCompletionDate(self):
+ return self.completed_date
+
+ def getQuantity(self):
+ return self.quantity
+
+ def getPrice(self):
+ return self.price
+
+ def getOrderFee(self):
+ return self.order_fee
+
+ def getSymbol(self):
+ return self.symbol
+
+ def getTotal(self):
+ return self.total
+
+
+class HoldingDataBean():
+ def __init__(self, holding_id, quantity, purchase_price, purchase_date, quoteID):
+ self.holding_id = holding_id
+ self.quantity = quantity
+ self.purchase_price = purchase_price
+ self.purchase_date = purchase_date
+ self.quoteID = quoteID
+
+ def getHoldingID(self):
+ return self.holding_id
+
+ def getQuantity(self):
+ return self.quantity
+
+ def getPurchasePrice(self):
+ return self.purchase_price
+
+ def getPurchaseDate(self):
+ return self.purchase_date
+
+ def getQuoteID(self):
+ return self.quoteID
+
+
+class Holdings():
+ def __init__(self):
+ self.holdings = []
+
+ def addHolding(self, holding):
+ self.holdings.append(holding)
+
+ def getHoldings(self):
+ return self.holdings
+
+
+class GetOrdersReturn():
+ def __init__(self):
+ self.orders = []
+
+ def addOrder(self, order):
+ self.orders.append(order)
+
+ def getOrders(self):
+ return self.orders
+
+
+class AccountData():
+ def __init__(self, account_id, login_count, logout_count, last_login, creation_date, balance, open_balance, profile_id):
+ self.account_id = account_id
+ self.login_count = login_count
+ self.logout_count = logout_count
+ self.last_login = last_login
+ self.creation_date = creation_date
+ self.balance = balance
+ self.open_balance = open_balance
+ self.profile_id = profile_id
+
+ def getAccountID(self):
+ return self.account_id
+
+ def getLoginCount(self):
+ return self.login_count
+
+ def getLogoutCount(self):
+ return self.logout_count
+
+ def getLastLogin(self):
+ return self.last_login
+
+ def getCreationDate(self):
+ return self.creation_date
+
+ def getBalance(self):
+ return self.balance
+
+ def getOpenBalance(self):
+ return self.open_balance
+
+ def getProfileID(self):
+ return self.profile_id
+
+# Class AccountProfile which used to hold account profile data.
+class AccountProfile():
+ def __init__(self, user_id, passowrd, fullname, address, email, credit_card):
+ self.user_id = user_id
+ self.password = passowrd
+ self.fullname = fullname
+ self.address = address
+ self.email = email
+ self.credit_card = credit_card
+
+ def getUserID(self):
+ return self.user_id
+
+ def getPassword(self):
+ return self.password
+
+ def getFullName(self):
+ return self.fullname
+
+ def getAddress(self):
+ return self.address
+
+ def getEmail(self):
+ return self.email
+
+ def getCreditCard(self):
+ return self.credit_card
+
+
+class UserAccountSummary():
+ def __init__(self, total_buys, total_sells, total_tax):
+ self.total_buys = total_buys
+ self.total_sells = total_sells
+ self.total_tax = total_tax
+ self.total_impact = self.total_buys + self.total_tax - self.total_sells
+
+ def getTotalBuys(self):
+ return self.total_buys
+
+ def getTotalSells(self):
+ return self.total_sells
+
+ def getTotalTax(self):
+ return self.total_tax
+
+ def getTotalImpact(self):
+ return self.total_impact
+
+
+class QuoteDataBean():
+ def __init__(self, symbol, company_name, price, open, low, high, change, volume):
+ change_type = 'bal'
+ self.symbol = symbol
+ self.company_name = company_name
+ self.price = price
+ self.open = open
+ self.low = low
+ self.high = high
+ self.change = float(change)
+ self.volume = volume
+ if self.change > 0:
+ change_type = 'gain'
+ elif self.change <0 :
+ change_type = 'loss'
+ self.change_t = change_type
+
+
+class MarketSummary():
+ def __init__(self, tsia, open_tsia, volume, summary_date):
+ gain_type = 'bal'
+ self.top_gainers = []
+ self.top_loosers = []
+ self.tsia = round(float(tsia), 2)
+ self.open_tsia = round(float(open_tsia), 2)
+ self.volume = volume
+ self.summary_date = summary_date
+ self.gain = round((self.tsia- self.open_tsia), 2)
+ if self.gain > 0:
+ gain_type = 'gain'
+ elif self.gain < 0:
+ gain_type = 'loss'
+ self.gain_type = gain_type
+
+ def addTopGainer(self, gainer_quote):
+ self.top_gainers.append(gainer_quote)
+
+ def addTopLooser(self, top_looser):
+ self.top_loosers.append(top_looser)
+
+ def getTopGainers(self):
+ return self.top_gainers
+
+ def getTopLoosers(self):
+ return self.top_loosers
+
+# Utility method get the text contain inside XML element.
+def getText(nodelist):
+ rc = ""
+ for node in nodelist:
+ if node.nodeType == node.TEXT_NODE:
+ rc = rc + node.data
+ return rc
+
+def login_request(username, password, end_point):
+ message = '<login xmlns="http://trade.samples.websphere.ibm.com"><userID>'
+ message += username
+ message += '</userID><password>'
+ message += password
+ message += '</password></login>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":end_point,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ uid = res_dom.getElementsByTagNameNS(BS_NS, 'profileID')[0]
+ if uid:
+ return True
+ else:
+ return False
+ except wso2.wsf.WSFault, e:
+ return False
+
+def logout_request(username, end_point):
+ message = '<ns1:logout xmlns:ns1="http://trade.samples.websphere.ibm.com"><ns1:userID>'
+ message += username
+ message += '</ns1:userID></ns1:logout>'
+
+ msg = message.encode('utf8')
+ try:
+ client = wso2.wsf.WSClient({
+ "to":end_point,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ if res_dom.getElementsByTagNameNS(BS_NS, 'logoutResponse')[0]:
+ return True
+ else:
+ return False
+ except wso2.wsf.WSFault, e:
+ return False
+
+def get_orders(username, end_point):
+ message = '<getOrders xmlns="http://trade.samples.websphere.ibm.com"><userID>'
+ message += username
+ message += '</userID></getOrders>'
+
+ msg = message.encode('utf8')
+ try:
+ client = wso2.wsf.WSClient({
+ "to":end_point,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ if res_dom:
+ get_oders_return = GetOrdersReturn()
+ orders = res_dom.getElementsByTagNameNS(BS_NS, 'OrderDataBean')
+ for order in orders:
+ order_id = order.getElementsByTagNameNS(BS_NS, 'orderID')[0]
+ order_type = order.getElementsByTagNameNS(BS_NS, 'orderType')[0]
+ order_status = order.getElementsByTagNameNS(BS_NS, 'orderStatus')[0]
+ open_date = order.getElementsByTagNameNS(BS_NS, 'openDate')[0]
+ completion_date = order.getElementsByTagNameNS(BS_NS, 'completionDate')[0]
+ quantity = order.getElementsByTagNameNS(BS_NS, 'quantity')[0]
+ price = order.getElementsByTagNameNS(BS_NS, 'price')[0]
+ order_fee = order.getElementsByTagNameNS(BS_NS, 'orderFee')[0]
+ symbol = order.getElementsByTagNameNS(BS_NS, 'symbol')[0]
+
+ order_obj = OrderDataBean(getText(order_id.childNodes),\
+ getText(order_type.childNodes),\
+ getText(order_status.childNodes),\
+ getText(open_date.childNodes),\
+ getText(completion_date.childNodes),\
+ getText(quantity.childNodes),\
+ getText(price.childNodes),\
+ getText(order_fee.childNodes),\
+ getText(symbol.childNodes))
+ get_oders_return.addOrder(order_obj)
+ return get_oders_return
+ else:
+ return None
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+def get_account_data(username, epr):
+ message = '<getAccountData xmlns="http://trade.samples.websphere.ibm.com"><userID>'
+ message += username
+ message += '</userID></getAccountData>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ if res_dom:
+ account_id = res_dom.getElementsByTagNameNS(BS_NS, 'accountID')[0]
+ login_count = res_dom.getElementsByTagNameNS(BS_NS, 'loginCount')[0]
+ logout_count = res_dom.getElementsByTagNameNS(BS_NS, 'logoutCount')[0]
+ last_login = res_dom.getElementsByTagNameNS(BS_NS, 'lastLogin')[0]
+ creation_date = res_dom.getElementsByTagNameNS(BS_NS, 'creationDate')[0]
+ balance = res_dom.getElementsByTagNameNS(BS_NS, 'balance')[0]
+ open_balance = res_dom.getElementsByTagNameNS(BS_NS, 'openBalance')[0]
+ profile_id = res_dom.getElementsByTagNameNS(BS_NS, 'profileID')[0]
+
+ account_data = AccountData(
+ getText(account_id.childNodes),
+ getText(login_count.childNodes),
+ getText(logout_count.childNodes),
+ getText(last_login.childNodes),
+ getText(creation_date.childNodes),
+ getText(balance.childNodes),
+ getText(open_balance.childNodes),
+ getText(profile_id.childNodes))
+ return account_data
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+def get_account_profile(username, epr):
+ message = '<ns1:getAccountProfileData xmlns:ns1="http://trade.samples.websphere.ibm.com"><ns1:userID>'
+ message += username
+ message += '</ns1:userID></ns1:getAccountProfileData>'
+
+ msg = message.encode('utf8')
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ if res_dom:
+ user_id = res_dom.getElementsByTagNameNS(BS_NS, 'userID')[0]
+ password = res_dom.getElementsByTagNameNS(BS_NS, 'password')[0]
+ fullname = res_dom.getElementsByTagNameNS(BS_NS, 'fullName')[0]
+ address = res_dom.getElementsByTagNameNS(BS_NS, 'address')[0]
+ email = res_dom.getElementsByTagNameNS(BS_NS, 'email')[0]
+ credit_card = res_dom.getElementsByTagNameNS(BS_NS, 'creditCard')[0]
+
+ account_profile = AccountProfile(
+ getText(user_id.childNodes),
+ getText(password.childNodes),
+ getText(fullname.childNodes),
+ getText(address.childNodes),
+ getText(email.childNodes),
+ getText(credit_card.childNodes))
+ return account_profile
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+def get_account_summary(orders):
+ buys = 0
+ sells = 0
+ tax = 0
+ if orders:
+ for order in orders:
+ if order.getOrderType() == 'buy':
+ buys += float(order.getPrice())*float(order.getQuantity()) + float(order.getOrderFee())
+ elif order.getOrderType() == 'sell':
+ sells += float(order.getPrice())*float(order.getQuantity()) - float(order.getOrderFee())
+
+ tax += float(order.getOrderFee())
+ user_accnt_summary = UserAccountSummary(buys, sells, tax)
+ return user_accnt_summary
+ else:
+ return None
+
+
+def update_account_profile(username, password, fullname, address, email, credit_card, epr):
+ message = '<ns1:updateAccountProfile xmlns:ns1="http://trade.samples.websphere.ibm.com"><ns1:profileData><ns1:userID>'
+ message += username
+ message += '</ns1:userID><ns1:password>'
+ message += password
+ message += '</ns1:password><ns1:fullName>'
+ message += fullname
+ message += '</ns1:fullName><ns1:address>'
+ message += address
+ message += '</ns1:address><ns1:email>'
+ message += email
+ message += '</ns1:email><ns1:creditCard>'
+ message += credit_card
+ message += '</ns1:creditCard></ns1:profileData></ns1:updateAccountProfile>'
+
+ msg = message.encode('utf8')
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ uid = res_dom.getElementsByTagNameNS(BS_NS, 'userID')[0]
+ if uid:
+ return True
+ else:
+ return False
+ except wso2.wsf.WSFault, e:
+ return False
+
+def get_holdings(username, epr):
+ message = '<getHoldings xmlns="http://trade.samples.websphere.ibm.com"><userID>'
+ message += username
+ message += '</userID></getHoldings>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ holdings_return = Holdings()
+ holding_data_beans = res_dom.getElementsByTagNameNS(BS_NS, 'HoldingDataBean')
+
+ for holding in holding_data_beans:
+ holding_id = holding.getElementsByTagNameNS(BS_NS, 'holdingID')[0]
+ quantity = holding.getElementsByTagNameNS(BS_NS, 'quantity')[0]
+ purch_price = holding.getElementsByTagNameNS(BS_NS, 'purchasePrice')[0]
+ purch_date = holding.getElementsByTagNameNS(BS_NS, 'purchaseDate')[0]
+ quote_id = holding.getElementsByTagNameNS(BS_NS, 'quoteID')[0]
+ holding_data = HoldingDataBean(getText(holding_id.childNodes),\
+ getText(quantity.childNodes),\
+ getText(purch_price.childNodes),\
+ getText(purch_date.childNodes),\
+ getText(quote_id.childNodes))
+ holdings_return.addHolding(holding_data)
+
+ return holdings_return
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+
+def get_closed_orders(username, epr):
+
+ message = '<getClosedOrders xmlns="http://trade.samples.websphere.ibm.com"><userID>'
+ message += username
+ message += '</userID></getClosedOrders>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ closed_orders = []
+ orders = res_dom.getElementsByTagNameNS(BS_NS, 'OrderDataBean')
+ if orders is None:
+ return None
+ for order in orders:
+ order_id = order.getElementsByTagNameNS(BS_NS, 'orderID')[0]
+ order_type = order.getElementsByTagNameNS(BS_NS, 'orderType')[0]
+ order_status = order.getElementsByTagNameNS(BS_NS, 'orderStatus')[0]
+ open_date = order.getElementsByTagNameNS(BS_NS, 'openDate')[0]
+ completion_date = order.getElementsByTagNameNS(BS_NS, 'completionDate')[0]
+ quantity = order.getElementsByTagNameNS(BS_NS, 'quantity')[0]
+ price = order.getElementsByTagNameNS(BS_NS, 'price')[0]
+ order_fee = order.getElementsByTagNameNS(BS_NS, 'orderFee')[0]
+ symbol = order.getElementsByTagNameNS(BS_NS, 'symbol')[0]
+
+ order_obj = OrderDataBean(getText(order_id.childNodes),\
+ getText(order_type.childNodes),\
+ getText(order_status.childNodes),\
+ getText(open_date.childNodes),\
+ getText(completion_date.childNodes),\
+ getText(quantity.childNodes),\
+ getText(price.childNodes),\
+ getText(order_fee.childNodes),\
+ getText(symbol.childNodes))
+ closed_orders.append(order_obj)
+
+ return closed_orders
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+
+def get_quote(symbol, epr):
+
+ message = '<getQuote xmlns="http://trade.samples.websphere.ibm.com"><symbol>'
+ message += symbol
+ message += '</symbol></getQuote>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ quote_order_return = res_dom.getElementsByTagNameNS(BS_NS, 'getQuoteReturn')[0]
+ symbol = quote_order_return.getElementsByTagNameNS(BS_NS, 'symbol')[0]
+ company_name = quote_order_return.getElementsByTagNameNS(BS_NS, 'companyName')[0]
+ price = quote_order_return.getElementsByTagNameNS(BS_NS, 'price')[0]
+ open = quote_order_return.getElementsByTagNameNS(BS_NS, 'open')[0]
+ low = quote_order_return.getElementsByTagNameNS(BS_NS, 'low')[0]
+ high = quote_order_return.getElementsByTagNameNS(BS_NS, 'high')[0]
+ change = quote_order_return.getElementsByTagNameNS(BS_NS, 'change')[0]
+ volume = quote_order_return.getElementsByTagNameNS(BS_NS, 'volume')[0]
+
+ return QuoteDataBean(getText(symbol.childNodes),\
+ getText(company_name.childNodes),\
+ getText(price.childNodes),\
+ getText(open.childNodes),\
+ getText(low.childNodes),\
+ getText(high.childNodes),\
+ getText(change.childNodes),\
+ getText(volume.childNodes))
+
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+def get_five_quotes(epr):
+ quotes = []
+ for i in [1,2,3,4,5]:
+ symbol = 's:%d'%i
+ quotes.append(get_quote(symbol, epr))
+ return quotes
+
+def get_market_summary(epr):
+ message = '<getMarketSummary xmlns="http://trade.samples.websphere.ibm.com"/>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ tsia = res_dom.getElementsByTagNameNS(BS_NS, 'TSIA')[0]
+ open_tsia = res_dom.getElementsByTagNameNS(BS_NS, 'openTSIA')[0]
+ volume = res_dom.getElementsByTagNameNS(BS_NS, 'volume')[0]
+ summary_date = res_dom.getElementsByTagNameNS(BS_NS, 'summaryDate')
+ if len(summary_date) == 0:
+ sum_date = time.ctime(time.time())
+ else:
+ summary_date = res_dom.getElementsByTagNameNS(BS_NS, 'summaryDate')[0]
+ sum_date = getText(summary_date.childNodes)
+
+ market_summary = MarketSummary(getText(tsia.childNodes),\
+ getText(open_tsia.childNodes),\
+ getText(volume.childNodes),\
+ sum_date)
+
+ top_gainers = res_dom.getElementsByTagNameNS(BS_NS, 'topGainers')[0]
+ top_looser = res_dom.getElementsByTagNameNS(BS_NS, 'topLosers')[0]
+
+ gainers = top_gainers.getElementsByTagNameNS(BS_NS, 'QuoteDataBean')
+ loosers = top_looser.getElementsByTagNameNS(BS_NS, 'QuoteDataBean')
+
+ for gainer in gainers:
+ symbol = gainer.getElementsByTagNameNS(BS_NS, 'symbol')[0]
+ company_name = gainer.getElementsByTagNameNS(BS_NS, 'companyName')[0]
+ price = gainer.getElementsByTagNameNS(BS_NS, 'price')[0]
+ open = gainer.getElementsByTagNameNS(BS_NS, 'open')[0]
+ low = gainer.getElementsByTagNameNS(BS_NS, 'low')[0]
+ high = gainer.getElementsByTagNameNS(BS_NS, 'high')[0]
+ change = gainer.getElementsByTagNameNS(BS_NS, 'change')[0]
+ volume = gainer.getElementsByTagNameNS(BS_NS, 'volume')[0]
+
+ quote = QuoteDataBean(getText(symbol.childNodes),\
+ getText(company_name.childNodes),\
+ getText(price.childNodes),\
+ getText(open.childNodes),\
+ getText(low.childNodes),\
+ getText(high.childNodes),\
+ getText(change.childNodes),\
+ getText(volume.childNodes))
+ market_summary.addTopGainer(quote)
+
+ for looser in loosers:
+ symbol = looser.getElementsByTagNameNS(BS_NS, 'symbol')[0]
+ company_name = looser.getElementsByTagNameNS(BS_NS, 'companyName')[0]
+ price = looser.getElementsByTagNameNS(BS_NS, 'price')[0]
+ open = looser.getElementsByTagNameNS(BS_NS, 'open')[0]
+ low = looser.getElementsByTagNameNS(BS_NS, 'low')[0]
+ high = looser.getElementsByTagNameNS(BS_NS, 'high')[0]
+ change = looser.getElementsByTagNameNS(BS_NS, 'change')[0]
+ volume = looser.getElementsByTagNameNS(BS_NS, 'volume')[0]
+
+ quote = QuoteDataBean(getText(symbol.childNodes),\
+ getText(company_name.childNodes),\
+ getText(price.childNodes),\
+ getText(open.childNodes),\
+ getText(low.childNodes),\
+ getText(high.childNodes),\
+ getText(change.childNodes),\
+ getText(volume.childNodes))
+ market_summary.addTopLooser(quote)
+ return market_summary
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+class HoldingDisplayEntry():
+ def __init__(self, holding_id, quantity, pur_price, pur_date, quote_id, epr):
+ self.holding_id = holding_id
+ self.pur_date = pur_date
+ self.pur_price = pur_price
+ self.quantity = quantity
+ self.quote_id = quote_id
+ self.pur_basis = float(pur_price)*float(quantity)
+ quote = get_quote(quote_id, epr)
+
+ if quote is not None:
+ self.cur_price = quote.price
+ self.mark_value = float(quantity)*float(self.cur_price)
+
+ self.gain = self.mark_value - self.pur_basis
+ if self.gain > 0:
+ gain_type = "gain"
+ elif self.gain < 0:
+ gain_type = "loss"
+ else:
+ gain_type = "bal"
+ self.gain_type = gain_type
+
+class ProceesedHoldings():
+ def __init__(self, h_list, purchase_basis, market_value):
+ gain_type = 'bal'
+ self.h_list = h_list
+ self.purchase_basis = purchase_basis
+ self.market_value = market_value
+ self.gain = self.market_value - self.purchase_basis
+ if self.gain > 0:
+ gain_type = 'gain'
+ elif self.gain< 0:
+ gain_type = 'loss'
+ else:
+ gain_type = 'bal'
+ self.gain_type = gain_type
+
+ def getNumberOfHoldings(self):
+ return len(self.h_list)
+
+
+def process_holdings(holdings, epr):
+ holdings_list = holdings.getHoldings()
+ purchase_basis = 0
+ market_value = 0
+ holding_display_list = []
+ for holding in holdings_list:
+ holding_display_list.append(\
+ HoldingDisplayEntry(holding.getHoldingID(),\
+ holding.getQuantity(),\
+ holding.getPurchasePrice(),\
+ holding.getPurchaseDate(),\
+ holding.getQuoteID(),\
+ epr))
+ for holding_dis in holding_display_list:
+ purchase_basis += holding_dis.pur_basis
+ market_value += holding_dis.mark_value
+
+ return ProceesedHoldings(holding_display_list, purchase_basis, market_value)
+
+
+def buy_request(user_id, symbol, quantity, mode, epr):
+ comp_d = None
+ message = '<buy xmlns="http://trade.samples.websphere.ibm.com"><userID>'
+ message += user_id
+ message += '</userID><symbol>'
+ message += symbol
+ message += '</symbol><quantity>'
+ message += quantity
+ message += '</quantity><orderProcessingMode>'
+ message += str(mode)
+ message += '</orderProcessingMode></buy>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ order_id = res_dom.getElementsByTagNameNS(BS_NS, 'orderID')[0]
+ order_t = res_dom.getElementsByTagNameNS(BS_NS, 'orderType')[0]
+ order_stat = res_dom.getElementsByTagNameNS(BS_NS, 'orderStatus')[0]
+ open_date = res_dom.getElementsByTagNameNS(BS_NS, 'openDate')
+ if len(open_date) == 0:
+ open_d = time.ctime(time.time())
+ else:
+ open_date = res_dom.getElementsByTagNameNS(BS_NS, 'openDate')[0]
+ open_d = getText(open_date.childNodes)
+
+ comple_date = res_dom.getElementsByTagNameNS(BS_NS, 'completionDate')
+
+ if len(comple_date) == 0:
+ comp_d = time.ctime(time.time())
+ else:
+ comple_date = res_dom.getElementsByTagNameNS(BS_NS, 'completionDate')[0]
+ comp_d = getText(comple_date.childNodes)
+
+ quantity = res_dom.getElementsByTagNameNS(BS_NS, 'quantity')[0]
+ price = res_dom.getElementsByTagNameNS(BS_NS, 'price')[0]
+ order_fee = res_dom.getElementsByTagNameNS(BS_NS, 'orderFee')[0]
+ symbol = res_dom.getElementsByTagNameNS(BS_NS, 'symbol')[0]
+
+ return OrderDataBean(getText(order_id.childNodes),\
+ getText(order_t.childNodes),\
+ getText(order_stat.childNodes),\
+ open_d,\
+ comp_d,\
+ getText(quantity.childNodes),\
+ getText(price.childNodes),\
+ getText(order_fee.childNodes),\
+ getText(symbol.childNodes))
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+
+def sell_request(user_id, holding_id, quantity, epr):
+ message = '<sellEnhanced xmlns="http://trade.samples.websphere.ibm.com"><userID>'
+ message += user_id
+ message += '</userID><holdingID>'
+ message += holding_id
+ message += '</holdingID><quantity>'
+ message += quantity
+ message += '</quantity></sellEnhanced>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ order_id = res_dom.getElementsByTagNameNS(BS_NS, 'orderID')[0]
+ order_t = res_dom.getElementsByTagNameNS(BS_NS, 'orderType')[0]
+ order_stat = res_dom.getElementsByTagNameNS(BS_NS, 'orderStatus')[0]
+ open_date = res_dom.getElementsByTagNameNS(BS_NS, 'openDate')
+ if len(open_date) == 0:
+ open_d = time.ctime(time.time())
+ else:
+ open_date = res_dom.getElementsByTagNameNS(BS_NS, 'openDate')[0]
+ open_d = getText(open_date.childNodes)
+
+ comple_date = res_dom.getElementsByTagNameNS(BS_NS, 'completionDate')
+
+ if len(comple_date) == 0:
+ comp_d = time.ctime(time.time())
+ else:
+ comple_date = res_dom.getElementsByTagNameNS(BS_NS, 'completionDate')[0]
+ comp_d = getText(comple_date.childNodes)
+
+ quantity = res_dom.getElementsByTagNameNS(BS_NS, 'quantity')[0]
+ order_fee = res_dom.getElementsByTagNameNS(BS_NS, 'orderFee')[0]
+ price = res_dom.getElementsByTagNameNS(BS_NS, 'price')[0]
+ symbol = res_dom.getElementsByTagNameNS(BS_NS, 'symbol')[0]
+
+ return OrderDataBean(getText(order_id.childNodes),\
+ getText(order_t.childNodes),\
+ getText(order_stat.childNodes),\
+ open_d,\
+ comp_d,\
+ getText(quantity.childNodes),\
+ getText(price.childNodes),\
+ getText(order_fee.childNodes),\
+ getText(symbol.childNodes))
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
+
+
+def get_bs_epr(epr):
+ message = '<ns1:ClientConfigRequest xmlns:ns1="http://wso2.org/interop/stocktrader/xsd"><ns1:Client>PYTHON_CLIENT</ns1:Client></ns1:ClientConfigRequest>'
+
+ msg = message.encode('utf8')
+
+ try:
+ client = wso2.wsf.WSClient({
+ "to":epr,
+ "WSF_LOG_DIR":LOG_DIR,
+ "WSF_LOG_LEVEL":LOG_LEVEL,
+ "WSFC_HOME":WSFC_HOME,
+ "use_soap":"1.1"
+ })
+
+ response = client.request(msg)
+ if response is not None:
+ res_dom = xml.dom.minidom.parseString(response)
+ epr = res_dom.getElementsByTagNameNS(CONFIG_SERVICE_NS, 'BS')[0]
+ return getText(epr.childNodes)
+ else:
+ return None
+ except wso2.wsf.WSFault, e:
+ return None
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/settings.py
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/settings.py?rev=720802&view=auto
==============================================================================
--- incubator/stonehenge/contrib/stocktrader/python/trader_client/settings.py (added)
+++ incubator/stonehenge/contrib/stocktrader/python/trader_client/settings.py Wed Nov 26 02:55:38 2008
@@ -0,0 +1,99 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# Django settings for stock_trader project.
+import os.path
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+ # ('Your Name', 'your_email@domain.com'),
+)
+
+MANAGERS = ADMINS
+
+DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+DATABASE_NAME = '' # Or path to database file if using sqlite3.
+DATABASE_USER = '' # Not used with sqlite3.
+DATABASE_PASSWORD = '' # Not used with sqlite3.
+DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
+DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'America/Chicago'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = ''
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = '/media/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = 'vo1n!@%wjy%2z05w7$lj=!z5pa0up6tpkygck=5j6nc8ajz^dn'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source',
+# 'django.template.loaders.eggs.load_template_source',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.middleware.doc.XViewMiddleware',
+)
+
+ROOT_URLCONF = 'stock_trader.urls'
+
+TEMPLATE_DIRS = (
+ os.path.join(os.path.dirname(__file__), 'templates').replace('\\', '/'),
+ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+)
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+)
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/account.html
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/account.html?rev=720802&view=auto
==============================================================================
--- incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/account.html (added)
+++ incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/account.html Wed Nov 26 02:55:38 2008
@@ -0,0 +1,187 @@
+<!--
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+-->
+{% extends "base.html" %}
+
+{% block title %}
+ {{ page.title }}
+{% endblock %}
+
+{% block middle %}
+ <div class="main-title">
+ <h1>Account Information</h1>
+ <script type="text/javascript">
+ var thisdate = new Date();
+ document.writeln(thisdate.toLocaleString());
+ </script>
+ </div>
+ <table class="table-outer" cellspacing="0" align="center">
+ <thead>
+ <tr>
+ <th>Subtotal Buys</th>
+ <th>Subtotal Sells</th>
+ <th>Subtotal Fees</th>
+ <th>Net Impact Cash Balance</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="currency">{{ page.account_summary.total_buys }}</td>
+ <td class="currency">{{ page.account_summary.total_sells }}</td>
+ <td class="currency">{{ page.account_summary.total_tax }}</td>
+ <td class="currency">
+ {% ifequal page.impact 'loss' %}
+ <span class="price-loss">{{ page.account_summary.total_impact }}</span>
+ {% endifequal %}
+ {% ifequal page.impact 'gain' %}
+ <span class="price-gain">{{ page.account_summary.total_impact }}</span>
+ {% endifequal %}
+ {% ifequal page.impact 'bal' %}
+ <span>{{ page.account_summary.total_impact }}</span>
+ {% endifequal %}
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ {% if page.orders %}
+ <div><p><b>Total Orders Shown</b></p></div>
+ <table class="table-outer" cellspacing="0" align="center">
+ <thead>
+ <tr>
+ <th>Order ID</th>
+ <th>Order Status</th>
+ <th>Creation Date</th>
+ <th>Completion Date</th>
+ <th>Txn Fee</th>
+ <th>Type</th>
+ <th>Symbol</th>
+ <th>Quantity</th>
+ <th>Price</th>
+ <th>Total</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for order in page.orders %}
+ <tr>
+ <td>{{order.getOrderID}}</td>
+ <td>{{order.getOrderStatus}}</td>
+ <td>{{order.getOpenDate}}</td>
+ <td>{{order.getCompletionDate}}</td>
+ <td class="currency">${{order.getOrderFee}}</td>
+ <td>{{order.getOrderType}}</td>
+ <td>
+ <form action = "/quotes/" method = "post">
+ <input type="hidden" name="SYMBOLS" value="{{order.getSymbol}}"/>
+ <input type="submit" name="GETQUOTE" value="{{order.getSymbol}}"/>
+ </form>
+ </td>
+ <td>{{order.getQuantity}}</td>
+ <td class="currency">${{order.getPrice}}</td>
+ <td class="currency">${{order.getTotal}}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ </tbody>
+ </table>
+ {% endif %}
+ {% if page.account_profile%}
+ <form action = "/account" method ="post">
+ <table class="profile" cellspacing="0" width="100%">
+ <thead>
+ <tr>
+ <th>Update Account Profile:"{{page.user_from_cookie}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <table cellspacing="0" align="center">
+ <tr>
+ <td>Full Name:</td>
+ <td><input name="FULLNAME" type="text" value="{{page.account_profile.getFullName}}" id="" size="25"/></td>
+ <td>Email Address:</td>
+ <td><input name="EMAIL" type="text" value="{{page.account_profile.getEmail}}" id="" size="25"/></td>
+ </tr>
+ <tr>
+ <td>Address:</td>
+ <td><input name="ADDRESS" type="text" value="{{page.account_profile.getAddress}}" id="" size="25"/></td>
+ <td>Password:</td>
+ <td><input name="PASSWORD" type="password" value="{{page.account_profile.getPassword}}" type="text" id="" size="25"/></td>
+ </tr>
+ <tr>
+ <td>Credit Card:</td>
+ <td><input name="CREDITCARD" type="text" value="{{page.account_profile.getCreditCard}}" id="" size="25"/></td>
+ <td>Confirm Password:</td>
+ <td><input name="PASSWORD" type="password" value="{{page.account_profile.getPassword}}" id="" size="25"/></td>
+ </tr>
+ <tr>
+ <td colspan="4" class="button">
+ <input type="submit" name="UPDATEUSERPROFILE" value="Update" class="button"/>
+ </td>
+ </tr>
+ </table>
+ {% if page.account_data %}
+ <table align="center" class="profile-content" cellspacing="0">
+ <tbody>
+ <tr>
+ <td class="left">Account ID:</td>
+ <td>{{page.account_data.getAccountID}}</td>
+ <td class="left">Account Created:</td>
+ <td>{{page.account_data.getCreationDate}}</td>
+ </tr>
+ <tr>
+ <td class="left">User ID:</td>
+ <td>{{page.account_data.getProfileID}}</td>
+ <td class="left">Last Login:</td>
+ <td>{{page.account_data.getLastLogin}}</td>
+ </tr>
+ <tr>
+ <td class="left">Opening Balance:</td>
+ <td>{{page.account_data.getOpenBalance}}</td>
+ <td class="left">Total Logins:</td>
+ <td>{{page.account_data.getLoginCount}}</td>
+ </tr>
+ <tr>
+ <td class="left">Cash Balance:</td>
+ {% ifequal page.balance 'gain' %}
+ <td><span class="price-gain">${{page.account_data.getBalance}}</span></td>
+ {% endifequal %}
+ {% ifequal page.balance 'loss' %}
+ <td><span class="price-loss">${{page.account_data.getBalance}}</span></td>
+ {% endifequal %}
+ {% ifequal page.balance 'bal' %}
+ <td>${{page.account_data.getBalance}}</td>
+ {% endifequal %}
+ <td class="left">Total Logouts:</td>
+ <td>{{page.account_data.getLogoutCount}}</td>
+ </tr>
+ </tbody>
+ </table>
+ {% endif %}
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <div class="bottom">
+ <form action="/quotes/" method="post">
+ <input type="text" size="25" name="SYMBOLS" value=""/>
+ <input class="button" type="submit" name="GETQUOTE" value="Get Quote"/>
+ </form>
+ </div>
+ </form>
+
+ {% endif %}
+{% endblock %}
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/base.html
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/base.html?rev=720802&view=auto
==============================================================================
--- incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/base.html (added)
+++ incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/base.html Wed Nov 26 02:55:38 2008
@@ -0,0 +1,74 @@
+<!--
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
+ <meta name="generator" content="Adobe GoLive" />
+ <title>{% block title %}{% endblock %}</title>
+ <link href="/site_media/style.css" rel="stylesheet" type="text/css" media="all" />
+ </head>
+ <body>
+ <div id="content">
+ <div id="header">
+ <div class="logo"><img src="/site_media/images/logo.gif"></div>
+ </div>
+ <div id="header-links">
+ <table>
+ <tr>
+ <td>
+ <a href="/index">Welcome</a>
+ </td>
+ <td>
+ <a href="/home">Home</a>
+ </td>
+ <td>
+ <a href="/account">Account</a>
+ </td>
+ <td>
+ <a href="/portfolio">Portfolio</a>
+ </td>
+ <td>
+ <a href="/quotes">Quotes/Trade</a>
+ </td>
+ <td>
+ <a href="/glossary">Glossary</a>
+ </td>
+ <td>
+ <a href="/config">Config</a>
+ </td>
+ <td>
+ <a href="/login">Login/Logout</a>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div id="middle">
+ {% block middle %}
+ {% endblock %}
+ </div>
+ <div id="footer">
+ <div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+ <div style="margin-left:432px;float:left;">Powered by
+ <img align="top" src="/site_media/images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/config.html
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/config.html?rev=720802&view=auto
==============================================================================
--- incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/config.html (added)
+++ incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/config.html Wed Nov 26 02:55:38 2008
@@ -0,0 +1,41 @@
+<!--
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+-->
+
+{% extends "base.html" %}
+
+{% block title %}
+ {{ page.title }}
+{% endblock %}
+
+{% block middle %}
+ <div class="main-title">
+ <h1>Config</h1>
+ <script type="text/javascript">
+ var thisdate = new Date();
+ document.writeln(thisdate.toLocaleString());
+ </script>
+ </div>
+ <div class="login">
+ <form action="." method="POST">
+ <table>
+ {{ page.form.as_table }}
+ </table>
+ <p><input type = "submit" name = "SETENDPOINT" value = "Set" class="button"/></p>
+ </form>
+ </div>
+
+{% endblock %}
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/confirmation.html
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/confirmation.html?rev=720802&view=auto
==============================================================================
--- incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/confirmation.html (added)
+++ incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/confirmation.html Wed Nov 26 02:55:38 2008
@@ -0,0 +1,57 @@
+<!--
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+-->
+{% extends "base.html" %}
+
+{% block title %}
+ {{ page.title }}
+{% endblock %}
+
+{% block middle %}
+<div class="main-title">
+ <h1>Login</h1>
+ <script type="text/javascript">
+ var thisdate = new Date();
+ document.writeln(thisdate.toLocaleString());
+ </script>
+</div>
+<div id="confirm">
+ <h2>Trade Confirmation</h2>
+ <div class="confirm-content">
+ <form action="/quotes/" method="post">
+ {% ifequal page.op 'sell' %}
+ <p>You have requested to sell all or part of your holding {{page.holding_id}}. This holding has a total of {{page.quantity}} shares of stock {{page.symbol}}.Please indicate how many share to sell.</p>
+ <nobr>Number of Shares: <input type="text" name="QUANTITY" value="{{page.quantity}}" id="" size="10"/>
+ <input type="hidden" name="HOLDINGID" value="{{page.holding_id}}"></input>
+ <input type="submit" name="SELL" value="Sell" class="button"/>
+ {% endifequal %}
+ {% ifequal page.op 'buy' %}
+ <nobr>Number of Shares: <input type="text" name="QUANTITY" value="{{page.quantity}}" id="" size="10"/>
+ <p>You have requested to buy shares of {{page.symbol}} which is currently trading at ${{page.price}}.</p>
+ <input type="hidden" name="SYMBOL" value="{{page.symbol}}"></input>
+ <input type="submit" name="BUY" value="Buy" class="button"/>
+ {% endifequal %}
+ </form>
+ </div>
+</div>
+
+<div class="bottom">
+ <form method = "post" action = "/quotes/">
+ <input type="text" value="" name="SYMBOLS" size="25"/>
+ <input type="submit" value="Get Quote" name="GETQUOTE" class="button"/>
+ </form>
+</div>
+{% endblock %}
Added: incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/glossary.html
URL: http://svn.apache.org/viewvc/incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/glossary.html?rev=720802&view=auto
==============================================================================
--- incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/glossary.html (added)
+++ incubator/stonehenge/contrib/stocktrader/python/trader_client/templates/glossary.html Wed Nov 26 02:55:38 2008
@@ -0,0 +1,313 @@
+<!--
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+-->
+{% extends "base.html" %}
+
+{% block title %}
+ {{ page.title }}
+{% endblock %}
+
+{% block middle %}
+<div class="main-title">
+
+ <h1>Glossary</h1>
+
+ <script type="text/javascript">
+
+ var thisdate = new Date();
+
+ document.writeln(thisdate.toLocaleString());
+
+ </script>
+
+ </div>
+
+ <table align="center" class="glossary" >
+
+ <thead>
+
+ <tr>
+
+ <th>Term</th>
+
+ <th>Description</th>
+
+ </tr>
+
+ </thead>
+
+ <tbody>
+
+ <tr>
+
+ <td class="left">Account ID</td>
+
+ <td>A unique Integer based key. Each user is assigned an account ID at account creation time.</td>
+
+ </tr>
+
+ <tr>
+
+ <td class="left">Account Created</td>
+
+ <td>The time and date the users account was first created.</td>
+
+ </tr>
+
+ <tr>
+
+ <td class="left">Cash Balance</td>
+
+ <td>The current cash balance in the users account. This does not include current stock holdings.</td>
+
+ </tr>
+
+ <td class="left">Company</td>
+
+ <td>The full company name for an individual stock.</td>
+
+ </tr>
+
+ <td class="left">Current Gain/Loss</td>
+
+ <td>The total gain or loss of this account, computed by substracting the current sum of cash/holdings minus the opening account balance.</td>
+
+ </tr>
+
+ <td class="left">Current Price</td>
+
+ <td>The current trading price for a given stock symbol.</td>
+
+ </tr>
+
+ <td class="left">Gain/Loss</td>
+
+ <td>The current gain or loss of an individual stock holding, computed as (current market value - holding basis).</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Last Login</td>
+
+ <td>The date and time this user last logged in to Trade.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Market Value</td>
+
+ <td>The current total value of a stock holding, computed as (quantity * current price).</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Number of Holdings</td>
+
+ <td>The total number of stocks currently owned by this account.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Open Price</td>
+
+ <td>The price of a given stock at the open of the trading session.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Order ID</td>
+
+ <td>A unique Integer based key. Each order is assigned an order ID at order creation time.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Opening Balance</td>
+
+ <td>The initial cash balance in this account when it was opened.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Order Status</td>
+
+ <td>orders are opened, processed, closed and completed. Order status shows the current stat for this order.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Price Range</td>
+
+ <td>The low and high prices for this stock during the current trading session</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Purchase Date</td>
+
+ <td>The date and time the a stock was purchased.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Purchase Price</td>
+
+ <td>The price used when purchasing the stock.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Purchase Basis</td>
+
+ <td>The total cost to purchase this holding. This is computed as (quantity * purchase price).</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Quantity</td>
+
+ <td>The number of stock shares in the order or user holding.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Session Created</td>
+
+ <td>An HTTP session is created for each user at during login. Session created shows the time and day when the session was created.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Sum of Cash/Holdings</td>
+
+ <td>The total current value of this account. This is the sum of the cash balance along with the value of current stock holdings.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Symbol</td>
+
+ <td>The symbol for a Trade stock.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Total Logins</td>
+
+ <td>The total number of logins performed by this user.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Total Logouts</td>
+
+ <td>The total number of logouts performed by this user.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Total of Holdings</td>
+
+ <td>The current total value of all stock holdings in this account given the current valuation of each stock held.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Top gainers</td>
+
+ <td>The list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) gaining the most in price during the current trading session.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Top Losers</td>
+
+ <td>The list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) falling the most in price during the current trading session.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Trader Stock Index (TSIA)</td>
+
+ <td>A computed index of the top 20 stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) in Trade.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Trading Volume</td>
+
+ <td>The total number of shares traded for stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) during this trading session.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Txn Fee</td>
+
+ <td>The fee charged by the brokerage to process this order.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Type</td>
+
+ <td>The order type (buy or sell).</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">User ID</td>
+
+ <td>The unique user ID for the account chosen by the user at account registration.</td>
+
+ </tr>
+
+ </tr>
+
+ <td class="left">Volume</td>
+
+ <td>The total number of shares traded for this stock.</td>
+
+ </tr>
+
+ </tbody>
+
+ </table>
+{% endblock %}