<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>KHICHAD TECHNOLOGIES</title>
  <link rel="self" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435" />
  <subtitle>KHICHAD TECHNOLOGIES</subtitle>
  <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435</id>
  <updated>2026-04-05T17:35:49Z</updated>
  <dc:date>2026-04-05T17:35:49Z</dc:date>
  <entry>
    <title>Frontend Client Extensions in Liferay 7.4</title>
    <link rel="alternate" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=229879" />
    <author>
      <name>Admin .</name>
    </author>
    <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=229879</id>
    <updated>2025-02-13T11:58:17Z</updated>
    <published>2025-02-12T05:51:00Z</published>
    <summary type="html">&lt;p&gt;   &lt;strong&gt;Overview:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;Liferay 7.4 offers a powerful system for extending its
  functionality with front-end client extensions. This allows developers
  to embed custom JavaScript, CSS, and external frameworks (like React,
  Angular, or Vue.js) directly into the Liferay portal. By leveraging
  this system, you can create dynamic, interactive user interfaces while
  maintaining the core capabilities of Liferay, such as user
  authentication and data security.&lt;/p&gt;
    &lt;p&gt;In this blog, we will explore how to create a front-end client
  extension in Liferay 7.4 using React. By converting a React app into a
  custom web component, we can seamlessly integrate it into the Liferay
  portal. This enables the development of interactive UIs for Liferay
  users while utilizing React's powerful ecosystem.&lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Prerequisite:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;JDK 11&lt;/li&gt;  &lt;li&gt;Liferay Server:
  liferay-dxp-tomcat-2024.q4.0&lt;/li&gt;  &lt;li&gt;Liferay Developer Studio: 
  3.9.7.202207131011-ga8&lt;/li&gt;  &lt;li&gt;Node.js&lt;/li&gt;  &lt;li&gt;React JS&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;What is a Frontend Client Extension in
  Liferay?&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;A frontend client extension in Liferay allows developers to add
  custom functionality to Liferay's frontend without modifying the core
  platform. These extensions can be used to: &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Add custom JavaScript and CSS.&lt;/li&gt;  &lt;li&gt;Integrate with
    external libraries or frameworks.&lt;/li&gt;  &lt;li&gt;Build reusable
    components, such as widgets or portlets, that can be embedded in
    different parts of a Liferay site.&lt;/li&gt;  &lt;li&gt;Extend Liferay's
    default UI and behavior.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;In Liferay 7.4, the frontend client extension system allows you
  to   register custom web components (like React or Angular components)
  and   easily integrate them into the portal.&lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Key Features of Frontend Client Extensions in Liferay
  7.4:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Framework Agnostic&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Supports modern front-end frameworks like React,
      Angular, Vue.js, or even plain JavaScript, giving developers
      flexibility to use their preferred technologies. &lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2. Seamless Integration with Liferay&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Easily integrates custom front-end components into
      Liferay’s environment, allowing for smooth interaction with
      Liferay services, APIs, and theme styles.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;3. Modular Architecture&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Encourages a modular approach to development,
      allowing       for reusable, independent components that can be
      deployed and       maintained separately.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;4. Shadow DOM Support&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Provides Shadow DOM encapsulation for CSS and
      JavaScript, ensuring style and behavior isolation from Liferay’s
      global environment. This prevents conflicts with other portal
    elements.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;5. Single Page Application (SPA)
  Compatibility&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Fully compatible with Liferay’s SPA navigation
      system,       enabling fast, smooth transitions between pages
      without full     reloads.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;6. Deployment via Liferay Workspace&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Simplifies deployment using Liferay Workspace and the
      Blade CLI, streamlining the build and deployment process for
      front-end developers.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;7. Customization and Extensibility&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Offers the ability to customize and extend Liferay’s
      default behavior and UI through custom elements, widgets, and
    portlets.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;8. Access to Liferay APIs and Services&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Provides easy access to Liferay’s REST APIs, OAuth2
      services, and ThemeDisplay objects, enabling dynamic, data-driven
    applications.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;9. Automatic Resource Loading&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Automatically handles loading of JavaScript and CSS
      resources, optimizing performance and reducing manual
    configuration.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Types of Frontend Client Extensions&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;JavaScript:&lt;/strong&gt; Include custom
    JavaScript     code for     specific functionalities.&lt;/li&gt;  &lt;li&gt;
    &lt;strong&gt;CSS:&lt;/strong&gt; Add custom CSS styles to specific pages or the
    entire platform.&lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Theme CSS:&lt;/strong&gt; Modify
    the existing Liferay theme by     adding custom CSS styles.&lt;/li&gt;
    &lt;li&gt;     &lt;strong&gt;Theme Favicon:&lt;/strong&gt; Change the favicon
    displayed in the     browser tab.&lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Custom
    Element:&lt;/strong&gt; Register and integrate external     applications
    as widgets within Liferay.&lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;IFrame:&lt;/strong&gt;
    Embed external content within a dedicated     frame on a Liferay
  page.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229893"
  src="https://khichad.com/documents/portlet_file_entry/135001/20+Workflow+Diagram+Image+%281%29.png/77cfc7e1-ea4a-8f91-3f66-4d36812c74a0"&gt;
  &lt;br&gt; &lt;strong&gt;Steps to implement a front-end client extension in
    Liferay 7.4:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Create a Workspace Project:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open Liferay Developer Studio and start the server.&lt;/li&gt;
    &lt;li&gt;Navigate to File → New → Liferay Workspace Project&lt;/li&gt;
    &lt;li&gt;Provide a project name (e.g., global-workspace) and click
  Finish.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2. Install Node.js:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Ensure Node.js is installed on your system.&lt;/li&gt;  &lt;li&gt;You
    can download it from &lt;a href="https://nodejs.org/" target="_blank"
  rel="noopener noreferrer"&gt;nodejs.org&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;3. Create a Client Extension Folder:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Inside the workspace, create a new folder named
  client-extension.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;4. Create a React App in the Client Extension
  Folder:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open your terminal and navigate to the client-extension
  folder.&lt;/li&gt;  &lt;li&gt;Run the following command to create a new React app
    inside this folder: &lt;strong&gt;Command: npx create-react-app
    my-react-app.&lt;/strong&gt;   &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;5. Update index.js:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;     &lt;img data-fileentryid="229913"
    src="https://khichad.com/documents/portlet_file_entry/135001/5.+update+index.js.png/a2286ff9-1af2-e26c-5bd6-b680b78a914d"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;The WebComponent class extends the HTMLElement class to
    manage the lifecycle of the custom React element, ensuring correct
    mounting and unmounting for improved performance.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;6. Update index.html:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;     &lt;img data-fileentryid="229922"
    src="https://khichad.com/documents/portlet_file_entry/135001/6.+update+index.html.png/ce582aae-b257-a2ea-ce7f-78da3b0915a0"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Modify index.html to register the React custom element.
    This     ensures that when the browser encounters
    &amp;lt;employee-management-react-custom-element&amp;gt;, it renders the
    React application.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;7. Create the client-extension.yaml File:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;At the root of your React app, create
    client-extension.yaml.     This file configures how Liferay loads
    the custom element:&lt;br&gt;  &lt;br&gt;       &lt;img data-fileentryid="229931"
    src="https://khichad.com/documents/portlet_file_entry/135001/7.+client-extension.yaml+file.png/5e59653e-1025-1f26-e7bc-d57968753693"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;a. Assemble Section&lt;/strong&gt;   &lt;br&gt; This section
  defines how static assets (like CSS, JS, and images)   are packaged
  for deployment. &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;from: build/static&lt;/strong&gt;       &lt;br&gt;
      Specifies the source directory where static files are
      generated, typically from a React build (npm run build). &lt;/p&gt;
  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;into: static&lt;/strong&gt;       &lt;br&gt;
      Indicates the destination directory where these files will
      be placed in the final build output.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;b. Custom Element Configuration
  (my-react-custom-element1)&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;cssURLs:&lt;/strong&gt; &lt;br&gt;
      css/main.*.css:       Points to the main       CSS file generated
      during the React       build. The asterisk (*) is a       wildcard
      matching hashed       filenames like main.a1b2c3.css for cache
    busting. &lt;/p&gt;  &lt;/li&gt;     &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;friendlyURLMapping:
      my-react-custom-element1&lt;/strong&gt;       &lt;br&gt;  Defines a
      user-friendly URL slug for accessing the custom       element,
      useful in platforms like Liferay for direct     navigation. &lt;/p&gt;
  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;htmlElementName:
      my-react-custom-element1&lt;/strong&gt;       &lt;br&gt;  Specifies the name
      of the custom HTML tag used to embed this       component in your
    HTML. &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;instanceable:
      false&lt;/strong&gt;       &lt;br&gt;  Indicates that the custom element
      cannot be added multiple       times on the same page. Setting it
      to true would allow multiple     instances. &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;
        &lt;strong&gt;name: My React Custom Element1&lt;/strong&gt;       &lt;br&gt;  The
      display name of the custom element in the admin       interface
      (e.g., Liferay Control Panel). &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;
        &lt;strong&gt;portletCategoryName:
      category.client-extensions&lt;/strong&gt; &lt;br&gt;  Specifies the category
      under which this custom element will be listed in the admin panel.
      Here, it's under Client Extensions. &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;
        &lt;strong&gt;type: customElement&lt;/strong&gt;       &lt;br&gt;  Indicates that
      this extension is a Custom Element (Web     Component). &lt;/p&gt;
  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;urls:&lt;/strong&gt;       &lt;br&gt;
      js/main.*.js: Points to the main JavaScript bundle generated
      by the React build. The wildcard (*) handles hashed file names for
      cache management. &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;useESM:
      true&lt;/strong&gt;       &lt;br&gt;  Instructs the system to use ES Modules
      (ESM), a modern       JavaScript module format that enhances
      performance and       compatibility with modern browsers. &lt;/p&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt; 8. Test Headless API:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open a browser and navigate to: &lt;a
      href="http://localhost:8080/o/api/" target="_blank"
  rel="noopener noreferrer"&gt;http://localhost:8080/o/api/&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;Click on the REST APPLICATION tab. &lt;/li&gt;  &lt;li&gt;Click on
    employee-rest/v1.0 to view and test the API. &lt;/li&gt;  &lt;li&gt;You can
    follow our blog for a detailed guide on creating headless APIs. &lt;a
      href="https://www.khichad.com/insights/-/blogs/crud-operation-with-headless-rest-api-in-liferay?_com_liferay_blogs_web_portlet_BlogsPortlet_redirect=https%3A%2F%2Fwww.khichad.com%2Finsights%3Fp_p_id%3Dcom_liferay_blogs_web_portlet_BlogsPortlet%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview"
      target="_blank" rel="noopener noreferrer"&gt;Read more here&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;9. Create a Test.js file: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Navigate to the src folder inside your React app: &lt;/li&gt;
    &lt;li&gt;Create a new folder named utils inside src. &lt;/li&gt;  &lt;li&gt;Inside
    the utils folder, create a new file named test.js. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;10. Create API Functions in test.js:&lt;br&gt; Inside
  src/utils/test.js,   create API functions:&lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;a.  addObject(object): &lt;/strong&gt;Adds a new employee
  via POST.&lt;/p&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229940"
  src="https://khichad.com/documents/portlet_file_entry/135001/1.+addEmployee+request.js+%281%29.png/a2abf7de-0950-70f9-aa7e-3c1294e306ce"&gt;
  &lt;br&gt; &lt;br&gt; &lt;strong&gt;b. getEmployees(): Fetch All Employees&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;     &lt;img data-fileentryid="229951"
    src="https://khichad.com/documents/portlet_file_entry/135001/2.+get+all+employees+request.js.png/f3e12acb-c561-c486-ce97-3ae03a362ca3"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;c. deleteEmployee(employeeId):&lt;/strong&gt; Deletes an
  employee   via DELETE.&lt;/p&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229960"
  src="https://khichad.com/documents/portlet_file_entry/135001/3.+deleteEmployee+request.js.png/e5645ca9-eeb2-2a8c-25dc-07a4c431f41a"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;d. updateEmployee(employeeData):&lt;/strong&gt; Updates an
  employee   via PUT.&lt;/p&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229969"
  src="https://khichad.com/documents/portlet_file_entry/135001/4.+updateEmployee+request.js.png/3fe0f7c3-8179-06c3-b729-c34b411042d6"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;11. Create Individual CRUD Components&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;AddStudent.js:&lt;/strong&gt; Create the
    AddEmployee.js component     to handle adding new employees.&lt;br&gt;
    &lt;br&gt;  &lt;img data-fileentryid="229978"
    src="https://khichad.com/documents/portlet_file_entry/135001/8.+addEmployee1.png/ac07f449-bd08-35e8-d713-3b6eebe3c652"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="229987"
    src="https://khichad.com/documents/portlet_file_entry/135001/9.+addEmployee2.png/a0ca6cea-9911-25b4-736c-46c2442b0787"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="229996"
    src="https://khichad.com/documents/portlet_file_entry/135001/10+addEmployee3.png/c7f7f820-f61a-233c-b76d-e9de914f9d44"&gt;
    &lt;br&gt;   &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;EmployeeList.js:&lt;/strong&gt; This
    component displays the     employee list and includes the logic to
    delete employees from the     list.&lt;br&gt;  &lt;br&gt;  &lt;img
      data-fileentryid="230007"
    src="https://khichad.com/documents/portlet_file_entry/135001/11+getAllEmployee1.png/5e603d42-3c08-fad8-6696-440248eb3ca4"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="230018"
    src="https://khichad.com/documents/portlet_file_entry/135001/12+getAllEmployee+2.png/d822cdd9-2eca-e8f2-ce1c-072eeda5d3c9"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="230027"
    src="https://khichad.com/documents/portlet_file_entry/135001/13+getAllEmployee3.png/2e12273b-22ed-b380-b080-bb56b8cc0371"&gt;
    &lt;br&gt;   &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;UpdateEmployee.js:&lt;/strong&gt; Create
    the UpdateEmployee.js     component to update existing employee
    records.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="230036"
    src="https://khichad.com/documents/portlet_file_entry/135001/14+updateEmployee+1.png/8ff5baf0-5d6b-8109-40c5-d12e2de2d9ee"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="230045"
    src="https://khichad.com/documents/portlet_file_entry/135001/15+updateEmployee+2.png/bc0d851d-6f9a-3dbe-2e57-9454709f46e1"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="230054"
    src="https://khichad.com/documents/portlet_file_entry/135001/16+updateEmployee+3.png/bb6648ac-4c69-e04b-dd55-51862dc9eac2"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="230063"
    src="https://khichad.com/documents/portlet_file_entry/135001/17+updateEmployee4.png/89f97520-cc6d-779f-b759-63cfbccadbef"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;12. Build the Client Extension &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Delete the node_modules folder from the React app. &lt;/li&gt;
    &lt;li&gt;Open Gradle Task Executor in Liferay Developer Studio. &lt;/li&gt;
    &lt;li&gt;Navigate to Client-Extension -&amp;gt;
  employee-management-app. &lt;/li&gt;  &lt;li&gt;Under the Build section, click on
    Build to execute the build task. &lt;/li&gt;  &lt;li&gt;After a successful
    build, a zip file employee-management-app.zip i will be generated in
    the dist directory.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="230072"
    src="https://khichad.com/documents/portlet_file_entry/135001/18+employeeManagement.zip+file.png/3c66746e-3778-d678-7b75-15af41b2389c"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;13. Deploy the Client Extension &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open Gradle Task Executor in Liferay Developer
  Studio. &lt;/li&gt;     &lt;li&gt;Navigate to Client-Extension -&amp;gt;
  employee-management-app. &lt;/li&gt;  &lt;li&gt;Under the Build section, click on
    Deploy to execute the deployment task. &lt;/li&gt;  &lt;li&gt;After deployment,
    the client extension will be available on the Liferay server. You
    can confirm that it has been properly configured from the
    workspace.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="230081"
    src="https://khichad.com/documents/portlet_file_entry/135001/19+client+extension+in+portal.png/6be42cdf-a5af-0b0a-a581-bf8fd6ec7d47"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;div class="overflow-auto portlet-msg-info"&gt;If you have any query,
    &lt;a href="https://khichad.com/contact-us"&gt;click here&lt;/a&gt;&lt;/div&gt;</summary>
    <dc:creator>Admin .</dc:creator>
    <dc:date>2025-02-12T05:51:00Z</dc:date>
  </entry>
  <entry>
    <title>Custom Permission in Liferay 7.4</title>
    <link rel="alternate" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=228767" />
    <author>
      <name>Admin .</name>
    </author>
    <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=228767</id>
    <updated>2025-02-11T09:43:25Z</updated>
    <published>2025-02-10T05:24:00Z</published>
    <summary type="html">&lt;p&gt;   &lt;strong&gt;Overview:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;Custom permissions in Liferay 7.4 empower developers to create
  advanced access control mechanisms that go beyond the platform's
  default settings. Using Liferay’s robust permission framework,
  developers can define specific rules and actions for portlets, model
  instances, or other resources. This capability ensures that
  permissions align precisely with business workflows, enhancing
  security and enabling granular, role-based access control for users.
  By tailoring permissions to suit unique application requirements,
  Liferay 7.4 provides a scalable and flexible solution for managing
  access to sensitive data and features. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Prerequisite:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;JDK 11 &lt;/li&gt;  &lt;li&gt;Liferay Server:
  liferay-dxp-tomcat-7.4.13.u92 &lt;/li&gt;  &lt;li&gt;Liferay Developer Studio: 
  3.9.7.202207131011-ga8&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;How Custom Permissions Work&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;Liferay's permission system operates on the principle of actions
  and resources: &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Actions:&lt;/strong&gt; These represent operations that
  can be   performed, such as VIEW, UPDATE, DELETE, or custom-defined
  actions   like ADD_COMMENT or EXPORT_DATA. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;2. Resources:&lt;/strong&gt; These can be:&lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;Portlet Resources:&lt;/strong&gt; Access to the
    portlet itself and     its associated features. &lt;/li&gt;  &lt;li&gt;
      &lt;strong&gt;Model Resources:&lt;/strong&gt; Access to specific entities,
    such     as a blog entry, user profile, or custom object. &lt;/li&gt;
    &lt;li&gt;     &lt;strong&gt;File or Data Resources:&lt;/strong&gt; Access to files,
    documents,     or other forms of data. By combining these elements,
    developers can     define who (roles/users) can do what (actions) on
    a specific   resource.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Features of Custom Permissions&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Role-Based Control&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Permissions can be assigned to roles such as
    Administrator,     Guest, Power User, or custom-defined roles. This
    ensures that access     aligns with user responsibilities.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2. Granular Access Levels&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Developers can define permissions not only at a high level
    (e.g., portlet-level) but also at the entity or field level within a
  model. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;3. Dynamic Management&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Permissions can be adjusted dynamically through the
    Liferay     Control Panel or programmatically using APIs. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;4. Integration with Workflow&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Custom permissions integrate seamlessly with Liferay’s
    workflow system, enabling conditional access based on the state of a
  resource.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;5. Guest and User Differentiation&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Actions available to guests (unauthenticated users) and
    authenticated users can be defined separately, providing an
    additional layer of control.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Steps to Implement Custom Permissions in
  Liferay:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Start the Liferay Developer Studio:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open Liferay Developer Studio. &lt;/li&gt;  &lt;li&gt;Start the
    Liferay     server by navigating to the Servers tab and clicking on
    the Start     button.   &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2. Create a Workspace Project:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open Liferay Developer Studio and start the server.&lt;/li&gt;
    &lt;li&gt;Navigate to File → New → Liferay Workspace Project.&lt;/li&gt;
    &lt;li&gt;Provide a project name (e.g., global-workspace) and click
  Finish.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;3. Create a Service Builder&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Go to File → New → Liferay Module Project.&lt;/li&gt;
    &lt;li&gt;Choose     the Service Builder template, provide the project
    name (e.g.,     customer-service), and click Finish.&lt;/li&gt;  &lt;li&gt;Enter
    the class and     package name.&lt;/li&gt;  &lt;li&gt;Modify the service.xml
    file to define an     entity (e.g. Customer) with attributes. Set
    the remote-service     attribute to true.&lt;br&gt;  &lt;br&gt;  &lt;img
      data-fileentryid="228772"
    src="https://khichad.com/documents/portlet_file_entry/135001/1.+service.xml+%281%29.png/73c2176e-0472-57f8-a423-fdef932bf1ce"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;4. Build the ServiceBuilder Module&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open Gradle Task Executor in Liferay Developer
  Studio.&lt;/li&gt;     &lt;li&gt;In the Gradle Task Executor, navigate to
  Modules.&lt;/li&gt;  &lt;li&gt;Go     to the customer Service module.&lt;/li&gt;
    &lt;li&gt;Under the customer Service     module, go to the Build
  section.&lt;/li&gt;  &lt;li&gt;Click on Build Service to     execute the build
  task.&lt;/li&gt;  &lt;li&gt;Refresh the Gradle project to     generate necessary
    packages and classes.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="228792"
  src="https://khichad.com/documents/portlet_file_entry/135001/3.+generated+service+builder+methods.png/ea12eabc-a7f3-ba28-a65e-f53435b49a7e"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;5. Define Custom Resource Actions in a Service Builder
  Module&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Create a resource-actions folder under
    src/main/resources/META-INF/ in your module. &lt;/li&gt;  &lt;li&gt;After
    creating the resource-actions folder, create the default.xml file
    within it.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="228801"
  src="https://khichad.com/documents/portlet_file_entry/135001/4.+default.xml+in+service+builder.png/0588bdbc-da0f-0275-1e4c-5707e596474c"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;6. Configuring Resource Actions &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Specify the resource.actions.configs property in
    portal.properties to map your custom resource actions.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="228810"
  src="https://khichad.com/documents/portlet_file_entry/135001/5.+resource+configs.png/d3124c42-3299-889b-ee1f-fd60e436b929"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;7. Enforce Permissions in the Service Layer &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Use the Permission Checker API in your service methods to
    enforce permissions. &lt;/li&gt;  &lt;li&gt;Add Customer:&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="228819"
  src="https://khichad.com/documents/portlet_file_entry/135001/6.+service+builder+add+code.png/a422ee50-8f05-e4c1-a92e-b126ad5ff975"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Delete Customer:&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="228828"
  src="https://khichad.com/documents/portlet_file_entry/135001/7.+delete+customer+service+builder.png/6aa41d33-5e1f-5180-9515-05e91a9ea9ca"&gt;
  &lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="228837"
  src="https://khichad.com/documents/portlet_file_entry/135001/8.+deleted+customer+service+builder+2.png/633875c9-5ce6-8c33-07da-6490c9cb3b1a"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;8. Create a Portlet:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Navigate to File → New → Liferay Module Project. &lt;/li&gt;
    &lt;li&gt;Provide a project name (e.g., customer-portlet) and click
  Finish. &lt;/li&gt;  &lt;li&gt;Enter the class and package name.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;9. Integrate Service Builder with the Portlet&lt;br&gt; &lt;br&gt;
      &lt;img data-fileentryid="228846"
    src="https://khichad.com/documents/portlet_file_entry/135001/10.+integrate+service+builder+with+portlet.png/fda719e8-c0a1-5ca8-ff7a-32a775b99a21"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;10 .Define Custom Resource Actions in the portlet
  module:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Create a resource-actions folder under
    src/main/resources/META-INF/ in your module.&lt;/li&gt;  &lt;li&gt;After
    creating the resource-actions folder, create the default.xml file
    within it.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="228857"
    src="https://khichad.com/documents/portlet_file_entry/135001/9.+default.xml+in+portlet.png/788354bf-1e1f-e386-045a-d4d2957df427"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;11. Configuring Resource Actions in the
  portlet &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;To define custom permissions for your Liferay module, you need to
  map the resource actions to their corresponding configurations. This
  is achieved by specifying the resource.actions.configs property in the
  portal.properties file.&lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="228876"
  src="https://khichad.com/documents/portlet_file_entry/135001/5.+resource+configs+%281%29.png/4cdd0e38-feca-419e-7b3f-6171ab7442d2"&gt;
  &lt;br&gt; &lt;br&gt; &lt;strong&gt;12. Implement add, delete, and get Methods in the
    MVC Portlet:&lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="228885"
    src="https://khichad.com/documents/portlet_file_entry/135001/11.+implement+mvc+portlet.png/e85d40cb-e833-5a52-e6cd-02d7f97ee818"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;13. Creating Views with JSP and Adding
  Permissions &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;Init.jsp:&lt;/strong&gt;  init.jsp file is a JSP
    file that     initializes the portlet. It defines some taglibs and
    retrieves the     mainRequire attribute set in the Java code.&lt;br&gt;
    &lt;br&gt;  &lt;img data-fileentryid="229070"
    src="https://khichad.com/documents/portlet_file_entry/135001/12.+init.jsp+1+%281%29.png/40f7c47c-1af9-85c0-56a3-22fbbbabc321"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="229081"
    src="https://khichad.com/documents/portlet_file_entry/135001/13.int.jsp+2+%281%29.png/8b56994d-639f-c119-b188-740c6e1f912d"&gt;
    &lt;br&gt;   &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;View.jsp:&lt;/strong&gt; The view.jsp file
    is used to display the     data to the user.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229090"
  src="https://khichad.com/documents/portlet_file_entry/135001/14.+view.jsp1+%281%29.png/4b54a5fb-076a-d075-c459-9f26e9f64315"&gt;
  &lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="229099"
  src="https://khichad.com/documents/portlet_file_entry/135001/15.+view.jsp2+%281%29.png/145948c9-41e4-961f-ce70-eeb2d40600fc"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Add Customer:&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="229108"
    src="https://khichad.com/documents/portlet_file_entry/135001/16.+add+customer+%281%29.png/18743dff-acd0-ed09-069e-63321a0e88fe"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;14. Deploy the portlet (Customer-portlet):&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Deploy the portlet module using the Gradle Task
  Executor. &lt;/li&gt;  &lt;li&gt;Add the portlet to a page.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229126"
  src="https://khichad.com/documents/portlet_file_entry/135001/17.+deploy+portlet+%281%29.png/e685f137-48ef-7bf7-c930-5f21c6ac7737"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;15. Assign Permissions via Control Panel&lt;/strong&gt;
  &lt;br&gt; After implementing custom permissions and permission checks in
  your portlet, you need to assign these permissions to specific roles
  (e.g., power-user, administrator) or individual users in Liferay. This
  can easily be done through the Control Panel. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;a. Creating a User and Assigning a Role.&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Navigate to the Control Panel and click on Users and
  Organizations.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229135"
  src="https://khichad.com/documents/portlet_file_entry/135001/18.+create+user+%282%29.png/fe87dc81-7cee-6450-70d9-722ccdb0369a"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Click on the (+) icon and add the necessary user
  information.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229144"
  src="https://khichad.com/documents/portlet_file_entry/135001/19+add+necessary+info+of+user+%281%29.png/9dcac32c-ffad-3dec-3f9c-11ef5d5b01bd"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;​​​​Click on Save and assign the custom permission role to
    the user you created.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="229153"
    src="https://khichad.com/documents/portlet_file_entry/135001/21+assign+role+%281%29.png/bffb9777-05ae-4578-041a-7063dccf8846"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;b. Set the permission:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Now, go to Control Panel &amp;gt; Roles &amp;gt; Regular
      Roles       and navigate to your role (e.g., 'Customer Custom
      Permission').&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="229162"
      src="https://khichad.com/documents/portlet_file_entry/135001/22.+check+role+%281%29.png/ece56628-bf44-31f1-041e-4a6fb36a88d9"&gt;
      &lt;br&gt;   &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;Go to Define Permissions and search for
    your application (e.g., 'Customer'). &lt;/li&gt;  &lt;li&gt;Set the application
    and resource permissions. &lt;/li&gt;  &lt;li&gt;Then, go to Assignees and
    assign the permissions to the user.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;c. Test Your custom permission:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Log in as your user (Test1 user). &lt;/li&gt;  &lt;li&gt;First, set
    the     application permissions: action.ADD_CUSTOMER, view customer,
    and     delete customer.&amp;quot; &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229171"
  src="https://khichad.com/documents/portlet_file_entry/135001/23.+set+permission+%281%29.png/b1585bac-2dd0-a057-dd26-38c95a769e53"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Now, go to the page of the site where your portlet is
  available &lt;/li&gt;  &lt;li&gt;Here, you should be able to view the customer,
    add a customer, and delete a customer.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="229180"
  src="https://khichad.com/documents/portlet_file_entry/135001/24.+test+permission+%282%29.png/0075b663-60f8-2759-b4d7-ac631b02b9e1"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Here, I changed the permissions to only allow viewing
      and adding a customer.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="229189"
      src="https://khichad.com/documents/portlet_file_entry/135001/25.+without+delete+permission+%281%29.png/ffbc1504-191d-9d6e-7d23-79bfbff406ec"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Now, I modified the permissions to only allow
      viewing and adding a customer. As a result, the delete button is
      no longer visible because I did not grant the delete permission in
      the application permissions.&lt;br&gt;  &lt;br&gt;  &lt;img
        data-fileentryid="229198"
      src="https://khichad.com/documents/portlet_file_entry/135001/30+delete+permission+btn+disaaper+%281%29.png/5117ac8d-989c-954f-d351-88b1df6eff5d"&gt;
      &lt;br&gt;   &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Next, set the resource permission to
      allow only view permissions.&lt;br&gt;  &lt;img data-fileentryid="229207"
      src="https://khichad.com/documents/portlet_file_entry/135001/26.+resource+permission+%281%29.png/58eb4cd8-956d-bae9-932a-92bfd6a64d9c"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Now, I can only view the customer and cannot
      delete the customer. If I try to click the delete button, an error
      will be shown stating that the user does not have permission to
      delete the customer.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="229216"
    src="https://khichad.com/documents/portlet_file_entry/135001/27.+got+error+to+delete+%282%29.png/36155ccd-cfad-44a3-1bfd-6b242da9f024"&gt;​​​​​​&lt;/p&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;div class="overflow-auto portlet-msg-info"&gt;If you have any query,
    &lt;a href="https://khichad.com/contact-us"&gt;click here&lt;/a&gt;&lt;/div&gt;</summary>
    <dc:creator>Admin .</dc:creator>
    <dc:date>2025-02-10T05:24:00Z</dc:date>
  </entry>
  <entry>
    <title>CRUD Operations Using React Portlet in Liferay 7.4</title>
    <link rel="alternate" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=228022" />
    <author>
      <name>Admin .</name>
    </author>
    <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=228022</id>
    <updated>2025-02-11T06:27:00Z</updated>
    <published>2025-02-08T05:38:00Z</published>
    <summary type="html">&lt;p&gt;   &lt;strong&gt;Overview:&lt;/strong&gt; &lt;/p&gt;
      &lt;p&gt;A React portlet in Liferay 7.4 enables developers to build
  modern,   interactive user interfaces by leveraging React’s
  capabilities within   the Liferay DXP platform. These portlets enhance
  user experience   through dynamic and reusable components, optimized
  performance, and   seamless integration with Liferay's backend
  services and APIs. With   support for modern front-end technologies,
  react portlets provide   flexibility, efficiency, and maintainability,
  making them a popular   choice for web application development. This
  blog explores how to   implement CRUD (Create, Read, Update, Delete)
  operations using a React   portlet in Liferay 7.4. &lt;/p&gt;
      &lt;p&gt;   &lt;strong&gt;Prerequisite:&lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;JDK 11 &lt;/li&gt;  &lt;li&gt;Liferay Server:
  liferay-dxp-tomcat-2024.q4.0 &lt;/li&gt;  &lt;li&gt;Liferay Developer Studio: 
  3.9.7.202207131011-ga8 &lt;/li&gt;  &lt;li&gt;Node.js &lt;/li&gt;  &lt;li&gt;React&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;Steps to Perform CRUD Operations Using a React
    Portlet     in     Liferay 7.4:&lt;/strong&gt; &lt;/p&gt;
      &lt;p&gt;   &lt;strong&gt;1. Create a Workspace Project:&lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Open Liferay Developer Studio and start the
  server. &lt;/li&gt;     &lt;li&gt;Navigate to File → New → Liferay Workspace
  Project &lt;/li&gt;     &lt;li&gt;Provide a project name (e.g., global-workspace)
    and click   Finish.&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;2. Create a Service Builder Module&lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Go to File → New → Liferay Module Project. &lt;/li&gt;
    &lt;li&gt;Choose     the Service Builder template, enter the project name
    (e.g.,     react-crud-service), and click Next. &lt;/li&gt;  &lt;li&gt;Enter the
    class name     and package name, then click Finish. &lt;/li&gt;  &lt;li&gt;The
    necessary file     structure for Service Builder will be
    automatically created.&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;3. Add a Student Entity in service.xml &lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Modify the service.xml file to include the Student
    entity     definition. This will enable the automatic generation of
    service     layers for handling CRUD operation.&lt;br&gt;  &lt;img
      data-fileentryid="228027"
    src="https://khichad.com/documents/portlet_file_entry/135001/2.+service.xml.png/801330d6-117a-592c-faa4-0e3115890616"&gt;
  &lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;4. Build the ServiceBuilder Module&lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Open Gradle Task Executor in Liferay Developer
  Studio. &lt;/li&gt;     &lt;li&gt;Navigate to Modules → react-crud-service.&lt;/li&gt;
    &lt;li&gt;Under the     Build section, click on Build Service to execute
    the build   task.&lt;/li&gt;  &lt;li&gt;Under the react-crud-service module, go
    to the Build   section. &lt;/li&gt;  &lt;li&gt;Click on Build Service to execute
    the build   task.&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;img data-fileentryid="228036"
    src="https://khichad.com/documents/portlet_file_entry/135001/3.+build+service.png/1e0eb6b1-852b-fc4c-9397-bc3675d43e03"
    style="height: auto;width: 255.0px;" width="255"&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;​​Refresh the Gradle project to generate necessary
    packages     and classes.&lt;br&gt;  &lt;img data-fileentryid="228054"
    src="https://khichad.com/documents/portlet_file_entry/135001/1.+service+builder+file+structure.png/527d2dd8-5473-4c7d-aff2-b399dc7de385"&gt;
  &lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;5. Implement the business logic for Create, Read,
    Update, and     Delete (CRUD) operations in the remote service layer
    of the Service Builder.&lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Create: Add logic to save a new student entity to the
  database.&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;img data-fileentryid="228075"
  src="https://khichad.com/documents/portlet_file_entry/135001/4.+add+student+in+db+%281%29.png/0e1bf25a-879f-c696-5118-5bdf06d813ed"&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;​​​​​​Read: Fetch all students from the database.&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;img data-fileentryid="228084"
  src="https://khichad.com/documents/portlet_file_entry/135001/5.+getAll+student.png/bf3220ad-85f8-cc9d-5cc1-665a7303e11e"&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Update: Modify an existing student.&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;img data-fileentryid="228093"
  src="https://khichad.com/documents/portlet_file_entry/135001/6.+update+student.png/388e0fc6-6a23-e4e4-e9b5-92dd8c4cc918"&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Delete: Remove a student by studentId.&lt;br&gt;  &lt;img
      data-fileentryid="228102"
    src="https://khichad.com/documents/portlet_file_entry/135001/7.+delete+student.png/8a19776a-9434-dd1a-6201-612b220cd3e9"&gt;
  &lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;6. Create a React Portlet:&lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Navigate to File → New → Liferay Module Project. &lt;/li&gt;
    &lt;li&gt;Provide a project name (e.g., student-react-portlet) and click
  Finish. &lt;/li&gt;  &lt;li&gt;Select Project Template Name as react-portlet and
    click Next. &lt;/li&gt;  &lt;li&gt;Enter the class name and package name, then
    click Finish. &lt;/li&gt;  &lt;li&gt;The necessary file structure for the React
    portlet will be created.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="228111"
    src="https://khichad.com/documents/portlet_file_entry/135001/8.+react-portlet+file+struc.png/00c39c8f-4d02-7757-c0a1-254b893f5606"&gt;
  &lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;7. Rendering Your Component:&lt;/strong&gt; &lt;/p&gt;
      &lt;p&gt;Index.js file: Modify the index.js file to render your React
  component within the Liferay framework.&lt;br&gt; &lt;img
    data-fileentryid="228120"
  src="https://khichad.com/documents/portlet_file_entry/135001/9+index.js.png/2ccf6baf-98ce-66fe-4663-1fc256684749"&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;App.js (Main Application
    Component):&lt;/strong&gt;     This file     serves as the root of your
    React application and can     manage routing,     state, and global
    context.&lt;br&gt;  &lt;img data-fileentryid="228129"
    src="https://khichad.com/documents/portlet_file_entry/135001/10+app.js.png/6688d7b7-9eec-140d-56fd-674d21eef15a"&gt;
    &lt;br&gt;   &lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;8. Create Individual CRUD Components &lt;/strong&gt; &lt;/p&gt;
      &lt;p&gt;   &lt;strong&gt;AddStudent.js:&lt;/strong&gt; Create the AddStudent.js
  component to   handle adding new students.&lt;br&gt; &lt;br&gt; &lt;img
    data-fileentryid="228140"
  src="https://khichad.com/documents/portlet_file_entry/135001/11+add+student+1.png/e605a4fa-0792-7f94-e6ab-e7455c6c236c"&gt;
  &lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="228151"
  src="https://khichad.com/documents/portlet_file_entry/135001/12+add+student+2.png/6b44cda1-307e-b8d1-6377-f7702b04eda1"&gt; &lt;/p&gt;
      &lt;p&gt;   &lt;strong&gt;Output of addStudent.js Component:&lt;/strong&gt;   &lt;br&gt;
    &lt;img data-fileentryid="228162"
  src="https://khichad.com/documents/portlet_file_entry/135001/13+add+student+view.png/206a282e-34ca-ab2f-fb71-10a9b77e0f61"&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;StudentList.js:&lt;/strong&gt; Create the
    StudentList.js component     to display the list of students.&lt;br&gt;
    &lt;br&gt;  &lt;img data-fileentryid="228173"
    src="https://khichad.com/documents/portlet_file_entry/135001/14+get+all+student.png/a0a38cbf-be1e-7efa-af4b-31baa847db35"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="228184"
    src="https://khichad.com/documents/portlet_file_entry/135001/15+get+all+student+2.png/a40ba5dd-8169-0542-98bb-02f9cad2549d"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="228193"
    src="https://khichad.com/documents/portlet_file_entry/135001/15.+get+all+student+3.png/a78c274e-a343-a2e0-dd1f-145b7a286b31"&gt;
  &lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt; Output of StudentList.js Component:&lt;br&gt; &lt;img
      data-fileentryid="228202"
    src="https://khichad.com/documents/portlet_file_entry/135001/16+output+all+student.png/5313774d-4253-9647-10f0-ed51a17be69c"&gt;
  &lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;UpdateStudent.js:&lt;/strong&gt; Create the
    UpdateStudent.js     component to update existing student
    records.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="228211"
    src="https://khichad.com/documents/portlet_file_entry/135001/17+update+student.png/bd7f4e58-1bf1-9372-7102-f720137ac4f4"&gt;
    &lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="228220"
  src="https://khichad.com/documents/portlet_file_entry/135001/18+update+student+2.png/3d831b22-8dd7-566b-427b-ffa84898bd27"&gt;​​​​&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;Output of update action&lt;br&gt; &lt;img
      data-fileentryid="228229"
    src="https://khichad.com/documents/portlet_file_entry/135001/19+update+student+output.png/b938b49c-f692-7998-22d2-aea98849f012"&gt;
  &lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;Delete Student:&lt;/strong&gt; Add a delete
    functionality that     allows users to remove students from the
    list.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="228238"
    src="https://khichad.com/documents/portlet_file_entry/135001/20+delete+student.png/e9ce1e49-9a2e-71bb-3a4a-cbfbe3d91208"&gt;
  &lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;   &lt;strong&gt;Output of delete action&lt;br&gt; &lt;img
      data-fileentryid="228247"
    src="https://khichad.com/documents/portlet_file_entry/135001/21+output+delete+student.png/d80528e4-a82a-27db-afb7-3a3a881d5ac1"&gt;
  &lt;/strong&gt; &lt;/p&gt;
      &lt;p&gt;   &lt;strong&gt;9. Deploy the React Portlet and Test&lt;/strong&gt; &lt;/p&gt;
      &lt;ul&gt;  &lt;li&gt;Deploy the React portlet  &lt;/li&gt;  &lt;li&gt;Navigate to
    Liferay's     control panel and add the React portlet to a
  page. &lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;Test the CRUD operations to ensure data is being created,
  retrieved, updated, and deleted correctly.&lt;/p&gt;
      &lt;div class="overflow-auto portlet-msg-info"&gt;If you have any query,
    &lt;a href="https://khichad.com/contact-us"&gt;click here&lt;/a&gt;​​&lt;/div&gt;</summary>
    <dc:creator>Admin .</dc:creator>
    <dc:date>2025-02-08T05:38:00Z</dc:date>
  </entry>
  <entry>
    <title>CRUD Operations Using MVC Portlet in Liferay 7.4</title>
    <link rel="alternate" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=225492" />
    <author>
      <name>Admin .</name>
    </author>
    <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=225492</id>
    <updated>2025-01-30T09:15:48Z</updated>
    <published>2025-01-30T04:42:00Z</published>
    <summary type="html">&lt;p&gt;   &lt;strong&gt;Introduction:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;CRUD (Create, Read, Update, Delete) operations are fundamental
  for   managing data in web applications, and Liferay's MVC Portlet
  offers a   robust framework for implementing them efficiently. The MVC
  Portlet   follows the Model-View-Controller design pattern, enabling
  developers   to create modular and maintainable applications. In this
  blog, we’ll   provide a step-by-step guide to implementing CRUD
  operations using an   MVC Portlet in Liferay 7.4, showcasing how to
  seamlessly handle data   creation, retrieval, updating, and deletion
  within the Liferay platform. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Prerequisite:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;JDK 11 &lt;/li&gt;  &lt;li&gt;Liferay Server:
  liferay-dxp-tomcat-2024.q4.0 &lt;/li&gt;  &lt;li&gt;Liferay Developer Studio: 
  3.9.7.202207131011-g&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Steps to Perform CRUD Operations Using an MVC Portlet
    in     Liferay 7.4: &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;1. &lt;strong&gt;Start the Liferay Developer Studio:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open &lt;strong&gt;Liferay Developer Studio&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Start the Liferay server by navigating to the Servers tab and
    clicking on the Start button.      &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;2. &lt;strong&gt;Create a Workspace Project:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open &lt;strong&gt;Liferay Developer Studio&lt;/strong&gt; and start
    the   server. &lt;/li&gt;  &lt;li&gt;Navigate to &lt;strong&gt;File → New → Liferay
      Workspace   Project&lt;/strong&gt;. &lt;/li&gt;  &lt;li&gt;Provide a project name
    (e.g.,     global-workspace) and click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;3. &lt;strong&gt;Create a Service Builder:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt; Go to &lt;strong&gt;File → New → Liferay Module
  Project&lt;/strong&gt;. &lt;/li&gt;  &lt;li&gt;Choose the &lt;strong&gt;Service
    Builder&lt;/strong&gt; template, provide the project name (e.g.,
    employee-service), and click &lt;strong&gt;Finish&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Enter the class and package name. &lt;/li&gt;  &lt;li&gt;Modify the
    service.xml file to define an entity (e.g. Employee-service) with
    attributes. Set the remote-service attribute to true.&lt;br&gt;  &lt;br&gt;
      &lt;img data-fileentryid="225519"
    src="https://khichad.com/documents/portlet_file_entry/135001/1.+service.xml.png/12744072-4b9a-dae7-7073-efbd662a5c45"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;4. &lt;strong&gt;Build the ServiceBuilder Module&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open &lt;strong&gt;Gradle Task Executor&lt;/strong&gt; in Liferay
    Developer Studio. &lt;/li&gt;  &lt;li&gt;In the &lt;strong&gt;Gradle Task
    Executor&lt;/strong&gt;, navigate to Modules. &lt;/li&gt;  &lt;li&gt;Go to the
      &lt;strong&gt;Employee Service&lt;/strong&gt; module. &lt;/li&gt;  &lt;li&gt;Under the
      &lt;strong&gt;Employee Service&lt;/strong&gt; module, go to the
    &lt;strong&gt;Build&lt;/strong&gt; section. &lt;/li&gt;  &lt;li&gt;Click on &lt;strong&gt;Build
    Service&lt;/strong&gt; to execute the build task.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="225530"
  src="https://khichad.com/documents/portlet_file_entry/135001/2.+build+service.png/b77a3531-bd71-9fed-59be-133640758097"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Refresh the Gradle project to generate necessary packages
    and classes.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="225541"
    src="https://khichad.com/documents/portlet_file_entry/135001/3.+service+builder+classes.png/cd717e39-0455-bd4c-08d7-2e1a0f835f36"&gt;
    &lt;br&gt;   &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;5. &lt;strong&gt;Implement business logic for (CRUD) Create, Read,
    Update, Delete in service builder.&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;Create:&lt;/strong&gt; Add logic to save a new
    entity (e.g., an     employee) to the database.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="225550"
  src="https://khichad.com/documents/portlet_file_entry/135001/4.+add+employee+in+service+builder.png/ab694296-8461-b879-153f-8d367a7da5d7"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;Read:&lt;/strong&gt; Fetch all employees.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="225559"
  src="https://khichad.com/documents/portlet_file_entry/135001/5.+get+all+employees+in+service+builder.png/b4a0854d-b78c-8b59-9aa1-304b5bf5ad81"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;Update:&lt;/strong&gt; Modify an existing
  employee.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="225568"
  src="https://khichad.com/documents/portlet_file_entry/135001/6.+update+employee+in+the+service+builder.png/95690e2f-3446-a686-2b0f-6babf5ce2642"&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;Delete:&lt;/strong&gt; Remove an employee by
  employeeId.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="225577"
  src="https://khichad.com/documents/portlet_file_entry/135001/7.+delete+employee+in+the+service+builder.png/f8387694-8852-cbe0-fddb-7baaddaadf1b"&gt; &lt;/p&gt;
    &lt;p&gt;6. &lt;strong&gt;Create a Portlet:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Navigate to &lt;strong&gt;File → New → Liferay Module
  Project&lt;/strong&gt;. &lt;/li&gt;  &lt;li&gt;Provide a project name (e.g.,
    employee-portlet) and click &lt;strong&gt;Finish&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Select “Project Template Name” as “mvc-portlet” and Click on
    “Next” .&lt;/li&gt;  &lt;li&gt;Enter the class and package name click on
    “Finish”. The necessary file structure for mvc module will gets
    created as below.&lt;br&gt;  &lt;br&gt;  &lt;img data-fileentryid="225586"
    src="https://khichad.com/documents/portlet_file_entry/135001/8.+mvc+portlet+module+structure.png/a0720258-3716-6ced-3de6-59b646a64366"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;7. &lt;strong&gt;Integrate Service Builder with the Portlet&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;To add the dependency for employee-service in your MVC
    portlet, include the following line in the build.gradle file of your
    MVC portlet.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="225595"
  src="https://khichad.com/documents/portlet_file_entry/135001/9.+employee-service+depdencice+in+build.gradle.png/485d1f90-4534-5047-a3b6-e03ba5c5fbf2"&gt;
  &lt;br&gt; 8. &lt;strong&gt;Now, create the addEmployee.jsp file in the same
    directory as view.jsp and add the following code to
    addEmployee.jsp.&lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="225604"
    src="https://khichad.com/documents/portlet_file_entry/135001/10.+addemloyee.jsp.png/2c5ab40f-f143-6df2-50b5-43ffbf124cfc"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Output of addEmployee.jsp&lt;br&gt; &lt;img
      data-fileentryid="225615"
    src="https://khichad.com/documents/portlet_file_entry/135001/11.+addEmployee+view.png/b35493ca-362f-b114-4a6a-0a9517605245"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;9. &lt;strong&gt;Now, implement the processAction method to add an
    employee in the controller class of the MVC portlet.&lt;br&gt; &lt;br&gt; &lt;img
      data-fileentryid="225626"
    src="https://khichad.com/documents/portlet_file_entry/135001/12.+add+method+in+portlet.png/a5cad51e-430c-be5e-4747-a41f17d88f65"&gt;
  &lt;/strong&gt;   &lt;br&gt; 10. &lt;strong&gt;Now add below code in view.jsp&lt;br&gt; &lt;img
      data-fileentryid="225637"
    src="https://khichad.com/documents/portlet_file_entry/135001/13.+view.jsp+1.png/0ff75ce3-618f-f815-2190-c71e56a605a6"&gt;
    &lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="225648"
    src="https://khichad.com/documents/portlet_file_entry/135001/14.+view.jsp+2.png/8d25c7ac-1d2c-f195-3d50-1afd4a57d40d"&gt;
  &lt;/strong&gt;   &lt;br&gt; 11. &lt;strong&gt;Now override render method of portlet to
    fetch all     employees and send employees list to view.jsp&lt;br&gt; &lt;img
      data-fileentryid="225659"
    src="https://khichad.com/documents/portlet_file_entry/135001/16.+get+all+employee+portlet+code.png/50c2176a-ecf1-edab-5172-e3bd37606b5a"&gt;
    &lt;br&gt; Output of view.jsp&lt;br&gt; &lt;img data-fileentryid="225670"
    src="https://khichad.com/documents/portlet_file_entry/135001/15.+view+employees+portla.png/616aee9e-40c5-1f09-8052-0340a3c7d18e"&gt;
  &lt;/strong&gt;   &lt;br&gt; 12. &lt;strong&gt;Now, create the updateEmployee.jsp file
    in the same     directory as view.jsp and add the following code to
    updateEmployee.jsp.&lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="225681"
    src="https://khichad.com/documents/portlet_file_entry/135001/17.+updateEmployee.jsp.png/95e42789-fee9-5910-7429-911e361bc306"&gt;
  &lt;/strong&gt;   &lt;br&gt; &lt;br&gt; 13. &lt;strong&gt;Now, implement the processAction
    methods for the     update action.&lt;br&gt; &lt;img
      data-fileentryid="225692"
    src="https://khichad.com/documents/portlet_file_entry/135001/18+updateEmployee+portlet+code.png/90f8a498-3e4c-6400-0423-3befbd6c190c"&gt;
    &lt;br&gt; &lt;br&gt; Output of updateEmployee.jsp&lt;br&gt; &lt;img
      data-fileentryid="225701"
    src="https://khichad.com/documents/portlet_file_entry/135001/19.+update+employee+view.png/cfd01bb2-7cde-8ab8-3775-fe872feb61e4"&gt;
  &lt;/strong&gt;   &lt;br&gt; &lt;br&gt; 14.&lt;strong&gt; Now, implement the processAction
    method for the     delete action.&lt;br&gt; &lt;img data-fileentryid="225710"
    src="https://khichad.com/documents/portlet_file_entry/135001/20+delete+employee+methods.png/582d6e49-b3b7-09db-d421-a37fc4c851a5"&gt;
    &lt;br&gt; Output of delete action&lt;br&gt; &lt;br&gt; &lt;img data-fileentryid="225719"
    src="https://khichad.com/documents/portlet_file_entry/135001/21+view+of+delete+employee.png/75bde61f-2409-847f-dd85-37e5f0c9d94f"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;div class="overflow-auto portlet-msg-info"&gt;If you have any query,
    &lt;a href="https://khichad.com/contact-us"&gt;click here&lt;/a&gt;.​​​​​​​​​​&lt;/div&gt;</summary>
    <dc:creator>Admin .</dc:creator>
    <dc:date>2025-01-30T04:42:00Z</dc:date>
  </entry>
  <entry>
    <title>CRUD Operation with Headless REST API in Liferay</title>
    <link rel="alternate" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=221251" />
    <author>
      <name>Admin .</name>
    </author>
    <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=221251</id>
    <updated>2025-02-10T09:38:07Z</updated>
    <published>2025-01-16T06:38:00Z</published>
    <summary type="html">&lt;h4&gt;Overview:&lt;/h4&gt;
    &lt;p&gt;A &lt;strong&gt;Headless REST API&lt;/strong&gt; refers to an architecture
  that   allows systems to interact with each other without being tied
  to a   front-end user interface. This is particularly useful in
  enterprise   applications, where the back-end data needs to be
  accessed by   different front-end systems or third-party applications. &lt;/p&gt;
    &lt;p&gt;Using &lt;strong&gt;Headless REST APIs&lt;/strong&gt;, developers can perform
    &lt;strong&gt;CRUD operations&lt;/strong&gt; (Create, Read, Update, Delete) on
  Liferay’s resources without relying on its traditional user interface.
  This flexibility enables integration with external systems, custom
  front-end applications, mobile apps, and IoT devices. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Prerequisite:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;JDK 11 &lt;/li&gt;  &lt;li&gt;Liferay Server:
  liferay-dxp-tomcat-7.4.13.u92 &lt;/li&gt;  &lt;li&gt;Liferay Developer Studio: 
  3.9.7.202207131011-ga8&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Headless REST API:&lt;/strong&gt;   &lt;br&gt; A &lt;strong&gt;Headless
  API&lt;/strong&gt; is an interface that allows you   to interact with a
  system’s data programmatically, without requiring a   user interface
  (UI). In a headless environment, the front-end (UI) is   independent
  of the back-end, and communication occurs via APIs, making   it easier
  to integrate with mobile apps, web apps, or other services. &lt;/p&gt;
    &lt;p&gt;A &lt;strong&gt;Headless REST API&lt;/strong&gt; in Liferay refers to a set
  of   API endpoints that allow for the interaction with the Liferay
  platform   without using its user interface (UI). It allows you to
  manage and   retrieve data, content, and other resources from Liferay
  in a   &amp;quot;headless&amp;quot; manner, meaning there's no need for a
  front-end   web interface directly tied to the API's operations. This
  API is   designed to be consumed by external systems or client-side
  applications (e.g., mobile apps, single-page applications, etc.). &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Key Features of Headless API:&lt;/strong&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;Decoupled Front-End and Back-End: Headless APIs enable a
    decoupled architecture where the frontend and backend are separated.
    This allows developers to build user interfaces independently from
    the Liferay platform, offering greater flexibility and
  scalability. &lt;/li&gt;  &lt;li&gt;JSON-Based Data Exchange: The API communicates
    using JSON (JavaScript Object Notation) to exchange data between
    client and server. This ensures a lightweight, easy-to-parse data
    format that works well with modern web applications. &lt;/li&gt;
    &lt;li&gt;RESTful Design: Liferay’s Headless APIs follow REST
    (Representational State Transfer) principles, ensuring a standard
    way to interact with the backend. This provides stateless operations
    using HTTP methods like GET, POST, PUT, and DELETE. &lt;/li&gt;
    &lt;li&gt;Scalability and Flexibility: Liferay’s headless APIs allow for
    easy scaling, enabling integrations with various third-party
    systems, and supporting large-scale, distributed solutions. &lt;/li&gt;
    &lt;li&gt;Content and Document Management: Provides powerful APIs for
    managing content types (web content, blogs, etc.) and handling
    document storage, retrieval, and manipulation in the Document and
    Media Library. &lt;/li&gt;  &lt;li&gt;Security &amp;amp; Authentication: Liferay
    Headless APIs offer robust authentication mechanisms such as OAuth2,
    JWT, and Basic Authentication to ensure secure communication between
    the client and the API. &lt;/li&gt;  &lt;li&gt;Custom Resource Extensions:
    Developers can extend Liferay’s headless API by adding custom
    resources and endpoints, enabling specialized business logic and
    personalized integrations. &lt;/li&gt;  &lt;li&gt;Integration with Third-Party
    Systems: Seamlessly integrates with external systems like CRMs,
    ERPs, and other applications, enabling a unified ecosystem and data
    exchange without a traditional UI.&lt;br&gt;  &lt;img
      data-fileentryid="221298"
      src="https://khichad.com/documents/portlet_file_entry/135001/db001b.png/9828ec4d-e75c-94f0-6c5f-302f3f5bd7f4"
      style="height: auto;width: 568.0px;" width="568"&gt;   &lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;   &lt;strong&gt;Steps for Performing CRUD Operations with Liferay
    Headless     REST API&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;To perform CRUD (Create, Read, Update, Delete) operations using
  Liferay Headless APIs, you’ll interact with specific endpoints for
  each operation. Below are the steps for each operation: &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Start the Liferay Developer Studio: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open &lt;strong&gt;Liferay Developer Studio&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Start the Liferay server by navigating to the Servers tab and
    clicking on the Start button.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2. Create a Workspace Project: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open &lt;strong&gt;Liferay Developer Studio&lt;/strong&gt; and start
    the   server. &lt;/li&gt;  &lt;li&gt;Navigate to &lt;strong&gt;File&lt;/strong&gt; →
    &lt;strong&gt;New&lt;/strong&gt; → &lt;strong&gt;Liferay Workspace
  Project&lt;/strong&gt;. &lt;/li&gt;  &lt;li&gt;Provide a project name (e.g.,
    global-workspace) and click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;3. &lt;strong&gt;Create a Service Builder &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Go to &lt;strong&gt;File → New → Liferay Module
  Project&lt;/strong&gt;. &lt;/li&gt;  &lt;li&gt;Choose the &lt;strong&gt;Service
    Builder&lt;/strong&gt; template, provide the project name (e.g.,
    employee-service), and click &lt;strong&gt;Finish&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Enter the class and package name. &lt;/li&gt;  &lt;li&gt;Modify the
    service.xml file to define an entity (e.g. Employee) with
    attributes. Set the remote-service attribute to true.&lt;br&gt;  &lt;img
      data-fileentryid="221307"
    src="https://khichad.com/documents/portlet_file_entry/135001/2.png/1bd3fc2a-8dea-433d-e4e3-bfc37bfd2a39"&gt;
  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;4. Build the ServiceBuilder Module&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open &lt;strong&gt;Gradle Task Executor&lt;/strong&gt; in Liferay
    Developer Studio. &lt;/li&gt;  &lt;li&gt;In the &lt;strong&gt;Gradle Task
    Executor&lt;/strong&gt;, navigate to Modules. &lt;/li&gt;  &lt;li&gt;Go to the
      &lt;strong&gt;Employee Service&lt;/strong&gt; module. &lt;/li&gt;  &lt;li&gt;Under the
      &lt;strong&gt;Employee Service&lt;/strong&gt; module, go to the Build
  section. &lt;/li&gt;  &lt;li&gt;Click on &lt;strong&gt;Build Service&lt;/strong&gt; to execute
    the build task.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="221318"
    src="https://khichad.com/documents/portlet_file_entry/135001/3.png/db554166-d098-fd3c-8464-d5be4804f3e6"
    style="height: auto;width: 518.0px;" width="518"&gt;   &lt;br&gt;  &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Refresh the Gradle project to generate necessary
      packages and classes.&lt;br&gt;  &lt;img data-fileentryid="221329"
        src="https://khichad.com/documents/portlet_file_entry/135001/4.png/0a701c3c-6eba-3daf-7cc6-f9b8f719e8ee"
        style="height: auto;width: 517.0px;" width="517"&gt;       &lt;br&gt;
     &lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;5. Implement business logic for (CRUD) Create, Read,
    Update,     Delete in service builder.&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Create:&lt;/strong&gt; Add logic to save a
      new entity (e.g., an       employee) to the database.&lt;br&gt;  &lt;img
        data-fileentryid="221340"
      src="https://khichad.com/documents/portlet_file_entry/135001/5.png/1e34f021-4350-4953-c1ba-35bc6c8c9042"&gt;
      &lt;br&gt;   &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Read:&lt;/strong&gt; Fetch
      all employees.&lt;br&gt;  &lt;img data-fileentryid="221351"
      src="https://khichad.com/documents/portlet_file_entry/135001/6.png/66db3b62-dddc-dc65-1f93-d2fcf19ccbc2"&gt;
      &lt;br&gt;   &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Update:&lt;/strong&gt;
      Modify an existing employee by       employeeId.&lt;br&gt;  &lt;img
        data-fileentryid="221362"
      src="https://khichad.com/documents/portlet_file_entry/135001/7.png/ac608ddc-ade6-cb8f-559d-1f1df255bf53"&gt;
      &lt;br&gt;   &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Delete:&lt;/strong&gt;
      Remove an employee by employeeId.&lt;br&gt;         &lt;img
        data-fileentryid="221373"
      src="https://khichad.com/documents/portlet_file_entry/135001/8.png/0bbe9f7d-b6c6-2d44-11fe-3759a059913c"&gt;
    &lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;6. Create and Develop the REST Builder Module&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Go to &lt;strong&gt;File → New → Liferay Module Project&lt;/strong&gt;
    and select the &lt;strong&gt;REST Builder&lt;/strong&gt; template. &lt;/li&gt;
    &lt;li&gt;Provide a project name (e.g., employee-rest) and click
  &lt;strong&gt;Finish&lt;/strong&gt;. &lt;/li&gt;  &lt;li&gt;Enter the class and package
  name. &lt;/li&gt;  &lt;li&gt;Add the OpenAPI configuration in the
    rest-openapi.yaml file under the *-impl module’s root folder.&lt;br&gt;
      &lt;img data-fileentryid="221382"
      src="https://khichad.com/documents/portlet_file_entry/135001/9.png/dc57a70e-a89d-2ec7-2112-1aefb8668894"
      style="height: auto;width: 491.0px;" width="491"&gt;     &lt;br&gt;  &lt;br&gt;
      &lt;img data-fileentryid="221391"
      src="https://khichad.com/documents/portlet_file_entry/135001/10.png/e51fca3b-dca1-86a0-16e0-fd0743073697"
      style="height: auto;width: 490.0px;" width="490"&gt;     &lt;br&gt;  &lt;br&gt;
      &lt;img data-fileentryid="221402"
      src="https://khichad.com/documents/portlet_file_entry/135001/11.png/48fc085a-830b-b014-1fb2-20b5168dcfde"
      style="height: auto;width: 491.0px;" width="491"&gt;     &lt;br&gt;  &lt;br&gt;
      &lt;img data-fileentryid="221413"
      src="https://khichad.com/documents/portlet_file_entry/135001/12.png/bee193ee-eea4-ae63-7cc9-5bedc1da447d"
      style="height: auto;width: 490.0px;" width="490"&gt;     &lt;br&gt;  &lt;br&gt;
      &lt;img data-fileentryid="221424"
      src="https://khichad.com/documents/portlet_file_entry/135001/13.png/2a4a6939-eeb6-ee6f-4f8c-3e36223339a8"
      style="height: auto;width: 489.0px;" width="489"&gt;     &lt;br&gt;   &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;7. Generate Scaffolding:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open &lt;strong&gt;Gradle Task Executor&lt;/strong&gt; in Liferay
    Developer Studio. &lt;/li&gt;  &lt;li&gt;In the &lt;strong&gt;Gradle Task
    Executor&lt;/strong&gt;, navigate to &lt;strong&gt;Modules&lt;/strong&gt;.&lt;/li&gt;
    &lt;li&gt;Go to the &lt;strong&gt;employee-rest module&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Under the &lt;strong&gt;E employee-rest&lt;/strong&gt; module, go to the
    employee-service-impl section. &lt;/li&gt;  &lt;li&gt;In the
    &lt;strong&gt;employee-service-impl&lt;/strong&gt; module, go to the Build
  section. &lt;/li&gt;  &lt;li&gt;Click on &lt;strong&gt;buildRest &lt;/strong&gt;to execute the
    build task.&lt;br&gt;  &lt;img data-fileentryid="221435"
      src="https://khichad.com/documents/portlet_file_entry/135001/14.png/76831b00-fb53-f988-9e2d-cd53499db566"
      style="height: auto;width: 487.0px;" width="487"&gt;     &lt;br&gt;   &lt;/li&gt;
    &lt;li&gt;Refresh the Gradle project to generate necessary     packages
    and classes. &lt;br&gt;  &lt;img data-fileentryid="221446"
      src="https://khichad.com/documents/portlet_file_entry/135001/15.png/0e022370-c9e1-ac9b-96c8-029ef4fb626a"
      style="height: auto;width: 486.0px;" width="486"&gt;   &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;8. Add employee-service Dependency to employee-rest
  Project:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Navigate to the build.gradle file of the
    employee-rest-impl     project in your project structure. &lt;/li&gt;
    &lt;li&gt;     &lt;strong&gt;Add the       employee-service Dependency&lt;br&gt;  &lt;img
        data-fileentryid="221457"
        src="https://khichad.com/documents/portlet_file_entry/135001/16.png/990e7b93-9b0f-1991-d6f2-930adbdb1d27"
        style="height: auto;width: 488.0px;" width="488"&gt; &lt;/strong&gt;
    &lt;br&gt;   &lt;/li&gt;  &lt;li&gt;Refresh Gradle&lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Save the changes and
      sync the Gradle project. In your IDE, click on Sync Gradle
    Project &lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;9. Now we have performed the CRUD operation for
    Employee in     OpenAPI and implemented Business Logic for each
  service. &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Add Employee&lt;br&gt;  &lt;img data-fileentryid="221468"
      src="https://khichad.com/documents/portlet_file_entry/135001/17.png/4d110806-e259-8942-322d-9ee100990a2b"
      style="height: auto;width: 488.0px;" width="488"&gt;     &lt;br&gt;  &lt;br&gt;
      &lt;img data-fileentryid="221479"
      src="https://khichad.com/documents/portlet_file_entry/135001/18.png/83b62e9f-4d47-156c-65cc-a17df7cb4d29"
      style="height: auto;width: 489.0px;" width="489"&gt;     &lt;br&gt;   &lt;/li&gt;
    &lt;li&gt;     &lt;strong&gt;Get All Employees&lt;/strong&gt;     &lt;br&gt;  &lt;img
      data-fileentryid="221490"
      src="https://khichad.com/documents/portlet_file_entry/135001/19.png/9aba8f18-fabc-f22a-522d-8b0126ce4086"
      style="height: auto;width: 491.0px;" width="491"&gt;     &lt;br&gt;   &lt;/li&gt;
    &lt;li&gt;     &lt;strong&gt;Update Employee&lt;/strong&gt;     &lt;br&gt;  &lt;img
      data-fileentryid="221501"
      src="https://khichad.com/documents/portlet_file_entry/135001/20.png/e8f6576e-4e7c-7e7a-6f01-9ed3bd6080eb"
      style="height: auto;width: 491.0px;" width="491"&gt;     &lt;br&gt;   &lt;/li&gt;
    &lt;li&gt;     &lt;strong&gt;Delete Employee&lt;/strong&gt;     &lt;br&gt;  &lt;img
      data-fileentryid="221512"
      src="https://khichad.com/documents/portlet_file_entry/135001/21.png/5b483231-cd4a-1c23-b75a-849f8780e12e"
      style="height: auto;width: 491.0px;" width="491"&gt;     &lt;br&gt;   &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;10. Deploy and Test the API:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Deploy the REST Builder module to the Liferay
      server.&lt;br&gt;  &lt;img data-fileentryid="221523"
        src="https://khichad.com/documents/portlet_file_entry/135001/22.png/4802ceff-a723-c18e-832b-008743cd26a4"
        style="height: auto;width: 492.0px;" width="492"&gt;       &lt;br&gt;
     &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;The API is available at the following
      URL: &lt;a href="http://localhost:8080/o/api" target="_blank"
        rel="noopener noreferrer"&gt;http://localhost:8080/o/api&lt;br&gt;  &lt;img
          data-fileentryid="221534"
          src="https://khichad.com/documents/portlet_file_entry/135001/23.png/3919e589-c30f-19af-d01e-374340ba4c22"
          style="height: auto;width: 495.0px;" width="495"&gt; &lt;/a&gt;&lt;br&gt;
     &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Add an Employee:&lt;/strong&gt;
      &lt;br&gt;  &lt;img data-fileentryid="221545"
        src="https://khichad.com/documents/portlet_file_entry/135001/24.png/dd7d2063-a21e-b583-4695-89e649ddc523"
        style="height: auto;width: 474.0px;" width="474"&gt;       &lt;br&gt;
      &lt;br&gt;  &lt;img data-fileentryid="221556"
        src="https://khichad.com/documents/portlet_file_entry/135001/25.png/d0659233-c717-d8fa-c395-b8c4704ee831"
        style="height: auto;width: 470.0px;" width="470"&gt;       &lt;br&gt;
     &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Retrieve All
      Employees:&lt;/strong&gt;       &lt;br&gt;  &lt;img data-fileentryid="221565"
        src="https://khichad.com/documents/portlet_file_entry/135001/26.png/30c4cdd4-c04d-b3ef-5ef1-60959748eaa4"
        style="height: auto;width: 474.0px;" width="474"&gt;       &lt;br&gt;
     &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Update an Employee:&lt;/strong&gt;
      &lt;br&gt;  &lt;img data-fileentryid="221574"
        src="https://khichad.com/documents/portlet_file_entry/135001/27.png/13eeceab-989e-aa94-daf7-cb724fb9e5fd"
        style="height: auto;width: 462.0px;" width="462"&gt;       &lt;br&gt;
     &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Delete an Employee&lt;/strong&gt;
      &lt;br&gt;  &lt;img data-fileentryid="221583"
        src="https://khichad.com/documents/portlet_file_entry/135001/29.png/a3d6e3bf-2f47-12d3-429c-6fdabfe26053"
        style="height: auto;width: 457.0px;" width="457"&gt;       &lt;br&gt;
      &lt;br&gt;  &lt;img data-fileentryid="221592"
        src="https://khichad.com/documents/portlet_file_entry/135001/30.png/c76fc68e-c4c9-8cf0-719a-b3bb17eced8c"
        style="height: auto;width: 459.0px;" width="459"&gt;     &lt;/p&gt;
  &lt;/li&gt;  &lt;li&gt;  &lt;div class="overflow-auto portlet-msg-info"&gt;If       you
      have any query, &lt;a href="https://khichad.com/contact-us"&gt;click here&lt;/a&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;</summary>
    <dc:creator>Admin .</dc:creator>
    <dc:date>2025-01-16T06:38:00Z</dc:date>
  </entry>
  <entry>
    <title>Product Architecture</title>
    <link rel="alternate" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=221171" />
    <author>
      <name>Admin .</name>
    </author>
    <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=221171</id>
    <updated>2025-01-28T04:45:42Z</updated>
    <published>2025-01-16T05:35:00Z</published>
    <summary type="html">&lt;p&gt;   &lt;strong&gt;Introduction:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Liferay Product Architecture refers to the structural
      design of the Liferay platform, which is an open-source enterprise
      portal designed to build and manage web applications, digital
      experiences, and content management systems.  &lt;/p&gt;  &lt;/li&gt;
    &lt;li&gt;Liferay's architecture focuses on modularity, flexibility, and
    scalability, allowing developers to build customized solutions for
    enterprise needs. &lt;br&gt;  &lt;img alt="Image" data-fileentryid="221186"
      src="https://khichad.com/documents/portlet_file_entry/135001/4a849d3e-d186-40ad-bd31-c3b2637eafe7.png/86bc5e9f-6f1d-bd18-5a1f-3fce30bf0c71"
    style="height: auto;width: 416.094px;"&gt;   &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Frontend:&lt;/strong&gt; &lt;br&gt; The front end refers to the
  visual and   interactive part of a website or application that users
  see and engage   with. It involves designing and coding the user
  interface (UI) to   ensure a seamless and appealing experience using
  technologies like   HTML, CSS, and JavaScript. The focus is on
  creating responsive,   accessible, and user-friendly designs that
  align with the project goals. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;HTML:&lt;/strong&gt;   &lt;br&gt; HTML (Hypertext Markup Language)
  is the standard language used to   create the structure and content of
  web pages. It provides the   framework for organizing text, images,
  links, and multimedia elements   on a webpage. HTML uses a system of
  tags and attributes to define the   layout and structure, allowing
  browsers to interpret and display the   content correctly. It forms
  the foundation of every website and works   seamlessly with CSS and
  JavaScript to create visually appealing and   interactive user experiences. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;CSS:&lt;/strong&gt;   &lt;br&gt; CSS (Cascading Style Sheets) is a
  stylesheet language used to   control the presentation and layout of
  HTML elements on a webpage. It   allows developers to apply styles
  such as colors, fonts, spacing, and   positioning to create visually
  appealing designs. CSS enables   responsive layouts, ensuring web
  pages adapt to different screen sizes   and devices. It works by
  linking style rules to HTML elements through   selectors. CSS enhances
  user experience by separating content (HTML)   from design. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Java script:&lt;/strong&gt;   &lt;br&gt; JavaScript is a powerful,
  high-level programming language used to   create dynamic and
  interactive features on websites. It enables   developers to add
  functionality such as animations, form validation,   content updates,
  and interactive elements. JavaScript works seamlessly   with HTML and
  CSS, making web pages more engaging and responsive. It   runs directly
  in the browser and supports frameworks like React,   Angular, and Vue
  for advanced web development. JavaScript is a core   technology for
  building modern web applications. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Browser: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;A browser is a software application used to access and
    view     websites on the internet. It interprets HTML, CSS, and
    JavaScript to     render web pages. Popular browsers include Google
    Chrome, Mozilla     Firefox, and Safari. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;1.  Native Development:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Native development is done for platform-specific apps
    (such     as Android and iOS). &lt;/li&gt;  &lt;li&gt; Native apps make full use
    of the     device’s hardware and software capabilities.  &lt;/li&gt;
    &lt;li&gt;Ios uses     Swift/objective-c and Android uses
  java/Kotlin. &lt;/li&gt;  &lt;li&gt;These are     fast and deliver high
  performance. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2. Metal:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Apple has a low-level graphics API that uses the GPU
    (Graphics Processing Units) on iOS and macOS.   &lt;/li&gt;  &lt;li&gt;It is
    used for high-performance graphics and 3D rendering.      &lt;/li&gt;
    &lt;li&gt;Metal provides direct access   to the GPU for faster
  processing. &lt;/li&gt;  &lt;li&gt;Ideal for gaming, virtual reality, and complex
    visual application.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;3. React JS: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;ReactJS is a JavaScript library used to build user
    interface   (UL). &lt;/li&gt;  &lt;li&gt;It works on component-based
  architecture. &lt;/li&gt;     &lt;li&gt;It is fast and efficient due to virtual
  DOM. &lt;/li&gt;  &lt;li&gt;Mainly     used to build Single page
  Applications. &lt;/li&gt;  &lt;li&gt;It helps in     fetching data from API and
    displaying it in UI.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;4. Angular: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Angular is a JavaScript framework for building dynamic web
  applications. &lt;/li&gt;  &lt;li&gt;It uses Typescript, a powerful superset of
  JavaScript. &lt;/li&gt;  &lt;li&gt;Angular supports features like two-way data
    binding and dependency injection. &lt;/li&gt;  &lt;li&gt;It is great for
    building large-scale, single-page applications. &lt;/li&gt;  &lt;li&gt;APIs are
    used in angular to Fetch and manage data dynamically.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;5.  Another JavaScript framework:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Vue. Js: A progressive JavaScript framework used to build
    user interfaces and single-page applications, offering simplicity
    and flexibility. &lt;/li&gt;  &lt;li&gt;Svelte: A compiler-based JavaScript
    framework that converts Components into efficient, standalone
    JavaScript at build time, leading to faster performance.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Backend:&lt;/strong&gt;   &lt;br&gt; The backend is the
  server-side   part of a web application   responsible for processing
  data, managing   business logic, and   interacting with databases. It
  handles tasks   like creating APIs,   managing authentication, and
  ensuring that the   frontend receives the   necessary data. Backend
  development uses   technologies like Java,   Python, PHP, Node.js,
  Django, and Laravel to   support the functionality   of a web application.&lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;What is API&lt;br&gt; API &lt;/strong&gt;(application programming
  interface) is set of rules, protocols and tools that allow different
  software applications to communicate and interact with each other
  Enables applications to request services or data Frome other
  application, operating systems, or servers. &lt;/p&gt;
    &lt;p&gt;How Does API Work &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Request: a clint (app) sends a request to the API &lt;/li&gt;
    &lt;li&gt;Endpoint: the request hits a specific URL in the API &lt;/li&gt;
    &lt;li&gt;Response: The API processes the request and sends Back a
    response, typically in Json or XML format. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;What are Portlets&lt;/strong&gt;   &lt;br&gt; Portlets are small,
  reusable web components that display specific   content or
  functionality within a larger portal or web application.   They
  operate independently but are integrated into a portal page,
  allowing multiple portlets to coexist and deliver different features
  or data to the user. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;What is Authorization:&lt;/strong&gt;   &lt;br&gt; Authorization
  is   the process of deciding what a person or system   is allowed to
  do   after they have been verified. It controls access to   resources,
  like   files, settings, or actions, based on the user's   permissions.
  For   example, after logging into an app, authorization   determines
  whether   you can view a file, edit it, or just read it based   on
  your role   (like Admin, User, or Guest). &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Persistence:&lt;/strong&gt;   &lt;br&gt; Persistence means data is
  stored in a non-volatile medium (like a   database or file system), so
  it remains available even after the   application is closed or the
  system restarts. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;DB (Database):&lt;/strong&gt;   &lt;br&gt; A Database (DB) is an
  organized collection of data that is stored   and managed in a way
  that allows for easy retrieval, modification, and   updating. It is
  designed to handle large amounts of data and supports   operations
  like querying, inserting, updating, and deleting data.   Databases are
  commonly used in applications, websites, and enterprise   systems to
  store and manage information such as user data,   transactions, and inventory. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Search indexing:&lt;/strong&gt;   &lt;br&gt; Search indexing is
  the   process of organizing and storing data in   a structured format
  to   make it easily retrievable by a search engine.   It involves
  analyzing   and indexing content, such as text or metadata,   so that
  relevant   results can be quickly found in response to user queries. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Cluster:&lt;/strong&gt;   &lt;br&gt; A cluster is a group of
  interconnected computers (nodes) that   work together as a single unit
  to perform tasks, share resources, and   provide high availability,
  scalability, and fault tolerance. It is   commonly used in distributed
  computing, cloud environments, and databases. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Integration Adapters:&lt;/strong&gt;   &lt;br&gt; Integration
  Adapters are software components or tools used to   facilitate
  communication between different systems, applications, or   platforms.
  They act as bridges that allow two or more disparate   systems to
  connect, share data, and work together, despite having   different
  technologies, formats, or protocols. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;What are Services:&lt;/strong&gt;   &lt;br&gt; Services are
  software components that perform specific tasks or   provide
  functionalities to users or other systems. They can be   background
  processes, web services, or APIs that enable interaction   and data
  exchange between systems. Services are reusable, modular, and
  designed to handle specific operations. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Caching:&lt;/strong&gt;   &lt;br&gt; Caching is the process of
  storing frequently accessed data in a   temporary storage layer
  (cache) to improve performance and reduce the   time it takes to
  retrieve data. It allows applications or systems to   access data
  faster by avoiding repetitive computation or database   queries,
  enhancing speed and efficiency. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Auditing:&lt;/strong&gt;   &lt;br&gt; Auditing is the process of
  systematically recording, examining,   and verifying activities,
  events, or changes within a system to ensure   compliance, detect
  anomalies, and maintain accountability. It helps   track user actions,
  data modifications, and system performance for   security, legal, or
  operational purposes. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Workflow:&lt;/strong&gt;   &lt;br&gt; Workflow is the sequence of
  tasks, activities, or processes that   are organized and executed in a
  specific order to achieve a particular   goal or complete a business
  process. It defines how tasks are   coordinated, who performs them,
  and how data flows between steps to   ensure efficiency and
  consistency in operations.&lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Authentication:&lt;/strong&gt;   &lt;br&gt; Authentication is the
  process of verifying the identity of a   user, system, or device to
  ensure that they are who they claim to be.   It typically involves
  validating credentials such as usernames,   passwords, biometrics, or
  tokens to grant access to a system or resource.  &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Analytics:&lt;/strong&gt;   &lt;br&gt; Analytics refers to the
  systematic process of collecting,   analyzing, and interpreting data
  to derive meaningful insights that   help in decision-making. It
  involves the use of statistical,   mathematical, and computational
  methods to identify patterns, trends,   and correlations within data.
  Analytics can be applied to various   fields, such as business,
  marketing, healthcare, and sports, to   improve performance, optimize
  strategies, and make data-driven decisions. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Message Bus:&lt;/strong&gt;   &lt;br&gt; A Message Bus is a
  communication system that facilitates the   exchange of data between
  different software applications, services, or   components within a
  system. It acts as a central hub or channel   through which messages
  (data or events) are sent, received, and   processed in a distributed
  environment. The message bus ensures   decoupling between different
  systems, allowing them to communicate   asynchronously and in a
  scalable manner. It typically supports   features like message
  routing, queuing, and delivery guarantees,   enabling efficient and
  reliable communication between services. &lt;/p&gt;
    &lt;div class="overflow-auto portlet-msg-info"&gt;If you have any query,
    &lt;a href="https://khichad.com/contact-us"&gt;click here&lt;/a&gt;&lt;/div&gt;</summary>
    <dc:creator>Admin .</dc:creator>
    <dc:date>2025-01-16T05:35:00Z</dc:date>
  </entry>
  <entry>
    <title>Create Liferay Objects Using Asset Library and Account</title>
    <link rel="alternate" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=215779" />
    <author>
      <name>Admin .</name>
    </author>
    <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=215779</id>
    <updated>2025-01-27T18:05:54Z</updated>
    <published>2025-01-08T05:35:00Z</published>
    <summary type="html">&lt;h4&gt;Overview: &lt;/h4&gt;
    &lt;p&gt;In Liferay, creating custom &lt;strong&gt;Liferay Objects&lt;/strong&gt; and
  utilizing &lt;strong&gt;Asset Libraries&lt;/strong&gt; alongside &lt;strong&gt;Accounts
  &lt;/strong&gt;offers an effective solution for managing both content and
  organizational data. You can use &lt;strong&gt;Asset Libraries&lt;/strong&gt; to
  manage and organize digital content such as images, documents, and
  videos, making content management more streamlined. By associating
  custom &lt;strong&gt;Liferay Objects&lt;/strong&gt; with
  &lt;strong&gt;Accounts&lt;/strong&gt;, you establish a relationship between your
  business data and specific organizations or business units. &lt;/p&gt;
    &lt;p&gt;This integration enables you to display the connection between
  custom objects and the &lt;strong&gt;Account &lt;/strong&gt;system object,
  creating a seamless experience for organizing and managing both
  content and data. By leveraging this relationship, you can efficiently
  handle assets and custom data linked to specific accounts, improving
  content management and enhancing data organization within the Liferay platform. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Prerequisite: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;JDK 11 &lt;/li&gt;  &lt;li&gt;Liferay Server:
  liferay-dxp-tomcat-7.4.13.u92 &lt;/li&gt;  &lt;li&gt;Liferay Developer Studio: 
  3.9.7.202207131011-ga8 &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Liferay Objects:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Liferay Objects are custom data entities that can be
      created directly within the Liferay platform using the Objects
      framework. These objects allow you to define fields,
      relationships, and behaviors similar to database tables, without
      requiring database-level programming. They seamlessly integrate
      into the Liferay ecosystem for managing application-specific
    data. &lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Key Features of Liferay Objects:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;System Objects:&lt;/strong&gt; Default objects
    integrated with     Liferay’s core functionality, such as Account,
    Organization, and   User. &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Custom
    Objects:&lt;/strong&gt; User-defined objects that extend     the
    functionality of system objects to meet specific business
  requirements. &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Fields:&lt;/strong&gt; Add custom data
    fields for your   objects. &lt;/li&gt;  &lt;li&gt;
    &lt;strong&gt;Relationships:&lt;/strong&gt; Establish links to system or custom
  objects. &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Actions:&lt;/strong&gt; Set up custom
    workflows or business   rules. &lt;/li&gt;  &lt;li&gt;
    &lt;strong&gt;Layouts:&lt;/strong&gt; Design user-friendly interfaces. &lt;/li&gt;
    &lt;li&gt;     &lt;strong&gt;Views:&lt;/strong&gt; Configure how data is displayed to
  users. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Creating Custom Liferay Objects Using Asset Library
    and     Account Workflow in Liferay:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;     &lt;img data-fileentryid="215800"
    src="https://khichad.com/documents/portlet_file_entry/135001/76102be7-744a-4747-a30b-30ece27ae826.jpg/71f815dd-e918-e36a-23ef-1f13770f8c65"&gt;
  &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Steps for Creating Custom Liferay Objects Using Asset
    Library     and Account &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;Creating custom objects in Liferay allows you to build tailored
  applications that meet specific business needs. Below are the
  step-by-step instructions for creating custom objects related to Asset
  Library and Account, and linking them for seamless management and
  display: ￼ &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Step 1: Accessing the Object Section:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Ensure your Liferay server is running. &lt;/li&gt;  &lt;li&gt;Open
    your     browser and navigate to localhost:8080. &lt;/li&gt;  &lt;li&gt;Go to
    the Control     Panel and click on Objects. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215811"
  src="https://khichad.com/documents/portlet_file_entry/135001/ae16ce1c-2c89-4016-a506-78ff76b218ab.jpg/edeeecb2-b85a-4cdc-37bf-fba0a9bdab58"&gt;
  &lt;br&gt; &lt;br&gt; &lt;strong&gt;Step 2: Creating a New Custom Object&lt;/strong&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;In the &lt;strong&gt;Objects&lt;/strong&gt; section, click the
    &lt;strong&gt;+&lt;/strong&gt; icon to add a new custom object. &lt;br&gt;  &lt;img
      data-fileentryid="215822"
    src="https://khichad.com/documents/portlet_file_entry/135001/3e61f80c-363e-4441-9b4d-ed20e0d9ce37.jpg/8dbe98be-a452-c35f-8df9-28c2f262ba02"&gt;
    &lt;br&gt;   &lt;/li&gt;  &lt;li&gt;Provide the following details for the new
  object: &lt;/li&gt; &lt;/ol&gt;
    &lt;ul&gt;  &lt;li&gt;     &lt;strong&gt;Label:&lt;/strong&gt; Identifies the object in the
    Objects admin     and supported application contexts (e.g.,
    Workflow, Display Page     Templates, Forms). (e.g., Product).&lt;/li&gt;
    &lt;li&gt;     &lt;strong&gt;Plural Label:&lt;/strong&gt; Name for plural references
    (e.g.,   Products).&lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Object Name:
    &lt;/strong&gt;Define the object name (e.g.,     Product). This cannot be
    changed once published.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215833"
  src="https://khichad.com/documents/portlet_file_entry/135001/b1db25c7-5f32-456b-927f-bb8f9e24d67c.png/15b97c4f-20c0-1542-51bb-bb4192ed657b"&gt;
  &lt;br&gt; 3. Click &lt;strong&gt;Save &lt;/strong&gt;to create a draft of the custom object.&lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Step 3: Adding Fields &lt;/strong&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;  &lt;p&gt;Navigate to the &lt;strong&gt;Fields &lt;/strong&gt;tab and click
      the &lt;strong&gt;+ &lt;/strong&gt;icon to add fields.&lt;br&gt;  &lt;img
        data-fileentryid="215844"
      src="https://khichad.com/documents/portlet_file_entry/135001/029d3a7b-c047-4260-a7d0-c750ab9f4ce7.png/4feea965-62d4-b9aa-ec68-4df23367244c"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Provide the &lt;strong&gt;Field Label, Field
      Name,&lt;/strong&gt; and select the &lt;strong&gt;Field Type&lt;/strong&gt; (e.g.,
      Text, Decimal, Integer). &lt;br&gt;  &lt;img data-fileentryid="215855"
      src="https://khichad.com/documents/portlet_file_entry/135001/d07ec3ec-2546-4fcf-a21c-60bc016a5dae.png/0b92d5c1-55c1-337b-c5c7-bbc0db605d0d"&gt;
      &lt;br&gt;   &lt;/p&gt;  &lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;3. Add fields to your Product object, such as: &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Product Name (Text) &lt;/li&gt;  &lt;li&gt;Product Description (Text
  Area) &lt;/li&gt;  &lt;li&gt;Price (Decimal) &lt;/li&gt;  &lt;li&gt;Stock Quantity
  (Integer)&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Step 4: Editing Object Details&lt;/strong&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;  &lt;p&gt;Go to the &lt;strong&gt;Details &lt;/strong&gt;section of your
      custom object. &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Set
      Scope&lt;/strong&gt; as &amp;quot;Site&amp;quot; &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;
        &lt;strong&gt;Set Panel Link&lt;/strong&gt; as &amp;quot;Site Administration
      &amp;gt;     People&amp;quot;&lt;/p&gt;   &lt;p&gt;       &lt;img
        data-fileentryid="215866"
      src="https://khichad.com/documents/portlet_file_entry/135001/0c041ea6-8707-46dc-a605-593141afc1f1.jpg/2d5a620f-ba9f-296d-78e7-2ee7d2ffe2ef"&gt;
      &lt;br&gt;   &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Save and publish the object. &lt;/p&gt;
  &lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;   &lt;strong&gt;Step 5: Establishing Relationships with System Objects&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Linking Custom Object with Account:&lt;/strong&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;Open the Account object and click on the + icon to add the
  relationship.&lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215877"
  src="https://khichad.com/documents/portlet_file_entry/135001/111a514f-b17c-4154-9587-049018f8c010.png/a218d094-7b54-fcf2-5375-92a1ba1e85b4"&gt;
  &lt;br&gt;  &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;Choose One-to-Many as the relationship type. &lt;/li&gt;
    &lt;li&gt;Choose Product as the object in the object field. &lt;/li&gt;
    &lt;li&gt;Click Save to establish the relationship.&lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215888"
  src="https://khichad.com/documents/portlet_file_entry/135001/dad89a1c-431b-40bd-809c-07ccdfa71b58.png/82cf5016-1bb7-03c6-1552-ba7a8455c2dd"&gt;
  &lt;br&gt;  &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Step 6: Creating an Account&lt;/strong&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;Navigate to the &lt;strong&gt;Control Panel&lt;/strong&gt; and click
    on       &lt;strong&gt;Accounts&lt;/strong&gt;. &lt;img data-fileentryid="215899"
    src="https://khichad.com/documents/portlet_file_entry/135001/aee6e036-f5f4-4dff-81aa-dc69499e9dc1.jpg/6f4eb3a4-77c9-082b-57d5-583b9be10378"&gt;
  &lt;/li&gt;  &lt;li&gt;Add account information and addresses as needed. &lt;br&gt;  &lt;img
      data-fileentryid="215910"
    src="https://khichad.com/documents/portlet_file_entry/135001/726e8429-7e3d-459b-9a40-2672c6280935.png/48f4b1b8-4258-7080-5892-34aaf70ef838"&gt;
  &lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Step 7: Creating an Asset Library&lt;/strong&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;  &lt;p&gt;Go to &lt;strong&gt;Global Menu &amp;gt; Applications &amp;gt;
        Asset       Library.&lt;/strong&gt; &lt;br&gt;  &lt;img
        data-fileentryid="215921"
      src="https://khichad.com/documents/portlet_file_entry/135001/46792f39-8782-4ee3-afd8-d485b1cb0d5b.png/73860d14-d5c7-b957-fcfc-0dc1ff42fd44"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Provide a name for the Asset Library.&lt;br&gt;
        &lt;img data-fileentryid="215932"
      src="https://khichad.com/documents/portlet_file_entry/135001/6f054ec1-f681-4e74-b882-6f03d75107bf.png/93a0051f-ae8b-3dcb-0680-6b696c6e49b8"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Add sites to the Asset Library. &lt;br&gt;  &lt;img
        data-fileentryid="215943"
      src="https://khichad.com/documents/portlet_file_entry/135001/9b2fde54-b4b0-4c0a-8488-a8fcc47978d9.jpg/80b7e2aa-f0bd-9cb3-a512-03f28f119183"&gt;
    &lt;/p&gt;  &lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;In the &lt;strong&gt;Documents and Media&lt;/strong&gt; section, create a
  folder for Product images and upload relevant images.&lt;br&gt; &lt;img
    data-fileentryid="215954"
  src="https://khichad.com/documents/portlet_file_entry/135001/c8048e87-078a-4a81-b723-f36ba50bc301.png/ad4781a1-4b06-5e2e-da42-ecbad6978bd0"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Step 7: Adding a Product Image Field&lt;/strong&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;Navigate to &lt;strong&gt;Control Panel &amp;gt; Objects &amp;gt; Select
  Product.&lt;/strong&gt; &lt;/li&gt;  &lt;li&gt;Add a new field  &lt;/li&gt;  &lt;li&gt;
      &lt;strong&gt;Label: &lt;/strong&gt;Product Image &lt;/li&gt;  &lt;li&gt;
    &lt;strong&gt;Name:&lt;/strong&gt; productImage &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Field
    Type:&lt;/strong&gt; Attachment &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Request
    Files:&lt;/strong&gt; Upload or Select from Documents and     Media Item
  Selector.&lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215965"
  src="https://khichad.com/documents/portlet_file_entry/135001/4eeec529-d93c-4e91-9822-ab491366ed64.png/7d097644-c5fe-031a-dbd0-1b10362226bb"&gt; &lt;/p&gt;
    &lt;p&gt; Step 8: Viewing Your Object &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;  &lt;p&gt;Go to the Site Navigation under &lt;strong&gt;People
      &lt;/strong&gt;and select &lt;strong&gt;Product&lt;/strong&gt;.&lt;br&gt;  &lt;img
        data-fileentryid="215976"
      src="https://khichad.com/documents/portlet_file_entry/135001/2d29727b-121f-4813-ae5f-078af677abea.png/64ee5848-1003-efff-3b7c-942aee4f3c57"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;Click on the '+' icon to add the object. &lt;/li&gt;
    &lt;li&gt;Fill in the details for each field, including uploading an image
    from the Asset Library. &lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215987"
  src="https://khichad.com/documents/portlet_file_entry/135001/68a2427b-4863-4c61-96d3-f279124c078b.jpg/cfaf707c-a972-b2df-9ba0-d24cf365a27a"&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;  &lt;p&gt;Save the object. &lt;/p&gt;  &lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;Step 9: Displaying the Object on a Web Page &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;Navigate to your site and drag and drop the Asset
    Publisher     onto the page. &lt;/li&gt;  &lt;li&gt;Click Configuration in the
    Asset   Publisher.&lt;/li&gt; &lt;/ol&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215998"
  src="https://khichad.com/documents/portlet_file_entry/135001/da6af8f6-0040-44fb-9cac-e2cdfb74b757.png/b98e11ba-1c6f-c364-3386-1336114a5c5c"&gt; &lt;/p&gt;
    &lt;ol&gt;  &lt;li&gt;Set Asset Selection to Dynamic and select Asset Type:
  Product. &lt;/li&gt;  &lt;li&gt;Save the configuration.  &lt;/li&gt;  &lt;li&gt;The Product
    object will now be visible on the web page. &lt;br&gt;  &lt;img
      data-fileentryid="216009"
    src="https://khichad.com/documents/portlet_file_entry/135001/fedc495e-2244-415d-85d0-5dbf24d6654f.jpg/d94507c6-921e-b417-8383-615f0aa90682"&gt;
  &lt;/li&gt; &lt;/ol&gt;
    &lt;div class="overflow-auto portlet-msg-info"&gt;If you have any query,
    &lt;a href="https://khichad.com/contact-us"&gt;click here&lt;/a&gt;&lt;/div&gt;
    &lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Admin .</dc:creator>
    <dc:date>2025-01-08T05:35:00Z</dc:date>
  </entry>
  <entry>
    <title>Cron Job Scheduling in Liferay DXP 7.4 : Best Practices and Tips</title>
    <link rel="alternate" href="https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=215440" />
    <author>
      <name>Admin .</name>
    </author>
    <id>https://khichad.com/en/c/blogs/find_entry?p_l_id=435&amp;entryId=215440</id>
    <updated>2025-01-27T18:06:11Z</updated>
    <published>2025-01-07T11:26:00Z</published>
    <summary type="html">&lt;h4&gt;Introduction: &lt;/h4&gt;
    &lt;ul&gt;  &lt;li&gt;The Job Scheduler is a powerful framework built on
    Liferay's     scheduler engine, allowing you to run and schedule
    business logic     seamlessly. A cron job scheduler is a vital
    feature in any     application for automating tasks at specified
  intervals. &lt;/li&gt;     &lt;li&gt;This framework uses the
    &lt;strong&gt;DispatchTaskExecutor&lt;/strong&gt;     interface to create
    templates with custom logic, which you can use     to set up tasks
    through the Control Panel. After creating a task     with the Job
    Scheduler, you can adjust its settings and schedule     when it
    should run.  &lt;/li&gt;  &lt;li&gt;cron jobs are often used to perform
    maintenance tasks, email notifications, clean-up operations, or
    other background processes. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Prerequisite: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;JDK 11 &lt;/li&gt;  &lt;li&gt;Liferay Server:
  liferay-dxp-tomcat-2024.q4.0 &lt;/li&gt;  &lt;li&gt;Liferay Developer Studio: 
  3.9.7.202207131011-ga8 &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Cron Job Scheduling Workflow in Liferay: &lt;/strong&gt;
  &lt;br&gt; The cron job configuration process involves several steps that
  work together to schedule, execute, and track the execution of tasks.
  Below is a detailed explanation of each step: &lt;img
    data-fileentryid="215026"
  src="https://khichad.com/documents/portlet_file_entry/135001/liferaydxp.png/0467b5f7-7ff6-64e7-0705-f4228d9104b0"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Scheduler Framework:&lt;/strong&gt; &lt;br&gt;
  &lt;strong&gt;Objective: &lt;/strong&gt;Use the Quartz Scheduler to create a
  trigger based on the cron expression. &lt;br&gt; The Quartz Scheduler is a
  popular and powerful job scheduling library used in Liferay to handle
  cron jobs. It allows for highly configurable job scheduling. When the
  cron expression is parsed, a trigger is created that determines when
  the job should run. &lt;br&gt; &lt;br&gt; &lt;strong&gt;2. Cron Job
  Configuration:&lt;/strong&gt; &lt;br&gt; &lt;strong&gt;Objective:&lt;/strong&gt; Define the
  cron expression and store it in an OSGi component or configuration
  file. &lt;br&gt; A &lt;strong&gt;cron expression&lt;/strong&gt; is a string that
  represents a time schedule. It is a highly flexible and concise way to
  define when a job should run &lt;br&gt; &lt;strong&gt;Example:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;0 0 12 * * ? — This means the job will run at 12:00 PM
    (noon) every day. &lt;/li&gt;  &lt;li&gt;0 0 0 1 * ? — This runs the job at
    midnight on the first day of each month. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;The cron expression is typically stored in a configuration file
  or   directly in an OSGi service or component in Liferay. These
  configurations are loaded when the Liferay server starts or can be
  updated through the Control Panel or custom configurations. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;3. Job Executor:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Objective: &lt;/strong&gt;Execute the job once the trigger fires. &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;The Job Executor is a critical component in the
      scheduled job process. Once the cron expression is processed, and
      the scheduled trigger fires at the specified time, it is the Job
      Executor's responsibility to carry out the actual execution of the
      task. This is where the core logic of the scheduled task is
    executed. &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;BaseDispatchTaskExecutor, which is
      the base class provided by Liferay to create custom task
      executors. When the scheduled trigger fires, Liferay will invoke
      the doExecute method. &lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;4.OSGi Scheduler Service:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Contains the task &lt;strong&gt;execution logic&lt;/strong&gt;,
      defined as an &lt;strong&gt;OSGi service&lt;/strong&gt;. &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;
      &lt;p&gt;Includes the &lt;strong&gt;business logic&lt;/strong&gt; for the
        &lt;strong&gt;scheduled task&lt;/strong&gt;, such as &lt;strong&gt;database
        interactions, processing data, and other operations.&lt;/strong&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Business Logic:&lt;/strong&gt; This
      step involves performing the       core task of the scheduled job.
      It could involve a variety of       operations, such as querying
      or updating a database, sending       emails, performing
      calculations, processing data, or other       application-specific
    tasks. &lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;5. Task Logic/Business Logic:&lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Objective:&lt;/strong&gt; Perform the business logic of the job. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;6. Logs:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Logs the task execution details such as success/failure,
    execution time, messages, and errors. &lt;/li&gt;  &lt;li&gt;Provides insights
    into task performance and debugging information. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;7. Database: &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;Objective:&lt;/strong&gt; Persist the task execution results
  for   future reference and auditing. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Persistence of Results:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;After the scheduled job (cron task) is executed, it’s
    important to store the execution results for reference and tracking.
    This involves saving key details about each execution, such
  as: &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Task Name: &lt;/strong&gt;The name of the task
    being executed.     This helps in identifying what the task is doing
    (e.g., &amp;quot;Daily     Report Generation&amp;quot; or &amp;quot;Data
  Backup&amp;quot;). &lt;/li&gt;  &lt;li&gt;     &lt;strong&gt;Status:&lt;/strong&gt; The status of
    the task after execution,     indicating whether it was successful,
    failed, or encountered any   issues. &lt;/li&gt;  &lt;li&gt;
      &lt;strong&gt;Execution Time:&lt;/strong&gt; The date and time when the task
    was     executed are crucial for tracking the timing and ensuring
    that tasks     run at the correct scheduled intervals. &lt;/li&gt;  &lt;li&gt;
      &lt;strong&gt;Error Messages (if any):&lt;/strong&gt; If the task encounters
    an     error during execution, these error messages or exceptions
    need to     be logged. This helps identify the root cause of any
    failures and is     crucial for debugging.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;Steps to Set Up a Cron Job Scheduler in
  Liferay: &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;Follow these detailed steps to create and set up a Cron Job
  Scheduler in Liferay. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;1. Create a Liferay Workspace Project&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open &lt;strong&gt;Liferay Developer Studio&lt;/strong&gt; and start
    the       &lt;strong&gt;Liferay Server.&lt;/strong&gt; &lt;/li&gt;  &lt;li&gt;Go to the
      &lt;strong&gt;File     &lt;/strong&gt;menu, select &lt;strong&gt;New&lt;/strong&gt;, and
      choose&lt;strong&gt;       Liferay Workspace Project&lt;/strong&gt;. &lt;/li&gt;
    &lt;li&gt;Enter your desired     project name (e.g., liferay-cron-job),
    then click   &lt;strong&gt;Finish&lt;/strong&gt;. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2. Create a Liferay Module Project &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Navigate to &lt;strong&gt;File &lt;/strong&gt;→ &lt;strong&gt;New &lt;/strong&gt;→
      &lt;strong&gt;Liferay Module Project.&lt;/strong&gt; &lt;/li&gt;  &lt;li&gt;Name the
    project (e.g., liferay-cron-jobs-scheduler). &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2.1 Select Project Template:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Choose the template as &lt;strong&gt;mvc-portlet&lt;/strong&gt;. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;2.2&lt;/strong&gt; Click &lt;strong&gt;Next &lt;/strong&gt;and proceed
  with the   project setup. &lt;br&gt; &lt;strong&gt;2.3&lt;/strong&gt; Enter the
    &lt;strong&gt;Portlet   Class&lt;/strong&gt; and &lt;strong&gt;Package Name&lt;/strong&gt;.
  Then click     &lt;strong&gt;Finish &lt;/strong&gt;to create the module. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;3. Create a Java Class for the Cron Job Logic&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Right-click the package name in the project and select
      &lt;strong&gt;New → Java Class&lt;/strong&gt; (e.g.,
  ScheduledJobTaskExecutor). &lt;/li&gt;  &lt;li&gt;In the newly created Java class,
    add the following properties:&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215037"
  src="https://khichad.com/documents/portlet_file_entry/135001/figimg2.png/c201718a-4bac-c56a-b1fe-5b3cafd0303e"&gt;
  &lt;br&gt;  &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;4. Implement Job Logic&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Extend BaseDispatchTaskExecutor to
        Implement Custom Task       Logic: &lt;/strong&gt;By extending
      BaseDispatchTaskExecutor, you can       create custom logic for
      your cron job, enabling it to be       scheduled, executed, and
      tracked within Liferay's task scheduler     framework. &lt;/p&gt;  &lt;/li&gt;
    &lt;li&gt;  &lt;p&gt;       &lt;strong&gt;Override Methods: &lt;/strong&gt;       &lt;br&gt;
      Implement the following required methods: &lt;br&gt;  &lt;strong&gt;(a).
        doExecute(): &lt;/strong&gt;This is the method where the main logic of
      the job should be written. When the job is triggered, this method
      will be executed, and your specific task logic should go inside
      this method. &lt;br&gt;  &lt;strong&gt;(b). getName():&lt;/strong&gt; This method
      should return the name or identifier for your task or job. This is
      useful for identifying which task is being executed or scheduled.
      It can return a simple string representing the name of the
    job.&lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;Example:&lt;br&gt; &lt;img data-fileentryid="215048"
  src="https://khichad.com/documents/portlet_file_entry/135001/figimg3.png/a92abd78-d4e2-6e5f-833a-e451db8cfebc"&gt;
  &lt;br&gt;  &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;5. Deploy the Portlet &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;After adding your logic, deploy the portlet to the Liferay
  server. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;6. Log in to the Liferay Portal&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Open your browser and log in to the &lt;strong&gt;Liferay
    Portal.&lt;/strong&gt;   &lt;/li&gt;  &lt;li&gt;Navigate to the &lt;strong&gt;Global Menu →
      Control Panel →       Configuration → Job Scheduler&lt;/strong&gt;.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;7. Access Job Scheduler&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Navigate to the &lt;strong&gt;Global Menu → Control Panel →
      Configuration → Job Scheduler&lt;/strong&gt;.&lt;img
      data-fileentryid="215059"
    src="https://khichad.com/documents/portlet_file_entry/135001/figimg4.png/63d36600-a55c-307a-f1c2-5341bc41dbf8"&gt;
    &lt;br&gt;   &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;8. Configure the Cron Job Scheduler &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;In the Job Scheduler interface, click the + icon to
      add       a new scheduler.&lt;br&gt;  &lt;img data-fileentryid="215114"
      src="https://khichad.com/documents/portlet_file_entry/135001/figimg7+%281%29s.png/ed0bd496-4169-e87b-7fe4-3ef2f877f6ff"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p&gt;Select Scheduled Job Task Executor from the
      available options.&lt;br&gt;  &lt;img data-fileentryid="215081"
      src="https://khichad.com/documents/portlet_file_entry/135001/figimg5.png/a08e9b88-b0f1-18d1-e9ed-30c8d69f98cb"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;Enter the job name and click
  &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215092"
  src="https://khichad.com/documents/portlet_file_entry/135001/figimg6.png/6aefa84c-4525-5b74-b8e5-80340f28fff5"&gt;
  &lt;br&gt;  &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;9. Test the Cron Job&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Click the &lt;strong&gt;Run Now&lt;/strong&gt; button to execute
      your job immediately.&lt;br&gt;  &lt;img data-fileentryid="215103"
      src="https://khichad.com/documents/portlet_file_entry/135001/figimg7+%281%29.png/a34a2da7-ec07-dcb1-df4d-b3befb9cdeaf"&gt;
    &lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;You should see a confirmation message indicating
    that the job has executed successfully. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;10. Manage Your Cron Job &lt;/strong&gt; &lt;/p&gt;
    &lt;p&gt;You can now manage the scheduled job by modifying its
  configuration, schedule, and other settings to meet your needs. &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;10.1 Adjust Time Zone:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt; In the &lt;strong&gt;Time Zone&lt;/strong&gt; field, select the
    desired     region to ensure the job runs at the correct time in
    your preferred     time zone. &lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;10.2 Customize Cron Expression: &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;In the &lt;strong&gt;Cron Expression&lt;/strong&gt; field, you can
    enter     a specific cron expression that defines when and how often
    the job     should be triggered (e.g., daily, weekly, or specific
  times). &lt;/li&gt;     &lt;li&gt;Optionally, set an &lt;strong&gt;End Date&lt;/strong&gt; and
      &lt;strong&gt;End     Time&lt;/strong&gt; to determine when the job should
    stop running,     allowing for precise control over its
  lifecycle.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;strong&gt;10.3 Define End Date and Time:&lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;Optionally, set an &lt;strong&gt;End Date&lt;/strong&gt; and
      &lt;strong&gt;End     Time&lt;/strong&gt; to determine when the job should
    stop running,     allowing for precise control over its
  lifecycle.&lt;/li&gt; &lt;/ul&gt;
    &lt;p&gt;   &lt;img data-fileentryid="215168"
  src="https://khichad.com/documents/portlet_file_entry/135001/Job+Scheduler+config..png/582026ee-757b-3da2-627c-eb6aaf95f067"&gt; &lt;/p&gt;
    &lt;p&gt;   &lt;strong&gt;11. Monitor Job Logs &lt;/strong&gt; &lt;/p&gt;
    &lt;ul&gt;  &lt;li&gt;  &lt;p&gt;Click on your job to view its details. &lt;/p&gt;  &lt;/li&gt;
    &lt;li&gt;  &lt;p&gt;Go to the &lt;strong&gt;Logs &lt;/strong&gt;tab to monitor the output
      and status of the scheduled job.&lt;br&gt;  &lt;img
        data-fileentryid="215179"
      src="https://khichad.com/documents/portlet_file_entry/135001/job+schedulor+logs.png/70415707-fd97-2578-b340-9899909a7401"&gt;
    &lt;/p&gt;  &lt;/li&gt; &lt;/ul&gt;
    &lt;div class="overflow-auto portlet-msg-info"&gt;If you have any query,
    &lt;a href="https://khichad.com/contact-us"&gt;click here&lt;/a&gt;&lt;/div&gt;</summary>
    <dc:creator>Admin .</dc:creator>
    <dc:date>2025-01-07T11:26:00Z</dc:date>
  </entry>
</feed>
