cancel
Showing results for 
Search instead for 
Did you mean: 

How to Import data into a Datalist

krispc75002
Champ in-the-making
Champ in-the-making
I have a dump file (actually an access database) that is in the same format data wise as our datalist. The data in access was originally from SharePoint. SharePoint has now gone dark permanently. I am trying to figure out how to import this data into the alfresco data list. What would be best way to accomplish this import. My backround is I am a DBA.

P.S. I am very new to Alfresco.
2 REPLIES 2

rjohnson
Star Contributor
Star Contributor
I'm not aware of any standard import routines but there is an excellent example of how to create a datalist and populate it using Javascript within the Javascript console (which by the way is a brilliant tool) at

http://www.techbits.de/2011/10/18/using-the-javascript-console-creating-and-populating-datalists/

So what you could do is create your datalist manually, upload your datafile to Alfresco, and read each line and create your datalist entries from there.

One thing to be careful of in bulk loading through Javascript is transaction size; in my experience you run out of buffer space quite quickly. This isn't a console issue its an Alfresco transaction buffer size issue. So you need to have your Javascript load perhaps 50 or 100 rows and then stop which will cause the transaction to commit and then re-run your Javascript repeatedly to load all your rows. Clearly you will need to code your javascript to be able to pick up from where it left off. Note you cannot force a commit within Javascript (so far as I am aware) so your Javascript must terminate, not merely loop.

Another way would be to create your datalist manually and then use the CMIS interface to populate it (datalist entries are just documents without content) and you could do that in PHP, Java or any language that the Apache Chemistry libraries support. As you would be inserting each row discretely, transaction size is no longer an issue. If you have a really large number of rows to load it might be easier to do this way.

Another word of caution, displaying datalists with very large numbers of rows can be quite slow because Alfresco does a lot of work rendering the content in datalists. This makes them super flexible but a tad slow with very long lists.

Bob

There is generic add-on created, which is used for importing and exporting datalist.

Demonstration : Alfresco Datalist Import Export - YouTube