Search

Well if my request for xml-rpc, the way all erp and ecommerce brifges work, would be to complex to achieve, I would be happy with an entry importer.

If for each of the products I manage in openerp I export a csv file, or xml file. Then I would like to be able to upload these files one by one and as such recreating sectionentries.

I think this can be achieved with this wordpress/symphony tutorial

Bauhause, is compatible with the current 2.2 build? and is there a way of not having to hit next and save each time; automatically looping through?

also

The Destinations Ensemble was an experiment to use Symphony 2.0 beta revision 5 to import XML using a front end form with the flag set for “Allow multiple”. The WordPress Import tutorial is intended to demonstrate the possibility of importing individual entries. For a WordPress import, this seemed a better way to go, as XML validation errors can easily crop up during the process, so it’s easier to see what’s happening for each individual entry. Plus, it allows for additions or modifications as you go, which is what I tend to do as I import.

If you have valid XML, and a one-to-one relationship between the XML data source and the input fields, it’s definitely possible to add the “Allow multiple” flag in the event and remove the filter to populate fields for all entries instead of for a single entry.

It looks like you modified your original post.

is compatible with the current 2.2 build?

It is compatible with all versions of Symphony 2.0 from beta revision 5 to the current release: 2.0.2.

is there a way of not having to hit next and save each time; automatically looping through?

Yes. Set your front end entry event to “Allow multiple”. Find the xsl:for-each instruction that is used to output the input fields with values inserted from the XML and remove the predicate that filters the selected XML node-set to match the currently selected entry position. Change this:

<xsl:for-each select="$wordpress-xml/rss/channel/item[number($selected-entry)]">

to this:

<xsl:for-each select="$wordpress-xml/rss/channel/item">

Modify the input fields to be able to post the data as a multidimensional array. Use the position() function to set the number to identify each entry in the array. Change the field that looks like this:

<input name="fields[date]" type="text" value="{wp:post_date}" />

to this:

<input name="fields[{position()}][date]" type="text" value="{wp:post_date}" />

Move the submit button outside of the xsl:for-each instruction, since you only need one submit button. Then, you should be good to go. Click the submit button to import all entries with a single click.

Stephen, I bow for thou ;-)
thanks!

So would you say this is also a ‘proper’ way of updating my productcatalog, maybe I should check for entries that are of a newer date. Or just copy over the entire catalog each time.

Or would xml-rpc be more suited for this?

I’m not entirely clear on your application of this type of import, but the only drawback that I can see is that the system date for each entry will be the date/time of the import. If the date, or for that matter, the ID number of the entry is important, you’ll need to create separate fields for this data. Otherwise, this works just as if you manually created each entry within the Symphony admin.

If you are asking whether it is possible to update a previously imported product catalog using this same process, I did test the possibility of excluding already existing entries from the node-set of the imported XML. As long as you have a field that can be used to test for a match, whether it be a date, an entry title, or a product number, it’s just a matter of using a predicate to filter out any entries that match existing entries.

<xsl:for-each select="$xml/data/section/entry[title != /data/section/entry/title]"/>

As far as I can remember, this worked quite well.

Rowan has an extension named Import Manager on Github. It’s unstable but would serve as a fine base for getting your hands dirty as I think it has everything you need.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details