Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
civitas-digitalis
platform
Commits
9170f7cb
Commit
9170f7cb
authored
Mar 06, 2018
by
Elias Englmeier
Browse files
Merge branch 'master' of
https://git.fortiss.org/civitas-digitalis/platform
parents
f3235107
fba2e0f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/commentModule/src/main/java/comment/portlet/commentPortlet.java
View file @
9170f7cb
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
);
}
...
...
modules/commentModule/src/main/resources/META-INF/resources/view.jsp
View file @
9170f7cb
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment