Monday, April 2, 2012
Oracle Fresher Opening
Job Role: Testing Fresher
Job Summary :
Calling BE/BTech freshers for the Testing and Test Automation position
Candiates Should be BE / BTech - 2011 passouts
Candiates Should be BE / BTech - 2011 passouts
Thursday, March 29, 2012
popup in liferay
To implement popup on popup in liferay is quite simple. We need to have 2 pages one parent page on which 1st popup is already opened and 2nd page which will be opened in 2nd popup.
For 1st page call:
functionparentPage(url) {
var popup = Liferay.Popup(
{
stack: true,
draggable:false,
title: 'Parent Page',
position:[110,50],
modal:true,
width:450,
height:365,
url:url
}
);
}
here stack:true property is important which is responsible for pop on popup.url is which page we want to load . It can be portlet url. Other parameters are self explanatory.
In child page you can simply write another popup.
functionchildPage(url) {
var popup = Liferay.Popup(
{
title: 'Child Page',
position:[110,50],
modal:true,
width:450,
height:365,
url:url
}
);
}
Thanks and Hope this help few people.
For 1st page call:
function
var popup = Liferay.Popup(
{
stack: true,
draggable:false,
title: 'Parent Page',
position:[110,50],
modal:true,
width:450,
height:365,
url:url
}
);
}
here stack:true property is important which is responsible for pop on popup.url is which page we want to load . It can be portlet url. Other parameters are self explanatory.
In child page you can simply write another popup.
function
var popup = Liferay.Popup(
{
title: 'Child Page',
position:[110,50],
modal:true,
width:450,
height:365,
url:url
}
);
}
Thanks and Hope this help few people.
popup in liferay
To implement popup on popup in liferay is quite simple. We need to have 2 pages one parent page on which 1st popup is already opened and 2nd page which will be opened in 2nd popup.
For 1st page call:
functionparentPage(url) {
var popup = Liferay.Popup(
{
stack: true,
draggable:false,
title: 'Parent Page',
position:[110,50],
modal:true,
width:450,
height:365,
url:url
}
);
}
here stack:true property is important which is responsible for pop on popup.url is which page we want to load . It can be portlet url. Other parameters are self explanatory.
In child page you can simply write another popup.
functionchildPage(url) {
var popup = Liferay.Popup(
{
title: 'Child Page',
position:[110,50],
modal:true,
width:450,
height:365,
url:url
}
);
}
Thanks and Hope this help few people.
For 1st page call:
function
var popup = Liferay.Popup(
{
stack: true,
draggable:false,
title: 'Parent Page',
position:[110,50],
modal:true,
width:450,
height:365,
url:url
}
);
}
here stack:true property is important which is responsible for pop on popup.url is which page we want to load . It can be portlet url. Other parameters are self explanatory.
In child page you can simply write another popup.
function
var popup = Liferay.Popup(
{
title: 'Child Page',
position:[110,50],
modal:true,
width:450,
height:365,
url:url
}
);
}
Thanks and Hope this help few people.
Hiding portlet in liferay
Simple Approach:
It is very difficult to hide or show portlet at user level. To get rid of these type of problem liferay provide us Roles. So we can create roles and on those roles we can easily assign permission on each portlet.
Creating role in liferay is very simple.
Just login as Admin and using dock navigate to control panel , click on Role from left panel and then click Add...for more details refer portal administration guide from liferay.
Once this is done click on define permission and select portlet permission.
e.g. Suppose you want to remove view permission from portlet A then uncheck view.
When you will login as user with that role then you will get message something like this.
"you don't have required permission to access this portlet"
Finally to make this portlet invisible for that role user who is not having required permission to view the portlet.In portal-ext.properties add this line
layout.show.portlet.access.denied=false
It is very difficult to hide or show portlet at user level. To get rid of these type of problem liferay provide us Roles. So we can create roles and on those roles we can easily assign permission on each portlet.
Creating role in liferay is very simple.
Just login as Admin and using dock navigate to control panel , click on Role from left panel and then click Add...for more details refer portal administration guide from liferay.
Once this is done click on define permission and select portlet permission.
e.g. Suppose you want to remove view permission from portlet A then uncheck view.
When you will login as user with that role then you will get message something like this.
"you don't have required permission to access this portlet"
Finally to make this portlet invisible for that role user who is not having required permission to view the portlet.In portal-ext.properties add this line
layout.show.portlet.access.denied=false
Hiding portlet in liferay
Simple Approach:
It is very difficult to hide or show portlet at user level. To get rid of these type of problem liferay provide us Roles. So we can create roles and on those roles we can easily assign permission on each portlet.
Creating role in liferay is very simple.
Just login as Admin and using dock navigate to control panel , click on Role from left panel and then click Add...for more details refer portal administration guide from liferay.
Once this is done click on define permission and select portlet permission.
e.g. Suppose you want to remove view permission from portlet A then uncheck view.
When you will login as user with that role then you will get message something like this.
"you don't have required permission to access this portlet"
Finally to make this portlet invisible for that role user who is not having required permission to view the portlet.In portal-ext.properties add this line
layout.show.portlet.access.denied=false
It is very difficult to hide or show portlet at user level. To get rid of these type of problem liferay provide us Roles. So we can create roles and on those roles we can easily assign permission on each portlet.
Creating role in liferay is very simple.
Just login as Admin and using dock navigate to control panel , click on Role from left panel and then click Add...for more details refer portal administration guide from liferay.
Once this is done click on define permission and select portlet permission.
e.g. Suppose you want to remove view permission from portlet A then uncheck view.
When you will login as user with that role then you will get message something like this.
"you don't have required permission to access this portlet"
Finally to make this portlet invisible for that role user who is not having required permission to view the portlet.In portal-ext.properties add this line
layout.show.portlet.access.denied=false
Reading tempelates in liferay
Brief Overview:
If we see in existing liferay source code then we can find the email tempelates regarding
create account and forgot password in com/liferay/portlet/admin/dependencies/ and they are read from there.
In 1 case I can tell you from UserLocalServiceImpl and corresponding entry for each tempelate is there in
portal.properties
Enough theory time to do your self:
1.Just create a folder in ext-impl may be u can choose this path
ext-impl\src\com\mytempelate
2.Write a simple tempelate
eg:
Dear [$TO_NAME$],<br /><br />
Hi this is my first tempelate.<br /><br />
Sincerely,<br />
[$FROM_NAME$]
save this as my_first_tmpl.tmpl
3.make an entry in portal-ext.properties
for our example like this :
ext.myfirst.tempelate=ext-impl\src\com\mytempelate\my_first_tmpl.tmpl
This is just a normal key value pair.
4.Now time to read your tempelate
String firstTemeplate = PrefsPropsUtil.getContent(user.getCompanyId(),"ext.myfirst.tempelate");
or
String firstTemeplate = ContentUtil.get("ext-impl\src\com\mytempelate\my_first_tmpl.tmpl");
5. We can easily replace the content :
String firstTemeplate= StringUtil.replace(firstTemeplate, new String[] {"[$TO_NAME$]","[$FROM_NAME$]"
}, new String[] {
"any_name","any_name"
});
CK editor in Liferay 6.0
Follow these 4 simple steps.
Step 1.Add below line on your page
<liferay-ui:input-editor width="80%" />.
Step 2.Create hidden variable to set the value of CK editor like below
<aui:input name="content" type="hidden" />
Step 3.Add javascript init method like this
<aui:script>
function <portlet:namespace />initEditor() {
return "<%= UnicodeFormatter.toString(content) %>";
}
</aui:script>
Step 4:On submiting form we can assign CK editor value like this
function <portlet:namespace />saveEntry() {
var message = window.<portlet:namespace />editor.getHTML();
document.<portlet:namespace />fm.<portlet:namespace />content.value = message;
submitForm(document.<portlet:namespace />fm);
}
Currently we are having problem in liferay 6.0 is that when we refresh CK editor page , it gives JS error.
For that fix is like this get html/js/editor/ckeditor.jsp in function initCkArea() comment line 52 and 53 which starts with CKEDITOR.config.toolbar and CKEDITOR.config.customConfig respectively and add below line
ckEditor.setData(parent.<%= HtmlUtil.escape(initMethod) %>());
In the same file comment line number 131 i.e
initCkArea(); and add
if (parent.AUI) {
parent.AUI().on('domready', initCkArea);
}
In side CKEDITOR.replace method at line number 123 in same file comment line starts with filebrowserBrowseUrl , filebrowserUploadUrl and
add below code
customConfig: '<%= PortalUtil.getPathContext() %>/html/js/editor/ckeditor/ckconfig.jsp?p_l_id=<%= plid %>&p_p_id=<%= HttpUtil.encodeURL(portletId) %>&p_main_path=<%= HttpUtil.encodeURL(mainPath) %>&doAsUserId=<%= HttpUtil.encodeURL(doAsUserId) %>&cssPath=<%= HttpUtil.encodeURL(cssPath) %>&cssClasses=<%= HttpUtil.encodeURL(cssClasses) %>',
filebrowserBrowseUrl: '<%= PortalUtil.getPathContext() %>/html/js/editor/ckeditor/editor/filemanager/browser/liferay/browser.html?Connector=<%= connectorURL %>',
filebrowserUploadUrl: null,
toolbar: '<%= TextFormatter.format(HtmlUtil.escape(toolbarSet), TextFormatter.M) %>'
Finally add required import i.e
<%@ page import="com.liferay.portal.util.PortalUtil" %> and one extra variable
String portletId = ParamUtil.getString(request, "p_p_id");
Step 1.Add below line on your page
<liferay-ui:input-editor width="80%" />.
Step 2.Create hidden variable to set the value of CK editor like below
<aui:input name="content" type="hidden" />
Step 3.Add javascript init method like this
<aui:script>
function <portlet:namespace />initEditor() {
return "<%= UnicodeFormatter.toString(content) %>";
}
</aui:script>
Step 4:On submiting form we can assign CK editor value like this
function <portlet:namespace />saveEntry() {
var message = window.<portlet:namespace />editor.getHTML();
document.<portlet:namespace />fm.<portlet:namespace />content.value = message;
submitForm(document.<portlet:namespace />fm);
}
Currently we are having problem in liferay 6.0 is that when we refresh CK editor page , it gives JS error.
For that fix is like this get html/js/editor/ckeditor.jsp in function initCkArea() comment line 52 and 53 which starts with CKEDITOR.config.toolbar and CKEDITOR.config.customConfig respectively and add below line
ckEditor.setData(parent.<%= HtmlUtil.escape(initMethod) %>());
In the same file comment line number 131 i.e
initCkArea(); and add
if (parent.AUI) {
parent.AUI().on('domready', initCkArea);
}
In side CKEDITOR.replace method at line number 123 in same file comment line starts with filebrowserBrowseUrl , filebrowserUploadUrl and
add below code
customConfig: '<%= PortalUtil.getPathContext() %>/html/js/editor/ckeditor/ckconfig.jsp?p_l_id=<%= plid %>&p_p_id=<%= HttpUtil.encodeURL(portletId) %>&p_main_path=<%= HttpUtil.encodeURL(mainPath) %>&doAsUserId=<%= HttpUtil.encodeURL(doAsUserId) %>&cssPath=<%= HttpUtil.encodeURL(cssPath) %>&cssClasses=<%= HttpUtil.encodeURL(cssClasses) %>',
filebrowserBrowseUrl: '<%= PortalUtil.getPathContext() %>/html/js/editor/ckeditor/editor/filemanager/browser/liferay/browser.html?Connector=<%= connectorURL %>',
filebrowserUploadUrl: null,
toolbar: '<%= TextFormatter.format(HtmlUtil.escape(toolbarSet), TextFormatter.M) %>'
Finally add required import i.e
<%@ page import="com.liferay.portal.util.PortalUtil" %> and one extra variable
String portletId = ParamUtil.getString(request, "p_p_id");
Apply Color Schemes in Liferay Theme
Apply Color Schemes in Our Theme
The technique documented here creates a "color scheme" that has the borders turned off, but preserves the other attributes of the theme, and does so with a single CSS source set (allowing for easier maintenance). It uses a CSS design pattern known as "CSS sub-class selectors." Note that this technique can be used for more than just borders. It can be used when you have several very small variations on a single theme, and you want to keep all of those variations in a single source file.
Step1. import the color scheme css in custom.css and write css for display the color schemes div
@import url(color_schemes/blue.css);
@import url(color_schemes/red.css);
/*------------color Schemes ------------*/
.color_schemes {
position:absolute;
text-align:right;
width:100%;
margin-top:65px;
}
Step2. Then in portal_normal.vm write this code
<div class="color_schemes">
<table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" title="change theme color">
<input type="image" src="$images_folder/color_schemes/red.png" onclick="body.className=value; setCookie('bgColor',value,60);" name="theme" value="red" id="red" width="10px" height="10px">
<input type="image" src="$images_folder/color_schemes/blue.png" onclick="body.className=value; setCookie('bgColor',value,60);" name="theme" value="blue" id="blue" width="10px" height="10px">
</td>
</tr>
</table>
</div>
Step3. Then deploy from your theme
Enable OpenOffice in liferay
To enable document conversion in the Document Library portlet, follow the instructions bellow:
For Windows user
1) Install OpenOffice.org v2.0.3 or higher (has been tested on many versions, include 3.2).
2) Go to the folder where it was installed (for example, C:\Program Files\OpenOffice.org\program) and start OpenOffice service with the following command:
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
For Linux user
1) Goto Openoffice installing path.From command prompt type this line
"cd /usr/lib/openoffice/program"
2) Same command prompt copy & paste this code
"sudo soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless –nofirststartwizard"
In latest linux we need run this commend with user name ubuntu 10.4 + use this code it will ask password give your root user password..
"sudo -H -u root /usr/lib/openoffice/program/ soffice "-accept=socket,host= localhost,port=8100;urp; StarOffice.ServiceManager" -nologo -headless -nofirststartwizard"
For Mac user
1) If you are running on Mac OS X, then you should run the following from the Terminal program (note that this is assuming you are running Open Office and it is installed in your /Applications directory.
/Applications/OpenOffice.org.app/Contents/MacOS/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless
In liferay GUI
2) Go to control panel then click on the Server Administration tab, then OpenOffice tab. Click on enable, in case OpenOffice is listening to a different port change the it accordingly.
You should see this when you View a document in Document Library, click on the desired conversion.
2) Web content Display
You should see this when you click configuration select which are the format guest could download. Then click save button show the option to guest.
For Windows user
1) Install OpenOffice.org v2.0.3 or higher (has been tested on many versions, include 3.2).
2) Go to the folder where it was installed (for example, C:\Program Files\OpenOffice.org\program) and start OpenOffice service with the following command:
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
For Linux user
1) Goto Openoffice installing path.From command prompt type this line
"cd /usr/lib/openoffice/program"
2) Same command prompt copy & paste this code
"sudo soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless –nofirststartwizard"
In latest linux we need run this commend with user name ubuntu 10.4 + use this code it will ask password give your root user password..
"sudo -H -u root /usr/lib/openoffice/program/
For Mac user
1) If you are running on Mac OS X, then you should run the following from the Terminal program (note that this is assuming you are running Open Office and it is installed in your /Applications directory.
/Applications/OpenOffice.org.app/Contents/MacOS/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless
In liferay GUI
2) Go to control panel then click on the Server Administration tab, then OpenOffice tab. Click on enable, in case OpenOffice is listening to a different port change the it accordingly.
Places where this integration is used.
1) Document Library portletYou should see this when you View a document in Document Library, click on the desired conversion.
2) Web content Display
You should see this when you click configuration select which are the format guest could download. Then click save button show the option to guest.










