Skip to content

Commit

Permalink
limit clickstream added
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Feb 28, 2016
1 parent adfe309 commit 9c8be2d
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -172,6 +172,9 @@ protected InputStream getContentXML(String viewId) throws Exception {

// INFO: Add clickstream to user profile
Element clickstreamEl = doc.createElementNS(NAMESPACE, "clickstream");
if (getResourceConfigProperty("limit-clickstream") != null) {
clickstreamEl.setAttribute("limit", getResourceConfigProperty("limit-clickstream"));
}
for(HistoryEntry he : clickStream) {
//log.debug("URL of history entry: " + he.getURL());
Element urlEl = doc.createElementNS(NAMESPACE, "url");
Expand Down Expand Up @@ -219,7 +222,12 @@ private Iterable<HistoryEntry> getClickstream(String boostServiceUrl, String coo
bsc.setSocketTimeout(getTimeoutValue(SOCKET_TIMEOUT_PROPERTY_NAME));
}
BoostService boost = new BoostService(bsc);
return boost.getClickStream(cookie);
if (getResourceConfigProperty("limit-clickstream") != null) {
return boost.getClickStream(cookie, new Integer(getResourceConfigProperty("limit-clickstream")).intValue());
} else {
log.warn("No clickstream limit set!");
return boost.getClickStream(cookie);
}
}

/**
Expand Down

0 comments on commit 9c8be2d

Please sign in to comment.