title: Liferay: get PortletId and Plid from init(PortletConfig) [i.e, no request object, just PortletConfig]
body: <p>I would like to get both values, and since init(Portletconfig) is executed when loading the portlet, I don't see any doubt about whether this values should be available.</p>
  
  <p>For portletId I tried </p>
  
  <pre><code>String portletId = ((PortletConfigImpl) portletConfig).getPortletId(); 
  </code></pre>
  
  <p>but it seems I can't. Guess it is because the impl is in another jar not meant to be accessed from portlets</p>
  
  <p>By the way, my main goal is to get to pass both params to another non-request context so I can do </p>
  
  <pre><code>final PortletPreferences prefs = PortletPreferencesFactoryUtil.getLayoutPortletSetup(LayoutLocalServiceUtil.getLayout(plid), portletId);
  </code></pre>
  
  <p>to read portlet's prefs in real time. If there is any other way to indicate that from init(), like getting the whole preferences it would be enough</p>
  
  <p><strong>EDIT:</strong> I found a different approach, and opened a new question with slightly changes
   <a href="https://stackoverflow.com/questions/12322904/liferay-get-portletid-and-companyid-from-init">Liferay: get PortletID and companyID from init()</a></p>