I have following situation: a whole lot of files and folders are now stored on a drive. We want to migrate those to Alfresco, and add the same time add the correct labels. Problem is that labels can not be assigned based on the folder structure, so a rule is no option.
What I think should be possible is the following:
Is there a better or more efficient way to do this?
What javascript command has to be used to extract labels from the file name?
Thanks,
Patrick
Solved! Go to Solution.
I think you are talking about "tags". You can add these tags - that show up as a kind of "labels" in alfresco share using node.addTag(Tarnname) - you were quite close:
Assuming you have a directory structure on a fileserver, want to import the whole structure and add metadata based on the Path of the imported documents, you have several optinons:
- copy it over on the alfresco servers filesystem, create metadata xml files and use the bulk importer Using the Bulk Import tool | Alfresco Documentation
- copy it to alfresco by webDav and use a rule to add the metadata. You can trigger a javascript by rule "onCreate" in a folder and all it subfolders. In your script, make sure the triggering object is a file (document.isDocument) and extract the data from document.displayPath
I'll have a look at the metadata xml and bulk import.
A rule is not possible, the place of the files in the structure does not determine the labels. So we somehow have to add the labels via another way.
One more question: assume we are going for a rule on a folder that adds a specific label to the files loaded in that folder, which javascript command is used to add that label to a document? Is it someting like node.addLabel(labelname)?
I think you are talking about "tags". You can add these tags - that show up as a kind of "labels" in alfresco share using node.addTag(Tarnname) - you were quite close:
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.