【发布时间】:2015-10-26 09:16:16
【问题描述】:
我一直在尝试在远程门户中创建本地 JournalArticle 的副本。但即使我在文章的content 部分提供了正确的 URL,它也不会出现在门户中。我已经在这个问题上停留了几天。
我按如下方式创建文章。
JournalArticleSoap journalArticleSoap = journalSoap.addArticle(
remoteGroupId,
article.getFolderId(),
article.getClassNameId(),
article.getClassPK(),
"",
true,
LocalizationUtil.getAvailableLanguageIds(article.getTitle()),
titleMapValues.toArray(new String[titleMapValues.size()]),
LocalizationUtil.getAvailableLanguageIds(article.getDescription()),
descriptionMapValues.toArray(new String[descriptionMapValues.size()]),
content,
article.getType(),
article.getStructureId(),
newRemoteTemplate.getTemplateKey(),
article.getLayoutUuid(),
displayDate.get(Calendar.MONTH),
displayDate.get(Calendar.DAY_OF_MONTH),
displayDate.get(Calendar.YEAR),
displayDate.get(Calendar.HOUR),
displayDate.get(Calendar.MINUTE),
0, 0, 0, 0, 0, //expirationDate
article.getExpirationDate() == null,
0, 0, 0, 0, 0,
true,
article.isIndexable(),
article.getUrlTitle(),
serviceContext);
其中journalSoap 是远程门户的JournalArticleServiceSoap,article 是本地JournalArticle。
内容如下。
<?xml version="1.0"?>
<root available-locales="en_US" default-locale="en_US">
<dynamic-element name="Text2001" type="text" index-type="keyword" index="0">
<dynamic-content language-id="en_US"><![CDATA[Desert image]]></dynamic-content>
</dynamic-element>
<dynamic-element name="Documents_and_Media2051" type="document_library" index-type="keyword" index="0">
<dynamic-content language-id="en_US"><![CDATA[/documents/20101/20201/Photo1]]></dynamic-content>
</dynamic-element>
</root>
在上面的 url (/documents/20101/20201/Photo1) 中,20101 是远程门户的 Global group ID,20201 是创建 Photo1 的远程文档库中的文件夹的 id。当我转到http://host:port/documents/20101/20201/Photo1 时,我下载了文件。但是,远程门户中的文章仍然如下所示。
如您所见,我在远程文章中获得了文本动态元素“沙漠图像”。但是我没有将文档库中的动态元素放入远程文章中。谁能让我知道我在这里做错了什么。
【问题讨论】: