Advanced Framework Training Outline

Written By: David E. Jones
Email: jonesde@ofbiz.org
Open For Business Site: http://www.ofbiz.org

Last Updated: June 2006


Target Audience

  1. Developers (especially Senior level)
  2. Architects

Pre-Requisites

  1. OFBiz Framework Introduction (Videos) - Important!
  2. Basic Java & J2EE (Servlet, JDBC, JNDI, JTA) Familiarity

Topics Covered

Part 1: Just Enough Java and J2EE

  1. The Java Classpath
  2. Servlet API & JSP
    1. Request & Response
    2. Contexts: page/screen, request, session, application
  3. JNDI
  4. JDBC
    1. Basic Concepts
    2. Basic API
    3. Transaction Isolation Levels
      1. None
      2. ReadCommitted (Recommended)
      3. ReadUncommitted
      4. RepeatableRead
      5. Serializable (NOT Recommended, Performance and Dead-locking)
  5. JTA
    1. UserTransaction & TransactionManager
    2. Transaction Control: rollback and setRollbackOnly
    3. On Pausing and Resuming Transactions

Part 2: The OFBiz Base: Containers and Components

  1. The OFBiz Base Utilities & Loader
  2. Containers
  3. Components
    1. component-load.xml (base/config, applications, framework, specialized, etc)
    2. Component Definition
      1. <component-directory>/ofbiz-component.xml
      2. Resource Loaders
      3. Classpath Entries
      4. Entity Resources
      5. Service Resources
      6. Test Resources
      7. Webapps
    3. Component Structure Conventions
      1. config
      2. data
      3. dtd
      4. entitydef (entitymodel*.xml, entitygroup.xml, eecas*.xml)
      5. lib
      6. script
      7. src
      8. servicedef (services*.xml, secas*.xml, groups*.xml)
      9. templates (email, survey, etc)
      10. testdef
      11. webapp
      12. widget
    4. The Component URI: component://<component-name>/relative-path

