1

I figured out how to list target type and publication target names. How do I do the following in core services?

  1. List all the items for a publication target; Description, Protocol, login, Language,priority....

  2. How do I create a target type

  3. How do I create a publication target and all the details that go with it.

2
  • 3
    What have you tried to do already? You'll get a lot of help here if you provide some code samples :)
    – johnwinter
    Commented Jul 8, 2013 at 21:25
  • 3
    It must be a fairly monster implementation to make it worth investing time in writing a web service application to create your target types and publication targets. Most projects I worked on have 2 target types (Staging/Live) - created in the GUI in 10 seconds. You might have a few more Publication Targets, but probably shouldn't (to ensure your deployment is as transactional as possible, use multiple destinations). The only scenario I can imagine is if you are somehow trying to script the creation of your environment - in which case you are surely advanced enough to read the API documentation
    – Will Price
    Commented Jul 9, 2013 at 7:07

1 Answer 1

8

Here's how to create a TargetType. Mutatis Mutandis for a Publication Target. (This is powershell with some namespace magic wired up, but enough to show the process. It's the same in C# or whatever)

$newTargetType = $core.GetDefaultData([ItemType]::TargetType, $null, $null)
$newTargetType.Title = "foobar"
$newTargetType.Description = "foobar"
$core.Create($newTargetType, $null)

As long as I've got the shell open, why not throw a couple of queries at a publication target

PS C:\Users\Administrator> $core.Read("tcm:0-1-65537", $null)

DefaultCodePage   : 65001
Destinations      : {Tridion.ContentManager.CoreService.Client.TargetDestinationData}
MinApprovalStatus : Tridion.ContentManager.CoreService.Client.LinkToApprovalStatusData
Priority          : Normal
Publications      : {Tridion.ContentManager.CoreService.Client.LinkToPublicationData}
TargetLanguage    : None
TargetTypes       : {Tridion.ContentManager.CoreService.Client.LinkToTargetTypeData}
Description       : visitorsweb
ExtensionData     : System.Runtime.Serialization.ExtensionDataObject
AllowedActions    :
Id                : tcm:0-1-65537
IsEditable        : True
ListInfo          :
Title             : visitorsweb
VersionInfo       :

PS C:\Users\Administrator> $core.Read("tcm:0-1-65537", $null).Destinations[0].Title
upload.visitorsweb.local

Enough to show that it's pretty straightforward to get most of the information you need.

1
  • 1
    you'll turn into a shell @dominic cronin
    – johnwinter
    Commented Jul 8, 2013 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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