Skip to content

Commit cf538a4

Browse files
authored
Merge pull request #41 from ktor/master
update to 7.4.3.86-ga86, added new docs and examples
2 parents a80a334 + 073dc42 commit cf538a4

33 files changed

+1253
-526
lines changed

.envrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
- uses: actions/checkout@v2
1414
with:
1515
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16-
- name: Set up JDK 1.8
16+
- name: Set up JDK 11
1717
uses: actions/setup-java@v1
1818
with:
19-
java-version: 8
19+
java-version: 11
2020
- name: Cache SonarCloud packages
2121
uses: actions/cache@v1
2222
with:

CONTRIBUTING.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
We didn't publish binary yet so you'll need to build the jar yourself. Here are the steps to do it:
1313

1414
. Download sources.
15-
. Install JDK 1.8
16-
. Install Maven 3.6.3 or higher.
15+
. Install JDK 11
16+
. Install Maven 3.8.1 or higher.
1717
. Run: `mvn clean install`
1818

1919
=== Automated local build environment setup with nix

LICENSE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
MIT License
22

3-
Copyright (C) 2018 - 2021 ableneo, s. r. o. (Original work Copyright (C) 2016 - 2018 mimacom AG)
3+
Copyright (C) 2016 - 2018 mimacom AG
4+
Copyright (c) 2020 Lundegaard a.s.
5+
Copyright (C) 2018 - 2024 ableneo Slovensko s.r.o.
46

57
Permission is hereby granted, free of charge, to any person obtaining a copy
68
of this software and associated documentation files (the "Software"), to deal

README.adoc

Lines changed: 107 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,107 @@
11
= Liferay Portal DB setup core
2-
:liferay-version: 7.3.6
3-
:current-db-setup-core-version: 7.3.605
2+
:liferay-version: 7.4.3.86
3+
:current-db-setup-core-version: 7.4.386.0
44
:TOC:
55

66
image:https://maven-badges.herokuapp.com/maven-central/com.ableneo.liferay/com.ableneo.liferay.db.setup.core/badge.svg?color=blue[Maven Central,link=https://search.maven.org/search?q=g:com.ableneo.liferay%20AND%20a:com.ableneo.liferay.db.setup.core]
77
image:https://github.com/ableneo/liferay-db-setup-core/actions/workflows/build.yml/badge.svg[Build workflow status,link=https://github.com/ableneo/liferay-db-setup-core/actions/workflows/build.yml]
8-
image:https://sonarcloud.io/api/project_badges/measure?project=liferay-db-setup-core-2_x&metric=alert_status[Quality Gate Status,link=https://sonarcloud.io/dashboard?id=liferay-db-setup-core-2_x]
8+
image:https://sonarcloud.io/api/project_badges/measure?project=ableneo_liferay-db-setup-core&metric=alert_status[Quality Gate Status,link=https://sonarcloud.io/dashboard?id=ableneo_liferay-db-setup-core]
9+
10+
Library that allows to automate https://github.com/liferay[Liferay] data setup. It uses XML configuration input to add the data.
11+
12+
== Liferay Portal version compatibility
13+
14+
|===
15+
|Liferay Portal version|DB setup core version
16+
17+
|{liferay-version} |{current-db-setup-core-version} link:https://github.com/ableneo/liferay-db-setup-core/tree/master[source]
18+
|7.3.6 | 7.3.605 link:https://central.sonatype.com/artifact/com.ableneo.liferay/com.ableneo.liferay.db.setup.core/7.3.605[jar] link:https://github.com/ableneo/liferay-db-setup-core/tree/7.3.6[source]
19+
|7.3.5 | 7.3.5 link:https://github.com/ableneo/liferay-db-setup-core/tree/7.3.5[source]
20+
|7.1.2 | link:https://github.com/ableneo/liferay-db-setup-core/tree/b0d4e1d602015b704218c5511277bc87dc7eb9c7[source]
21+
|6.2.5 | link:https://github.com/ableneo/liferay-db-setup-core/tree/1.x[source]
22+
23+
|===
924

10-
Library that allows to setup a number of https://github.com/liferay[Liferay] artifacts in the DB. It uses xml and https://docs.liferay.com/portal/7.0/javadocs/portal-kernel[Liferay APIs] to add all configured artifacts.
1125

1226
== Usage
1327

