jsp interest java sun

Document Sample
jsp interest java sun Powered By Docstoc
					BroadVision 4.0



Ganesh Siddhamalli
http://gsspageat.webjump.com
Agenda
•   Introduction and Overview
•   BV Component - I
•   BV Component - II
•   BV Database
•   Targeted Content
Pre-requisites
  –   UNIX
  –   C++
  –   Javascript
  –   Basic OO A & D
  –   Basics of RDBMS
  –   CORBA
  –   Basics of Web Architecture
       • HTTP
       • CGI
       • HTML
What is BV ?
• System designed for Rapid Application
  Development and Real Time operation of
  large web based business solutions.
• High Transaction volumes and can easily
  integrated with existing systems.
• Application Server + Framework + Application
  Development Environment.
• Can Build Applications that are Secure,
  Powerful, Scalable and Flexible.
What is one-to-one
• Marketing Model
• 1-1 focuses on the individual and tailors the
  marketing to individual’s interest and need.
• The content displayed to a user can be
  individualized based on pre-defined rules.
• These rules use the user profile or the
  previous visit history of the user.
BV - Web Apps
• Pre-built web application frameworks that
  can be customized to the needs.
• Commerce Web App
• Financial Web App
• Knowledge Web App

• Commerce Web App is the most mature.
BV - Commerce Web
• Personalization
  –   Observed Info
  –   Stated Info(Profile)
  –   Transaction Info
  –   Matching
• Shopping
  –   Anonymous & Registered
  –   Shopping Cart
  –   Shopping List : Shared, Personal
  –   Search : Parametric, text, category
BV - Commerce Web (..Contd)
  – Marketing, promotions, incentives
  – Discussion Groups
  – Alerts : Web, email & more
• Transactions
  –   Order management
  –   Payment Processing
  –   Pricing, shipping, handling, tax
  –   Security
  –   APIs
BV - Commerce Web (..Contd)
• Administration/ Tools
  –   Content Administration
  –   Reporting
  –   Rules Administration
  –   Template Creation
  –   User Administration
BV - Financial Web
• Core Banking transactions
• Bill Payment
• Adapter to Checkfree’s remittance Pipeline
  Processing(RPP) engine for payment
  processing
• Download data into Quicken, spreadsheets
• Alerts & Stock Quotes
• Customer Service
• Financial Server
• Sample Application
BV - Financial Web
• Core Banking transactions
• Bill Payment
• Adapter to Checkfree’s remittance Pipeline
  Processing(RPP) engine for payment
  processing
• Download data into Quicken, spreadsheets
• Alerts & Stock Quotes
• Customer Service
• Financial Server
• Sample Application
BV - Architecture
Layers         Elements                                       Roles




Presentation   Templates                                      Template Developers




Business       Business Rules & Contents                      Business Managers




Application                     One-to-One                    Application Developers
                 Componets – Database Accessors – Open APIs



               Database – External Systems – File System      Database Admins
BV Component Architecture
JS             CR               CI        External
                                          Services

• JavaScript Layer
     – allows BV components to be used in pages
• Component Reference Layer
     – passes messages between JS Layer and
       implementation
• Component Implementation Layer
     – does the heavy lifting
Benefits of BV Comp. Arch.
• Abstraction
  – separation between application logic (scripts)
    and implementation (components)
• Portability
  – scripts are portable across platforms
• Performance
  – can architect distribution of app logic between
    scripts and components to optimize
    performance
Benefits of BV Comp. Arch.
(..contd)

• Productivity
  – Component developers, script developers and
    GUI designers can each do their own thing.
• Scalability
  – can add components without distributing
    existing system
BV Arch - Components
• Components are standalone entities
• Components may be very light, or may
  represent an entire vertical slice of your
  system
• Components may run in several different
  environments … interfaces are key
BV Built-in Components
• System
  – Process
     • Similar to Application Variable
     • BV stores the process data
     • Control Info.
  – Session
  – Logging
     • Logs only BV Logs
  – Request
  – Response
  – Error Handling
BV Built-in Components
• Application
  – Visitor
     • Will help to log as who, when logs to BV
  – Content
     • to create dynamic web pages
  – Observation
     • can use 3rd party Report generators
  – Search
     • Text, Content-base search
  – Alert
     • Email - HTTP Content - MIME type
BV Process Architecture
                                                              Script Pre-
                                                              processor
                                      JSP Files

  Browser
               Interaction Manager
                       with                                          Script
                    Embedded                                         Cache
                Javascript Engine
  HTTP
  Server

                                                  Supporting Files & Tools

                                                                            Component
                                                  Component
                One - to-One Server                                         Interface
                                                  Interface
    Dynamic                                                                 File
                                                  Compiler
    Command
    Center                                                                  C++
                                                  C++
                                                                            Component
                                                  Compiler
                                                                            Files
                       DB




