Skip to main content

Service Builder 1

Service Builder uses the spring and hibernate integration Data Access Objects implementation mechanism in short we can call it as DAO implementation.


Here Service Builder Tool will use the spring and hibernate technology to develop service layer to Plugin portlet.

Service Layer's -:

Persistence/DAO classes:

Persistence or DAO classes will provide the direct data base interaction like insert, delete and update the data in table. such kind of logic will be present in this classes.

application-layers.pngConceptually for each table we have one persistence class that will interact with table. Here actual data base interaction code will be present.


As we know that to interact with database we need hibernate/jdbc in java. Persistence/DAO classes we will get the session factory object and from that we will open session, with that session object we will do all database interactions, once we finish all tasks we will close the session.

Model/POJO -:

The model or POJO classes will used to pass the data from application layer to database. In the ORM/Hibernate context each row in tables is one model or POJO object. This row we will represent as Model/POJO class. This is simple java bean or java class has setters and getters methods.

The session always use this object to pass data to table and same way it get the data from table and fill in pojo/model object.

At the time of database interaction we call this object as Persistence object. The persistence object is java bean it will bind with table’s rows when we open session to respective table.

Service Classes -:

Service classes will be separate the application layer and direct Data base interaction layer. Before inserting data if any business logic is requires then we will use this service classes 

After perform the business logic then we will call DAO classes to interact with database.
We can use one service class and there we will create many DAO objects to interact with many tables in database.


Required things used in Liferay Service Builder-:

  1. Data Source
  2. Configure All Model classes in Hibernate mapping files
  3. Session factory
  4. Configure All Service Implementation classes in spring configuration files
  5. Load all configuration files in spring context








Comments

Popular posts from this blog

Liferay 7.1 Topics Coming Soon stay connected

1. Liferay 7.1 Service Builder 2. Rest Service and Liferay 3. Consuming SOAP service with Liferay 7.1 4. Creating Theme With Liferay 7.1 Using Liferay IDE Using NPM 5. Create Angular NPM Module 6. Web Content Management 7. OSGI Basic 8. Liferay 7.1 with more than 1 DB 9. A sample project 10. Liferay Dev Ops

How the portal page is loaded with respective portlets

How the portal page is loaded with respective portlets When a user requests a page with a URL, 1.    The browser sends the request to the Application Server (AS). 2.    Liferay gets the page name from the URL. 3.    It goes to the layout database table and finds the related        theme and page layout. 4.    Based on the page layout, Liferay finds the portlets added        into each area of the page layout. 5.    Liferay runs the portlet and adds the output in the        portlet.vm template. 6.    Liferay interprets the portlet.vm template and adds the output        in the page layout. 7.    Then Liferay interprets the page layout and adds the output in        the portal_normal.vm template. 8.    After that Liferay interprets the portal...

Liferay Dynamic Query API

Liferay Dynamic Query API  -Liferay Dynamic Query API is an elegant feature in Liferay portlet development. -Dynamic Query API can only perform read operations against database. These we will use specially to provide search operations against database. -Dynamic Query API is independent feature and we can implement anywhere in the development like we can implement in JSP pages, Portlet Action Classes and service implementation classes. Types of Class Loader-: Here we have two class loaders 1. Portal Class Loader-:    If any class or model class in portal level then we need to use Portal Class Loader in Dynamic Query Object.    ClassLoader portalClassLoader=PortalClassLoaderUtil.getClassLoader();    We can implement dynamic query against portal level class such as User, Group, Role, Organization, Layout and Layoutset 2. Portlet Classs Loader-:    Portlet Class Loader is related to each portlet.    ClassLoader portle...