My Linux Stuff - Complete Blog For Linux Articles

My Linux Stuff - Complete Blog For Linux Articles

A Website For Complete Linux OS,Step by Step linux Installtion, Linux Tips and Tricks and Linux Stuff and so on... Connect and sharing here....

TOP 50 ENGINEERING COLLEGES IN INDIA 2014

TOP 50 ENGINEERING COLLEGES IN INDIA 2014

This below survey was taken many form many colleges in India. These Top 50 Engineering Colleges in India have Good Infrastructure, Good Environment, Educations , Staff, Placement , Research Activities and other Facilities are good.

Top 10 Government Engineering Colleges in India

Top 10 Government Engineering Colleges in India

These Government Engineering Colleges in India are really good for all kind of stuff like Education , research , Placement and New Innovation Ideas etc... But Getting seat in these colleges are heavy competition in students .....

Top 10 Colleges In India 2014

Top 10 Colleges In India 2014

Indian Institute Of Technology Delhi,Indian Institute Of Technology Bombay,Indian Institute Of Technology Kanpur,Indian Institute Of Technology Madras,Indian Institute Of Technology Kharagpur,Indian Institute Of Technology Roorkee,University Of Delhi,Indian Institute Of Technology Guwahati,University Of Calcutta,University Of Mumbai, National Institute Of Technology,Trichy.

2014 LATEST SURVEY TOP RANKING ENGINEERING COLLEGES IN INDIA

2014 LATEST SURVEY TOP RANKING ENGINEERING COLLEGES IN INDIA

This below survey was taken many form many colleges in India. These Top 100 Engineering Colleges in India have Good Infrastructure, Good Environment, Educations , Staff, Placement , Research Activities and other Facilities are good. If you want to do Engineering as your dream and try out these colleges

Subscribe Now!

Enter your email address:

Thursday, March 29, 2012

Bangalore student is YouTube Space Lab Asia-Pacific winner


Washington: India's Sachin S. Kukke is the Asia-Pacific region winner and one of the six global winners of the YouTube Space Lab 2012 contest for young people to design experiments that could be performed in outer space.
The winners of the YouTube Space Lab 2012 contest by YouTube and Lenovo, in cooperation with Space Adventures, NASA, ESA (European Space Agency), and JAXA (Japan Aerospace Exploration Agency) were announced at a ceremony at the Newseum here Friday.
Kukke's experiment explores transfer of heat in ferrofluid - a special liquid that gets magnetized when subjected to a magnetic field. The study can benefit development of advanced cooling and heat transfer systems.A student of mechanical engineering at the BMS College for Engineering in Bangalore, Kukke called on Indian Ambassador to the US Nirupama Rao Friday and shared his experience of conceptualising and carrying out innovative scientific experiments, an Indian Embassy release said.
Warmly congratulating Kukke on his achievement, Rao said that in India, a country engaged in rapid economic development, "students like Sachin symbolise the hopes and the potential of a dynamic, resurgent India and it's young population".She encouraged Kukke to pursue his goals and interests in the specialised area of aerospace engineering and wished him the very best for the years ahead.
At the meeting, Kukke was accompanied by Lee Hunter, head of brand marketing for YouTube, and Claudio Lilienfeld, senior policy manager for Asia Pacific at Google.
Nearly 40 percent of the total number of entries for the contest came from India alone, an indicator of the skills and level of interest in the field of exploration of outer space among the youth in India.
Source: IANS

Image Source: Reuters
Full coverage:NASA

Details CSS in liferay Theme




By default, CSS styles in liferay can be found in folder /css. Bundle liferay with Classic theme means that css folder path: ~/tomcat-6.0.18/webapps/ROOT/html/themes/classic.

There are few css styles file. Main css (main.css) located all styling files from the lowest to highest (in term of priority) from top to bottom.

Let say, I want to add a new css file (e.g mystyle.css). I must import this file in main.css – add this new line @import url(mystyle.css); - the styles in this new file will overwrite all styles in other files above it. For a standard practice, custom.css has the highest priority.

Sometimes, new developer understood this thing but when doing some customization in custom.css nothing changes. Why? It is because the server not refers to that changes. When developer inspected the element using firebugs, the css style reference maybe main.css or base.css only. How to overcome this problem?

For development purpose only, developer must add new properties in portal-ext.properties (/webapps/ROOT/WEB-INF/classes). The properties are shows as the following.

## FOR DEVELOPMENT PURPOSE, NEED TO REMOVE
##AT PRODUCTIONS ##

