Aquarius24
Aquarius24

Reputation: 1866

How to pass WebDavURL instead of TCM URI while creating a Component using Core Service?

I am able to create Components using Folder TCMURI as shown below:

var schemaInfo = client.ReadSchemaFields(
    "tcm:184-1882-8", true, new ReadOptions());

ComponentData component = (ComponentData)client.GetDefaultData(
    ItemType.Component, "tcm:19-454-2");

Can I can pass WebDavURL instead of this TCMURI where I want to create Component?

Thanks in advance.

Upvotes: 2

Views: 819

Answers (1)

Mihai Cădariu
Mihai Cădariu

Reputation: 2407

You should simply use the WebDAV URL instead of the TCM URI:

string folderWebDAVURL = "/webdav/MyPublication/Path/To/Folder";

ComponentData component = (ComponentData)client.GetDefaultData(
    ItemType.Component, folderWebDAVURL);

Upvotes: 7

Related Questions