Hi!

I'm trying to delete files from Alfresco repository using alfresco_soap_node_delete, but i'm having a problem and a very simple explanation (hopefully)

alfresco_soap_node_delete('/app:company_home/app:guest_home/cm:worksgood.txt') // works as expected :)

alfresco_soap_node_delete('/app:company_home/app:guest_home/cm:works bad.txt') // works bad :(

alfresco_soap_node_delete('/app:company_home/app:guest_home/cm:works_bad_too.txt') // works bad too :(

I'm almost sure that the problem is the filename, when using spaces or underscores I can't delete the file. Maybe using other special characters occurs the same mistake.

Is there a way to encode the filename or something to be able to delete files with spaces and underscores using alfresco_soap_node_delete?

I've tried with encodings, decodings and stuff like that, but nothing works...

Please help!

Comments

BetoAveiga’s picture

After searching A LOT I found stuff that could help someone:

http://forums.alfresco.com/es/viewtopic.php?f=12&t=2490
http://wiki.alfresco.com/wiki/Search#ISO_9075_encoding

In one line: Lucene search uses ISO 9075 codification, so we need to encode the path that we send to functions like alfresco_soap_node_delete.

I think i'll use my own (primitive) function to encode paths to delete files.

Is there a better solution?

smartinm’s picture

Title: Using alfresco_soap_node_delete » Alfresco QName path must be encoded using ISO 9075 codification
Component: Miscellaneous » Code
Category: support » bug

Thanks for your bug report, BetoAveiga. You're right. It is necessary to encode the local part of Alfresco Node Path with ISO 9075 codification. The Alfresco module works fine because it always uses node references instead of QName paths.

So should be implemented the encode routines from ISO9075.java to encode the path of the functions which accept as parameter an Alfresco Node Path (QName). Patches welcome :)

Alternatively alfresco_soap_node_delete() function accepts as parameter an Alfresco Node Reference (of the form workspace://SpacesStore/UUID). You can try using Alfresco Node References.