Hi,

I'm finishing another group of commits introducing part of the new public
api. As the initial proposal is taking shape, I've thought an update would
be nice:

* o.a.w.api.core: core API interfaces
** Engine, Context and Session, extracted from WikiEngine, WikiContext and
Session
** Page and Attachment, extracted from WikiPage and Attachment. May be add
DynamicAttachments as well? They don't seem to be widely used, so maybe add
them later on, if needed...
** Acl and AclEntry, promoted from the o.a.w.auth.acl package (as they are
used by Page, Attachment and Context)
** Command, promoted from the o.a.w.ui package (as WikiContext is
implementing Command)
** o.a.w.Release promoted to this package
* o.a.w.api.exceptions: JSPWiki custom exceptions
* o.a.w.api.filters: Filters API (modified to require Context instead of
WikiContext)
* o.a.w.api.plugin: Plugins API (modified to require Context instead of
WikiContext)
* o.a.w.api.providers: Page providers API, it would contain WikiProvider,
WikiPageProvider and WikiAttachmentProvider from both org.apache.wiki  and
org.apache.wiki.providers packages
* o.a.w.api.search: QueryItem and SearchResult, promoted from the
o.a.w.search package (as they're needed by the
WikiPageProvider/WikiAttachmentProvider interfaces)

I'm thinking of also including / promoting the
o.a.w.providers.AbstractFileProvider to the o.a.w.api.providers package. I
have to take a look at existing 3rd party
WikiPageProviders and see if it would be useful to include this class on
the public api. If it ends up being a useful class to have on the public
api, that would also mean that
another couple of classes from the o.a.w.search package should be promoted
to the o.a.w.api.search package, namely, SearchComparator and SearchMatcher.

the o.a.w.event package will also be extracted to its own module, and it
will be a dependency of the public API, as some of the public API classes
are expected to react
to events.

Also, the o.a.w.api.engine package is going away, because of two reasons:
- the do not add anything towards 3rd party extensions
(plugins/filters/page providers)
- with all the managers on that package, we would end up with a lot of
classes from everywhere on the public api package, which would do nothing
in there. Having (say)
half the code on that package would totally dillute the purpose of a public
api. It'd simply be half the code on a "public api" package

Finally, WikiEngine, WikiSession and WikiContext have some static methods
to locate / build new instances of those classes. I'm also thinking of
introducing an SPI to
abstract away these methods and be able to get these instances through the
public api. For example, instead of

Engine engine = WikiEngine.getInstance( servletConfig );

we would have:

Engine engine = API.engine().getInstance( servletConfig ); // or whatever
chain of calls from only the o.a.w.api.core package

the engine() method would call the SPI, and return the appropiate
implementation from the classpath, which would call its getInstance(..)
method to return the Engine.
This would have the additional, very nice, benefit of making the core api
interface's implementation pluggable: it would be possible, f.ex., to have
customized
WikiEngine/Wikicontext/WikiSession/etc. implementations without having a
parallel, customized branch. These SPI implementations could be selected
from a
property on jspwiki[-custom].property. Right now this is only an idea and I
still have to see how viable this is, but seems promising.


best regards,
juan pablo

On Mon, Feb 24, 2020 at 11:33 PM Murray Altheim <murra...@altheim.com>
wrote:

> [...]
> > Thoughts? Am I missing something, should the API include more things, or
> > is it too wide,..?
>
> Hi Juan Pablo,
>
> As an author of a lot of plugins I'm guessing I'll have some work to do to
> update my code. Sorry, but I won't be able to look into this and provide
> any
> feedback until this coming weekend though as this week is pretty chocka.
>
> Cheers,
>
> Murray
>
> ...........................................................................
> Murray Altheim <murray18 at altheim dot com>                       = =  ===
> http://www.altheim.com/murray/                                     ===
> ===
>                                                                    = =  ===
>      In the evening
>      The rice leaves in the garden
>      Rustle in the autumn wind
>      That blows through my reed hut.
>             -- Minamoto no Tsunenobu
>
>
>
>

Reply via email to