This is a demo of a performant activity stream. The principle of this activity stream is to display results by groups of 5 minutes. A first query is run to detect all groups of 5 minutes that are needed to display 20 (configurable) groups. Then one other query is run to retrieve all the necessary data to display the 20 groups. For each group, the display is different based on the number of results.
If you click on a group the detailed changes are retrieved using an AJAX call.
Security wise, the display will check security for groups of less than 100 changes. Otherwise only the number of changes are displayed.
For now the display has not been made to look pretty.
Failed to execute the [groovy] macro. Cause: [ActivityEventImpl is not mapped]. Click on this message for details.
org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Script Macro for content [import org.joda.time.DateTime;
import java.text.SimpleDateFormat;
spacefilter = "'XWiki','Scheduler', 'Sandbox', 'IRC'"
wikifilter = "'import'"
pagefilter = "'Main.ActStream', 'Main.ActStream2'"
def cache = new HashMap()
nbqueries = 0;
nbchecks = 0;
def getIntervals(nb, delay, secDelay) {
nbqueries++;
def hql = "select distinct round( (datediff(current_timestamp(), act.date)*24*3600 + (hour(current_timestamp())-hour(act.date))*3600 + (minute(current_timestamp())-minute(act.date))*60 + (second(current_timestamp()) + ${secDelay} -second(act.date)))/60/${delay} - 0.5) from ActivityEventImpl as act where act.space not in (${spacefilter}) and act.page not in (${pagefilter}) and act.wiki not in (${wikifilter}) and act.hidden<>1 order by act.date desc"
return xwiki.search(hql, nb * 2, 0);
}
def filter(list) {
if (list.size()>100)
return list;
def list1 = new ArrayList();
for (event in list) {
def pageName = "${event[0]}:${event[1]}"
nbchecks++;
def pagedoc = xwiki.getDocument(pageName)
if (pagedoc!=null) {
list1.add(event);
} else {
println "Got rid of ${pageName}"
}
}
return list1;
}
def getEvents(starti, endi, delay, currentDate) {
nbqueries++;
def sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm")
def nextDate = currentDate.minusMinutes(delay * starti);
def previousDate = currentDate.minusMinutes(delay * endi);
def spreviousDate = sdf.format(previousDate.toDate());
def snextDate = sdf.format(nextDate.toDate())
def hql = "select act.wiki, act.page, act.user, act.title, act.version, act.type, act.date, act.param2 from ActivityEventImpl as act where act.space not in (${spacefilter}) and act.page not in (${pagefilter}) and act.wiki not in (${wikifilter}) and act.date>'${spreviousDate}' and act.date<'${snextDate}' and act.hidden<>1 order by act.date desc"
if (request.debug) {
println "* ${starti} ${endi} ${delay} ${previousDate} ${spreviousDate} ${nextDate} ${snextDate} ${hql}";
}
return xwiki.search(hql);
}
def getEventsWithCache(i, starti, endi, delay, currentDate, nbgroups, cache, withadddelay) {
// let's check in cache
def result = cache.get
if (result!=null) {
return filter(result)
}
def endi2 = calcEnd(i+nbgroups, withadddelay)
def sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm")
def nextDate = currentDate.minusMinutes(delay * starti);
def previousDate = currentDate.minusMinutes(delay * endi2);
def spreviousDate = sdf.format(previousDate.toDate());
def snextDate = sdf.format(nextDate.toDate())
def hql = "select act.wiki, act.page, act.user, act.title, act.version, act.type, act.date from ActivityEventImpl as act where act.space not in (${spacefilter}) and act.page not in (${pagefilter}) and act.wiki not in (${wikifilter}) and act.date>'${spreviousDate}' and act.page<>'Sandbox.PushTest3' and act.date<'${snextDate}' and act.hidden<>1 order by act.date desc"
// now we have more data so we need to put it in cache
def list = xwiki.search(hql)
nbqueries ++;
def start = i;
def list2 = new ArrayList()
for (event in list) {
def minDate = null;
while (minDate==null) {
minDate = currentDate.minusMinutes(delay * calcEnd(start, withadddelay));
if (event[6].time<minDate.toDate().time) {
cache.put(start, list2);
list2 = new ArrayList();
start++;
minDate = null;
}
}
list2.add(event);
}
cache.put(start, list2);
start++;
while (start<=i+nbgroups) {
cache.put(start, new ArrayList())
start++;
}
def newlist = cache.get;
return filter(newlist);
}
def calcEnd(i, withadddelay) {
return (withadddelay&&(i+1>6)) ? (i + 1 + (i - 6)) : (i+1)
}
def calcStart(i, withadddelay) {
return (withadddelay&&(i>6)) ? (i + (i - 6) -1) : i
}
def findComment(pagedoc, commentNb) {
def cobj = pagedoc.getObject("XWiki.XWikiComments", Integer.parseInt(commentNb))
if (cobj) {
pagedoc.use(cobj);
return pagedoc.getValue("comment")
}
return "";
}
def getMessage(list, nochange) {
def message = ""
def nb = (list==null) ? 0 : list.size();
if (nb==0) {
if (nochange) {
message = "no change";
}
} else if (nb==1) {
def res = list.get(0)
def author = xwiki.getUserName(res[2], false)
def changedDoc = xwiki.getDocument("${res[0]}:${res[1]}")
if (changedDoc!=null) {
def stitle = changedDoc.displayTitle
if (changedDoc.version=="1.1")
message = "1 create: ${stitle} in wiki ${res[0]} update by ${author}"
else
message = "1 update: ${stitle} in wiki ${res[0]} update by ${author}"
}
} else if (nb<30) {
def titleList = new ArrayList()
def wikis = new ArrayList()
for (item in list) {
def changedDoc = xwiki.getDocument("${item[0]}:${item[1]}")
if (changedDoc!=null) {
def stitle = changedDoc.displayTitle
if (!titleList.contains(stitle))
titleList.add(stitle)
if (!wikis.contains(item[0]))
wikis.add(item[0])
} else {
nb--;
}
}
def text = ""
if (titleList.size()<3) {
text = ": " + titleList.join(",")
} else {
text = "on " + titleList.size() + " pages"
}
if (wikis.size()==1) {
def wiki = wikis.get(0)
message = "${nb} changes in ${wiki} ${text}"
} else {
def nbwikis = wikis.size();
message = "${nb} changes in ${nbwikis} wikis ${text}"
}
} else if (nb>1) {
def wikis = new ArrayList()
for (item in list) {
if (!wikis.contains(item[0]))
wikis.add(item[0])
}
if (wikis.size()==1) {
def wiki = wikis.get(0)
message = "${nb} changes in ${wiki}"
} else if (wikis.size()<4) {
def swikis = wikis.join(",");
message = "${nb} changes in wikis: ${swikis}"
} else {
def nbwikis = wikis.size();
message = "${nb} changed in ${nbwikis} wikis"
}
}
return message;
}
// add jsx
xwiki.jsx.use(doc.fullName);
if (request.details) {
def starti = Integer.parseInt(request.start)
def endi = Integer.parseInt(request.end)
def delay = Integer.parseInt(request.delay)
def ctime = Long.parseLong(request.time)
def cdate = new DateTime(ctime);
def events = getEvents(starti, endi, delay, cdate)
if (events.size()>100) {
println "* Too many changes to show"
} else {
for (event in events) {
def pageName = "${event[0]}:${event[1]}"
def pagedoc = xwiki.getDocument(pageName)
if (pagedoc!=null) {
def authorName = xwiki.getUserName(event[2])
def comment = ""
if (event[5]=="addComment")
comment = findComment(pagedoc, event[7])
println """* Page [[$pagedoc.displayTitle>>${pageName}]] ${event[5]} by {{html}}${authorName}{{/html}} to version ${event[4]} on ${event[6]} ${comment}"""
}
}
}
} else {
def time1 = (new Date()).getTime();
println """{{html clean=false}}<p><ul>"""
def delay = 5;
if (request.delay)
delay = Integer.parseInt(request.delay)
def max = 20;
if (request.max)
max = Integer.parseInt(request.max)
def currentDate = new DateTime()
def sec = currentDate.getSecondOfDay()
def secDelay = (int) (600 - sec + 600*Math.floor(sec/600))
currentDate = currentDate.plusSeconds(secDelay);
def intervals = getIntervals(max, delay, secDelay);
def maxi = (int) ((intervals.size()>0) ? intervals.get(intervals.size()-1) : 1);
if (request.debug) {
println intervals;
println maxi
}
def st = 0;
for (interval in intervals) {
// we should stop when we have enough
if (st>=max)
break;
def i = (int) interval;
def starti = calcStart(i, false);
def endi = calcEnd(i, false);
if (request.debug) {
println "<li>Run ${i} ${starti} ${endi} ${delay} ${currentDate} ${maxi}</li>"
}
def list = getEventsWithCache(i, starti, endi, delay, currentDate, maxi , cache, false)
// def list = getEvents(starti, endi, delay, currentDate)
def message = getMessage(list, (request.withnochange=="1"));
if (message!="") {
def mn = starti*delay - (int) (secDelay/60)
def newDate = currentDate.minusMinutes(mn)
def stime = ""
if (newDate.getDayOfYear()+1==currentDate.getDayOfYear()) {
def sdf2 = new SimpleDateFormat("HH:mm")
stime = "Yesterday " + sdf2.format(newDate.toDate())
} else if (newDate.getDayOfYear()!=currentDate.getDayOfYear()) {
def sdf2 = new SimpleDateFormat("E MMM dd, HH:mm")
stime = sdf2.format(newDate.toDate())
} else {
if (mn>60) {
def hours = Math.floor(10*mn/60)/10;
if (hours>24) {
def rdays = (int) Math.floor(mn/60/24);
def rmn = mn - rdays*60*24;
def rhours = (int) Math.floor(rmn/60);
rmn = rmn - rhours*60;
stime = "${rdays} days ${rhours} hours and ${rmn} minutes ago";
} else {
def rhours = (int) Math.floor(mn/60);
def rmn = mn - 60*rhours;
stime = "${rhours} hours and ${rmn} minutes ago";
}
} else if (mn>0) {
stime = "${mn} minutes ago"
} else {
stime = "now"
}
}
println """<li><a href="javascript:void(0)" onclick="load('${doc.getURL("get")}', ${starti}, ${endi}, ${delay}, ${currentDate.toDate().time}); return false;">${stime}: ${message}</a>"""
println """<div id="data${starti}"></div></li>"""
st++;
}
}
def time2 = (new Date()).getTime();
def dtime = time2-time1
println """</ul></p><p><br />run in ${dtime} ms with ${nbqueries} queries ${nbchecks} security checks</p>"""
println "{{/html}}"
}
]
at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:198)
at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:56)
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:182)
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:311)
at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:88)
at org.xwiki.display.internal.DocumentContentAsyncExecutor.executeInCurrentExecutionContext(DocumentContentAsyncExecutor.java:396)
at org.xwiki.display.internal.DocumentContentAsyncExecutor.execute(DocumentContentAsyncExecutor.java:269)
at org.xwiki.display.internal.DocumentContentAsyncRenderer.execute(DocumentContentAsyncRenderer.java:112)
at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:157)
at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:54)
at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:290)
at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.execute(DefaultBlockAsyncRendererExecutor.java:125)
at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:67)
at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:43)
at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96)
at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39)
at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:123)
at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:52)
at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68)
at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42)
at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1388)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1524)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1491)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1406)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1533)
at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:796)
at jdk.internal.reflect.GeneratedMethodAccessor1124.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:704)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:75)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:242)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
at org.apache.velocity.Template.merge(Template.java:358)
at org.apache.velocity.Template.merge(Template.java:262)
at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225)
at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:105)
at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:219)
at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:174)
at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:135)
at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54)
at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284)
at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284)
at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:904)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:866)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:853)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:808)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:800)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:79)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:73)
at org.xwiki.template.script.TemplateScriptService.render(TemplateScriptService.java:54)
at jdk.internal.reflect.GeneratedMethodAccessor293.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:218)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:331)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:261)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:171)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
at org.apache.velocity.Template.merge(Template.java:358)
at org.apache.velocity.Template.merge(Template.java:262)
at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225)
at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:105)
at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:219)
at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:174)
at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:135)
at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54)
at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284)
at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284)
at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:904)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:866)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:846)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:832)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:91)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:85)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2564)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:180)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:651)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:339)
at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:354)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: javax.script.ScriptException: javax.script.ScriptException: com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct round( (datediff(current_timestamp(), act.date)*24*3600 + (hour(current_timestamp())-hour(act.date))*3600 + (minute(current_timestamp())-minute(act.date))*60 + (second(current_timestamp()) + 172 -second(act.date)))/60/5 - 0.5) from ActivityEventImpl as act where act.space not in ('XWiki','Scheduler', 'Sandbox', 'IRC') and act.page not in ('Main.ActStream', 'Main.ActStream2') and act.wiki not in ('import') and act.hidden<>1 order by act.date desc
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:164)
at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.eval(AbstractJSR223ScriptMacro.java:338)
at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:238)
at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:193)
... 147 more
Caused by: javax.script.ScriptException: com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct round( (datediff(current_timestamp(), act.date)*24*3600 + (hour(current_timestamp())-hour(act.date))*3600 + (minute(current_timestamp())-minute(act.date))*60 + (second(current_timestamp()) + 172 -second(act.date)))/60/5 - 0.5) from ActivityEventImpl as act where act.space not in ('XWiki','Scheduler', 'Sandbox', 'IRC') and act.page not in ('Main.ActStream', 'Main.ActStream2') and act.wiki not in ('import') and act.hidden<>1 order by act.date desc
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:334)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:161)
... 150 more
Caused by: com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct round( (datediff(current_timestamp(), act.date)*24*3600 + (hour(current_timestamp())-hour(act.date))*3600 + (minute(current_timestamp())-minute(act.date))*60 + (second(current_timestamp()) + 172 -second(act.date)))/60/5 - 0.5) from ActivityEventImpl as act where act.space not in ('XWiki','Scheduler', 'Sandbox', 'IRC') and act.page not in ('Main.ActStream', 'Main.ActStream2') and act.wiki not in ('import') and act.hidden<>1 order by act.date desc
at com.xpn.xwiki.store.XWikiHibernateStore.lambda$search$22(XWikiHibernateStore.java:2574)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:826)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:902)
at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2536)
at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2518)
at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2511)
at com.xpn.xwiki.store.XWikiCacheStore.search(XWikiCacheStore.java:701)
at com.xpn.xwiki.XWiki.search(XWiki.java:2496)
at com.xpn.xwiki.api.XWikiCompatibilityAspect.ajc$interMethod$com_xpn_xwiki_api_XWikiCompatibilityAspect$com_xpn_xwiki_api_XWiki$search(XWikiCompatibilityAspect.aj:1040)
at com.xpn.xwiki.api.XWiki.search(XWiki.java:1)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at Script33.getIntervals(Script33.groovy:15)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1333)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1088)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:165)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl$3.invokeMethod(GroovyScriptEngineImpl.java:315)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at Script33.run(Script33.groovy:221)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:331)
... 151 more
Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: ActivityEventImpl is not mapped [select distinct round( (datediff(current_timestamp(), act.date)*24*3600 + (hour(current_timestamp())-hour(act.date))*3600 + (minute(current_timestamp())-minute(act.date))*60 + (second(current_timestamp()) + 172 -second(act.date)))/60/5 - 0.5) from ActivityEventImpl as act where act.space not in ('XWiki','Scheduler', 'Sandbox', 'IRC') and act.page not in ('Main.ActStream', 'Main.ActStream2') and act.wiki not in ('import') and act.hidden<>1 order by act.date desc]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:138)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:757)
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:114)
at org.hibernate.engine.spi.SessionDelegatorBaseImpl.createQuery(SessionDelegatorBaseImpl.java:576)
at com.xpn.xwiki.internal.store.hibernate.legacy.LegacySessionImplementor.createQuery(LegacySessionImplementor.java:127)
at com.xpn.xwiki.internal.store.hibernate.legacy.LegacySessionImplementor.createQuery(LegacySessionImplementor.java:48)
at com.xpn.xwiki.store.XWikiHibernateStore.lambda$search$22(XWikiHibernateStore.java:2548)
... 176 more
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: ActivityEventImpl is not mapped [select distinct round( (datediff(current_timestamp(), act.date)*24*3600 + (hour(current_timestamp())-hour(act.date))*3600 + (minute(current_timestamp())-minute(act.date))*60 + (second(current_timestamp()) + 172 -second(act.date)))/60/5 - 0.5) from ActivityEventImpl as act where act.space not in ('XWiki','Scheduler', 'Sandbox', 'IRC') and act.page not in ('Main.ActStream', 'Main.ActStream2') and act.wiki not in ('import') and act.hidden<>1 order by act.date desc]
at org.hibernate.hql.internal.ast.QuerySyntaxException.generateQueryException(QuerySyntaxException.java:79)
at org.hibernate.QueryException.wrapWithQueryString(QueryException.java:103)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:220)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:144)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:112)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:73)
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:162)
at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:636)
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:748)
... 181 more
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: ActivityEventImpl is not mapped
at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:170)
at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:91)
at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:77)
at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:334)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3782)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3671)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:746)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:602)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:339)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:287)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:276)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:192)
... 187 more
16.7.0