Menu
  • HOME
  • TAGS

How to upgrade liferay services from 6.0 archetype to 6.2?

Tag: liferay,maven-3,best-fit

I am currently working on liferay upgradation from 6.0 to 6.2.2 GA3. I tried upgrading the services portlet. The services portlet of 6.0 version is built using mvn services-portlet-archetype whereas for 6.2 version the archetype is liferay-servicebuilder-archetype. The difference is that in 6.2 liferay-servicebuilder-archetype there are two modules: Module 1: is a portlet which has our code logic Module 2: is the services-portlet which has the class files generated during liferay:build-service. These files are archived into jar file which is later used inside the portlet(Module 1) module for the creation of the WAR file.

Whereas in 6.0, there is no concept of modules. The services class files generated during liferay:build-service are generated inside services folder under src/.

This liferay-servicebuilder-archetype is available only from Liferay 6.1+ versions as seen in mvnrepository. My guesses for the need of this new archetype from 6.1 version are:
1. To avoid committing the auto generated services files by mistake to our version control repo.
2. To be more modular.

But with this new archetype I found out that the build process consumes lot of permgen space and heap space(I have to double the heap and permgen space everytime I run the mvn clean package liferay:build-service as observed through jvisualvm). I was able to create the same portlet with services-portlet-archetype successfully deployed and working in 6.2 GA3 server(without extra permgen space and heapspace). But did not find any memory issues during its build.

My questions are:
1. Which of these two archetypes(liferay-servicebuilder-archetype or services-portlet-archetype) is a good practice for liferay 6.2 GA3.
2. Going forward if I need to upgrade all the 20+ portlets which I am using in my project should I need to create from archetype? (Takes lot of time and effort).
3. How to fix this issue of extra memory consumption if using liferay-servicebuilder-archetype is the best practice. The target folder seems to produce more class files than in services-portlet-archetype target folder.
4. The need for this new archetype is for the two benefits mentioned above(which I guessed) or is there anything else?

Best How To :

After waiting for 2+ weeks for an answer to this question, I am assuming that my following guesses are the correct answer to this question.

The need for this new archetype from 6.1 version is: 
1. To avoid committing the auto generated services files by mistake to our version control repo.
2. To be more modular.

If there is a more convincing answer, I will choose that to be the best answer.

EDIT:::: Found this link useful https://www.liferay.com/community/forums/-/message_boards/message/51303796

Maven reactor builds in order that doesn't satisfy all dependencies

maven,maven-3

I installed all your projects with all versions set to 1.0 here. Then I changed the versions as you stated and got the same error. After changing the reactor POM to: <modules> <module>jar1</module> <module>jar2</module> <module>jar3</module> </modules> ... the build succeeded. I looked at Guide to Working with Multiple Modules, Reactor...

Form submit portlet with Spring MVC

java,jsp,spring-mvc,liferay,portlet

Which version of Liferay you are using? if it is > 6.2 GA1 Then in your liferay-portlet.xml file, please add this attribute and recompile and test again. <requires-namespaced-parameters>false</requires-namespaced-parameters> Liferay adds namespace to the request parameters by default. You need to disable it. ...

How to upload file in relative directory

java,liferay

