Home
Visit CollectionsVisit Collections
A visit collector is a way to collect visits (instances of org.polliwog.data.Visit), based on certain criteria, as polliwog is processing a log file.

Once collected the visits can be processed and sections/pages generated to display the information. For instance you may wish to collect visits from potential bots/spiders (ones that aren't listed in the robots_list.txt file)

The collector definitions are stored in file: data/visit-collectors.xml. This is an xml file that has the following elements/attributes:
Show the help for this table
NameRootChildrenParent(s)AttributesDescription
collectorsYcollector+NONENONEThe root elements, each child collector element defines a collection.
collectorNANYcollectorson(enum{normal, filtered}),O)
name(string,R)
class(string,R)
Defines a particular collection. The class attribute defines the class that will represent the collection and implements the org.polliwog.collectors.VisitCollector interface. The name attribute defines a unique name (within the list of visit collections) for the collection, it is this identifier that can be used in sections to identify the collection to use as the input.
Basic Visit Collector
Whilst it is possible to provide your own implementation of the VisitCollector interface a basic implementation that allows you to define criteria for collecting visits via a External site, opens in new window JoSQL WHERE clause is available with the org.polliwog.collectors.BasicVisitCollector class.

To use this class just use a value of:
org.polliwog.collectors.BasicVisitCollector
for the class attribute of the collector element.

The WHERE clause is then provided by the content of the collector element. Remember that the class for any accessors is: Visit. Any valid WHERE clause can be used, the expression used will be evaluated to a boolean true/false value. This value is returned from the accept(org.polliwog.data.Hit) method.

Example
Find all potential bots/spiders.
<collector name="potentialBots"
           class="org.polliwog.collectors.BasicVisitCollector">
  userAgent $IN LIKE ('%http://%', '%bot%', '%spider%', '%crawler%')
</collector>
Example
Find hot linked image visits (replace www.mysite.com with the name of your website).
<collector name="hotLinkedImageHits"
           class="org.polliwog.collectors.BasicHitCollector">
 (SELECT *
  FROM   pages
  WHERE  :_allobjs.size = 1
  AND    requestURI.path $IN LIKE ('%.gif', '%.jpg', '%.png')
  AND    refererURI.toString LIKE 'http://%'
  AND    refererURI.toString NOT LIKE 'http://www.mysite.com%')
</collector>