- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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:
- the names of the current files need to updated anyhow, so in some way we could the needed labels at the end of the file names, separated with e.g. a $
- the files are uploaded to Alfresco
- a javascript has to be run that extracts the labels from the file names and add these as labels to the corresponding document
- the javascript at the same time removes the labels from the file names
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
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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:
