Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vanja Tesin 30 posts 55 karma points
    Sep 03, 2009 @ 11:21
    Vanja Tesin
    0

    Programmatically import document types

    I'm trying to figure out is it possible to programmatically (e.g. via webservice) import document types exported from the back end UI?

    I'd like to use such a functionality to extend our build process from Visual Studio so that when a project is built, document types from the project can be imported to the developers instance of Umbraco. We're using project setup with POST-Build event and XCOPY command that can be found on the Net.

    Umbraco version is 4.0.2.1

     

    Thanks!

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Sep 03, 2009 @ 11:39
    Thomas Höhler
    0

    You can create a package on the source system including the document types and then import it on the target system.

    hth, Thomas

  • Vanja Tesin 30 posts 55 karma points
    Sep 03, 2009 @ 11:47
    Vanja Tesin
    0

    Thanks Thomas, but as I said I'd need this functionality inside Visual Studio build process. I looked at the webservices ( /webservices/api ) but there isn't  anything like that there.

    What i'd like to do is to create a small program that could use web service calls, for example, to import all the udt files from the VS2008 project directory to the running Umbraco instance. This small program would then be part of the projects post-build event, thus enablig every developer on the project to easily work with the up-to-date document types. We'd keep udt files under version control.

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Sep 03, 2009 @ 12:27
    Thomas Höhler
    0

    Hi Vanja,my fault, didn't read it exactly.

    You can implement an own webservice which creates the document types. Didn't tried it yet, but should be possible like this:

    DocumentType newDt = DocumentType.MakeNew(UMBRACOUSER, "DocTypeAlias");
    newDt.Description = "Description";
    newDt.Text = "DocTypeName"
    //for each property do...
    PropertyType pt = PropertyType.MakeNew(....);
    newDt.PropertyTypes.Add(pt);

    Just to fill the lacks I left for you ;-)

    Did this help? If you want I can look into it again.

    hth, Thomas

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Sep 03, 2009 @ 12:39
    Thomas Höhler
    0

    Did you take a look into the umbImport project from Richard or the Courier from the Umbraco Pro licence?

    Thomas

  • Vanja Tesin 30 posts 55 karma points
    Sep 03, 2009 @ 13:37
    Vanja Tesin
    0

    I was thinking to create the webservice. I'll take a look at the source code to see how the actual import is done by the umbraco backend.

    For the upcoming project we'll get the Umbraco Pro license, but untill then i'm looking into other ways of doing this (don't know if Courier can do this for us?)

  • Nikola Petkovic 64 posts 63 karma points
    Sep 04, 2009 @ 13:04
    Nikola Petkovic
    0

    Hi Vanja,

    I also had problems with up-to-date docTypes at every developers machine.

    How are you going to call webservice from postbuild event?

  • Vanja Tesin 30 posts 55 karma points
    Sep 04, 2009 @ 15:40
    Vanja Tesin
    0

    I'm thinking to create a webservice that will extend /umbraco/webservices/api so that you can manipulate documentTypes in the same way as Documents, Media etc.

    I'll have a look at the source code for the weekend, to see how import functionality actually does this and just expose that code as a service. Hopefully that should work. If it does, there will be one additional Umbraco project available ;)

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Sep 04, 2009 @ 17:34
    Chris Houston
    0

    Vanja,

    Sounds like an interesting idea. Do post an update when you have found / developed a solution.

    I have been thinking about doing something similar to allow a build server to automatically update a testing server based on a successful build which could then be used for some form of client side unit testing.

    I am working on a tool that already does programmatically create document types, one thing to consider is how you would achieve hierachical document types in your import process.

    Cheers,

    Chris

     

     

  • Vanja Tesin 30 posts 55 karma points
    Sep 07, 2009 @ 13:39
    Vanja Tesin
    0

    Will do!

     

Please Sign in or register to post replies

Write your reply to:

Draft