-
Notifications
You must be signed in to change notification settings - Fork 103
Feature/jspwiki 1198 plugin api change, discovery and in browser auto complete snippets #415
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
Merged
spyhunter99
merged 8 commits into
apache:master
from
spyhunter99:feature/JSPWIKI-1198-plugin-api-change
Nov 16, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bdb7c93
JSPWIKI-1198 installed plugins are now available in the autocomplete …
spyhunter99 6b6648c
JSPWIKI-1198 moves the test module into the test module and some mino…
spyhunter99 8b384e2
Merge branch 'master' into feature/JSPWIKI-1198-plugin-api-change
spyhunter99 c720fe4
JSPWIKI-1198 I18N the display names of all plugins so that the sugges…
spyhunter99 3f34478
JSPWIKI-1198 address pr comments
spyhunter99 abfa0b7
JSPWIKI-1198 fixes the build, adds the counter plugin to the xml file…
spyhunter99 9529dbc
Merge branch 'master' into feature/JSPWIKI-1198-plugin-api-change
spyhunter99 9faf47e
change log
spyhunter99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> <!-- tests reuse [1/3]: reads common configuration for ITs and brings jspwiki-war as dependency --> | ||
| <groupId>org.apache.jspwiki.it</groupId> | ||
| <artifactId>jspwiki-it-tests</artifactId> | ||
| <version>3.0.0-SNAPSHOT</version> | ||
| </parent> | ||
| <artifactId>jspwiki-test-plugin</artifactId> | ||
| <packaging>jar</packaging> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.apache.jspwiki</groupId> | ||
| <artifactId>jspwiki-main</artifactId> | ||
| <version>${project.version}</version> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| This test plugin was created for testing the newer (v3.0.0) API | ||
| changes that provide plugin discovery and the ability to get | ||
| an example available in the UI. | ||
|
|
||
| In case that's not clear, after installing this plugin, then | ||
| starting the server and editing a page, ctrl+space will show | ||
| a snippet (refered to as a "snip" in the code) that provides | ||
| a usage example in the browser. This helps to eliminate guess | ||
| work and provides a better user experience. | ||
|
|
||
| To deploy this plugin: | ||
| mvn clean install | ||
| Then | ||
| copy target\*.jar $JSPWIKI_HOME | ||
| Where $JSPWIKI_HOME is something like | ||
| tomcat/webapps/jspwiki/WEB-INF/lib | ||
| Then start up the tomcat server/container that you're running. | ||
|
|
||
| That should be it. Enjoy. | ||
|
|
||
| Remember this is just a test plugin, meaning it's only to | ||
| demonstrate the proof of concept. It really doesn't do much. |
36 changes: 36 additions & 0 deletions
36
...i-test-plugin/src/main/java/org/apache/jspwiki/jspwiki/test/plugin/JspwikiTestPlugin.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Copyright 2025 The Apache Software Foundation. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.jspwiki.jspwiki.test.plugin; | ||
|
|
||
| import java.util.Map; | ||
| import org.apache.wiki.api.core.Context; | ||
| import org.apache.wiki.api.exceptions.PluginException; | ||
| import org.apache.wiki.api.plugin.Plugin; | ||
|
|
||
| /** | ||
| * a simple hello world test plugin | ||
| * | ||
| */ | ||
| public class JspwikiTestPlugin implements Plugin { | ||
|
|
||
| public JspwikiTestPlugin() { | ||
| } | ||
|
|
||
| @Override | ||
| public String execute(Context context, Map<String, String> params) throws PluginException { | ||
| return "<h1>HelloWorld</h1>"; | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
...spwiki-test-plugin/src/main/resources/META-INF/services/org.apache.wiki.api.plugin,Plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| org.apache.jspwiki.jspwiki.test.plugin.JspwikiTestPlugin |
8 changes: 8 additions & 0 deletions
8
jspwiki-it-tests/jspwiki-test-plugin/src/main/resources/ini/jspwiki_module.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <modules> | ||
| <plugin class="org.apache.jspwiki.jspwiki.test.plugin.JspwikiTestPlugin"> | ||
| <author>Apache</author> | ||
| <minVersion>3.0.0</minVersion> | ||
| <alias>JspwikiTestPlugin</alias> | ||
| </plugin> | ||
| </modules> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.