AnsweredAssumed Answered

Bulk metadata update

Question asked by efvrvo on Aug 26, 2011
Latest reply on Aug 19, 2016 by rachana
I have searched on the forum for this but the results I have found are more concentrated on older versions of Alfresco for bulk file uploading or CMS migration. I use version 3.4d and to bulk upload files is not a problem but to bulk update metadata is a problem. I have seen various topics that use programs like Talend or OpenMigrade but it appears to me that they are for older versions of Alfresco and I do not really understand them.

I have seen that this program http://code.google.com/p/alfresco-bulk-filesystem-import/ can update the metadata for version 3.4 but I will have to create 1000 text files each containing custom metadata so I don't think this is going to help me much.

My requirement is in my opinion very simply. I have say 1000 drawings that I upload into Alfresco. I have an Excel spreadsheet that contains in the columns the metadata fields (eg Name, Title, description etc) and in the rows the doc names with each metadata field. I think its fairly simple to write a javascript to update the metadata but I would like the javascript to use the excel spreadsheet for the values.

I would like it to read the excel spreadsheet (I can make this a CSV file) and then use the NAME column to find the document and and the other columns to insert into the metadata fields. If someone can help me on how I can get the javascript to read the csv file and then show me how to handle the variables I think I will have a very useful metadata update tool for high volume files.

For example. Lets say
0)I upload 5 document into the alfresco repository under "sites/testSite/documentlibrary"
1) I create a CSV file and name it "ImportMetadata.csv"

document1.doc,Test document title 1,Test document desc 1
document2.doc,Test document title 2,Test document desc 2
document3.doc,Test document title 3,Test document desc 3
document4.doc,Test document title 4,Test document desc 4
document5.doc,Test document title 5,Test document desc 5

2) I upload the file in the alfresco repository in "data dictionary/temp"
3) I run my javascript and it reads "ImportMetadata.csv" and creates a 2 dimensional array using a variable called "metadata"
4) The javascript then accesses the array "metadata" and starts going through the rows
5) It takes "metadata[0,0]" to find the name of the first document ("document1.doc") and then searches for this document in the alfresco repository under "sites/testSite/documentlibrary"
6) Once the document is found it edits the document1 properties
7) It uses "metadata[0,1]" to update document.properties.title
8) It uses "metadata[0,2]" to update document.properties.description

9) It takes "metadata[1,0]" to find the name of the second document ("document2.doc") and then searches for this document in the alfresco repository under "sites/testSite/documentlibrary"
10) Once the document is found it edits the document2 properties
11) It uses "metadata[1,1]" to update document.properties.title
12) It uses "metadata[1,2]" to update document.properties.description

And so it goes. I think the big trick is to parse the csv file

Anyone that could assist?

Outcomes