On February 29, 2012, Liferay announces the End of Version
for Liferay 5.2 EE. The last date to order Liferay 5.2 EE (Last Ship
Date) is May 31, 2012.
For more details see the original post
For more details see the original post
This blog is about my observations and thoughts related to software development. These observations include tips and tricks that I have learned, solutions to problems I have faced, and other concepts I have found interesting and useful. This blog is intended to provide information to help other developers facing the same issues as well as providing me a method to document things in a well-known location for my future reference.
<a id="" class="feedback_popup"> Submit Feedback</a>
jQuery(document).ready(The idea behing javascript is to bind the click event of all anchor elements on page having class "feedback_popup" to open a modal popup. Make sure that you should bind the event based on class name and not on element id as a page can have multiple such elements.
function() {
th_FeedbackPopup()
}
);
function th_FeedbackPopup() {
jQuery(document).find("a.feedback_popup").click(function() {
var url = new Liferay.PortletURL.createRenderURL();
url.setPortletId("FEEDBACK_1");
url.setWindowState("exclusive");
url.setPortletMode("view");
url.setParameter("struts_action", "/ext/feedvack/view");
var popup = Liferay.Popup({
draggable:false,
width:500,
height:'auto',
url:url.toString(),
resizable:false,
modal:true,
title:'Submit Feedback',
position:[250,20]
});
});
}
// Preferred idiom for iterating over a collectionA final technique to minimize the scope of local variables is to keep methods small and focused. If you combine two activities in the same method, local variables relevant to one activity may be in the scope of the code performing the other activity. To prevent this from happening, simply separate the method into two: one for each activity.
for (Element e : c) {
doSomething(e);}
Here is another loop idiom that minimizes the scope of local variables:
for (int i = 0, n = expensiveComputation(); i < n; i++)
{
doSomething(i);}
public String statement() {This method performs abysmally if the number of items is large. To achieve acceptable performance, use a StringBuilder in place of a String to store the statement under construction. The StringBuilder class, added in release 1.5, is an unsynchronized replacement for StringBuffer, which is now obsolete. The difference in performance is dramatic.
String result = "";}
for (int i = 0; i < numItems(); i++)
result += lineForItem(i);// String concatenation return result;
WRONG
public void bar() {RIGHT
try {}
//doSomething()}
catch (JMSException e) {
System.out.println("exception occurred"); e.printStackTrace();}
finally {
System.out.println("cleaning up");}
public void bar() {
try {}
// ...}
catch (JMSException e) {
logger.log(Level.WARNING, "JMS Problem", e);} finally {
logger.info("cleaning-up");}
Wrap complex logging expressions into conditions
if (logger.isDebugEnabled()) {
logger.debug("Message: " + object.calculateSomething() + ", count=" + cnt);
}
public static DefaultHttpClient getThreadSafeClient() {
DefaultHttpClient httpClient = new DefaultHttpClient();ClientConnectionManager mgr = httpClient.getConnectionManager();HttpParams params = httpClient .getParams();httpClient = new DefaultHttpClient(new ThreadSafeClientConnManager(params,mgr.getSchemeRegistry()), params);return httpClient ;}