cancel
Showing results for 
Search instead for 
Did you mean: 

Import XML and Associate with Form

kooktroop
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to import my XML content into WCM. Copying and pasting isn't a good idea due to the large number of files and the possibilities of resulting errors. So, I would rather automatically import them by copying them across.

To test it out I created a form (simple.xsd) and then created the file test.xml using the form. I then saved test.xml as text_import.xml and modified it to look like:


<!– test_import.xml –>
<?xml version="1.0" encoding="UTF-8"?>
<pm:content xmlns:pm="http://www.processmentor.com" xmlns:alf="http://www.alfresco.org" xmlns:chiba="http://chiba.sourceforge.net/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <pm:name>imported test</pm:name>
  <pm:description>this test is an import!&lt;br /&gt;</pm:description>
</pm:content>

After browsing to this test_import.xml I clicked edit and was given the standard "save this file…" etc. rather than being able to edit through the nice simple.xsd form that appears when I edit the original, test.xml.

Am I doing something wrong? Or is this type of operation not supported?

Thanks in advance.
1 REPLY 1

arielb
Champ in-the-making
Champ in-the-making
what you want to do is possible - though inconvenient.  there are two options:

1) create some xml content using the form, and then update the generated xml asset with the imported content.

2) set a node property on the content you've created using the AVMRemote api.  i believe someone from eyestreet has posted a utility for doing this.  the node property that needs to be set is
{http://www.alfresco.org/model/wcmappmodel/1.0}parentformname    = <form_name>