掲示板

Is it possible to add extra columns in a default liferay table?

thumbnail
9年前 に Arunjyoti Banik によって更新されました。

Is it possible to add extra columns in a default liferay table?

Junior Member 投稿: 74 参加年月日: 14/08/26 最新の投稿
I know by service builder I can add an entire custom table but is it possible to add extra columns in a default liferay table?
if yes, how? any documentation I can read will be very helpful.
thumbnail
9年前 に Jeffrey Paul Handa によって更新されました。

RE: Is it possible to add extra columns in a default liferay table?

Liferay Master 投稿: 541 参加年月日: 08/12/01 最新の投稿
Hi Arunjyoti,

If you're looking to extend a Liferay defined entity, take a look at Custom Fields (Expandos). They allow you to easily add new data to an existing Liferay defined entity without modifying the database.

https://www.liferay.com/documentation/liferay-portal/6.2/user-guide/-/ai/custom-fields-liferay-portal-6-2-user-guide-17-en
thumbnail
9年前 に Arunjyoti Banik によって更新されました。

RE: Is it possible to add extra columns in a default liferay table?

Junior Member 投稿: 74 参加年月日: 14/08/26 最新の投稿
Thanks Paul.

I knew expandotable are the easiest way for this but I just wanted to know whether it can be done. Because I cant figure out what is this dynamicquery used for.
thumbnail
9年前 に Jeffrey Paul Handa によって更新されました。

RE: Is it possible to add extra columns in a default liferay table?

Liferay Master 投稿: 541 参加年月日: 08/12/01 最新の投稿
Arunjyoti Banik:
Because I cant figure out what is this dynamicquery used for.


There is a Liferay Developer Network article that discusses Liferay's DynamicQuery API.
thumbnail
9年前 に Arunjyoti Banik によって更新されました。

RE: Is it possible to add extra columns in a default liferay table?

Junior Member 投稿: 74 参加年月日: 14/08/26 最新の投稿
And Sorry I forgot to mention, I want to create custom field for PasswordPolicy table but I cant find PasswordPolicy as resource for creating custom fields. Can you help please.
thumbnail
9年前 に Jeffrey Paul Handa によって更新されました。

RE: Is it possible to add extra columns in a default liferay table?

Liferay Master 投稿: 541 参加年月日: 08/12/01 最新の投稿
Ah, in that case you would need to extend the Liferay service (table), but to do that you'd actually create a second service that references the first. This used to be the approach before Expandos. This wiki article should still be relevant: https://www.liferay.com/community/wiki/-/wiki/Main/Extend+Liferay+Tables

Never modify any Liferay tables directly. It will definitely cause problems in the future.
thumbnail
9年前 に Arunjyoti Banik によって更新されました。

RE: Is it possible to add extra columns in a default liferay table?

Junior Member 投稿: 74 参加年月日: 14/08/26 最新の投稿
Hiii Jeffrey,

Sorry for replying 2 months later. I did it as you said with expandos, I just created them programmatically. As a matter of fact, I realised any object for which getExpandoBridge() method comes, we can create custom field for that resource.

Thanks again for your help emoticon

Arun