Skip to content

Latest commit

 

History

History
50 lines (44 loc) · 1.93 KB

README.md

File metadata and controls

50 lines (44 loc) · 1.93 KB

Liferay Portal DB Setup core Build Status Gitter chat

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.

Usage

Setup

We didn't publish binary yet so you'll need to build the jar yourself. Here are the steps to do it:

  1. Download sources.
  2. Install Maven 3.x.
  3. cd db-setup-core
  4. run mvn clean install
  5. 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>

Integration

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>test@liferay.com</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.

Compatibility

  • Version 2.x.x: Liferay Portal DXP/7.0.x
  • Version 1.x.x: Liferay Portal EE/CE 6.2.x