• Browser
  – Visitor Point of Contact with site HTTP Server
                                                                  Script Pre-
                                                                  processor
                                          JSP Files

    Browser
                   Interaction Manager
                           with                                          Script
                        Embedded                                         Cache
                    Javascript Engine
    HTTP
    Server

                                                      Supporting Files & Tools

                                                                                Component
                                                      Component
                    One - to-One Server                                         Interface
                                                      Interface
      Dynamic                                                                   File
                                                      Compiler
      Command
      Center                                                                    C++
                                                      C++
                                                                                Component
                                                      Compiler
                                                                                Files
                           DB


HTTP Server
  Site’s connection with WWW
  BV adds the interface that forwards visitor request to an IM
  running on a specific machine.
                                                                 Script Pre-
                                                                 processor
                                         JSP Files

    Browser
                  Interaction Manager
                          with                                          Script
                       Embedded                                         Cache
                   Javascript Engine
    HTTP
    Server

                                                     Supporting Files & Tools

                                                                               Component
                                                     Component
                   One - to-One Server                                         Interface
                                                     Interface
      Dynamic                                                                  File
                                                     Compiler
      Command
      Center                                                                   C++
                                                     C++
                                                                               Component
                                                     Compiler
                                                                               Files
                          DB



Dynamic Command Center (DCC)
   UI for creating and maintaining Business Rules
                                                                   Script Pre-
                                                                   processor
                                           JSP Files

    Browser
                   Interaction Manager
                           with                                           Script
                        Embedded                                          Cache
                    Javascript Engine
    HTTP
    Server

                                                       Supporting Files & Tools

                                                                                 Component
                                                       Component
                     One - to-One Server                                         Interface
                                                       Interface
      Dynamic                                                                    File
                                                       Compiler
      Command
      Center                                                                     C++
                                                       C++
                                                                                 Component
                                                       Compiler
                                                                                 Files
                            DB




JSP Files (Page Scripts)
   text file .jsp containing server-side Javascript, HTML, text,
   Component Reference
                                                                 Script Pre-
                                                                 processor
                                         JSP Files

    Browser
                  Interaction Manager
                          with                                          Script
                       Embedded                                         Cache
                   Javascript Engine
    HTTP
    Server

                                                     Supporting Files & Tools

                                                                               Component
                                                     Component
                   One - to-One Server                                         Interface
                                                     Interface
      Dynamic                                                                  File
                                                     Compiler
      Command
      Center                                                                   C++
                                                     C++
                                                                               Component
                                                     Compiler
                                                                               Files
                          DB


Interaction Manager(IM)
    Comm. & Process control for handling HTTP requests
    Controls processing page scripts
    Controls interactions with underlying 1-to-1 servers
                                                                Script Pre-
                                                                processor
                                        JSP Files

   Browser
                 Interaction Manager
                         with                                          Script
                      Embedded                                         Cache
                  Javascript Engine
   HTTP
   Server

                                                    Supporting Files & Tools

                                                                              Component
                                                    Component
                  One - to-One Server                                         Interface
                                                    Interface
     Dynamic                                                                  File
                                                    Compiler
     Command
     Center                                                                   C++
                                                    C++
                                                                              Component
                                                    Compiler
                                                                              Files
                         DB



Embedded Javascript Engine
  NS JS engine embedded directly into the IM
                                                                  Script Pre-
                                                                  processor
                                          JSP Files

    Browser
                   Interaction Manager
                           with                                          Script
                        Embedded                                         Cache
                    Javascript Engine
    HTTP
    Server

                                                      Supporting Files & Tools

                                                                                Component
                                                      Component
                    One - to-One Server                                         Interface
                                                      Interface
      Dynamic                                                                   File
                                                      Compiler
      Command
      Center                                                                    C++
                                                      C++
                                                                                Component
                                                      Compiler
                                                                                Files
                           DB


Script Pre-Processor
    Converts a Page Script into pure SSJS
                                                                 Script Pre-
                                                                 processor
                                         JSP Files

    Browser
                  Interaction Manager
                          with                                          Script
                       Embedded                                         Cache
                   Javascript Engine
    HTTP
    Server

                                                     Supporting Files & Tools

                                                                               Component
                                                     Component
                   One - to-One Server                                         Interface
                                                     Interface
      Dynamic                                                                  File
                                                     Compiler
      Command
      Center                                                                   C++
                                                     C++
                                                                               Component
                                                     Compiler
                                                                               Files
                          DB



