Quantcast
Channel: XWiki Forum - Latest topics
Viewing all articles
Browse latest Browse all 1220

Deprecate Document#rename(*) in favor of Refactoring Script Service API

$
0
0

Hi devs,

We currently have 2 scripting APIs to rename a document:

  • Document#rename(*) (e.g. `$doc.rename() in velocity)
  • Refactoring Script Service API (e.g. $services.refactoring.rename() on velocity)

There are several problems:

  • It’s confusing for users
  • It’s harder to maintain 2 apis
  • Both apis are not doing exactly the same things (and the refactoring one is more advanced)

I’m thus proposing to deprecate (and later on legacify) all Document#rename(*) signatures.

Note that this could apply to other methods such as copyDocument() (in api.XWiki) or Document#delete(). However, we could also decide that it’s ok to keep these methods in api.XWiki and api.Document, provided they are no refactoring operations done in them (ie they only rename, copy, delete the doc and don’t modify other docs). If we agree about this, then we could want to keep a Document#rename() method but we’d need to change its implementation which would be a breaking change. So I’m still proposing that we deprecate it.

WDYT?

Thx

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 1220

Trending Articles