Anyone know if it's possible to write commandline tools which use the Umbraco api (current version - 4.0?). We want to import (once) a load of data, as well as export content, doctypes and other stuff so we can version it in subversion.
Anyone done this, or better yet, tried and failed? Any examples (happy to publish our tools once written)?
To expand, I'd like to do (on the command line, and hence can be scheduled)
Export document type
Create a document (page?) (ok, not scheduled, but we have around 400 articles, all in marked up XML, to import _once_) and save it (not publish, tho I doubt it matters)
Export a document (page) to an XML file (ie, back up all our content in XML - versioned - not in SQL databases (not at all versioned)
possibly reverse the previous one, tho really, thats just what #2 is with a different XML format :)
For exporting doctypes you may want to look at the packages section of the API, as this allows the automatic packaging of doctypes which are then portable as ZIP files for you to then install automatically (again, using the packaging part of the API).
For some pseudo-logic:
Export doctypes, import to new installation;
Create documents based on XML-stored data and your new doctypes, and save;
Export newly-created document to XML for versioning in source control.
1 and 2 are simple, 3 can be done using a post-publish hook in Umbraco that you can then use to call a Subversion commit action on the umbraco.config file, which then means it's automatically stored in Subversion for you.
are 1 and 2 simple in an app which is not part of Umbraco? ie external? while I could embed it in, it MUST be able to run as a scheduled job.
BTW, these are all seperate tasks / apps. 1 and 3 might be the same app (run once a day), and 2 is a once-off app, run once it's all tested etc. After the content is in, it'll most likely never be used again.
I guess the other option is to put it into the umbraco interface, and somehow hit a URL every so often...... but then I also have to login.....
Command line tools?
Hi there
Long time listener, first time caller.
Anyone know if it's possible to write commandline tools which use the Umbraco api (current version - 4.0?). We want to import (once) a load of data, as well as export content, doctypes and other stuff so we can version it in subversion.
Anyone done this, or better yet, tried and failed? Any examples (happy to publish our tools once written)?
Thanks
N
To expand, I'd like to do (on the command line, and hence can be scheduled)
Hi Nic,
For exporting doctypes you may want to look at the packages section of the API, as this allows the automatic packaging of doctypes which are then portable as ZIP files for you to then install automatically (again, using the packaging part of the API).
For some pseudo-logic:
Thanks Benjamin
are 1 and 2 simple in an app which is not part of Umbraco? ie external? while I could embed it in, it MUST be able to run as a scheduled job.
BTW, these are all seperate tasks / apps. 1 and 3 might be the same app (run once a day), and 2 is a once-off app, run once it's all tested etc. After the content is in, it'll most likely never be used again.
I guess the other option is to put it into the umbraco interface, and somehow hit a URL every so often...... but then I also have to login.....
Thanks for the help.
Bother, after an afternoon of playing around, it appears to need a full ASP.NET stack running to work, so I guess commandline tools are out
Oh, well. Thanks for the help.
is working on a reply...