4

I am using the PowerShell Core-Service module (https://code.google.com/p/tridion-powershell-modules/) and I can easily obtain the schema Publication Target Destination by tcm id:

$schema1 = Get-TridionItem -id "tcm:0-3-8"

However, I can not look up the HTTPS schema for Publication Target Destination by webdav url unless I put in a double //. When I open the HTTPS schema in the CME, I see it's webdav url (or location) is simply "\" so, I would expect this should work:

$schema2 = Get-TridionItem -id "/webdav/HTTPS.xsd"

but it tells me there is no item with that ID. however, if I when I looked it up by tcm id, it told me that the webdav location is actually /webdav//HTTPS.xsd and indeed this works:

$schema2 = Get-TridionItem -id "/webdav//HTTPS.xsd"

Can anyone explain why this is the case? I can look up our schemas without this double // (e.g. "/webdav/C020%20Shared%20Global%20Content%20US%20English/Building%20Blocks/System/Content/Administration/Administrative%20Alerts/Dashboard%20News%20and%20Notifications.xml")

1 Answer 1

4

I am not 100% sure why you need to know that :)

The reason is that a webdav URL structure is made up of /WEBDAV PREFIX/REPOSITORY/Path/to/item.

Protocol schemas are system-wide objects, and therefore do not have a REPOSITORY. If you use a URL like /WEBDAV_PREFIX/HTTPS.xsd, then Tridion will search for a publication named HTTPS.xsd. By omitting the repository you're basically telling Tridion "look in System Wide objects". I agree Tridion could have used a keyword there, like "SYSTEM", but then you wouldn't be able to use that keyword as a publication name.

2
  • Thanks Nuno. I am building a tool to read an excel file of publish target urls and set them. this is for after doing db refresh from production. i have to reset the publication targets for the environment back to its original setting. in order to do that, I have to create new Tridion.ContentManager.CoreService.Client.LinkToSchemaData object and set its IdRef. I thought it best to look up the HTTPS schema by webdav url instead of assuming its id doesn't change. Commented Apr 23, 2014 at 15:12
  • Makes perfect sense to use WebDAV urls, and I agree. The 'why' was related to the double slash, not the use case.
    – Nuno Linhares
    Commented Apr 23, 2014 at 17:00

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.