12-09-2019 12:10 PM
Hello,
I use alfresco 5.2.0f.
Actually my colleagues use some name with "+" on the document.name
Exemple : XXXX + XXX.pdf
With a javasript i move the file in a folder and the folder get the name ot the filename.
I need to know how i can replace all the "+" by "_" for exemple.
Is someone know how to do ? Is there a javascript to save me from this "+" ?
In the end i want to extend this script for all the shared files.
Thank you by advance for you collaboration.
12-10-2019 11:06 AM
You can use the replace() function to do this.
12-16-2019 04:00 AM
Thank you for you answer,
Can you give me a sample of the javascript please ?
I'm a noob for it...
Here is the rename and move folder, i would like to have a replace for the name if there is a "+" in the props BDCSEDIT.
var Descr = document.properties["test:BDC-SEDIT-propriete"]; var libelle = document.properties["test:BDC-SEDIT-ObjetCommande"]; var tiers = document.properties["test:BDC-SEDIT-LibelleTiers"]; var parent = document.parent; var myfolder = parent.childByNamePath(Descr + "_" + tiers + "_" + libelle); if (myfolder === null) { myfolder = parent.createFolder(Descr + "_" + tiers + "_" + libelle); } document.move(myfolder);
Thank you for your help !
Explore our Alfresco products with the links below. Use labels to filter content by product module.