03-02-2018 07:32 AM
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
03-13-2018 02:38 PM
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:
03-02-2018 12:59 PM
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
03-05-2018 03:35 AM
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.
03-13-2018 11:21 AM
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)?
03-13-2018 02:38 PM
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:
Explore our Alfresco products with the links below. Use labels to filter content by product module.