Archive | Liferay RSS feed for this section

JournalVmUtil in Liferay 6.1

11 Jul

Disclaimer – Following is not the best or optimal solution. If you have better suggestion please write in comments

JournalVmUtil was present upto Liferay 5.2 and then deprecated in Liferay 6.0 and then completed removed in Liferay 6.1. If you are upgrading to 6.1 and make extensive use of JournalVmUtil you can do the following.

Extend VelocityTemplateParser.java. Following code example is just a sample. Feel free to add any pre-processing or post-processing as required

package com.myexamples.mypackage;

import com.liferay.portal.kernel.templateparser.TemplateNode;
import com.liferay.portal.kernel.xml.Element;
import com.liferay.portlet.journal.util.VelocityTemplateParser;

import java.util.List;

/**
 * @author parasjain
 */
public class MyVelocityTemplateParserImpl extends VelocityTemplateParser{
    public List getNodes(Element element) throws Exception {
        return getTemplateNodes(element);
    }
}

Now inject MyVelocityTemplateParserImpl in your velocity templates and just call getNodes method like this

#set( $articleTemplateNodes = $myVelocityTemplateParser.getNodes($articleXmlDocument.getRootElement()) )

No theme found for specified theme id abc_WAR_xyztheme

11 Jul

As far as my experience is concerned, this error means that your database is referring to theme which is not present. To make sure run the following commands

select distinct themeid from layout;
select distinct themeid from layoutset;

Now go to liferay’s Control Panel -> Plugin Configuration -> Theme Plugins tab and click on the theme in question. See the
Plugin ID of the theme. It should match what is there in layout and layoutset tables. If it doesn’t then you have to either change themeid or update database tables. If you happen to update DB don’t forget to restart or clear DB cache.

Changing Liferay Password in database

12 Jun

Note : Use caution while trying this for the production installation. For production, it’s better to use technics like “Forgot Password”

If you forget password for your local admin account in Liferay, then stop the server and run the following command

update user_ set passwordEncrypted=0, password_='mynewpassword', passwordReset=1 where userId=10196;

 

Where mynewpassword is your new password. Now restart the server. This time you should be able to login with your new password. As soon as you login, Liferay should prompt you for password change. Change your password and try to remember it this time ;)

Follow

Get every new post delivered to your Inbox.