0

I've a document (folderish) in nuxeo I want to rename. I get the DocumentModel by uid using the API, and I'm trying to chenge the actual nuxeo name so that his path changes (not just like renaming a blob attachment name, the whole folderish should change name)

I tried changing the properties:

DocumentModel cf = this.getCampaignFolder();
cf.setProperty("dublincore", "title", newShortName);

This does seems to change the title, but leaves the nuxeo name unchanged.

I tried changing the path:

cf.setPathInfo(cf.getPathAsString().replaceAll("/[^/]*$", "), newShortName);

but when I save that it says the document doesn't exist.

Can't find a rename or move API either.

How do you rename stuff?

Currently, as a workaround, I am deleting the folder and recreating it.

Chris Martin
  • 30,334
  • 10
  • 78
  • 137
Lorenzo Boccaccia
  • 6,041
  • 2
  • 19
  • 29

1 Answers1

1

What is your Nuxeo version?

There are:

You could do something like:

session.move(doc.getRef(), null, newShortName);
Julien Carsique
  • 3,915
  • 3
  • 22
  • 28