liferay-6

How to fetch liferay entity through custom-finder in custom plugin portlet?

喜夏-厌秋 提交于 2019-12-07 02:18:20
问题 How can we fetch liferay entities through custom-finder using custom SQL? Following is my sql query written in default.xml ( I have trimmed down the query to the bare minimum so that the logic remains simple. Since it included a few functions and joins we couldn't use DynamicQuery API ): SELECT grp.* FROM Group_ WHERE site = 1 AND active_ = 1 AND type_ <> 3 Relevant code in MyCustomGroupFinderImpl.java : Session session = null; try { session = openSession(); // fetches the query string from

How to share jar within multiple portlets?

六月ゝ 毕业季﹏ 提交于 2019-12-07 01:54:02
问题 I'm using several jars in my portlets, for instance c3p0. Now I want to avoid to put the jars in every of my portlets lib folders. How can I share one jar file within multiple portlets? And how should I integrate them in the Eclipse IDE? Add an external jar or put them in one dedicated project and include them from there? 回答1: Another solution would be to put them under ../liferay-portal-<version>/tomcat-<version>/webapps/ROOT/WEB-INF/lib If you place them here you can add the JAR as a

Comaprison of Liferay ServiceBuilder to other Code generation tools like AndroMDA

泪湿孤枕 提交于 2019-12-06 16:34:45
I started digging into the liferay 6.x ServiceBuilder framework and really liked its code generation approach. A simple service.xml file can generate ready to use powerful services without even writing a single line of code. I also tried looking into AndroMDA which can generate similar services from the UML model, which sounds even more interesting since it will link my business model directly without me needing to learn a new xml config for service.xml (in case of liferay ServiceBuilder) now I am in the process of deciding which tool should I use. Based on your experience with any of these

how to capture the data sent by alloy ui io request in serveresource method?

℡╲_俬逩灬. 提交于 2019-12-06 16:13:50
Getting blank values for title and description in serveResource method.Is this the right way to send the parameters from io request? After inserting blank values in database I have to reload the page to see the inserted values?So io-request is not ajax request? <aui:script use="aui-base"> A.one('#<portlet:namespace/>save').on('click', function(event) { var A = AUI(); var title=A.one('#<portlet:namespace/>title').val(); alert(title); var description=A.one('#<portlet:namespace/>description'); var url = '<%= newJob.toString() %>'; A.io.request( url, { method:'POST', data: { <portlet:namespace /

Users are not getting deleted from Liferay DB

江枫思渺然 提交于 2019-12-06 13:58:35
问题 I have deleted users from Liferay UI. Some time its asking to deactivate and then delete. some time only deactivate. And users are not going from db always. So, recreation of same user is not possible as it is throwing errors like "email address already exist or username alreasdy exist". Why user is not getting deleted from DB after deletion from UI? I am using liferay-portal-6.1.1-ce-ga2. How to solve this issue? 回答1: Deactivate and Delete are two different functionalities. When you

JSR 286 compliant namespace parameter

元气小坏坏 提交于 2019-12-06 12:33:49
In portlet What is the best way to read namespace parameter in action method. My form contains <input id="<portlet:namespace/>param1" name="<portlet:namespace/>param1" value='hello'/> option1: request.getParameter(response.getNamespace() + "param1"); option2: request.getParameter("param1"); option1 does not work in liferay, but does seem will work in websphere. option2 works fine in liferay 6.2. option1 seems to work in before 6.1. Can anyone please tell me what is the jsr 286 compliant way? As I mentioned in a comment of an answer to this question, the problem is with Liferay 6.2 because IBM

How do I use the different file storage and retrieval APIs in Liferay?

孤人 提交于 2019-12-06 08:31:35
问题 When developing a Liferay portlet, sometimes you want to use file artifacts. For example, you might want to have a configurable image(s), or the means to let users attach files to your custom service entity. There are several API's built into Liferay that address this problem. How is each one used? 回答1: Following are the three methods which I can think of to store and retrieve files. Method-1 Storage: Method using the DLStoreUtil as you have shown in your question. Retrieval: For this you

HttpClient 4.2.3 using both SSL encryption and NTLM authentication fails

匆匆过客 提交于 2019-12-06 07:37:14
I am trying to use a REST call to Sharepoint 2010 via HTTPClient 4.2.3 from a Liferay 6.1 portlet. I have imported the cert into my local MAC's JVM cacerts and am trying to load the cacerts as the keystore. My code is: String opsCalendarURL1 = "https://hostname/sites/team-sites/operations/_vti_bin/owssvr.dll?"; String opsCalendarURL2 = "Cmd=Display&List={6E460908-D470-4F8A-AF76-CC279E25E0B1}&XMLDATA=TRUE"; String opsCalenderURLEncoded = opsCalendarURL1 + URLEncoder.encode( opsCalendarURL2 , "UTF8" ); System.out.println(opsCalenderURLEncoded); DefaultHttpClient httpclient = new

How to use Liferay's permission system in other applications?

烂漫一生 提交于 2019-12-06 07:23:22
问题 I'm considering using Liferay's permission system to implement access security in an external Java application (not a portlet). Liferay has robust features for managing users, groups, roles, permissions and resources. It would be great if I could leverage those instead of re-inventing the wheel in our external app. Liferay and our external application are configured to use the same CAS and LDAP for authentication, so they share the same users. So far I've successfully used Liferay's JSON-WS

File upload in specific folder of web application in liferay..?

牧云@^-^@ 提交于 2019-12-06 03:45:26
I am using liferay 6.0.5. I am uploading file using following code. UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest); String submissionFileName = uploadRequest.getFileName("file");//uploaded filename File submissionFile = uploadRequest.getFile("file"); this works fine and upload file in tomcat's temp directory with some different name. What I want is.."There is one folder docs in my project directory. I want uploaded file in this directory". How to do this in liferay..? If you want to change the temp directory for the file upload then you can change the