A PHP Error was encountered

Severity: Warning

Message: include(gtag.php): Failed to open stream: No such file or directory

Filename: blogs/details.php

Line Number: 4

Backtrace:

File: /home1/atsglobaltspl/public_html/application/views/blogs/details.php
Line: 4
Function: _error_handler

File: /home1/atsglobaltspl/public_html/application/views/blogs/details.php
Line: 4
Function: include

File: /home1/atsglobaltspl/public_html/application/controllers/Blogs.php
Line: 45
Function: view

File: /home1/atsglobaltspl/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: include(gtag.php): Failed to open stream: No such file or directory

Filename: blogs/details.php

Line Number: 4

Backtrace:

File: /home1/atsglobaltspl/public_html/application/views/blogs/details.php
Line: 4
Function: _error_handler

File: /home1/atsglobaltspl/public_html/application/views/blogs/details.php
Line: 4
Function: include

File: /home1/atsglobaltspl/public_html/application/controllers/Blogs.php
Line: 45
Function: view

File: /home1/atsglobaltspl/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: include(): Failed opening 'gtag.php' for inclusion (include_path='.:/opt/cpanel/ea-php81/root/usr/share/pear')

Filename: blogs/details.php

Line Number: 4

Backtrace:

File: /home1/atsglobaltspl/public_html/application/views/blogs/details.php
Line: 4
Function: _error_handler

File: /home1/atsglobaltspl/public_html/application/views/blogs/details.php
Line: 4
Function: include

File: /home1/atsglobaltspl/public_html/application/controllers/Blogs.php
Line: 45
Function: view

File: /home1/atsglobaltspl/public_html/index.php
Line: 315
Function: require_once

Liferay India | Liferay | Liferay Bangalore | Liferay Consulting | Liferay Training | Web Development | Mobile App Development | ERP | eCommerce| Data Science | Digital Marketing

Blogs

List Of Blogs > Custom Headless API in Liferay 7.4

Custom Headless API in Liferay 7.4

umer


Custom Headless API in Liferay 7.4's

Introduction:

In this blog, we'll navigate the terrain of Liferay 7.4's Headless API, demystifying the process of implementing CRUD operations. From effortless data creation to seamless updates and deletions, this streamlined approach empowers developers with straightforward methods to interact with their application's data.

Okay I don’t want to waste your time, Imagine a scenario where managing student data - their Ids, names, and academic standards - becomes effortless. Enter Liferay 7.4's Headless API, offering a streamlined approach to handling CRUD operations within the Student entity created through the Service Builder.

 

Step 1:

  • Create entity into service.xml as shown in below image and an entity name as “student” then build the service after that create instance method in studentLocalServiceImpl.java then finally build the service and deploy it.

 

Step 2:

  • Create Headless API using rest-builder by liferay’s developer studio and then I gave it’s name as student-headless-delivery.

  • After click on finish it will create four folder as shown in below image and then delete “student-headless-delivery-client” and “student-headless-delivery-test”.

  • Into the student-headless-delivery-client -> rest-config.yaml file remove these line as shown in below image.

  • Add this dependency into student-headless-delivery-impl -> build.gradle file as show in below script.

  • After changes done in rest-openapi.yaml file then click the buildREST as shown in below image.

Step 3:

  • After buildREST it will create packages into student-headless-delivery-api and student-headless-delivery-impl then into the impl packages created like that as shown in below image.

  • After that add below script into "StudentResourceImpl.java student-headless-delivery-impl -> src/main/java -> com.student.headless.delivery.internal.resource.v1_0 -> StudentResourceImpl.java" (Click to get code StudentResourceImpl.java.)

  • Finally deploy that both student-headless-delivery-api and student-headless-delivery-impl jar files after builDREST.

Conclusion:

Now, it's your turn to put theory into practice and witness firsthand the transformative capabilities of Liferay 7.4's Headless API and Rest Builder in your development endeavors.



Categories


Archive