Foren
Liferay Webconent discussion (Comments) Issue
venkateshwarlu racha, geändert vor 12 Jahren.
Liferay Webconent discussion (Comments) Issue
Junior Member Beiträge: 52 Beitrittsdatum: 26.07.09 Neueste Beiträge
Hi Everyone,
I implement one custom webconent display portlet and i kept discussion tag for that portlet when iam trying to save comments for each webconent its not saving and its not geting redirect to correspondent URL which i have given in that tag below is my code please help me out any one with this issue.
Thanks
I implement one custom webconent display portlet and i kept discussion tag for that portlet when iam trying to save comments for each webconent its not saving and its not geting redirect to correspondent URL which i have given in that tag below is my code please help me out any one with this issue.
<%
int discussionMessagesCount = MBMessageLocalServiceUtil.getDiscussionMessagesCount(PortalUtil.getClassNameId(JournalArticle.class.getName()), articleDisplay.getResourcePrimKey(), WorkflowConstants.STATUS_APPROVED);
%>
<c:if test="<%= discussionMessagesCount > 0 %>">
<liferay-ui:header title="comments" />
</c:if>
<portlet:actionurl var="discussionURL">
<portlet:param name="struts_action" value="/journal_content/edit_article_discussion" />
</portlet:actionurl>
<liferay-ui:discussion className="<%= JournalArticle.class.getName() %>" classPK="<%= articleDisplay.getResourcePrimKey() %>" formAction="<%= discussionURL %>" ratingsEnabled="<%= enableCommentRatings %>" redirect="<%= currentURL %>" subject="<%= articleDisplay.getTitle() %>" userId="<%= articleDisplay.getUserId() %>" />
Thanks
venkateshwarlu racha, geändert vor 12 Jahren.
RE: Liferay Webconent discussion (Comments) Issue
Junior Member Beiträge: 52 Beitrittsdatum: 26.07.09 Neueste Beiträge
Guys i found solution.
I forgot to add struct action
I forgot to add struct action
/journal_content/edit_article_discussionin my webproject structs-config.xml. and after that need to add below code in proecessAction method.
Object[] args = new Object[] {
new NullWrapper("org.apache.struts.action.ActionMapping"),
new NullWrapper("org.apache.struts.action.ActionForm"),
new NullWrapper("javax.portlet.PortletConfig"), request, response};
try {
PortalClassInvoker
.invoke("com.liferay.portlet.messageboards.action.EditDiscussionAction",
"processAction", args);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}