Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: RE: How to retain the portlet Id of a spring mvc based portlet during upgrade?
Hi All,
We had a portlet which was spring mvc based porltet , it was having 21 spring mvc based portlets bundled into one mammoth war style portlet.
We upgraded them to 7.4 from 7.1 and kept some of them as spring mvc based portlet as some of them were using lot of spring web / mvc based features so we kept them as it is to avoid doing lot of testing or migrating them to Liferay MVC.We want that the portlet id to be the same as earlier.But in Spring MVC portlet we have to define the portlet id in xml config files like liferay-portlet.xml,portlet.xml,liferay-display.xml.
Old portlet id :
knowledgecookiesnavigation_WAR_knowledgecookiesportlet
Have you tried using the old portlet id explicitly? What happens? What's the behavior? Is there some decoration going on that the portal does to those portlet ids? (I never look at them, thus I can't tell from the top of my head)
Please describe what you observe, what you expect, and what you've tried
Hi Olaf
Thanks for your reply.
Since the portlets were bundled into another spring mvc portlet , they had the container portlet mentioned in its portlet id for ex knowledgecookiesnavigation_WAR_knowledgecookiesportlet is a knowledegcookies-navigation portlet being contained under the main knowledgecookies-portlet.
I did use the portlet id that was there in the liferay-portlet.xml for the portlet ie knowledgecookies-navigation but the knowledgecookiesnavigation_WAR_knowledgecookiesportlet as portlet wasn't generated in the process so this portlet didnt find placed on page on successful deployment.I had to forcibly add it to the page via add application but this thing I want to avoid.Since I am working on upgrading the code from 7.1 to 74 and wanted to maintain the portlet id references that database on 7.1 was having so that I dont have to alter the database tables like portlet table , layout table etc.
This must be something that Liferay is doing all the time. I'm assuming that there's some reusable Upgrade-routine code that you can pass in the old and the new portlet-id. Technically that does the database change that you're looking to avoid, but as you don't have to do the work yourself, this might not be too bad (and you'll be in a somewhat standardized environment of generated portlet IDs)
Powered by Liferay™