-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for BELL SPI visibility and BELL properties #5724
Comments
Hello @dmuelle. Per our previous conversation, let's schedule a few minutes to consider how to organize this content before submitting a draft. I think we need a new example section to describe extending SPI using a BELL service, and perhaps some conceptual content under section "Enabling this feature", before the examples start. |
@dmuelle Here's my first draft: epic.19368.openliberty.io.feature.doc.bells-1.0.sep28.docx. I spent time this evening adding meta-info and transposing to MS Word. @chirp1 Regarding what needs to be documented: The draft provides updates to the Basic Extensions using Liberty Libraries 1.0 feature documentation. The changes include conceptual example sections for the new |
per slack discussion and David's comments in the draft, we'll remove the custom user registry example form the doc until we can revise and test it, which is tracked in #5850 |
Hi @dazavala - I've created a draft based on your word doc: I have a few questions to sort out in some of the examples before we do a proper review. Configure a BELL
This seems a little vague- can we give common 1-2 sentence example to clarify? eg Specify configuration properties in BELL services
we're asking them to "... define a public constructor or a public method that is named Expose a REST endpoint for custom resourcesI revised this slightly to try and draw clear connections between the examples and the descriptions- hopefully I haven't messed anything up, but it's certainly possible that I did. I wonder if there is a better way to organize the examples in this section- it feels like it jumps around a bit (though that might just be because I'm used to documenting server.xml rather than app code). Right now we have 4 examples, in the following order:
Does this order represent how a developer would likely configure something like this? App code first, then OSGi prop, and finally the server? Just want to make it as intuitive as possible to go from one example to the next. It might help to put a 1-2 sentence overview at the beginning of the section to help the reader map the examples to the overall process.
What are Open Liberty extenders? I dont think we've used this term in OL doc before |
From: David Mueller ***@***.***>
Date: Monday, October 3, 2022 at 1:21 PM
To: OpenLiberty/docs ***@***.***>
Cc: David Zavala ***@***.***>, Mention ***@***.***>
Subject: [EXTERNAL] Re: [OpenLiberty/docs] Documentation for BELL SPI visibility and BELL properties (Issue #5724)
Hi @dazavala - I've created a draft based on your word doc: https: //docs-draft-openlibertyio. mqj6zf7jocq. us-south. codeengine. appdomain. cloud/docs/latest/reference/feature/bells-1. 0. html I have a few questions to sort out in some of the examples
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi @dazavala<https://github.com/dazavala> - I've created a draft based on your word doc:
https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/reference/feature/bells-1.0.html<https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/reference/feature/bells-1.0.html>
I have a few questions to sort out in some of the examples before we do a proper review.
Configure a BELL
Be sure to enable the Open Liberty features that export the API or SPI packages that are required by the BELL service implementation classes.
This seems a little vague- can we give common 1-2 sentence example to clarify? eg
For example, if you need to use x, make sure to enable the y feature.
Be sure to enable the Open Liberty features that provide the API or SPI packages required by the library. For example, the feature configuration must enable the Jakarta Servlet feature for a library that provides an implementation of interface `jakarta.servlet.ServletContainerInitializer`, because the Jakarta Servlet feature provides API package `jakarta.servlet`.
Also – We should change `javax` to `Jakarta` in all examples. That one got past me.
Specify configuration properties in for BELL services
To enable property injection, define a public constructor or a public method that is named updateBell with a single parameter of the java.util.Map<String,String> type within the service implementation class.
we're asking them to "... define a public constructor or a public method that is named updateBell" but the example doesn't contain anything called updateBell- where would the method or constructor be named? Is that out of the scope of this example? Also, where would you define this method? what file?
First, there’s a typo in the my draft. The single-arg constructor is YourServiceImpl(…), not ServiceImpl(…). The name of the class must match the name of the constructor method. That’s why I wrapped the method signatures in a class. I was inconsistent with an edit at some point
public class YourServiceImpl implements api.or.spi.Interface {
java.util.Map<String,String> props;
public YourServiceImpl(Map<String,String> bellProps) {props=bellProps;}
// OR
public void updateBell(Map<String,String> bellProps) {props=bellProps;}
}
Regarding the example, I chose to use the single-arg constructor to receive properties rather than the updateBell method. The user need not declare both. We could change the example to use updateBell, instead. The user must define one of the methods in their service implementation classes.
Expose a REST endpoint for custom resources
I revised this slightly to try and draw clear connections between the examples and the descriptions- hopefully I haven't messed anything up, but it's certainly possible that I did.
I wonder if there is a better way to organize the examples in this section- it feels like it jumps around a bit (though that might just be because I'm used to documenting server.xml rather than app code). Right now we have 4 examples, in the following order:
1. minimal service implementation class (app code, any particular file?)
2. OSGi property (set in the META-INF/services/com.ibm.wsspi.rest.handler.RESTHandler w/in the library?)
3. detail server config- BELL feature
4. full server.xml example
Does this order represent how a developer would likely configure something like this? App code first, then OSGi prop, and finally the server? Just want to make it as intuitive as possible to go from one example to the next. It might help to put a 1-2 sentence overview at the beginning of the section to help the reader map the examples to the overall process.
That’s perfectly good AFAIC. Your sequence reflects my intent: Show the service implementation, then the required service resource file (includes OSGi service property info), then the library jar packaging, then the BELL deployment. I suspect you removed some of the redundant info as well.
Open Liberty extenders use the REST Handler framework<https://www.ibm.com/docs/en/was-liberty/nd?topic=SSAW57_liberty/com.ibm.websphere.javadoc.liberty.doc/spi_liberty_core.html> SPI to expose REST endpoints (REST APIs) for custom resources.
What are Open Liberty extenders? I dont think we've used this term in OL doc before
Open Liberty extensions developers. That’s what I should have said. A BELL is a Basic Extension using a Liberty Library. Another extension model is Liberty User Features. Both BELLs and User Features provide services that extend the capabilities of Liberty. Previously in the draft you may have noticed the paragraph, below. Making a service available to the Open Liberty runtime means the service is now part of the server composition – the user has extended/expanded the capability of the server.
For each service discovered or specified the BELL feature registers the service interface and implementation class as an OSGi service, making the service available to the Open Liberty runtime.
—
Reply to this email directly, view it on GitHub<#5724 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHBQA4TTR6AXGCOEAM7QYJ3WBMPZXANCNFSM6AAAAAAQHD24LA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thanks- I've updated the draft per your answers. When you have a chance, would you review and let me know what changes are needed? When you're satisfied with the draft, you can add the |
After reviewing I have some suggestions: Configure a BELL
Implement an SPI with BELL services
Specify configuration properties in BELL services
Expose a REST endpoint for custom resources
|
@dmuelle I've posted all change suggestions. Seems premature to add the |
@dazavala - all suggestions implemented except-
There is not a great way to do this in the OL Docs. The "Note" formatting in Antora runs afoul of our accessibility scans. I tired simply adding "Note:" but it seemed more distracting that anything else. |
The new draft looks really great. I found few items. Items 2, 3, 5 are mandatory.
|
@dmuelle Rock on! |
Peer Review - Basic Extensions using Liberty LibrariesShort Description - Just one sentence. Rephrase by adding 2nd sentence to the short desc. With the BELL feature, a library declares a The following example shows the BELL configuration in The Transport Security feature and the related The BELL feature does not support nondestructive updates. |
Thanks for reviewing @ramkumar-k-9286 , all suggestions implemented except
This is in the autogenerated portion of the page, not in our files. Generally, we don't strictly enforce the 2 sentence rule on feature pages since that content is in the metatype
Acrolinx says "Don't use a hyphen after the prefix non" |
updates are on vNext and will publish with 22.0.0.11- closing this issue. |
For epic OpenLiberty/open-liberty#19368.
Add sections to the Basic Extensions using Liberty Libraries 1.0 feature documentation that describe the function and usage of the new
spiVisibility
and<properties/>
attributes in the BELL configuration.We can use this opportunity to describe how to declare OSGi properties specific to BELL services, a necessary but yet undocumented capability, and introduce the use of the
service
attribute in one of the examples.The text was updated successfully, but these errors were encountered: