Skip to content

web-devel/cuba-component-loggable

 
 

Repository files navigation

Download license Build Status Coverage Status

CUBA Platform Component - Loggable

This application component lets you easily add log entries to any entity in your application.

Installation

  1. loggable is available in the CUBA marketplace
  2. 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

The latest version is: Download

Add custom application component to your project:

  • Artifact group: de.diedavids.cuba.loggable
  • Artifact name: loggable-global
  • Version: add-on version

Supported DBMS

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.

Using the application component

Browse Screens

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 functionality
  • getButtonsPanelForLogEntries defines the button panel on which a button will be placed
  • logEntryListOpenType optionally defines the open type for the logEntry list

Edit Screens

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.

Example usage

To see this application component in action, check out this example: cuba-example-using-loggable.

About

CUBA application component lets you easily add log entries to any entity in your application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 88.5%
  • TSQL 7.6%
  • Groovy 3.8%
  • Shell 0.1%