Laliwala IT Services

Laliwala IT Services
Website Development

Thursday, February 24, 2011

jQuery Layout integration, jquery.layout.js, javascript, property files, liferay source code, liferay developing plugins, liferay porblem solution



Michael Poznecki : Hello all,





I have built an HTML page using the jQuery Layout. I needed two panes that I can resize. You can see the demo and the code of what I used here:








http://layout.jquery-dev.net/demos/simple.html]








Once it was working the way I needed, I started to port it into a portlet. But when I run it, my jquery.layout.js does not seem to work right.








Has anyone ever used this layout.js? It does not work for some reason.








It might have something to do with the fact that the jquery.layout.js uses the "$" instead of "jQuery" but when I tried to replace them it still does not work.








Has anyone used the jquery.layout.js before? Can someone please help me get this working?








I have attached the files to make it easier to look at.








Thanks so much.








Michael

Attachments






Mazhar Anwar : Hi Micheal,








If you are developing your portlet in ext environment you need to add your jquery-layout.js file into Liferay's jquery framework, and need to update javascript.barebone.files property in portal-ext.properties. For more reference you can see portal.properties in liferay's source code.








And If you are developing in plugins environment, you can put your .js file under any folder and you need to add javascript manually in you jsp.






Michael Poznecki : Please re-read my question.






Hui Deng : Hi Micheal,








I have the same issue as yours, I want to use jquery.layout in liferay too. I have tried it for long time, but I was failed. Have you solved this problem?

Using Locale Language, liferay language portlet, liferay applictions, liferay module, liferay glassfish, liferay webspace, liferay portlet language





































































































































































































Rajesh Babu : Hi,










i had added the language hi_IN in the portal succesfully. In the language portlet, it is showing as hindi(india). now i have 2 modify it to hindi only.








i.e., hindi(india) ---- hindi








i had modified in the view.jsp of the language portlet in the path








\webspace\glassfish2\domains\domain1\applications\j2ee-modules\webspace\html\portlet\language








but it is not modifying.








if u know the achieve it, then plz xplain me 2.






Mazhar Anwar : Hi Rajesh,








There are 3 steps to achieve it.








1) You have to add one more locale in portal-ext.properties.





Please the check the following property in portal.properties of Liferay source.








You need to override locales and add hi_IN for Hindi and India.








2) Add a hi_IN.png image of our flag in your theme folder /images/language folder.








3) Create Language_hi.properties and Language_hi.properties.native in ext-impl/src/content folder.

How Listing children of current page with there URLs, Layout liferay, theme solution, theme.runtime, string liferay, liferay contain, page manages




























































































































































































































































































































































































































































































































































































Al-Mothafar Al-Hasan : Hi





How can I list children of page that visitor inside it , I mean the visitor must see the children of current page he view it








I wrote a vm code for that , but it just listing names without URLs , because .getURL() does not work ...








liferay url tutorial, liferay theme tutorial, liferay admin tutorial








$nav_child.getURL() does not work , it because $layout.getChildren return a list of LayoutImpl not NavItem , how I can do what I want by another way .. !!!






Mazhar Anwar : Hi Mothafar,








liferay page tutorial, liferay string tutorial, liferay iceface tutorial








Please try this code, it will work.






Al-Mothafar Al-Hasan : Thank you very much !





It's work.








emoticon

I'm very thankful






Al-Mothafar Al-Hasan : I have a new problem , its listing the child name for another languages too at the same time , how to solve this ?






Mazhar Anwar : Replace the













Hope this will work...emoticon






Al-Mothafar Al-Hasan :


Thank you very much emoticon , BUT what about private pages , I mean if you have a page that hidden or user have not permission to see this page , this is hard , i trying to find the solution emoticon






Al-Mothafar Al-Hasan : Now I need the solution of this , I used the $theme.runtime("71") to load navigation portlet in my theme , but its does not working it community !








Its retrieve empty in portlet for displayStyle = 6 , I need to be displayStyle = 1 , I was make a JSP hook and made this change to init.jsp








its work well and show me the navigation portlet in guest community , but in another its empty except String displayStyle = "6"; But i don't need this style ,








Anyway the alternative is this way, I mean the code that I wrote it here in this post , but there is 2 problems the language and I think it's solving with ($local) , and the another is the permission !








I need the solution of the permission problem OR the solution of navigation portlet , why displayStyle = "1"; not working in community pages..








Note : sorry for my English emoticon






Archi Madhu : Hi there,





You can use following methods of LayoutLocalServiceUtil.java





you can get public pages using








public static java.util.List<com.liferay.portal.model.Layout> getLayouts(

long groupId, boolean privateLayout, long parentLayoutId)








where groupid and plid you can get it from themeDisplay object.and pass privateLayout=false

and private pages








