But, before using that in another application, the following remarks must be taken into consideration :
By default, only the aggregates are exposed in the Capabilities document. The expose the datasets, the "WMS getCapabilities mode" needs to be changed from 1 to 0 (Data Manager -> Configuration -> General).
To expose an aggregate or a dataset in the getCapabilities, all its parent aggregates must be exposed. It means that all the parent aggregates must have "Enable View Services" and "WMS" set to "true" (in the properties tab). In other words, a datasets can be available in WMS (you can display it in the Portal for instance) but if one of its parent aggregate is not exposed, the dataset will not be listed in the capabilities document.
The capabilities document is filtered depending of the user provided (security). If an user can see only a part of the catalog (security settings), when requesting the getCapabilities with this user, only the aggregates/datasets he is allowed to see will be returned. With the admin user, all is always exposed.
Besides that, it is very important to understand that exposing all the cataloged datasets/aggregates in the capabilities document is not recommended at all because with a lot of layers, the document takes a long time to be generated and it can even prevent APOLLO to work properly.
The best practise is to use or to implement a client that is able to find the data in the catalog and then request a getLayer (no need of the full getCapabilities) to have the parameters to request the getMap. The Geospatial Portal is doing that for instance.
It is also recommended for better performances to disabled the WMS on the highest aggregates to have the smallest capabilities document as possible. All the children datasets can still be displayed with the WMS but they are not listed in the capabilities unless you use a getLayer.