Skip Headers
Oracle® Application Server Personalization Programmer's Guide
10g Release 2 (10.1.2)
B14051-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

7 RE Batch API Supporting Classes

This chapter describes the supporting classes for the REBatchProxy class. These classes are used to create instances of the objects used by the methods described in Chapter 8. You may be able to create one instance of many of these classes and use that one instance as an argument for several calls.


Note:

Except for Location, these supporting classes are the same as the ones that are used by REAPI. (Not all REAPI classes are used by the RE Batch API.)

Before you issue any of the recommendation methods described in Chapter 8, you must generate appropriate Section 7.4.2, "FilteringSettings Class", Section 7.4.5, "TuningSettings Class", and Section 7.4.4, "Location Class" instances.

All methods described in this chapter are public.

This chapter does not contained detailed descriptions of any of the classes. For detailed information, see the Javadoc in the OracleAS Personalization section of the Oracle Application Server 10g Documentation Library.

The supporting classes are divided into two categories:

7.1 Ratings in OracleAS Personalization

Ratings in OracleAS Personalization are in "ascending order of goodness", that is, the higher the rating, the more the user prefers the item. Low-rated items are items that the user does not prefer. OracleAS Personalization algorithms use these assumptions, so it is important that ratings are in ascending order of goodness.

7.2 Location of RE Batch API Classes

The following frequently used classes are in the oracle.dmt.re.base subdirectory:

For example, to use the Enum interfaces, you must include the following statement in your Java program:

   import oracle.dmt.op.re.base.Enum;

7.3 EnumType Interfaces for RE Batch API

Many of the RE Batch API methods reference attributes that can take on a finite number of values. The interface Enum is used to implement the base class for these "enumerations."

The Enum interface has a nested EnumType class with the following general methods:

int getId()

String toString()

String getName()

boolean isEqual(EnumType)

The following interfaces extend EnumType:

7.3.1 CategoryMembership Interface

CategoryMembershipType is implemented as:

  • CategoryMembershipType (a class that extends EnumType)

  • CategoryMembership (an interface)

The class CategoryMembership has the following methods:

   CategoryMemberShipType getType(String name)

   CategoryMemberShipType getType(int)

CategoryMembership specifies how categories in a list of categories should be applied for filtering. For example, Enum.CategoryMembership.EXCLUDE_ITEMS specifies that items from the category should be excluded from the category list. For details, see Section 7.4.2, "FilteringSettings Class" later in this chapter.

CategoryMembership takes on the following values:

  • Enum.CategoryMembership.EXCLUDE_ITEMS

  • Enum.CategoryMembership.INCLUDE_ITEMS

  • Enum.CategoryMembership.EXCLUDE_CATEGORIES

  • Enum.CategoryMembership.INCLUDE_CATEGORIES

  • Enum.CategoryMembership.LEVEL

  • Enum.CategoryMembership.SUBTREE_ITEMS

  • Enum.CategoryMembership.SUBTREE_CATEGORIES

  • Enum.CategoryMembership.ALL_ITEMS

  • Enum.CategoryMembership.ALL_CATEGORIES

The following statement assigns Enum.CategoryMembership.LEVEL to the variable myEnum:

   CategoryMembershipType myEnum = Enum.CategoryMembership.LEVEL; 

7.3.2 DataSource Interface

DataSource is implemented as:

  • DataSourceType (a class that extends EnumType)

  • DataSource (an interface)

The class DataSourceType has the following methods:

   DataSourceType getType(String name)

   DataSourceType getType(int)

DataSource specifies the type of data that is used when OracleAS Personalization performs certain operations. For example, Enum.DataSource.DEMOGRAPHIC specifies that demographic data. The method Section 7.4.1, "DataItem Class", described later in this chapter, uses DataSource. Note that a given method may not support all values of DataSource. For details, see the description of the method in the Javadoc included with OracleAS Personalization.

