Fórumok

How can I get a friendly url of an organization?

David Haber, módosítva 13 év-val korábban

How can I get a friendly url of an organization?

New Member Bejegyzések: 5 Csatlakozás dátuma: 2010.07.04. Legújabb bejegyzések
Hi,

I am trying to redirect all my users to their community start page.


List<organization> organizations = user.getOrganizations();
// Get name of first organization
String orgName = organizations.get(0).getName();
path = "/web/" + orgName + "/home";
</organization>


This works fine as long as the name is equal to the friendly url of the organization. However if my organization is called "Liferay Inc." for example, the friendly url will be different as the name consists of two words. The redirection does not work anymore.

How can I get the friendly url of an organization or is there any way around this?

Thank you for your help. emoticon
thumbnail
Dong-Jun Kim, módosítva 13 év-val korábban

RE: How can I get a friendly url of an organization?

Junior Member Bejegyzések: 61 Csatlakozás dátuma: 2009.12.23. Legújabb bejegyzések
You can use group object since you can get groupId from organization as well


GroupLocalServiceUtil.getGroup(0).getFriendlyURL()


You can get better idea about how Liferay's friendly url is formed if you look at Group_ table in your liferay database. It will show you all friendly url's for all groups (communities and organizations).
Hope this helps.

Cheers.
Dwayne McFarlane, módosítva 12 év-val korábban

RE: How can I get a friendly url of an organization?

New Member Bejegyzés: 1 Csatlakozás dátuma: 2011.05.09. Legújabb bejegyzések
You can get the group object from the organization object
String friendlyUrl = organizations.get(0).getGroup().getFriendlyURL();