Library that allows to setup a number of Liferay artifacts in the DB. It uses xml and Liferay APIs to add all configured artifacts.
We use Liferay as an application building platform.
In the approach pages, portlets, content and permissions serve as a building block of an application with consistent portal UX. It's all easy and fun unless you need to move through environments or track changes. Which you always need to track. Suddenly it becomes a problem that a very important part of your application resides in database.
The library helps to fix what need to be fixed across environments while allowing to use as much of a portal flexibility as needed.
The code is compatible with Liferay Portal DXP/7.x. We maintain a separate branch for Liferay Portal EE/CE 6.2.x.
We didn't publish binary yet so you'll need to build the jar yourself. Here are the steps to do it:
- Download sources.
- Install Maven 3.x.
- run
mvn clean install
- grab jar from
./target
or use as a dependency in your maven project
<dependency>
<groupId>com.ableneo.liferay</groupId>
<artifactId>db-setup-core</artifactId>
<version>2.2.0-SNAPSHOT</version>
</dependency>
Run com.ableneo.liferay.portal.setup.LiferaySetup#setup(java.io.File)
with following xml configuration:
<?xml version="1.0" encoding="UTF-8" ?>
<setup xmlns="http://www.ableneo.com/liferay/setup">
<configuration>
<run-as-user-email>[email protected]</run-as-user-email>
</configuration>
<!--
This will add new custom field that can be used in theme to control if ads should display on
particular page.
-->
<custom-fields>
<field name="showAds" type="boolean" class-name="com.liferay.portal.model.Layout">
<role-permission role-name="Guest" permission="view"/>
</field>
</custom-fields>
</setup>
When adding the library to a liferay OSGI module it will be necessary to specify the dependency into the bnd file:
Include-Resource: @db-setup-core-2.2.0-SNAPSHOT.jar
the name of the file is the same that you will find inside the maven/gradle repository.
Want/need to hack on db-setup-core? See our super short contributing guide for information on building, testing and contributing changes.
They are probably not perfect, please let me know if anything feels wrong or incomplete.
- OSGi descriptors exporting LiferaySetup
- reference documentation
- more tests
- how-to guides
- it's possible to use more than one company id per configuration file, the configuration will be applied to all listed companies
- tag names in configuration follow unified naming convention: word-word
- run-as-user renamed to run-as-user-email to be explicit about expected value
- added missing documentation to few xml elements
- setup xsd provides a version attribute
- configured sonar analysis on each commit
- configured maven test / coverage runner
- maven project structure has changed to single-module
- companyId, groupId and runAsUserId are set in Setup class and propagated to all involved Utils with SetupConfigurationThreadLocal context class
- improved MarshallUtil performance
- introduced unit tests
- most of the problems reported by sonar are fixed
- improved logging
- Added resource class name when creating ADT
- Fix user expando assignement
- Allow add categories and summaries to articles