Wednesday 5 December 2018


How to Inject OSGi custom services in Custom Portlets in Liferay 7



1) Create a service builder portlet by using servicebuilder plugin.
2) Generate the OSGI service.
3) Goto xxx-service portlet under build.gradle file 
The below dependencies are generated.
dependencies {
        compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
compileOnly group: "com.liferay", name: "com.liferay.osgi.util", version: "3.0.0"
compileOnly group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.6.0"
compileOnly project(":modules:EmployeeApp:EmployeeApp-api")
}
4)  Create a sample Portlet
5) Use the custom services in sample portlet
         Add the below dependencie in sample portlet build.gradle file
        compileOnly project(":modules:EmployeeApp:EmployeeApp-api")
6) Refresh the gradle project

No comments:

Post a Comment

  Inter Portlet Communication (IPC) in Liferay 7.4 Public Render Parameter IPC: 1) Create a new module project -> SenderPortlet 2) In  Se...