DataSource takes on the following values:

  • Enum.DataSource.DEMOGRAPHIC

  • Enum.DataSource.PURCHASING

  • Enum.DataSource.RATING

  • Enum.DataSource.NAVIGATION

  • Enum.DataSource.ALL

The following statement assigns Enum.DataSource.ALL to the variable myEnum:

   DataSourceType myEnum = Enum.DataSource.ALL;

7.3.3 InterestDimension Interface

InterestDimension is implemented as:

  • InterestDimensionType (a class that extends EnumType)

  • InterestDimension (an interface)

The class InterestDimensionType has the following methods:

   InterestDimensionType getType(String name)

   InterestDimensionType getType(int)

InterestDimension indicates the type of interest that the user of the Web site has in a given item. NAVIGATION indicates that the user is interested in the items. PURCHASING indicates that the user would like to purchase the items. RATING indicates that the user likes the items. For more information, see the description of Section 7.4.5, "TuningSettings Class" later in this chapter.

InterestDimension takes on the following values:

  • Enum.InterestDimension.NAVIGATION

  • Enum.InterestDimension.PURCHASING

  • Enum.InterestDimension.RATING

The following statement assigns Enum.InterestDimension.PURCHASING to the variable myEnum:

   InterestDimensionType myEnum = Enum.InterestDimension.PURCHASING; 

7.3.4 PersonalizationIndex Interface

PersonalizationIndex is implemented as:

  • PersonalizationIndexType (a class that extends EnumType)

  • PersonalizationIndex (an interface)

The class PersonalizationIndexType has the following methods:

   PersonalizationIndexType getType(String name)

   PersonalizationIndexType getType(int)

PersonalizationIndex specifies how "unusual" the recommendations returned will be. For example, LOW specifies not unusual. For more information, see the description of Section 7.4.5, "TuningSettings Class" later in this chapter.

PersonalizationIndex takes on the following values:

  • Enum.PersonalizationIndex.LOW

  • Enum.PersonalizationIndex.MEDIUM

  • Enum.PersonalizationIndex.HIGH

The following statement assigns Enum.PersonalizationIndex.LOW to the variable myEnum:

   PersonalizationIndexType myEnum = Enum.PersonalizationIndex.LOW;

7.3.5 ProfileDataBalance Interface

ProfileDataBalance is implemented as:

  • ProfileDataBalanceType (a class that extends EnumType)

  • ProfileDataBalance (an interface)

The class ProfileDataBalanceType has the following methods:

   ProfileDataBalanceType getType(String name)

   ProfileDataBalanceType getType(int)

ProfileDataBalance specifies whether to take data from the current session or from history or to balance data between data from the current session and history when making recommendations. For more information, see the description of Section 7.4.5, "TuningSettings Class" later in this chapter.

ProfileDataBalance takes on the following values:

  • Enum.ProfileDataBalance.HISTORY


    Note:

    The only value of profile data balance that makes sense for bulk recommendations is Enum.ProfileDataBalance.HISTORY. You must specify this value. (There is no current session data available.)

The following statement assigns Enum.ProfileDataBalance.HISTORY to the variable myEnum:

   ProfileDataBalanceType myEnum = Enum.ProfileDataBalance.HISTORY; 

7.3.6 ProfileUsage Interface

ProfileUsage is implemented as:

  • ProfileUsageType (a class that extends EnumType)

  • ProfileUsage (an interface)

The class ProfileUsageType has the following methods:

   ProfileUsageType getType(String name)

   ProfileUsageType getType(int)

ProfileUsage specifies whether the recommendation list can include or exclude items in a customer's profile. For more information, see the description of Section 7.4.5, "TuningSettings Class"later in this chapter.

ProfileUsage takes on the following values:

  • Enum.ProfileUsage.INCLUDE

  • Enum.ProfileUsage.EXCLUDE

The following statement assigns Enum.ProfileUsage.INCLUDE to the variable myEnum:

   ProfileUsageType myEnum = Enum.ProfileUsage.INCLUDE;

