Copied to clipboard

Flag this post as spam?

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


  • Marco Graziotti 40 posts 166 karma points c-trib
    Aug 24, 2021 @ 08:57
    Marco Graziotti
    0

    Creating a package that installs "API controllers" (custom endpoint) and "Composers"

    Hi,

    Is there a way in Umbraco 9 to create a package in the backoffice that also contains all the "API controllers" (custom endpoint) and "Composers" that I have created?

    I saw that it's possible to create a "custom package actions", and looking at the bottom of the page, in the "Adding Configuration" paragraph, it seems that using "actions" it's possible to write an xml file (here the Azure provider example), but is it possible to also write classes? Or there's another way to import these elements?

    Thank you, Marco

  • Marco Graziotti 40 posts 166 karma points c-trib
    Aug 24, 2021 @ 09:53
    Marco Graziotti
    0

    I saw that when you create a new package from the BO, and export the partial views, in the package.xml file, there is a section called "PartialViews" with all the ".cshtml" files inside.

    Here a screenshot: package.xml export

    Probably it's possible to also write classes.

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Aug 24, 2021 @ 11:30
    Kevin Jump
    0

    Hi Marco,

    the docs are a bit out of date - as part of the v9 process - creating packages via the backoffice has been dropped :(

    only nuget packages are supported now.

    The best way to see how they work is to use the dotnet templates to create a template package . it will setup the basics of how a package works (there is a trick with a .targets file)

    so for example you can create a package from the command line:

     dotnet new umbracopackage -n MyCustomUmbracoPackage
    

    See : https://our.umbraco.com/documentation/UmbracoNetCoreUpdates?_ga=2.238910144.151428304.1629718538-1389963372.1606994685#package-development

  • Marco Graziotti 40 posts 166 karma points c-trib
    Aug 24, 2021 @ 14:23
    Marco Graziotti
    0

    Hi Kevin,

    thank you for your reply.

    yes, I think that the docs from Umbraco 8 to Umbraco 9 were wrongly duplicated.

    From the Umbraco 9 RC2 backoffice, I saw that the "Packages" menu still exists, and it's possible to create a "package.xml" file to export all "Document Types", "Data Types", etc. Is this feature going to be discontinued? For example I didn't find a way to upload an existing "package.xml".

    Is it possible with NuGet packages to export "API controllers" (custom endpoint) and "Composers"?

    Thank you, Marco

Please Sign in or register to post replies

Write your reply to:

Draft