BroadVision 4.0 Ganesh Siddhamalli .

117
BroadVision 4.0 Ganesh Siddhamalli http:// gsspageat.webjump.com

Transcript of BroadVision 4.0 Ganesh Siddhamalli .

Page 1: BroadVision 4.0 Ganesh Siddhamalli .

BroadVision 4.0

Ganesh Siddhamallihttp://gsspageat.webjump.com

Page 2: BroadVision 4.0 Ganesh Siddhamalli .

Agenda

• Introduction and Overview• BV Component - I• BV Component - II• BV Database• Targeted Content

Page 3: BroadVision 4.0 Ganesh Siddhamalli .

Pre-requisites– UNIX– C++– Javascript– Basic OO A & D– Basics of RDBMS– CORBA– Basics of Web Architecture

• HTTP• CGI• HTML

Page 4: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 5: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 6: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 7: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 8: BroadVision 4.0 Ganesh Siddhamalli .

BV - Commerce Web (..Contd)

– Marketing, promotions, incentives– Discussion Groups– Alerts : Web, email & more

• Transactions– Order management– Payment Processing– Pricing, shipping, handling, tax– Security– APIs

Page 9: BroadVision 4.0 Ganesh Siddhamalli .

BV - Commerce Web (..Contd)

• Administration/ Tools– Content Administration– Reporting– Rules Administration– Template Creation– User Administration

Page 10: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 11: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 12: BroadVision 4.0 Ganesh Siddhamalli .

BV - ArchitectureLayers Elements Roles

Presentation Templates Template Developers

Business Business Rules & Contents Business Managers

Application One-to-OneComponets – Database Accessors – Open APIs

Application Developers

Database – External Systems – File System Database Admins

Page 13: BroadVision 4.0 Ganesh Siddhamalli .

BV Component Architecture

• 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

CR CI External Services

JS

Page 14: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 15: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 16: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 17: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 18: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 19: BroadVision 4.0 Ganesh Siddhamalli .

BV Process Architecture

Page 20: BroadVision 4.0 Ganesh Siddhamalli .

• Browser– Visitor Point of Contact with site HTTP

Server

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Page 21: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

HTTP ServerSite’s connection with WWWBV adds the interface that forwards visitor request to an IM running on a specific machine.

Page 22: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Dynamic Command Center (DCC)UI for creating and maintaining Business Rules

Page 23: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

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

Page 24: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Interaction Manager(IM)Comm. & Process control for handling HTTP requestsControls processing page scriptsControls interactions with underlying 1-to-1 servers

Page 25: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Embedded Javascript EngineNS JS engine embedded directly into the IM

Page 26: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Script Pre-ProcessorConverts a Page Script into pure SSJS

Page 27: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Script CacheCache of compiled page scripts

Page 28: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Component Interface FilesDefines interface between C++ and Javascriptdefines methods & Attr. Accessible from pge scriptsfile .jsi

Page 29: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Component interface CompilerGenerates C++ Source code with callbacks of JS engine

Page 30: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

C++ Component FilesJavascript - Visible C++

Page 31: BroadVision 4.0 Ganesh Siddhamalli .

Browser

HTTP Server

Dynamic Command Center

Interaction Manager with

Embedded Javascript Engine

One - to-One Server

JSP Files

Script Pre-processor

Script Cache

DB

Component Interface Compiler

C++ Compiler

Component Interface File

C++ Component Files

Shared library

of Components

Supporting Files & Tools

Shared Library of ComponentsShared object libraries loaded by IM when it fires up

Page 32: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 33: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 34: BroadVision 4.0 Ganesh Siddhamalli .

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)

Page 35: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 36: BroadVision 4.0 Ganesh Siddhamalli .

BV Components

Page 37: BroadVision 4.0 Ganesh Siddhamalli .

BV Component

• What is a BV Component• How to Use BV component• Commonly used BV Components

Page 38: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 39: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 40: BroadVision 4.0 Ganesh Siddhamalli .

What is BV Component (..contd)• Javascript Componet Prefix

– BVI

• C++ Components Prefix– BVC

Page 41: BroadVision 4.0 Ganesh Siddhamalli .

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(…);

Page 42: BroadVision 4.0 Ganesh Siddhamalli .

Commonly Used Components• BVI_Request• BVI_Response• BVI_Session• BVI_Visitor• BVI_Properties

• BVI_Content• BVI_ContentList• BVI_ContentMana

ger• BVI_Category• BVI_Multivaluetab

le

Page 43: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 44: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 45: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 46: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 47: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 48: BroadVision 4.0 Ganesh Siddhamalli .

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’);

Page 49: BroadVision 4.0 Ganesh Siddhamalli .

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_page.jsp’);• If no server name is used, by default, the

browser will use the last referenced server.

Page 50: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 51: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 52: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 53: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 54: BroadVision 4.0 Ganesh Siddhamalli .

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;

Page 55: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 56: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 57: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 58: BroadVision 4.0 Ganesh Siddhamalli .

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’;

