This commit is contained in:
Massimiliano Assante 2016-03-24 16:27:37 +00:00
parent 0a194defa5
commit 14a154de13
2 changed files with 3 additions and 12 deletions

View File

@ -1,12 +1,9 @@
package org.gcube.common.portal;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
public class GCubePortalConstants {
public static final String PREFIX_GROUP_URL = "/group";
public static final String GUEST_GROUP_FRIENDLY_URL = "/guest";
public static final String PRIVATE_GROUP_SERVLET_MAPPING = PropsUtil.get(PropsKeys.LAYOUT_FRIENDLY_URL_PRIVATE_GROUP_SERVLET_MAPPING);
public static final String INFRASTRUCTURE_NAME = "infrastructure";

View File

@ -17,13 +17,9 @@ import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.Group;
import com.liferay.portal.model.User;
import com.liferay.portal.model.VirtualHost;
import com.liferay.portal.service.GroupLocalServiceUtil;
import com.liferay.portal.service.LayoutSetLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.service.VirtualHostLocalServiceUtil;
import com.liferay.portal.util.PortalUtil;
@ -37,7 +33,7 @@ import com.liferay.portal.util.PortalUtil;
*/
public class PortalContext {
private static final Logger _log = LoggerFactory.getLogger(PortalContext.class);
public static final String PORTAL_CONTEXT = PortalUtil.getPathContext();
private static PortalContext singleton = new PortalContext();
@ -167,11 +163,9 @@ public class PortalContext {
* @throws SystemException
*/
private static String getGroupFriendlyURL(final HttpServletRequest request, final Group currentGroup) throws PortalException, SystemException {
String friendlyURL = GCubePortalConstants.PRIVATE_GROUP_SERVLET_MAPPING;
String friendlyURL = GCubePortalConstants.PREFIX_GROUP_URL;
StringBundler sb = new StringBundler();
sb.append(PORTAL_CONTEXT);
sb.append(friendlyURL);
sb.append(currentGroup.getFriendlyURL());
sb.append(friendlyURL).append(currentGroup.getFriendlyURL());
return sb.toString();
}
/**