in

Dotnetpanel Forums

Community support forums for DotNetPanel products

Add multiple domains - with API or any other way??

Last post 02-11-2010 8:36 AM by bloggus. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-07-2010 12:26 AM

    Add multiple domains - with API or any other way??

    I need to add around 1000 domains.

    Basically I need to perform the task "add domain" (togerther with DNS and webiste), but I can't find any functions in the API documentation that allows me to do that.

    How can I do it automatically?? Adding them manually is not really an option ...

  • 02-11-2010 4:58 AM In reply to

    Re: Add multiple domains - with API or any other way??

    Is there really no way to do that?

  • 02-11-2010 7:22 AM In reply to

    • MickeP
    • Top 75 Contributor
    • Joined on 09-22-2008
    • Landskrona, Sweden
    • Posts 62

    Re: Add multiple domains - with API or any other way??

    Are you developing against the API yourself, or what do you mean?

    I'm not doing that - yet - but I downloaded the web portal sources, opened it in my Visual Studio and made a few searches, out of curiousity.

    Background:
    When adding domain manually from within the control panel, the user logs in, goes to "Domains" (by clicking the icon) and then clicks the "Add Domain" button, followed by the "Domain" link from that page that appears. Then the user can enter the domain name in an input field, prefixed by the text "www." and the user can also tick two boxes; "Create Web Site" and "Enable DNS". Now i Hope you know where I mean? Let's find our where this form is in the source codes:

    Programmatically:
    Having the above description in mind, we now would like to do the exact same thing but programmatically. This I won't get my hands into right now but my searches in the source code in Visual Studio tells me that the portal source code for the form described above, is located in DNP.Portal.Modules -> DomainsAddDomain.ascx -> DomainsAddDomain.ascx.cs file, under the AddDomain() method.

    You have to set the DomainType to "Domain", fill in the string "domainName" and probably have some variabel with the SpaceID number in as well, as a minimum.

    If i were you I'd try to create a new web form to the portal source codes (for example "myAutomaticDomainAdding.aspx") and then use code from description above and use for your needs, You'll probably wrap that code with some iteration, I presume, and it also depends on how you're able to read a list of all customers and belonging domains to iterate.

    Conclusion: As I've understood it, ALL DNP functions work against the API. The public API and it's documentation might not have ready-to-go methods to call in a basic way right now for doing this, but if you're a programmer I don't think it will be too hard to make that on your own?

    Hope this helps you - or someone.

    Final words: I have the need to develope small things myself against DNP soon. Maybe all (the few?) DNP customers that actually DO some programming could start some kind of group/forum here to help each other out and sharing knowledge, since documentation and examples are really lacking? Instead of each of us spending lots of time seperately to learn how to communicate with DNP API from our own different projects and needs?

    Filed under:
  • 02-11-2010 8:36 AM In reply to

    Re: Add multiple domains - with API or any other way??

    Thanks MickeP. Don't help me that a lot since I'm not a programmer in that sense. I wouldn't know where to begin ...

     ( Heja Skåne! = I'm 30km from you ... :) )

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems