Building Logic Tutorial - BusLogicIntro

Under construction.

Create Project BusLogicIntroOX

Create project as described below.  All required artifacts (source, jars, etc) are at the bottom of this page - download them using the arrow on the right (don't just click the name!):
  1. Create Java project named per title in  OpenXava worksapce
  2. Run OpenXavaTemplate/CreateNewProject.xml
  3. Copy the web.WEB_INF.lib.zip jars 
  4. Add autobizlogic and buslogicext to your classpath
  5. Add Library jUnit4 to your classpath
  6. Copy in the src and test folders, and add test to the source path
    1. See here for database structure
Minor issue: BusLogicIntroTest required a line to be commented out.  Don't know why.

Configure Persistence

Configure persistence/META-INF/persistence.xml:

<!-- Activate ABL -->

<property name="hibernate.current_session_context_class" value="com.autobizlogic.abl.session.LogicThreadLocalSessionContext"/>        



Configure tomcat (in Servers/Tomcat v6.0 Server at localhost-config/context.xml):

<Resource name="jdbc/BusLogicIntroOXDS" 
    auth="Container" type="javax.sql.DataSource"
    maxActive="20" maxIdle="5" maxWait="10000"
    username="root" password="" 
    driverClassName="com.mysql.jdbc.Driver"
    defaultCatalog="buslogicintro"
    url="jdbc:mysql://localhost/buslogicintro"/>


Create MySQL database BusLogicIntro

Create the MySQL physical database called buslogicintro, then use the sql scripts (bottom of page) to create the tables and rows.


Issues


Tree - nodeProperties undefined

Tried to follow this documentation (find tree on the page), but ran http://localhost:8080/BusLogicIntroOX/modules/Department with the following result:



Resolved Issues


Open Purchaseorder with "node properties undefined" - define an @view

If you attempt to use a complicated database, and observe OpenXava stack traces with "Node Properties undefined", try defining an @view.  For example, BusLogicIntro was made to work with the following:


@View (members="orderNumber, amountTotal, amountUnPaid, amountPaid;" + 

                "Items {lineitems}," +

                "PaymentAllocations {paymentPurchaseorderAllocations}" +

                "LineItemUsages {lineitemUsages} ")

public class Purchaseorder implements java.io.Serializable {



Naviox does not open - additional instructions

You may encounter issues getting Naviox to run, as shown below.   In the case of BusLogicIntro, these were resolved as described in Working with OpenXava.



ċ
buslogicintro create rows.sql
(3k)
Val Huber,
Jun 30, 2012, 9:09 PM
ċ
buslogicintro create tables.sql
(14k)
Val Huber,
Jun 30, 2012, 5:46 PM
ċ
src.zip
(144k)
Val Huber,
Jun 30, 2012, 9:09 PM
ċ
test.zip
(53k)
Val Huber,
Jun 30, 2012, 4:04 PM
ċ
web.WEB-INF.lib.zip
(8923k)
Val Huber,
Jun 30, 2012, 3:49 PM
Comments