2015-10-26 14 views
2

我一直在嘗試在遠程門戶中創建本地JournalArticle的副本。但即使我在文章的content部分提供了正確的URL,但它並未出現在門戶中。我已經在這個問題上停留了幾天了。Liferay - 無法將文檔庫項目附加到遠程門戶中的JournalArticle

我按如下方式創建文章。

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是遠程門戶的全局組ID,20201是在其中創建照片1遠程文檔庫中的文件夾的標識。當我去http://host:port/documents/20101/20201/Photo1時,我得到下載的文件。但是,遠程門戶中的文章如下所示。

enter image description here

正如你所看到的,我越來越遙遠文章中的文本動態元素「沙漠圖像」。但是我沒有從文檔庫中獲取動態元素到遠程文章中。任何人都可以讓我知道我在這裏做錯了請。

回答

0

問題是我從URL中刪除了uuid和創建時間戳。

當我用/documents/20101/20201/Photo1/uuid?t=timestamp代替/documents/20101/20201/Photo1它開始工作。這裏uuid是uuid,時間戳是文件Photo1的創建時間(長類型)。

0

只需創建一個結構化的(僅包含d &中號上傳域)從前端的文章,並檢查XML DB中,你會發現究竟是什麼出錯的差異。

相關問題