AnsweredAssumed Answered

How to change a node's name before it gets created?

Question asked by johannii on Oct 28, 2012
Latest reply on Nov 29, 2012 by jhesparrach
due to a character constraint certain characters are not allowed in the file/ folder names. Our users have Macs that allow "<" and ">" characters in the file/ folder names and the email program they use exports emails in a way that the sender of the email is part of the folder name the email is being exported to. The sender usually appears in the following format: last name, first name <>. Now, the user is supposed to export an email directly into a webdav drive, so that the email is being uploaded into Alfresco. Because of these < > characters, the upload fails of course.

I was considering using a policy - "BeforeCreateNode" to be precise. So far, I have been able to read the name of that uploaded folder from one of the parameters of the beforeCreateNode method. But I have not yet found a way to change it. The idea was to get rid of those invalid characters, before the node actually gets created. But the to-be-created node name is coming over in a QName object, which does not have any setter or other manipulation methods. I have a feeling that this policy won't help me solve this problem.

Would be great, if someone could point me into the right direction.