Saturday, November 16, 2013

Some useful notes :)


p_p_lifecycle=0 > render url

p_p_lifecycle=1 > action url

p_p_lifecycle=2 > serveresource url

you might be have seen p_p_lifecycle in query string many times BUT might be not knowing exactly what is each value exactly mean

It is important to know what are the possible values for p_plifecycle & how they can be helpful, might be useful in forming friendly urls (of Freindly url routes feature of Liferay)

Liferay Sample plugins

For latest version of Liferay released you will have at

You will have plugins for other versions tagged appropriately here

Tuesday, November 12, 2013

Browsing through different Alloy UI versions documentation

As of writing this post we have 1.0.x, 15.x & 2.0.x Alloy UI versions available

For API documentation related to exach version you can browse as below - This points to latest documentation always (which is 2.0.x)

How to navigate to different versions from, you will some selectable kind of option at ALLOYUI as show below

Hope it helps some people who have hard time finding out AUI documentation

Using Liferay.provide - to add global java script function

An example function

Liferay.provide(window, 'existingUser', function(sessionId, buttonClicked) {
var A = AUI();

var hrefDefaultVal ='#openServeyWindow').getAttribute('href');
var jsAtt = sessionId;'#openServeyWindow').setAttribute('href', hrefDefaultVal+jsAtt);'#openServeyWindow').setAttribute('onclick', "saveEntry('${count}','${newSessionIdPK}','${recentSessionIdPK}','"+buttonClicked+"' );");

if (navigator.appName == 'Microsoft Internet Explorer') {// as AUI simulate is not working in IE, handling through
var elem = document.getElementById("openServeyWindow");
if (typeof elem.onclick == "function") {
}else{ // other browsers
// click working fine with below command for IE, redirect is not happening'#openServeyWindow').simulate('click');

window.location.replace('${lastAccessedPageUrl}'); // to redirect to previous page

Somehow this works well compared to (it seems because of lazy loading aui does with aui:script use attribute)
// whole function code from above