public static java.util.List<com.liferay.portal.model.Layout> getLayouts(

long groupId, boolean privateLayout, long parentLayoutId)








where groupid and plid you can get it from themeDisplay object.and pass privateLayout=true








and make a combined list of both of them and iterate it.








I haven't tried this but you can give a try.








Let me know if you need more clarification.

HTH!






Al-Mothafar Al-Hasan : Thank you for your hints





Actually i trying to use permission checker ($permissionChecker.contains() usong PortletPermissionUtil) but sometimes return errors and liferay stop too or not work and liferay working but show my sentence as a normal string








may this way was stupid , but I'm newbie in liferay and its just newbie tries emoticon






Archi Madhu : Why you are using PermisionChecker here?





seems it irrelevant






Al-Mothafar Al-Hasan : Why irrelevant !!!!!





I think when you go to page manages and select your page that you want to edit permission of it , and click permission button and disable view and others from community and enable it for others , the first thing you will thinking about it in theme is PermissionChecker !








I think !








i don't know , I feel it is relevant!

about the serverResource() method, mazhar anwar, servlet, respons, tomcat, spring, liferay?






























































Alaa Hendi : Hi all








i am using the serveResource() method to generate a pdf reports








should i have close the OutputStream there? or leave it to the the Liferay?





Thnx






Mazhar Anwar : No need to close if you are using ServletResponseUtil for sending the generated pdf.

Unable to upload with liferay, apache, liferay installe, java, jsp, java class, instructions, server, tomcat, action, upload portlet, servlet, liferay

giuseppe rossi :


Hello, I create a portlet, which simply took a file from the client, it loads on the server (where liferay, the latest version with tomcat, is installed) and saves it in a specific path. I used "apache commons upload" but it seems not to work, even though I followed the step by step the instructions (the JSP / HTML part and the Java class), but when I go to upload, it doesn't save the file on disk.








Any suggestions?








Thanks






Mazhar Anwar : You can easily upload a file on server.





Please make sure you have set form encType to 'multipart/form-data' in your jsp.








And then you can use "UploadPortletRequest" as in portal source "com.liferay.portlet.documentlibrary.action.EditFileEntryAction.java" for uploading the file on server.








No need to use apache commons uploads.








HTH.








Regards,

Mazhar






giuseppe rossi : Thanks for your answer. First I have already set encType. Then, do you mean this class?? http://docs.huihoo.com/javadoc/liferay/4.2/util-java/com/liferay/util/servlet/UploadPortletRequest.html








Because I can't understand how can I use that in a java class!






Mazhar Anwar : hmm, please find the sample code. You can pass ActionRequest/ResourceRequest/RenderRequest objects to the method.








liferay upload tutorial, liferay apache tutorial, liferay tomcat tutorial, liferay installation tutorial








PARAMETER_FILENAME is the name of your input tag for fileUplaod in jsp.






Mazhar Anwar : Package path for UploadPortletRequest is com.liferay.portal.kernel.upload.UploadPortletRequest emoticon






giuseppe rossi : it works...thanks ;)

installe theme, liferay recommend, glassfish solution, theme solution, solaris, cluster, deploy clustering, liferay clustering, deploy lr, liferay ver

Al-Mothafar Al-Hasan : Hi





I have this strange problem , its work and get XML and contents ,





liferay theme installe tutorial, liferay glassfish tutorial, glassfish solution, glassfish tutorial





BUT slow liferay down , and log file filled with megabytes with these lines





in glassfish server log :





alfresco tutorial, theme integration tutorial, theme developer tutorial, liferay theme developer tutorial, tutorial theme liferay








in NetBeans console (with tomcat 6.0) :





glassfish tutorial, liferay training tutorial, liferay book tutorial, liferay development tutorial








What the problem , Its work BUT with bad performance ...





And i have a another 5 structures called as the same as previous with EVENTS_STRUCTURE !





Please i want to solve it ASAP...





Note: My liferay 5.2.3 emoticon






Al-Mothafar Al-Hasan : Is there something not clear in my post?






Mazhar Anwar : Hi Mothafar,





Are you getting xml?








Are you getting xml?





Please let me know what's your requirement by reading content as xml in theme? I think you will again need to parse the xml in theme which is obviously going to create performace issues.








Wassalam,

Mazhar






Al-Mothafar Al-Hasan : Yes , I getting XML and 3 records , and I can call it from theme and show content , everything work , BUT this warning logged!





Just i want what is invalid ?








i tried this "http://localhost:9090/c/journal/get_articles?&structureId=EVENTS_STRUCTURE" lonely and I got XML and this warn logged again !!!!!








is there parameter missed or what ???






Mazhar Anwar : URL and Parameters are right only, m exactly not sure for the Warning...emoticonemoticon






Al-Mothafar Al-Hasan :


