Skip to content

Turns a messy portal-*.properties into a clean and well organised portal-*.properties

License

Notifications You must be signed in to change notification settings

tmoreira2020/portal-properties-prettier-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portal Properties Prettier App

Coverage Status Maven Central

Turns a messy Liferay portal-*.properties into a clean and well organised portal-*.properties. Basically it does 6 things:

  • Identify, group and comment properties that has the same values as the original portal.properties located at portal-impl.jar
  • Identify, group and comment properties that are obsolete for the given Liferay version
  • Identify, group and recommend a fix for properties that has typos in its key's declaration
  • Group custom properties in a section in the beginning of the file
  • Sort the properties in the same order as the original portal.properties
  • Add the original comments for each property as definied in the portal.properties file

Online version

You can test it on http://portalproperti.es

Command line version

You can also call the service from command line using curl. If you don't provide a Liferay version it will use the default that is 7.0.4-ga5.

curl http://portalproperti.es/prettify -F portalPropertiesFile=@/path/to/portal-ext.properties

If you need to use a different Liferay version, for instance 6.1.0-ga1, you must use the following format

curl http://portalproperti.es/prettify/6.1.0-ga1 -F portalPropertiesFile=@/path/to/portal-ext.properties

Or if you need to print the original value of each customized property you must call the service this way

curl http://portalproperti.es/prettify/6.2.3-g4/true -F portalPropertiesFile=@/path/to/portal-ext.properties

Sample

Input
    javascript.fast.load=true
    layout.user.public.layouts.modifiable=false
    liferay.error.log.path=/var/log/liferay
    liferay.home=/opt/liferay
    jdbc.default.jndi.name=jdbc/LiferayDataSource
    cluster.link.enable=true
Output
##
## Removed properties
##

    #
    # The properties listed below has the exactly same value as in the original
    # portal.properties which means that they are safe to be removed.
    #
    #javascript.fast.load=true

##
## Obsolete properties of 6.1.0-ga1
##

    #
    # The properties listed below are obsolete for version 6.2.3-ga4 which
    # means that they don't have any influence in how Liferay is configured
    # and are safe be to removed.
    #
    #layout.user.public.layouts.modifiable=false

##
## Typo properties
##

    #
    # The properties listed below looks like that has a typo in its declaration
    # which means that they don't have any influence in how Liferay is configured.
    # The system suggested the correct property name in the comments.
    #
    #cluster.link.enabled=true
    cluster.link.enable=true

##
## Custom properties
##

    custom.error.log.path=/var/log/liferay

##
## Liferay Home
##

    #
    # Specify the Liferay home directory.
    #
    liferay.home=/opt/liferay

##
## JDBC
##

    #
    # Set the JNDI name to lookup the JDBC data source. If none is set,
    # then the portal will attempt to create the JDBC data source based on the
    # properties prefixed with "jdbc.default.".
    #
    jdbc.default.jndi.name=jdbc/Liferay6Dev

License

Portal Properties Prettier App is licensed under Apache 2 license.

Maven/Gradle

Portal Properties Prettier App is available on Maven central, the artifact is as follows:

Maven:

<dependency>
    <groupId>br.com.thiagomoreira.liferay.plugins.portal-properties-prettier-app</groupId>
    <artifactId>portal-properties-prettier-app</artifactId>
    <version>1.5.0</version>
    <type>lpkg</type>
</dependency>

Gradle:

dependencies {
    compile(group: "br.com.thiagomoreira.liferay.plugins.portal-properties-prettier-app", name: "portal-properties-prettier-app", version: "1.5.0", type: "lpkg");
}

Support

Portal Properties Prettier App tracks bugs and feature requests with Github's issue system. Feel free to open your new ticket!

Contributing

Portal Properties Prettier App is a project based on Maven to improve it you just need to fork the repository, clone it and from the command line invoke

mvn package

After complete your work you can send a pull request to incorporate the modifications.

Enjoy!

About

Turns a messy portal-*.properties into a clean and well organised portal-*.properties

Resources

License

Stars

Watchers

Forks

Packages

No packages published