New answers tagged

2

After lot debugging was able to figure out that on below code _client.Publish(new String[] { id }, pid, purposes.toArray(), PublishPriority.Low, new ReadOptions()); I was passing string array on purposes i.e. Live, Live1 But Publish method on core-service is expecting id instead of purpose string. Previously I was fetching purpose string by below line of ...


3

The error happens if you call a Linq statement on a null object. The only Linq statement in your code is ToArray(). My guess is that the variable purposes is null.


0

Publish Page coreservice example: // Publish the page var publishInstruction = new PublishInstructionData { ResolveInstruction = new ResolveInstructionData() }; PublishTransactionData[] unpublishTransactions = core.Publish(new[] { pageUri }, publishInstruction, destinationTargetUrisOrPurposes, PublishPriority.Normal,new ReadOptions());


2

For Core Service, read the BPT from the Publication and then you can get to TargetTypes and their Purpose: var pub = (PublicationData)client.Read("tcm:0-x-1", null); var bpt = (BusinessProcessTypeData)client.Read(pub.BusinessProcessType.IdRef, null); bpt.TargetTypes.Select(tt => tt.Purpose);


1

A Publication/Repository has a BusinessProcessType property which tells you what the selected Business Process Type (BPT) is for that Publication/Repository (if any). A Business Process Type contains a set of Target Types which each have a distinct Purpose. So, if you are working with TOM.NET and want to get a list of publishing purposes for a given context ...


Top 50 recent answers are included