Really I don't know what the problem , every parameter works well , and effective if values changed , and I getting XML and so I can get the content , what the problem !!, I don't know, I'm Installed the theme it on different liferays & PCs with 3 tomcat 6 and 1 glassfish 2.0 , the warning logged and logged , I think I can disable log this from log levels in the control panel , but I'm not recommend that & I must found the solution of this problem !






Younis Alomoush : Dear Mazhar,





I am calling saxReaderUtil from within the theme. and I noticed that when I refresh the page many times the server hang and it needs restart. does it related to calling the saxReaderUtil from within the theme?








btw, I am using LR 5.2.3 with Glassfih 2.1.1 under Solaris 10.






Minhchau Dang : Replace ?& with ?






Al-Mothafar Al-Hasan : WOOOOOOOOOOOOOOOOW emoticon





What this mistake error that I made. emoticon





I feel I am an idiot emoticon








My team leader will kill me emoticon LOOOOOOOL





Thank you very much emoticon











Just I have a question , about problem , is this problem may cause any problem with glassfish v2.1 (last version) , I mean, I have a hangs in glassfish instances (when I deploy LR standalone) or in cluster instances (with clustering of LR) this happened when I hold my finger on F5 button for a few seconds. I test to remove this code and I then holding F5 again but hang did not happen, I traced the problem and I found this line that made this warning cause a hang...

Setting up Extention environement, dynamic servlet config, location, phpportlet, tomcat server, app.server, tomcat liferay, java liferay tomacat, dir

Sanghamitra Mitra : Hi ,








While setting up the ext environment for development








as per the instruction @ http://www.liferay.com/community/wiki/-/wiki/Main/Development+Environment+%28Windows%29








I got the following error while deploying








E:\SM\liferay\portal\build.xml:331: The following error occurred while executing

this line:








E:\SM\liferay\portal\build-common-java.xml:100: Failed to copy E:\SM\liferay\por

tal\portal-kernel\portal-kernel.jar to E:\SM\liferay\portal\SMliferay omcat\co

mmon\lib\ext\portal-kernel.jar due to failed to create the parent directory for

E:\SM\liferay\portal\SMliferay omcat\common\lib\ext\portal-kernel.jar








The directory to





E:\SM\liferay\portal\SMliferay omcat\common\lib\ext\ does not exist on my machine.








I believe I have missed to set the right directory in some of the property file , but not able to find out where (which file )to recify the same.








Can any body help me.








Sharing the following for reference.





1. Snapshot of my directory structure


2. release.mitrasag.properties (which lies in the portal directory )


3. app.server.mitrasag.properties ( which lies in the ext directory )








Thanks in advance.

Sanghamitra






Attachments:






Mazhar Anwar : Hi, you have to point to parent directory of your tomcat server, not java, "app.server.parent.dir=E:/SM/liferay"








Please find the attached properties file as per your image.









Attachments:






Sanghamitra Mitra : Hi





Many thanks .. I could solve the problem with your input.








But now getting the following error :





[javac] E:\SM\liferay\portal\util-





bridges\src\com\liferay\util\bridges\wai\WAIPortlet.java:30: cannot find





symbol


[javac] symbol : class HttpUtil





[javac] location: package com.liferay.util





[javac] import com.liferay.util.HttpUtil;

[javac] ^





[javac] E:\SM\liferay\portal\util-





bridges\src\com\liferay\util\bridges\php\PHPPortlet.java:141: cannot find





symbol





[javac] symbol : class DynamicServletConfig





[javac] location: class com.liferay.util.bridges.php.PHPPortlet





[javac] config = new DynamicServletConfig





(config, params);





[javac] ^





[javac] E:\SM\liferay\portal\util-





bridges\src\com\liferay\util\bridges\wai\WAIPortlet.java:134: cannot find





symbol





[javac] symbol : variable HttpUtil





[javac] location: class com.liferay.util.bridges.wai.WAIPortlet





[javac] String queryString = HttpUtil.parameterMapToString





(params, false);





[javac] ^





[javac] Note: Some input files use or override a deprecated API.





[javac] Note: Recompile with -Xlint:deprecation for details.





[javac] Note: Some input files use unchecked or unsafe operations.





[javac] Note: Recompile with -Xlint:unchecked for details.





[javac] 4 errors








What am I missing..








Thanks & Regards.

Sanghamitra






Gaurang Sheladia : Hi Sanghamitra,








Seems like error is missing jar file so you need to add some jar file on your build path.








Thanks,

Gaurang Sheladia






Sanghamitra Mitra : Hi,





Can any body let me know exactly which jar file(s) is required.








Thanks

Sanghamitra






Sandeep Nair : HttpUtil is in portal-kernal.jar and DynamicServletConfig is in util-java.jar








Regards,

San-D