문제

I have defined a configuration-action-class for loading the configuration of an existing portlet based on drools (liferay-portlet.xml):

<configuration-action-class>com.liferay.drools.action.ConfigurationActionImpl</configuration-action-class>

This class is processAction class:

public class ConfigurationActionImpl extends DefaultConfigurationAction {

    @Override
    public void processAction(

Now, I want to add another form with rows (inside the same config.jsp page). Exactly I want to call a different class from all of this rows (A call to SelectRules.java class):

<%
ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
IRRule myRule = (IRRule)row.getObject();
String name = IRRule.class.getName();
String primKey = String.valueOf(myRule.getPrimaryKey());
%>

<liferay-ui:icon-menu>
    <portlet:actionURL name="selectRule" var="selectURL">
        <portlet:param name="resourcePrimKey" value="<%=primKey %>" />
    </portlet:actionURL>
    <liferay-ui:icon image="checked" message="SelectRule" url="<%=selectURL.toString() %>" />
</liferay-ui:icon-menu>

In my portlet.xml I defined the following portlet-class:

<portlet-class>com.myown.oriol.selectrules.portlet.SelectRules</portlet-class>

As you see, the main problem is that actionURL is looking to the configuration-action-class but what I exactly want is to call to the portlet-class(SelectRules.java) function called selectRules.

And the defined class selectRules that I want to call starts this way:

public class SelectRuleClass extends MVCPortlet {

    public void selectRule(
            PortletConfig portletConfig, ActionRequest actionRequest,
            ActionResponse actionResponse)

Do you know what I need to solve this?? I don't know how I can merge this two classes with two different extensions considering that configurationActionImpl.java is already defined by another person.

In resume.. I need to call the function selectRule from configuration.jsp while selecting a Rule to be used. But the configuration-action-class is another one required for loading this existing portlet. And while selecting a rule I get this error...

86 does not have any paths specified

Thank you so much, Oriol

도움이 되었습니까?

해결책

Since the configuration.jsp is rendered by a liferay portlet with name 86 you would need to use <liferay-portlet:actionURL> instead of the simple <portlet:actionURL> since you would need to specify the portlet-name whose action method you need to call from configuration.jsp, something like this:

<liferay-ui:icon-menu>
    <liferay-portlet:actionURL name="selectRule" var="selectURL" portletName="SelectRules_WAR_SelectRulesportlet">
        <liferay-portlet:param name="resourcePrimKey" value="<%=primKey %>" />
    </liferay-portlet:actionURL>
</liferay-ui:icon-menu>

If you have defined <portlet-name>SelectRules</portlet-name> than the attribute portletName of the tag would have value portletName="SelectRules_WAR_SelectRulesportlet", this is the portlet-id which is generated by liferay once you deploy the portlet.

This is liferay's convenient way to call one portlet (SelectRules) from another (86).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top