Log in | Register | Lost password

Bottom
Bulk publication creation??? Help!!
  • Posted: 10.12.2008, 17:53
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Heya all,

    So I'm still thinking about how to auto-create a publication and I'm really in need of some help- or at least some brainstorming....

    1.) I have a CSV with 1000 lines, each with two fields; A and B
    2.) I have a pagesetter publication with two fields; 1 and 2
    3.) I would like to somehow automate the creation of a publication for each of the 1000 lines where A gets stored into field 1 and B into field 2.

    How in the world can I do this?

    I know that the creation of publications must be handled through the pagesetter process as the revision control depends on it etc...

    Can I call a pagesetter command to create the publication without having to manually do it? Maybe a php script:

    Quote

    For each line in the CSV run the pagesetter publication function...?


    Maybe I can hack the "Import News" feature to do it?

    I'm dying here...c'mon you aces, any help would be seriously appreciated!!!

    Thanks,
    -Julian
  • Posted: 11.12.2008, 22:21
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Well, I tool a look at the process of importing news that comes built into pagesetter and am fairly confident that with some duct tape and a big old knife I can hack it up and find a solution.

    The catch of course is that the submission page will have to be an HTML form that simply calls a script that parses the spreadsheet and inputs it into the appropriate pagesetter table and then updates the pub header and pid count as done in the import news plugin...

    So yeah, it can be done... eventually I'll post the results here.
  • Posted: 14.12.2008, 15:24
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Try this one... This worked for me!

    First you create one or two sample publications on your pubtype, then you go to phpmyadmin (if you can access your mysql server from outside, you can use heidisql if not, you could use sqlyog) and export the pubdata table as SQL. Now all you have to do is change the data with yours...

    Can be done with CSV also but then you have to remember the null values and the dates...

    Once done, reimport with your phpmysql, heidisql or sqlyog.
  • Posted: 19.12.2008, 16:39
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    In the end I've found a path to a solution...

    1.) create a publication that allows the uploading of a CSV file and other relevant informaiton
    2.) Write a plugin/extension to be called form the _full template to allow the processing of the uploaded CSV

    It will create an array for each line in the CSV and then, based on one of the values in the array add data from another table where the values match.

    3.) The array (data from the CSV + the new data) will then be added to the table for a previously created pagesetter pub.

    4.) As with importing news (pagesetter plugin) the publication counter and publication header will be updated...

    "simple as that" I hope.

    ;)

Template courtesy of Designs By Darren.