Programmatically retrieve a list of publication topics

What is the most efficient way to programmatically find a list of topics used in a given publication? There is Baseline 2.5 GetReport, which returns a list of baseline topics, but I see two issues with this:

  • Not all topics in a baseline are necessarily used in a publication that uses that baseline (those that show as 'not in use' in the baseline tab in Pub Manager).
  • Maps can become out of sync with a baseline, meaning a baseline could potentially be out of date when queried. It's only when you open a pub in Pub Manager that the resync occurs. 

It seems that more work needs to be done with the list of topics returned by Baseline 2.5 GetReport, such as also parsing the maps. Is this correct? Any better way?

thanks,
Barra

emoji
Parents
  • Hi Barra,

    Baseline is the crux of the Tridion Docs product, and it is not supereasy. Baseline on an in progress publication has a lot of gray area as not all content is there, maps change, conrefs changes, objects gets versioned, links gets removed, causing orphans, variable assignment changes, conditions change, sharing baselines, etc

    So I would like to help by focussing on your user request "list of topics used in a given publication"

    You indeed landed on the available API calls, see https://docs.rws.com/1151795/68081/tridion-docs-main-documentation/baseline-2-5. Note that a baseline always is conditionally complete, meaning that although condition context (bluetooth=Y or bluetooth=N) could change, all linked topics should have a version in the baseline no matter what the condition context is.

    • Where GetReport indeed returns ALL objects in the baseline, the ones that are also not in use anymore because of removed topicrefs, etc
    • Where ExpandBaseline returns you object identifiers for your given Start-LogicalId. This last parameter should be the GUID of your root map that you specified on the Publication Version. This will recursively navigate on what is used by this root map. A lot of his information comes from the Publication Version where you want to find the list for. The API call you need...
    • Where CompleteBaselineByCandidateAndMode returns you object identifiers for your given Start-LogicalId and will attempt to complete the missing gaps (e.g. somebody added a topicref link, but Publication Manager was not used to set a version for this new topic). You can leave ExtendBaselineId empty, and the mode is the well-known of LatestAvailable or perhaps LatestReleased.

    If you really are interested in the magic. Publication Manager is completely written on the public API. It uses the above calls, so if you put a https://www.telerik.com/fiddler in between you can see what happens.

    Best wishes,
    Dave

    PS: Cross linking to an ISHRemote idea which actually looks a lot like your use case Add cmdlet Get-IshPublicationOutputContent to return directly linked content objects of this publication · Issue #126 · RWS/ISHRemote https://github.com/RWS/ISHRemote/issues/126 ... Note, this is an idea but is not implemented in ISHRemote v8.0 dd. 20240607.

    emoji
  • Hi Dave, thanks a lot for the reply, that covers what I need and it will be interesting to play around with fiddler as suggested. Agree with the idea of an ISHRemote cmdlet to do this too, I think a lot of people will find it useful. 

    cheers,
    Barra

    emoji
Reply Children