Skip to content
CUBA component that lets you add attachments to any entity
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config/codenarc
gradle/wrapper
img
modules
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.txt
README.md
RELEASE.md
build.gradle
extra.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle
studio-settings.xml
upload-to-repository.sh

README.md

Download license Build Status Coverage Status

CUBA Platform Component - Attachable

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

Just add @WithAttachments on the browse screen of your entity and the rest will be done by this app-component.

1-browse-with-attachments

Installation

  1. attachable 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
6.10.x 0.5.x
6.9.x 0.2.x - 0.4.x
6.8.x 0.1.x

The latest version is: Download

Add custom application component to your project:

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

Supported DBMS

The following databases are supported by this application component:

  • HSQLDB
  • PostgreSQL

Usage

To add attachments to your entity, you have to add the following annotation to your browse / edit screen controller:

@WithAttachments(listComponent = "customersTable")
public class CustomerBrowse extends AnnotatableAbstractLookup {
}

For the @WithAttachments annotation you need to define the list component on which it should add the attachments button. Normally this is the id of the table you defined in your browse screen.

This annotation will create a button in the buttonsPanel of the table and add the Attachments button after the default CUBA buttons.

The @WithAttachments annotations can be customized through the following attributes:

  • String listComponent - the id of the list component / table where the button will be added - REQUIRED
  • String buttonId - the id of the newly created button that will be created ("attachmentBtn" by default)
  • String buttonsPanel - the id of the buttons panel where the new button will be added ("buttonsPanel" by default)

Example usage

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

Attachment list

The attachment button will show all attachments that have been added to a particular selected entity. It allows to add, edit & remove attachments to this entity. 2-attachments-list

Attachment preview

Furthermore it gives the user the option to preview the attachment directly in the browser or download the attachment.

3-attachment-preview

The ability to do the preview depends on the attachment type and the browser capabilities.

Configuration options

The application components adds the following application properties, that can be changed in the corresponding screen (`Administration > Application Properties):

  • attachable.updateAttachmentCounterOnSelect - whether or not a counter of attachments should be displayed after a particular entity is selected in the table
You can’t perform that action at this time.