掲示板

How to create a generic OSGI module - Documentation.

7年前 に Julian Pfeil によって更新されました。

How to create a generic OSGI module - Documentation.

Junior Member 投稿: 72 参加年月日: 16/03/01 最新の投稿
I started reading the documentation section about customizing the product menu:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/customizing-the-product-menu#adding-custom-panel-categories

There it says one should create a generic OSGI module e.g. with blade. But as far as i understood from the blade documnetation (Tooling->Blade CLI in this documentation) is used for creating liferay-specific modules.

So my question is: how to create a generic OSIG module using blade?

Also a suggestion to put the description of how to create a generic OSGI module via blade into the Tooling->Blade CLI section of the documentation, since the product customization documentation does reference it.

Kind Regards,
Julian
thumbnail
7年前 に Cody Hoag によって更新されました。

RE: How to create a generic OSGI module - Documentation. (回答)

Junior Member 投稿: 70 参加年月日: 12/04/26 最新の投稿
Hi Julian,

We try to keep the documentation as tool-agnostic as possible, since so many developers prefer different tools. A generic OSGi module basically means you should create a project with your tool's build file (pom.xml, build.gradle, etc.) and a bnd.bnd file. Then the tutorial takes it from there by creating a package with a Java class. A generic Gradle project's anatomy would look something like this

- my-project
    - src
        - main
            - java
    - bnd.bnd
    - build.gradle


If you still want a generic OSGi module generated, this can be easily done by using any of the Blade CLI templates. For example, you could follow the Portlet Template tutorial to generate an OSGi module, and then delete the Portlet class generated. Then, voila! You have a "generic OSGi module".

Luckily, the tutorial you referenced has its own Blade CLI template: panelapp. You could run that template and get a head start for customizing the Product Menu. A tutorial for using that template in Blade CLI should be published today.

Let me know if you have any further questions!
7年前 に Julian Pfeil によって更新されました。

RE: How to create a generic OSGI module - Documentation.

Junior Member 投稿: 72 参加年月日: 16/03/01 最新の投稿
Cody Hoag:
Hi Julian,

We try to keep the documentation as tool-agnostic as possible, since so many developers prefer different tools. A generic OSGi module basically means you should create a project with your tool's build file (pom.xml, build.gradle, etc.) and a bnd.bnd file. Then the tutorial takes it from there by creating a package with a Java class. A generic Gradle project's anatomy would look something like this

- my-project
    - src
        - main
            - java
    - bnd.bnd
    - build.gradle


If you still want a generic OSGi module generated, this can be easily done by using any of the Blade CLI templates. For example, you could follow the Portlet Template tutorial to generate an OSGi module, and then delete the Portlet class generated. Then, voila! You have a "generic OSGi module".

Luckily, the tutorial you referenced has its own Blade CLI template: panelapp. You could run that template and get a head start for customizing the Product Menu. A tutorial for using that template in Blade CLI should be published today.

Let me know if you have any further questions!


Hey Cody Hoag,

thanks for the quick reply!

It would be nice to have the information you just wrote included in one of the earlier chapters (Fundamentals or Tooling), because it seems useful to me and is already concise enough to fit in an already-existing or it's own sub-chapter.
Also it helps liferay-dev-newcomers (like me) to understand the liferay development platform AND the documentation more easily, which makes it easier and more probable for new people to adopt liferay, because you don't have to search for basic but required (and referenced) information in the web. Of course, for further reading and extended information of external tooling there can always be links.

This is something i experience throughout most of this documentations chapters. But for this i'll post a new thread when i'm more used to liferay developing, so i can help with it.

Kind Regards,
Julian
thumbnail
7年前 に Cody Hoag によって更新されました。

RE: How to create a generic OSGI module - Documentation.

Junior Member 投稿: 70 参加年月日: 12/04/26 最新の投稿
Thanks for your feedback! We'll consider creating something like you suggested to help with those new to Liferay development.

Thanks again!
thumbnail
7年前 に David H Nebinger によって更新されました。

RE: How to create a generic OSGI module - Documentation.

Liferay Legend 投稿: 14917 参加年月日: 06/09/02 最新の投稿
Julian Pfeil:
I started reading the documentation section about customizing the product menu:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/customizing-the-product-menu#adding-custom-panel-categories

There it says one should create a generic OSGI module e.g. with blade. But as far as i understood from the blade documnetation (Tooling->Blade CLI in this documentation) is used for creating liferay-specific modules.


Actually this has already been done. There's a new blade template, "api" which really just creates a blank bundle project. You get the bnd.bnd file and an effectively empty project.

Use:

blade create -t api [...] vanilla-bundle


to get your starting project.
7年前 に Robert Meissner によって更新されました。

RE: How to create a generic OSGI module - Documentation.

Junior Member 投稿: 76 参加年月日: 15/02/26 最新の投稿
I found the enroute tutorial and especially the best practices in developing microservices to be very helpful
http://enroute.osgi.org/tutorial_base/320-provider.html#how-does-it-work


Hope, this helps for you, too.