Forums de discussion

Liferay hot-deploy Renaming Portlet Name Problem

Gilad Reich, modifié il y a 7 années.

Liferay hot-deploy Renaming Portlet Name Problem

New Member Publications: 10 Date d'inscription: 21/07/16 Publications récentes
Hello,
I'm working for a company that is using Liferay-portal-6.1.1-ce-ga2 in the last 5 years.
Some of my co-workers using Eclipse as their IDE and Maven to build/pack portlets.
I really liked the hot-deploy functionality because it saves tons of time instead of compiling all
the source code of a portlet just for a tiny single change and deploy automatically to make a simple test.
I'm working with Liferay v6.1 CE Server (Tomcat 7) plugin in Eclipse and have a server configured and working for hot-deployment.

Some of our portlets have JavaScript functionality that defining the ID of a portlet in order to communicate with different portlets on the portal.
In our custom Theme that we use in the portal, we have many portlets working on the same concept which is why I'm posting here because this could be a serious working process improvement.

The main problem we have is:
When i hot-deploy a portlet into Liferay IDE plugin(using Eclipse Mars as the main IDE), Liferay automatically checks if it's a:
"Portlet", "Theme" or a "Hook" and changing the name of the portlet ID/name at the end of the original name of the portlet and then our other portlets can't communicate with each other unless i go and change them manually in the JavaScripts files in our theme, build it again, deploy and restart server just to have the hot-deployment functions and working.

For example, if my portlet name/ID is:
RegisterPortlet
After i hot-deploy that portlet using Eclipse and Liferay plugin with Tomcat server, it makes the id of that portlet:
RegisterPortletportlet
On the folder and public view it shows RegisterPortlet-portlet but the id of that portlet actually changing to RegisterPortletportlet.

and the JavaScript code from our custom theme calls it for example:
var PORTLET_ID = 'RegisterPortlet_WAR_RegisterPortlet';
And in order to correct the ID in order to get the hot-deploy working as i want, i need to go every time to that line of code and change it to:
var PORTLET_ID = 'RegisterPortlet_WAR_RegisterPortletportlet';


The problem is, i need to always watch out I'm not committing those changes into productions and always need to change it back and forward (We have many portlets that works on the same concept) and then re-deploy and restart server because of a theme changes.
I assume we need to patch it through the source code of Liferay plugin to disable the name changing suffix functionality for the hot-deploy to function properly.
But i would be very happy to hear suggestions and tips, of how can i go around that issue or what would be possibly configuration to change in order to skip the name changing suffix that Liferay does automatically.
I've checked every single configuration in server and hot-deploy and couldn't find a solution to that or even a more creative and efficient way to go around this.
I saw some posts regarding this issue here and i didn't find a solution for that:
Topic 1
Topic 2

Thank you so much for your time reading this.

Best regards,
Gilad Reich
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: Liferay hot-deploy Renaming Portlet Name Problem

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
You should name your projects to include the project type as a suffix.

Portlet projects would be "register-portlet", your site theme would be "classy-red-theme", ...

The name of the project war has nothing to do about the contents (i.e. RegisterPortlet), but the name is important for the deployment process to ensure Liferay uses the right deployer for both hot and auto deployment mechanisms.







Come meet me at the LSNA!