Portlet table returning 0 for companyIdPortlet table returning 0 for companyIdhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1208249172024-03-19T08:23:42Z2024-03-19T08:23:42ZPortlet table returning 0 for companyIdKevin Neibargerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1208249162021-06-11T15:31:54Z2021-06-11T15:31:54Z<p>I'm currently running Liferay 7.3.6 GA7 and I'm having issues getting
data from the Portal.Portlet table. Using the following code</p>
<p> </p>
<blockquote>
<p>List<Portlet> searchPortlets = PortletLocalServiceUtil.<i>getPortlets</i>();</p>
<p>for (Portlet p : searchPortlets) {</p>
<p>System.<b>
<i>out</i></b>.println(</p>
<p>"\n -- Portlet Cols --- \nMccVersion: " +
p.getMvccVersion() + "\nID: " + p.getId() +
"\nCompany: "</p>
<p>+ p.getCompanyId() + "\nPortletId: "</p>
<p>+ p.getPortletId() + "\nRoles: " + p.getRoles() +
"\nActive: " + p.getActive() + "\n");</p>
<p>}</p></blockquote>
<p>I can only get data for <strong>portletId,
roles </strong>and <strong>active_ </strong>flag. Printing out each
column from that table able yeilds the following output</p>
<blockquote>
<p> -- Portlet Cols --- </p>
<p>MccVersion: 0</p>
<p>ID: 0</p>
<p>Company: 0</p>
<p>PortletId: com_liferay_asset_tags_navigation_web_portlet_AssetTagsCloudPortlet</p>
<p>Roles: Guest,Power User,User</p>
<p>Active: true</p>
<p> </p>
<p> -- Portlet Cols --- </p>
<p>MccVersion: 0</p>
<p>ID: 0</p>
<p>Company: 0</p>
<p>PortletId: com_liferay_commerce_wish_list_web_internal_portlet_CommerceWishListContentPortlet</p>
<p>Roles: Power User,User</p>
<p>Active: true</p>
<p> </p>
<p> -- Portlet Cols --- </p>
<p>MccVersion: 0</p>
<p>ID: 0</p>
<p>Company: 0</p>
<p>PortletId: com_healthmap_compass_practices_CompassPracticesPortlet</p>
<p>Roles: Power User,User</p>
<p>Active: true</p></blockquote>
<p>What's strange here is when I do a <strong>SELECT * from
lportal.Portlet</strong> I see data for all columns <strong>
<em>except</em></strong> the <strong>Roles</strong> column... I'm
completely stumped here.. I need the <strong>companyId</strong> in
order to build a redirect link for a specific portlet to another
portlet, but it returns 0 for ALL rows. I was able to access this data
in Liferay 6.2. Is there something wrong with the persistence for the
Portal DB schema?? Am I using the incorrect service builder
persistence Util class?? &l