Contacta con nosotros
contacto@flabo.es

Liferay DXP + Apache Felix Web Console

Apache Felix Web Console

The main technological change that Liferay DXP incorporates is the use of OSGi. Liferay uses the OSGi implementation Apache Felix, usually all the administration of the modules are done using the Gogo shell but there are other ways, as the one that we are showing here.

Features

  •  List bundles
  • Install update or remove bundles
  • Bundle details, meta-information
  • Bundles configuration
  • List OSGi Services
  • Relationship between services and bundles
  • Licenses managed inside bundles
  • System information

Why is Apache Felix Web Console so interesting?

  1. In some situations is not possible to access the machines to admin the bundles, neither telnet Gogo Shell neither SSH.
  2. Sometimes the operators have no knowledge of Liferay administration and do not know how access to the settings section, or simply has no rights to do it.
  3. When you need to locate a service, for example to override it with another service rank.

 

Official website

http://felix.apache.org/documentation/subprojects/apache-felix-web-console.html

Installation

  1. Start Liferay DXP
  2. Connect to Gogo shell
  3. Install web console jar directly from Internet, execute the install command on the gogo shell :
    install http://central.maven.org/maven2/org/apache/felix/org.apache.felix.webconsole/4.3.0/org.apache.felix.webconsole-4.3.0.jar
  4. The new module only will be installed, you need to start it manually.
  5. Use command “lb” to list the modules and locate the web console recently installed.
    apache_felix_webconsole (2)
  6. Execute the start command on the Gogo Shell:
    apache_felix_webconsole (3)
  7. After the module starts, you can go to http://localhost:8080/o/system/console
  8. The default credentials are: admin/admin

Bundles management

http://localhost:8080/o/system/console/bundles 
In that section, you can get a list of the bundles deployed on the OSGi container, included all the modules that conform Liferay itself.

apache_felix_webconsole (4)

Also in the top of the table there is a searcher to help us find the correct bundle ( a Liferay bundle has more than 500 bundles ). For example, if we can know the bundles involved with the JournalArticles:

apache_felix_webconsole (5)

Bundle meta-information

From the list (filtered or not) we can access to all the details and meta-information of each bundle. To see the details only is necessary click on the icon triangle beside Bundle name.

apache_felix_webconsole (6)

This information could be very useful when you need to know the dependencies or the packages exported by a bundle.

 

Install bundle

To install a new bundle only is necessary access to the upload form, is present in the top-right side of the table:

apache_felix_webconsole (7)

You can select if the bundle must be immediately started.

apache_felix_webconsole (8)

Uninstall bundle

To uninstall a bundle only is necessary click on the last button present on the right side of the table:

apache_felix_webconsole (9)

Configuration management

The Web Console also includes a section to manage the Configuration API of OSGI.

When an application is deployed to Liferay, it’s common to need different configurations depending on the scope. That means having different configurations for a given application per virtual instance (a.k.a. Company), site (a.k.a. Group), or portlet instance. Liferay Portal provides an easy way to achieve this with little effort through a new framework called the Configuration API that is based on the standard OSGi Configuration Admin API.
https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-0/making-your-applications-configurable

 

Usually, the way to modify this configuration is using the control panel, xml files stored inside OSGI folder or programmatically with the API. With the web console we have another way to achieve that.

Going to http://localhost:8080/o/system/console/configMgr we get a list of all the configurations available on the OSGi container.
Clicking on each element a pop-up will be open with the configuration values in a form in which we can modify the values or even reset to default values.

apache_felix_webconsole (10)

The alert triangle informs us that the values that we are showing are the default ones, similar to the Liferay control panel view:

apache_felix_webconsole (11)

If we change the values on webconsole:

apache_felix_webconsole (12)

NOTE: Is necessary mark the left checkbox to save the value.

Immediately the changes are reflected on Liferay:

apache_felix_webconsole (13)

Services management

Going to http://localhost:8080/o/system/console/services we get a list of all the services registered on the Service Registry. Here we can find all the Liferay Services and also our custom services. Remember that even clases like MVCRenderCommand or MVCActionCommand are services, for this reason we can find here almost every view or action deployed on the portal.
Clicking on the service name we can see all the details, and at the right side we have identified the bundles that provide that service.

apache_felix_webconsole (1)

As you can imagine, there are thousands of services, on the top of the table you can use a search form to filter the results.

________________________________________