Commit 9170f7cb authored by Elias Englmeier's avatar Elias Englmeier
Browse files
parents f3235107 fba2e0f2
package comment.portlet;
import java.io.IOException;
import java.util.List;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
......@@ -11,6 +12,8 @@ import javax.portlet.RenderResponse;
import org.osgi.service.component.annotations.Component;
import com.liferay.message.boards.kernel.model.MBMessage;
import com.liferay.message.boards.kernel.service.MBMessageLocalServiceUtil;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
import com.liferay.portal.kernel.theme.ThemeDisplay;
......@@ -46,12 +49,20 @@ public class commentPortlet extends MVCPortlet {
long layoutRef = (themeDisplay.getLayout().getPrimaryKey());
Ideas idea = IdeasLocalServiceUtil.getIdeasByLayoutIdRef(layoutRef);
//This is the code we need for fetching all the messages - if ever we need to put it in the UI
/*List<MBMessage> msgs = MBMessageLocalServiceUtil.getMessages(Ideas.class.getName(), idea.getIdeasId(), 0);
for(int i = 0; i < msgs.size(); i++){
if(msgs.get(i).getParentMessageId()!=0){
System.out.println(msgs.get(i).getSubject());
}
}*/
renderRequest.setAttribute("classPK", idea.getIdeasId());
renderRequest.setAttribute("userID", themeDisplay.getUserId());
renderRequest.setAttribute("currentURL", themeDisplay.getURLCurrent());
renderRequest.setAttribute("className", Ideas.class.getName());
}catch(Exception ex){
System.out.println(ex);
}
......
......@@ -6,4 +6,21 @@
<c:set var="currentUrl" value="${currentURL}"/>
<c:set var="class" value="${className}"/>
<portlet:actionURL name="commentTestSubmit" var="discussionURL" />
<liferay-ui:discussion classPK="${classPK}" userId="${userID}" className="${class}" formAction="<%= discussionURL%>" formName="fm2" redirect="${currentUrl}"/>
\ No newline at end of file
<!-- Uncomment this to add a rating system to the comment portlet, can serve as the voting for the module
<liferay-ui:ratings
className= "${class}"
classPK= "${classPK}"
type="stars"
/>
-->
<liferay-ui:discussion
classPK="${classPK}"
userId="${userID}"
className="${class}"
formAction="<%= discussionURL%>"
ratingsEnabled="<%=true%>"
formName="fm2"
redirect="${currentUrl}"
/>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment