Writing a Liferay Deployment Script Part 5

01 October 2016

In part 4 of this article we explored a method for transfering a password from one file to another. Now we are going to use Apache Ant to stop a Liferay server. What are the steps needed to accomplish this goal? First we need to determine if the Liferay server is running. No need to stop it if it isn’t running. Next we need to run the shutdown command. The shutdown command works most of the time. The build file will need to account for those times when it doesn’t. Because I will be using this on a Linux server we will start with the pgrep command.

Writing a Liferay Deployment Script Part 4

21 September 2016

In part 3 of this article we covered using waitFor, fail and exec to handle files. Today we are going to look into using Apache Ant filters to retrieve a password from an existing configuration file and then using the replace task to place the password in a new configuration file. There are a variety of filters available in Ant and I recommend you browse them to gain familiarity. We will be using the tokenfilter and striplinebreaks filter to retrieve our password. Below is an example build file.

Writing a Liferay Deployment Script Part 3

19 September 2016

In the previous two articles we listed our requirements and started exploring how Bash and Apache Ant could help us satisfy them. We ended the last part discussing using the Exec task to run the “tar” command from the operating system. This works well if the target file is present, but what happens if the file is not present? The Ant task will fail with a somewhat cryptic message. Fortunately Ant provides us with the tools to check for the files existence and to fail with a custom error message. Three tasks help us accomplish this goal: echo, waitfor and fail. We have already discussed the echo task. Waitfor and fail both rely on conditions The waitfor task, as its name implies, waits for a condition to be true. Today our condition will be whether or not a file exists. The fail task stops Ant from continuing and prints out a message. Example code below shows how they can be used together.

Liferay: How to Find Current User Permission Algorithm Version

27 April 2016

Recently my workstation was scanned for vulnerabilities and the Nessus scanning software reported a medium vulnerability of “SSH Weak Algorithms Supported”. The Vulnerability report had few details. Luckily I was able to find the folowing resources.

Subversion: Useful Command Line Goodness

21 April 2016

Recently there has been the need for me to revert changes in Subversion and to remove all unversioned files. This requires a few different Linux commands along with some Subversion commands.

Liferay: Internet Explorer (IE) and JSON Mime Type

09 April 2016

After upgrading to Liferay 6.2 we noticed that some of our portlets quit working in IE while still working with Firefox. Specifically those portlets relying on AJAX calls. Turns out, by default, Liferay 6.2 gives a MIME type “text/javascript” to JSON results delivered to IE. Results delivered to Firefox have a MIME type of “application/json”.

Older posts are available in the archive.