## Set this property to true to load the theme's merged CSS files
##for faster loading for production.
## Set this property to false for easier debugging for development.
##You can also disable fast loading by setting the
## URL parameter "css_fast_load" to "0".

theme.css.fast.load=false

## Set this to flase to disable the display of CSS logging.

theme.images.fast.load=false

## Set this property to true to load the packed version of
##files listed in the properties "javascript.barebone.files" or

## "javascript.everything.files".

## Set this property to false for easier debugging for development.
##You can also disable fast loading by setting the
## URL parameter "js_fast_load" to "0".

javascript.fast.load=false

## Set this to true to enable the display of JavaScript logging.

javascript.log.enabled=true

## Setting it to false is useful during development if you need
##to make a lot of changes.

layout.template.cache.enabled=false

## Disable Liferay from opening a new browser window
##everytime start the server

browser.launcher.url=
##

## Last Modified

## Set this to true to check last modified date on server side CSS and

## JavaScript. On Development purpose just set it false

last.modified.check=false

## Enabling OpenOffice integration allows the
##Document Library portlet and the Wiki
##portlet to provide conversion functionality. This is tested with
## OpenOffice 2.3.x and 2.4. To start OpenOffice as a service,
##run the command:
openoffice.cache.enabled=false

## Set the Velocity resource managers. We extend the
##Velocity's default resource managers for better scalability.

velocity.engine.resource.manager.cache.enabled=false

## The cache filter will cache content. See ehcache.xml to modify the cache

## expiration time to live.

com.liferay.portal.servlet.filters.cache.CacheFilter=false

## The theme preview filter generates a preview of the currently applied

## theme that can be used by the Dreamweaver Theming plugin.
##This is disabled by default.
##Set the "themePreview" parameter to "1" in the URL to access

## the theme preview for any page. For example, a URL can be

## http://localhost:8080/web/guest?themePreview=1.

com.liferay.portal.servlet.filters.theme.ThemePreviewFilter=true

Liferay Interview Questions


1) What are the various ways in which you can customize the default behavior of Liferay that ships to you?
2) What is the difference between a Liferay Hook and Liferay EXT?
3) Suppose I want to customize the behavior of Calendar portal that comes out of the box with Liferay, how can I do that?

4) How will you configure Liferay to authenticate users from LDAP?
5) What is inter portlet communication and how can that be achieved?
6) What is the difference between view and edit modes of a portlet?
7) What is service.xml and how will you use Liferay service builder?
8 ) Suppose I have a portlet written for Liferay 5.2.3 and I want to run it on Liferay 6, how can I do that? What if I get some spring and hibernate related exceptions with Liferay 6?
9) There is a requirement from the client that out of 4 portlets that you have written only 2 should be visible to a particular category of users. How will you achieve that? What if some fields in the remaining 2 portlets have also to be controlled based on user role?
10) What is the purpose of portal-ext.properties?
11) What steps will you follow to change the layout and theme of the portal pages?
12) Suppose I want to change the background color of the footer in Liferay, what steps should I follow?
13) Which JSR is being implemented by Liferay?
14) What improvements would you like to see in Liferay 6 portal?
15) There are 1000 users using the portlet developed by you, how will you take care of transaction management.
16) A client has two different portal applications for Sales and HR department. The client wants to run these portal applications on same server but with separate URL’s like http://<ip>:<port>/sales and http://<ip>:<port>/hr. How will you achieve that?
17) What are the minimum Java methods one needs to override in order to write a portlet?
18) How will you make the user to go from one JSP to another JSP page in a portlet?
19) While building a service using service builder, what is the purpose of specifying remoteservice=true in service.xml?
20) How to control the category in which the liferay portlet created by me will be displayed?
21) What is hot deployment feature of Liferay? Where will you place your portlets for them to be deployed without server restart?
22) Does Liferay support email notifications out of the box for portlets involving workflow?
23) What is the purpose of mode and persistence packages which are created by the Liferay service builder?
24) If there are 3 portlets and all of them need to talk to different database systems (say MysSQL, Oracle and SQL Server) because of some legacy appliation requirements. How will you make them connect to different databases?
25) Can you configure the database connection pool created by Liferay?
26) Can you list down various tools and frameworks used by Liferay? e.g. It uses Lucene for search
27) Suppose a client is pursuing a Liferay based solution to their requirements, what non-functional clarifications will you ask from the customer?
28) Is there a build number associated to a portlet assigned by the service builder? Where can we find the current build number?
29) Have you tried the Liferay 6 Eclipse plugin? What all limitations have you found?
30) How do you log events in a portlet? Do I need to configure Log4J for every portlet or is there a common place where one can configure Log4J so that all Liferay portlets can use logging API?
31) Do you know how to update your setup of Liferay 5.2.3 to Liferay 6?
32) Can I run my Struts 1.3 based legacy application as a portlet application? How?
33) Is it a good design to meet the customer requirements by creating a single portlet or splitting them into multiple portlets? What criteria will you use to split the functionality into multiple portlets?
34) What advantages do you see in running the Liferay portal application on a application server like JBoss than running it on a web server like Tomcat?

35) What all other portals have you heard of? How do you compare them to Liferay?
36) How will you implement i18 in a portal application? What if you want the user to choose his language preference?
37) There is a portlet application for managing images similar to Flickr. The user wants to see the images in full screen. Will Liferay allow you to do that?
38) I have a war file of the portlet which is created using service builder, what is the difference between pasting this war file in the deploy folder of Liferay and application folder of server (like webapps in case of Tomcat)?
39) How will you setup a clustered Liferay portal on 5 servers available to you?
40) How much user base can Liferay support without affecting performance?
41) There is a JRE shipped with Liferay package, do we not need a JDK and what is the purpose of bundled JRE?
42) Suppose there is a requirement from client to implement search functionality in Liferay portlet, does Liferay provides any API out of the box to support search?
43) What are the various ways in which one can override the default behaviour of Liferay?
44) The service builder can also build WSDL for you. What is the benefit of this feature provided by Liferay?
45) How will you build a portlet that can be added only single or multiple times in to the portal application?
46) Is it possible to set a session time out for a portlet which is different from other portlets and the Liferay portal?
47) What is the flow of HTTP request in Liferay?
48) The JSPPortlet.java extends  the MVCPortlet.java class. What purpose does MVCPortlet.java fulfill?
49) How do you perform Junit tests on your portlet? How do tackle the dependency on the MVCPortlet.java?
50) Is it mandatory to have the view logic in view.jsp? Can one configure some other JSP (say MyJSP.jsp) to be default view page than view.jsp?

What is Liferay




Liferay is an upcoming and  very famous open source solution for building portal based applications. If you are not familiar with what a portal then please visit iGoogle to see how a portal looks like. A portal is something which acts as container for various other smaller applications running as portlets within the portal container.
Coming to more details, Liferay offers various features to the application developer in order to meet the functionalities of the client in an easier way. For example, there is out of the box support for Chat, Message Boards, Calendar,Blog,Wiki, Document Management in Liferay. These features only a subset of all the features provided by Liferay.
In addition to these out of the box features provided by Liferay, these features can be customized to the extreme extent because of the open source nature of Liferay. The customization is made easy by providing hooks. Also, one can completely customize the look and feel of Liferay portal.
As Liferay doesn’t use EJB or JMS, it can be deployed an a servlet engine like Tomcat. The best part is that Liferay uses the latest technologies and tools to build the features. Some of the Java technologies used by Liferay include jQuery, VAADIN, Spring, Hibernate, Solr, Velocity, FreeMarker etc. This ensures best technologies are available to one when using Liferay.
Liferay also has a tool named Service Builder which helps in generating the helper code for interacting with databases. The databases supported by Liferay include HSQL,MySQL,MS SQL Server,Oracle,DB2 etc.
There are two versions of Liferay available. One is community edition which is free and the other is enterprise edition which has paid support. Since Liferay has strong user base, getting around the popular blockers is not that difficult. Enterprise edition should be used when professional consulting is required.

How Create Build and Deploy Liferay Portlets


A Liferay portlet is nothing but a web application consisting of Java classes, JSP, images, Javascript files. Here we will discuss the ways in which a Liferay portlet can be created.
There is an ANT script file which comes with the Liferay plugin SDK. This ANT script has various tasks for creating, building and deploying the portlet to Liferay server. All these ANT tasks can either be run using command line or by using Liferay 6 plugin for Eclipse. This Eclipse plugin also runs these ANT tasks behind the same. So its basically the ANT tasks that we want to run.