14-
We recommend using Liferay's link:https://learn.liferay.com/dxp/latest/en/building-applications/data-frameworks/upgrade-processes.html[upgrade process] or control panel portlet to apply declared database changes.
28+
. Install the `com.ableneo.liferay.db.setup.core-{current-db-setup-core-version}.jar` bundle in `${liferay.home}/osgi/modules`
29+
. Prepare your own bundle that uses the library as a `provided`/`compileOnly` dependency. For example:
30+
+
31+
.build.gradle
32+
[subs=attributes+]
33+
```groovy
34+
dependencies {
35+
compileOnly 'com.ableneo.liferay:com.ableneo.liferay.db.setup.core:{current-db-setup-core-version}'
36+
}
37+
```
38+
+
39+
.pom.xml
40+
[subs=attributes+]
41+
```xml
42+
<dependency>
43+
<groupId>com.ableneo.liferay</groupId>
44+
<artifactId>com.ableneo.liferay.db.setup.core</artifactId>
45+
<version>{current-db-setup-core-version}</version>
46+
<scope>provided</scope>
47+
</dependency>
48+
```
49+
50+
. Prepare xml data configuration. Documentation sits directly in the link:src/main/resources/setup_definition.xsd[setup_definition.xsd] file.
51+
+
52+
.Example documentation
53+
image:doc/xsd-inline-documentation.png[]
54+
+
55+
.Example configuration: setup.xml
56+
[source,xml]
57+
----
58+
<?xml version="1.0" encoding="UTF-8" ?>
59+
<setup xmlns="http://www.ableneo.com/liferay/setup">
60+
<configuration>
61+
<!-- uses random administrator account for the setup in the company, run-as-user-email tag allows to specify particular admin account to be used for the setup -->
62+
<company>
63+
<companyid>20101</companyid> <!-- companywebid can be used alternatively -->
64+
</company>
65+
</configuration>
66+
<sites>
67+
<site> <!-- Guest by default -->
68+
<vocabulary name="Some categories" uuid="602f55b6-6021-455e-8d6d-696cc25daa91">
69+
<title-translation locale="de_DE" text="Einige Kategorien"/>
70+
<category name="Other categories" uuid="867b33df-2465-4a81-9945-88159c604589">
71+
<title-translation locale="de_DE" text="Andere Kategorien"/>
72+
<category name="New category" uuid="5fb4308e-bd21-4cf4-bdc5-3557508ffe4a">
73+
<title-translation locale="de_DE" text="Neue Kategorie"/>
74+
</category>
75+
</category>
76+
</vocabulary>
77+
</site>
78+
</sites>
79+
</setup>
80+
----
81+
. Load the XML setup file and run `setup` method on it:
82+
+
83+
[source, java]
84+
----
85+
URL resource = Thread.currentThread().getContextClassLoader().getResource(path);
86+
InputStream setupFile = Objects.requireNonNull(resource, "XML Liferay DB setup file not found in classpath.").openStream();
87+
Setup setup = MarshallUtil.unmarshall(setupFile);
88+
boolean setupSuccess = LiferaySetup.setup(setup);
89+
----
90+
91+
==== Example project
92+
93+
Used primarily for integration testing but may be a good start for your application: link:./com.ableneo.liferay.portal.setup.example/[com.ableneo.liferay.portal.setup.example]
94+
95+
=== How to bundle and execute DB changes for Liferay portal
96+
97+
Bundling XML descriptors and code that will execute them in bundle separate to the
98+
99+
.Directory layout in bundle project
100+
101+
.Usage in activator class
102+
[source, java]
103+
----
104+
----
15105

16106
=== Configuration header
17107
All data definitions in the setup XML file are applied according to the `configuration` header. The header defines:
@@ -194,82 +284,18 @@ Document's file itself is determined by `file-system-name` attribute which defin
194284
</sites>
195285
----
196286

