I am making a pluigin for Umb17 and need to do a few things with the host information but have no idea where to even start looking. Here is what I need to look for:
1: On site warm up: discover all domains assigned to any nodes in the “Culture and Hostnames” interface.
2: While runinng: if a domain is Added/Updated/Deleted from a node my package needs to know about it.
Can anyone help me figure out where to start on these? Thanks
On warm-up, inject it and call GetAll(true) to get every domain across all nodes. Run it from a UmbracoApplicationStartingNotification handler to build your initial list.
While running, subscribe to the domain notifications, DomainSavedNotification and DomainDeletedNotification to get added/updated and deleted domains.
One thing I wanted to check on too. How does Umbraco know the domain name if none are set in the hosts config? I.E. it is just a single site setup and the user never goes sets the domain? Does Umbraco just default to server the files on what ever TLD is associated with the incoming request?