Script Cache
    Cache of compiled page scripts
                                                                 Script Pre-
                                                                 processor
                                         JSP Files

    Browser
                  Interaction Manager
                          with                                          Script
                       Embedded                                         Cache
                   Javascript Engine
    HTTP
    Server

                                                     Supporting Files & Tools

                                                                               Component
                                                     Component
                   One - to-One Server                                         Interface
                                                     Interface
      Dynamic                                                                  File
                                                     Compiler
      Command
      Center                                                                   C++
                                                     C++
                                                                               Component
                                                     Compiler
                                                                               Files
                          DB

Component Interface Files
  Defines interface between C++ and Javascript
  defines methods & Attr. Accessible from pge scripts
  file .jsi
                                                                 Script Pre-
                                                                 processor
                                         JSP Files

   Browser
                  Interaction Manager
                          with                                          Script
                       Embedded                                         Cache
                   Javascript Engine
    HTTP
    Server

                                                     Supporting Files & Tools

                                                                               Component
                                                     Component
                   One - to-One Server                                         Interface
                                                     Interface
     Dynamic                                                                   File
                                                     Compiler
     Command
     Center                                                                    C++
                                                     C++
                                                                               Component
                                                     Compiler
                                                                               Files
                          DB


Component interface Compiler
  Generates C++ Source code with callbacks of JS engine
                                                                 Script Pre-
                                                                 processor
                                         JSP Files

   Browser
                  Interaction Manager
                          with                                          Script
                       Embedded                                         Cache
                   Javascript Engine
    HTTP
    Server

                                                     Supporting Files & Tools

                                                                               Component
                                                     Component
                   One - to-One Server                                         Interface
                                                     Interface
     Dynamic                                                                   File
                                                     Compiler
     Command
     Center                                                                    C++
                                                     C++
                                                                               Component
                                                     Compiler
                                                                               Files
                          DB


C++ Component Files
  Javascript - Visible C++
                                                                  Script Pre-
                                                                  processor
                                          JSP Files

    Browser
                   Interaction Manager
                           with                                          Script
                        Embedded                                         Cache
                    Javascript Engine
    HTTP
    Server

                                                      Supporting Files & Tools

                                                                                Component
                                                      Component
                    One - to-One Server                                         Interface
                                                      Interface
      Dynamic                                                                   File
                                                      Compiler
      Command
      Center                                                                    C++
                                                      C++
                                                                                Component
                                                      Compiler
                                                                                Files
                           DB


Shared Library of Components
   Shared object libraries loaded by IM when it fires up
Flow of the Application
 • Visitor requests for the Page from the
   Browser
 • HTTP server processes request via BV CGI
   or NSAPI interface, connects to IM
   – IM gets path from CGI environment and
     validates it
 • IM checks script cache for a compiled
   script
   – if no script, IM runs pre-processor and caches
     compiled script
Flow of the Application (..contd)

 • IM runs compiled script in embedded JS
   engine
 • Embedded JS engin processes component
   invocation
 • IM sends back result to HTTP server
 • HTTP server delivers HTML page to server.
 Interaction Manager
• Manages application requests from site and
  returns the requested information
• Maintains association between visitors and
  browser requests
• Loads and runs scripts
• Works with secure HTTP servers to process
  encrypted information
• Maintains conn. between app and BV servers.
• Manages caches(profiles, content, categories,
  scripts)
Interaction Manager (..Contd)
• Multi-threaded Process
  – connection Manager handles multiple,
    simultaneous tasks
  – Requests are sent to the connection Manager,
    which tracks the status of the various engines
  – IM can run multiple engines to distribute the
    workload.
  – It is scalable and is limted only by the
    hardware of the host machine.
BV Components
BV Component
• What is a BV Component
• How to Use BV component
• Commonly used BV Components
What is BV Component
• BV does everything with SSJS.
• All the Javascript components are executed
  in IM.
• The Javascript layer of the BV architecture
  allows BV components to be used in
  Javascript scripts.
What is BV Component (..contd)
• All the dynamic page scripts utlize
  Javascript Components exclusively.
• All Presentation logic should be performed
  in the Javascript Layer and not the business
  logic.
• Sorting and searching, you should write in
  C++ rather than Javascript.
What is BV Component (..contd)
• Javascript Componet Prefix
  – BVI
• C++ Components Prefix
  – BVC
How to use BV Component
• Creating BV components is done via the
  new keyword rather than accessing creator
  method :
  – var oContMgr = new
    BVI_ContentManager(“on_line”);

  – oCont = oContMgr.contentbyQuery(…);
Commonly Used Components
•   BVI_Request      •   BVI_Content
•   BVI_Response     •   BVI_ContentList
•   BVI_Session      •   BVI_ContentManager
•   BVI_Visitor      •   BVI_Category
•   BVI_Properties   •   BVI_Multivaluetable
BVI_Request

  • Why Use it ?
    – Get values sent from client
    – Get values sent from web server
    – Encode special characters in URLs
  • Where to Use it
    – Whenever the input from the client or web
      server is required.
BVI_Request (…Contd)
• How to Use it
  – Instantiating a BVI_Request obejct
     • automatically instantiated by BV once for each JSP
     • Object Name : Request
     • Globally vailable within all SSJS functions
  – Get variables sent from client in <Form> tages
    or URL arguments
     •   Use .value() or .values() accessor methods
     •   Pass in name as a string
     •   Receive back the value as a string or BVI_StringList
     •   .url_encode() to escape the special characters in
         url’s before placing on HTML page.
BVI_Request (…Contd)
• How to Use it
  – Examples
     • var firstname = Request.value(‘first_name’);
     • var listcolors = Request.values(‘colors’);
  – Add new ites to Request Object
     • Request.add_attribute(“tempval”,”5”);
  – CGI Environment Variables
     • HTTP_COOKIE, HTTP_HOST
     • var cookies = request.HTTP_COOKIE;
     • will return the string and will have to parse the
       string.
BVI_Response
• Mirror image of BVI_Request
• Way to communicate back to the client.
• Whatever goes into Response buffer gets
  passed back to the web server and passed
  back to the client.
• Why Use it ?
  – Send output to client
  – Redirect page processing flow
BVI_Response (…Contd)
• Where to Use it ?
  – JS routines that directly write output to the
    output buffer.
  – The HTML is wrapped up into a Response.write
    automatically by BV.
• Instantiating a BVI_Response Object
  – automatically instantiated by BV once for each
    JSP
  – Object name : Response
  – Globally available within all SSJS functions
BVI_Response (…Contd)
• Send output to the client
  – Response.write(‘Last Name: ’+lastname);
• Redirect Page Processing
  – .localRedirect()
     •   pass relative file reference
     •   Do not pass any query string parameters
     •   Session and Request objects are preserved
     •   BV processes redirection on server
     •   Use Return() to halt processing of currect page.
     •   Client’s URL doesn’t change.
     •   Response.locatRedirect(‘main/home_page.jsp’);
BVI_Response (…Contd)
• Redirect Page Processing
  – . redirect()
     • pass full URL : ‘http:[//server]/path/filename?query’
     • Results in additional call to serverr by client
     • Client’s URL changes
     • Response.redirect(‘http:/bin/my_im/main/home_p
       age.jsp’);
     • If no server name is used, by default, the browser
       will use the last referenced server.
BVI_Response (…Contd)
• .redirect() and .localRedirect() flush the
  headers before redirecting
  – HTTP header can be used to set cookies on the
    browser.
  – If you set a cookie on Page ‘A’ then redirec to
    page ‘B’ the cookie is lost from the HTTP
    response header.
BVI_Session
• Identifies a unique connection to the
  application and maintains state across
  pages.
• Session is consistent across each of client
  requests - parameters along on the URL is
  must.
• Can store info. As a property of a session
  object, then access the same from another
  page script.
BVI_Session (…Contd)
• Why use it ?
  – Set current visitor after authentication
  – Save application State on server
  – Get session parameters to preserve session
    for
     • URL’s
     • HTML forms
• Where to use it
  – Pages that need to Maintain
     • user authentication or
     • application state
BVI_Session (…Contd)
• How to Use it
  – Automatically instanticated by BV once for
    each JSP
  – Object Name : Session
  – Globally available within all SSJS functions
  – Automatically preserved when BV_EngineID
    and BV_SessionID parameters are passed
    between pages.
  – Set Current visitor after authentication
     • Can be saved on the session to use in later pages.
BVI_Session (…Contd)
• How to Use it
  – Get session parameters to preserve session
    for URLs and HTML forms
     • To maintain session across Javascript pages the
       BV_EngineID and BV_SessionID parameters must
       be passed
        – on the URL query string or
        – as hidden fields on HTML forms
  – Can Store Primitive datatypes and BVI objects
     • Cannot store Javascript objects
     • To Free the Memory
        – Session.myvalue = null;
BVI_Session (…Contd)
• initSessionState()
  – will initialise useful session data onto the
    session object.
• setCurrentVisitor()
  – Will set the Id of the Visitor
• makeScriptURL()
  – Puts session parameters onto a URL.
BVI_Visitor
• Encapsulates methods and properties of
  the visitor. E.g. passowrd, visitor Id etc.,
• Why Use it ?
  – Get/set single/multiple visitor attributes
  – Register Guests
• Where to use it ?
  – Registration
  – Authentication
  – Profile updates
BVI_Visitor (…Contd)
• How to Use it ?
  – Instantiating a BVI_Visitor Object
     • Transient Guests
        – created for free, when a new session is created.
        – are visitor objects created automatically with new
          session objects
        – their profile is only in RAM, lost when session objects
        – useful for sites that do NOT require registration but track
          user information during visits
     • Permanent Guests
        – are visitors whose profile information is stored in the db
          but cannot be used to login ever again
BVI_Visitor (…Contd)
• How to Use it ?
  – Instantiating a BVI_Visitor Object
     • Members
        – are registered visitors whose profile information is
          stored in the database and can be retrieved on
          subsequent visit to the site.
        – Registered visitors can be retrieved using
          BVI_VisitorManager.visitor()
     • Examples (Single Attribute)
        – var username = visitor.USERNAME;
        – visitor.CITY = ‘Atlanta’;
BVI_Visitor (…Contd)
• How to Use it ?
  – BVP_Properties object can be used to quickly
    update multiple visitor attributes in one
    operation
  – Examples (Multiple Attributes)
     propertyList = new BVI_Properties();
     propertyList.CITY = ‘Wahsington D.C’;
     propertyList.STATE = ‘DC’;
     propertyList.COUNTRY= ‘USA’;
     visitor.updateProperties(propertyList);
BVI_Visitor (…Contd)
• How to Use it ?
  – Registered Guests
     • using .registerGuest() method
     • visitor.registerGuest(username,password,true);
  – .PASSWORD is write-only
     • Is a setter and not a getter.
     • Use .isPasswordValid() to authenticate visitors
BV Component II
BVI_ContentManager
• What is Content ?
  – Is the stuff, that is dynamically generated to
    make up the website :
     • Products, Tables, Catalogs
  – Content is displayed in the browser as the
    result of a database Query.
  – Tool that is used to access items in the
    database.
  – Examples
     • For shopping cart catalog
     • Customer content types
BVI_ContentManager (…Contd)
• Returns a BVI_ContentList or BVI_Content
  object
  – BVI_ContentList - zero or more content items
  – BVI_Content - zero or one object - Single item.
• contentByCondition()
  – method that requires a list of attributes
    (columns) to return.
     • Use a BVI_StringList object and use the .append
       method to set desired attributes.
BVI_ContentManager (…Contd)
• Example
  var oAttrList = new BVI_StringList();
  oAttrList.append(“price”);
  oAttrList.append(“description”);
  var oContList =
    oContMgr.contentByCondition(“device_type =
    ‘CD_ROM’”, “RAC”,”Devices”,oAttrList);
BVI_ContentManager (…Contd)
 – ContentByJoin()
   • references multiple tables and does a SQL JOIN
     command
 – contentByOID()
   • When a particular BV Object ID is know
      – returns a single BVIContent object
 – maxReturn property controls the maximum
   number of rows returned from any single
   query.
BVI_ContentList
• Represents a list of contents
• Each element in the list has the same
  content type and belongs to the same
  service.
• List can sorted.
• Returned from BVI_ContentManager
• Returned by other BVI_ContentList
  methods
• .length method returns the number of
  elements in the list
BVI_ContentList (…Contd)
• .get method is used to retrieve an
  individual
• Example
  for (iNdx = 0;iNdx<oContList.length;++iNdx)
     oCurCont = oContList.get(iNdx);
• .cursor property to set the current location
  in the list
• List is ‘0-based’
BVI_Content
• Represents the content - Table
• Used to get columns from a database.
• When a specific values of an objects is
  required.
• Returned from
  BVI_ContentManager.contentByOID() or
  from BVI_ContentList.get()
• .get() method to retrieve an attribute
  (column) as a BVI_Value object.
  BVI_Content (…Contd)
• New Content objects can be created and added
  to the database
  var oNewCont = new BVI_Content(“RAC”,”Editorials”)
• Changes made to BVI_Content object are not
  transmitted to persistent storage - Database
• To update the content values
  – BVI_ContentManager.updateContent() method
  BVI_Value
• Use it to receive results when the return type is
  not known in advance.
• Can be used to read data off of fields once you
  have a Content Object instantiated.
• Why use it ?
  – To access field values of database table using BV
    objects such as :
     • BVI_Visitor
     • BVI_Content
     • BVI_Category
  BVI_Value (…Contd)
• Where to use it ?
  – Anywhere database reads and writes are performed
    using BV objects
  – Any database values can be accessed.
  BVI_Category
• It is the interface to a hierarchical storage area
  for content.
• It has the methods to retrieve content and
  subcategories based on category membership.
• Allows you to create a hierarchical
  organizations of similar products.
• Why to Use it ?
  – Navigate through the hierarchical tree of categories
    for a content type.
  – Retrieve the content stored in a given category.
  BVI_Category (…Contd)
• Where to use it ?
  – Applications where content is grouped or organized
    hierarchically.
  – Used to retrieve a list of things that have been stored
    in the category.
  – Example - Shopping Cart
     • Computer - > Monitor/Printer/Keyboard
  – Selecting the root category can be done with
     • BVI_ContentManager.categoryInfo
  BVI_Category (…Contd)
• Example
  var contentManager - new BVI_ContentManager();
  var category =
    contentManager.categoryInfo(‘/clothing/shirts/rug
    by’,’myservice’,’mycontenttype’);
  var parent = category.parentOID; // rugby’s parent id
  var parentCategory =
    contentManager.categoryInfo(parent,’myservice’,’m
    yContentType’); // same as saying /clothing/shirts
  BVI_Category (…Contd)
• Navigate category hierarchy using
  parentCategory() and childCategory()
• Example
  var childCats = rootCategory.childCategories();
  var category = childCats.get(1);
  var parentCat = category.parentCategory();
• Get list of all content in a category using
  childContent()
  – Retrieves all content in a category. (DCC off-line)
  – Var childlist = category.childContent();
   BVI_Category (…Contd)
• Get list of all content in a category or its
  descendents using memberContent()
   – Useful to get a list of all content in a given branch of
     all category tree.
   – Var descendentList = category.memberContent(); -
     will return all content on all categories below and
     including the current one.
  BVI_MultivalueTable
• Why Use it ?
  – To access child tables associated with visitors or
    content
• Where to Use it ?
  – Wherever detailed records are required.
     • Visitor preferences
  – Allows to create child tables associated with a given
    piece of content.
  BVI_MultivalueTable (..Contd)
• How to use it
  – Retrieve the detail record for content using
    .multiValueTable()
  – var table =
    content.multiValueTable(‘PRODUCT_COLORS’);
  – Retrieve the detail records for a visitor using the
    name of the multivalue attribute
  – var table = visitor.COLOR_PREFERENCES;
  – multiValueTable will return a BVI_MultiValueTable
    Object.
BVI_MultivalueTable (..Contd)
• How to use it
  – Get the number of records in the table using
    .length
     var recordCount = table.length;
     for (var I=0; I<recordCount;I++)
     {
        table.cursor = I;
        var nameList + = table.name + ‘,’;
        }
  – .cursor is used for locating the row.
BVI_MultivalueTable (..Contd)
• How to use it
  – Retrieve an entire row from the multvalue table
    using .get()
  – Example
     • var row = table.get(2);
     • var name = row.name;
  – Jump to a particular row using .locate()
     var message = ‘The shirt is in stock’;
     var row = table.locate(‘color’,’red’);
     If (row > -1) // -1 no match
        message + = ‘we have it in your favorite color’;
BV Database
What in BV Database
•   BV Schema
•   Designing a Data Model Extension
•   Implementing a Data Model Extension
•   Data Loading
•   Dynamic Command Center
Using BV Database
• Two kinds of Information in a BV system,
  that are stored & organized in a series of
  tables in BV schema
• Profile
  – Information contains all the attributes for site
    visitors such as demographics, preferences,
    buying patterns.
• Content
  – Information consists of all the information that
    can be presented on the site.
BV DB Schema
• Creating a new visitor reecord results in
  the creation of one record in each of the
  following tables :
  – BV_USER
  – BV_ACCOUNT
  – BV_USER_PROFILE
BV_USER
• Information needed for a user to logon to
  the system.
• New User - insertion
  – User_ID - Integer - Unique for each visitor
  – Account_ID - Integer - Identifies the visitor
    Account
  – Password - varchar(255) - Only BV comp can
    access it.
  – PMT_PREFERENCE - varchar(50) - Payment
    method preferred.
BV_USER (..Contd)
  – USER_STATE - Integer - 0 - active/ 1 - Inactive
  – Modif_Time - DateTime - when the user_state
    was last modified.
BV_USER_PROFILE
• Stores the additional information
  associated with a user.
  – USER_ID - Key from BV_USER
  – NAME - varchar(50) - Name of the visitor
  – ADDRESS, CITY, STATE, ZIP, COUNTRY, EMAIL,
  – LAST_LOGIN_DATE - Useful to avoid the updates
    to this table, at every login.
  – AVG_LOGIN_DAYS - days between login
  – NUMBER_LOGIN - count of logins
BV_USER_PROFILE (..Contd)
  – Also includes the following fields as
     • home_phone, bus_phone, age_range, gender,
       income_range, no_household, marital_status,
       employ_status, occupation, education_level,
       want_message, invalid_email
• You can also modify this table, but BV
  recommands the Users not modify BV_USER
  table
BV Content
• BV allows system designers to create their
  own data structure
• Each BV content requires the following six
  fields :
     • OID - Unique BV generated ID - Number(28)
     • STORE_ID - to Identify the Store
     • CREATION_TIME - A date field populated by BV
     • STATUS - whether the content is on-off line.
     • DELETED - Flags, When deleted with DCC and a DBA
       can remove it.
     • LAST_MOD_TIME - BV will update automatically.
BV_DISCUSSION
• Enables you to store discussion group
  information.
• Discussion group includes :
  –   Title
  –   Description
  –   Author Information
  –   Publication Information
  –   Rating Statistics
BV_EDITORIAL
• It is for a publication system where several
  primary publishers present information to
  consumers.
• On-line articles, includes :
  –   Publication information
  –   Media references - images, audio files or URL
  –   Billing data
  –   Rating Statistics
DESIGNING A DATA MODEL
EXTENSION
• What are attributes ?
  – An attributes describes a single
    characteristics about a visitor or content item
    such as
     • Name
     • favorite color
  – Attributes are properties of Visitor or Content.
  – Adding new attributes to Visitor Profile and
    Content tables
     • Can Add a attribute
DESIGNING A DATA MODEL
EXTENSION (..Contd)
  – Easy to add null able attributes to an existing
    table.
  – Non-null fields require a data conversion
    strategy
  – You can add attributes to the existing BV table.
  – BV recommends to create an extension table
    and associate to the existing table.
DESIGNING A DATA MODEL EXTENSION
(..Contd)
 • To maintain the multi-value attributes
   – BV provides related attributes list
   – These are child tables in a one-to-many
     relationship.
   – The content or visitor is a parent.
 • Example
   – A User has multiple color preference.
DESIGNING A DATA MODEL EXTENSION
(..Contd)
   – BV_USER
   User_ID        User_Name                   Shirt_Size
   585            John Smith                  XL
   – USER_COLOR_LINKS
   USER_ID COLOR_LINKS
   585            RED
   585            GREEN
   585            BLUE
      • BV_USER to USER_COLOR_LINKS is one to many
DESIGNING A DATA MODEL EXTENSION
(..Contd)
 • Multi-value tables have to be explicitly loaded.
 • Explicitly insert and update should be done to the
   table.
 • BV is not a regular RDBMS, so there are not always
   corss-references between tables.
 • You need to maintain referential integrity.
DESIGNING A DATA MODEL EXTENSION
(..Contd)
 • Issues :
    – In Current version of BV 4.0, you cannot develop rules
      on multi-value extensions.
    – BV 4.1 will overcome this limitation.
Implementing a Data Model
Extension
 • When to Implement ?
    – Once the Single Attributes or Multivalue attributes are
      decided for you application.
    – You must first have the required fields as USER_ID and
      six other fields.
 • Where to specify ?
    – Source File (.SRC)
    – Structured text file that describe the parts of BV
      database.
Implementing a Data Model
Extension
 • SRC …
Implementing a Data Model
Extension
   – Used to define content and visitor profiles tables.
   – Each SRC file defines one or more BV database tables.
   – Some SRC files contain definitions for extended data
     types.
   – A parsing process will register the Content Type and
     generate SQL that can be applied to the database.
Implementing a Data Model
Extension
 • SRC Files
    – Required Information
       • CLASS - identifies a unique name for the content and will be
         used inside of BV.
       • STORE - Which store will access this or ALL_STORE
       • CONTENT - The string used to refer to this from application
         code.
       • CONTENT_KIND - Name that will be visible to the users of DCC.
       • TABLE - name used for CREATE TABLE statement.
Implementing a Data Model
Extension
 • SRC Files
    – Example
       Knowledge.src
       <CLASS_SECTION>
       CLASS: HP_KNOWLEDGE
       STORE: ALL_STORE /*Default */
       CONTENT: HP_KNOWLEDGE
       TABLE : HP_KNOWLEDGE /* table Name */
       • The Content and table name are same above but need not be
         same.
Implementing a Data Model
Extension
 • SRC Files
    – Optional #include statement allows inclusion of
      custom data types
       • #include “cnt_type.src”
    – Optional storage clause for database DDL
       • TABLE_OPTION - Allows to specify the storage parameters for
         database, this is tagged onto the end of table creation
         statements.
       • INDEX_OPTION - Allows to specify storage parameters for
         database. There is only one index storage option and so all
         have the same size.
Implementing a Data Model
Extension
 • SRC Files
    – OID does not appear in the SRC File - BV will update
      automatically.
    – Required Attributes of content type
       ATTRIBUTE : KNOWLEDGE_ID
       TYPE : STRING NOT NULL
       COLUMN : varchar (20)
       ATTR_KIND : REQ_ATTR
       FRIENDLY_NAME : Knowledge Id
       SEMATICS : Unique integer assigned to knowledge
Implementing a Data Model
Extension
 • SRC Files
    – The Generating the SQL of the above statements will
      result a insert into a BV_ATTRIBUTES table.
    – Multi-value attributes tables
       • Defined as a LIST_TABLE in the SRC
           – with a table name
       • Attributes are simply listed under the LIST_TABLE statement
       • Parent Key is implied by the list table.
       • Define a column as key if required a composite key.
 • SRC Files
    – BV Data Types
       • Numeric
           – LONG, Double, MONEY
Implementing a Data Model
Extension
 • SRC Files
    – Attribute Kind
       •   KEY - identifies primary key
       •   REQ_ATTR - Will ensure user enters value when editing in DCC.
       •   READ_ONLY - makes the attribute read only in DCC
       •   HIDDEN - will prevent the data from being displayed in DCC.
       •   Column - Native database column definition.
Implementing a Data Model
Extension
 • SRC Files
    – Generating the schema.mk file
       mycontent_db.sql : mycontent_spec.src
           /bin/touch mycontent_spec.tmp mycontent_db.sql
           /bin/rm -f mycontent_spec.tmp mycontent_db.sql
           $(CPP) -B mycontent_spec.src mycontent_spec.tmp
           $(SCH_GEN) -schema mycontent_spec.tmp -script
       mycontent_db.sql -cnt -class_only
    – Be care full to use the tabs at the beg. Of continued
      lines
    – -cnt for content definition
Implementing a Data Model
Extension
 • Generating the SQL files
    make -f schema.mk mycontent_db.sql


 • Applying SQL
    $BV1To1/bin/scripts/apply_sql mycontent_db.sql
Implementing a Data Model
Extension
 • Extending an existing content type

 • Put the word EXTENSION at the top of the SRC file
    – SQL will be generated to alter the existing tables.
Data Loading
 • A set of Unix utilities are available to perform bulk
   loading of data into BV database
    – These tools are run when system is off-line.
    – Provide delimited text files containing raw data for
      batch insert or update.
 • Load Users
    – BV_load_users utility batch creates or updates visitor
      accounts in the BV database.
Data Loading (…Contd)
 • Load Content and Load Categories
   – Use BV_load_cat to load categories
   – The BV_load_content utility loads data into
      • content tables
      • related list tables
      • categories
Dynamic Command Center - DCC
 • DCC is a Windows 95/NT application.
 • Useful during development for testing purposes
   and looking at the database data.
 • DCC used to create the Rule sets in BV
   applications.
 • DCC is an Orbix client, it connects to the ‘Generic
   db Accessor’, server through.
 • DCC must be configured with the correct Orbix
   parameters.
Targeted Content
 • What is targeted Content ?
    – Visitor 1 is a rich software developer like you.

    – Visitor 2 is a physics student with a trillion dollars in
      debt.
Targeted Content
 • Know your visitor
    – Last time they were here, they looked at a lot of diet
      books
    – They have previously purchased subscriptions to
      “Carpenters Monthly” and “Home Improvement
      Magazine”
    – They created an account and filled in a user profile
      form, telling us :
       • gender, age, profession, income, shoe size, favorite color ...
Targeted Content
 • Where do you have data about the visitor ?
    – User Profile
    – Session
    – Event
       • Bought Product A
       • Viewed a Category B
Targeted Content
 • What content can be targeted ?
   – Any BV content type
      • Product
      • Advertisement
      • editorial
   – Categories
      • Instead of returning actual content from the rules, BV
        categories can be returned.
Targeted Content
 • Incentives
 • Notifications
 • Observations

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:28
posted:7/27/2012
language:English
pages:117