Closed alexbudarov closed 4 years ago
Comments from Mario:
EditorPrintFormAction Constructor When using new EditorPrintFormAction(this, null) I have to pass in a null to express that I don’t want to define a output name. From an API usage perspective this is not very intuitive. Perhaps a builder would make sense here?
Connecting Button and EditorPrintFormAction Currently the glue code looks like this: Screen XML:
<button id="patientRecordBtn"
caption="msg://patientRecord"/>
Screen Controller:
@Inject
protected Button patientRecordBtn;
@Subscribe
protected void onInit(InitEvent event) {
patientRecordBtn.setAction(new EditorPrintFormAction(this, null));
}
RunReportAction
and ExecutionHistoryAction
return exception
repot -est.zip
java.lang.UnsupportedOperationException: Unsupported meta class repotest_TotalEntity for runReport action
at com.haulmont.reports.gui.actions.list.RunReportAction.actionPerform(RunReportAction.java:94)
at com.haulmont.cuba.web.gui.components.WebButton.buttonClicked(WebButton.java:67)
at com.haulmont.cuba.web.widgets.CubaButton.fireClick(CubaButton.java:76)
at com.vaadin.ui.Button$1.click(Button.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:431)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:396)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1578)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Description of the bug or enhancement
CUBA 7.0 introduced standard actions: http://cubadev:8181/manual/standard_actions.html
These actions can be simply added to a table by typing "type" attribute. Also Studio scans these actions and suggests them to user in a Screen Designer.
From first glance, at least TablePrintFormAction / ListPrintFormAction can work as a standard action.
Updates
Relates to #178. The
ExecutionHistoryAction
,RunReportAction
andListPrintFormAction
are implemented as standard actions.ExecutionHistoryAction
ExecutionHistoryAction
- standard action for displaying the report execution history. It should be defined on the screen that is associated withReport
. It should be defined for aButton
or a list component (Table
,DataGrid
, etc.). To view the report execution history set app propertyreporting.executionHistory.enabled = true
.Add
ExecutionHistoryAction
toButton
When the action is performed, a modal
ExecutionHistoryDialog
will open where reports related to the current screen will be displayed (to link the screen and the report, see the corresponding section below).ExecutionHistoryDialog
After clicking on the
Execution History
button, the execution history for the selected reports will be displayed. If no reports have been selected, then a execution history will be displayed for all reports associated with the screen.ListPrintFormAction
ListPrintFormAction
- for printing reports for a list of entity instances associated with a list component (Table
,DataGrid
, etc.). It should be defined for a list component in a screen XML descriptor. The action only selects reports having an external parameter of the Entity or the List of entities type and where the parameter entity type matches the entity type displayed by the list component. If only one report is available as a result of selection, it is invoked immediately. If several reports are available, their list is offered to the user for selection.When the action is performed, if no entities were selected from the list component, a confirmation window will be displayed. After that, the modal
Run reports
dialog will open where reports related to the current screen will be displayed (to link the screen and the report, see the corresponding section below).Print reports dialog
From this modal screen, the user can run the selected report for the selected entity.
RunReportAction
RunReportAction
- standard action for displaying the list of all available reports. It should be defined on the screen that is associated withReport
. It should be defined for aButton
or a list component (Table
,DataGrid
, etc.).Add
RunReportAction
toButton
When the action is performed, a modal
ReportRun
dialog will open where reports related to the current screen will be displayed (to link the screen and the report, see the corresponding section below).ReportRun dialog
How to link screen and report
To associate a screen with a report you need: 1) Open
Report
editor 2) Go toRoles and Screens
tab 3) Add a new screen to report.Test project
reports-standard-actions.zip
QA
1) Create
Customer
entity 2) CreateReport
forCustomer
entity 3) AddCustomer.browse
screen to report