197-
=== Setup guide
198-
199-
. Install the `com.ableneo.liferay.db.setup.core-{current-db-setup-core-version}.jar` bundle in `${liferay.home}/osgi/modules`
200-
. Prepare your own bundle that uses the library as a `provided`/`compileOnly` dependency. For example:
201-
+
202-
.build.gradle
203-
[subs=attributes+]
204-
```groovy
205-
dependencies {
206-
compileOnly 'com.ableneo.liferay:com.ableneo.liferay.db.setup.core:{current-db-setup-core-version}'
207-
}
208-
```
209-
+
210-
.pom.xml
211-
[subs=attributes+]
212-
```xml
213-
<dependency>
214-
<groupId>com.ableneo.liferay</groupId>
215-
<artifactId>com.ableneo.liferay.db.setup.core</artifactId>
216-
<version>{current-db-setup-core-version}</version>
217-
<scope>provided</scope>
218-
</dependency>
219-
```
220-
221-
. Prepare xml data configuration. Documentation sits directly in the link:src/main/resources/setup_definition.xsd[setup_definition.xsd] file.
222-
+
223-
.Example documentation
224-
image:doc/xsd-inline-documentation.png[]
225-
+
226-
.Example configuration: setup.xml
227-
[source,xml]
228-
----
229-
<?xml version="1.0" encoding="UTF-8" ?>
230-
<setup xmlns="http://www.ableneo.com/liferay/setup">
231-
<configuration>
232-
<!-- uses random administrator account for the setup in the company, run-as-user-email tag allows to specify particular admin account to be used for the setup -->
233-
<company>
234-
<companyid>20101</companyid> <!-- companywebid can be used alternatively -->
235-
</company>
236-
</configuration>
237-
<sites>
238-
<site> <!-- Guest by default -->
239-
<vocabulary name="Some categories" uuid="602f55b6-6021-455e-8d6d-696cc25daa91">
240-
<title-translation locale="de_DE" text="Einige Kategorien"/>
241-
<category name="Other categories" uuid="867b33df-2465-4a81-9945-88159c604589">
242-
<title-translation locale="de_DE" text="Andere Kategorien"/>
243-
<category name="New category" uuid="5fb4308e-bd21-4cf4-bdc5-3557508ffe4a">
244-
<title-translation locale="de_DE" text="Neue Kategorie"/>
245-
</category>
246-
</category>
247-
</vocabulary>
248-
</site>
249-
</sites>
250-
</setup>
251-
----
252-
. Load the XML setup file and run `setup` method on it:
253-
+
254-
[source, java]
255-
----
256-
URL resource = Thread.currentThread().getContextClassLoader().getResource(path);
257-
InputStream setupFile = Objects.requireNonNull(resource, "XML Liferay DB setup file not found in classpath.").openStream();
258-
Setup setup = MarshallUtil.unmarshall(setupFile);
259-
boolean setupSuccess = LiferaySetup.setup(setup);
260-
----
261-
262-
263287
=== Liferay Portal requirements
264288

265289
The code is compatible with *Liferay Portal {liferay-version}*. Other versions that have been or are supported:
266290

291+
. https://github.com/ableneo/liferay-db-setup-core/tree/7.3.6[Liferay Portal EE/CE 7.3.6]
267292
. https://github.com/ableneo/liferay-db-setup-core/tree/7.3.5[Liferay Portal EE/CE 7.3.5]
268293
. https://github.com/ableneo/liferay-db-setup-core/tree/b0d4e1d602015b704218c5511277bc87dc7eb9c7[Liferay Portal EE/CE 7.1.2]
269294
. https://github.com/ableneo/liferay-db-setup-core/tree/1.x[Liferay Portal EE/CE 6.2.5 and higher]
270295

271296
== Roadmap
272297

298+
* integration with link:https://liferay.dev/es/blogs/-/blogs/site-initializers-101[Site Initializers]
273299
* more tests
274300
* project integration with lundegaard fork: https://github.com/lundegaard/liferay-db-setup-core, until than changes and fixes from lundegaard fork will be ported to the library
275301

@@ -290,6 +316,16 @@ They are probably not perfect, please let me know if anything feels wrong or inc
290316

291317
== Changelog
292318

319+
=== Version 7.4.386.0
320+
321+
==== Features & bug fixes
322+
* switched to JDK11
323+
* upgraded and tested all features in link:./com.ableneo.liferay.site.example/src/main/resources/setup-ableneo-site.xml[example setup] with Liferay Portal 7.4.3.86
324+
* attached two tests from lundegaard fork, credit goes to link:https://github.com/Jandys[Jakub Jandak], thank you!
325+
326+
==== Refactorings & project changes
327+
* improved documentation
328+
293329
=== Version 7.3.605
294330
==== Features & bug fixes
295331
* fixed bug when handling multiline link:https://learn.liferay.com/dxp/latest/en/installation-and-upgrades/securing-liferay/securing-web-services/setting-service-access-policies.html[service access policy]

bnd.bnd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
Import-Package: \
2+
!com.liferay.portal.kernel.test.portlet.*,\
3+
*;resolution:=optional
14
-exportcontents: com.ableneo.*

0 commit comments

Comments
 (0)