Message Boards

Is it possible to show all available communities in the liferay portal??

thumbnail
Enrico Kusnady, modified 12 Years ago.

Is it possible to show all available communities in the liferay portal??

Junior Member Posts: 39 Join Date: 12/6/11 Recent Posts
Hello all,

i am new here.
I am trying to modify and develop the classic liferay theme.

I have a question to ask. Is there any possibility to get all the available communities that has been created ??
I have checked the navigation.vm. There is #foreach ($nav_item in $nav_items). That means all the items from the list nav_items are called.
How can i call all the communities that has been created??

Can anyone help me??

Thank you.
thumbnail
En Rico, modified 12 Years ago.

RE: Is it possible to show all available communities in the liferay portal?

Junior Member Posts: 39 Join Date: 12/6/11 Recent Posts
Hello,

thank you for ur answer.
I am noch trying to change the velocity code in the portal_normal.vm

Based on http://www.liferay.com/web/raymond.auge/blog/-/blogs/journal-vm-template-meets-saxreaderutil now i know how to add a list in velocity code.
On my velocity Code, i wrote this:

# set($groupUtil = $serviceLocator.findService("com.liferay.portal.service.GroupLocalServiceUtil"))

But i got an error:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.liferay.portal.service.GroupLocalServiceUtil' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)
at com.liferay.portal.bean.BeanLocatorImpl.doLocate(BeanLocatorImpl.java:86)
at com.liferay.portal.bean.BeanLocatorImpl.locate(BeanLocatorImpl.java:67)
... 152 more


That means there is no GroupLocalServiceUtil??
I thought this class is in .jar of Liferay that i got.

Any Idea?
thumbnail
En Rico, modified 12 Years ago.

RE: Is it possible to show all available communities in the liferay portal?

Junior Member Posts: 39 Join Date: 12/6/11 Recent Posts
Hello,

Problem is solved..

I wrote this in my portal_normal.vm

#set($mySites = $user.getMySites(10))

#foreach ($mySite IN $mySites)
#if ($mySite.isCommunity())
$mySite.getName()
#end
#end

But my other question is what is the integer parameter inside getMySites( ) ???