|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmagoffin.matt.ma2.support.AbstractPlugin
magoffin.matt.ma2.dao.support.AbstractJdbcBrowseModePlugin
magoffin.matt.ma2.dao.support.PopularityBrowseModePlugin
public class PopularityBrowseModePlugin
Browse mode based on media item popularity (hits).
The configurable properties of this class are:
The SQL to generate the browse results. This must return the aggregate
count of all browsable items, grouped in "buckets" by number of hits each
item has, e.g. "0 - 19", "20 - 39", etc. These "buckets" will be turned
into index keys. The SQL must return two columns: an integer bucket
for the lower bound of the bucket range, and an integer item_count
for the count of items that fall within this bucket.
The SQL query takes a template parameter 0 as the bucket size,
configured by the setPopularityBucketSize(int) property. Then the
following positional SQL parameters will be set:
The boolean flags are set as positional parameters for cross-database support for boolean values.
The SQL to generate the results for a single index section (i.e. popularity bucket range) and also to populate the items in a single album for viewing a single album. The following positional SQL parameters will be set:
The SQL must return the following columns:
| Field Summary | |
|---|---|
static int |
DEFAULT_POPULARITY_BUCKET_SIZE
The default value for the popularityBucketSize property. |
static int |
DEFAULT_SECTION_ALBUM_MAX_SIZE
The default value for the sectionAlbumMaxSize property. |
static java.lang.String |
MESSAGE_KEY_ALBUM_TITLE_MULTI
The message key for an album title with more than one item in it. |
static java.lang.String |
MESSAGE_KEY_ALBUM_TITLE_SINGLE
The message key for an album title with just one item in it. |
static java.lang.String |
MODE_POPULARITY
Browse mode key for popularity. |
| Fields inherited from class magoffin.matt.ma2.support.AbstractPlugin |
|---|
log |
| Constructor Summary | |
|---|---|
PopularityBrowseModePlugin()
|
|
| Method Summary | |
|---|---|
SearchResults |
find(BrowseAlbumsCommand command,
PaginationCriteria pagination)
Perform the search, returning SearchResults populated with
AlbumSearchResult objects. |
java.lang.String[] |
getMessageResourceNames()
Get a list of message resource names to register. |
org.springframework.context.MessageSource |
getMessages()
|
int |
getPopularityBucketSize()
|
int |
getSectionAlbumMaxSize()
|
java.lang.String |
getSqlBrowse()
|
java.lang.String |
getSqlBrowseSection()
|
java.lang.String[] |
getSupportedModes()
Get the supported modes of this plugin. |
void |
init()
Manual initialization method. |
protected void |
init(org.springframework.context.ApplicationContext application)
Initialization hook for subclasses. |
void |
setMessages(org.springframework.context.MessageSource messages)
|
void |
setPopularityBucketSize(int popularityBucketSize)
|
void |
setSectionAlbumMaxSize(int sectionAlbumMaxSize)
|
void |
setSqlBrowse(java.lang.String sqlBrowse)
|
void |
setSqlBrowseSection(java.lang.String sqlBrowseSection)
|
boolean |
supportsMode(java.lang.String mode)
Test if this plugin supports a given browse mode. |
| Methods inherited from class magoffin.matt.ma2.dao.support.AbstractJdbcBrowseModePlugin |
|---|
getDomainObjectFactory, getJdbcTemplate, getPluginType, getUserBiz, setDomainObjectFactory, setJdbcTemplate, setUserBiz |
| Methods inherited from class magoffin.matt.ma2.support.AbstractPlugin |
|---|
getConfigName, initialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface magoffin.matt.ma2.plugin.Plugin |
|---|
initialize |
| Field Detail |
|---|
public static final java.lang.String MODE_POPULARITY
public static final int DEFAULT_SECTION_ALBUM_MAX_SIZE
sectionAlbumMaxSize property.
public static final int DEFAULT_POPULARITY_BUCKET_SIZE
popularityBucketSize property.
public static final java.lang.String MESSAGE_KEY_ALBUM_TITLE_SINGLE
public static final java.lang.String MESSAGE_KEY_ALBUM_TITLE_MULTI
| Constructor Detail |
|---|
public PopularityBrowseModePlugin()
| Method Detail |
|---|
public boolean supportsMode(java.lang.String mode)
BrowseModePlugin
mode - the mode to test
protected void init(org.springframework.context.ApplicationContext application)
AbstractPluginThis method will be called at the end of the AbstractPlugin.initialize(org.springframework.context.ApplicationContext) method.
init in class AbstractPluginapplication - the ApplicationContextpublic java.lang.String[] getMessageResourceNames()
Plugin
public java.lang.String[] getSupportedModes()
BrowseModePlugin
public void init()
This is used by unit tests.
public SearchResults find(BrowseAlbumsCommand command,
PaginationCriteria pagination)
BrowseModePluginSearchResults populated with
AlbumSearchResult objects.
command - the browse commandpagination - the pagination criteria
public java.lang.String getSqlBrowse()
public void setSqlBrowse(java.lang.String sqlBrowse)
sqlBrowse - the sqlBrowse to setpublic java.lang.String getSqlBrowseSection()
public void setSqlBrowseSection(java.lang.String sqlBrowseSection)
sqlBrowseSection - the sqlBrowseSection to setpublic int getSectionAlbumMaxSize()
public void setSectionAlbumMaxSize(int sectionAlbumMaxSize)
sectionAlbumMaxSize - the sectionAlbumMaxSize to setpublic org.springframework.context.MessageSource getMessages()
public void setMessages(org.springframework.context.MessageSource messages)
messages - the messages to setpublic int getPopularityBucketSize()
public void setPopularityBucketSize(int popularityBucketSize)
popularityBucketSize - the popularityBucketSize to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||