Skip to content

Commit d7cabd3

Browse files
author
Mario David
committed
added field based annotations; some refactoring
1 parent 574c1cd commit d7cabd3

22 files changed

Lines changed: 280 additions & 72 deletions

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Select a version of the add-on which is compatible with the platform version use
1818

1919
| Platform Version | Add-on Version |
2020
| ---------------- | -------------- |
21-
| 6.6.x | 0.2.0 |
22-
| 6.5.x | 0.1.0 |
21+
| 6.6.x | 0.2.x - 0.3.x |
22+
| 6.5.x | 0.1.x |
2323

2424
Add custom application component to your project:
2525

@@ -86,9 +86,14 @@ is the only superclass you need to extend from. Not for every feature another su
8686

8787
## Defining Annotations
8888

89+
8990
Generally, there is another example repository, which shows the usage of this application component: [balvi/cuba-example-declarative-comments](https://github.com/balvi/cuba-example-declarative-comments)
9091
with the exact example of the `@Commentable`.
9192

93+
The application component allows two kinds of Annotations. A class-based Annotation and a field-based Annotation.
94+
95+
### Class-based Annotation: @Commentable
96+
9297
To create custom feature like `@Commentable` you have to do the following:
9398

9499
1. Create a Annotation in your web module like this:
@@ -151,6 +156,13 @@ you can take a look at the corresponding CUBA docs for
151156
[AbstractLookup](https://doc.cuba-platform.com/manual-6.6/abstractLookup.html) and [AbstractEditor](https://doc.cuba-platform.com/manual-6.6/abstractEditor.html).
152157

153158

159+
### Field-based Annotations
160+
161+
Field based annotations are useful if you want to enhance a particular Component on the page.
162+
163+
You can find the example for this in the example-project: [@IconCommentedEntities](https://github.com/balvi/cuba-example-declarative-comments/blob/master/modules/web/src/de/balvi/cuba/example/declarativecomments/web/iconcommented/IconCommentedEntities.groovy)
164+
165+
154166
That's it.
155167

156168
With this you have a single place where you can put your UI logic that is accessible for different screens.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cuba {
3535
artifact {
3636
group = 'de.balvi.cuba.declarativecontrollers'
3737
version = '0.3'
38-
isSnapshot = true
38+
isSnapshot = false
3939
}
4040
tomcat {
4141
dir = "$project.rootDir/deploy/tomcat"

gradle/wrapper/gradle-wrapper.jar

0 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Sep 18 16:17:01 CEST 2017
1+
#Wed Sep 20 11:35:13 CEST 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
1+
-- begin DBCDC_CUSTOMER
2+
create table DBCDC_CUSTOMER (
3+
ID varchar(36) not null,
4+
VERSION integer not null,
5+
CREATE_TS timestamp,
6+
CREATED_BY varchar(50),
7+
UPDATE_TS timestamp,
8+
UPDATED_BY varchar(50),
9+
DELETE_TS timestamp,
10+
DELETED_BY varchar(50),
11+
--
12+
NAME varchar(255),
13+
--
14+
primary key (ID)
15+
)^
16+
-- end DBCDC_CUSTOMER
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
create table DBCDC_CUSTOMER (
2+
ID varchar(36) not null,
3+
VERSION integer not null,
4+
CREATE_TS timestamp,
5+
CREATED_BY varchar(50),
6+
UPDATE_TS timestamp,
7+
UPDATED_BY varchar(50),
8+
DELETE_TS timestamp,
9+
DELETED_BY varchar(50),
10+
--
11+
NAME varchar(255),
12+
--
13+
primary key (ID)
14+
);

modules/global/src/de/balvi/cuba/declarativecontrollers/app-component.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
value="+de/balvi/cuba/declarativecontrollers/spring.xml"/>
2222
<property name="cuba.mainMessagePack"
2323
value="+de.balvi.cuba.declarativecontrollers.core"/>
24+
<artifact classifier="db"
25+
configuration="dbscripts"
26+
ext="zip"
27+
name="declarativecontrollers-core"/>
2428
</module>
2529
<module blocks="web,desktop"
2630
dependsOn="global"

modules/global/src/de/balvi/cuba/declarativecontrollers/entity/messages.properties

Whitespace-only changes.
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
3-
<persistence-unit name="cuba-component-declarative-controllers" transaction-type="RESOURCE_LOCAL">
4-
2+
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
3+
version="2.0">
4+
<persistence-unit name="cuba-component-declarative-controllers"
5+
transaction-type="RESOURCE_LOCAL">
56
</persistence-unit>
67
</persistence>

modules/web/src/de/balvi/cuba/declarativecontrollers/web-menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<menu-config xmlns="http://schemas.haulmont.com/cuba/menu.xsd">
33
<menu id="application-dbcdc" insertBefore="administration">
44
</menu>
5-
</menu-config>
5+
</menu-config>

0 commit comments

Comments
 (0)