Part 3: The Webapp Framework, Widgets & MiniLang

  1. Basic Framework Review
  2. The Webapp Framework
    1. Control Servlet
      1. ofbiz/framework/webapp/dtd/site-conf.xsd
      2. component://<component-name>/webapp/<webapp-name>/WEB-INF/controller.xml
      3. Requests
      4. Request Events
        1. Event Context (parameters and return values)
        2. Event Handlers/Types
        3. Service Events
        4. simple-method Events
        5. Java Events
        6. Designing a new Event Handler
      5. Special Events: firstvisit, preprocessor, postprocessor, after-login
      6. Request Responses
      7. Views
        1. View Handlers/Types
        2. Designing a new View Handler
    2. Screen Widget Based Views - Templates, Widgets, etc
      1. Screen Widget
        1. Screen Definitions
        2. ofbiz/framework/widget/dtd/widget-screen.xsd
        3. component://<component-name>/widgets/**/*Screens.xml
        4. Screen -> Section
        5. Section -> Actions
        6. Section -> Widgets
        7. Section -> Conditions
        8. Screen Contexts (protected, inherited, etc)
        9. parameters Map: request attributes, request parameters, session attributes, application attributes
        10. Screen Decoration Pattern
      2. Form Widget
        1. Form Definitions
        2. ofbiz/framework/widget/dtd/widget-form.xsd
        3. component://<component-name>/widgets/**/*Forms.xml
        4. Form Element
        5. Form Actions
        6. Form Auto-Fields from Entities and Services
        7. Form Fields
        8. Form Sort Order
      3. Menu Widget
        1. Menu Definitions
        2. ofbiz/framework/widget/dtd/widget-menu.xsd
        3. component://<component-name>/widgets/**/*Menus.xml
        4. Menu Items
      4. Tree Widget
        1. Tree Definitions
        2. ofbiz/framework/widget/dtd/widget-tree.xsd
        3. component://<component-name>/widgets/**/*Trees.xml
        4. Tree Nodes
      5. BeanShell
        1. Data Preparation Actions
        2. http://www.beanshell.org
        3. component://<component-name>/webapp/<webapp-name>/WEB-INF/actions/**/*.bsh
        4. Java Syntax, with some scripting like features
        5. Dynamic Types
      6. FreeMarker
        1. Content Templates
        2. http://www.freemarker.org
        3. component://<component-name>/webapp/<webapp-name>/**/*.ftl
        4. PHP-like Syntax with Java Robustness and Flexibility
        5. Control Constructs (#if/#else/#elseif, #list, #assign)
        6. Built-ins
        7. Existence Concept and Fail-Fast (?exists, ?has_content, ?if_exists)
        8. OFBiz-specific Transforms: ofbizUrl, ofbizContentUrl, etc
      7. Generating PDFs (or other print formatted documents)
        1. Introduction to XSL:FO - Like HTML, but for Page Oriented Layout
        2. A Powerful Combination: Screen Widget, BeanShell, FreeMarker, and FOP
        3. How to Setup the view-map in controller.xml
    3. JPublish Based Views - Generic Templates
      1. JPublish
        1. Page Definitions
        2. http://www.jpublish.org
        3. component://<component-name>/webapp/<webapp-name>/WEB-INF/jpublish.xml
        4. component://<component-name>/webapp/<webapp-name>/WEB-INF/pagedefs/**/*.xml
        5. Page Variables
        6. Decoration Templates
        7. Content, Template, and Page Actions
      2. Just as in Screen Widget use BeanShell for data preparation and FreeMarker for temapltes
    4. Region Based Views - Servlet/JSP Templates
      1. ofbiz/framework/webapp/dtd/regions.xsd
      2. Region Framework
        1. Defining Template Based Regions
        2. Defining Inheritance or Region Based Regions
        3. Using, or Not Using, Sections
      3. OFBiz Taglib
        1. URL Tags
        2. Conditional Tags
        3. Flow Control Tags
        4. Data Presentation Tags
        5. Internationalization Tags
        6. Service Engine Tags
        7. Other Tags
  3. MiniLang
    1. ofbiz/framework/minilang/dtd/simple-methods.xsd
    2. *Services.xml, *SimpleMethods.xml, et cetera
    3. simple-map-processor
      1. General Concept
      2. Make In String Operations
      3. Process Field Operations
    4. simple-method
      1. General Concept
      2. Call Operations
      3. Java Call Operations
      4. Control and Error Handling Operations
      5. Event Specific Operations
      6. Service Specific Operations
      7. Method Environment Operations
      8. Entity Engine Misc. Operations
      9. Entity Engine Find Operations
      10. Entity Engine Value Operations
      11. Entity Engine List Operations
      12. Entity Engine Transaction Operations
      13. Conditional (If) Operations
      14. Other Operations
    5. Some Examples

Part 4: The Entity and Service Engines

  1. The Entity Engine
    1. ofbiz/website/docs/entity.html
    2. ofbiz/website/docs/entityconfig.html
    3. Architecture & Design Goals
      1. Database (or datasource) Agnostic
      2. Dynamic API Behaves According to Entity Definitions
      3. Minimal Redundancy from Data Layer Artifacts (easier implementation and maintenance)
      4. Uses JDBC and JTA J2EE Components
        1. Can operate in the same transaction with EJB, JDO, Hibernate, etc code
        2. Can drop down to JDBC when necessary
      5. Choice of Tools for Ease/Efficient or Flexibility
    4. Configuration
      1. ofbiz/framework/entity/dtd/entity-config.xsd
      2. ofbiz/framework/entity/config/entityengine.xml
      3. Transaction (JTA) Setup
      4. Delegators
      5. Datasources
      6. JDBC Drivers (ofbiz/framework/entity/lib/jdbc)
      7. Distributed Cache Clearing
    5. Entity Groups & Delegation
      1. ofbiz/framework/entity/dtd/entitygroup.xsd
      2. entitydef/entitygroups*.xml
    6. Entity Definitions
      1. ofbiz/framework/entity/dtd/entitymodel.xsd
      2. entitydef/entitymodel*.xml
      3. Entities
      4. Fields
      5. Primary Keys
      6. Relationships
    7. View Entity Definitions
      1. Member Entities
      2. Field Aliases
      3. View Links
      4. Relationships
      5. Joins: Inner & Outer
      6. Grouping and Summary Data
    8. The GenericDelegator API
      1. Factory Methods (GenericDelegator, GenericPK, GenericValue)
      2. Creating, Storing & Removing
      3. Finding
        1. By Primary Key
        2. By And
        3. By Condition
          1. EntityConditions
            1. EntityFieldMap
            2. EntityExpr
            3. EntityConditionList
            4. EntityWhereString (caution)
        4. The EntityListIterator (remember to close)
      4. Caching
        1. Theory of Operation
        2. UtilCache & The Webtools Cache Page
        3. Automatic & Manual Cache Clearing
        4. Distributed Cache Clearing Note
    9. The GenericEntity API
      1. GenericPK
      2. GenericValue
    10. Overview of GenericHelper Interface
    11. Entity ECA (Event-Condition-Action) Rules
      1. ofbiz/framework/entity/dtd/entity-eca.xsd
      2. entitydef/eecas*.xml
      3. When to Use an Entity ECA: Data Maintenance, not Business Processes
      4. Defining Entity ECAs
      5. Limitations
  2. The Service Engine
    1. Architecture & Design Goals
      1. Agnostic Service Calls
        1. Implementation Agnostic
        2. Location Agnostic
      2. Synchronicity Support
      3. Parameter Validation
      4. Service Engines
        1. The GenericEngine Interface
        2. Overview of Existing Engines
          1. See definitions in serviceengine.xml, in the engine element
          2. simple
          3. java
          4. interface
          5. group
          6. route
          7. Remote: rmi, jms, soap
          8. Scripting: bsh, jacl, javascript, jpython
          9. workflow (Shark Workflow Engine, not old OFBiz Workflow Engine)
        3. Designing a New Engine
    2. Service Engine Configuration
      1. website/docs/serviceconfig.html
      2. ofbiz/framework/service/dtd/service-config.xsd
      3. ofbiz/framework/service/config/serviceengine.xml
      4. JNDI Servers & Resource Loaders
      5. Global Service Definition Files
      6. Service Group and SECA Rule Files
      7. JMS Servers
    3. Advanced Service Definitions
      1. ofbiz/framework/service/dtd/services.xsd
      2. servicedef/services*.xml
      3. Parameters and Validation
      4. Interface Services
      5. Service Authentication
      6. Transaction Control
        1. use-transaction
        2. require-new-transaction
        3. transaction-timout
    4. Remote Services
      1. JMS Services
      2. HTTP Services
    5. Implementing Services
      1. Service Context (parameters and return values)
      2. Java Services
      3. Bean Shell Services
      4. simple-method Services
    6. Calling Services
      1. Synch & Asynch
      2. Scheduled Services
      3. Calling From:
        1. Java
        2. simple-method
        3. Control Servlet
    7. Service Groups
      1. ofbiz/framework/service/dtd/service-group.xsd
      2. servicedef/groups*.xml
      3. Defining Groups
        1. Groups
        2. Services Per Group
    8. Service Event-Condition-Action (ECA) Rules
      1. ofbiz/framework/service/dtd/service-eca.xsd
      2. servicedef/secas*.xml
      3. Defining ECA Rules
        1. Events
        2. Conditions Per Event
        3. Actions Per Event
    9. Service Engine RemoteDispatcher
      1. JNDI & RMI Basics
      2. rmi-dispatcher Container (in ofbiz-containers.xml)
      3. ExampleRemoteClient.java
    10. Service Mail-Condition-Action (MCA) Rules
      1. ofbiz/framework/service/dtd/service-mca.xsd
      2. servicedef/smcas*.xml
      3. Mail Client Setup (ofbiz-containers.xml)
      4. Defining MCA Rules
        1. Field Conditions
        2. Header Conditions
        3. Service Conditions
        4. Actions

Part 5: The Workflow Engine, Data Files, etc

  1. The Workflow Engine
    1. Process Management Concepts
      1. Workflow Style
        1. States & Transitions
        2. WfMC & OMG
        3. OFBiz Workflow
        4. Shark & JaWE
      2. Message Flow Style
        1. Messages & Nodes (consumers & producers)
        2. ebXML BPSS (Business Process Specification, like interface)
        3. BPML & BPMI
        4. SOAP Related Standards
    2. Workflow Concepts
      1. Processes
      2. Activities
        1. Manual Start/End
        2. Automatic Start/End
      3. Transitions
      4. Splitting and Merging
      5. Workflow Data Context
      6. Asynchronous Execution
    3. Workflow Engine Architecture
      1. Service Engine Based
        1. Calling Workflows Through Service Engine
        2. Calling Other Services in a Workflow
      2. Uses Entity Engine for Workflow Definition and Run-Time Data Persistence
    4. Designing Workflows
      1. What Needs to be Done?
      2. Who Will Do What?
      3. What Dependencies Exist Between Activities?
    5. Defining Workflows
      1. Basic XPDL
      2. Working With Parties, Groups, and Roles
      3. OFBiz Extensions
    6. Importing and Managing Workflow Definitions
    7. Running Workflows
    8. Interacting With Running Workflows
    9. Client API (UI development)
    10. Monitoring & Testing Workflows
  2. The Data File Tool
    1. The Wonderful World of Flat Files
    2. Generic Data Structures for Flat File Data (very similar to the Entity Engine structures)
    3. Defining Data Files
    4. The Data File API

Part 6: Review, Q&A

  1. Review
  2. Q&A