SDL*_*per 4 tridion tridion-2011
如果在多行字段上启用了富文本格式,我想检查核心服务.
如果我在富文本格式启用后分析模式的源,那么为此目的插入了许多标记: -
<tcm:Size xmlns:tcm="http://www.tridion.com/ContentManager/5.0">2</tcm:Size>
<tcm:FilterXSLT xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></xsl:output>
<xsl:template name="FormattingFeatures">
<FormattingFeatures xmlns="http://www.tridion.com/ContentManager/5.2/FormatArea">
<Doctype>Transitional</Doctype>
<AccessibilityLevel>0</AccessibilityLevel>
<DisallowedActions></DisallowedActions>
<DisallowedStyles></DisallowedStyles>
</FormattingFeatures>
</xsl:template>
<xsl:template match="/ | node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"></xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="/body[not(processing-instruction() or comment() or normalize-space(translate(., ' ', '')) != '' or *[@* or * or comment() or processing-instruction() or not(self::p or self::br)])]">
<!-- make an empty <body> if all the body has is empty paragraphs, line-breaks and (non-breaking) spaces -->
<xsl:copy></xsl:copy>
</xsl:template>
<xsl:template match="p[not(@* or * or comment() or processing-instruction() or normalize-space(translate(., ' ', '')) != '' or following-sibling::node()[@* or * or comment() or processing-instruction() or not(self::p or self::text()) or normalize-space(translate(., ' ', '')) != ''])]">
<!-- ignore all paragraphs at the end that have nothing but (non-breaking) spaces -->
</xsl:template>
</xsl:stylesheet>
</tcm:FilterXSLT>
Run Code Online (Sandbox Code Playgroud)
但是,如果启用了富文本,那么确切地找到了哪个属性我甚至无法弄清楚核心服务API文档.
我的核心服务代码如下: -
SessionAwareCoreService2010Client client = new SessionAwareCoreService2010Client();
client.ClientCredentials.Windows.ClientCredential.UserName = "myUserName";
client.ClientCredentials.Windows.ClientCredential.Password = "myPassword";
client.Open();
SchemaFieldsData fields = client.ReadSchemaFields("tcm-x-y-z",
true, new ReadOptions());
foreach (var field in fields.Fields)
{
if (field is MultiLineTextFieldDefinitionData)
{
return Constants.DataType.STRING;
}
}
Run Code Online (Sandbox Code Playgroud)
请建议.
只需将"is"检查更改为与XhtmlFieldDefinitionData进行比较:
if (field is XhtmlFieldDefinitionData)
{
...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
375 次 |
| 最近记录: |