Overview This guide walks through creating two OSGi modules in Liferay 7.4 and sharing a Java package between them using the standard API + Implementation pattern. This is the most common and correct approach for exposing reusable services in a Liferay-based architecture. In OSGi, a bundle (module) does not expose its internal packages by default — everything is private unless explicitly exported. To share code between modules, the standard practice is to split functionality into: · An API module — contains interfaces/DTOs and exports the package · A Service (Implementation) module — implements the interface, imports the package, and registers the implementation as an OSGi component/service The consuming module then simply imports the API package and looks up the service using @Reference injection. Step 1: Create the API Module Using Liferay Workspace + Blade CLI, generate a new API module: blade create -t api -p com.sgc.greeting greeting-api This generates a Gradle module unde...
Crud and Search opration in Liferay: -> Liferay use service builder techniq for Crud opration. -> Service builder purform by Service.xml file. -> Service.xml file create table in database and also create class and diffrent method. 1) Create service.xml file. ->Create service.xml file in WEB-INF and write below code. ->CODE: < service-builder package-path = "com.test" > < namespace > qr </ namespace > < entity name = "Searchclass" local-service = "true" ...