1

While using legacy publishing we used below API to fetch publication target.

But now with Topology Publishing publication target exist no more. Which API now we can use for same

PublicationTargetsFilterData filter = new PublicationTargetsFilterData();
PublicationTargetData ptd = (PublicationTargetData)CoreServiceClient.GetSystemWideList(filter).Where(w=>w.Title.Equals(title));
return ptd;
2

You should be using TargetTypesFilterData. Something like this should work:

TargetTypesFilterData targetTypesFilterData = new TargetTypesFilterData();
var targetTypes = coreServiceClient.ClientInstance.GetSystemWideList(targetTypesFilterData);

To work with other Topology Manager items, you should be using Tridion.TopologyManager. Client.dll. You can find the DLL from the bin\client\TopologyManager subfolder of %TRIDON_HOME%.

Connect to the Topology Manager Client like you would connect to the Core Service Client, and then you should get topology types, environments, business process types, and other Topology Manager items.

For instance, to get all environments configured in the Topology Manager, you would do something like this:

TopologyManagerClient topologyManagerClient = new tridionTtm.TopologyManagerClient(new Uri("http://localhost:84/ttm201601/"));
List<CdTopologyTypeData> topologyTypes = topologyManagerClient.topologyManagerClientInstance.CdTopologyTypes.ToList();

List<string> environments = topologyManagerClient.topologyManagerClientInstance
                                                 .CdTopologies
                                                 .Where(t => t.CdTopologyTypeId == "<topology ID>")
                                                 .Select(t => new { t.CdEnvironmentIds })
                                                 .FirstOrDefault()
                                                 .CdEnvironmentIds.ToList();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.