aayushdriger
aayushdriger

Reputation: 382

Check if liferay community is active or not

I need check if the community is active or not through code. I am using Liferay 6.0.6 CE.

When I fetch myPlaces using List<Group> myPlaces = user.getMyPlaces(max); I get all the not active communities in the list as well which I don't want. I want only the active communities to be returned in the List.

Upvotes: 0

Views: 138

Answers (1)

Mark
Mark

Reputation: 18767

Sometimes it is necessary to program a little bit self :)

    List<Group> myActivePlaces = new ArrayList<Group>();
    List<Group> myPlaces = user.getMySites();
    for (Group group : myPlaces) {
        if(group.isActive()){
            myActivePlaces.add(group);
        }
    }

Upvotes: 1

Related Questions