3

I have following questions on instatiable portlets.

1) Will it service server restart. Lets say I added portlet1 to page1. If I restart the server portlet1's portletId will be same with respect to page1. (Basically with same instance id)

2) Lets say we move from environment to environment stage,production,QA. The portletId should remain constant with respect to that page.

The reason being I am hardcoding this id at some place and at later point I donot want to mess up.

user1927808
  • 577
  • 1
  • 10
  • 23

1 Answers1

4

Hard-coding instanceable portlet Ids is not at all recommended, since if the portlet is somehow deleted and again placed on the page it will have a different instanceId even on the same environment.

There are ways to get the portletIds on a page if you know the page-url (since this page friendly url is guaranteed to be same across environment unless some user changes it :-), so this post might help you: How to find portlets added on a particular page in liferay

And this might also be helpful: How to get Portlet Id using the Portlet Name in Liferay

Community
  • 1
  • 1
Prakash K
  • 11,669
  • 6
  • 51
  • 109