This application component lets you easily add log entries to any entity in your application.
loggable
is available in the CUBA marketplace- Select a version of the add-on which is compatible with the platform version used in your project:
Platform Version | Add-on Version |
---|---|
7.2.x | 0.1.x |
Add custom application component to your project:
- Artifact group:
de.diedavids.cuba.loggable
- Artifact name:
loggable-global
- Version: add-on version
The following databases are supported by this application component:
- HSQLDB
- PostgreSQL
All other DBMS systems are supported in the way, that CUBA studio automatically creates DDL scripts. Therefore it is totally possible to use the application component even without dedicated SQL scripts directly from this application component.
Let your browse screens implement the WithLogEntriesSupport
interface.
public class CustomerBrowse extends StandardLookup<Customer> implements WithLogEntriesSupport {
@Inject
protected GroupTable<Customer> customersTable;
@Inject
protected ButtonsPanel buttonsPanel;
@Override
public ListComponent getListComponentForLogEntries() {
return customersTable;
}
@Override
public ButtonsPanel getButtonsPanelForLogEntries() {
return buttonsPanel;
}
@Override
public WindowManager.OpenType logEntryListOpenType() {
return WindowManager.OpenType.NEW_TAB;
}
}
In the Interface variant the following attributes have to be defined by implementing methods instead of annotation attributes:
getListComponentForLogEntries
defines the list component to target for the loggable functionalitygetButtonsPanelForLogEntries
defines the button panel on which a button will be placedlogEntryListOpenType
optionally defines the open type for the logEntry list
Besides using LogEntries in the Browse Screen of the Entity, it is also possible to show LogEntries as part of an Edit Screen.
In order to do display logEntries of a particular Entity there is a fragment
which can be used in the Edit Screen:
<fragment screen="ddcl_EntityLogEntriesFragment">
<properties>
<property name="loggableDc" ref="customerDc"/>
</properties>
</fragment>
An example can be found in the customer-edit.xml.
To see this application component in action, check out this example: cuba-example-using-loggable.