Page 59: BroadVision 4.0 Ganesh Siddhamalli .

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);

Page 60: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 61: BroadVision 4.0 Ganesh Siddhamalli .

BV Component II

Page 62: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 63: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 64: BroadVision 4.0 Ganesh Siddhamalli .

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);

Page 65: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 66: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 67: BroadVision 4.0 Ganesh Siddhamalli .

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’

Page 68: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 69: BroadVision 4.0 Ganesh Siddhamalli .

BVI_Content (…Contd)

• New Content objects can be created and added to the databasevar 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

Page 70: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 71: BroadVision 4.0 Ganesh Siddhamalli .

BVI_Value (…Contd)

• Where to use it ?– Anywhere database reads and writes are

performed using BV objects– Any database values can be accessed.

Page 72: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 73: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 74: BroadVision 4.0 Ganesh Siddhamalli .

BVI_Category (…Contd)

• Examplevar contentManager - new

BVI_ContentManager();var category =

contentManager.categoryInfo(‘/clothing/shirts/rugby’,’myservice’,’mycontenttype’);

var parent = category.parentOID; // rugby’s parent id

var parentCategory = contentManager.categoryInfo(parent,’myservice’,’myContentType’); // same as saying /clothing/shirts

Page 75: BroadVision 4.0 Ganesh Siddhamalli .

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();

Page 76: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 77: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 78: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 79: BroadVision 4.0 Ganesh Siddhamalli .

BVI_MultivalueTable (..Contd)• How to use it

– Get the number of records in the table using .lengthvar recordCount = table.length;for (var I=0; I<recordCount;I++){

table.cursor = I;var nameList + = table.name + ‘,’;}

– .cursor is used for locating the row.

Page 80: BroadVision 4.0 Ganesh Siddhamalli .

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’;

Page 81: BroadVision 4.0 Ganesh Siddhamalli .

BV Database

Page 82: BroadVision 4.0 Ganesh Siddhamalli .

What in BV Database

• BV Schema• Designing a Data Model Extension• Implementing a Data Model

Extension• Data Loading• Dynamic Command Center

Page 83: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 84: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 85: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 86: BroadVision 4.0 Ganesh Siddhamalli .

BV_USER (..Contd)– USER_STATE - Integer - 0 - active/ 1 -

Inactive– Modif_Time - DateTime - when the

user_state was last modified.

Page 87: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 88: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 89: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 90: BroadVision 4.0 Ganesh Siddhamalli .

BV_DISCUSSION• Enables you to store discussion

group information.• Discussion group includes :

– Title– Description– Author Information– Publication Information– Rating Statistics

Page 91: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 92: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 93: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 94: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 95: BroadVision 4.0 Ganesh Siddhamalli .

DESIGNING A DATA MODEL EXTENSION (..Contd)

– BV_USERUser_ID User_Name Shirt_Size585 John Smith XL– USER_COLOR_LINKSUSER_ID COLOR_LINKS585 RED585 GREEN585 BLUE

• BV_USER to USER_COLOR_LINKS is one to many

Page 96: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 97: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 98: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 99: BroadVision 4.0 Ganesh Siddhamalli .

Implementing a Data Model Extension

• SRC …

Page 100: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 101: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 102: BroadVision 4.0 Ganesh Siddhamalli .

Implementing a Data Model Extension

• SRC Files– Example

Knowledge.src<CLASS_SECTION>CLASS: HP_KNOWLEDGESTORE: ALL_STORE /*Default */CONTENT: HP_KNOWLEDGETABLE : HP_KNOWLEDGE /* table Name */• The Content and table name are same above but

need not be same.

Page 103: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 104: BroadVision 4.0 Ganesh Siddhamalli .

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_IDTYPE : STRING NOT NULLCOLUMN : varchar (20)ATTR_KIND : REQ_ATTRFRIENDLY_NAME : Knowledge IdSEMATICS : Unique integer assigned to knowledge

Page 105: BroadVision 4.0 Ganesh Siddhamalli .

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

• Character– STRING, TEXT (varchar(2000)

• DATETIME• Enumeration - Integer or strings• Boolean - enumeration or a long• Can be NOT_NULL• No blobs and no images.

Page 106: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 107: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 108: BroadVision 4.0 Ganesh Siddhamalli .

Implementing a Data Model Extension

• Generating the SQL filesmake -f schema.mk mycontent_db.sql

• Applying SQL$BV1To1/bin/scripts/apply_sql

mycontent_db.sql

Page 109: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 110: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 111: BroadVision 4.0 Ganesh Siddhamalli .

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

Page 112: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 113: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 114: BroadVision 4.0 Ganesh Siddhamalli .

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 ...

Page 115: BroadVision 4.0 Ganesh Siddhamalli .

Targeted Content

• Where do you have data about the visitor ?– User Profile– Session– Event

• Bought Product A• Viewed a Category B

Page 116: BroadVision 4.0 Ganesh Siddhamalli .

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.

Page 117: BroadVision 4.0 Ganesh Siddhamalli .

Targeted Content

• Incentives• Notifications• Observations