Products to XML to MySQL

General ShopSite user discussion

Products to XML to MySQL

Postby Bsummerlin » Mon Mar 22, 2010 1:42 pm

I'm trying to dump specific product data (using a field map I've setup) to a specific folder location on my server. I would then import that XML file into a MySQL database that I could then call into for a New Items box on my front page and category pages.

I've installed the AutoXML SDK and can pull it into the browser for download, but was wondering if there is a parameter to pass the folder/file location so that I can write to the file to the server (preferably outside of the root, or in a private directory)?

I have a php class I can use to import the XML file from the server into the MySQL database, just having trouble digging up information about real world scenarios involving details of the AutoXML feature. Can anyone shed some additional light on this subject?

A Developer Tutorial section might some of us "Do-It-Yourselfers" who are past, or uninvolved with the template design phase.

Thanks,
B
Bsummerlin
 
Posts: 18
Joined: Mon Mar 01, 2010 1:27 pm
Location: Louisiana

Postby Jim » Mon Mar 22, 2010 4:20 pm

You can do it from the backoffice of your store without any programming.

Utilities > Database > Download select pages or products > Download

Select XML file format and the version you want.
Select the Use Fieldmap radio button and the field map to use
Select the radio button Save data to your HTML (output) directory on the host server:
Give it the file name and extension you want.

Click Proceed. and the file will be put in that directory. Note that the file must be put in the output directory (specified in Download options text line). This is a security issue since you could overwrite files that you shouldn't if you could specify a full path.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby Bsummerlin » Mon Mar 22, 2010 6:31 pm

I'm sorry, maybe I wasn't clear enough. I HAVE done that already in the admin and have already created the field map to use. I have used the tool in the admin you mentioned and have the file created in the output directory.

I want to be able to do it automatically, say once a day right now, by calling the url via CRON ("/cgi-bin/ss/dbextract.cgi") with necessary parameters and having it dumped to "products.xml" automatically without having to go into the backend and manually create the file after new products have been loaded to the db - just one less thing to do (and remember to do). Anything to save a few steps...

Here's what I've come up with: I can call this url and create the exported xml file in the Output Directory, and follow it up by importing it in MySQL and removing it from the directory.

/cgi-bin/ss/dbextract.cgi?clientApp=1&dbname=products&format=xml&xml_version=10.1&fieldmap=products_to_mysql&downloadto=host&filename=productsexport&filetype=.xml

What does "clientApp=1" refer to?

B
Bsummerlin
 
Posts: 18
Joined: Mon Mar 01, 2010 1:27 pm
Location: Louisiana

Postby Jim » Mon Mar 22, 2010 7:47 pm

http://shopsite.com/help/10.1/en-US/sc/ ... pload.html

clientApp Identifies the client application interface version.

I think there has only been one version of it so 1 is the valid parameter.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby Bsummerlin » Mon Mar 22, 2010 9:48 pm

Thanks Jim.

"Required. Identifies the client application interface version." is all I could find too.

B
Bsummerlin
 
Posts: 18
Joined: Mon Mar 01, 2010 1:27 pm
Location: Louisiana


Return to User Forum

Who is online

Users browsing this forum: No registered users and 127 guests