Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在SDL Tridion 2011 SP1中使用核心服务创建模式_Tridion - Fatal编程技术网

在SDL Tridion 2011 SP1中使用核心服务创建模式

在SDL Tridion 2011 SP1中使用核心服务创建模式,tridion,Tridion,我正在使用SDL Tridion 2011 SP1中的核心服务创建模式。在创建模式时,我使用了模式的自定义名称空间URI。通常,当我们直接通过Tridion CME创建模式时,我们会自动生成一个名称空间URI,以uuid:xxxxxxxxxxxxxxxxxxxxxxxxx开始 我使用以下代码创建了一个模式: Tridion.ContentManager.CoreService.Client.SchemaData schemas = new SchemaData { Title = "co

我正在使用SDL Tridion 2011 SP1中的核心服务创建模式。在创建模式时,我使用了模式的自定义名称空间URI。通常,当我们直接通过Tridion CME创建模式时,我们会自动生成一个名称空间URI,以
uuid:xxxxxxxxxxxxxxxxxxxxxxxxx开始

我使用以下代码创建了一个模式:

Tridion.ContentManager.CoreService.Client.SchemaData schemas = new SchemaData
{
    Title = "coreservicesschema3",
    Description = "coreservicesschema",
    Id = "tcm:0-0-0",
    LocationInfo = new LocationInfo
    {
        OrganizationalItem =
            new LinkToOrganizationalItemData { IdRef = "tcm:7-18-2" }
    },

    RootElementName = "Content",
    NamespaceUri = "customnamespaceuri",
    Xsd = xsd.ToString(SaveOptions.None)
};
schemas = (SchemaData)client.Create(schemas, new ReadOptions());
Response.Write("<BR>" +"new schema id"+ schemas.Id);
Response.Write("<BR>" + "new schema Name" + schemas.Title);
//schema created
Tridion.ContentManager.CoreService.Client.SchemaData schemas=new SchemaData
{
Title=“coreservicesschema3”,
Description=“coreservicesschema”,
Id=“tcm:0-0-0”,
LocationInfo=新的LocationInfo
{
组织学=
新链接到组织alitemdata{IdRef=“tcm:7-18-2”}
},
RootElementName=“内容”,
NamespaceUri=“customnamespaceuri”,
Xsd=Xsd.ToString(SaveOptions.None)
};
schemas=(SchemaData)client.Create(schemas,newreadoptions());
写(“
”+“新模式id”+schemas.id); 写(“
”+“新模式名”+schemas.Title); //创建的模式
有人能指出如何使用默认名称空间URI创建模式吗


谢谢

创建具有核心服务的架构所需的最少代码如下:

using (var client = new SessionAwareCoreServiceClient(netTcpBinding, remoteAddress))
{
    SchemaData schemaData = client.GetDefaultData(ItemType.Schema, folderId) as SchemaData;
    schemaData.Description = "description";
    schemaData = client.Save(schemaData, readOptions) as SchemaData;
    schemaData = client.CheckIn(schemaData.Id, readOptions) as SchemaData;

    Console.WriteLine("Schema: " + schemaData.LocationInfo.WebDavUrl);
}
将使用默认名称空间创建架构。在本例中,它也不包含任何字段,但这不是您所要求的