Hello,
FirstSpirit 5.1.605.IE 9/Chrome 34.
I have been building a ReportPlugin, which lists Pages according to various criteria. The basic plugin is working in SiteArchitect, and the report appears in ContentCreator. But when I mouse over the Report item, or click on it, an error is thrown.
In the web browser console the error is:
Mon Aug 01 12:14:45 GMT+100 2016 de.espirit.firstspirit.webedit.client.report.HtmlReportServiceAsyncProxy SEVERE: Status code detection: 500 The call failed on the server; see server log for details On the server, the logs show:
[–] 11:46:54 DEBUG 01.08.2016 11:46:54.707 (fs.webedit.server.report.HtmlReportManager) [...] 01.08.2016 11:46:54 DEBUG 01.08.2016 11:46:54.707 (de.espirit.firstspirit.webedit.server.report.HtmlReportManager): Created report-proxy, handle=715816598, type=PluginReportType{_type=uk.gov.scotland.afrc.firstspirit.contentreports.PageContentReportPlugin,renderer:false}, sessionID=3601705410209406750, user=d416936
Then:
(de.espirit.firstspirit.webedit.server.control.PollSupportingWebeditService): [Sync] call 'HtmlReportServiceImpl.getActions()' failed: java.lang.NullPointerException
FSVersion=5.1.605.72781#4210;JDK=1.7.0_45 64bit Oracle Corporation;OS=Linux 2.6.32-358.23.2.el6.x86_64 amd64;Date=01.08.2016 11:46:57
java.lang.NullPointerException
at de.espirit.firstspirit.webedit.server.action.ActionManager.getPluginActions(ActionManager.java:273)...
Then:
1.08.2016 11:46:57 WARN 01.08.2016 11:46:57.444 (/fs5webedit_466725): Exception while dispatching incoming RPC call
FSVersion=5.1.605.72781#4210;JDK=1.7.0_45 64bit Oracle Corporation;OS=Linux 2.6.32-358.23.2.el6.x86_64 amd64;Date=01.08.2016 11:46:57
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract de.espirit.firstspirit.webedit.client.action.Action[] de.espirit.firstspirit.webedit.client.report.HtmlReportService.getActions(int,java.lang.String) throws de.espirit.firstspirit.webedit.client.report.ReportException' threw an unexpected exception: java.lang.NullPointerException
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:389)
at de.espirit.firstspirit.webedit.server.control.PollSupportingWebeditService.logAndEncode...
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
at de.espirit.firstspirit.webedit.server.action.ActionManager.getPluginActions(ActionManager.java:273)
at de.espirit.firstspirit.webedit.server.action.ActionManager._getActions(ActionManager.java:178)
I can't find any reference to HtmlReportManager or HtmlReportService in the FirstSpirit documentation, so I don't know what I've done wrong or forgotten to do.
My ReportItem looks like this code. The logging message "Navigating to..." never appears in the logs:
public class AFRCReportItem extends ReportType implements ReportItem<IDProvider>, JavaClientExecutableReportItem<IDProvider>,
WebeditExecutableReportItem<IDProvider> {
...
public void execute(ReportContext<IDProvider> reportContext) {
final IDProvider idProvider = reportContext.getObject();
reportContext.logDebug("++++ Navigating to " + idProvider.getUid() + ", class: " + idProvider.getClass().getName());
if (!reportContext.is(BaseContext.Env.WEBEDIT)) {
reportContext.requireSpecialist(OperationAgent.TYPE).getOperation(DisplayElementOperation.TYPE).perform(idProvider);
} else {
PageRef pageRef = null;
for (final ReferenceEntry inboundReference : idProvider.getIncomingReferences()) {
if (inboundReference.getType() == ReferenceEntry.SITE_STORE_REFERENCE) {
final IDProvider referenceElement = inboundReference.getReferencedElement();
if (referenceElement instanceof PageRef && idProvider.equals(((PageRef) referenceElement).getPage())) {
pageRef = (PageRef) referenceElement;
}
}
}
if (pageRef != null) {
final OperationAgent operationAgent = reportContext.requestSpecialist(OperationAgent.TYPE);
final DisplayElementOperation displayElementOperation = operationAgent.getOperation(DisplayElementOperation.TYPE);
if (displayElementOperation != null) {
displayElementOperation.setLanguage(reportContext.getObject().getProject().getMasterLanguage());
reportContext.logDebug("++++ Navigating to " + pageRef.getUid() + "");
displayElementOperation.perform(pageRef);
}
}
}
}
The report only lists Pages, and when the user clicks on the page the ContentCreator should navigate to that page, as it does in SiteArchitect.
Many thanks,
Liam Davison