Foros de discusión

creatign xml structure in liferay !!!

Ashwani Kumar, modificado hace 11 años.

creatign xml structure in liferay !!!

Junior Member Mensajes: 26 Fecha de incorporación: 19/10/12 Mensajes recientes
Hi All,

I want to create the XML structure eg.


<root available-locales="en_US" default-locale="en_US"> <static-content language-id="en_US">The content would be here....</static-content></root>


Any reference can i get for doing this??

Thanks in advance..
-
Ashwani
thumbnail
Bart Simpson, modificado hace 11 años.

RE: creatign xml structure in liferay !!!

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
To begin with
 JournalStructure com.liferay.portlet.journal.service.JournalStructureLocalServiceUtil.createJournalStructure(long id)

You can use com.liferay.portlet.journal.model.JournalStructure and it's methods to do the rest.
Do write about any specific problems you face.
Ashwani Kumar, modificado hace 11 años.

RE: creatign xml structure in liferay !!!

Junior Member Mensajes: 26 Fecha de incorporación: 19/10/12 Mensajes recientes
Hi Bart,

Thanks for your quick response, I am trying to store the field of my custom portlet in journal Article table as Journal Article.

So , with my understanding the field value will be stored in content field of LR DB in the form of XML. thats why i am trying to build the xml with filed value.

Also, pls given some reference with which i can make an entry in JournalArticle table. because Most of the parameter of JournalArticleLocalServiceUtil.addArticle() methods are unknown for me...

-
Thanks
Ashwani
Gwowen Fu, modificado hace 11 años.

RE: creatign xml structure in liferay !!!

Expert Mensajes: 315 Fecha de incorporación: 27/12/10 Mensajes recientes
What I did to learn how JournalArticleLocalServiceUtil.addArticle() works is to run Liferay in debug mode and see how Liferay's Web Content portlet uses it.

I wan's able to find good references for that. Let us know if you could find any.

Regards,
Gwowen
thumbnail
Bart Simpson, modificado hace 11 años.

RE: creatign xml structure in liferay !!!

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
I wan's able to find good references for that. Let us know if you could find any.


Seven Cogs hook, checkout my response above for 'Ashwani Kumar's question
thumbnail
Bart Simpson, modificado hace 11 años.

RE: creatign xml structure in liferay !!!

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
If you want to add content etc using the api, sevencogs hooks is a very good starting point, it does all that using the api,
For reference here is the one http://sourceforge.net/projects/lportal/files/Liferay%20Plugins/6.0.6/sevencogs-hook-6.0.6.1.war/download, or may be download the one that suits your liferay version.

It has a java class
com.liferay.sevencogs.hook.upgrade.v1_0_0.UpgradeCompany

so you can checkout the method
addJournalArticle(...)
on how to use the api
It basically reads from xml and adds them as journal article. All resources are present in it.

Hope it helps