留言板

New liferay 7 API

thumbnail
Miguel Ángel Júlvez,修改在7 年前。

New liferay 7 API

Junior Member 帖子: 63 加入日期: 11-3-29 最近的帖子
Hi,

is posible to have two different layouts with the same uuid in the same company in liferay 7?

I don't see in the new API the old function getLayoutByUuidAndCompanyId(uuid, companyId) . However this other function exits getLayoutsByUuidAndCompanyId(uuid, companyId) that returns a List<Layout>.

Besides, there's this other function getLayoutByUuidAndGroupId(uuid,groupId,isPrivateLayout) , so ¿is even posible to have the same uuid in the same group for a layout, but one public and another private?

Thanks
thumbnail
Jorge Díaz,修改在7 年前。

RE: New liferay 7 API

Liferay Master 帖子: 753 加入日期: 14-1-9 最近的帖子
Hi Miguel,

UUID is unique at group level, as it is used to link objects during LAR/Staging export/import.
UUID is not recalculated in export/import operations, so when you import a LAR in a site, it will update the existing object that have the same UUID, with newer information.
So at company level you can have two objects with same uuid in case you execute a LAR export/import between two sites of same company or you active staging local.

About 6.2 method getLayoutByUuidAndCompanyId(uuid, companyId), it was changed to new getLayoutsByUuidAndCompanyId(uuid, companyId) because it was wrong as you can have more than one Layout with same UUID in one company. (It was not changed until 7.0, as we cannot change the API in a released version)

About getLayoutByUuidAndGroupId(uuid,groupId,isPrivateLayout) it is not possible in one group to have two layouts (one private and one public) with same uuid. I think that method is provided by convenience, allowing to filter by that extra parameter (isPrivateLayout)
thumbnail
Miguel Ángel Júlvez,修改在7 年前。

RE: New liferay 7 API

Junior Member 帖子: 63 加入日期: 11-3-29 最近的帖子
Cheers Jorge!! Crystal-clear.