Bulk import - how to import node of custom type

cancel
Showing results for 
Search instead for 
Did you mean: 
vladimir_tekel
Active Member

Bulk import - how to import node of custom type

Jump to solution

Hello I'm using Bulk Import tool to import data from another DMS, but I have problems to do it correctly.

e.g. I need to import record of Invoice type, I prepared this import file:

IMV-13679.metadata.properties.xml

<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">

<properties>

<comment>Record: INV-13579</comment>

<entry key="aspects">cm:versionable</entry>

<entry key="type">cm:content</entry>

<entry key="cm:title">INV-13579</entry>

<entry key="cmSmiley Tongueublisher">import</entry>

<entry key="cm:identifier">INV-13579</entry>

<entry key="cm:created">2017-06-12</entry>

<entry key="cm:subject">INV-13579</entry>

<entry key="cm:description">INV-13579 description</entry>

<entry key="cm:contributor">import</entry>

<entry key="cm:author">import</entry>

<entry key="cm:type">Invoice</entry>

<entry key="Invoice:Contractor">ABC</entry>

<entry key="InvoiceSmiley Frustratedumm">123</entry>

</properties>

CM type metadata are imported correctly, but my custom Invoice metadata not, I tried few ways to do it, but I wasnt successful. Where is a problem? Smiley Sad

1 Solution

Accepted Solutions
vladimir_tekel
Active Member

Re: Bulk import - how to import node of custom type

Jump to solution

Hi Cesar,

finally I found your advice usefull, it helped me to find solution, now it works like a charm

Now I use

<entry key="type">Invoice:Invoice</entry> because my model name is the same like type name.

My problem was that I always tried to use type cm:content as representation of file.

thanks

Vlado

View solution in original post

3 Replies
cesarista
Customer

Re: Bulk import - hot to import node of custom type

Jump to solution

Hi:

The type is cm:content (what are your invoice document types ?) and neither custom aspects are applied, so this is the expected behaviour. You should check your custom invoice model, and assign the corresponding types or aspects for these properties:

You need to know your custom model, you can inspect your content models using this tip:

How to list and check your custom content models in Alfresco - Checking details about bootstrap cont... 

Probably you need something like:

<entry key="type">Invoice:doc</entry>

If existing invoice data in your repo, you can also check the applied types and aspects via Node Browser tool (In alfresco repository administration console or even in alfresco share administration console).

Regards.

--C.

vladimir_tekel
Active Member

Re: Bulk import - hot to import node of custom type

Jump to solution

Thanks for answer,

I found in manual, that for bulk import, type can be folder (for folder) or cm:content (for file)

in my example I used <entry key="type">cm:content</entry> as a representation of file

I need to define special metadata, so I used <entry key="cm:type">Invoice</entry> to define metadata of custom type - Invoice.

next I tried to add custom metadata

<entry key="Invoice:Contractor">ABC</entry> etc

My model is working - it is correctly set, is active and has defined default layout, so I can add new Invoice manualy into repository.

My source repository has nodes as records in folders structure, record is defined by type which is defined by set of metadata, and for each record there can be assigned attachment (0:n). So it is possible that no real file is stored, only metadata. Metadata and attachment are versionable.

So my idea was to create folder structure as in source repo, and nodes as representative of my nodes. node should be defined by node_name.metadata.properties.xml and empty file node_name. When I prepare my source structures and run import, folder structure is created fine, nodes are created in place, but without type metadata. Another problem is with attachment so far.

maybe my main idea is bad

appreciate every advice

Vlado

vladimir_tekel
Active Member

Re: Bulk import - how to import node of custom type

Jump to solution

Hi Cesar,

finally I found your advice usefull, it helped me to find solution, now it works like a charm

Now I use

<entry key="type">Invoice:Invoice</entry> because my model name is the same like type name.

My problem was that I always tried to use type cm:content as representation of file.

thanks

Vlado