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
205a03b2
Commit
205a03b2
authored
Feb 08, 2018
by
saurabh
Browse files
created comment module
parent
3f635168
Changes
8
Show whitespace changes
Inline
Side-by-side
modules/commentModule/.gitignore
0 → 100644
View file @
205a03b2
.gradle/
build/
target/
\ No newline at end of file
modules/commentModule/bnd.bnd
0 → 100644
View file @
205a03b2
Bundle-Name: commentModule
Bundle-SymbolicName: comment
Bundle-Version: 1.0.0
Export-Package: comment.constants
\ No newline at end of file
modules/commentModule/build.gradle
0 → 100644
View file @
205a03b2
dependencies
{
compileOnly
group:
"com.liferay.portal"
,
name:
"com.liferay.portal.kernel"
,
version:
"2.0.0"
compileOnly
group:
"com.liferay.portal"
,
name:
"com.liferay.util.taglib"
,
version:
"2.0.0"
compileOnly
group:
"javax.portlet"
,
name:
"portlet-api"
,
version:
"2.0"
compileOnly
group:
"javax.servlet"
,
name:
"javax.servlet-api"
,
version:
"3.0.1"
compileOnly
group:
"jstl"
,
name:
"jstl"
,
version:
"1.2"
compileOnly
group:
"org.osgi"
,
name:
"osgi.cmpn"
,
version:
"6.0.0"
compile
project
(
":modules:ideaService:ideaService-api"
)
compile
project
(
":modules:projectService:projectService-api"
)
}
modules/commentModule/src/main/java/comment/constants/commentPortletKeys.java
0 → 100644
View file @
205a03b2
package
comment.constants
;
/**
* @author singh
*/
public
class
commentPortletKeys
{
public
static
final
String
comment
=
"comment"
;
}
\ No newline at end of file
modules/commentModule/src/main/java/comment/portlet/commentPortlet.java
0 → 100644
View file @
205a03b2
package
comment.portlet
;
import
comment.constants.commentPortletKeys
;
import
ideaService.model.Ideas
;
import
ideaService.service.IdeasLocalServiceUtil
;
import
projectService.service.ProjectLocalServiceUtil
;
import
com.liferay.asset.kernel.model.AssetEntry
;
import
com.liferay.asset.kernel.service.AssetEntryLocalServiceUtil
;
import
com.liferay.portal.kernel.exception.SystemException
;
import
com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet
;
import
com.liferay.portal.kernel.theme.ThemeDisplay
;
import
com.liferay.portal.kernel.util.WebKeys
;
import
java.io.IOException
;
import
javax.portlet.ActionRequest
;
import
javax.portlet.ActionResponse
;
import
javax.portlet.Portlet
;
import
javax.portlet.PortletException
;
import
javax.portlet.RenderRequest
;
import
javax.portlet.RenderResponse
;
import
org.osgi.service.component.annotations.Component
;
/**
* @author singh
*/
@Component
(
immediate
=
true
,
property
=
{
"com.liferay.portlet.display-category=category.EEN"
,
"com.liferay.portlet.instanceable=true"
,
"javax.portlet.display-name=commentModule"
,
"javax.portlet.init-param.template-path=/"
,
"javax.portlet.init-param.view-template=/view.jsp"
,
"javax.portlet.name="
+
commentPortletKeys
.
comment
,
"javax.portlet.resource-bundle=content.Language"
,
"javax.portlet.security-role-ref=power-user,user"
},
service
=
Portlet
.
class
)
public
class
commentPortlet
extends
MVCPortlet
{
@Override
public
void
doView
(
RenderRequest
renderRequest
,
RenderResponse
renderResponse
)
throws
IOException
,
PortletException
{
try
{
ThemeDisplay
themeDisplay
=
((
ThemeDisplay
)(
renderRequest
.
getAttribute
(
WebKeys
.
THEME_DISPLAY
)));
long
currentUserId
=
themeDisplay
.
getUserId
();
long
layoutRef
=
(
themeDisplay
.
getLayout
().
getPrimaryKey
());
Ideas
idea
=
IdeasLocalServiceUtil
.
getIdeasByLayoutIdRef
(
layoutRef
);
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
);
}
super
.
doView
(
renderRequest
,
renderResponse
);
}
@SuppressWarnings
(
"deprecation"
)
public
void
commentTestSubmit
(
ActionRequest
request
,
ActionResponse
response
)
throws
PortletException
,
SystemException
{
try
{
System
.
out
.
println
(
"comes here"
);
invokeTaglibDiscussion
(
request
,
response
);
}
catch
(
Exception
e
){
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
modules/commentModule/src/main/resources/META-INF/resources/init.jsp
0 → 100644
View file @
205a03b2
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<%@ taglib
uri=
"http://java.sun.com/portlet_2_0"
prefix=
"portlet"
%>
<%@ taglib
uri=
"http://liferay.com/tld/aui"
prefix=
"aui"
%>
<%@taglib
uri=
"http://liferay.com/tld/portlet"
prefix=
"liferay-portlet"
%>
<%@taglib
uri=
"http://liferay.com/tld/theme"
prefix=
"liferay-theme"
%>
<%@taglib
uri=
"http://liferay.com/tld/ui"
prefix=
"liferay-ui"
%>
<%@ taglib
prefix=
"liferay-ui"
uri=
"http://liferay.com/tld/ui"
%>
<%@ taglib
prefix=
"portlet"
uri=
"http://java.sun.com/portlet_2_0"
%>
<liferay-theme:defineObjects
/>
<portlet:defineObjects />
\ No newline at end of file
modules/commentModule/src/main/resources/META-INF/resources/view.jsp
0 → 100644
View file @
205a03b2
<%@ include
file=
"/init.jsp"
%>
<%@ taglib
prefix=
"liferay-ui"
uri=
"http://liferay.com/tld/ui"
%>
<%@ taglib
prefix=
"portlet"
uri=
"http://java.sun.com/portlet_2_0"
%>
<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
modules/commentModule/src/main/resources/content/Language.properties
0 → 100644
View file @
205a03b2
javax.portlet.display-name.commentModule
=
commentModule JSP
javax.portlet.keywords.commentModule
=
commentModule,jsp
javax.portlet.short-title.commentModule
=
commentModule JSP
javax.portlet.title.commentModule
=
commentModule JSP Portlet
commentModule.caption
=
Hello from commentModule JSP!
\ 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