Creating Portlet:
The ANT command “create”, creates an empty portlet which is a web application having deployment descriptor web.xml inside the WEB-INF folder. There is also one JSP file named view.jsp being created which is the default first view of the portlet. In Liferay 6 plugin for Eclipse, we need to create a new Liferay Plugin project which also results in the creation of above described web application structure.
Meeting Functional Requirements:
To meet the functional requirements, one can write the view code in JSP. The database interaction code (business logic) can be written inside Java classes. This Java code can be either invoked using JSP scriptlets or JSP taglibs depending upon the size and requirements of the portlets. The DAO and DTO can be generated by using the service builder. The service builder reads service.xml and generates the Java classes for database CRUD operations.
The ANT task names “build-service” is responsible for generating the DAO and DTO code. With Liferay 6 plugin for Eclipse, there is a build service button displayed when service.xml is opened.
The service builder creates a JAR file of the generated code and places the same on CLASSPATH (inside lib folder of the portlet). After generating the DAO and DTO code, one can use them to write the business logic which includes the code required for interaction with database.
One more point worth mentioning is that the service builder only generates Java code and does not create the database tables corresponding to the entities mentioned in the service.xml. The database tables are created by the Liferay server after service builder has been run and portlet has been deployed. This means that the service builder creates entry somewhere inside the Liferay server so that the database tables can be created.
Deploying the Portlet:

The portlet is created and built inside the plugin SDK of Liferay. After writing the view code and business logic, it has to be deployed on to the Liferay server. The deployment is in the form of packaged WAR file. There is again one ANT task named “deploy” which compiles all the Java code and generates the WAR file which is then copied to Liferay server’s deployment folder (the folder named “deploy” present outside Tomcat, JBOSS etc.). The deploy ANT task can also be invoked from Liferay 6 plugin for Eclipse using the “Run on Server” feature of Eclipse.
Liferay server comes with Hot deployment feature which means that once the ANT task for deployment has run, the server detects the change and automatically loads the Liferay portlet application so as to make it available for use.
In this process of deploying the portlet, any required database changes are made by the Liferay server.

Liferay Hello World Example


  1. Download Liferay binary here. I downloaded the Tomcat bundle for ease of configuration. YMMV with other bundles.
  2. Follow the quick installation here. I didn’t have any issue starting Tomcat with Liferay. It brings up the default portal page automatically. Do not close this page. We will revisit this page in a later step.
  3. Download SDK from here. Look for a download link that starts with “Liferay Plugins SDK”.
  4. If you don’t have Ant setup in your environment, follow the instructions in page 6 of the development documentation here. My environment is already setup with ant, so I just skipped this step.
  5. Customize your own build.${username}.properties. I made copy of ${sdk_directory}/build.properties and created my own file in the same directory using thebuild.${username}.properties convention documented in page 7 of the development guide. Within this file, I updatedapp.server.dir property with the path to Tomcat’s directory in my local environment. The document has a typo about the other property:java.compiler. Reading the build.property file suggested to me that the property name should be javac.compiler. Since I only wanted the default configuration, which is modern, I didn’t change this second property.
  6. Create a portlet using ant: I followed the instruction on page 8 in the development guide. It is very straight forward. Make sure you run the create command in the portlets directory in the sdk directory.
    cd ${sdk_directory}/portlets
    ant -Dportlet.name=hello -Dportlet.display.name="hello world title" create
  7. After created the portlet, you should see a new directory that looks likehello-portlet. You can go into that directory and make changes to your liking. Since my goal was just to get a simple portlet running, I just added “Hello World” to hello-portlet/docroot/view.jspfile.
  8. Deploy the portlet: Within the hello-portlet, I ran the following command to deploy the portlet:
    ant deploy
  9. After I deployed the portlet, I did a quick check in the log file (catelina.out) to see if the portlet is available. I did notice that the message is slightly different from what development guide stated.
  10. Add the portlet to the portal page: I returned to the default portal page on my browser. On the default portal page, there is a menu that has the label “welcome” on the to right corner. Liferay documentation called this “Dock”. If you mouse over this, you will see login option. To login, enter “bruno@7cogs.com” for email address and “bruno” for password. This information comes from the quick installation guide. All other documentation that I read all refers to “test@liferay.com” and “test”, which are wrong for the release that I downloaded. Once log-in, You can mouse over to the Dock and choose “Add Application”. Enter the name of your portlet in the search textfield, the list should automatically updated. If you can identify your portlet, click the “Add” link next to it. You should see the portlet showing on the portal page.
That should get your development setup for further portlet development. Have fun coding!

Is Liferay Portal still open source


Liferay Portal Community Edition (CE) is offered at no cost under the business-friendly Lesser GNU Public License (LGPL) v2.1 for use by early adopters and developers in non-critical environments. Liferay Portal CE is community supported and includes the latest in features.
Liferay Portal Enterprise Edition (EE) offers a more hardened, stable version of Liferay Portal CE that guarantees ongoing long-term support with a combined subscription and support package. This caters to organizations seeking to build on top of and maintain one stable version of the product over an extended period of time.
Liferay Portal EE release cycle will be less frequent than the CE. However, each enterprise version will be supported for a number of years with bug fixes backported to your version for the life of your subscription. Please see the EOSL Policy page for a detailed description.
Liferay's professional services team offers training and consulting on the Enterprise Edition to ensure long-term support and stability for our clients.

