Skip to content

Instantly share code, notes, and snippets.

@000benniu
Last active April 6, 2022 15:08

Revisions

  1. 000benniu revised this gist Apr 6, 2022. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions AssetPublisherTemplate_Dump_Sample_DXP71
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,6 @@
    <#--
    Dump all the values for web contents.
    Use as asset publisher's template. (tested on DXP 7.1)

    ! need change the ddmTemplate Key to
    -->

    <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
  2. 000benniu revised this gist Apr 6, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion AssetPublisherTemplate_Dump_Sample_DXP71
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    <#--
    Dump all the values for web contents.
    Use as asset publisher's template. (tested on DXP 7.1)

    ! need change the ddmTemplate Key to
    -->

    <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
    @@ -9,7 +11,7 @@ Use as asset publisher's template. (tested on DXP 7.1)
    <#assign journalArticle = journalArticleLocalService.getLatestArticle(curEntry.getClassPK()) />
    <@liferay_journal["journal-article"]
    articleId=journalArticle.getArticleId()
    ddmTemplateKey="36970"
    ddmTemplateKey=journalArticle.getDDMTemplateKey()
    groupId=journalArticle.getGroupId()
    />
    -----------<br/>
  3. 000benniu renamed this gist Apr 6, 2022. 1 changed file with 0 additions and 0 deletions.
  4. 000benniu renamed this gist Apr 6, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. 000benniu created this gist Apr 6, 2022.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <#--
    Dump all the values for web contents.
    Use as asset publisher's template. (tested on DXP 7.1)
    -->

    <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
    <#if entries?has_content>
    <#list entries as curEntry>
    <#assign journalArticle = journalArticleLocalService.getLatestArticle(curEntry.getClassPK()) />
    <@liferay_journal["journal-article"]
    articleId=journalArticle.getArticleId()
    ddmTemplateKey="36970"
    groupId=journalArticle.getGroupId()
    />
    -----------<br/>
    </#list>
    </#if>