Posts

Showing posts with the label language

Get Text from language properties via javascript

We know that we can get the text from the properties as   Language.properties     you-have-processed-sucessfully = Your Request processed successfully.   JSP: <liferay-ui : message key = "you-have-processed-sucessfully" /> CLASS: LanguageUtil . get ( pageContext , " you-have-processed-sucessfully " ); But if want to retrieve via javascript , Here is the one <script>      <custom code> ---               ----     Liferay . Language . get ( ' you-have-processed-sucessfully ' ); </script> But this Liferay.Language will get from the Portal properties not from the portlet properties There is way to solve this problem writing Hook and specifing the properties.

Adding Page Template in liferay Programmatically

We know that we can create the page template from the control panel, What if we want to create programmatically. So here we go, 1. We are reterving the page template name form the portlet.properties. If you want to know how to create the portlet.properties and retrieve follow the below link. http://liferaytutorial.blogspot.in/2013/03/how-to-read-values-from-properties-file.html So here i am retrieving the page template name as page.template from portlet.properties file. String pageTemplateNames = PortletProps.get("page.template"); In Portlet. properties page.template = Home,Test Before adding the page template we are checking weather page template exists or not by dynamicQuery , because we don't have any finder method to check the page template by name. Here i am checking by descrition beacause name will be storing as JSON format in DB. List<LayoutPrototype> layoutProtoTypeList = null; DynamicQuery dynamicQuery = DynamicQueryFactoryUti...

Adding Site Template Programmatically

We know that we can create the site template from the control panel, What if we want to create programmatically. So here we go, 1. We are reterving the site template name form the portlet.properties. If you want to know how to create the portlet.properties and reterive follow the below link. http://liferaytutorial.blogspot.in/2013/03/how-to-read-values-from-properties-file.html So here i am reterving the site name as  site.template from portlet.properties file. String siteTemplateNames = PortletProps.get("site.template"); In portlet.properties site.template = SiteTemplate1 , SiteTemplate2 Before adding the site template we are checking weather site template exists for not by dynamicQuery , because we don't have any finder method to check the site template by name. Here i am checking by descrition beacause name will be storing as JSON format in DB. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(LayoutSetPrototype.class); dynamicQuery....