I had somewhat similar task to upload files to specified folders, so following is bit modified code as per your requirement: public void upload(ActionRequest request, ActionResponse response) throws Exception { UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(request); long sizeInBytes = uploadRequest.getSize(fileInputName); if (sizeInBytes == 0) { throw new Exception("Received file is 0 bytes!");...

how is the properties set in this pom.xml?

maven,maven-3

To say exactly how those properties are set in your case we need to see the entire pom structure including the parent pom(s) as well as your Jenkins job configuration. However, I know of two ways that these properties can be set: Through a profile in one of your parent...

Users in Guest role see default theme instead custom one for given layouts

liferay,liferay-6,liferay-theme

After few hours consumed on analyzing our portal environment finally I managed to solve it. Here is the reason of such strange problem: It turns out, the information about main parent theme (the one which can be inherited on child pages) is stored in different places for such options enabled...

Text internationalization in Javascript using liferay-ui:message

javascript,internationalization,liferay

Converting my comment into answer :) Hi, You can try this code snippet <%= UnicodeLanguageUtil.get(pageContext, "please-choose-file-type") %> HTH...

In liferay market place, I am unable to submit the project

liferay,liferay-6

A Google search for "liferay plugin package file name format" reveals this page: Marketplace basics - Development | Liferay And there you can find: WAR file names must conform to the following naming convention: context_name- plugin_type -A.B.C.D.war Where: context_name - Alpha-numeric (including - and _) short name of your app....

Customize CreateAccountAction in Liferay Portal

liferay,liferay-ide,liferay-hook

Using UserLocalServiceUtil instead of UserServiceUtil worked. Basically, the difference is that *ServiceUtil checks permissions and *LocalServiceUtil does not.

Maven: Error while executing goal versions:update-properties

maven-3,versions-maven-plugin

I finally came to a solution for this problem. The pom.xml was encoded with UTF-8 with BOM. The problem was solved after converting the file to UTF-8 w/o BOM.

How to pass data from page to Portlet class through AJAX call?

ajax,jsp,liferay,portlet

I recommend to use liferay's <portlet:resourceURL var="resourceURL"> </portlet:resourceURL> with AlloyUI instead of using simple xmlhttp function. Change required namespace parameter in your liferay-portlet.xml <requires-namespaced-parameters>false</requires-namespaced-parameters> Add following import <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <portlet:defineObjects /> Change the url to below url += '?cache=' + nocache + '&<portlet:namespace/>nRows=' + numberOfRows; Please...

Identify that the logged in user is an administrator or not using velocity

liferay,liferay-6,liferay-theme

Depending on the requirement, there are following two ways to check whether the logged in user is an admin user or not: Show dockbar to all the admin users: #if ($is_signed_in && $permissionChecker.isOmniadmin()) #dockbar() #end Show dockbar to specific admin user(s) based on role-name: #set($showDockBar = false) #foreach($role in $$themeDisplay.getUser().getRoles())...

Get list of users in liferay

liferay

There is no issue with your logic in putting user-list in session, the list is getting populated and set in session accurately. However, on JSP, there are couple of issues: renderRequest is undefined. Cast exception (UnmodifiableList cannot be cast to java.util.ArrayList) for user-list. You are not iterating list and getting...

Why won't maven-antrun-plugin run?

maven,ant,maven-3,maven-antrun-plugin

Please use an uptodate version of the maven-antrun-plugin if you really need to use maven-antrun-plugin. The older versions have using the configuration tag: tasks instead of target. But stop using such ancient versions of Maven plugins....

How manage styles in Vaadin portlet in Liferay

css3,liferay,vaadin,portlet

I found solution, wich is not perfect, but still enough for my purposes: 1.Do copy Valo Theme from vadin-themes-7.0.5..jar as explained on http://www.rapidpm.org/2014/05/25/vaadin-valo--the-new-theme-%28since-vers.html 2. Edit styles.css in valo root theme. 3. Add !important clause into .valo .v-textfield {..} class definition as written on http://www.liferay.com/community/forums/-/message_boards/message/15001322 for border-radius and height. It changes...

Local Nexus Maven repository for common java libraries

maven,maven-3,dependency-management,nexus,sonatype

After a bit more digging I noticed that when dependencies were downloaded from central they were stored in .m2/repositories along with their pom files. I wrote a Python script to copy these into another location and then walk that directory tree and run mvn deploy:deploy-file for each jar/pom pair I...

Lifefay freemarker ADT: methods unavailable?

java,liferay,liferay-6,freemarker

Asset renderer renders asset entries of the given class (ei. JournalArticle or DLFileEntry in your case). Asset renderer itself is not instance of the given class (in Java sense). It is always instance of com.liferay.portlet.asset.model.AssetRenderer. To get instance of the related DLFileEntry, you must use DLFileEntryLocalService to find it. <#--...

Unable to import maven project in IntelliJ14

maven-3,intellij-idea-14

Solved. I had to remove the IntelliJ project folder (.idea) and create a new project from the existing source clicking on the parent pom. Then, everything worked properly. I guess that some file was corrupted....

how to bypass the necessity of having to have email address firstname and lastname in liferay to import authenticating users

ldap,liferay

It won't be easy to remove Liferay's dependency on users having a unique email address - it might be easier to set them up with an artificial email address in order to import them. In case you stumble upon this artificial email address in Liferay's UI and don't like it,...

Register multiple EventHandlers for one portlet

event-handling,liferay,portlet

The bridge is expecting only one event handler, but you can create one that delegates to both instances: public class BridgeEventHandler { private BridgeEventHandler eventHandler1 = new ...; private BridgeEventHandler eventHandler2 = new ...; public EventNavigationResult handleEvent(FacesContext facesContext, Event event); EventNavigationResult result = eventHandler1.handleEvent(facesContext, event); if (result != null) {...

maven activate by property value and version

maven,maven-3

I believe there is no such functionality with out-of-the-box Maven. Maven is usually really simple when looking into its internals. Profile activation based on property is basically about two strings equality, nothing more, no extra logic here. I can image a solution that introduces own, simple Maven plugin that does...

How to ignore Liferay user removed from LDAP errors?

ldap,log4j,liferay,liferay-6,openldap

Until missing users in LDAP are supported by Liferay you can turn off the logging for this particular message. Just create the file ROOT.war/WEB-INF/classes/META-INF/portal-log4j-ext.xml with the following content: <?xml version="1.0"> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <!-- Copy all appenders from ROOT.war/WEB-INF/lib/portal-impl.jar/META-INF/portal-log4j.xml and add the following filter: --> <appender ...>...

How to delete a portlet in Liferay 6.1 programmatically from code

java,javascript,java-ee,liferay,liferay-6

public void removePortlets(ActionRequest request, ActionResponse response) throws PortletException { ThemeDisplay themeDisplay = (ThemeDisplay) request .getAttribute(WebKeys.THEME_DISPLAY); long groupId = themeDisplay.getScopeGroupId(); String friendlyURL = "/demochildpage"; boolean privateLayout = false; long userId = themeDisplay.getUserId(); try { Layout layout = LayoutLocalServiceUtil.getFriendlyURLLayout( groupId, privateLayout, friendlyURL); LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) layout .getLayoutType();...

Portlet event send array of objects

arrays,events,liferay,portlet

Consider portlet events (and portlets) the UI layer of your application. Based on this, judge if the amount of data that you send back and forth makes sense or not. Also, if you closely couple the portlets, you're just hiding the fact that they can only function together - at...

Liferay workflow Flow(ie:Kaleo WorkFlow)

liferay

I have used the below workflow XML Code <workflow-definition xmlns="urn:liferay.com:liferay-workflow_6.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.1.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_1_0.xsd" > <name>Sample</name> <description>A single approver can approve a workflow content.</description> <version>10</version> <state> <name>created</name> <metadata>...

what does having two goals in same plugin mean in maven?

maven,maven-3,maven-plugin

First your given configuration does not make sense, cause the documentation says different: <project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.18.1</version> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> </plugin> </plugins>...

JAXB Release Documentation stating contrary information about Compile and Runtime Jars

java,xml,jaxb,jax-ws,maven-3

As the link clearly states, jaxb-api.jar, jaxb-core.jar, jaxb-impl.jar are required at runtime. jaxb-api.jar, jaxb-core.jar, jaxb-impl.jar, jaxb-xjc.jar are required at compile time. Your other link is for an older version of JAXB 2.2 so you should ignore it....

How can I configure AOP in Liferay Service Builder?

liferay,aop

There are basically two ways to achieve this in Liferay, assuming you want to intercept Liferay's services: Service Wrapper Hooks What this does is gives you a wrapper around the desired service, for eg: UserLocalServiceWrapper would be a wrapper around UserLocalService and would have complete control over the methods defined...

Liferay Migrating User from legacy database & LDAP

liferay,liferay-6.2

If you set the Authentication Search Filter, the Import Search Filter and the User Mapping in the LDAP settings correctly, it should find the appropriate user during synchronization. Depending on the setup of your LDAP you can use the screen name or the email address of the user as place...

Maven hamcrest parent depedency failed to resolve

maven,maven-3,dependency-management

Correct. There is no such artifact of jar type which is default if you don't specify any. This one will work: <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-parent</artifactId> <version>1.3</version> <type>pom</type> </dependency> ...

how to define path to superpom?

java,maven-3

Apache Maven has a two level strategy to resolve and distribute files, which we call artifacts. The first level is called the local repository, which is the artifact cache on your system, by default located at ${user.home}/.m2/repository. When executing Maven, it'll first look in this local cache for artifacts....

Does'nt Liferay work at different ports?

liferay,server,portal

You can always navigate to exactly the port that you configure - given that the appserver actually serves connections to the port. Common mistakes that I see (assuming you're running tomcat): People change server.xml to refer 8080 to 8090, but leave the other ports (8005 and 8009) untouched. This means...

Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved

maven,maven-2,maven-3,maven-plugin,maven-release-plugin

Your debug output indicates that Clean is the first thing that it's trying to run, so I'm guessing it's failing to download any plugins from central. First off, see if you can download the plugin jar directly in a web browser: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar If that works then your web browser has...

How to host a newportal instance in liferay

liferay,liferay-6

Please add host file entry in /etc/hosts file to open www.newportal.com in your local browser. For Example, 127.0.0.1 www.newportal.com HTH...

Maven: how to build jar and include as a dependency

eclipse,maven,maven-3

Add your jar project as topmost <module> in your multi-module EAR project's POM. See also Maven: The Complete Reference, Multi-module vs. Inheritance....

Incorrect liferay-plugins dependency

gradle,dependencies,liferay,liferay-6.2

The 6.2 branch is mainly used for development, and those Gradle scripts are not designed to run on Liferay 6.2. Furthermore, they've been removed in the master branch, replaced by a series of Gradle plugins written in Java. Everything is still under active development, but anyway you're more than welcome...

commandButton action method not invoked in Liferay

jsf,liferay,portlet

Im not sure why, but after adding this line to my liferay-portlet.xml it fixed it. <requires-namespaced-parameters>false</requires-namespaced-parameters> And here the whole block: <portlet> <portlet-name>Test1</portlet-name> <icon>/icon.png</icon> <requires-namespaced-parameters>false</requires-namespaced-parameters> <header-portlet-css>/css/main.css</header-portlet-css> </portlet> ...

I am working on a MVC Portlet and the document i am saving is not going to db

liferay,liferay-6

There are certain mistakes in your code: You forgot to include tag reference for aui in your JSP. Attribute name for file type input was name="Doc", and you were getting parameter value in your action as File docImage = uploadRequest.getFile("doc"); It should be consistent, either "Doc" / "doc" in both...

Cons of a liferay cms while website development using Community Edition

content-management-system,liferay

I am not sure, if this question really belongs here, anyway here are few my points: you have to get the proper Liferay mindset to get things work insufficient developer documentation (they are trying to improve it) a lot of code in JSP files little (if any) support for TDD...

Include ftl file in ext plugin

maven,liferay,liferay-6

The solution is moving file from source folder to resource folder.

How do I activate a Maven profile if a file does NOT exist?

maven,maven-3,profile,file-exists

See http://maven.apache.org/ref/3.3.3//maven-model/maven.html#class_file <missing>${basedir}/src/main/myfile</missing> ...

How to automatically set Maven compiler plugin based on $JAVA_HOME env variable?

environment-variables,maven-3,java-home,maven-compiler-plugin

As Jarrod pointed, solution is usage of profiles. Using example provided from maven docs. Profiles can be automatically triggered based on the detected state of the build environment. These triggers are specified via an section in the profile itself. Currently, this detection is limited to prefix-matching of the JDK version,...

Customizing liferay Calendar portlet

liferay,liferay-6,liferay-ide

Solved: I got the Correct version of Calendar-portlet from marketplace. Went to liferay marketplace-->purchased apps-->click on calendar app and Download. I got "Calendar-CE.lpkg" file and found .war file inside it. Imported as Liferay Binary Plugin in eclipse. build and deployed. working as expected....

Service builder doesn't delete table in DB

liferay,liferay-6,liferay-service-builder

Liferay will never ever delete a table which has been in your service.xml but is now deleted. Also it will not delete any of the classes generated by a build-service command. For example it could be the case, that you refactored your portlet to 2 different projects. On a deploy,...

How to pass HTTP request to Web-Service

ajax,web-services,liferay,liferay-6,portlet

Suggesting to rethink your problem. A servlet request object does not make any sense as parameter for a web service call. Those are two totally different frameworks. A servlet request only makes sense within the processing of a servlet and is defined within that context. You are probably interested in...

Difference between Liferay Mobile SDK and Liferay Screens

mobile,liferay,liferay-6

From the respective homepages of the products, first hits on google on the product names (bold by me): Liferay Mobile SDK is a framework for building native mobile apps that integrate with your different Liferay Portal instances and their portlets. The SDK provides the means for your mobile apps to...

How to create service builder for liferay plugin project with maven

liferay,liferay-ide,liferay-service-builder

Frankly speaking Liferay-Maven combination is not so fully supported by Liferay IDE in eclipse. Originally Liferay IDE has been created for only ANT support but since maven support has been introduced there are many things missing. This issue which you have raised is same for following options as well. JSF...

Keep liferay-ui:search-container while paging

liferay,liferay-6.2

I see two solutions for your problem: Add an onchange handler to the checkboxes and send an AJAX request to store the selected items on the server: // Stub using AUI/YUI: AUI().use("node", function(A) { A.all("td.entry-selector input").on('change', function (e) { var checkbox = e.target; var selectionState = checkbox.get('checked'); // Send the...

How can I change the zIndex attribute of aui-datepicker in Liferay Portlet 6.2

datepicker,liferay,z-index,liferay-aui,alloy-ui

You need to change the zIndex on the DatePicker's internal Popover: new Y.DatePicker({ // ... popover: { zIndex: 1 } }); See the example page and API docs for more details....

Customizing My Sites portlet in Liferay

liferay

Following is the files structure for My Sites portlet in portal source: Views: \portal-web\docroot\html\portlet\my_sites\ - view.jsp - site_action.jsp Action: \portal-impl\src\com\liferay\portlet\myplaces\action\ViewAction.java The initial view is being rendered from view.jsp with the help of group_search.jsp (Search field) and site_action.jsp (Actions button). To ensure action file, open \portal-web\docroot\WEB-INF\struts-config.xml, copy any of the struts_action...

AJAX Call not working in liferay 6.2.2?

ajax,liferay,hook,liferay-6

A big thanks to Olaf Cock and Gevatterajan for their guidance. First issue was: to replace varImpl with var and also to remove copyCurrentRenderParameters while i was migrating from 6.1 to 6.2. The defination should have been like this: <liferay-portlet:resourceURL var="mainURL" /> Similarly we have to repeat for renderURL and...