Я пытался расширить BaseFriendlyURLMapper под Liferay5.2 - сервер приложений Jboss4.2 ... Нет проблем с методом buildPath (), но я не могу понять, когда срабатывает populateParams () ... даже в режиме отладки
это мой liferay-portlet.xml
<portlet>
<portlet-name>bookingInterface</portlet-name>
<configuration-action-class>my.package.MyConfiguration
</configuration-action-class>
<!-- -->
<instanceable>false</instanceable>
<private-request-attributes>false</private-request-attributes>
<private-session-attributes>false</private-session-attributes>
<friendly-url-mapper-class>
my.package.MyFriendlyURLMapper
</friendly-url-mapper-class>
<use-default-template>true</use-default-template>
<restore-current-view>true</restore-current-view>
</portlet>
это MyFriendlyURLMapper.java
public class MyFriendlyURLMapper extends BaseFriendlyURLMapper{
private static final String _PORTLET_ID="myPortlet_WAR_myPortlet";
private static final String _PORTLET_MAPPING = "myPortlet";
private static final String _LIFECYCLE_RENDER = "0";
private static final String _LIFECYCLE_ACTION = "1";
private static final String _LIFECYCLE_RESOURCE = "2";
public String getPortletId() {
return _PORTLET_ID;
}
public String getMapping() {
return _PORTLET_MAPPING;
}
public String buildPath(LiferayPortletURL portletURL) {
String friendlyURLPath = null;
String portletId = portletURL.getPortletId();
String action = GetterUtil.getString(portletURL.getParameter("action"));
if(action.equals("step1")){
System.out.println("step1" );
}
friendlyURLPath = StringPool.FORWARD_SLASH +getMapping()
+ StringPool.FORWARD_SLASH + action
;
if (Validator.isNotNull(friendlyURLPath)) {
//parametri da rimuovere dalla portleturl
portletURL.addParameterIncludedInPath("action");
portletURL.addParameterIncludedInPath("p_p_id");
portletURL.addParameterIncludedInPath("p_p_lifecycle");
portletURL.addParameterIncludedInPath("p_p_state");
portletURL.addParameterIncludedInPath("p_p_mode");
portletURL.addParameterIncludedInPath("p_p_col_id");
portletURL.addParameterIncludedInPath("p_p_col_count");
}
}
// return orignal unformatted url
return friendlyURLPath;
}
public void populateParams(String friendlyURLPath, Map<String, String[]> parameterMap) {
System.out.println(friendlyURLPath );
System.out.println(parameterMap.size() );
}
есть подсказка?