Export assets tool not including metadata


(Alderman) #1

Matrix 5.3.2.0

 

Hi.

 

In the past when I need to write scripts to export from non-matrix systems into matrix I have created an example of the matrix asset I want and then exported it and writen a script that takes the data from the external system and generates an import xml script.  We make heavy use of metadata attached to data records and in the past (from both the command line and the admin interface) metadata values have been exported along with the data record.  However I have just created and applied a new metadata schema with a single field (a check box) but both methods of export are only resulting in the data record creation and name attributes being exported not the application of the metadata schema or the metadata values that I have entered into the checkboxes as applied to the data record.

 

Any ideas?


(Bart Banda) #2

No idea, not worked much with custom imports/exports. Can you post an example of the export you are using that is failing? And maybe an export of the same thing from the admin interface? Or replication steps if it doesnt work with the admin interface export/import either?


(Alderman) #3

Thanks Bart - will do.


(Alderman) #4

I created a data record and applied a metadata schema with a single checkbox field (with 6 options).

 

Here is the export (it's the same from the gui and the command line - I've removed the permissions settings which are also exported ok).

<?xml version="1.0" encoding="utf-8"?>
<actions>
<action>
   <action_id>create_Data_Record_235793</action_id>
   <action_type>create_asset</action_type>
   <type_code>Data_Record</type_code>
   <link_type>1</link_type>
   <parentid>1</parentid>
   <value></value>
   <is_dependant>0</is_dependant>
   <is_exclusive>0</is_exclusive>
</action>

<action>
<action_id>add_Data_Record_235793_path</action_id>
<action_type>add_web_path</action_type>
<asset>[[output://create_Data_Record_235793.assetid]]</asset>
<path>check-test</path>
</action>

<action>
<action_id>set_Data_Record_235793_name</action_id>
<action_type>set_attribute_value</action_type>
<asset>[[output://create_Data_Record_235793.assetid]]</asset>
<attribute>name</attribute>
<value><![CDATA[check-test]]></value>
</action>

</actions>

Previously setting a metadata schema and then setting metadata field values was part of the export as in the following..

<action>
    <action_id>set_Data_Record_1_metadata_schema_19506</action_id>
    <action_type>set_metadata_schema</action_type>
    <asset>[[output://create_Data_Record_1.assetid]]</asset>
    <schemaid>19506</schemaid>
    <granted>1</granted>
    <cascades>1</cascades>
</action>

<action>
<action_id>set_Data_Record_1_metadata_field_19508</action_id>
<action_type>set_metadata_value</action_type>
<asset>[[output://create_Data_Record_1.assetid]]</asset>
<fieldid>19508</fieldid>
<value><![CDATA[Some text input here…]]></value>
</action>


(Alderman) #5

Just wondering if the export utility changed at all over the years.  The reason I am doing this when I already know how to set a metadata schema and populate metadata fields is because I don't know what the xml for a checkbox should look like.


(Bart Banda) #6

Oh, are you exporting the metadata schema as well as the data record asset together?

 

If not, you need to make sure Self Contained Relations Only is set to No. Otherwise the export will only export links that are pointing to other assets within the same export. 

 

See attached.  Capture.JPG (23.4 KB)


(Alderman) #7

Thanks Bart that makes sense.  Will try when I'm back in work tomorrow.


(Alderman) #8

Couldn't wait for that - yes! including the metadata schema in the export did the trick.  That must have been how I did it originally but forgot (who needs documentation ;-) ).  However I don't get the field 'Self-contained relations only' at the download screen (not that it matters as I have the info I need now).

 

Many thanks for the help Bart.


(Bart Banda) #9

That setting basically asks you if you want to only keep links to other assets that are also part of the export, or even links that are going to assets outside of the export root node.

 

If you are exporting and importing to a different system, then the setting should probably be set to Yes.

 

If you are exporting and importing into the same system, then the setting can be set to No.