Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,16 @@ a parse failure and set a `fess.webapp.plugin` marker property.
<!-- src/main/resources/fess+systemHelper.xml -->
<component name="systemHelper"
class="org.codelibs.fess.webapp.example.helper.CustomSystemHelper">
<postConstruct name="addDesignJspFileName">
<arg>"index"</arg>
<arg>"index.jsp"</arg>
</postConstruct>
<!-- ...the rest of Fess core's design-JSP mappings... -->
</component>
```

> **Maintenance cost (read before overriding):** because a redefine replaces the
> *whole* definition, the override must repeat **every** `postConstruct` the core
> `systemHelper` performs &mdash; the full set of design-JSP name mappings. These
> are copied verbatim from Fess core's `fess.xml`, and the referenced `*.jsp`
> files are provided by Fess itself (this plugin ships none of them). You must
> keep that list in sync with each Fess release, or design pages (e.g.
> `chat` / `busy` / `newpassword`) will stop resolving. This is exactly why
> Pattern 1 is preferred whenever you do not truly need to replace core behavior.
> *whole* definition, the override must repeat **every** property and
> `postConstruct` that Fess core declares for the component in `fess.xml`. Fess
> 15.9 declares none for `systemHelper`; earlier releases registered the
> design-JSP pages here, which 15.9 removed. Check `fess.xml` for each Fess
> release you support. This is exactly why Pattern 1 is preferred whenever you do
> not truly need to replace core behavior.

## The `Fess-WebAppJar` manifest

Expand All @@ -114,7 +108,7 @@ application's classloader. This is set in [`pom.xml`](pom.xml) via the

- Java 21 or later
- Maven 3.8 or later
- Fess 15.8 or later
- Fess 15.9 or later

## Project structure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* {@code fess+systemHelper.xml}) tells LastaDi to register THIS class in place
* of the core {@link SystemHelper}. Because a redefine REPLACES the whole
* component definition, the override XML must repeat every {@code postConstruct}
* the core definition performs (the design-JSP name mappings) &mdash; see
* the core definition performs (Fess 15.9 declares none) &mdash; see
* {@code fess+systemHelper.xml} for the details and the maintenance cost this
* implies.
* </p>
Expand Down
92 changes: 7 additions & 85 deletions src/main/resources/fess+systemHelper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,94 +11,16 @@
below. Contrast this with the additive "app++.xml" in this plugin, which ADDS
a brand-new component instead of replacing an existing one.

IMPORTANT: a redefine replaces the ENTIRE component definition, so this file
must repeat every postConstruct that Fess core performs on systemHelper -
namely the design-JSP name mappings below. They are copied verbatim from Fess
core's fess.xml (the referenced *.jsp files are provided by Fess itself, not
by this plugin). If you override a core component, keep this list in sync with
each Fess release; otherwise design pages (e.g. chat / busy / newpassword)
will stop resolving. That maintenance cost is the main reason to prefer adding
a new component (app++.xml) whenever you do not truly need to replace core
behavior.
IMPORTANT: a redefine replaces the ENTIRE component definition, so it must
repeat every property and postConstruct that Fess core declares for the
component. Fess 15.9 declares none for systemHelper, so this override has
none either. Check fess.xml of the Fess release you build against and keep
this file in step with it. That maintenance cost is the main reason to prefer
adding a new component (app++.xml) whenever you do not truly need to replace
core behavior.
-->
<components>
<component name="systemHelper"
class="org.codelibs.fess.webapp.example.helper.CustomSystemHelper">
<postConstruct name="addDesignJspFileName">
<arg>"index"</arg>
<arg>"index.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"header"</arg>
<arg>"header.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"footer"</arg>
<arg>"footer.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"search"</arg>
<arg>"search.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"searchResults"</arg>
<arg>"searchResults.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"searchNoResult"</arg>
<arg>"searchNoResult.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"searchOptions"</arg>
<arg>"searchOptions.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"advance"</arg>
<arg>"advance.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"help"</arg>
<arg>"help.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"error"</arg>
<arg>"error/error.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"errorNotFound"</arg>
<arg>"error/notFound.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"errorSystem"</arg>
<arg>"error/system.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"errorBadRequest"</arg>
<arg>"error/badRequest.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"errorBusy"</arg>
<arg>"error/busy.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"cache"</arg>
<arg>"cache.hbs"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"login"</arg>
<arg>"login/index.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"newpassword"</arg>
<arg>"login/newpassword.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"profile"</arg>
<arg>"profile/index.jsp"</arg>
</postConstruct>
<postConstruct name="addDesignJspFileName">
<arg>"chat"</arg>
<arg>"chat/chat.jsp"</arg>
</postConstruct>
</component>
</components>
Loading