Skip to content
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

Command recorder Admin Console plugin to configure admin command logging (with plain facelets, no JSF templating) #24898

Merged
merged 9 commits into from
Jul 17, 2024

Conversation

OndroMih
Copy link
Contributor

@OndroMih OndroMih commented Apr 6, 2024

This PR does 2 things:

  • Adds support for using plain facelets with *.xhtml files
  • Adds a button in the Admin Console header to enable/disable admin command logging

This allows creating new pages in Admin Console using the standard Jakarta Faces facelets and bundle them in a JAR in the Admin GUI WAR. Those pages can be then injected into old JSF templating pages via iframe or ajax call. it's also possible to provide an injection point to the existing Admin Console pages via standard means, all in the same JAR file.

New Facelets should be placed into the root of the web app. Or, even better, in a separate JAR file inside the web app, into the `META-INF/resources/ directory. CDI beans can be places in the WAR or nested JAR as usual.

image

URLs that start with /faces/* are handled by xhtml pages
(e.g. /faces/header.xhtml handled by header.xhtml (in the webapp root).
Can be injected to JSF templating pages via iframe.
Example in upload.jsf (Application -> Deploy...)
Adds a custom resource handler wrapper that loads facelets from a console plugin, from the META-INF/resources directory.
Adds a Console plugin for command recorder, which provides a menu facelet wtih a toggle button. The MenuView bean is not found yet.
Button to toggle Command logger
Simplified plugins via Faces - plain JARs in Admin WAR,
which contain facelets and resources in META-INF/resources,
and Java model as plain CDI beans in the JAR.

Subject is retrieved from Jakarta Security - worth to move to a common module.
@OndroMih OndroMih changed the title Support for plain facelets pages in Admin Console (no weird JSF templating syntax in new pages) Command recorder Admin Console plugin to configure admin command logging (with plain facelets, no JSF templating) Jul 11, 2024
@OndroMih OndroMih marked this pull request as ready for review July 11, 2024 11:14
…ommandrecorder plugin

Moved all the code needed to integrate the Command Recorder console plugin into the plugin module. This means that Admin Console will work without issues if the module is not present.

Since the Admin Recorder plugin is deployed in the AdminGUI application and not as an OSGi bundle in modules, I needed to update the ConsolePluginService:

* it's now created by an HK2 locator specific to the deployed app, so that it finds console plugins also in the web app, not only in OSGi modules
* it searches for all plugin configuration files in the classloader and remove duplicities (because the web app classloader also finds all files in OSGi bundles via the parent classloader)

Also removed the demo facelets files.(header.xhtml, etc.)
Moved CDI producers into Admin Core, so that they can be reused by other modules and we avoid conflicts or implicit dependencies if multiple modules define the same producers or rely on beans produced by other modules.
@OndroMih
Copy link
Contributor Author

@avpinchuk , @arjantijms , @dmatej , @pzygielo , @hs536, can you please review? I think this is an important PR for the future Admin Console development, which allows adding new features to the Admin console using plain Jakarta Faces facelets, with no JSF templating dependencies.

Removed unnecessary Serializable
@arjantijms arjantijms added the New feature A major new user functionality was added label Jul 17, 2024
@arjantijms arjantijms added this to the 7.0.16 milestone Jul 17, 2024
@arjantijms arjantijms merged commit 2205e74 into eclipse-ee4j:master Jul 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New feature A major new user functionality was added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants