Fórum

Liferay DXP getDDMFields

thumbnail
Gustavo Oliveira, modificado 6 Anos atrás.

Liferay DXP getDDMFields

Junior Member Postagens: 98 Data de Entrada: 23/09/15 Postagens Recentes
Hi,
In Liferay 6.2 I used JournalConverterUtil getDDMFields to read Journal content:
https://docs.liferay.com/portal/6.2/javadocs/src-html/com/liferay/portlet/journal/util/JournalConverterUtil.html#line.33

How are you guys doing it on DXP? Cant find this class:
https://docs.liferay.com/portal/7.0/javadocs/portal-kernel/allclasses-noframe.html

This one is deprecated and doesnt have the method:
https://docs.liferay.com/portal/7.0/javadocs/portal-kernel/com/liferay/journal/kernel/util/JournalConverterManagerUtil.html

Thanks
Jenny Chen, modificado 6 Anos atrás.

RE: Liferay DXP getDDMFields

New Member Postagens: 8 Data de Entrada: 20/09/10 Postagens Recentes
com.liferay.journal.util package is exportable in the journal-api/bnd.bnd, you should be able to use it if you add the journal-api as a build.gradle dependency.

https://github.com/liferay/liferay-portal/blob/7.0.x/modules/apps/web-experience/journal/journal-api/src/main/java/com/liferay/journal/util/JournalConverter.java
thumbnail
Gustavo Oliveira, modificado 6 Anos atrás.

RE: Liferay DXP getDDMFields

Junior Member Postagens: 98 Data de Entrada: 23/09/15 Postagens Recentes
I found this interface and its Impl, but is there an Util like all other services? Or now we should directly access impls?

EDIT: I cant use the impl, all methods are protected, so I need an util to call it, cant find it:
https://docs.liferay.com/portal/7.0/javadocs/modules/apps/web-experience/journal/com.liferay.journal.api/
https://docs.liferay.com/portal/7.0/javadocs/modules/apps/web-experience/journal/com.liferay.journal.service/
Jenny Chen, modificado 6 Anos atrás.

RE: Liferay DXP getDDMFields

New Member Postagens: 8 Data de Entrada: 20/09/10 Postagens Recentes
Based on JournalArticleIndexer, as an example, it looks like you should be able to call the JournalConverter.getDDMFields() directly. However, JournalConverterImpl should still be a public class accessible for you to use.

If you're talking about service classes like JournalArticleLocalServiceUtil, these util classes are generally created when updating the service.xml and service builder for database model objects (JournalArticle.java in the model packages). I believe other util classes (interfaces/helper) were moved and renamed to simplify the API.

There are other classes that were renamed/moved as well in the reference link below.
Classes Moved from portal-service.jar
thumbnail
Gustavo Oliveira, modificado 6 Anos atrás.

RE: Liferay DXP getDDMFields

Junior Member Postagens: 98 Data de Entrada: 23/09/15 Postagens Recentes
Jenny Chen,
JournalConverter is an interface... If you check JournalArticleIndexer its a variable that was instanced.
JournalConverterImpl is a public class but its methods are protected... So no, I wont be able to use it.

Im talking about the Liferay pattern of calling services, we need Utils.
Im trying to find what happened to this Util class on DXP:

https://docs.liferay.com/portal/6.2/javadocs/src-html/com/liferay/portlet/journal/util/JournalConverterUtil.html#line.25
thumbnail
Gerhard Horatschek, modificado 6 Anos atrás.

RE: Liferay DXP getDDMFields

Junior Member Postagens: 86 Data de Entrada: 20/03/09 Postagens Recentes
Hi,

we have the same question/issue with JournalConverterUtil.
How can we read the content of a journal or what is the alternative to JournalConverterUtil from 6.2 in DXP/Liferay7??
Any hints from Liferay staff??
Thank you!
Best regards
thumbnail
Aditya Bhardwaj, modificado 4 Anos atrás.

RE: Liferay DXP getDDMFields

Junior Member Postagens: 78 Data de Entrada: 08/01/15 Postagens Recentes
Inside your controller use this:-

@Reference
   private static JournalConverter _journalConverter; 
    
    @Reference(unbind = "-")
    protected void setJournalContent(JournalConverter journalConverter) {
        _journalConverter = journalConverter;
    }

And then simply call the method  as:- 

Fields ddmFields =  _journalConverter.getDDMFields(ddmStructure, content);