<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How  many ways are there to find community id in liferay</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=10790552" />
  <subtitle>How  many ways are there to find community id in liferay</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=10790552</id>
  <updated>2026-04-06T18:50:26Z</updated>
  <dc:date>2026-04-06T18:50:26Z</dc:date>
  <entry>
    <title>RE: How  many ways are there to find community id in liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10805093" />
    <author>
      <name>Jay Patel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10805093</id>
    <updated>2011-09-16T12:13:03Z</updated>
    <published>2011-09-16T12:13:03Z</published>
    <summary type="html">One more, if you have reference to themeDisplay:&lt;br /&gt;&lt;br /&gt;themeDisplay.getScopeGroupId()&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jay.</summary>
    <dc:creator>Jay Patel</dc:creator>
    <dc:date>2011-09-16T12:13:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: How  many ways are there to find community id in liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10790876" />
    <author>
      <name>Gurumurthy Godlaveeti</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10790876</id>
    <updated>2011-09-15T11:34:51Z</updated>
    <published>2011-09-15T11:34:51Z</published>
    <summary type="html">Hey &lt;br /&gt;              Thanks to all who gave reply&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;G.murthy</summary>
    <dc:creator>Gurumurthy Godlaveeti</dc:creator>
    <dc:date>2011-09-15T11:34:51Z</dc:date>
  </entry>
  <entry>
    <title>RE: How  many ways are there to find community id in liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10790813" />
    <author>
      <name>Hajri Mohamed</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10790813</id>
    <updated>2011-09-15T11:24:40Z</updated>
    <published>2011-09-15T11:24:40Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;cou can get community id too by simply using long communityId = &lt;pre&gt;&lt;code&gt;PortalUtil.getScopeGroupId(request)&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;regards&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Hajri Mohamed</dc:creator>
    <dc:date>2011-09-15T11:24:40Z</dc:date>
  </entry>
  <entry>
    <title>RE: How  many ways are there to find community id in liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10790729" />
    <author>
      <name>Manikandan S</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10790729</id>
    <updated>2011-09-15T11:16:03Z</updated>
    <published>2011-09-15T11:16:03Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;You can get like,&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
ThemeDisplay themeDisplay= (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
long portletGroupId= themeDisplay.getPortletGroupdId();
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Community Id with name,&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
User user = themeDisplay.getUser();
Layout layout = themeDisplay.getLayout();
Group group = GroupLocalServiceUtil.getGroup( layout.getGroupId() );
String groupname = "";
if( group.isUser() ) groupname = user.getFullName();
if( group.isCommunity() ) groupname = group.getName();
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;And without themeDisplay object,&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;long groupId = GroupLocalServiceUtil.getGroup(communityObj.getCompanyId(), "Guest").getGroupId();&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Hope it will help you&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Manikandan S</dc:creator>
    <dc:date>2011-09-15T11:16:03Z</dc:date>
  </entry>
  <entry>
    <title>How  many ways are there to find community id in liferay</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10790551" />
    <author>
      <name>Gurumurthy Godlaveeti</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10790551</id>
    <updated>2011-09-15T10:39:00Z</updated>
    <published>2011-09-15T10:39:00Z</published>
    <summary type="html">Hello all,&lt;br /&gt;&lt;br /&gt;               I want to know how to find community id . How many ways are there .&lt;br /&gt;              Please send the details &lt;br /&gt;&lt;br /&gt;Thanks &amp;amp; regards&lt;br /&gt;G.murthy</summary>
    <dc:creator>Gurumurthy Godlaveeti</dc:creator>
    <dc:date>2011-09-15T10:39:00Z</dc:date>
  </entry>
</feed>
