Liferay Database Table Desktop?

I am new to Liferay. Now I need to create a flowchart that has a Liferay table workflow in the following scenarios,

1) What will be the list of the table will be displayed / updated if we create a site admin?

2) What is the list of tables will reflect / update if we build the site?

I tried to open the database tables and noticed that USER_, CONTACT_ would reflect. But I need a list of all related tables to be displayed when building site and siteminmin? I am using Liferay version 6.2.

Thanks in advance.

0


source to share


2 answers


If you want to know the internals of any system, it is always best to check the corresponding source code. So, in this case, you can check the source code for those classes that are used for CRUD operations for user and site.

1) What will be the list of the table will be displayed / updated if we create a site admin?

  • Site Administrator is a role that can be applied to a user created in Liferay.
  • So if you want all tables created from User-creation before User to be assigned the Site-administrator role for a specific site, here are some that I can remember:
    • User (obviously)
    • Contact_ (not so obvious :-))
    • Group_ (Users are also created as a record in this table, since users have public and private pages)
    • Address (if you add an address)
    • Phone (if you add a phone)
    • Users_Roles (the Power user

      role is assigned by default)
    • UserGroupRole (user-site relationship and role, site admin is site role)
    • Users_Groups (user-site relationship)
  • For others, you must provide the source code for UserLocalServiceImpl

    , RoleLocalServiceImpl

    and GroupLocalServiceImpl

    , check the corresponding prefixed methods add

    , update

    etc.
  • The appropriate service.xml

    module for this module will show the database tables that are in use.

2) What is the list of tables will reflect / update if we build the site?



  • Websites are nothing but groups in Liferay. Therefore, its obvious table Group_

    plays a big role.
  • Other tables also depend on what configuration you make when creating the site.
  • Then, when creating pages for the site, other tables of the type will appear Layout

    .

I highly recommend that you continue exploring the source code for the classes and you will understand the flow - when and which tables will be affected .

Here are some tips that can help you walk through the source code, almost everyone *LocalServiceImpl

is related to *Model

like UserLocalServiceImpl

with UserModel

, and almost everyone *Model

has a corresponding database table with the same name. In addition, the function name in most cases hints at which service classes are used to connect to the database, for example, an append User

hints at usage UserLocalServiceImpl

.

I hope I understood your question and was able to provide the right direction.

+2


source


If you want to find out, because you also want to write to these tables: Don't go there! You should simply use the API to modify the data that Liferay stores. Otherwise, you will face disasters in the future - promised.

To get only those SQL commands used by Liferay, tweak portal-ext.properties

and change this default:

hibernate.show_sql=false

      



Then go to the "Server Administration / Log Levels" section and add a new category "org.hibernate.SQL", configure it at the DEBUG level. The results are then displayed in logs. Note that this log configuration is temporary and will be returned the next time the server starts. If you want the parameter to be persistent, you need to go into the Liferay log4j config files.

Remember: you don't want to write to tables. Promise!

+2


source







All Articles