Liferay.com

Saturday, November 16, 2013

Some useful notes :)

p_p_lifecycle

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

http://alloyui.com/api/ - This points to latest documentation always (which is 2.0.x)

http://alloyui.com/versions/1.0.x/api/

http://alloyui.com/versions/1.5.x/api/

How to navigate to different versions from http://alloyui.com/, 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 = A.one('#openServeyWindow').getAttribute('href');
var jsAtt = sessionId;
A.one('#openServeyWindow').setAttribute('href', hrefDefaultVal+jsAtt);

A.one('#openServeyWindow').setAttribute('onclick', "saveEntry('${count}','${newSessionIdPK}','${recentSessionIdPK}','"+buttonClicked+"' );");

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

closeRmiWindow();
window.location.replace('${lastAccessedPageUrl}'); // to redirect to previous page
},
['node-event-simulate']
);

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