Liferay Create object in velocity template

I am writing velocity templates for my liferay theme and I am wondering, whether it is possible to create a new object inside the velocity template. The reason is that in liferay there is no contextTool registered in the context and I really want to be able to inspect the variables that are present in the template at a given time. There is a cool macro for this, but unfortunately it uses the contexttool. I'd like to do something like: #set($contextTool = new ContextTool()) Another solution

Liferay Why to use PortletURL?

This thread is not a question , it was a doubt raised when I was going through Liferay Forums about using PortletURL. In some cases I see this PortletURL inside the javscript Method function createRowURL() { var portletURL = new Liferay.PortletURL(); portletURL.setParameter("rowNumber", "25" ); return portletURL.toString(); } In some cases I see this PortletURL inside the doView Method as shown To get currentURL : PortletURL url = PortletURLUtil.getCurrent(renderRequest, mimeR

password syntax checking based on password policy in Liferay

I'm implementing a separate Change Password module in Liferay, especifically, extending the Login portlet such that it has a Change Password upon login. I tried calling the struts action enterprise_admin/edit_user but it does not work but I have implemented my own password checker by getting the Password Policy of that user and checking the minUpperCase, etc in that class but is there a way that i can check the syntax without looping through the password and counting the minUpperCase, etc.? Do

How to signout programmatically from Liferay custom portlet

I am creating a custom portlet. And I need to log-out the User from the portal after he performs some operation in my custom portlet. I am extending liferay's MVCPortlet. In one of MyPortlet's action methods I need to write the code to logout the user and then redirect it to the home page. Update: I tried the following which I think logs out the user but does not redirect to the home page after logging out: actionResponse.sendRedirect(PortalUtil.getPortalURL(actionRequest) + "/c/portal/logou

Liferay How to place portlet in the header?

I use Liferay Portal 6.0 CE and I need to place portlet (two buttons) in the header of the standart template, as shown in the picture below: How can I do it?.. I need to get access to the layer that is beyond the scope of my template:

Liferay: Checking permissions based on role

I'd like to check if the logged in user has permission to execute a certain action on a portlet. Let's say there is a "Create Product" button on a page and I'd like to hide it if anyone other than the admin is logged in. How do you check for that, both in the front end and back end

CSS to Liferay theme

I have a css web design and I want to converted in Liferay theme. Is this possible? I am using Liferay 6.1 Ga2 with Tomcat 7 and Liferay SDK for java. Any advice will be appreciated! Thanks in advance

Liferay Portal CE and EE

Our company is developing e-portal solutions for the government in Vietnam. We are using Liferay Community Edition. We are considering switching to Enterprise Edition. From a programmer's perspective, is there something LP EE can do that LP CE cannot (performance, security, functionality, etc.)? We would like to hear from the experiences of programmers who have worked with both LP CE and EE before. Thank you so much. Linh

how to hide liferay version and type to prevent hacking

Liferay shows its type and version when /documents/ are used as URI: http://mydomainname.zzz/documents/ /documents/ Name Modified Size Description redele/ - 0 Liferay Portal Community Edition / 6.0.6 How can I hide that info to hackers? Thanx in advance

liferay popup dispalying tthe same content as its render page

I have a popup which show the same page from which it was clicked . I have redirected it to another jsp but it does not show that jsp page but instead shows the same jsap page in the jsp .Below is the code . Thanks in advance All the code below is in view.jsp <portlet:defineObjects /> <script type="text/javascript"> var dialog2 function Popupdisplay1(url,flr){ alert(url); AUI().use('aui-dialog', 'aui-io', function(A) { alert("reached here inside popup"); dial

Liferay Clustering

I am trying to Implement clustering in liferay 6.2 using below Link I had put below properties in both liferay server's and Pointing both Liferay server to same Database. lucene.replicate.write=true Now I added one portlet to a page from first Liferay instance a

How can I upload file to alfresco repository in liferay

I integrate liferay and alfresco..I integrate alfresco repository with liferay in Document and Media end.. I create my custom portlet. I want to upload my document to alfresco repository through custom code. I can upload my document to liferay document_library using DLFileEntry. but I want to upload that document to alfresco repository How is it possible? please help me.. Thanks in advance

Liferay How to check <aui:validator> object before submitting

I wrote the following code in aui and i am using the aui validators for fields but here my requirement is while submitting if all validations are success then i want to call one javascript function.How to check erros are there or not in my javascript function. <aui:form> <aui:fieldset id="inputs"> <aui:input name="staticInput" label="Static Input" value="" size="40" showRequiredLabel="false"> <aui:validator name="required"/> </aui:input> <

How to get default page url in liferay?

I set default page URL in Then create portlet with Controller : public class UserPortrait extends MVCPortlet { @Override public void render(RenderRequest renderRequest, RenderResponse renderResponse) { } @Override public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException { super.processAction(actionRequest, actionResponse); } } Now , how to get la

Liferay project: Use Facet Search to implement search by category with "logic and"

I want to search out webcontent objects by categoryids. I have defined two groups of category Marketing: AA, BB, CC, DD Country: America, France, German I want to find a WebContent which contains [AA, France]. The logic should be 'AA and France'. So I defined a JSON file which is used to load the search condition. But I found my JSON file execute the search with 'AA or France': { className: '', data: { displayStyle: 'list',

Copy file from inside a .war, after deploying to liferay

I want to copy a configuration file from inside the .war file which is being deployed to a specific folder. The reason is that I want to pick it up and process it afterwards, and I might have multiple files, depending on the number of archives deployed on the server. Is there a way to trigger this action, after Liferay picks up the .war file? If yes, any suggestions how? p.s. I have 0 experience with Liferay

Liferay Rendering JSP in ALLOY DIALOG

I am using ALLOY DIALOG in Liferay 6.0.5 as follows: function countPopup(){ AUI().use('aui-dialog', 'liferay-portlet-url', function(A) { var dialog = new A.Dialog({ title: 'Upload Details', centered: true, modal: true, width: 500, height: 400, bodyContent:"testing", }).render(); }); } I am getting in popup " testing ". But Instead of "bodycontent" I want to forward to one jsp file where i have written some logic. How to

Portlet Navigation in Liferay

So I'm having some trouble figuring out how to handle navigation in liferay. I'm new to jsp, portlets, and liferay, but I think I've exhausted all of the documentation looking for an answer. I'm looking for a way to submit an html form and set render parameters with the fields. I would like to have URLs that work with normal browser navigation, and bookmarkable urls. I have figured out a way to do it by using javascript to update an already declared renderurl with new values from the form, b

Liferay Sonar plugin to parse Velocity templates to check code quality

Is there any Sonar plugin to parse velocity templates to check the code quality? I am using Liferay portal and I have lot of Liferay themes which uses velocity templates as template engine. I want to get the metrics for those Liferay themes. I have tried to get the metrics using Sonar, but the problem is they dont parse .vm files. I was successful to get the metrics for Liferay Portlets, but I am stuck with Liferay Themes.

Liferay 6.1 Demo porlet error

I am trying to get some of the demo's working, but have been having problems. I am using Tomcat 7 + MySql. When I try to the jsf2 portlet demo found at: my logs (configured for log4j) show it gets registered but is immediately unregistered. I have no idea why and am not seeing any reason in the log. I would appreciate any help. The log entry in quest

Liferay 6.1 dynamic data list in velocity

I build some custom views for DDL. For text type fields i'd iterate through records and display just like below: $record.getField("field_name").getValue() This won't work for the date field. I presume I should use getRenderedValue(themeDisplay) method instead of getValue() I can access themeDisplay in velocity markup through request.get("theme-display"), however if i set it as variable and pass as argument to getRenderedValue method I get no result Is this the right way to do it? Whats the

Liferay Custom viewing of files from Documents and Media portlet

I have a requirement where in a drop-down with years (2008,2009,2010,2011,2012) as its values is to be displayed. On select of a particular value all annual report (i.e all pdf files falling in that year) for that particular year are to be displayed. I have found Documents & Media useful to store such files. I have created Document Type for annual report having following meta data: NAME: Text field-name of the file uploaded FILE UPLOAD: file uploaded YEAR: Integer-this year are linked to

Liferay Produce a dynamic download from a portlet

Led by this comment in a previous question: Portlet: Forward a ResourceRequest to show the full portal I was wondering if the best way to generate a dynamic download from a portlet (Like, for example, a dynamically generated PDF or image), is making a ResourceRequest, or if there is a better alternative approach

Set Organization statusId to provisional-member in Liferay

How do I set the organization's status to provisional-member for the type com.liferay.portal.model.Organization.status ? When I do GetterUtil.getInteger(PropsUtil.get("")); it sets organization status to full-member.

Liferay: How can I set a specific layout for Terms of use content, the page shown after an user registered

Using Liferay 6.2, I try to workaround to set a specific layout for the Terms of use, shown after an user registered to the portal, and also Verify Email Address page after the user clicked "Agree" under URL /c/portal/.... I would like to have these pages showing with a look and feel I created. For example, I have created a layout called "1_column_white" in the theme I am using for this site and would like to assign to these pages (Terms of use and Verify Email Address). I did try to overwrite

Liferay multilingual support

Is there any way to put custom fields attributes for users and organizations in details? If so, how to make text field for custom fields to accept nonunicode "Arabic"? I have added a new custom field "text field Arabic name". I want to add custom field in details of the form "organization information".

Getting " Portlet Portlet_WAR_portletID has a null portlet bag" in liferay 6.2

I created a liferay plugin portlet project and deployed in Liferay 6.2. When i try to deploy, i am getting " Portlet Portlet_WAR_portletID has a null portlet bag" error. I am not able to find the root as i could see i am referring correct plugin project. SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at com.liferay.portlet.PortletContextFactory._create( at com.liferay.portlet.PortletContextFactory.create(PortletCont

Liferay Finding all users in roles

I would like to find out all of the user which are associated in some roles. I have seen the UserLocalService that provides the method to find the users in a particular role. But I want a method to which I can pass an array of roleIds and it shall return me the list of users in those roles. One way is to write custom SQL, but I would like to get it done by using the API only. Is that possible with Liferay API??

newbie --> How to deploy my jsr 168 portlet inside liferay

Three simple questions... Question 1. I have a JSR168 portlet that is deployed over IBM Websphere Portal server at my company. I was using a version of IBM Portal server for my development but strictly speaking I don't think I am allowed to use these at my company. So now my plan is to do my development and testing on my local machine using liferay and then deploy to IBM Portal Server. From what I have read about liferay since it supports jsr168 I should not have any problems. Is this correc

Liferay error after reply to a thread in message boards portlet

In liferay portal 6.2 CE-GA2, I used message boards portlet. In this portlet I create a thread and then I reply to that thread. After every reply I have these messages in the catalina.out log file: 17:18:01,520 ERROR [http-bio-80-exec-575][IncludeTag:129] Current URL /web/knowledge-management/wiki/-/message_boards/message/109006 generates exception: null java.lang.NullPointerException at org.apache.jsp.html.portlet.message_005fboards.view_005fthread_005fmessage_jsp._jspService(view_005

javax.servlet-api-3.0.1.jar not loded in liferay 6.1 and tomcat 7.0

With a custom plugin deployed, I'm getting the following error message and the webapp doesn't start: validateJarFile(E:\6.1\liferay-portal-tomcat-6.1.1-ce-ga2-20120731132656558\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\4-SiteSkills_CMS-portlet\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Why and how can I get rid of this message?

Importing Liferay portlet into Eclipse IDE

I haved created a portlet through plugins SDK and wanted to import that into the eclipse ,but it did not imported as it is , But after creating the portlet if i give " ant setup-eclipse " then the project get imported into the eclipse .i have searched for this almost 2 days then i found the solution .. How do i know what all the commands i have in ant . like in the API i will have all the methods where i can see there and get on with my coding work ,how with ant ? how do i know wat all the co

Liferay Send parameter from Portlet doView to portal_normal.vm

I'm trying to send a parameter from Portlet doView function to portal_normal.vm Is it possible? How can I send and receive it? Sorry, but I can't see the way to do through request. In doView I wrote HttpServletRequest httpRequest = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(renderRequest)); httpRequest.setAttribute("hola", "hola"); And in the portal normal I tried with: #set ($holas =$request.get('attributes').get('hola')) #set ($holas2 = $request.getS

how to store the data into 2 tables in liferay service builder?

i have already created one portlet name is course-portlet. i have created the add.jsp for storing the course in to the database using service layer. now my requirement is i need to store the course details in two tables course,course_user. in course table column values are cid,cname,sdate,sid. for this table i have created service builder. now my requirement is i have to create the another class in service layer which need to store the values in the table course_user cuid,cid, it possible

Create Object in Liferay Web Content Template

I am trying to instantiate MimeMessage class using Liferay WebContent Velocity template and having difficulty with it. Here is my code #set ($properties = $portal.getClass().forName("java.util.Properties").newInstance()) #set ($VOID = $properties.put("","")) #set ($VOID = $properties.put("","25")) #set ($mailSession = $portal.getClass().forName("javax.mail.Session").getInstance($properties, null)) Mail Session: $mailSession <br/> #set ($mi

Liferay Setting Asset Publisher Default Display Template

How does one define, or set, the default Display Template on the Asset Publisher Portlet to a global scope/other template? I thought about using to alter the portlet itself, but was unable to find a relevant preference setting. Using Liferay 6.2

Categories for Article in Liferay

I am using Liferay 6.1.0 GA1. Where I can change Categories that are displayed in Asset Publisher -> Edit (Article) -> Categorization where local (defined in group or organization) instead of being global?

Liferay Friendly URL struts action not fired

Please help me to implement Friendly URL My source URL http://localhost:8080/web/guest/myshop? p_p_id=225_INSTANCE_08MX& p_p_lifecycle=0 &p_p_state=normal& p_p_mode=view& p_p_col_id=column-1& p_p_col_count=1 &_225_INSTANCE_08MX_struts_action=%2Fproduct%2Fview_product &_225_INSTANCE_08MX_redirect=http%3A%2F%2Flocalhost%3A8080%2Fweb%2Fguest%2Fprodu­ct%3Fp_p_id%3D25_INSTANCE_08MX%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mo­de%3Dview%26p_p_col_id%3Dcolumn-1%26p_p

Is there a way to get a deployed war from a running Liferay?

A version of a portlet I'm working on is already deployed to liferay. Is there any way to get that originally deployed war from a running liferay instance? This is so I could hot-deploy my version and shortly deploy the old version. The original was deployed by Jenkins. Liferay 6.1 ee, Tomcat 7.

Liferay How to show child site tags in parent site tag cloud?

I'm hooking the tag cloud portlet, but I can't figure out how to show the tags given to content in a child site. On one page, I have a tag cloud and an asset publisher below that showing tagged content if a tag is clicked. Currently the child site and parent site tags and contents are serparated. In the tag cloud portlet options I see a global scope option, but that displays nothing. In asset_tags_navigation/page.jsp I see the following is used to actually get the tag data: if (showAssetCoun

How to add custom icon in liferay clay?

I want to add WhatsApp icon in Liferay and use clay ui then how to add whatsapp icon in clay with liferay. <clay:link buttonStyle="outline-secondary" elementClasses="btn-monospaced btn-outline-borderless btn-sm lfr-portal-tooltip" href="#link" icon="phone" title="title" />

  1    2   3   4   5   6  ... 下一页 最后一页 共 10 页