我可以使用文件夹TCMURI创建组件,如下所示:
var schemaInfo = client.ReadSchemaFields(
"tcm:184-1882-8", true, new ReadOptions());
ComponentData component = (ComponentData)client.GetDefaultData(
ItemType.Component, "tcm:19-454-2");
Run Code Online (Sandbox Code Playgroud)
我可以传递WebDavURL而不是我要创建Component的TCMURI吗?
提前致谢.
我正在使用c#处理Windows应用程序.
我有一个表格和一个有所有方法的课程.
我在课堂上有一个方法,我正在处理arraylist中的一些文件.我想为此文件处理调用进度条方法,但它不起作用.
任何帮助
PFB我的代码片段:
public void TraverseSource()
{
string[] allFiles1 = Directory.GetFiles(sourcePath, "*.xml", SearchOption.AllDirectories);
var allFiles = new ArrayList();
var length = allFiles.Count;
foreach (string item in allFiles1)
{
if (!item.Substring(item.Length - 6).Equals("MD.xml"))
{
allFiles.Add(item);
// Here i want to invoke progress bar which is in form
}
}
}
Run Code Online (Sandbox Code Playgroud) 我在使用核心服务更新Tridion中的组件时遇到错误
根元素必须在命名空间中
我的代码:
ComponentData component = client.Read(webDavPath, readOptions) as ComponentData;
component = client.TryCheckOut(webDavPath, readOptions) as ComponentData;
//XDocument dom = XDocument.Parse(component.Content);
//// do your modifications to dom
//component.Content = dom.ToString();
doc.Load(filePath);
sw = new StringWriter();
xw = new XmlTextWriter(sw);
doc.WriteTo(xw);
component.Content = sw.ToString();
//client.CheckOut(webDavPath, true, readOptions);
client.Update(component, readOptions);
client.Save(component, readOptions);
client.CheckIn(component.Id, readOptions);
//client.Update(component, new ReadOptions());
// component = client.Update(component, readOptions) as ComponentData;
Run Code Online (Sandbox Code Playgroud) 我有以下代码用于读取JSON文件.它没有给出任何错误,但我在变量中得到null:
var myData = null;
$.ajax({
type: 'GET',
async: false,
url: 'myJson.json',
dataType: 'json',
success: function (r) {
myData = r;
}
});
Run Code Online (Sandbox Code Playgroud)
以下是我的JSON文件:
{items:[{value:"1",name:"John"},{value:"2",name:"Henry"}]};
Run Code Online (Sandbox Code Playgroud) 我正在创建安全组并允许使用以下代码为所有 ip 打开 TCP 和 HTTP 的入站协议:
IpPermission ipPermission = new IpPermission();
ipPermission.withIpRanges("0.0.0.0/0")
.withIpProtocol("tcp")
.withFromPort(22)
.withToPort(22);
ipPermission.withIpRanges("0.0.0.0/0")
.withIpProtocol("http")
.withFromPort(80)
.withToPort(80);
AuthorizeSecurityGroupIngressRequest authorizeSecurityGroupIngressRequest =
new AuthorizeSecurityGroupIngressRequest();
authorizeSecurityGroupIngressRequest.withGroupName("JavaSecurityGroup")
.withIpPermissions(ipPermission);
amazonEC2Client.authorizeSecurityGroupIngress(authorizeSecurityGroupIngressRequest);
Run Code Online (Sandbox Code Playgroud)
但是,它给我以下错误:IP 协议的值“http”无效。未知协议
我在一个出版物的结构组中创建了一些页面.我想使用核心服务取消发布所有这些已发布的页面.谁能帮我吗?
我得到了所有用户的列表XElement中Tridion使用的核心服务.现在我想根据解密来搜索特定用户的tcm uri?
datetime=Datetime.Now;
string strquery = @"INSERT INT0 [Destination_CMS].[dbo].[Destination_CMS_User]
values('" + userid + "','" + email + "','"
+ userType + "','" + userStatus + "','" + processed + "','"
+ datetime.ToLongDateString() + "')";
cmd = new SqlCommand(strquery, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Run Code Online (Sandbox Code Playgroud)
我收到错误:'Destination_CMS'附近的语法不正确.
我使用以下代码从结果集中的数据库中获取数据:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection connection = DriverManager.getConnection(
"jdbc:oracle:thin:@host:1521:DB", "User","pass_01");
Statement statement = connection.createStatement();
resultset = statement.executeQuery("select * from employee");
System.out.println("Records Exist "+resultset.next());
System.out.println(resultset.getRow());
while (resultset.next()) {
System.out.println(resultset.getInt(1) + " " +
resultset.getInt(2) + " " +
resultset.getInt(3) + " " +
resultset.getString(4));
}
Run Code Online (Sandbox Code Playgroud)
但是我只得到一行,尽管数据库表中有两行.我在这里错过了什么?
我想使用核心服务在SDL Tridion 2011中创建一个空白组件.我在流程开始时获得的唯一信息是Schema URI.模式可以包含任何类型的字段(文本,rtf,数字日期,嵌入等),其中一些可能是强制性的.
我理解,对于必填字段,我需要在其中保存一些虚拟值,这是可以接受的,因为它们将在以后手动更改.
我怎样才能实现这一目标?
tridion ×6
c# ×3
tridion-2011 ×2
amazon-ec2 ×1
aws-sdk ×1
java ×1
javascript ×1
jquery ×1
json ×1
progress-bar ×1
resultset ×1
sql ×1
winforms ×1
xelement ×1