【问题标题】:Liferay - Not able to attach a Document Library item to JournalArticle in Remote portalLiferay - 无法将文档库项目附加到远程门户中的 JournalArticle
【发布时间】: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 时,我下载了文件。但是,远程门户中的文章仍然如下所示。

如您所见,我在远程文章中获得了文本动态元素“沙漠图像”。但是我没有将文档库中的动态元素放入远程文章中。谁能让我知道我在这里做错了什么。

【问题讨论】:

    标签: java liferay


    【解决方案1】:

    只需从前端创建一篇结构化(仅包含 D&M 上传器字段)文章并检查 DB 中的 XML,您就会发现到底哪里出了问题。

    【讨论】:

      【解决方案2】:

      问题是我从 url 中删除了 uuid 和创建时间戳。

      当我用 /documents/20101/20201/Photo1/uuid?t=timestamp 替换 /documents/20101/20201/Photo1 时,它开始工作了。这里的uuid是uuid,timestamp是Photo1文件的创建时间(长型)。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-05-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-05-23
        • 2021-07-09
        • 1970-01-01
        相关资源
        最近更新 更多