Forums de discussion

[SOLVED] Update expando row

thumbnail
José Manuel Domínguez Romero, modifié il y a 14 années.

[SOLVED] Update expando row

Regular Member Publications: 219 Date d'inscription: 03/02/10 Publications récentes
Hello Community,

I'm doing a portlet that uses Expando to create a virtual table. I have everything prepared to add and to eliminate records but not the edition of these.

I have consulted enough information, including Raymond Auge's marvellous article (thank you very much) but regarding to edit values, do not understand it completely.

Please, someone might help me to clarify since the update of a value is done?

Thanks and regards.
thumbnail
Juan Fernández, modifié il y a 14 années.

RE: Update expando row

Liferay Legend Publications: 1261 Date d'inscription: 02/10/08 Publications récentes
Hi José Manuel:
I don't really understand your question.
I suppose you're extending a portal model (user, blog entry, group or whatever) by adding custom fields. To update those fields, you just have to use the code provided by Ray in his article:
user.getExpandoBridge().setAttribute("company-name", "My Company");


Is this what you were looking for?
If not, please excuse me and give more details emoticon
Regards
Juan Fernández
thumbnail
José Manuel Domínguez Romero, modifié il y a 14 années.

RE: Update expando row

Regular Member Publications: 219 Date d'inscription: 03/02/10 Publications récentes
Hi Juan,

Thank you first of all. I have created a portlet who sends mails to a few admins (not users of Liferay) entrusted to give information, depending on a few factors.

The virtual table must not be a Liferay's part for certain circunstances, and I have created this one for hold the admins and emails address with:

ExpandoTableLocalServiceUtil.addTable


I have added columns to the table using:

ExpandoColumnLocalServiceUtil.addColumn


To add values I use:

ExpandoValueLocalServiceUtil.addValue


Finally, for eliminate values:

ExpandoRowLocalServiceUtil.deleteRow


Nevertheless, to edit, I do not still have the concept clear.

Regards.
thumbnail
Juan Fernández, modifié il y a 14 années.

RE: Update expando row

Liferay Legend Publications: 1261 Date d'inscription: 02/10/08 Publications récentes
Ok, I understand better.
The point now is: you're creating a new "object", let's call it (administrators) with the userId and his email, and you want to store it and access it as any other Liferay object.

Question: why don't you create a complete model service (starting with its definition in the service.xml) using the Service Builder so that you get all the methods to access, update and delete your objects? Would it be valid in your use case?

I think this can be a better approach to your problem

Regards
Juan Fernández
thumbnail
José Manuel Domínguez Romero, modifié il y a 14 années.

RE: Update expando row

Regular Member Publications: 219 Date d'inscription: 03/02/10 Publications récentes
It is a possible solution and probably the one that we will apply if we do not manage to work well with I Expand.

Probably this solution that you propose is the best, though in our case and for the restrictions that we have, we do not still have other one that to continue it trying(meaning) with I Expand.

We remain with Service Builder as alternative.

Thank you very much Juan.
thumbnail
José Manuel Domínguez Romero, modifié il y a 14 années.

RE: Update expando row (Réponse)

Regular Member Publications: 219 Date d'inscription: 03/02/10 Publications récentes
Ok. I had the solution ahead and did not see her... emoticon

I just get the classPK of the row, which value I want to update. Later I use ExpandoValueLocalServiceUtil.addValue spending to him as parameters, the obtained classPK and the name of the column. That's all!

Regards.