7.3.7 Sorting Interface

Sorting is implemented as:

  • SortingType (a class that extends EnumType)

  • Sorting (an interface)

The class SortingType has the following methods:

   SortingType getType(String name)

   SortingType getType(int)

Sorting indicates whether sorting is done (none implies no sorting), and, if sorting is done, how it is done (ascending or descending). For more information, see the discussion of the Section 7.4.1, "DataItem Class" later in this chapter.

Sorting takes on the following values:

  • Enum.Sorting.NONE

  • Enum.Sorting.DESCENDING

  • Enum.Sorting.ASCENDING

The following statement assigns Enum.Sorting.NONE to the variable myEnum:

   SortingType myEnum = Enum.Sorting.NONE;

7.4 Other RE Batch API Supporting Classes

The other supporting classes are

7.4.1 DataItem Class

This class is a subclass of class Item. It encapsulates data about an item.

There are two kinds of methods provided with this class:

  • A constructor that creates a DataItem instance

  • Methods that return attribute values

The following methods return attribute values:

  • getDataSource()

  • getValue()

7.4.2 FilteringSettings Class

This class is used to specify the items to include or exclude when generating recommendations.

Release 2 of OracleAS Personalization supports category filtering only.

There are three kinds of methods provided with this class:

  • A constructor for FilteringSettings

  • Methods that set the attributes values:

    • setItemFiltering(int taxonomyID)

    • setItemFiltering(int taxonomyID, long[] categoryList)

    • setItemExclusion(int taxonomyID, long[] categoryList])

    • setItemSubTreeFiltering(int taxonomyID, long[] categoryList])

    • setCategoryExclusion(int taxonomyID, long[] categoryList])

    • setCategorySubTreeFiltering(int taxonomyID, long[] categoryList])

    • setCategoryLevelFiltering(int taxonomyID, long[] categoryList])

    • setCategoryFiltering(int taxonomyID)

    • setCategoryFiltering(int taxonomyID, long[] categoryList)

  • Methods that return attribute values:

    • getTaxonomyID()

    • getCategoryFiltering ()

    • getCategoryList()

    • getCategoryMembership()

Not all filtering settings can be used will all methods. In particular, the following filtering setting cannot be used with the cross-sell methods:

  • setCategoryLevelFiltering

  • setCategorySubtreeFiltering

  • setCategoryExclusion

  • setCategoryFiltering(int)

  • setCategoryFiltering(int, long[])

7.4.3 Item Class

This class is used to represent items that can be recommended and for which data can be collected. An item is uniquely represented by the combination of type and ID. Item IDs must be unique within a given type, but different types can have the same IDs.

There are two kinds of methods provided with this class:

  • A constructor that creates an Item instance

  • Methods that return attribute values

    • getType()

    • getID()

7.4.4 Location Class

This class specifies the location of the input table or the location of the table containing the results of an REBatchProxy method. The schema for the table depends on the call made. See the descriptions of the individual methods in the Javadoc for details.

There are three kinds of methods provided with this class:

  • A constructor that creates a Location instance

  • Methods that return attribute values

    • get DatabaseURL()

    • getDatabaseAlias()

    • getSchemaName()

    • getTableName()

    • getUserName()

    • getPassword()

7.4.5 TuningSettings Class

This class specifies settings to be applied when computing a recommendation. An instance of this class is passed to all recommendation requests.

There are three kinds of methods provided with this class:

  • A constructor that creates an TuningSettings instance

  • Methods that set attribute values

  • Methods that return attribute values

The following methods set attribute values:

  • setDataSourceType()

  • setInterestDimension()

  • setPersonalizationIndex()

  • setProfileDataBalance()

  • setProfileUsage()

The following methods return attribute values:

  • getDataSourceType()

  • getInterestDimension()

  • getPersonalizationIndex()

  • getProfileDataBalance()

  • getProfileUsage()