Service class for all page revision data related actions.
More...
Public Member Functions |
void | initialize (ServletContext servContext) |
| initializes the data service.
|
boolean | isKnownPage (String pageTitle) |
| determines if a page with the given title is known (and data exists) or not
|
WikiVisData | getData (ServletContext servContext, String pageTitle, int width, int height, int fromMonth, int fromYear, int toMonth, int toYear) throws RevisionExtractionException |
| calculate and returns the data for the given page title and conditions.
|
WikiVisData | getData (ServletContext servContext, String pageTitle, int width, int height, int fromMonth, int fromYear, int toMonth, int toYear, boolean ignoreChacedData) throws RevisionExtractionException |
| calculate and returns the data for the given page title and conditions.
|
Map | getKnownPages () |
| returns the map of known pages
|
String | getVersion () |
| returns the version of the service
|
Static Private Member Functions |
static long | getMonthIndex (int year, int month) |
| calculate the month index for the given month and year.
|
static List< Revision > | filterRevisionList (List< Revision > revisions, int fromMonth, int fromYear, int toMonth, int toYear) |
| filters a given revision list according to the filter conditions.
|
static void | createNodesAndEdges (WikiVisData data, int fromMonth, int fromYear, int toMonth, int toYear) |
| creates and sets the revision network from the given data (the data must contain revisions and authors).
|
Static Private Attributes |
static final String | DATA_DIR = "/data/" |
| the data directory that holds all page data
|
static final String | CONFIG_PAGEDATA_FILENAME = "/pagedata-config.xml" |
| the configuration file name
|
static final int | MAX_CACHE_DATA = 10 |
| the maximum number of cached items
|
static final int | THRESHOLD_VAR = 50 |
| the revision number threshold used in variance calculation
|
static final int | MAX_ALLOWED_NODES = 7000 |
| the maximum number of authors where eigenvalue calculation is possible (limited to prevent OutOfMemoryError)
|
Detailed Description
Service class for all page revision data related actions.
Data is loaded from WebContent/data/
,the page title to xml file mapping is specified in the configuration file. The configuration file "pagedata-config.xml" is an properties-xml file that contains all page entries with their titles as keys and the xml file name as value.
- See Also
- java.uitl.Properties
- Author
- Manuel Wyss e0106.nosp@m.157@.nosp@m.stude.nosp@m.nt.t.nosp@m.uwien.nosp@m..ac..nosp@m.at
-
Florian Zoubek zoube.nosp@m.k@bi.nosp@m.tanda.nosp@m.rt.a.nosp@m.t
Member Function Documentation
void wikivis.data.WikiVisDataService.cacheData |
( |
WikiVisData |
data | ) |
|
|
private |
updates the cache with the given data
- Parameters
-
void wikivis.data.WikiVisDataService.calculateOverallStatistics |
( |
WikiVisData |
data | ) |
|
|
private |
calculates and sets the statistics for the given data
- Parameters
-
data | the data to operate upon |
void wikivis.data.WikiVisDataService.calculatePositions |
( |
WikiVisData |
data, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
private |
calculates the positions of the nodes of the revision network of the given data.
If the number of nodes exceeds MAX_ALLOWED_NODES
, the positions will not be calculated and the according flag will be set in the data. This limit exists to prevent OutOfMemoryErrors due to eigenvalue calculation of huge adjacency matrices.
- Parameters
-
data | the data to operate upon |
width | the width of the visualization area |
height | the height of the visualization area |
void wikivis.data.WikiVisDataService.computeVariance |
( |
WikiVisData |
data, |
|
|
int |
fromMonth, |
|
|
int |
fromYear, |
|
|
int |
toMonth, |
|
|
int |
toYear |
|
) |
| |
|
private |
computes and sets the variance values for each author
- Parameters
-
data | the data to operate upon |
fromMonth | the from month value of the time range filter (0-11) |
fromYear | the from year value of the time range filter |
toMonth | the to month value of the time range filter (0-11) |
toYear | the to year value of the time range filter |
static void wikivis.data.WikiVisDataService.createNodesAndEdges |
( |
WikiVisData |
data, |
|
|
int |
fromMonth, |
|
|
int |
fromYear, |
|
|
int |
toMonth, |
|
|
int |
toYear |
|
) |
| |
|
staticprivate |
creates and sets the revision network from the given data (the data must contain revisions and authors).
Filtering of the data will not be performed if any of the given conditions is negative.
- Parameters
-
data | the data operate upon |
fromMonth | the month value of the first month to include |
fromYear | the year value of the first month to include |
toMonth | the month value of the last month to include |
toYear | the year value of the last month to include |
loads the revision data from the page data file
- Parameters
-
servContext | the current servlet context |
pageTitle | the page title of the page to load |
- Returns
- the extracted data
- Exceptions
-
static List<Revision> wikivis.data.WikiVisDataService.filterRevisionList |
( |
List< Revision > |
revisions, |
|
|
int |
fromMonth, |
|
|
int |
fromYear, |
|
|
int |
toMonth, |
|
|
int |
toYear |
|
) |
| |
|
staticprivate |
filters a given revision list according to the filter conditions.
If any condition is negative no filtering will be performed and the given instance will be returned.
- Parameters
-
revisions | a list of revisions to filter |
fromMonth | the month value of the first month to include |
fromYear | the year value of the first month to include |
toMonth | the month value of the last month to include |
toYear | the year value of the last month to include |
- Returns
- a filtered list of revisions
WikiVisData wikivis.data.WikiVisDataService.getCachedData |
( |
String |
pageTitle | ) |
|
|
private |
restores the cahce page data with the given title
- Parameters
-
- Returns
- the restored data (does not contain variances and revision network)
WikiVisData wikivis.data.WikiVisDataService.getData |
( |
ServletContext |
servContext, |
|
|
String |
pageTitle, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
fromMonth, |
|
|
int |
fromYear, |
|
|
int |
toMonth, |
|
|
int |
toYear |
|
) |
| throws RevisionExtractionException |
calculate and returns the data for the given page title and conditions.
If any of fromMonth
, fromYear
, toMonth
or toYear
, is given a negative value, no filtering will be performed. No caching will be performed.
- Parameters
-
servContext | the current servlet context |
pageTitle | the page title |
width | the width of the visualization area |
height | the height of the visualization area |
fromMonth | the from month value of the time range filter (0-11) |
fromYear | the from year value of the time range filter |
toMonth | the to month value of the time range filter (0-11) |
toYear | the to year value of the time range filter |
- Returns
- the requested data
- Exceptions
-
WikiVisData wikivis.data.WikiVisDataService.getData |
( |
ServletContext |
servContext, |
|
|
String |
pageTitle, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
fromMonth, |
|
|
int |
fromYear, |
|
|
int |
toMonth, |
|
|
int |
toYear, |
|
|
boolean |
ignoreChacedData |
|
) |
| throws RevisionExtractionException |
calculate and returns the data for the given page title and conditions.
If any of fromMonth
, fromYear
, toMonth
or toYear
, is given a negative value, no filtering will be performed. Caching will be performed if specified.
- Parameters
-
servContext | the current servlet context |
pageTitle | the page title |
width | the width of the visualization area |
height | the height of the visualization area |
fromMonth | the from month value of the time range filter (0-11) |
fromYear | the from year value of the time range filter |
toMonth | the to month value of the time range filter (0-11) |
toYear | the to year value of the time range filter |
ignoreChacedData | true if no caching should be performed, false otherwise |
- Returns
- the requested data
- Exceptions
-
String wikivis.data.WikiVisDataService.getDataFileName |
( |
String |
pageTitle | ) |
|
|
private |
returns the file name for the given page title.
The page must be known to the service.
- Parameters
-
pageTitle | the title of the page |
- Returns
- the file containing the revision data
Map wikivis.data.WikiVisDataService.getKnownPages |
( |
| ) |
|
returns the map of known pages
- Returns
- the map of known pages
static long wikivis.data.WikiVisDataService.getMonthIndex |
( |
int |
year, |
|
|
int |
month |
|
) |
| |
|
staticprivate |
calculate the month index for the given month and year.
The characteristics of this index are:
-
if month1/year1 is before month2/year2 then monthIndex1 < monthIndex2
-
if month1/year1 is equal month2/year2 then monthIndex1 = monthIndex2
-
if month1/year1 is after month2/year2 then monthIndex1 > monthIndex2
- Parameters
-
year | the year |
month | the month (0-11) |
- Returns
String wikivis.data.WikiVisDataService.getVersion |
( |
| ) |
|
returns the version of the service
- Returns
- the version of the service
void wikivis.data.WikiVisDataService.initialize |
( |
ServletContext |
servContext | ) |
|
initializes the data service.
This method must be called and succeed before any other method of this class should be called
- Parameters
-
servContext | the Servlet context used in this service |
boolean wikivis.data.WikiVisDataService.isKnownPage |
( |
String |
pageTitle | ) |
|
determines if a page with the given title is known (and data exists) or not
- Parameters
-
pageTitle | the page title of the page |
- Returns
- true if the page is known, false otherwise
void wikivis.data.WikiVisDataService.manageCache |
( |
| ) |
|
|
private |
tries to optimize the cache with a simple cache strategy
Member Data Documentation
final String wikivis.data.WikiVisDataService.CONFIG_PAGEDATA_FILENAME = "/pagedata-config.xml" |
|
staticprivate |
the configuration file name
final String wikivis.data.WikiVisDataService.DATA_DIR = "/data/" |
|
staticprivate |
the data directory that holds all page data
final int wikivis.data.WikiVisDataService.MAX_ALLOWED_NODES = 7000 |
|
staticprivate |
the maximum number of authors where eigenvalue calculation is possible (limited to prevent OutOfMemoryError)
final int wikivis.data.WikiVisDataService.MAX_CACHE_DATA = 10 |
|
staticprivate |
the maximum number of cached items
Properties wikivis.data.WikiVisDataService.pageConfig |
|
private |
the page configuration as Properties instance
final int wikivis.data.WikiVisDataService.THRESHOLD_VAR = 50 |
|
staticprivate |
the revision number threshold used in variance calculation
The documentation for this class was generated from the following file: