tag:blogger.com,1999:blog-91669014679957264312024-03-19T00:24:21.162-07:00Liferay is easyThis blog is specially create for learning step by step liferay.We can learn liferay,hooks,ext,portlet,layout ,services and themes with eclipse ide.Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.comBlogger139125tag:blogger.com,1999:blog-9166901467995726431.post-62381793287525763332022-06-15T02:14:00.002-07:002022-06-15T02:14:10.315-07:00Dynamic SessionErrors in Liferay 7.3<p> <span style="font-size: xx-large;"> </span></p><p><span style="font-size: large;">Today we will see how we can send error message from our controller. Here we set the error message in controller which is dynamic and view this on jsp with single tag.</span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: x-large;"><u><b>Step 1:- Create MVC Portlet </b></u></span></p><p><span style="font-size: large;">Just Create a simple MVC Portlet and paste this content in the controller.</span></p><p><span style="font-size: large;"><b><u>DynamicSessionErrorPortlet.java</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/ff9b341805bbb7d902cea047b8df7429.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: x-large;"><u><b>Step 2:- Change your view.jsp</b></u></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;">Now open your view.jsp and paste this:-</span></p><p><span style="font-size: large;"><b><u>view.jsp</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/ca07c8320f90f470834f6cd8f8bf0c8c.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: x-large;"><u><b>Step 3:- Provide entry in Language.properties</b></u></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;">Now open Language.properties file and add the entry </span></p><p><span style="font-size: large;">dynamic.error.msg={0}</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: x-large;"><u><b>Step 4:- Deploy and Check Output</b></u></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;">Now deploy your portlet and add to page.</span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh02AJHTPwtlW5shlK_vV9o-Zxg4tAOFM8CswaPAWsSOnfmLQQ_K5SM25a0Mr9BqMJpHNbq7T2XHTmgB1JatQGwN6Zvq5M7cK6Qrq36iPLku_U3m6vHfVjkN9DEh4QQ_1WihL7_0rBrtc4qZNO5y8mQGcrXWwagqx1nj0OIPft7Fpy7uzW5qJspxKsA5w/s1239/arithmatic.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="246" data-original-width="1239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh02AJHTPwtlW5shlK_vV9o-Zxg4tAOFM8CswaPAWsSOnfmLQQ_K5SM25a0Mr9BqMJpHNbq7T2XHTmgB1JatQGwN6Zvq5M7cK6Qrq36iPLku_U3m6vHfVjkN9DEh4QQ_1WihL7_0rBrtc4qZNO5y8mQGcrXWwagqx1nj0OIPft7Fpy7uzW5qJspxKsA5w/s16000/arithmatic.JPG" /></a></div><br /><span style="font-size: large;">Now comment Line 40 and uncomment line 41 and redeploy</span><p></p><p><span style="font-size: large;"><br /></span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilTFq52veppjydrK9X_0TRsQXFZCRqViZdUWSMPuINuuEv9vwo1hERLCK74726BjrfiHzCgHTdUWv2L3IGX53Sb36PG0Ycku1okylQa5VoQg5YunMaIsgTPVBIVR4PhxXU69zKGvaXa29BXHR7HKsaNHbdarrFXP8eQcGB6Xf8zMZRzLne8RDAm_0iyQ/s1272/null.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="241" data-original-width="1272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilTFq52veppjydrK9X_0TRsQXFZCRqViZdUWSMPuINuuEv9vwo1hERLCK74726BjrfiHzCgHTdUWv2L3IGX53Sb36PG0Ycku1okylQa5VoQg5YunMaIsgTPVBIVR4PhxXU69zKGvaXa29BXHR7HKsaNHbdarrFXP8eQcGB6Xf8zMZRzLne8RDAm_0iyQ/s16000/null.JPG" /></a></div><p style="font-size: x-large;"><span style="font-size: x-large;"><br /></span></p><span style="font-size: large;">You can download source from <a href="https://sourceforge.net/projects/liferayiseasy7-3/files/Dynamic%20SessionErrors/dynamic-session-error.rar/download" target="_blank">here</a>.</span><br /><span style="font-size: large;"><br /></span><p></p><p><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></p><div style="font-family: "times new roman"; font-size: x-large; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><i><br /></i></div><p style="font-size: x-large;"><span style="font-size: large;"></span></p><p><span style="font-size: large;"></span></p><div style="font-family: "times new roman"; font-size: x-large; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/jax-rs-web-services-with-spring-in.html" target="_blank">JAX-RS Web Services with Spring in Liferay 7 (DXP)</a></span></i></div><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/read-excel-file-xlsx-using-apache-poi.html" target="_blank">Read Excel file using Apache POI in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/how-to-enable-jquery-in-liferay-dxp-73.html" target="_blank">Enable jQuery in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/access-document-and-media-files-in.html" target="_blank">Access files of Document and Media Portlet</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><a href="https://liferayiseasy.blogspot.com/2022/06/imageselector-in-custom-portlet.html" target="_blank"><i><span style="font-size: x-large;">Image Selector in Liferay 7.x</span></i></a><br /></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><a href="https://liferayiseasy.blogspot.com/2022/06/create-custom-fields-programmatically.html" target="_blank"><i><span style="font-size: x-large;">Custom fields Programatically in Liferay 7.3 </span></i></a></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/create-application-start-up-event-in.html" target="_blank"><i>Application Start up Events in Liferay DXP 7.3</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/spring-resttemplate-client-in-liferay.html" target="_blank"><i>Spring RestTemplate in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div><p><span style="font-size: large;"><br /></span></p>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-13107280447599377272022-06-14T20:55:00.001-07:002022-06-14T20:55:28.223-07:00Spring RestTemplate Client in Liferay DXP (7.3)<p> <span style="font-size: xx-large;"> </span></p><p><span style="font-size: large;">Today we will see how we can call Rest API in Liferay by using Spring RestTemplate. We just need to add dependencies related to Spring and accordingly write our client.</span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: x-large;"><u><b>Step 1:- Add Dependencies </b></u></span></p><p><span style="font-size: large;">Just open your build.gradle file and add two dependencies related to gradle.</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>build.gradle</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/c7f09a72456fc89a296bf610d5c0c425.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: x-large;"><u><b>Step 2:- Use RestTemplte to write the client </b></u></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;">In your java class you can use RestTemplate Class to call various APIs . Here i am using one open source rest api that will give us country details.</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>CountryImpl.java</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/8695a235bc95c03a813739e8d29a2779.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"> </span><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></p><div style="font-family: "times new roman"; font-size: x-large; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><i><br /></i></div><p style="font-size: x-large;"><span style="font-size: large;"></span></p><div style="font-family: "times new roman"; font-size: x-large; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/jax-rs-web-services-with-spring-in.html" target="_blank">JAX-RS Web Services with Spring in Liferay 7 (DXP)</a></span></i></div><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/read-excel-file-xlsx-using-apache-poi.html" target="_blank">Read Excel file using Apache POI in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/how-to-enable-jquery-in-liferay-dxp-73.html" target="_blank">Enable jQuery in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/access-document-and-media-files-in.html" target="_blank">Access files of Document and Media Portlet</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><a href="https://liferayiseasy.blogspot.com/2022/06/imageselector-in-custom-portlet.html" target="_blank"><i><span style="font-size: x-large;">Image Selector in Liferay 7.x</span></i></a><br /></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><a href="https://liferayiseasy.blogspot.com/2022/06/create-custom-fields-programmatically.html" target="_blank"><i><span style="font-size: x-large;">Custom fields Programatically in Liferay 7.3 </span></i></a></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/create-application-start-up-event-in.html" target="_blank"><i>Application Start up Events in Liferay DXP 7.3</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-53903112441583137622022-06-14T00:07:00.000-07:002022-06-14T00:07:08.160-07:00Create Application Start up Event in Liferay DXP (7.3)<p> <span style="font-size: xx-large;"> </span></p><p><span style="font-size: large;">Today we will see how we can create application start up events in Liferay 7.3 . By using this we can create our configuration on start up of your module. So we don't need to create Custom Fields, Structure, templates etc using Control Panel. As soon as module is deployed code will run automatically. </span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: x-large;"><u><b>Step 1:- Create a simple Liferay Module</b></u></span></p><p><span style="font-size: large;">Create a simple Liferay module Project and select api from Project Template Name. Provide the package name and class name and click finish. Now delete the old package as it is appended by api and create new package and also provide the new package entries in bnd file. Now create a Class that implement BundleActivator</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>StartUp.java</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/c700c4fe2376d3d5bb93b760f492d72d.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>Explanation</u></b></span></p><p><span style="font-size: large;">Here in Line number 9 we provide key=application.startup.event.</span></p><p><span style="font-size: large;">Also we implement two methods start which run when we deploy the module and stop which run when we un deploy or stop our module</span></p><p><span style="font-size: large;"><br /></span></p><div><span style="font-size: large;"><p style="font-size: medium;"><span style="font-size: x-large;"><u><b>Step 2:- Provide entry in bnd file</b></u></span></p><p style="font-size: medium;"><span style="font-size: large;">Provide entry of your class in bnd </span></p><p><span style="font-size: large;"><b>Bundle-Activator: com.liferay.start.up.StartUp</b></span></p><p><span style="font-size: large;">So now my bnd file become</span></p><p><span style="font-size: large;"><b><u>bnd.bnd</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/7e4c02fb557ed6a310531c2f4187c3c7.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p style="font-size: medium;"><span style="font-size: x-large;"><u><b>Step 3:- Check output</b></u></span></p><p style="font-size: medium;"><span style="font-size: large;">Now deploy your module as soon as you deploy the module you will see message on your tomcat console</span></p><p style="font-size: medium;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBf6pIU5Hc47wgpYk-77gdlQwSeAuxiv7u_CPDPogGhwVBOXg7D1nLJ7oOnF277Im5NbM2SAB66Zp5jEohirt0zeZfsQ8LQb8FplSBrPJ62duE496nUpo1e7kMqKtvCagMganzjMnyrcs5T5L-5TYSh61TBatvZju23gPpjETV_IE1egLVe7VGjD0NXg/s679/output.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="199" data-original-width="679" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBf6pIU5Hc47wgpYk-77gdlQwSeAuxiv7u_CPDPogGhwVBOXg7D1nLJ7oOnF277Im5NbM2SAB66Zp5jEohirt0zeZfsQ8LQb8FplSBrPJ62duE496nUpo1e7kMqKtvCagMganzjMnyrcs5T5L-5TYSh61TBatvZju23gPpjETV_IE1egLVe7VGjD0NXg/s16000/output.JPG" /></a></div><br /><span style="font-size: large;"><br /></span><p></p><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><p style="text-align: center;"><br style="text-align: left;" /></p><div style="font-family: "times new roman"; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><br /><i><br /></i></div><p><span style="font-size: large;"></span></p><div style="font-family: "times new roman"; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/jax-rs-web-services-with-spring-in.html" target="_blank">JAX-RS Web Services with Spring in Liferay 7 (DXP)</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/read-excel-file-xlsx-using-apache-poi.html" target="_blank">Read Excel file using Apache POI in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/how-to-enable-jquery-in-liferay-dxp-73.html" target="_blank">Enable jQuery in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/access-document-and-media-files-in.html" target="_blank">Access files of Document and Media Portlet</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><a href="https://liferayiseasy.blogspot.com/2022/06/imageselector-in-custom-portlet.html" target="_blank"><i><span style="font-size: x-large;">Image Selector in Liferay 7.x</span></i></a><br /></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><a href="https://liferayiseasy.blogspot.com/2022/06/create-custom-fields-programmatically.html" target="_blank"><i><span style="font-size: x-large;">Custom fields Programatically in Liferay 7.3 </span></i></a></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div></span></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-35242927329434377332022-06-13T08:11:00.002-07:002022-06-13T08:11:40.898-07:00Create Custom Fields Programmatically in Liferay DXP(7.3) <p> <span style="font-size: xx-large;"> </span></p><p><span style="font-size: large;">Today we will see how we can create custom fields in Liferay DXP . In this example we will create 3 custom fields one contain String value , second contain Boolean value and third contain drop down . We also set the permissions of Custom Fields in the same example. I am creating custom fields for sites . But you can use the same process for users and others entities of Liferay. Here i am using Liferay 7.3.</span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: x-large;"><u><b>Step 1:- Create a simple MVC Portlet</b></u></span></p><p><span style="font-size: large;">Create a simple Liferay module Project and provide the portlet name as CustomFieldsPortlet and paste this content:-</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>CustomFieldsPortlet.java</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/b769650d14284fba3e45c47e6aa3ad36.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>Explanation :</u></b></span></p><div><span style="font-size: large;">Here we create 3 custom fields in sites/Group.</span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><p style="font-size: medium;"><span style="font-size: x-large;"><u><b>Step 2:- Check Result</b></u></span></p><p>Before deployment go to create sites and create a dummy site . Then try to edit that site. Their is no Custom filed</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_fBhW9UM1nTMY3arPVXo_zrto0Ni3V8DG4VwEp70AhSnC3r_DJuZjMu5uECGgtr2QwjsfS06QNbo2eZKwYvf4XdcET6zCDQcprq6NS7uEUZ5NPANxjvNO1GfnOICn92Q0D2G5ew6PHDVZBR4vt5B58zMPHZqIK2SwGnOPTjA2KlbSfX2fXWwLo2h3lQ/s809/Before.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="435" data-original-width="809" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_fBhW9UM1nTMY3arPVXo_zrto0Ni3V8DG4VwEp70AhSnC3r_DJuZjMu5uECGgtr2QwjsfS06QNbo2eZKwYvf4XdcET6zCDQcprq6NS7uEUZ5NPANxjvNO1GfnOICn92Q0D2G5ew6PHDVZBR4vt5B58zMPHZqIK2SwGnOPTjA2KlbSfX2fXWwLo2h3lQ/s16000/Before.JPG" /></a></div><div><span style="font-size: large;"><br /></span></div>Now lets deploy the portlet and check again.</span></div><div><span style="font-size: large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnYRqvI4yfvYnGrrtJs9DBfP_wlkpsJK0QYkgB8PV2kFUNLX18M0drmlLdwPravcmZXC4zxmr4mzvmpAS5XB93JxLeUXOm88RGeabipDklSO7SrxOfugFe9BITeqP81XoSk5EOdwmyzP0OHvH-NeKDMRPs6m-sV397DuYGVBpvpF5o_CyFyUtgan-nlA/s818/After.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="468" data-original-width="818" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnYRqvI4yfvYnGrrtJs9DBfP_wlkpsJK0QYkgB8PV2kFUNLX18M0drmlLdwPravcmZXC4zxmr4mzvmpAS5XB93JxLeUXOm88RGeabipDklSO7SrxOfugFe9BITeqP81XoSk5EOdwmyzP0OHvH-NeKDMRPs6m-sV397DuYGVBpvpF5o_CyFyUtgan-nlA/s16000/After.JPG" /></a></div><span style="font-size: large;"><p><br /></p></span><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgOK8SN7gCNZL8BMQ9bSI4rkDztxfI9rU7jzGUPx_LmP4DPqE3CX0XG-zu_YTvJjkJ7B2VIaRP8fxIryUYkLgah8diMD6TamRL-dolG8RtevP9X0rg2CQzmlyBEM-syj7GpnHth7nZZ12Hk1hkS6Jsvf32deweTxZi_QLl2O2O3fwucWKgqWV1CsMJpw/s855/after2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="355" data-original-width="855" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgOK8SN7gCNZL8BMQ9bSI4rkDztxfI9rU7jzGUPx_LmP4DPqE3CX0XG-zu_YTvJjkJ7B2VIaRP8fxIryUYkLgah8diMD6TamRL-dolG8RtevP9X0rg2CQzmlyBEM-syj7GpnHth7nZZ12Hk1hkS6Jsvf32deweTxZi_QLl2O2O3fwucWKgqWV1CsMJpw/s16000/after2.JPG" /></a></div><br /></div><div><br /></div><div><br /></div><div style="text-align: left;"><span style="font-size: large;">Now For Checking Permission Go to Control Panel and Check Custom Fields of Group/Site.</span></div><div><span style="font-size: x-large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMkZL2ppxvSyl2XoOyDZgW7oGjlKyuel4naXPieURWjndW6GQXtIVoTfv0erRiHTcaAGIwPhH3wGm0tOjNXp0O9EDkHszYQxh6p1_aRL7f2sPRn15tz6JO9yam4_VfXOM_eEc5plI-_5IQ0YW_LOMdjiJ3OBpRJGIEp505yo081wt6LGiEdAPuvgHrQQ/s1279/permission1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="504" data-original-width="1279" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMkZL2ppxvSyl2XoOyDZgW7oGjlKyuel4naXPieURWjndW6GQXtIVoTfv0erRiHTcaAGIwPhH3wGm0tOjNXp0O9EDkHszYQxh6p1_aRL7f2sPRn15tz6JO9yam4_VfXOM_eEc5plI-_5IQ0YW_LOMdjiJ3OBpRJGIEp505yo081wt6LGiEdAPuvgHrQQ/s16000/permission1.JPG" /></a></div><br /><span style="font-size: x-large;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoRr27zAsJxDScomTfkel57t5IZDojjF2S36POz-ZrhFVPWH302-10y7PtmwQxvV3qtyHCbqg3-m9MAu6rPSNf0nOghBfeKqvOVyj8nZtgLUCPzbbklJDhU3acTeo_4i51UgmI86Yd5YOralMqlbgFMBzaKJ4BKJ73FK-BZF7yIAK031Gu5hqSAgE8hA/s1277/permission2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="623" data-original-width="1277" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoRr27zAsJxDScomTfkel57t5IZDojjF2S36POz-ZrhFVPWH302-10y7PtmwQxvV3qtyHCbqg3-m9MAu6rPSNf0nOghBfeKqvOVyj8nZtgLUCPzbbklJDhU3acTeo_4i51UgmI86Yd5YOralMqlbgFMBzaKJ4BKJ73FK-BZF7yIAK031Gu5hqSAgE8hA/s16000/permission2.JPG" /></a></div><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><p style="text-align: center;"><br style="text-align: left;" /></p><div style="font-family: "times new roman"; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><br /><i><br /></i></div><p><span style="font-size: large;"></span></p><div style="font-family: "times new roman"; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/jax-rs-web-services-with-spring-in.html" target="_blank">JAX-RS Web Services with Spring in Liferay 7 (DXP)</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/read-excel-file-xlsx-using-apache-poi.html" target="_blank">Read Excel file using Apache POI in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/how-to-enable-jquery-in-liferay-dxp-73.html" target="_blank">Enable jQuery in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/access-document-and-media-files-in.html" target="_blank">Access files of Document and Media Portlet</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><a href="https://liferayiseasy.blogspot.com/2022/06/imageselector-in-custom-portlet.html" target="_blank"><i><span style="font-size: x-large;">Image Selector in Liferay 7.x</span></i></a><br /></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div><div><span style="font-size: x-large;"><br /></span></div></div></div></div><div><br /></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-17459504524398270952022-06-11T20:31:00.000-07:002022-06-11T20:31:04.492-07:00ImageSelector in Custom Portlet <p> <span style="font-size: xx-large;"> </span></p><p><span style="font-size: large;">Today we will how we can include image selector in our custom portlet . Here we create a custom portlet where we provide a Choose button as soon as user click on choose button a pop up will open where he can select the images from document and media portlet . Here i am using Liferay 7.3.</span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: x-large;"><u><b>Step 1:- Create a simple MVC Portlet</b></u></span></p><p><span style="font-size: large;">Create a simple Liferay module Project and provide the portlet name as ImageSelectorPortlet and paste this content:-</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>ImageSelectorPortlet.java</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/31e7d7ea8177b66b5cba2fbf45899134.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>Explanation :</u></b></span></p><p><span style="font-size: large;"><span>At line number 65 we use eventName as <b>sampleTestSelectItem </b>. We use this same eventName in our jsp.</span></span></p><p><span style="font-size: large;"><span><br /></span></span></p><p><span style="font-size: x-large;"><u><b>Step 2:- Change view.jsp</b></u></span></p><p><span style="font-size: large;">Open view.jsp and paste this content:-</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>view.jsp</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/1c6b97885391372414d102ac2bfcb9b3.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>Explanation :</u></b></span></p><p><span style="font-size: large;"><span></span></span></p><p><span style="font-size: large;">Here we create a simple form which contain choose button , a text box that save the path of document and submit button.</span></p><p><span style="font-size: large;">Also provide a entry in <b>Language.properties</b></span></p><p><span style="font-size: large;">select-image=Please Select the Image</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>Note </u></b>:- Before using this you must enable jQuery in Liferay. I already write a blog on <a href="https://liferayiseasy.blogspot.com/2022/06/how-to-enable-jquery-in-liferay-dxp-73.html" target="_blank">how to enable jQuery in Liferay 7.3</a></span></p><p><br /></p><p><span style="font-size: x-large;"><u><b>Step 3:- Check output</b></u></span></p><p><span style="font-size: large;">Deploy your portlet and add to page.</span></p><p><span style="font-size: large;"><br /></span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf3UtpcTsVgxp8IoOpLAmgBW0TH_hcOJRXytfL7K09CYBifz962ZhZy9AKhiGcvtLTWupgM_0x3yCnoPq7-fQiiH0d4qqMXfVDwczMBpnCCETja3tuPN3kp5x5LHZAt4BTSXGFFSTH8PqJmJjBv_MC6MtvctEi88VZooBhzqgGQrNfNZ7W-MitEecblw/s1260/o1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="350" data-original-width="1260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf3UtpcTsVgxp8IoOpLAmgBW0TH_hcOJRXytfL7K09CYBifz962ZhZy9AKhiGcvtLTWupgM_0x3yCnoPq7-fQiiH0d4qqMXfVDwczMBpnCCETja3tuPN3kp5x5LHZAt4BTSXGFFSTH8PqJmJjBv_MC6MtvctEi88VZooBhzqgGQrNfNZ7W-MitEecblw/s16000/o1.JPG" /></a></div><br /><span style="font-size: large;"> Click on Choose button </span><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWnVZc4uZUTY96Do8Y-fd76WNOjlnLbdcvX_AthYQeWHl9odk1frhSc-zLQxP4ytOUhZLdoj2FNdlOcy39Iwlo5M2jHvrTujcfI74yRO58Ypsh2PQ_Yh2OfQWf_Li5o_nXpPibbW55O878iu0DhwGdxIE9myNVLxlCNsv-KDaa8fFQzHE_NZr-oSl8w/s1303/o2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="635" data-original-width="1303" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZWnVZc4uZUTY96Do8Y-fd76WNOjlnLbdcvX_AthYQeWHl9odk1frhSc-zLQxP4ytOUhZLdoj2FNdlOcy39Iwlo5M2jHvrTujcfI74yRO58Ypsh2PQ_Yh2OfQWf_Li5o_nXpPibbW55O878iu0DhwGdxIE9myNVLxlCNsv-KDaa8fFQzHE_NZr-oSl8w/s16000/o2.JPG" /></a></div><br /><span style="font-size: large;"><br /></span><p></p><p><span style="font-size: large;">Select the image and click Add</span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmLEAqeS12wNzGeJ9_EGPWHToXeZo6nUFV3WWd7x2beTFhoZHmUtRrrjzv-FdMDMxkPwrTZ0TeXlrp8K6bjgNRx_cpR58jUp777sJY_sjapu8jzMZyRhH7zBKBFqaDFGvFuUZAWRKwkB1fSEhy4KCE6rgyMrUwLkvyYMkeYrhLsAEPUekBCwMTfaKW5w/s1262/03.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="368" data-original-width="1262" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmLEAqeS12wNzGeJ9_EGPWHToXeZo6nUFV3WWd7x2beTFhoZHmUtRrrjzv-FdMDMxkPwrTZ0TeXlrp8K6bjgNRx_cpR58jUp777sJY_sjapu8jzMZyRhH7zBKBFqaDFGvFuUZAWRKwkB1fSEhy4KCE6rgyMrUwLkvyYMkeYrhLsAEPUekBCwMTfaKW5w/s16000/03.JPG" /></a></div><br /><span style="font-size: large;">When you submit this . The path will be available in your portlet.</span><p></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;">You can download the source code from <a href="https://sourceforge.net/projects/liferayiseasy7-3/files/Image%20Selector/image-selector.rar/download" target="_blank">here</a>.</span></p><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b><br /></b></i></u></div><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><p style="text-align: center;"><br style="text-align: left;" /></p><div style="font-family: "times new roman"; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><br /><i><br /></i></div><p><span style="font-size: large;"></span></p><div style="font-family: "times new roman"; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/jax-rs-web-services-with-spring-in.html" target="_blank">JAX-RS Web Services with Spring in Liferay 7 (DXP)</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/read-excel-file-xlsx-using-apache-poi.html" target="_blank">Read Excel file using Apache POI in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/how-to-enable-jquery-in-liferay-dxp-73.html" target="_blank">Enable jQuery in Liferay 7.3</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/access-document-and-media-files-in.html" target="_blank">Access files of Document and Media Portlet</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: x-large;"></span></p>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-6653481336615006952022-06-11T07:03:00.002-07:002022-06-11T07:03:21.858-07:00How to enable jQuery in Liferay DXP (7.3)<p> </p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;">By Default in Liferay DXP jQuery is disable . But we can easily enable this using control panel. Here i am using Liferay 7.3.</span></p><p><span style="font-size: large;">Just Login with Admin and Go to control panel then system settings</span></p><p><br /></p><a name='more'></a><p><br /></p><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1xYeb4rwzIHIaBXGy3Qqe31bVT-AMaVU9-VoRREyHTOC4jh3vsjH-4DrU-LL9JU-EKPOF46Af40pn4nyJkWk5JYBL2lXf7nrb1GLrVkXkXm-4t7mJEzaGIuC9Wh2LsvPz9WMcEz3s4KbsnNAcw4yFmH2j-jefoyvgWI9wvtd-UNpwabfegbAmg0jLNg/s1347/system%20settings.JPG" imageanchor="1"><img border="0" data-original-height="399" data-original-width="1347" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1xYeb4rwzIHIaBXGy3Qqe31bVT-AMaVU9-VoRREyHTOC4jh3vsjH-4DrU-LL9JU-EKPOF46Af40pn4nyJkWk5JYBL2lXf7nrb1GLrVkXkXm-4t7mJEzaGIuC9Wh2LsvPz9WMcEz3s4KbsnNAcw4yFmH2j-jefoyvgWI9wvtd-UNpwabfegbAmg0jLNg/s16000/system%20settings.JPG" /></a></div><br /><p><br /></p><p><span style="font-size: large;">then Click on third party</span></p><p><span style="font-size: large;"><br /></span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieb5nkIEg3lL1oWbBfc1MJJg0E8z70CAXtX7LnZYliu7QsFL5JQbfSyXkLCGzoFIdprBkpylUtVGkKAmt6dwzxuSfIIwmcD8jZaQ6jouJne9BxlAVeuZKzPJYgX_sR_3KhT1_2mQIKN4g01VJwwExVDjdIcqjPBscUJeoUM1vvsrF4uaIaeMTZ_1lGtg/s1316/third%20party.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="438" data-original-width="1316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieb5nkIEg3lL1oWbBfc1MJJg0E8z70CAXtX7LnZYliu7QsFL5JQbfSyXkLCGzoFIdprBkpylUtVGkKAmt6dwzxuSfIIwmcD8jZaQ6jouJne9BxlAVeuZKzPJYgX_sR_3KhT1_2mQIKN4g01VJwwExVDjdIcqjPBscUJeoUM1vvsrF4uaIaeMTZ_1lGtg/s16000/third%20party.JPG" /></a></div><br /><span style="font-size: large;"><br /></span><p></p><p><span style="font-size: large;">then click on jQuery enable the check box and update.</span></p><p><span style="font-size: large;"><br /></span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9yU5JTDKD5D9rKKUf7CyQPjS1I09gVXPsJ6XV2RzInWiOzHT-5TPmRJal1JfECsVeP6e3LDy6luukcdZWuqHJaCw8Z9oE5bpCUKiR9PbGl3PGoNHdB6nSjSMwxgWm8O16iQnnXy_qMrw8C59MKw6bBjSiRnuSMXDckOPIG0zr0NFvq-TzXgSMkeo5kw/s1279/enableJquery.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="455" data-original-width="1279" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9yU5JTDKD5D9rKKUf7CyQPjS1I09gVXPsJ6XV2RzInWiOzHT-5TPmRJal1JfECsVeP6e3LDy6luukcdZWuqHJaCw8Z9oE5bpCUKiR9PbGl3PGoNHdB6nSjSMwxgWm8O16iQnnXy_qMrw8C59MKw6bBjSiRnuSMXDckOPIG0zr0NFvq-TzXgSMkeo5kw/s16000/enableJquery.JPG" /></a></div><br /><span style="font-size: large;"><br /></span><p></p><p><span style="font-size: large;"><br /></span></p><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><p style="text-align: center;"><br style="text-align: left;" /></p><div style="font-family: "times new roman"; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><br /><i><br /></i></div><p><span style="font-size: large;"></span></p><div style="font-family: "times new roman"; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/jax-rs-web-services-with-spring-in.html" target="_blank">JAX-RS Web Services with Spring in Liferay 7 (DXP)</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/read-excel-file-xlsx-using-apache-poi.html" target="_blank">Read Excel file using Apache POI in Liferay 7.3</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-12620366042169678492022-06-10T05:08:00.002-07:002022-06-10T05:08:44.760-07:00Access Document and Media Files in Custom Portlet<p> <span style="font-size: x-large;"> </span></p><p><span style="font-size: large;">Today we will discuss how we can display files which are stored in document and media portlet of Liferay.We also create download link so that user can download the files which are stored in document and media . Here i am using Liferay 7.3.</span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: large;">For this i created a folder with name Testing and upload 2 files in it.</span><span style="font-size: x-large;"> </span></p><p><span style="font-size: x-large;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-large;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-large;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXAwoHIPnfnjFv0Xjn5lWIyDuRBB0zX9zPWCRbCUbaAVQKULHBXKZlzjkozPfUAGBDnQMX36n5SQ9sgHLkquVDyzegsMGpRVD8VPeP-XzAayn5SiB1U8CXiSKEcAjNrmKxGo3x1Oo5g3IdiF1o5QD7I_QxLSuRn6OA1TbJMkEVCnUO2eJH9uDScjUTkg/s679/foldername.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="383" data-original-width="679" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXAwoHIPnfnjFv0Xjn5lWIyDuRBB0zX9zPWCRbCUbaAVQKULHBXKZlzjkozPfUAGBDnQMX36n5SQ9sgHLkquVDyzegsMGpRVD8VPeP-XzAayn5SiB1U8CXiSKEcAjNrmKxGo3x1Oo5g3IdiF1o5QD7I_QxLSuRn6OA1TbJMkEVCnUO2eJH9uDScjUTkg/s16000/foldername.JPG" /></a></span></div><span style="font-size: x-large;"><br /><span style="font-size: x-large;"><br /></span></span><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtc6w_rHb9cGb3BZqi6n2Qm4a8CdbZUGJM-U821tFEzeswGhGzNKPWXQ0RVmfQF6jN-Y_0pJZBrWh-T1ipgJVgxk-_FsQ_SBmrJrhUUJh5-2lgvksXMmE1Mntvk--Ee-w9oI05UCTDb7hEqsHoAoaMRsEFzSVoctFQ_NoC-XaU2KkVFWwTGHwtlJE8Bg/s986/two%20files.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="599" data-original-width="986" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtc6w_rHb9cGb3BZqi6n2Qm4a8CdbZUGJM-U821tFEzeswGhGzNKPWXQ0RVmfQF6jN-Y_0pJZBrWh-T1ipgJVgxk-_FsQ_SBmrJrhUUJh5-2lgvksXMmE1Mntvk--Ee-w9oI05UCTDb7hEqsHoAoaMRsEFzSVoctFQ_NoC-XaU2KkVFWwTGHwtlJE8Bg/s16000/two%20files.JPG" /></a></div><br /><p></p><p><span style="font-size: x-large;"><u><b><br /></b></u></span></p><p><span style="font-size: x-large;"><u><b>Step 1:- Create a simple MVC Portlet</b></u></span></p><p><span style="font-size: large;">Create a simple Liferay module Project and provide the portlet name as DocumentAndMediaPortlet and paste this content:-</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>DocumentAndMediaPortlet.java</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/00cf5f8b188c587bbe1bdc60ae3d56a5.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;"><b><u>Explanation :</u></b></span></p><p><span style="font-size: large;">Here i am using DLAppService which provide as all the required methods. We get the List of files are present in Testing folder and put in request.</span><span style="font-size: x-large;"> </span></p><div><span style="font-size: large;"><br /></span></div><div><span><p style="font-size: medium;"><span style="font-size: x-large;"><u><b>Step 2:- Change view.jsp</b></u></span></p><p style="font-size: medium;"><span style="font-size: large;">Now change the view.jsp so that we can display all the files using search container.</span></p><p style="font-size: medium;"><span style="font-size: large;"><b><u>view.jsp</u></b></span></p><p style="font-size: medium;"><span style="font-size: large;"><script src="https://gist.github.com/adit2787/535ab68baf77986c352bfb8186b0cddb.js"></script></span></p><p><span style="font-size: x-large;"><b><u>Explanation:</u></b></span></p><p><span style="font-size: large;">By default size is in digits like 123, 6787 so we need to format it so that it should formatted in MB or KB. </span></p><p><span style="font-size: large;">For this we use LanguageUtil class . I created a separate utility class that format the size and give us URL for download.</span><span style="font-size: x-large;"> </span></p><p style="font-size: x-large;"><br /></p><p style="font-size: medium;"><span style="font-size: x-large;"><u><b>Step 3:- Create Utility Class</b></u></span></p><p style="font-size: medium;"><span style="font-size: large;">Now create a utility class DocumentAndMediaUtil and paste this:-</span></p><p><u><b><span style="font-size: large;">DocumentAndMediaUtil.java</span></b></u></p><p style="font-size: x-large;"><script src="https://gist.github.com/adit2787/0c36e5ba278cbc60f4eef4277b30d50a.js"></script> </p><p style="font-size: x-large;"><br /></p><p><span style="font-size: x-large;"><u><b>Step 4:- Check Output</b></u></span></p><p><span style="font-size: large;">Deploy your portlet and add to page.</span></p><p style="font-size: x-large;"><br /></p><div class="separator" style="clear: both; font-size: x-large; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFvoPJGWHTwNZub7ReSpUPwFHwTUbz6hybD_CnOr4_ZFK_HEimGCj8VnAphRLxABuyiCCVvk4OFLudj8eg6JUHz-eyydwE8Fj13yOGsAHsHfD8O77PyDOYElayV_VCfrypxGJKHkW4SKPcRclw8ryTWnp1pw1n6hf0gR1oI79ABSCFfQT4oyfas3Twtw/s1296/Output.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="1296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFvoPJGWHTwNZub7ReSpUPwFHwTUbz6hybD_CnOr4_ZFK_HEimGCj8VnAphRLxABuyiCCVvk4OFLudj8eg6JUHz-eyydwE8Fj13yOGsAHsHfD8O77PyDOYElayV_VCfrypxGJKHkW4SKPcRclw8ryTWnp1pw1n6hf0gR1oI79ABSCFfQT4oyfas3Twtw/s16000/Output.JPG" /></a></div><u style="font-size: xx-large;"><div style="text-align: center;"><u><b>Project Structure</b></u></div><div style="text-align: center;"><u><b><br /></b></u></div></u><div class="separator" style="clear: both; font-size: x-large; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUzOH1MN6lfXdrYJrlHIkkGpNyMeCp_FdUjRnnqEB5vzXxw8e9Uk7EH7b5AQUOXiDGIgEDbk4j6awWJ6G1VaHv5FKHo__JNf4ILZOq_1Ffijgt-Rd7-gCZtdrz9J8SsFSAYzFtYEU1wON8BMVwYkzHlubATH8eVLalK-aBk_j0Ip7gWddOiGsz4Tl2YA/s578/structure.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="344" data-original-width="578" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUzOH1MN6lfXdrYJrlHIkkGpNyMeCp_FdUjRnnqEB5vzXxw8e9Uk7EH7b5AQUOXiDGIgEDbk4j6awWJ6G1VaHv5FKHo__JNf4ILZOq_1Ffijgt-Rd7-gCZtdrz9J8SsFSAYzFtYEU1wON8BMVwYkzHlubATH8eVLalK-aBk_j0Ip7gWddOiGsz4Tl2YA/s16000/structure.JPG" /></a></div><br /><p><span style="font-size: large;">You can download the source code from <a href="https://sourceforge.net/projects/liferayiseasy7-3/files/Custom%20Document%20and%20Media/document-and-media.rar/download" target="_blank">here</a>.</span></p><div style="font-family: "times new roman"; font-size: medium; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><p style="font-size: medium; text-align: center;"><br style="text-align: left;" /></p><div style="font-family: "times new roman"; font-size: medium; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><br /><i><br /></i></div><div style="font-family: "times new roman"; font-size: medium; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/jax-rs-web-services-with-spring-in.html" target="_blank">JAX-RS Web Services with Spring in Liferay 7 (DXP)</a></span></i></div><div style="margin: 0px;"><i><br /></i></div><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/read-excel-file-xlsx-using-apache-poi.html" target="_blank">Read Excel file using Apache POI in Liferay 7.3</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div></span></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-46629916726985506532022-06-09T00:23:00.006-07:002022-06-09T00:31:50.769-07:00Read Excel file (xlsx) using Apache POI in Liferay 7/DXP<br/><p> </p><p><span style="font-size: large;">Today we will see how we can read excel file(.xlsx) using Apache POI .The main problem in this is POI dependencies .POI create problem with OSGI .So we add dependencies in gradle and include resources in bnd.Here i am using Liferay 7.3.</span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: x-large;"><u><b>Step 1:- Create a simple MVC Portlet</b></u></span></p><p><span style="font-size: large;">Create a simple Liferay module Project and create a simple form in jsp</span></p><p><span style="font-size: large;"><b><u>view.jsp</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/22357beec63bba69f33c87e62682b75e.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: x-large;"><u><b>Step 2:- Create Action Method in Portlet</b></u></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;">Create a method uploadFile in your controller . So now your controller become :-</span></p><p><span style="font-size: large;"><b><u>ReadExcelPortlet.java</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/7a63c292153dc7b83cb43abd6e08272a.js"></script></span></p><p><span style="font-size: large;"><b><u>Explanation:-</u></b></span></p><p><span style="font-size: large;">Here we are using apache poi classes so we need to add dependencies for the same.</span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: x-large;"><u><b>Step 3:- Add Dependencies </b></u></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;">Open build.gradle and paste this:-</span></p><p><span style="font-size: large;"><b><u>build.gradle</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/21a54bc546f355bcd612913a76897db7.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: large;">Now open bnd.bnd and paste this:-</span></p><p><span style="font-size: large;"><b><u>bnd.bnd</u></b></span></p><p><span style="font-size: large;"><script src="https://gist.github.com/adit2787/5384959a678fa3cdabb2f26c185fcf89.js"></script></span></p><p><span style="font-size: large;"><br /></span></p><p><span style="font-size: x-large;"><u><b>Step 4:- Check Output </b></u></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;"></span></p><p><span style="font-size: large;">Now deploy your project and check output:- </span></p><p><span style="font-size: large;">The Excel file we used :-</span></p><p><span style="font-size: large;"><br /></span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyG2iT7ANFnQEh6IvUGpsARZq9ev8wKNUpou9DgNKKBx9DXMnMoSu64WzGCebahnxZnZdpqxWeA4u2lgMmUVJ6D8-yK8w0H3q2oiBkOS4FSu2g_hfF7G0yzqx7dIoa-CskBzFBFquYL-yeLCk8hL4wFw55tQi9P90Z7v7BzIH-SQ0en5OzF8yYM0yF-A/s662/excelfile.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="271" data-original-width="662" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyG2iT7ANFnQEh6IvUGpsARZq9ev8wKNUpou9DgNKKBx9DXMnMoSu64WzGCebahnxZnZdpqxWeA4u2lgMmUVJ6D8-yK8w0H3q2oiBkOS4FSu2g_hfF7G0yzqx7dIoa-CskBzFBFquYL-yeLCk8hL4wFw55tQi9P90Z7v7BzIH-SQ0en5OzF8yYM0yF-A/s16000/excelfile.JPG" /></a></div><br /><p></p><p><span style="font-size: x-large;"><br /></span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5boBRgXXXaQRk4dz_aQfTtn42ptVQdX05Fzf499Sw8BwkSUVDNGQpUt0q8ya4lUBoz58YOQKZ9ZhSl9LlLMNQzlzWv9T-FKeAHQauOYRyhrvIiL0mQE-QWHYOdvbFhQSLPx8EnbJn8_0FkuLWIiYwox5zINDGVCImmod-LSJvpC3KJOrijZQWVTg4Kw/s846/view.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="441" data-original-width="846" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5boBRgXXXaQRk4dz_aQfTtn42ptVQdX05Fzf499Sw8BwkSUVDNGQpUt0q8ya4lUBoz58YOQKZ9ZhSl9LlLMNQzlzWv9T-FKeAHQauOYRyhrvIiL0mQE-QWHYOdvbFhQSLPx8EnbJn8_0FkuLWIiYwox5zINDGVCImmod-LSJvpC3KJOrijZQWVTg4Kw/s16000/view.JPG" /></a></div><p></p><div class="separator" style="clear: both; text-align: center;"><p style="text-align: left;"><span style="font-size: large;">Upload Excel file and click submit and check the console</span></p><div><span style="font-size: large;"><br /></span></div></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB8ObfN5pkyAmgiHEQXHgrRu7OZG-M3_uQ611ab-xLbLWEhtBeoIUjheB2qSbwSYhCLLAQDcEJ7OTat1JhqGab0q-VWwICIWinVxIC5-2SK3uJPjOkcAorBNZAz_IgtJ_7qUT16fqZbOtMkQlDrG2ixzfUytcTOKqxErG_S-lXgM3lYSZAaVe_S6fz2w/s791/output.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="173" data-original-width="791" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB8ObfN5pkyAmgiHEQXHgrRu7OZG-M3_uQ611ab-xLbLWEhtBeoIUjheB2qSbwSYhCLLAQDcEJ7OTat1JhqGab0q-VWwICIWinVxIC5-2SK3uJPjOkcAorBNZAz_IgtJ_7qUT16fqZbOtMkQlDrG2ixzfUytcTOKqxErG_S-lXgM3lYSZAaVe_S6fz2w/s16000/output.JPG" /></a></div><div><br /></div><div><br /></div><span style="font-size: x-large;"><b><u>Note </u></b>: You can download the source code from <a href="https://sourceforge.net/projects/liferayiseasy7-3/files/Read%20Excel%20File%20using%20POI/read-excel.rar/download" target="_blank">here</a></span><br /><p><br /></p><p style="text-align: center;"><b><u><span style="font-size: x-large;"> Project Structure</span></u></b></p><p style="text-align: center;"><b><u></u></b></p><div class="separator" style="clear: both; text-align: center;"><b><u><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4TIFbMbIgkIukl8BU_ydK6OWt7v_H0ohzHpjkar6sKF0g1I5KPpoAoQFZJk4RUHZ49z1_WuH3YzsJxJ2BCtJvVOoAuJrBL6QsNuZ0uIedgVT7YAWfBjtJ2GFCDXUX6kULHSfWyGyrjKygXGAKSrzbJMHHHgktl8jWuAd-Lboyl1DMQ6IQXZTi6ekdSw/s1084/projectstructure.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="564" data-original-width="1084" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4TIFbMbIgkIukl8BU_ydK6OWt7v_H0ohzHpjkar6sKF0g1I5KPpoAoQFZJk4RUHZ49z1_WuH3YzsJxJ2BCtJvVOoAuJrBL6QsNuZ0uIedgVT7YAWfBjtJ2GFCDXUX6kULHSfWyGyrjKygXGAKSrzbJMHHHgktl8jWuAd-Lboyl1DMQ6IQXZTi6ekdSw/s16000/projectstructure.JPG" /></a></u></b></div><b><u><br /></u></b><p></p><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b><br /></b></i></u></div><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><p style="text-align: center;"><br style="text-align: left;" /></p><div style="font-family: "times new roman"; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><br /><i><br /></i></div><div style="font-family: "times new roman"; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/jax-rs-web-services-with-spring-in.html" target="_blank">JAX-RS Web Services with Spring in Liferay 7 (DXP)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-50747662617509534402022-06-08T03:31:00.002-07:002022-06-09T00:26:04.799-07:00JAX-RS Web Services with Spring in Liferay 7 (DXP) <p> </p><p><span style="font-size: large;">We already know how to <a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">create Rest API in Liferay 7 (JAX-RS Web Services)</a>. Today we will see how we can use spring and add objects in Liferay databases. Here we will create a Rest service that will add data in Liferay database. Before reading this blog it is highly recommended to read how to <a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">create Rest API in Liferay 7 (JAX-RS Web Services).</a> Here i am using Liferay 7.3.</span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: x-large;"><u><b>Step 1:- Create a simple Rest Portlet</b></u></span></p><p><span style="font-size: large;">Create a simple Liferay module Project and select Rest Template provide class name and package name and Click Finish. Now open your java file and paste this :- </span></p><p><span style="font-size: large;"><br /></span><span style="font-size: large;"><u><b>EmployeeRestApplication.java</b></u></span><br /><span style="font-size: large;"><script src="https://gist.github.com/adit2787/be0343a46b23274eb08a65b8b6de70f0.js"></script></span><br /><span style="font-size: large;"><br /></span></p><div><span style="font-size: x-large;"><b><u>Explanation:-</u></b></span></div><div><br /></div><div><span style="font-size: large;">1)In Line 28 we define base URL as /employee</span></div><p><span style="font-size: large;"></span></p><div><span style="font-size: large;">2) JAX_RS_NAME is Employee.Rest</span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">So we register this with same name in OAuth2 Administration.</span></div><div><span style="font-size: x-large;"><br /></span></div><div><span style="font-size: x-large;"><b><u>Note</u></b>:- </span><span style="font-size: large;">How to register our web service you can read my <a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank"> previous blog.</a></span></div><div><br /></div><div><span style="font-size: large;">During registration select create/Read/Update all checkboxes</span></div><div><br /></div><div><br /></div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixwqV0tWzz3Xi5GM_E73xfSfuVj8GoBWZ3iyubkt0fUxNFa9VIeiDnbcCnXuy41Zm8H4qlZClw_XuuqKz1ennlvfvII5SOmxrXLHVgVM7bdOmcvgB_yR-AivQ3vdxZjKVm0JCkgK8z_rwzOGqY36mvhDaZUJENbWSu29eeGGDs6pkAfJG_c8Huvaw_ZQ/s1243/scope%20for%20employee.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="637" data-original-width="1243" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixwqV0tWzz3Xi5GM_E73xfSfuVj8GoBWZ3iyubkt0fUxNFa9VIeiDnbcCnXuy41Zm8H4qlZClw_XuuqKz1ennlvfvII5SOmxrXLHVgVM7bdOmcvgB_yR-AivQ3vdxZjKVm0JCkgK8z_rwzOGqY36mvhDaZUJENbWSu29eeGGDs6pkAfJG_c8Huvaw_ZQ/s16000/scope%20for%20employee.JPG" /></a></div><br /><span style="font-size: x-large;"><br /></span></div><div><br /></div><div><span style="font-size: large;">3) Here in line 51, addEmployee method we use @RequestBody which belong to Spring Frame work. Also we use JSONFactoryUtil so we need to add the dependencies in build.gradle </span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><p style="font-size: medium;"><span style="font-size: x-large;"><u><b>Step 2:- Add Dependencies in build.gradle</b></u></span></p><p style="font-size: medium;"><span style="font-size: large;">Now open build.gradle and paste the dependencies :- </span></p><p style="font-size: medium;"><span style="font-size: large;"><br /></span><span style="font-size: large;"><u><b>build.gradle</b></u></span></p><p style="font-size: medium;"><span style="font-size: large;"><script src="https://gist.github.com/adit2787/e9d252eff18739c052d042e412be2486.js"></script></span></p><p style="font-size: medium;"><span style="font-size: large;"><br /></span></p><p style="font-size: medium;"><span style="font-size: x-large;"><u><b>Step 3:- Create Employee Bean</b></u></span></p><p style="font-size: medium;"><span style="font-size: large;">Create Employee.java that contain setter and getters which can parse Json to Employee object and used with @RequestBody </span></p><p style="font-size: medium;"><span style="font-size: large;"><br /></span></p><p style="font-size: medium;"><u style="font-size: x-large;"><b>Employee.java</b></u></p><p><script src="https://gist.github.com/adit2787/7c94f25940758171efb24e0a8be38ecd.js"></script></p><p><u style="font-size: xx-large;"><b><br /></b></u></p><p style="font-size: medium;"><span style="font-size: x-large;"><u><b>Step 4:- Test your API</b></u></span></p><p style="font-size: medium;"><span style="font-size: large;">Deploy your project and test the API using postman</span></p><div style="font-size: medium;"><span style="font-size: large;">Now you call your services but first you need to generate access_token by using client_id and client_secret which is generated in step 2</span></div><div style="font-size: medium;"><span style="font-size: large;"><br /></span></div><div style="font-size: medium;"><span style="font-size: large;"><br /></span></div><div style="font-size: medium;"><b><span style="font-size: x-large;"><u>A)Call to generate access_ token</u></span></b></div><div style="font-size: medium;"><span style="font-size: large;"><br /></span></div><div style="font-size: medium;"><span style="font-size: large;"><span> </span><span> </span><b>URL : http://localhost:8080/o/oauth2/token</b></span><span style="font-size: x-large;"> </span></div><div style="font-size: medium;"><span style="font-size: x-large;"><br /></span></div><div style="font-size: medium;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvfBb48hRlftc76QKEQYQse3FuI9TFRDcZPv1GR1s6LeiroN4i-CXqcbdM5LUq_GLgbDlGF5dgOB0tBsd-OnaoDWPCAzAk9U1G-ufZzKtqvtyWKxhmZx9ur0gbnpbODeEb6yHQvCvn5RHXfkH-cjf8QujQTdAsHXXKnARKeNceBHNOOwkYD20hhcJC8A/s937/tokenforemployee.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="511" data-original-width="937" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvfBb48hRlftc76QKEQYQse3FuI9TFRDcZPv1GR1s6LeiroN4i-CXqcbdM5LUq_GLgbDlGF5dgOB0tBsd-OnaoDWPCAzAk9U1G-ufZzKtqvtyWKxhmZx9ur0gbnpbODeEb6yHQvCvn5RHXfkH-cjf8QujQTdAsHXXKnARKeNceBHNOOwkYD20hhcJC8A/s16000/tokenforemployee.JPG" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><span style="font-size: x-large;"><br /></span></div><div style="font-size: medium;"><span style="font-size: large;">Now this access token is used with Bearer in next Calls.</span></div><div style="font-size: medium;"><span style="font-size: large;"><br /></span></div><p style="font-size: medium;"><span style="font-size: large;"></span></p><div style="font-size: medium;"><b><u><span style="font-size: x-large;">B) Base/Get call</span></u></b></div><div><b><u><span style="font-size: x-large;"><br /></span></u></b></div></span></div><div><span style="font-size: large;"><b><span> </span>URL : </b></span><span style="font-size: large;"><b>http://localhost:8080/o/employee/</b></span></div><div><span style="font-size: large;"><b><br /></b></span></div><div><span style="font-size: large;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-pceN3TjYDwq35itssyl0tJXpnzgwRjJKAoisWJSokpKOoaqKZw848I9vvLykCqt1aiN0OlgMOOsOlHJQgWkO7W3HMgJ6lkuiexnRDc3i3UTXGMORlHO4E2ld2szRQSKk_3Y_59EwjW0_JN9It5qZgnViPbD0MTPQmGYH2G9CdaD0w1ESYJcIHFHO_A/s1044/base.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="368" data-original-width="1044" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-pceN3TjYDwq35itssyl0tJXpnzgwRjJKAoisWJSokpKOoaqKZw848I9vvLykCqt1aiN0OlgMOOsOlHJQgWkO7W3HMgJ6lkuiexnRDc3i3UTXGMORlHO4E2ld2szRQSKk_3Y_59EwjW0_JN9It5qZgnViPbD0MTPQmGYH2G9CdaD0w1ESYJcIHFHO_A/s16000/base.JPG" /></a></div><br /><b><br /></b></span></div><div><div><span style="font-size: large;"><div style="font-size: medium;"><b><u><span style="font-size: x-large;">C) Add Employee/Post call</span></u></b></div><div><b><u><span style="font-size: x-large;"><br /></span></u></b></div></span></div><div><span style="font-size: large;"><b> URL : </b></span><span style="font-size: large;"><b>http://localhost:8080/o/employee/add-employee</b></span></div></div><div><span style="font-size: large;"><b><br /></b></span></div><div><span style="font-size: large;"><b>In body Pass JSON</b></span></div><div><span style="font-size: large;"><b><br /></b></span></div><div><span style="font-size: large;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPhYnqrFTalsllZjJ9eoh8Q8q_7s0-CbalCwJx2n85dIGgQ2rYOJe3Tdy4eSFF9Z6EgEfXKMlOMe1diUW5DgFQS7A-EB8iiuAxin8PbkqrH1xgAAOy9Jm88nPkKecI1Ft49FpeXC29UIrMwhuogQvlmDEqRLIdayDhTpGJU8n-A8SUrk85XL3hnXEEAA/s1034/body.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="312" data-original-width="1034" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPhYnqrFTalsllZjJ9eoh8Q8q_7s0-CbalCwJx2n85dIGgQ2rYOJe3Tdy4eSFF9Z6EgEfXKMlOMe1diUW5DgFQS7A-EB8iiuAxin8PbkqrH1xgAAOy9Jm88nPkKecI1Ft49FpeXC29UIrMwhuogQvlmDEqRLIdayDhTpGJU8n-A8SUrk85XL3hnXEEAA/s16000/body.JPG" /></a></div><br /><b><br /></b></span></div><div><span style="font-size: large;"><b>In Header Pass Authorization and Content-type</b></span></div><div><span style="font-size: large;"><b><br /></b></span></div><div><span style="font-size: large;"><b><br /></b></span></div><div><span style="font-size: large;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhinVbz5isi3QlNaBoDelhzF-U9Fn7FfP-50J5OUukul3-r8CSsbRRUjhWF1f13sZGIvN7sHgF26S48dRRStKVuW5zUhsAD4ioW_386gTY2gBbjmC76R7ZK6n_K_0KOMhDxBnjRjwirlcHF79rkoDNliiCYikeFnFmonhs0HkJp3vRSUahbKFQbF8u3jg/s1039/AddEmployee.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="396" data-original-width="1039" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhinVbz5isi3QlNaBoDelhzF-U9Fn7FfP-50J5OUukul3-r8CSsbRRUjhWF1f13sZGIvN7sHgF26S48dRRStKVuW5zUhsAD4ioW_386gTY2gBbjmC76R7ZK6n_K_0KOMhDxBnjRjwirlcHF79rkoDNliiCYikeFnFmonhs0HkJp3vRSUahbKFQbF8u3jg/s16000/AddEmployee.JPG" /></a></div><br /><b><br /></b></span></div><div><span style="font-size: large;"><b>On Console you will see Employee Object</b></span></div><div><span style="font-size: large;"><b><br /></b></span></div><div><span style="font-size: large;"><b><br /></b></span></div><div><span><div class="separator" style="clear: both; font-size: x-large; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTHAtlBS3evs3Bk4OIIEePruh3lXFyUsUNm7zgzLYIq5ofiFC2XeEC54TwLBoYOoPxw0chCTWhL6O3Udl8N16YiEPOIREMxlf-9kWIzuzGM6x5z0-SjCutkw6gfNJwFHl1Ixf2PmK-b-3LNOegqSTYBqAyEn6E24Ml4I51j44cfnZE6z8hAHagt7gWbg/s853/Output.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="154" data-original-width="853" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTHAtlBS3evs3Bk4OIIEePruh3lXFyUsUNm7zgzLYIq5ofiFC2XeEC54TwLBoYOoPxw0chCTWhL6O3Udl8N16YiEPOIREMxlf-9kWIzuzGM6x5z0-SjCutkw6gfNJwFHl1Ixf2PmK-b-3LNOegqSTYBqAyEn6E24Ml4I51j44cfnZE6z8hAHagt7gWbg/s16000/Output.JPG" /></a></div><span style="font-size: x-large;"><div style="text-align: center;"><b><u>Project Structure</u></b></div></span></span></div><div><span><span style="font-size: x-large;"><b><u><br /></u></b></span></span></div><div><span><span style="font-size: x-large;"><b><div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAkafYtYJB5pig7Hmjt8LNebte-cctJSisRYvfM0QtpYQle5BX4Ko1Qm7Z-EeXyt2digyCK-d4THIt6Vy0BymrDANAuneNTsffZiiDBFjfzOzCNsPkxfXM_t9oEeuZrg3qQP3waPPeBgV7PNl5i9NR3Zi3wcg3rap_S6jAdddNQHPMvx4Uyk3YV4355Q/s513/projectstructure.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="238" data-original-width="513" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAkafYtYJB5pig7Hmjt8LNebte-cctJSisRYvfM0QtpYQle5BX4Ko1Qm7Z-EeXyt2digyCK-d4THIt6Vy0BymrDANAuneNTsffZiiDBFjfzOzCNsPkxfXM_t9oEeuZrg3qQP3waPPeBgV7PNl5i9NR3Zi3wcg3rap_S6jAdddNQHPMvx4Uyk3YV4355Q/s16000/projectstructure.JPG" /></a></div><br /><u><br /></u></b></span><b style="font-size: x-large;"><br /></b></span></div><div><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><br /><div style="font-family: "times new roman"; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><br /><i><br /></i></div><div style="font-family: "times new roman"; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/creating-rest-api-in-lliferay-7-jax-rs.html" target="_blank">Creating Rest API in Liferay 7 (JAX-RS Web Services)</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/read-excel-file-xlsx-using-apache-poi.html" target="_blank">Read Excel File in Liferay 7.3</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-66733696591411875942022-06-08T01:11:00.005-07:002022-06-08T02:23:01.545-07:00Creating Rest API in Liferay 7 (JAX-RS Web Services)<p><span style="font-size: large;"> </span></p><p><span style="font-size: large;">Today we will discuss how to create Rest Services in Liferay. By using JAX-RS we will create Rest Services that can be used by other applications. Here i am using Liferay 7.3.</span></p><p><span style="font-size: large;">So lets start this step by step :-</span></p><p><br /></p><a name='more'></a><p><span style="font-size: x-large;"><u><b>Step 1:- Create a simple Rest Portlet</b></u></span></p><p><span style="font-size: large;">Create a simple Liferay module Project and select Rest Template </span></p><p><span style="font-size: large;"> </span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1kcjGm3yvC2sC2ScqPEeoVWyH_OVID88KfoGl26wF8lQcXsyhR3Jt-iQLtJfPcJqAC5cS3iYxAWMJtPtq9mRLizzxoG5YLjiENR_dKJ0Rrt0PriQGTvGgyfbwfIGw5OV3JSeyH4s1zcbM3m-2m7_M8r6xcVmos_vyO37IZDwr5EzmZTns1D2KbO2zHw/s507/rest.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="488" data-original-width="507" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1kcjGm3yvC2sC2ScqPEeoVWyH_OVID88KfoGl26wF8lQcXsyhR3Jt-iQLtJfPcJqAC5cS3iYxAWMJtPtq9mRLizzxoG5YLjiENR_dKJ0Rrt0PriQGTvGgyfbwfIGw5OV3JSeyH4s1zcbM3m-2m7_M8r6xcVmos_vyO37IZDwr5EzmZTns1D2KbO2zHw/s16000/rest.JPG" /></a></div><br /><span style="font-size: large;"><br /><br />After that provide Class Name(DemoRest) and package name (com.portal.rest)</span><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEPK0rPoR6Tgaz9oAuFkyCl82oKUIkVzI0r9WAQHTa78suCyc9a5U0WNMoqK8AnNSjh79oQhgkVglGNNbxbYLviSt08ntXllj0O_i4pc24MBSOjvC7i-vs7q2V1TZTV3ZDnZ9n4faaIZKxMkzwSPkiqzxksBw3vw8sCmFv_LVBCl6JC4U3OMscg25OVA/s513/packageandclass.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="494" data-original-width="513" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEPK0rPoR6Tgaz9oAuFkyCl82oKUIkVzI0r9WAQHTa78suCyc9a5U0WNMoqK8AnNSjh79oQhgkVglGNNbxbYLviSt08ntXllj0O_i4pc24MBSOjvC7i-vs7q2V1TZTV3ZDnZ9n4faaIZKxMkzwSPkiqzxksBw3vw8sCmFv_LVBCl6JC4U3OMscg25OVA/s16000/packageandclass.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">And Click Finish.</span><p></p><p><span style="font-size: large;">You will see new project is created and Application is appended with class as well as package.</span></p><p><span style="font-size: large;">Now Class name become <b>DemoRestApplication </b>and package name become <b>com.portal.rest.application</b>.</span></p><p><span style="font-size: large;"><br /></span><span style="font-size: large;"><b><u>DemoRestApplication.java</u></b></span><br /><span style="font-size: large;"><script src="https://gist.github.com/adit2787/b63e3ece2b097c7cfa9aced6eaee1d36.js"></script></span><br /><span style="font-size: large;"><br /></span></p><div><span style="font-size: x-large;"><b><u>Explanation:-</u></b></span></div><div><br /></div><div><span style="font-size: large;">1)In Line 21 we define base URL as /greetings</span></div><div><span style="font-size: large;">2) JAX_RS_NAME is Greetings.Rest</span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"> </span></div><p style="text-align: left;"><u style="font-size: xx-large;"><b>Step 2:- Register JAX-RS Web Service</b></u></p><div><span style="font-size: large;">Your JAX-RS web service requires authorization by default. To enable this, you must create an OAuth 2.0 application to provide a way to grant access to your service.</span></div></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">Go to Control panel->Security->OAuth 2 Administration</span></div><div><span style="font-size: large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKNvqo40wnun0h3pqVcMZ1JbwJPvISv781i89SLOw8TpekFi2S7Hwcy15lfX46waU8Lp9wyWqrSFLmpA0AHC723n6JAm4ttzhUbQBYkFA2630mzrQpHI569nHolQTwbcBeKeG2gZOPrfsbvxPOB-XimJbO1j6dwoov1r4rDspADHlmNXAufzPIvqFCsg/s1007/oauth.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="461" data-original-width="1007" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKNvqo40wnun0h3pqVcMZ1JbwJPvISv781i89SLOw8TpekFi2S7Hwcy15lfX46waU8Lp9wyWqrSFLmpA0AHC723n6JAm4ttzhUbQBYkFA2630mzrQpHI569nHolQTwbcBeKeG2gZOPrfsbvxPOB-XimJbO1j6dwoov1r4rDspADHlmNXAufzPIvqFCsg/s16000/oauth.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">then Click on + icon </span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMbWIB08K3B9JxRN5zmRGoJELUffvQP-dXCvlNYqq-4T1vNywbenZJ3hoFTGpXu-EZDcE1uGY1O8EBdTdCN25j7_OGjGl33ZU7QK0qWX6GHMcNwd-YiMkxfViWYd3cUVefiUFI5l7PT_hbG9g0cwkjCoFznfipD8UcxEfLgvrZZsArB3XxGlAMLDEiAQ/s1322/Add.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="357" data-original-width="1322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMbWIB08K3B9JxRN5zmRGoJELUffvQP-dXCvlNYqq-4T1vNywbenZJ3hoFTGpXu-EZDcE1uGY1O8EBdTdCN25j7_OGjGl33ZU7QK0qWX6GHMcNwd-YiMkxfViWYd3cUVefiUFI5l7PT_hbG9g0cwkjCoFznfipD8UcxEfLgvrZZsArB3XxGlAMLDEiAQ/s16000/Add.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">Provide</span></div><div><span style="font-size: large;">Application Name : Greeting</span></div><div><span style="font-size: large;">Client Profile : Headless Server</span></div><div><span style="font-size: large;">and click save.</span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghVbqfhnegmAv8tq6APllcS7biVxiuJr9w6OqXpV-mnK29I-70PeH-J3NDsE5ihUl6TeUmo5rzN1VRUEosWVL3W4eLgwQK0PYN5FVZA-vQFblpe8INqOfQcshLS9YCwqAcUUqUkrXCsdPYlT2NSRXsojQ83AhOYGqEeEVjun9CHhdj_QOwwg2dD3e8GQ/s1014/Greeting%20Add.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="604" data-original-width="1014" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghVbqfhnegmAv8tq6APllcS7biVxiuJr9w6OqXpV-mnK29I-70PeH-J3NDsE5ihUl6TeUmo5rzN1VRUEosWVL3W4eLgwQK0PYN5FVZA-vQFblpe8INqOfQcshLS9YCwqAcUUqUkrXCsdPYlT2NSRXsojQ83AhOYGqEeEVjun9CHhdj_QOwwg2dD3e8GQ/s16000/Greeting%20Add.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">When you click save clientId and Client Secret is Generated automatically.Now Click on scopes tab</span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga8Jrhkq5YMClRbdqPcqwaSQW52kcWrSdWNuwN5PYcHzjuQ4DqfuIUvCHGBuaLquqgcHmcIAia1eVWf1qe_WANoVkgQRB55L6wujR_5S9CHenmfLAwMnNRN-unr6Nv1ZXX7_0cGDW2b0VjxG-rX1x3_CJgYO3JzrKYPGzKPilz9iP4bTd_jnBXOrCAsA/s1266/scope.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="443" data-original-width="1266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga8Jrhkq5YMClRbdqPcqwaSQW52kcWrSdWNuwN5PYcHzjuQ4DqfuIUvCHGBuaLquqgcHmcIAia1eVWf1qe_WANoVkgQRB55L6wujR_5S9CHenmfLAwMnNRN-unr6Nv1ZXX7_0cGDW2b0VjxG-rX1x3_CJgYO3JzrKYPGzKPilz9iP4bTd_jnBXOrCAsA/s16000/scope.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">Because we provide JAX_RS_NAME as Greetings.Rest so we will see a entry in scopes</span><span style="font-size: x-large;"> </span></div><div><span style="font-size: x-large;"><br /></span></div><div><span style="font-size: x-large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiD4Pcf2mXsVuD1jxhdsDH-HyZ9ZfdwcowZQ5YXby7fVFjaBHhFGgSRvRc-vfvgGWe5WooM22NZcJS1Er-_TcexGiaNlIaZU7AL-kTrbHmUBnAPBfmvAUApyrHxVy8jSEUCIb52GBBYQlI3XGzUm4l1xpETecL_D5UGkIcyt8yH-GlVQniJJ5iQAAstQ/s1247/Greeting%20scopes.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="564" data-original-width="1247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiD4Pcf2mXsVuD1jxhdsDH-HyZ9ZfdwcowZQ5YXby7fVFjaBHhFGgSRvRc-vfvgGWe5WooM22NZcJS1Er-_TcexGiaNlIaZU7AL-kTrbHmUBnAPBfmvAUApyrHxVy8jSEUCIb52GBBYQlI3XGzUm4l1xpETecL_D5UGkIcyt8yH-GlVQniJJ5iQAAstQ/s16000/Greeting%20scopes.JPG" /></a></div><br /><span style="font-size: x-large;"> </span></div><div><span style="font-size: large;">Check the check box and Click Save.</span></div><div><span style="font-size: x-large;"><br /></span></div><div><p><u style="font-size: xx-large;"><b>Step 3:- Test Your Services </b></u></p><div><span style="font-size: large;">Now you call your services but first you need to generate access_token by using client_id and client_secret which is generated in step 2</span></div></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><b><span style="font-size: x-large;"><u>A)Call to generate access_ token</u></span></b></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><span> </span><span> </span><b>URL : http://localhost:8080/o/oauth2/token</b></span><span style="font-size: x-large;"> </span></div><div><span style="font-size: x-large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxz7_h75ZiigDugWziGtpKucwlE7PKXkNEbHbC2rWAPubj-XLV1m80fLcssETc_2vTiiN2u5zuCwWzf-v_G8ZxkJlWJ8lKQgAr3sEeCLaVKprm5Wgx6GtvJ1WX18P4qpD80YSL37ZMBfSdSjb-1H7-xJINLKH8bXe2uYAeUoWr2GZgXqnHi4WTHPnabA/s1062/token.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="515" data-original-width="1062" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxz7_h75ZiigDugWziGtpKucwlE7PKXkNEbHbC2rWAPubj-XLV1m80fLcssETc_2vTiiN2u5zuCwWzf-v_G8ZxkJlWJ8lKQgAr3sEeCLaVKprm5Wgx6GtvJ1WX18P4qpD80YSL37ZMBfSdSjb-1H7-xJINLKH8bXe2uYAeUoWr2GZgXqnHi4WTHPnabA/s16000/token.JPG" /></a></div><br /><span style="font-size: x-large;"><br /></span></div><div><span style="font-size: large;">Now this access token is used with Bearer in next Calls.</span></div><div><span style="font-size: large;"><br /></span></div><div><b><u><span style="font-size: x-large;">B) Base URL call</span></u></b></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><span> </span><span> </span><b>URL : http://localhost:8080/o/greetings/</b> </span></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVbqALlrEJZTlm_bxCYywNKxE71Uc7H2Txft8LpBCrIrI0qtJSQy4dHCySR5bUbECOt8uUEud1mLsflcDHo_KpvhQOe_UIwPJ1b5QPGjDbRgsC3WpY6BM73blIhPOA8OpBpI_nnC1bQyEi8mlEehK0YNAkf6ri87F2xn_FgjgjEDUJRO6HHQx1n6YoCw/s1065/get.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="383" data-original-width="1065" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVbqALlrEJZTlm_bxCYywNKxE71Uc7H2Txft8LpBCrIrI0qtJSQy4dHCySR5bUbECOt8uUEud1mLsflcDHo_KpvhQOe_UIwPJ1b5QPGjDbRgsC3WpY6BM73blIhPOA8OpBpI_nnC1bQyEi8mlEehK0YNAkf6ri87F2xn_FgjgjEDUJRO6HHQx1n6YoCw/s16000/get.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><div><b><u><span style="font-size: x-large;">C) Specific URL call</span></u></b></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><span> </span><span> </span><b>URL : http://localhost:8080/o/greetings/morning</b></span></div></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVvKQowNtkB3sIjPqzCWIZDwP_lSGRdH7lUODOduwqQtQFTE3esCw7j_RC0rEny0jw6FDx67aAIjM31vRjpfN5F6TeXlEkHX7uvbSHhnOSFTWL1aQNVdLU25o5UiM4PuPgDseNnEzhqPaOJ7GCYFytRjAZK-mlENv2Qg2LhMWJEArbz-swzmO-6j-OUQ/s1060/getmorning.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="384" data-original-width="1060" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVvKQowNtkB3sIjPqzCWIZDwP_lSGRdH7lUODOduwqQtQFTE3esCw7j_RC0rEny0jw6FDx67aAIjM31vRjpfN5F6TeXlEkHX7uvbSHhnOSFTWL1aQNVdLU25o5UiM4PuPgDseNnEzhqPaOJ7GCYFytRjAZK-mlENv2Qg2LhMWJEArbz-swzmO-6j-OUQ/s16000/getmorning.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><div><b><u><span style="font-size: x-large;">D) URL with Path and Query Param</span></u></b></div><div><b style="font-size: x-large;"><br /></b></div><div><b style="font-size: x-large;">URL : </b><span style="font-size: large;"><b>http://localhost:8080/o/greetings/morning/:name?drink=Cofee</b></span></div></div><div><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjga72crpsrZsQpuk8RROjJku6zEmR9zagLYU6KaYLYuhnH80tC6oilBwdNylWsTJf3DCIvkS2_JW3R_ZufS1sCyy-bz6lsHfUO68GX-vvoKp1CK-iFZysh0GEdoJuqnAiJPH9i-oVTLNM9iz3L1NkzKpChooaWtw00IghoWGKlVQ1dS8iz_WJWcEhS5w/s1060/getwithparameter.JPG"><img border="0" data-original-height="402" data-original-width="1060" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjga72crpsrZsQpuk8RROjJku6zEmR9zagLYU6KaYLYuhnH80tC6oilBwdNylWsTJf3DCIvkS2_JW3R_ZufS1sCyy-bz6lsHfUO68GX-vvoKp1CK-iFZysh0GEdoJuqnAiJPH9i-oVTLNM9iz3L1NkzKpChooaWtw00IghoWGKlVQ1dS8iz_WJWcEhS5w/s16000/getwithparameter.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;"><br /></span></div><div><div style="font-family: "times new roman"; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><br /><div style="font-family: "times new roman"; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://liferayiseasy.blogspot.com/2022/06/make-you-liferay-dxp-application.html" target="_blank">Make You Liferay DXP Application Configurable</a></span></i><br /><i><br /></i></div><div style="font-family: "times new roman"; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://youtu.be/18JYYJ-KrNs" target="_blank">Resolve dependency in Liferay DXP 7.2</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://youtu.be/bSQ0bDk2pAs" target="_blank">How to Use Service Builder in Liferay DXP 7.2</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-25604763245107016472022-06-04T06:55:00.000-07:002022-06-04T06:55:05.344-07:00Make You Liferay DXP Application Configurable<p> </p>
<p>
<span style="font-size: large;"><span>Before Liferay DXP if we need to provide some configuration then we have
two option :-</span>
</span></p>
<p>
<span style="font-size: large;"><span>1)Provide configuration in portal-ext.properties</span>
</span></p>
<p><span style="font-size: large;">2)Use portal.properties </span></p>
<p>
<span style="font-size: large;"><span>In both cases we need to either redeploy the portlet or restart the server.
In this blog we will see how to make our application configurable so that we
don't need to restart or redeploy the portlet.</span>Here i am using Liferay 7.3</span></p>
<p><span style="font-size: large;"><span>So lets start this step by step :-</span></span></p><br /><a name='more'></a><span style="font-size: x-large;"><u><b>Step 1:- Create a simple MVC Portlet</b></u></span><br /><span style="font-size: large;">Let's create a simple MVC portlet and then create a simple package in it.
After that create a interface with this code :-</span><br /><span style="font-size: large;"><br /></span><span style="font-size: large;"><b><u>DemoConfiguration.java</u></b></span><br /><span style="font-size: large;"><script src="https://gist.github.com/adit2787/f9618ace83bad2e8282a6ebb094068d0.js"></script></span><br /><span style="font-size: large;"><br /></span><div><span style="font-size: x-large;"><b><u>Explanation:-</u></b></span></div><div><br /></div><div><span style="font-size: large;">1)In the 9th line we provide the category where our configuration is displayed in control panel system setting.</span></div><div><span style="font-size: large;">2)In 10th line we need to pass 3 things </span></div><div><span style="font-size: large;"> a)id : full path of your interface</span></div><div><span style="font-size: large;"> b)localization : your Language.properties file</span></div><div><span style="font-size: large;"> c)name : name which is displayed in system setting.</span></div><div><span style="font-size: large;">3)Here we can use keys those values we can pick from Language.properties or you can directly pass the value also. Like</span><span style="font-size: large;"> For sender and receiver description we pick from Language.properties and for gender description we directly mention</span><span style="font-size: x-large;">.</span></div><div><span style="font-size: x-large;"><br /></span></div><div><u><b><span style="font-size: x-large;">Step 2:- Provide values in Language.properties</span></b></u></div><div><span style="font-size: large;">Now add the keys values which we use in DemoConfiguration.java</span></div><div><span style="font-size: large;"><br /></span><span style="font-size: large;"><b><u>Language.properties</u></b></span><br /></div><div><span style="font-size: large;"><script src="https://gist.github.com/adit2787/28d6dec562edda9682a361083deb6f06.js"></script> </span></div><div><span style="font-size: large;"><br /></span></div><div><span><div><u><b><span style="font-size: x-large;">Step 3:- Deploy and Configure</span></b></u></div><div style="font-size: medium;"><span style="font-size: large;">Now deploy you portlet and go to control panel-> Configuration-> System Setting</span></div><div style="font-size: medium;"><span style="font-size: large;"><br /></span></div><div style="font-size: medium;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaD9jBVeidb_WJe7BJGQnd1FLJPtPktPTYYtwrdyBR5KPwRIUYUy-Y8E3oBJXfv8W8VKw34J9OFa0zysnu6C6jxu5mLVVS3uy5TznMawiAf7zpoDe9xE-XqX8iCCrpvw93_ht_pNsSUjRZFLtWk3pgcug9PfIwD38g3Ow9pXz_5RxSjP106YoISuOC7A/s962/system%20setting.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="410" data-original-width="962" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaD9jBVeidb_WJe7BJGQnd1FLJPtPktPTYYtwrdyBR5KPwRIUYUy-Y8E3oBJXfv8W8VKw34J9OFa0zysnu6C6jxu5mLVVS3uy5TznMawiAf7zpoDe9xE-XqX8iCCrpvw93_ht_pNsSUjRZFLtWk3pgcug9PfIwD38g3Ow9pXz_5RxSjP106YoISuOC7A/w640-h272/system%20setting.JPG" width="640" /></a></div><br /><span style="font-size: large;">Click on System setting then scroll down and you will see your category which we mention in DemoConfiguration.java</span></div><div style="font-size: medium;"><span style="font-size: large;"><br /></span></div><div style="font-size: medium;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBBJAxKeaY2uPO1X8MBom54iUE62nfMlSeq2Mv6lBGtu2-LLBSV8Ot78wu6R6n6x4Q8CoHlHM-m91sjMzD99Xiw_5uuDlm2GgojjpeRFik-BrAF16vbVICZ_KLrzDnDH_jZkpy0tByms0PXeDrZrfLEB55V0WAkT3miiBLO_KaqvSha2kVqKOlfUWiSA/s990/Category.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="233" data-original-width="990" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBBJAxKeaY2uPO1X8MBom54iUE62nfMlSeq2Mv6lBGtu2-LLBSV8Ot78wu6R6n6x4Q8CoHlHM-m91sjMzD99Xiw_5uuDlm2GgojjpeRFik-BrAF16vbVICZ_KLrzDnDH_jZkpy0tByms0PXeDrZrfLEB55V0WAkT3miiBLO_KaqvSha2kVqKOlfUWiSA/s16000/Category.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div style="font-size: medium;"><span style="font-size: large;">Click on category.LiferayIsEasy you will see your Demo Configuration inside System Scope</span></div><div style="font-size: medium;"><span style="font-size: large;"><br /></span></div><div style="font-size: medium;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilOlwCR-lrLRNJBVyQ9m3pVYp0fQWQLTapHYLkhV55gXiinV0tDjxluQ25If4EJfvmI1iFd_ZZUnhbWZYuLA9KlqNPH_GOhLLqLpF-2U-jDcEpPKet3FpZTuqTAYUv4uowifIR5eOh3drz49-CCi2hXqDR7_EW8YNfCD5bQLdKVzd5jxonczn91SGxyg/s1188/configuration.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="648" data-original-width="1188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilOlwCR-lrLRNJBVyQ9m3pVYp0fQWQLTapHYLkhV55gXiinV0tDjxluQ25If4EJfvmI1iFd_ZZUnhbWZYuLA9KlqNPH_GOhLLqLpF-2U-jDcEpPKet3FpZTuqTAYUv4uowifIR5eOh3drz49-CCi2hXqDR7_EW8YNfCD5bQLdKVzd5jxonczn91SGxyg/s16000/configuration.JPG" /></a></div><br /><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">Here you can provide any values and click update.</span></div><div><span style="font-size: large;"><br /></span></div><div><div><u><b><span style="font-size: x-large;">Step 4:- Fetch values in Portlet</span></b></u></div><div><span style="font-size: large;">Now Open your portlet in my case DemoPortlet.java and paste this code :</span></div><div><span><span style="font-size: large;"><br /></span><span style="font-size: large;"><b><u>DemoPortlet.java</u></b></span><br style="font-size: medium;" /><span style="font-size: large;"></span><span style="font-size: large;"><script src="https://gist.github.com/adit2787/c86c96a188f0b3e90df0aceb362f1288.js"></script></span><br style="font-size: medium;" /><div><span style="font-size: x-large;"><b><u>Explanation</u></b>:-</span></div><div style="font-size: medium;"><br /></div><div style="font-size: medium;"><span style="font-size: large;">1)Focus on line 37 Where we pass <b>configurationPid </b>which is path of our interface</span></div><div style="font-size: medium;"><span style="font-size: large;">2)From 40 to 46 we initialize our configuration .</span></div><div style="font-size: medium;"><span style="font-size: large;">3)From 51 to 53 we simply get the values.</span></div><div style="font-size: medium;"><span style="font-size: large;"><br /></span></div><div style="font-size: medium;"><span style="font-size: large;"><u style="font-size: medium;"><b><span style="font-size: x-large;">Project Structure</span></b></u></span></div><div style="font-size: medium;"><span style="font-size: large;"><u style="font-size: medium;"><b><span style="font-size: x-large;"><br /></span></b></u></span></div><div style="font-size: medium;"><span style="font-size: large;"><u style="font-size: medium;"><b><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd3K-747Csky8lcvM7HvRAMKEOEBZSfc0wyT00UApz0vqVYw5EsptsABc_LilT7EDF3H1A2uIOY-NPgHEymRHZpVupOZ2fNHZFI6jfZe5TSxj2L2Bzzuek3--N36bHMAdCsXe8ZUTM6plSBAAC8UWvid582tkuQ9T7dNigEI5Uxn10PGzP5jBUAGMV_g/s559/projectstructure.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="373" data-original-width="559" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd3K-747Csky8lcvM7HvRAMKEOEBZSfc0wyT00UApz0vqVYw5EsptsABc_LilT7EDF3H1A2uIOY-NPgHEymRHZpVupOZ2fNHZFI6jfZe5TSxj2L2Bzzuek3--N36bHMAdCsXe8ZUTM6plSBAAC8UWvid582tkuQ9T7dNigEI5Uxn10PGzP5jBUAGMV_g/s16000/projectstructure.JPG" /></a></div><br /><span style="font-size: x-large;"><br /></span></b></u></span></div><div style="font-size: medium;"><span style="font-size: large;"><b><u>Note </u></b>: You can download the source code from <a href="https://sourceforge.net/projects/liferayiseasy7-3/files/Liferay%20making%20Application%20Configurable/demo.rar/download">here</a> .</span></div><div style="font-size: medium;"><span style="font-size: large;"><u style="font-size: medium;"><b><span style="font-size: x-large;"><br /></span></b></u></span></div><div style="font-size: medium;"><span style="font-size: large;"><div style="font-family: "times new roman"; font-size: medium; margin: 0px;"><u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div><br style="font-size: medium;" /><div style="font-family: "times new roman"; font-size: medium; margin: 0px;"><i><span style="font-size: x-large;"><a href="https://youtu.be/2PA5r_AI300" target="_blank">FinderMethods in Liferay DXP 7.2</a></span></i><br /><i><br /></i></div><div style="font-family: "times new roman"; font-size: medium; line-height: normal;"><div style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><i><span style="font-size: x-large;"><a href="https://youtu.be/18JYYJ-KrNs" target="_blank">Resolve dependency in Liferay DXP 7.2</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><i><span style="font-size: x-large;"><a href="https://youtu.be/bSQ0bDk2pAs" target="_blank">How to Use Service Builder in Liferay DXP 7.2</a></span></i></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div></div></div></div></span></div></span></div></div></span></div>Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-6177224876585857512020-01-26T20:43:00.002-08:002020-03-17T21:25:57.022-07:00Connect Service Builder to External Database in Liferay DXP<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Today we will discuss how to connect service builder to external database using spring beans. We already know how to write <a href="https://youtu.be/bSQ0bDk2pAs" target="_blank">Service Builder in Liferay DXP 7.2</a>. So lets start this step by step :-</span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;"><br /></span><br />
<a name='more'></a><span style="font-size: x-large;"><u><b>Step 1:- Create Service Builder</b></u></span><br />
<span style="font-size: large;">Here i create a small entity employee that contain only two column:-</span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;"><b><u>service.xml</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/66cf7dca80f7cb210639c0f764bdd214.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Here two things are important:-</span><br />
<span style="font-size: large;">1)dpen</span><span style="font-size: large;">e</span><span style="font-size: large;">dency-injector="spring" ie we are using spring and not ds</span><br />
<span style="font-size: large;">2)data-source="secondDatabase" ie we create another datasource.</span><br />
<br />
<div>
</div>
<span style="font-size: large;">When you build the service you see some errors for spring dependency.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">For this add the dependency in build.gradle </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"> compileOnly group: "com.liferay", name: "com.liferay.portal.spring.extender.api", version: "4.0.0"</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"> And refresh gradle project.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Here a spring folder is automatically created inside META-INF</span><br />
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzMNj24QlBdyVnBz4sQ_ozMh29Y23StONMsJHismsCXlN3pFHOZMHG6yRIR8GvqZXDsQJRgNksiJ4bD1lEKz23kj4BbwMaq0wf3PeWKV9-c6bu6p9ykUB_rkQ2Go1g1Om0MwszO3QMizaT/s1600/external+db1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="512" height="500" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzMNj24QlBdyVnBz4sQ_ozMh29Y23StONMsJHismsCXlN3pFHOZMHG6yRIR8GvqZXDsQJRgNksiJ4bD1lEKz23kj4BbwMaq0wf3PeWKV9-c6bu6p9ykUB_rkQ2Go1g1Om0MwszO3QMizaT/s640/external+db1.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/F1Q0SK4XCAM/0.jpg" frameborder="0" height="336" src="https://www.youtube.com/embed/F1Q0SK4XCAM?feature=player_embedded" width="580"></iframe></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: x-large;"><u><b>Step 2:- Specify the datasource</b></u></span><br />
<span style="font-size: large;">Now open your portal-ext.properties and enter the database properties:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>portal-ext.properties</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/49a946e3d889253119fc79a2eb814288.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: x-large;"><b><u>Explanation</u></b></span><br />
<span style="font-size: large;">Here we add our database properties .The .ext is our new database which we are using for creating connection.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: x-large;"><u><b><br /></b></u></span>
<span style="font-size: x-large;"><u><b>Step 3:- Create Spring Bean</b></u></span><br />
<span style="font-size: large;">Create a ext-spring.xml file inside the sprint folder and paste this content:-</span><span style="font-size: large;"></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>ext-spring.xml</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/6f138b0d3bbc153d881341217448ce96.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: medium;"><b><u><span style="font-size: x-large;">Explanation</span></u></b><span style="font-size: large;">:-</span></span><br />
<span style="font-size: large;">1)Here we use </span><span style="font-size: large;">DataSourceFactoryBean where value is jdbc.ext. which we already create in out portal-ext.properties(Step 2).</span><br />
<span style="font-size: large;">2)alias="secondDatabase" this secondDatabase we already mention in our service.xml</span><br />
<span style="font-size: large;"><br /></span><u style="font-size: xx-large;"><b>RUN SERVICE BUILDER</b></u><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Also restart server because we mention new database properties in portal-ext.properties.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Now you can use another database tables .</span><br />
<span style="font-size: large;"><br /></span>
<u style="font-size: xx-large;"><b>Final Project Structure</b></u><br />
<u style="font-size: xx-large;"><b><br /></b></u>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCQL-rGHpt6npq_m6XnXTguNRQQHZDC3ViNj_B42WaNDAN4_-9rx5YeL_QzpufZF0ZfSzr3q5LH6wf2R1An75E1NfI9s91mVQpTJ4SFqlUVdo1whfO45tMGOjwySfxDMWOCi-Bbe2gE_eA/s1600/externaldb2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="419" data-original-width="538" height="498" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCQL-rGHpt6npq_m6XnXTguNRQQHZDC3ViNj_B42WaNDAN4_-9rx5YeL_QzpufZF0ZfSzr3q5LH6wf2R1An75E1NfI9s91mVQpTJ4SFqlUVdo1whfO45tMGOjwySfxDMWOCi-Bbe2gE_eA/s640/externaldb2.PNG" width="640" /></a></div>
<u style="font-size: xx-large;"><b><br /></b></u>
<span style="font-size: large;"><br /></span>
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div>
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="https://youtu.be/2PA5r_AI300" target="_blank">FinderMethods in Liferay DXP 7.2</a></span></i><br />
<i style="font-family: "times new roman";"><br /></i></div>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><span style="font-size: x-large;"><a href="https://youtu.be/18JYYJ-KrNs" target="_blank">Resolve dependency in Liferay DXP 7.2</a></span></i></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="https://youtu.be/bSQ0bDk2pAs" target="_blank">How to Use Service Builder in Liferay DXP 7.2</a></span></i></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i>Installation of Liferay DXP 7.2</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
</div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-82122494072121331912020-01-24T23:16:00.001-08:002020-03-10T20:15:18.997-07:00Custom Sql in Liferay DXP 7.2<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Today we will discuss how to write Custom Sql in Liferay DXP 7.2. We already know how to write <a href="https://youtu.be/bSQ0bDk2pAs" target="_blank">Service Builder in Liferay DXP 7.2</a>. So lets start this step by step :-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<br />
<a name='more'></a><span style="font-size: x-large;"><u><b>Step 1:- Create Service Builder</b></u></span><br />
<span style="font-size: large;">Here i create a small entity Pets that contain only two column:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>service.xml</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/b90d79b63f293b04cdd55bbd74af5018.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<u style="font-size: xx-large;"><b>Step 2:- Create default.xml</b></u><br />
<div>
<span style="font-size: large;">When you build service two projects are created :-</span><br />
<span style="font-size: large;">a)project-api</span><br />
<span style="font-size: large;">b)project-service</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b>My project name is lie</b>.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Now inside your service META-INF folder create a folder custom-sql and inside this folder create default.xml.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>Path of default.xml</u></b>:-</span><br />
<span style="font-size: large;">/lie-service/src/main/resources/META-INF/custom-sql/default.xml</span><br />
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMiNmhQ8IAwgQDjVOEkpfHWshKWPfIKcWbt0ELEg_2G7MPsMs71jyNaAv_B9btebztYs9734pFVw5SDeeiOtsdzaQlQ-rTOBg7kxKLCua8z3sT3UPmggQoH2YqfvHEb_n0nUCMT8oTQtac/s1600/default.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="307" data-original-width="343" height="569" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMiNmhQ8IAwgQDjVOEkpfHWshKWPfIKcWbt0ELEg_2G7MPsMs71jyNaAv_B9btebztYs9734pFVw5SDeeiOtsdzaQlQ-rTOBg7kxKLCua8z3sT3UPmggQoH2YqfvHEb_n0nUCMT8oTQtac/s640/default.PNG" width="640" /></a></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Now paste this content in default.xml</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>default.xml</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/844013de2b1aae2d22944e8fe1f4e62e.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>Explanation</u></b>:-</span><br />
<span style="font-size: large;">Here we use sql id ="getPetsByName" this id should be unique for each sql. So that we can get the query by this id.</span></div>
</div>
<br />
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/XvcVhODs17U/0.jpg" frameborder="0" height="320" src="https://www.youtube.com/embed/XvcVhODs17U?feature=player_embedded" width="540"></iframe></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<u style="font-size: xx-large;"><b>Step 3:- Create EntityFinderImpl</b></u><br />
<div>
<span style="font-size: large;">Now create EntityFinderImpl my entity is Pet so create PetFinderImpl inside com.lie.service.persistence.impl .</span><br />
<span style="font-size: large;">Here PetFinderImpl extends BasePersistanceImpl and implement EntityFinder.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>PetFinderImpl</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/3c52e607c3ee810014374412e2a2e7cd.js"></script></span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;">Initially this will give error because PetFinder is not available.</span><br />
<span style="font-size: large;"><br /></span>
<u style="font-size: xx-large;"><b>Now Build Service</b></u></div>
<div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">When you build service and refresh </span><span style="font-size: large;">BasePersistanceImpl become PetFinderBaseImpl . You can now import PetFinder also . So PetFinderImpl become:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>PetFinderImpl</u></b></span></div>
<div>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/b48b923f889311afdc7ca5b11bdce04c.js"></script></span></div>
<div>
<span style="font-size: large;"><br /></span></div>
<div>
<u style="font-size: xx-large;"><b><br /></b></u>
<u style="font-size: xx-large;"><b>Step 4:- Create method</b></u></div>
<span style="font-size: large;"><span style="font-size: medium;"></span>Now inside PetFinderImpl paste this:-</span><br />
<span style="font-size: large;"><br /></span>
<b style="font-size: x-large;"><u>PetFinderImpl</u></b><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/b523e8be5ee0b0b6b2ff9bb8322c193f.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Initially this will give error because we use CustomSQL object so just add the dependency in build.gradle </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"> <b>compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql.api", version: "1.0.0"</b></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">and refresh gradle project.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>Note</u></b>:- Here we use @Component and @Reference annotations.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><u style="font-size: xx-large;"><b>Now Build Service</b></u></span><br />
<span style="font-size: medium;"><span style="font-size: x-large;"><b><u><br /></u></b></span></span>
<span style="font-size: medium;"><span style="font-size: large;">and refresh Gradle project.</span><span style="font-size: x-large;"><b><u><br /></u></b></span></span>
<span style="font-size: large;"><br /></span>
<br />
<div>
<u style="font-size: xx-large;"><b>Step 5:- Create method in LocalServiceImpl</b></u></div>
<span style="font-size: large;"></span><br />
<span style="font-size: large;"><span style="font-size: medium;"></span>Now create a method in PetLocalServiceImpl so that it will available in PetLocalServiceUtil.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>PetLocalServiceImpl</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/961c54099358c58411329b12ddf05bfb.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><u style="font-size: xx-large;"><b>Now Build Service</b></u></span><br />
<span style="font-size: large;"><u style="font-size: xx-large;"><b><br /></b></u></span>
<span style="font-size: large;"><span style="font-size: x-large;"><span style="font-size: large;">Now you can deploy your services. And use the method as :-</span></span></span><br />
<span style="font-size: large;"><span style="font-size: x-large;"><span style="font-size: large;"><br /></span></span></span>
<span style="font-size: large;"><b>@Reference</b></span><br />
<span style="font-size: large;"><b>private PetLocalService _petLocalService;</b></span><br />
<span style="font-size: large;"><b>List<Pet>pet = _petLocalService.getPetsByName("Dog");</b></span><br />
<span style="font-size: large;"><span style="font-size: x-large;"><span style="font-size: large;"><br /></span></span></span><span style="font-size: large;"><span style="font-size: x-large;"><span style="font-size: large;"><b><u>Final Project structure:</u></b>-</span></span></span><br />
<span style="font-size: large;"><span style="font-size: x-large;"><span style="font-size: large;"><br /></span></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4TvlLO57A9uUaywAxkn6JNYeARD6JEnsj1Z0AsU2_CoYk8-4teHpd6wbsjRe2qaCMKMMSIQSl5ZsrSISXvMmCgVNtv-OPxe5GGiig9KWcWM1_4vgOe3TLqI8hAZertlVRuL0TR9GeDpQq/s1600/dxp.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="474" data-original-width="475" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4TvlLO57A9uUaywAxkn6JNYeARD6JEnsj1Z0AsU2_CoYk8-4teHpd6wbsjRe2qaCMKMMSIQSl5ZsrSISXvMmCgVNtv-OPxe5GGiig9KWcWM1_4vgOe3TLqI8hAZertlVRuL0TR9GeDpQq/s1600/dxp.PNG" /></a></div>
<span style="font-size: large;"><span style="font-size: x-large;"><span style="font-size: large;"><br /></span></span></span>
<span style="font-size: large;"><span style="font-size: x-large;"><span style="font-size: large;"><br /></span></span></span>
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div>
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="https://youtu.be/2PA5r_AI300" target="_blank">FinderMethods in Liferay DXP 7.2</a></span></i><br />
<i style="font-family: "times new roman";"><br /></i></div>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><span style="font-size: x-large;"><a href="https://youtu.be/18JYYJ-KrNs" target="_blank">Resolve dependency in Liferay DXP 7.2</a></span></i></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="https://youtu.be/bSQ0bDk2pAs" target="_blank">How to Use Service Builder in Liferay DXP 7.2</a></span></i></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/3n19Wlf55ck" target="_blank"><i>Create Your First Liferay Module Project??</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferay%20dxp%20with%20mysql/" target="_blank"><i>Liferay DXP with MySql</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="https://youtu.be/2md397ASER4" target="_blank"><i> Installation of Liferay DXP 7.2</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
</div>
</div>
</div>
<span style="font-size: large;"><u style="font-size: xx-large;"></u></span>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span></div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-71930077752712498032018-06-29T23:08:00.002-07:002018-06-29T23:10:39.995-07:00Open Web Content in Control Panel from your Custom Portlet<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-size: large;">Today we will open Web Content Edit Page from our custom portlet.We already know how to <a href="http://liferayiseasy.blogspot.com/2015/04/liferay-struts-action-hook.html" target="_blank">write struts action</a> hook here we use the same approach. We create a simple portlet and provide a link on click of that link we open the web content in control panel.</span><br />
<span style="font-size: large;"><br /></span>
<br />
<a name='more'></a><span style="font-size: x-large;"><u><b>Just Use this code in your jsp:-</b></u></span><br />
<span style="font-size: x-large;"><u><b><br /></b></u></span>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/151a192695116234c0fd5df825bb2736.js"></script></span><br />
<span style="font-size: large;"></span><br />
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: x-large;"><b style="font-size: xx-large;">Hope this will Help....</b></span><br />
<u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b><br /></b></i></u>
<u style="color: #c4a549; font-family: lora, serif; font-size: xx-large;"><i><b>Related Post:-</b></i></u></div>
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/01/liferay-service-builder-in-detail.html" target="_blank">Service Builder in Detail</a></span></i><br />
<i style="font-family: "times new roman";"><br /></i></div>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/02/custom-sql-in-liferay.html" target="_blank">Custom Sql in Liferay</a></span></i></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/service-builder-in-liferay.html" target="_blank">Service Builder in Liferay</a></span></i></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/02/dynamic-query-in-liferay.html" target="_blank"><i>Dynamic Query in Liferay</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
</div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-9709836477696116672018-06-29T21:28:00.000-07:002018-06-29T23:11:10.064-07:00Validation in WYSIWUG Editor in Liferay<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span><span style="font-size: large;">We already know how to <a href="http://liferayiseasy.blogspot.com/2017/05/use-wusiwug-editor-in-our-custom-portlet.html" target="_blank">Create WYSIWYG editor</a> in our custom portlet.For this we create a hidden field with same name as our editor and use aui:validator on that field.</span><br />
<span style="font-size: large;"></span><br />
<a name='more'></a><span style="font-size: x-large;"><b><u>Just use this code in your JSP</u></b></span><br />
<span style="font-size: x-large;"><b><u><br /></u></b></span>
<span style="font-size: x-large;"><span style="font-size: large;"><script src="https://gist.github.com/adit2787/e0964f551dd1dbe17e51cfa6a1ded86d.js"></script></span></span><br />
<span style="font-size: x-large;"><span style="font-size: large;"><br /></span></span>
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: x-large;"><b style="font-size: xx-large;">Hope this will Help....</b></span></div>
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: x-large;"><b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span></span></div>
<br />
<span style="font-size: x-large;"></span>
<div style="font-family: "times new roman"; margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/01/liferay-service-builder-in-detail.html" target="_blank">Service Builder in Detail</a></span></i><br />
<i style="font-family: "times new roman";"><br /></i></div>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/02/custom-sql-in-liferay.html" target="_blank">Custom Sql in Liferay</a></span></i></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/service-builder-in-liferay.html" target="_blank">Service Builder in Liferay</a></span></i></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/02/dynamic-query-in-liferay.html" target="_blank"><i>Dynamic Query in Liferay</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
</div>
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
</div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-161006413540437242018-06-22T03:17:00.000-07:002018-06-22T03:17:24.527-07:00How to access JSTL variable in Scriptlets<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span><span style="font-size: large;">Sometimes we have a situation in which we need to access JSTL in our scriptlets. Today we will solve this problem. Here i need to call a simple method greetUser that take screen name as a argument.</span><br />
<span style="font-size: large;"></span><br />
<a name='more'></a><span style="font-size: x-large;"><b><u>Problem</u></b></span><br />
<span style="font-size: x-large;"><span style="font-size: large;">When we try to access this we have the errors like:-</span></span><br />
<span style="font-size: x-large;"><span style="font-size: large;"><script src="https://gist.github.com/adit2787/0907f5a83d4570c1643523ceb526e49c.js"></script></span></span><br />
<span style="font-size: x-large;"><span style="font-size: large;"><br /></span></span>
<span style="font-size: x-large;"><span style="font-size: x-large;"><b><u>Solution</u></b></span><br />
<span style="font-size: large;">For solving this situation we first put the screenName in pageContext using c:set and then use this to call out method.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/23de6859034c3979af2e88c9248800b1.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<br />
</span><br />
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: x-large;"><b style="font-size: xx-large;">Hope this will Help....</b></span></div>
<span style="font-size: x-large;">
</span>
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: x-large;"><b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span></span></div>
<span style="font-size: x-large;">
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: large;"></span><br /></div>
<div style="font-family: "times new roman"; margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/01/liferay-service-builder-in-detail.html" target="_blank">Service Builder in Detail</a></span></i><br />
<i style="font-family: "times new roman";"><br /></i></div>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/02/custom-sql-in-liferay.html" target="_blank">Custom Sql in Liferay</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/service-builder-in-liferay.html" target="_blank">Service Builder in Liferay</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/02/dynamic-query-in-liferay.html" target="_blank"><i>Dynamic Query in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
</div>
</div>
</span></div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-7305434279908801172018-06-13T02:23:00.002-07:002018-06-13T02:29:11.630-07:00Use JQuery Data Table in Liferay<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span><span style="font-size: large;">In Liferay if we need to show some data in grid form we use search container provided by Liferay.</span><br />
<span style="font-size: large;">But search container refresh page each time when we click next page and if we want to apply search on search container its also refresh page for each search.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">So today we create data grid by using jquery data table .This is very easy and provide search, pagination etc without page refresh.</span><br />
<br />
<span style="font-size: large;">Lets start this step by step:-</span><br />
<a name='more'></a><span style="font-size: large;"><br /></span>
<span style="font-size: large;">Just use this code in your jsp here we create data table for user objects:-</span><br />
<span style="font-size: medium;"><br /><b><u><span style="font-size: x-large;">view.jsp</span></u></b></span><span style="font-size: large;"><script src="https://gist.github.com/adit2787/5c8b68089466b2a0d576bd747f7d9929.js"></script></span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;">You can check details about each tag <a href="http://legacy.datatables.net/ref" target="_blank">here</a>.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Add jstl library in liferay-plugin-package.properties.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: x-large;"><b><u>Output:-</u></b></span><br />
<span style="font-size: large;"><b><u><br /></u></b></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5YcrGDr44LrUYE0kwZY7FEWw9AEp8ymfcRd5mLgNZhpRIqYGI7cYDw-RQnot8x1Qku314tSZ_61DxaOvO6h3UsbSlbXt0JSzhTDYCY6AGQ5GJeAMNRVyLeurq9vEJKXVEzgj_lL92ht5q/s1600/datatable.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="364" data-original-width="1294" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5YcrGDr44LrUYE0kwZY7FEWw9AEp8ymfcRd5mLgNZhpRIqYGI7cYDw-RQnot8x1Qku314tSZ_61DxaOvO6h3UsbSlbXt0JSzhTDYCY6AGQ5GJeAMNRVyLeurq9vEJKXVEzgj_lL92ht5q/s1600/datatable.PNG" /></a></div>
<span style="font-size: large;"><b><u><br /></u></b></span>
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<b style="font-size: xx-large;">Hope this will Help....</b></div>
<div style="font-family: "times new roman"; margin: 0px;">
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span></div>
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: large;"></span><br /></div>
<div style="font-family: "times new roman"; margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/01/liferay-service-builder-in-detail.html" target="_blank">Service Builder in Detail</a></span></i><br />
<i style="font-family: "times new roman";"><br /></i></div>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/02/custom-sql-in-liferay.html" target="_blank">Custom Sql in Liferay</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/service-builder-in-liferay.html" target="_blank">Service Builder in Liferay</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/02/dynamic-query-in-liferay.html" target="_blank"><i>Dynamic Query in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-8825883834264973842018-05-16T02:00:00.004-07:002018-05-16T02:06:43.764-07:00Call Procedure in Liferay using jdbc methods<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">In the blog we will see how to call procedure in liferay using jdbc methods. For this i already created a procedure that return 3 result sets (user, contact and account). We iterate these result sets using jdbc methods.</span><br />
<br />
<div>
<a name='more'></a><br /></div>
<div>
<span style="font-size: large;">Here is my procedure code:-</span></div>
<div>
<span style="font-size: large;"><br /></span></div>
<div>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/2ea8550a75856dc1b03ee3cbb6f3b47f.js"></script></span></div>
<div>
<span style="font-size: large;"><br /></span></div>
<div>
<span style="font-size: large;">And when we call this procedure it will return 3 result sets:-</span><br />
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-BWMOeoePcA6BmiHYo5LBHYZLfmcFjdTHPvoZ6vYKWeNa1F41a4bodU5XjmjWMMjaJbdX5VSotgLRWIwtqFNwLz1iBg3S-p8phCEUGWNKDZUUsxdupfzDoi6tObmxCi5SjRxCnMb3RCej/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="216" data-original-width="977" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-BWMOeoePcA6BmiHYo5LBHYZLfmcFjdTHPvoZ6vYKWeNa1F41a4bodU5XjmjWMMjaJbdX5VSotgLRWIwtqFNwLz1iBg3S-p8phCEUGWNKDZUUsxdupfzDoi6tObmxCi5SjRxCnMb3RCej/s1600/1.PNG" /></a></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Liferay code for call this procedure:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/b72a448bff797ae41fe7db001f15b578.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<br />
<div style="font-family: "times new roman"; margin: 0px;">
<b style="font-size: xx-large;">Hope this will Help....</b></div>
<div style="font-family: "times new roman"; margin: 0px;">
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span></div>
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: large;"></span><br /></div>
<div style="font-family: "times new roman"; margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/01/liferay-service-builder-in-detail.html" target="_blank">Service Builder in Detail</a></span></i><span style="font-size: large;"></span></div>
<br /><span style="font-size: large;"></span>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/02/custom-sql-in-liferay.html" target="_blank">Custom Sql in Liferay</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/service-builder-in-liferay.html" target="_blank">Service Builder in Liferay</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/02/dynamic-query-in-liferay.html" target="_blank"><i>Dynamic Query in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
</div>
</div>
<span style="font-size: large;"><br /></span></div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-69627329472736140732018-03-23T02:18:00.000-07:002018-03-23T02:18:02.221-07:00Change Permission of a File/Document by Groovy in Lilferay<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">In the previous blog we <a href="http://liferayiseasy.blogspot.in/2018/03/programmatically-change-permission-of.html" target="_blank">Change the permission of a file to guest programmatically</a> in this blog we change the permission by groovy script. </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">So Lets start this:-</span><br />
<a name='more'></a><span style="font-size: large;">First go to control panel ->Server Administration->Script->Select Groovy and paste this:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"></span><br />
<script src="https://gist.github.com/adit2787/c7247e6b4f6ec914560cca68307ec1b2.js"></script>
<span style="font-size: large;"><br /></span><span style="font-size: large;">and click execute.</span><br />
<span style="font-size: large;"><br /></span>
<div style="font-family: "times new roman"; margin: 0px;">
<b style="font-size: xx-large;">Hope this will Help....</b></div>
<div style="font-family: "times new roman"; margin: 0px;">
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span></div>
<div style="font-family: "times new roman"; margin: 0px;">
<span style="font-size: large;"></span><br /></div>
<div style="font-family: "times new roman"; margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2017/06/liferay-portlet-url-in-javascript.html" target="_blank">Liferay Portlet URL in JavaScript</a></span></i><span style="font-size: large;"></span></div>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/04/openclose-dialog-box-using-aui-in.html" target="_blank">Dialog Box in Liferay using AUI</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/11/friendly-url-in-liferay.html" target="_blank">FriendlyURL in Liferay</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/10/developing-mvcportlet-with-multiple_5.html" target="_blank"><i>Multiple Render Methods in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-40200725249591930192018-03-23T02:02:00.002-07:002018-03-23T02:02:58.027-07:00Programmatically Change Permission of a File/Document in Lilferay<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-size: large;">Sometimes we need to change the permission of a document to Guest in Liferay. For this we can change this by Groovy Script or programatically. Today we will change this </span><span style="font-size: large;">programatically:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">So lets start this:-</span><br />
<a name='more'></a><span style="font-size: large;">You can simply use this code to change the permission to guest. In this first we check the folder permission and then file permission:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/1eac227e79829b43454d65c56f3f3eb1.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</div>
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<div>
<div style="margin: 0px;">
<b style="font-size: xx-large;">Hope this will Help....</b></div>
<div style="margin: 0px;">
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span></div>
<div style="margin: 0px;">
<span style="font-size: large;"></span><br /></div>
<div style="margin: 0px;">
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2017/06/liferay-portlet-url-in-javascript.html" target="_blank">Liferay Portlet URL in JavaScript</a></span></i><span style="font-size: large;"></span></div>
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/04/openclose-dialog-box-using-aui-in.html" target="_blank">Dialog Box in Liferay using AUI</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/11/friendly-url-in-liferay.html" target="_blank">FriendlyURL in Liferay</a></span></i></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/10/developing-mvcportlet-with-multiple_5.html" target="_blank"><i>Multiple Render Methods in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span></div>
<div style="margin: 0px;">
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span></div>
<div>
</div>
</div>
</div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-52579920427389848782018-02-03T04:16:00.002-08:002018-02-03T04:24:51.433-08:00Lucene Search in Liferay<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-size: large;">Today we will see how to use Lucene Search in Liferay. For this i create a simple portlet which can search journal Articles on the basis of title.</span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;">So lets start this Step by Step:-</span><br />
<a name='more'></a><br />
<b><u><span style="font-size: x-large;">Step 1:-Create a project and portlet</span></u></b><br />
<div>
<span style="font-size: large;">Create a project and then create a portlet in it .Here my project name is <b>lucene-portle</b>t and portlet name is <b>Demo</b>. </span><br />
<div>
<span style="font-size: large;"><br /></span>
<br />
<center>
<span style="font-size: large;"><br /></span><ins class="adsbygoogle" data-ad-client="ca-pub-7156905098737722" data-ad-slot="2849953898" style="display: inline-block; height: 280px; width: 336px;"></ins></center>
<span style="font-size: large;"><br /></span><span style="font-size: large;"><br /></span></div>
<div>
<span style="font-size: large;"></span><br />
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 2:-Change the jsp</span></u></b></span></div>
<div>
<div style="font-size: medium;">
<span style="font-size: large;">Change your view.jsp as:-</span></div>
<div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><br /></span><span style="font-size: large;"><b><u>view.jsp</u></b></span></span><br />
<div>
<span style="font-size: large;"><span style="font-size: large;"> <script src="https://gist.github.com/adit2787/a071f007a1c08f39f84dd4e101e72061.js"></script></span></span></div>
<div>
<span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span></span></div>
<div>
<span style="font-size: large;"><span style="font-size: large;"></span></span><br />
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><span style="font-size: large;"><span style="font-size: large;"><b><u><span style="font-size: x-large;">Explanation:-</span></u></b></span></span></span></span></div>
<span style="font-size: large;">
</span>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><span style="font-size: large;">Here i create a simple form with only one text field and a submit button. By using the text field we send the keyword for search.</span></span></span></div>
<span style="font-size: large;">
</span>
<br />
<div style="font-size: medium;">
<br />
<br /></div>
</div>
<div>
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 3:-Change the Controller</span></u></b></span></div>
<div>
<span style="font-size: large;">Now change your Demo.java:-</span><br />
<span style="font-size: large;"><br /></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><b><u>Demo.java</u></b><b><u><br /></u></b></span></span>
<script src="https://gist.github.com/adit2787/fef91dd37b72b012f9944a5e1bed2f64.js"></script>
<span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span>
</span><span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span></span></div>
<span style="font-size: large;"><span style="font-size: large;"><b><u><span style="font-size: x-large;">Explanation:-</span></u></b></span></span><br />
<span style="font-size: large;">Here i use Boolean Query and apply some conditions like:-</span><br />
<span style="font-size: large;">1)line 28 :- Search on JournalArticle class</span><br />
<span style="font-size: large;">2)line 29 :- Title must match with the Keyword.</span><br />
<span style="font-size: large;">3)line 30 :- Fetch only Latest Articles.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/afomVilw5xA/0.jpg" frameborder="0" height="350" src="https://www.youtube.com/embed/afomVilw5xA?feature=player_embedded" width="580"></iframe></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<br />
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 4:-Check the Output</span></u></b></span></div>
<span style="font-size: large;"></span><br />
<div>
<span style="font-size: large;">Now deploy the portlet and check the output . When you enter some text in text box it will get the articles that contain the required title.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">You can download the source code from <a href="https://sourceforge.net/projects/liferay-is-easy/files/Lucene%20Search%20in%20Liferay/lucene-portlet.rar/download" target="_blank">here</a>.</span><br />
<div>
<br /></div>
<div>
<br /></div>
<b style="font-size: xx-large;">Hope this will Help....</b><br />
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span><br />
<span style="font-size: large;"></span><br />
<i style="font-family: "times new roman";"><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2017/06/liferay-portlet-url-in-javascript.html" target="_blank">Liferay Portlet URL in JavaScript</a></span></i><span style="font-size: large;"></span><br />
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/04/openclose-dialog-box-using-aui-in.html" target="_blank">Dialog Box in Liferay using AUI</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/11/friendly-url-in-liferay.html" target="_blank">FriendlyURL in Liferay</a></span></i><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/10/developing-mvcportlet-with-multiple_5.html" target="_blank"><i>Multiple Render Methods in Liferay</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span><br />
<div>
</div>
</div>
</div>
</div>
</div>
<div>
<span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span></span></div>
</div>
<div style="font-size: medium;">
</div>
</div>
</div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-64446173037452681532017-11-02T03:21:00.000-07:002017-11-02T03:21:14.199-07:00Multiple ActionURL Call on Click of Buttons in Liferay<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-size: large;">We already know how to submit a form in Liferay. Normally we create a Form with a submit button and in Form action we pass actionURL .</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">When we click the submit button the form is submitted and call the process action method. But sometimes we need to call various action methods on clicking of simple buttons. So today we will discuss this in detail.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">So lets start this Step by Step:-</span><br />
<a name='more'></a><br />
<b><u><span style="font-size: x-large;">Step 1:-Create a project and portlet</span></u></b><br />
<div>
<span style="font-size: large;">Create a project and then create a portlet in it .Here my project name is <b>multisubmit-portle</b>t and portlet name is <b>Demo</b>.</span><br />
<span style="font-size: large;"><br /></span>
<br />
<center>
<span style="font-size: large;"><br /></span><ins class="adsbygoogle" data-ad-client="ca-pub-7156905098737722" data-ad-slot="2849953898" style="display: inline-block; height: 280px; width: 336px;"></ins></center>
<span style="font-size: large;"><br /></span><span style="font-size: large;"><br /></span></div>
<div>
<span style="font-size: large;"></span><br />
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 2:-Change the jsp</span></u></b></span></div>
<div>
<div style="font-size: medium;">
<span style="font-size: large;">Change your view.jsp as:-</span></div>
<div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><br /></span><span style="font-size: large;"><b><u>view.jsp</u></b></span></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><script src="https://gist.github.com/adit2787/1deb824b50a4d69648b34e8d539dd8b8.js"></script></span></span><br /></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span></span>
<span style="font-size: large;"><span style="font-size: large;"><b><u><span style="font-size: x-large;">Explanation:-</span></u></b></span></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;">1)In the view.jsp first we create two actionURLs (firstURL and SecondURL).</span></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;">2)Then we create two aui buttons and handle the click event by using aui.</span></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;">3)${message} is shown when we click on a button . This message is set in our controller.</span></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;">4)Here we use c tag so add the jstl jars in liferay-plugin-package.properties.</span></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span></span>
<span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span></span>
</div>
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 3:-Change the Controller</span></u></b></span></div>
<div>
<div>
<span style="font-size: large;">Now change your Demo.java:-</span><br />
<span style="font-size: large;"><br /></span></div>
</div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><b><u>Demo.java</u></b><b><u><br /></u></b></span></span><span style="font-size: large;"><span style="font-size: large;"><script src="https://gist.github.com/adit2787/7d3627a35ddd0f86e2c5bfb98b38f5f0.js"></script><b><u><br /></u></b></span></span>
<span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span></span>
</div>
<span style="font-size: large;"><span style="font-size: large;"><b><u><span style="font-size: x-large;">Explanation:-</span></u></b></span></span><br />
<span style="font-size: large;">1)Here we handle the request when first button is clicked first method is called and </span><span style="font-size: large;">when second button is clicked second method is called.</span><br />
<span style="font-size: large;">2)Here we also set the message in request that can be used on our jsp.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 4:-Check the Output</span></u></b></span></div>
<div>
<span style="font-size: large;">Now deploy the portlet and check the output:-</span><br />
<span style="font-size: large;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL-9bVm9S2vCVemrWCWixYrdIPsLAI_wa_9sk_rTeDyTMcI_-wFfqDF2nV_ZcLZx-C1gkrz7UY2WgxlzMNRUjEMAYg80TABoLFuREUNrLS8gqvjnjo8RMrQ77f_2x2pvsBqW1mHJ66zYf1/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="383" data-original-width="535" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL-9bVm9S2vCVemrWCWixYrdIPsLAI_wa_9sk_rTeDyTMcI_-wFfqDF2nV_ZcLZx-C1gkrz7UY2WgxlzMNRUjEMAYg80TABoLFuREUNrLS8gqvjnjo8RMrQ77f_2x2pvsBqW1mHJ66zYf1/s1600/1.PNG" /></a></div>
<span style="font-size: large;"><br /></span></div>
<span style="font-size: large;"></span><span style="font-size: large;">When we click on First:-</span><br />
<span style="font-size: large;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZSllmbwFvFG1UEn7ADySqUkOKZlrZ48zNC38JAMA5kWc3w5hqpdGc3xFGQxq9FvhZF-wzizIa84Za0klLvdfiikIwceRir1xGfbd6WUypws6gF7hflU4rigN98TkhxDc29iJGLXimhke_/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="456" data-original-width="524" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZSllmbwFvFG1UEn7ADySqUkOKZlrZ48zNC38JAMA5kWc3w5hqpdGc3xFGQxq9FvhZF-wzizIa84Za0klLvdfiikIwceRir1xGfbd6WUypws6gF7hflU4rigN98TkhxDc29iJGLXimhke_/s1600/2.PNG" /></a></div>
<span style="font-size: large;"><br /></span><span style="font-size: large;">When we click on second</span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;"></span>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: large;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJmRFaryT2nTMZq5v26vyF9elXmhOSJtOi2xGLwz09wA1jqqOkllvBLpJ2rt8EttdGBREcYPvkSYkyqTADW_1I5Pg2rxiF4D3_USvAIXJRyOlDJdjuHunvq4Kc5wITtiVt3fwKd-4sru6A/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="436" data-original-width="517" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJmRFaryT2nTMZq5v26vyF9elXmhOSJtOi2xGLwz09wA1jqqOkllvBLpJ2rt8EttdGBREcYPvkSYkyqTADW_1I5Pg2rxiF4D3_USvAIXJRyOlDJdjuHunvq4Kc5wITtiVt3fwKd-4sru6A/s1600/3.PNG" /></a></span></div>
<br />
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"></span></span>
<span style="font-size: large;"><span style="font-size: large;"><b><u><br /></u></b></span></span><br />
<span style="font-size: large;"><span style="font-size: large;"></span></span><br />
<div>
<span style="font-size: large;">You can download the source code from <a href="https://sourceforge.net/projects/liferay-is-easy/files/Multiple%20ActionURL%20Call%20on%20Click%20of%20Buttons%20in%20Liferay/multisubmit-portlet.rar/download" target="_blank">here</a>.</span><br />
<div>
<br /></div>
<div>
<br /></div>
<b style="font-size: xx-large;">Hope this will Help....</b><br />
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span><br />
<span style="font-size: large;"></span><br />
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<br />
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2017/06/liferay-portlet-url-in-javascript.html" target="_blank">Liferay Portlet URL in JavaScript</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/04/openclose-dialog-box-using-aui-in.html" target="_blank">Dialog Box in Liferay using AUI</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/11/friendly-url-in-liferay.html" target="_blank">FriendlyURL in Liferay</a></span></i><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/10/developing-mvcportlet-with-multiple_5.html" target="_blank"><i>Multiple Render Methods in Liferay</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/06/logger-in-liferay.html" target="_blank"><i>Logger in Liferay</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/10/send-redirect-in-liferay.html" target="_blank"><i>Send Redirect in Liferay</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/09/use-liferay-auto-fields.html" target="_blank">Use Liferay AutoFields</a></i></span><br />
<div>
<span style="font-size: x-large;"><br /></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-71386707435828495842017-10-17T04:07:00.000-07:002017-10-17T04:23:52.436-07:00Upload / Download Files in Liferay <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-size: large;">We already know how to <a href="http://liferayiseasy.blogspot.in/2015/07/folder-and-file-upload-programmatically.html" target="_blank">upload file in document and media</a> portlet. Today we will see how to upload a file in local machine . I created a folder on my desktop with name <b>textdata</b>. When we upload a file it will save in this folder . Here i also check that file must be a text file if you upload a pdf or jpeg it will give error.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">So lets start this Step by Step:-</span><br />
<a name='more'></a><br />
<b><u><span style="font-size: x-large;">Step 1:-Create a project and portlet</span></u></b><br />
<div>
<span style="font-size: large;">Create a project and then create a portlet in it .Here my project name is <b>upload-download-portle</b>t and portlet name is <b>Demo</b>.</span><br />
<span style="font-size: large;"><br /></span>
<br />
<center>
<span style="font-size: large;"><br /></span>
<!-- Between Ad start -->
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Between Code 336*280 -->
<ins class="adsbygoogle" data-ad-client="ca-pub-7156905098737722" data-ad-slot="2849953898" style="display: inline-block; height: 280px; width: 336px;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- Between Ad End -->
</center>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span></div>
<div>
<span style="font-size: large;"></span><br />
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 2:-Change the jsp</span></u></b></span></div>
<span style="font-size: large;">
</span>
<br />
<div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;">Change your view.jsp as:-</span></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>view.jsp</u></b></span></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"><script src="https://gist.github.com/adit2787/6a5e50c1e00094745f5c69eca57111f0.js"></script></span><br /></span></div>
<br />
<b><u><span style="font-size: x-large;">Explanation:-</span></u></b><span style="font-size: large;"><br /></span><span style="font-size: large;"><span style="font-size: large;">Here we create two urls :-</span></span><br />
<span style="font-size: large;"><span style="font-size: large;"><b><u>1)uploadURL</u></b>:- Action URL for upload </span></span><br />
<span style="font-size: large;"><b>2)<u>downloadURL</u></b>:- Resource URL(Ajax) for Download</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Here we also use success and failure messages for <a href="http://liferayiseasy.blogspot.in/2016/08/validation-in-liferay-using-liferay-ui.html" target="_blank">Validation</a>.</span><br />
<span style="font-size: large;"><br /></span>
<br />
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 3:-Change the Controller(Java)</span></u></b></span></div>
<div>
<div style="font-size: medium;">
<span style="font-size: large;">Change the Portlet file as:-</span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>Demo.java</u></b></span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/4315072cc93f66ebcad3b54d3a60ea06.js"></script></span><br /></div>
<div>
<br />
<b><u><span style="font-size: x-large;">Explanation</span>:-</u></b><span style="font-size: large;"><br /></span><span style="font-size: large;">Here i created a folder textData on Desktop where i upload the file. File are save with name hello.txt.</span></div>
<div style="font-size: medium;">
<span style="font-size: large;"><br /></span></div>
<span style="font-size: large;">I used </span><span style="font-size: large;">IOUtils class which belong to commons-io.jar so add this jar in liferay-plugin-package.properties.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtLu5mgmyZThr175jYgQ4tAwwVwq4BmIXZC77BoENfji8N9D9nieeR-8o1vUrW98KcaFE_3KmPhPHJ2UE8ICjhg4yoPDqP3FIFtPshG06gaJM4R0F01zLQU79S6_KXbeGtFB2uw5LytJMp/s1600/liferay-plugin-package.properties.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="431" data-original-width="801" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtLu5mgmyZThr175jYgQ4tAwwVwq4BmIXZC77BoENfji8N9D9nieeR-8o1vUrW98KcaFE_3KmPhPHJ2UE8ICjhg4yoPDqP3FIFtPshG06gaJM4R0F01zLQU79S6_KXbeGtFB2uw5LytJMp/s1600/liferay-plugin-package.properties.PNG" /></a></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<br />
<div style="font-size: medium;">
<span style="font-size: large;"><b><u><span style="font-size: x-large;">Step 4:-Check the output</span></u></b></span></div>
<div>
<div style="font-size: medium;">
<span style="font-size: large;">Now deploy the portlet and check the output:-</span><br />
<b><u><span style="font-size: large;"><br /></span>
</u></b><br />
<span style="font-size: large;"><b><u>1)If you upload a pdf file:-</u></b></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHlGglQ9mm-6VjrPXBzyaXqOQObJJNGR12imFhMN1AW-jJZtAJU6J_iad7bZ5MQz0dOGt27A2qeqYDeDKptQcksh2ro6ouQT1HLayqFlA12AqLJ9qhL1DoerHkLrUtiQECIFIwsRprslHc/s1600/only+text+file.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="373" data-original-width="628" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHlGglQ9mm-6VjrPXBzyaXqOQObJJNGR12imFhMN1AW-jJZtAJU6J_iad7bZ5MQz0dOGt27A2qeqYDeDKptQcksh2ro6ouQT1HLayqFlA12AqLJ9qhL1DoerHkLrUtiQECIFIwsRprslHc/s1600/only+text+file.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="font-size: large; text-align: left;"><b><u>2)If you upload a text file:-</u></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3PZ-QsB4St6h3yUdoC-xKKGSbYVO8qzc1FxikgmUYthUmzNw577PZk0fnVbPMhOfknoZsYnJZlsLRqNG1zATL81CfqpH-ue6gG4kVN_SC9ko4HvGGOkilteftq50UBI8tL7_Z1U3TRLNX/s1600/success.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="352" data-original-width="628" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3PZ-QsB4St6h3yUdoC-xKKGSbYVO8qzc1FxikgmUYthUmzNw577PZk0fnVbPMhOfknoZsYnJZlsLRqNG1zATL81CfqpH-ue6gG4kVN_SC9ko4HvGGOkilteftq50UBI8tL7_Z1U3TRLNX/s1600/success.PNG" /></a></div>
<span style="font-size: large;"><br /></span></div>
</div>
<span style="font-size: large;"></span>
<span style="font-size: large;"><span id="goog_1092966120"></span><span id="goog_1092966121"></span><br /></span>
<br />
<span style="font-size: large;">You can download the source code from <a href="https://sourceforge.net/projects/liferay-is-easy/files/Upload%20and%20Download%20File%20in%20Liferay/uplaod-download-portlet.rar/download" target="_blank">here</a>.</span><br />
<div>
<br /></div>
<div>
<br /></div>
<b style="font-size: xx-large;">Hope this will Help....</b><br />
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span><br />
<span style="font-size: large;"></span><br />
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<br />
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/basic-web-content-in-liferay.html">Basic web content in Liferay</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/categorization-in-web-content.html">Categorization in web content</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/structure-and-templates-for-web-content.html">Structure and Template in Web Content</a></span></i><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/fetchretrieve-web-content-by-providing.html"><i>Fetch Web Content Programmatically</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/get-web-contentjournal-article-fields.html"><i>Get Journal Article Using SAX Parser</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/09/embedding-web-contentjournal-article-in.html" target="_blank"><i>Embedding a Web Content in a Portlet</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/05/fetch-latest-version-journal-article-or.html">Fetch Latest Version Journal Article or Web Content in Liferay</a></i></span></div>
</div>
</div>
<span style="font-size: large;"></span><br />
<div style="font-size: medium;">
<span style="font-size: large;"><span style="font-size: large;"></span></span></div>
</div>
<span style="font-size: large;">
</span></div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-79152952777405002422017-09-30T22:18:00.000-07:002017-09-30T22:26:18.728-07:00Search Form with Search Container in Liferay<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-size: large;">In the previous tutorial on <a href="http://liferayiseasy.blogspot.in/2017/09/liferay-search-form-with-search.html" target="_blank">Liferay Search Form with Search Container</a> we see how we can search data from a search container. We override DisplayTerm and Search Container classes. Today we will create the same thing but in a simple way. Before reading this blog it is highly recommended to read my previous blog on </span><span style="font-size: large;"> </span><a href="http://liferayiseasy.blogspot.in/2017/09/liferay-search-form-with-search.html" style="font-size: large;" target="_blank">Liferay Search Form with Search Container</a>.<br />
<br />
<a name='more'></a><br />
<span style="font-size: large;">I already created my Services using <a href="http://liferayiseasy.blogspot.in/2015/10/service-builder-in-liferay.html" target="_blank">Service Builder</a>. Here is my service.xml:-</span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;"></span>
<br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/b770a6d52e8fdf55c6230f9aac7e194f.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">I fill some data in Database:-</span><br />
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2dfboMHnveb0bmOyWnbHvBdrIEREHqyeRRnLVvUQqof2g__-eCdXH5OPEruPDnYv5YYIYvoFhCYhVJB5LLe3B3ZCJ3xKTUyiYaiTwdCiRoh60jofvj0h7aKBhWLj2FeXOxK2xVjbQWxjs/s1600/DBdata.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="440" data-original-width="577" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2dfboMHnveb0bmOyWnbHvBdrIEREHqyeRRnLVvUQqof2g__-eCdXH5OPEruPDnYv5YYIYvoFhCYhVJB5LLe3B3ZCJ3xKTUyiYaiTwdCiRoh60jofvj0h7aKBhWLj2FeXOxK2xVjbQWxjs/s1600/DBdata.PNG" /></a></div>
<span style="font-size: large;"><br /></span><span style="font-size: large;">Today we apply Searching on these records on the basis of eId and eName.</span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;"><br /></span><br />
<center>
<ins class="adsbygoogle" data-ad-client="ca-pub-7156905098737722" data-ad-slot="2849953898" style="display: inline-block; height: 280px; width: 336px;"></ins></center>
<span style="font-size: large;"><br /></span>
<b><u><span style="font-size: x-large;">Project Structure</span></u></b><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrMK8lOZvFGnkP2ggVxtYYzk5J6-QACP7nCctYNyH80HUW_KFj4RManlys9fho2IveVJRfMRlk2tmV1hY_118NUJRR4p5ygW0uR7SOj2dJKOSdLJtknideQzTbeXFpbozvrmVIwH4S7kHc/s1600/Liferay+Project+Structure.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="376" data-original-width="545" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrMK8lOZvFGnkP2ggVxtYYzk5J6-QACP7nCctYNyH80HUW_KFj4RManlys9fho2IveVJRfMRlk2tmV1hY_118NUJRR4p5ygW0uR7SOj2dJKOSdLJtknideQzTbeXFpbozvrmVIwH4S7kHc/s1600/Liferay+Project+Structure.PNG" /></a></div>
<br />
<br />
<span style="font-size: large;">So lets Start this step by step:-</span><br />
<span style="font-size: large;"><br /></span>
<b><u><span style="font-size: x-large;">Step 1:-Create init.jsp</span></u></b><br />
<div>
<span style="font-size: large;">First we create a init.jsp that contain all the imports:-</span><br />
<span style="font-size: large;"><b><u><br /></u></b></span><span style="font-size: large;"><b><u>init.jsp</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/0a06d08c5771c9c6bf9e94cee1be63d3.js"></script></span><br />
<span style="font-size: large;"><br /></span> <span style="font-size: large;"><br /></span>
<b><u><span style="font-size: x-large;">Step 2:-Create view.jsp</span></u></b><br />
<div>
<span style="font-size: large;">Now create view.jsp which contain our </span><a href="http://liferayiseasy.blogspot.in/2015/01/liferay-search-container-in-detail.html" style="font-size: large;" target="_blank">Search Container</a> <span style="font-size: large;">and search box:-</span><br />
<span style="font-size: large;"><br /></span>
<b style="font-size: large;"><u>view.jsp</u></b></div>
<span style="font-size: large;"></span>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/262d980dd62e105b5f3239e6a5525077.js"></script></span>
<span style="font-size: large;"><br /></span>
<span style="font-size: x-large;"><b><u>Explanation</u></b>:-</span><br />
<span style="font-size: large;">Here we use a simple search container which is enclosed in a aui form.For results we call methods on 3 conditions:-</span><br />
<span style="font-size: large;">1)For Advance Search</span><br />
<span style="font-size: large;">2)For Basic Search</span><br />
<span style="font-size: large;">3)For Dafault data we load all the employees.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Iterator URL is very important for pagination . If you are not using this then after search it will always redirect to first page.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Here we include a search.jsp which contain our advance search fields.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>search.jsp</u></b></span>
<span style="font-size: large;"><br /><script src="https://gist.github.com/adit2787/c6fe726bfe92363564b229c140f03ea2.js"></script></span>
<b><u><span style="font-size: x-large;"><br /></span></u></b><br />
<b><u><span style="font-size: x-large;">Step 3:-Create Helper Class</span></u></b><br />
<div>
<span style="font-size: large;">In view.jsp we use EmployeeHelper class to load the data.In EmployeeHelper we use <a href="http://liferayiseasy.blogspot.in/2016/02/dynamic-query-in-liferay.html" target="_blank">dynamic query</a> and <a href="http://liferayiseasy.blogspot.in/2016/02/conjunctionand-vs-disjunctionor-clause.html" target="_blank">Conjunction , Disjunction</a> on the basis of various scenarios like For Normal Search we use Keywords ,for Advance Search ALL operation we use Conjunction , for Advance Search ANY operation we use Disjunction etc.</span><br />
<span style="font-size: large;"><br /></span><b><u><span style="font-size: large;">EmployeeHelper.java</span></u></b></div>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/ae6346f618207eec6b2ed51c488d2642.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Now Deploy the portlet and check the output</span><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<span style="font-size: large;"><ins class="adsbygoogle" data-ad-client="ca-pub-7156905098737722" data-ad-slot="7922232696" style="display: inline-block; height: 100px; width: 580px;"></ins></span><br />
<span style="font-size: large;"><br /></span><span style="font-size: large;"><br /></span><b><u><span style="font-size: x-large;">Output:-</span></u></b><br />
<br />
<b><u><span style="font-size: x-large;">1)Normal Search</span></u></b><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy8vx3g5ng-fqzX4H40MzgAOQcGEvYvQsEBkg98MDInTmm30nSPurXvXrPKiImfUEEIpKrIgYW9_W3BvKYKwny07AtyysBBv8LAH4-GKOv0ooO34-trOE7QQaH_cm_j1xAQebWXP1hze71/s1600/NormalSearch.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="619" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy8vx3g5ng-fqzX4H40MzgAOQcGEvYvQsEBkg98MDInTmm30nSPurXvXrPKiImfUEEIpKrIgYW9_W3BvKYKwny07AtyysBBv8LAH4-GKOv0ooO34-trOE7QQaH_cm_j1xAQebWXP1hze71/s1600/NormalSearch.PNG" /></a></div>
<b><u><span style="font-size: x-large;"><br /></span></u></b><b><u><span style="font-size: x-large;">2)Advance Search</span></u></b><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiSF-FNY9OnM6q-v0riTv8GCPRcvBGnDvAp74gn2GfvEF1uly3OhmRCNA-EgPYmpjWFhoV8PKdly_X9lBHSsquDHGZYu49eGAGEx-cHkhk8MgEjMQOZIXW63Gz9nrspP-OzzhlcHfPHiB6/s1600/AdvanceSearch.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="482" data-original-width="612" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiSF-FNY9OnM6q-v0riTv8GCPRcvBGnDvAp74gn2GfvEF1uly3OhmRCNA-EgPYmpjWFhoV8PKdly_X9lBHSsquDHGZYu49eGAGEx-cHkhk8MgEjMQOZIXW63Gz9nrspP-OzzhlcHfPHiB6/s1600/AdvanceSearch.PNG" /></a></div>
<b><u><span style="font-size: x-large;"><br /></span></u></b><span style="font-size: large;">You can download the source code from <a href="https://sourceforge.net/projects/liferay-is-easy/files/Search%20Form%20with%20Search%20Container%20in%20Liferay/testportlet-portlet.rar/download" target="_blank">here</a>.</span><br />
<div>
<br /></div>
<div>
<br /></div>
<b style="font-size: xx-large;">Hope this will Help....</b><br />
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span><br />
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<br />
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/basic-web-content-in-liferay.html">Basic web content in Liferay</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/categorization-in-web-content.html">Categorization in web content</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/structure-and-templates-for-web-content.html">Structure and Template in Web Content</a></span></i><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/fetchretrieve-web-content-by-providing.html"><i>Fetch Web Content Programmatically</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/get-web-contentjournal-article-fields.html"><i>Get Journal Article Using SAX Parser</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/09/embedding-web-contentjournal-article-in.html" target="_blank"><i>Embedding a Web Content in a Portlet</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/05/fetch-latest-version-journal-article-or.html">Fetch Latest Version Journal Article or Web Content in Liferay</a></i></span></div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com0tag:blogger.com,1999:blog-9166901467995726431.post-3126804484938564372017-09-23T23:51:00.000-07:002017-09-30T22:20:44.450-07:00Liferay Search Form with Search Container<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-size: large;">We already know how to use <a href="http://liferayiseasy.blogspot.in/2015/01/liferay-search-container-in-detail.html" target="_blank">Search Container</a> in Liferay</span><span style="font-size: large;">. Today we will create a search form that can search values from search container. For this we use <liferay-ui:search-form> tag. By using this we can apply basic as well as advance search.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Liferay use this in many places like when you go to web content section (Admin->Content)</span><br />
<a name='more'></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEw49FCbhGAIq01ExsuJK7BvhfweQFkJ20bvXoRdMbZM_OhjGJuRNt9-0iN54K4Bs4A5QvAMu6oQ7Q1yqSWI08P_VjZBlixlHJZCFIVTTaB51LSPmJxmyLmyJuEY925w0OOqxYLWsor7GI/s1600/Webcontent.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="186" data-original-width="1019" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEw49FCbhGAIq01ExsuJK7BvhfweQFkJ20bvXoRdMbZM_OhjGJuRNt9-0iN54K4Bs4A5QvAMu6oQ7Q1yqSWI08P_VjZBlixlHJZCFIVTTaB51LSPmJxmyLmyJuEY925w0OOqxYLWsor7GI/s1600/Webcontent.PNG" /></a></div>
<br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Here you can search web content by name and when you click Gear icon you can search by id, name etc. You can also apply All(AND) and ANY(OR) operations.</span><br />
<br />
<span style="font-size: large;">I already created my Services using <a href="http://liferayiseasy.blogspot.in/2015/10/service-builder-in-liferay.html" target="_blank">Service Builder</a>. Here is my service.xml:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/b770a6d52e8fdf55c6230f9aac7e194f.js"></script></span><br />
<br />
<span style="font-size: large;">I fill some data in Database:-</span><br />
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2dfboMHnveb0bmOyWnbHvBdrIEREHqyeRRnLVvUQqof2g__-eCdXH5OPEruPDnYv5YYIYvoFhCYhVJB5LLe3B3ZCJ3xKTUyiYaiTwdCiRoh60jofvj0h7aKBhWLj2FeXOxK2xVjbQWxjs/s1600/DBdata.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="440" data-original-width="577" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2dfboMHnveb0bmOyWnbHvBdrIEREHqyeRRnLVvUQqof2g__-eCdXH5OPEruPDnYv5YYIYvoFhCYhVJB5LLe3B3ZCJ3xKTUyiYaiTwdCiRoh60jofvj0h7aKBhWLj2FeXOxK2xVjbQWxjs/s1600/DBdata.PNG" /></a></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Today we apply Searching on these records on the basis of eId and eName.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<br />
<center>
<!-- Between Ad start -->
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Between Code 336*280 -->
<ins class="adsbygoogle" data-ad-client="ca-pub-7156905098737722" data-ad-slot="2849953898" style="display: inline-block; height: 280px; width: 336px;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- Between Ad End -->
</center>
<span style="font-size: large;"><br /></span>
<br />
<b><u><span style="font-size: x-large;">Project Structure</span></u></b><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD8C1oUKAezEzdCxSmQ1mFN1E_doenKBVz7bhHFdQNI9HrlDdoeX9NgAF-0B3w7I6L_p2J2eeEkqYK3JMUz88ZFMi-bobH5EYezSsJRtAi4CMs3vXMwJTlSjQX-bj0evUvKsQnoZ7bp-Lc/s1600/Project+Structure.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="424" data-original-width="544" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD8C1oUKAezEzdCxSmQ1mFN1E_doenKBVz7bhHFdQNI9HrlDdoeX9NgAF-0B3w7I6L_p2J2eeEkqYK3JMUz88ZFMi-bobH5EYezSsJRtAi4CMs3vXMwJTlSjQX-bj0evUvKsQnoZ7bp-Lc/s1600/Project+Structure.PNG" /></a></div>
<br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">So lets start this Step by Step:-</span><br />
<br />
<b><u><span style="font-size: x-large;">Step 1:-Create init.jsp</span></u></b><br />
<div>
<span style="font-size: large;">First we create a init.jsp that contain all the imports:-</span><br />
<span style="font-size: large;"><b><u><br /></u></b></span>
<span style="font-size: large;"><b><u>init.jsp</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/e39ad4fb690d94444d4941099a8bf1be.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Now as you can see in init.jsp we use two java classes EmployeeSearchContainer and EmployeeDisplayTerms. Now we create these two classes.</span><br />
<span style="font-size: large;"><br /></span>
<b><u><span style="font-size: x-large;">Step 2:-Create EmployeeSearchContainer.java</span></u></b><br />
<div>
<span style="font-size: large;">Now we create </span><span style="font-size: large;">EmployeeSearchContainer</span><span style="font-size: large;"> that extends SearchContainer in this class we can set properties like empty result message and default records per page(DELTA).</span><br />
<span style="font-size: large;"><br /></span>
<b><u><span style="font-size: large;">EmployeeSearchContainer.java</span></u></b></div>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/08ec851934c67da00d693c5b0cbd598e.js"></script></span><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<b><u><span style="font-size: x-large;">Step 3:-Create EmployeeDisplayTerms.java</span></u></b><br />
<div>
<span style="font-size: large;">This class extends DisplayTerms .We want searching on the basis of eId and eName so we create getter and setter for both. This class also gives us important methods like isAdvancedSearch() , isAndOperator() etc.</span></div>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b style="font-size: medium;"><u><span style="font-size: large;">EmployeeDisplayTerms.java</span></u></b></span><span style="font-size: large;"><br /></span>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/d2b36cb7cf22779ec94cd44ef6b11f7f.js"></script> </span>
<span style="font-size: large;"><br /></span> <span style="font-size: large;"><br /></span><br />
<b><u><span style="font-size: x-large;">Step 4:-Create view.jsp</span></u></b><br />
<div>
<span style="font-size: large;">We already discuss about <a href="http://liferayiseasy.blogspot.in/2015/01/liferay-search-container-in-detail.html" target="_blank">Search container</a> in Liferay. Here we apply searching in this:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>view.jsp</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/4e7c8a102ce853a9c5bca8bd9cc23453.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: medium;"><b><u><span style="font-size: x-large;">Explanation</span></u></b><span style="font-size: large;">:-</span></span></div>
<span style="font-size: large;">In this we use liferay-ui:search-form tag that include search.jsp which contain two fields eId and eName:-</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b><u>search.jsp</u></b></span><br />
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/c6616106f83912e7c6af0a0c83e21a3b.js"></script>
</span>
<span style="font-size: large;"><br /></span>
<b><u><span style="font-size: x-large;"><br /></span></u></b><br />
<b><u><span style="font-size: x-large;">Step 5:-Create Helper Class</span></u></b><br />
<div>
<span style="font-size: large;">In view.jsp we use EmployeeHelper class to load the data.In EmployeeHelper we use <a href="http://liferayiseasy.blogspot.in/2016/02/dynamic-query-in-liferay.html" target="_blank">dynamic query</a> and <a href="http://liferayiseasy.blogspot.in/2016/02/conjunctionand-vs-disjunctionor-clause.html" target="_blank">Conjunction , Disjunction</a> on the basis of various scenarios like For Normal Search we use Keywords ,for Advance Search ALL operation we use Conjunction , for Advance Search ANY operation we use Disjunction etc.</span><br />
<span style="font-size: large;"><br /></span>
<b><u><span style="font-size: large;">EmployeeHelper.java</span></u></b></div>
<span style="font-size: large;"><script src="https://gist.github.com/adit2787/b92cae9381a412cfd0f8c0597de7ffa0.js"></script></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Now Deploy the portlet and check the output</span><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<!-- responsive 4th Ad start -->
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 4th custom 580x100 -->
<br />
<ins class="adsbygoogle" data-ad-client="ca-pub-7156905098737722" data-ad-slot="7922232696" style="display: inline-block; height: 100px; width: 580px;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- responsive 4th ads ends-->
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<b><u><span style="font-size: x-large;">Output:-</span></u></b><br />
<br />
<b><u><span style="font-size: x-large;">1)Normal Search</span></u></b><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy8vx3g5ng-fqzX4H40MzgAOQcGEvYvQsEBkg98MDInTmm30nSPurXvXrPKiImfUEEIpKrIgYW9_W3BvKYKwny07AtyysBBv8LAH4-GKOv0ooO34-trOE7QQaH_cm_j1xAQebWXP1hze71/s1600/NormalSearch.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="619" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy8vx3g5ng-fqzX4H40MzgAOQcGEvYvQsEBkg98MDInTmm30nSPurXvXrPKiImfUEEIpKrIgYW9_W3BvKYKwny07AtyysBBv8LAH4-GKOv0ooO34-trOE7QQaH_cm_j1xAQebWXP1hze71/s1600/NormalSearch.PNG" /></a></div>
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<b><u><span style="font-size: x-large;">2)Advance Search</span></u></b><br />
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiSF-FNY9OnM6q-v0riTv8GCPRcvBGnDvAp74gn2GfvEF1uly3OhmRCNA-EgPYmpjWFhoV8PKdly_X9lBHSsquDHGZYu49eGAGEx-cHkhk8MgEjMQOZIXW63Gz9nrspP-OzzhlcHfPHiB6/s1600/AdvanceSearch.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="482" data-original-width="612" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiSF-FNY9OnM6q-v0riTv8GCPRcvBGnDvAp74gn2GfvEF1uly3OhmRCNA-EgPYmpjWFhoV8PKdly_X9lBHSsquDHGZYu49eGAGEx-cHkhk8MgEjMQOZIXW63Gz9nrspP-OzzhlcHfPHiB6/s1600/AdvanceSearch.PNG" /></a></div>
<b><u><span style="font-size: x-large;"><br /></span></u></b>
<span style="font-size: large;">You can download the source code from <a href="https://sourceforge.net/projects/liferay-is-easy/files/Liferay%20Search%20Form%20With%20Search%20Container/testportlet-portlet.rar/download" target="_blank">here</a>.</span><br />
<div>
<br />
<span style="font-size: large;">In the next blog we create <a href="http://liferayiseasy.blogspot.in/2017/09/search-form-with-search-container-in.html" target="_blank">Search Form With Search Container</a> but in a simple way.</span></div>
<div>
<br /></div>
<b style="font-size: xx-large;">Hope this will Help....</b><br />
<b style="font-size: xx-large;"><br /></b><span style="color: #c4a549; font-family: "lora" , serif; font-size: x-large; line-height: 22px;"><u><i><b>Related Post:-</b></i></u></span><br />
<div style="font-family: "times new roman"; line-height: normal;">
<div style="margin: 0px;">
<br />
<i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/basic-web-content-in-liferay.html">Basic web content in Liferay</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/categorization-in-web-content.html">Categorization in web content</a></span></i><br />
<i><br /></i><i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/structure-and-templates-for-web-content.html">Structure and Template in Web Content</a></span></i><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/fetchretrieve-web-content-by-providing.html"><i>Fetch Web Content Programmatically</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/08/get-web-contentjournal-article-fields.html"><i>Get Journal Article Using SAX Parser</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2015/03/form-submission-in-spring-mvc-portlet.html"><i>Form Handling in Spring Portlet</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><a href="http://liferayiseasy.blogspot.in/2016/09/embedding-web-contentjournal-article-in.html" target="_blank"><i>Embedding a Web Content in a Portlet</i></a></span><br />
<i><br /></i><span style="font-size: x-large;"><i><a href="http://liferayiseasy.blogspot.in/2017/05/fetch-latest-version-journal-article-or.html">Fetch Latest Version Journal Article or Web Content in Liferay</a></i></span><br />
<div>
<span style="font-size: x-large;"><br /></span></div>
<div>
</div>
</div>
</div>
</div>
</div>
Adityahttp://www.blogger.com/profile/06877429720075168788noreply@blogger.com1