001
014
015 package com.liferay.portal.model;
016
017
020 public class PortletConstants {
021
022
025 public static final String WAR_SEPARATOR = "_WAR_";
026
027
030 public static final String INSTANCE_SEPARATOR = "_INSTANCE_";
031
032
035 public static final String LAYOUT_SEPARATOR = "_LAYOUT_";
036
037
040 public static final String DEFAULT_PREFERENCES = "<portlet-preferences />";
041
042
045 public static final String USER_PRINCIPAL_STRATEGY_SCREEN_NAME =
046 "screenName";
047
048
051 public static final String USER_PRINCIPAL_STRATEGY_USER_ID = "userId";
052
053
056 public static final String FACEBOOK_INTEGRATION_FBML = "fbml";
057
058
061 public static final String FACEBOOK_INTEGRATION_IFRAME = "iframe";
062
063
068 public static String getRootPortletId(String portletId) {
069 int pos = portletId.indexOf(INSTANCE_SEPARATOR);
070
071 if (pos == -1) {
072 return portletId;
073 }
074 else {
075 return portletId.substring(0, pos);
076 }
077 }
078
079
084 public static String getInstanceId(String portletId) {
085 int pos = portletId.indexOf(INSTANCE_SEPARATOR);
086
087 if (pos == -1) {
088 return null;
089 }
090 else {
091 return portletId.substring(
092 pos + INSTANCE_SEPARATOR.length(), portletId.length());
093 }
094 }
095
096 }