AnsweredAssumed Answered

Importing files from xml that describes file structure

Question asked by ebogaard on Feb 25, 2013
Latest reply on Oct 9, 2013 by mdutoo
Recently I received a zip with a file file structure and an xml-file that describes these files. This xml is an export from a ms sql-db describing the binaries in the file structure. As this file structure is completely 'random' (comparable to the way Alfresco stores the binaries), the metadata is in the xml file. One problem though, it doesn't include the folders (parents) to be created and the files (children) in those folders. So I'm wondering how I can import this in Alfresco.

The XML looks like this:

    <document>
        <document_naam>Versie II - RenD-uitgaven private sector.doc</document_naam>
        <pk_document_id>3489</pk_document_id>
        <gepubliceerd>1</gepubliceerd>
        <document_actief>1</document_actief>
        <URI>W:\websites\dms\CheckedIn\00\00\00\51431C7B-AC23-4C9C-AB00-D69738B8077A.doc</URI>
        <file_created/>
        <file_modified/>
        <created>2008-01-07T15:53:56+01:00</created>
        <modified>2008-01-07T15:53:56+01:00</modified>
        <eigenaar_persoon_id>1559218</eigenaar_persoon_id>
        <eigenaar_persoon_formal_naam>De heer ABC</eigenaar_persoon_formal_naam>
        <doc_ident_id>3489_5304_58946</doc_ident_id>
        <tabelnaam>tbl_werkgroep</tabelnaam>
        <PK_tabel_ID>4617</PK_tabel_ID>
        <context_naam>Beleidscommissie Innovatie &amp; Kennis</context_naam>
        <html_label>Vergadering 14 maart 2008</html_label>
        <tree_path>/Vergadering 14 maart 2008</tree_path>
        <identifier>VergaderingenBijWerkgroep</identifier>
        <PK_tree_node_locator_id>5304</PK_tree_node_locator_id>
        <PK_tree_node_id>58946</PK_tree_node_id>
    </document>

This XML is completely 'flat', as all files are specified the same way and on the same 'level'.

The most important attributes are:
- document_naam: document name
- URI: location of the binary in the current file structure
- tree_path: location in the file structure 'to be'. This can be multiple folders deep.

It would also be nice to import the 'created' and 'modified' data, but those aren't necessary.

Can someone help me with this? I know how to import ACP-fiels, but I'm not sure how to create the file structure when the folder metadata is in the file attributes and is not specified as a separate node.

Outcomes