Library that allows to setup a number of Liferay artifacts in the DB. It uses xml configuration and Liferay APIs to add all configured artifacts.
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.
- cd
db-setup-core
- run
mvn clean install
- grab jar from
db-setup-core/target
or use as a dependency in your maven project
<dependency>
<groupId>com.mimacom.liferay</groupId>
<artifactId>db-setup-core</artifactId>
<version>2.1.2</version>
</dependency>
Run com.mimacom.liferay.portal.setup.LiferaySetup#setup(java.io.File)
with following xml configuration:
<?xml version="1.0" encoding="UTF-8" ?>
<setup xmlns="http://www.mimacom.com/liferay/setup">
<configuration>
<runasuser>[email protected]</runasuser>
</configuration>
<!--
This will add new custom field that can be used in theme to control if ads should display on
particular page.
-->
<customFields>
<field name="showAds" type="boolean" className="com.liferay.portal.model.Layout">
<role-permission role-name="Guest" permission="view"/>
</field>
</customFields>
</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.1.2.jar
the name of the file is the same that you will find inside the maven/gradle repository.
- Version 2.x.x: Liferay Portal DXP/7.0.x
- Version 1.x.x: Liferay Portal EE/CE 6.2.x