Liferay Portal CE is available under the Lesser GNU Public License (LGPL) v2.1 at absolutely no cost and no risk.
Liferay Portal EE is made available under a commercial open source license, users benefit from the same high quality features and innovation that results from our nine years of valuable user feedback from the community.

Is Liferay Portal still open source


Liferay Portal Community Edition (CE) is offered at no cost under the business-friendly Lesser GNU Public License (LGPL) v2.1 for use by early adopters and developers in non-critical environments. Liferay Portal CE is community supported and includes the latest in features.
Liferay Portal Enterprise Edition (EE) offers a more hardened, stable version of Liferay Portal CE that guarantees ongoing long-term support with a combined subscription and support package. This caters to organizations seeking to build on top of and maintain one stable version of the product over an extended period of time.
Liferay Portal EE release cycle will be less frequent than the CE. However, each enterprise version will be supported for a number of years with bug fixes backported to your version for the life of your subscription. Please see the EOSL Policy page for a detailed description.
Liferay's professional services team offers training and consulting on the Enterprise Edition to ensure long-term support and stability for our clients.

Liferay Portal CE is available under the Lesser GNU Public License (LGPL) v2.1 at absolutely no cost and no risk.
Liferay Portal EE is made available under a commercial open source license, users benefit from the same high quality features and innovation that results from our nine years of valuable user feedback from the community.

What is Liferay Portal


Portals can serve an enterprise in a variety of ways. Read about key use cases and then learn more about Liferay Portal's robust portal, content, and collaboration features.


Google Translator in a Liferay portal


People always prefer their native language for their convence. To browse a website with a feature of tranlsation is what most of them would like. Liferay provides a feature where in we can have our portal in different languages. This is achieved using  Language-ext.properties file.

But there are few drawbacks in using the above.
The  drawbacks are :
1.This requires a customisation in all the Language_xx.properties file. (For eg. If we want 30 languages option then 30 Language_xx.properties files need to be customised).

2.Even after doing so the entire portal is not changed to the language selected,only the variables mentioned in the  Language_xx.properties file are changed and anything from database is not changed.

So here is the convenient solution of having your portal in different languages by integrating the Google's API in two simple steps

Step1:

Copy and paste the below snippet code in the "portal_normal.vm" file


<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.
translate.TranslateElement({
pageLanguage: 'en',
layout: google.
translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script>
<script src="//
translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

Step 2:
We can further change the position of the translate tab. To change the display mode in Horizontal, change the layout to
  layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
For Bottom-right Position:    floatPosition: google.translate.TranslateElement.FloatPosition.BOTTOM_RIGHT
For Bottom-left Position:    floatPosition: google.translate.TranslateElement.FloatPosition.BOTTOM_LEFT

and so on..

To use the the Google's translator only in the selected sections of a website, we can use the below code
<script>
          function googleSectionalElementInit() {
new google.translate.SectionalElement({
sectionalNodeClassName: 'goog-trans-section',
controlNodeClassName: 'goog-trans-control',
background: '#99ff99'
}, 'google_sectional_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=auto"></script>

Add an element with a class name “goog-trans-section”  and a child element with class name “goog-trans-control”. On clicking the parent element, the contents within the child element will be translated.

Note: We can further customise the look and feel of the Google translator toolbar by strictly maintaining the Google trademark and logos.

The following are the merits and demerits of Liferay's translation and other translation APIs (eg. Google Translator)

Liferay's Translation
 Merits  1.Its looks professional
 2.Performance will not be affected.
 3.Translation of the content will be controlled by ourselves.

Demerits
 1.It will not translate Dynamic contents
 2.Static contents need to be mentioned in properties files manually
 3.The number of properties file increases as a number of language increases
 4.For CMS (i.e Web content and page navigations) we need to create articles in the                 respective languages seperately


Google and others Translation tools :
 Merits  1.No need of any properties file changes
 2.Dynamic content as well as static content will be translated in the respective languages
 3.For Web content and page navigations need not create articles in different languages
 4.Imlementation is easy. 
De Merits
  1.Performance issue.
 2.The translation control is handled by third party
 3.We need to adhere to the terms & condition of the third party
 4.We don't have control over any issues that are caused by the third party applications .

Related Posts Plugin for WordPress, Blogger...