> On 15 Sep 2016, at 10:04, Vincent Massol <vinc...@massol.net> wrote:
> Hi devs,
> I’d like to add a new script API in oldcore.
> I need a new API to know if the XAR export feature is available so that the 
> Page level XAR export button is displayed (I’m trying to fix 
> http://jira.xwiki.org/browse/XWIKI-13695#).
> I was thinking about adding some XXXScriptService in oldcore but the right 
> hint would be “xar” and XXX would be “XAR”. The problem is that we already 
> have one in xwiki-platform-xar (which right now is used by oldcore and thus I 
> cannot add this new method to the existing XarScriptService that is there).

Ah there’s one option, which is to split the current xwiki-platform-xar module 
into 2:
- xwiki-platform-xar-api
- xwiki-platform-xar-script

And have xwiki-platform-xar-script depend on oldcore

And introduce the isXARExportAvailable() method in XarScriptService.


If we agree about my proposal in http://markmail.org/message/2qmd7urysr32xewj 
it could make sense maybe.


> I can’t find any name or hint that would make sense on the long run for 
> oldcore. Some other ideas:
> * OldCoreScriptService, hint = “oldcore” and we consider it something 
> temporary that will need to go away and deprecate
> * CoreScriptService, hint = “core”. Same
> * ImportExportSerciceService, hint = “?”
> Last, I have the option to continue what we’ve done so far which is increase 
> a bit more the size of api.XWiki. For example we have in there the following 
> method which does something similar:
> /**
> * @return true if title handling should be using the compatibility mode or 
> not. When the compatibility mode is
> *         active, if the document's content first header (level 1 or level 2) 
> matches the document's title the
> *         first header is stripped.
> */
> public boolean isTitleInCompatibilityMode()
> {
>    return this.xwiki.isTitleInCompatibilityMode();
> }
> so I could add XWiki.isXARExportAvailable()…
> WDYT? Any preference?
> Right now I have a hard time deciding. I hate it but I’m considering adding a 
> new method to the XWiki class, but I’d love to find something better.
> Thanks
> -Vincent

devs mailing list

Reply via email to