Foros de discusión

New liferay 7 API

thumbnail
Miguel Ángel Júlvez, modificado hace 7 años.

New liferay 7 API

Junior Member Mensajes: 63 Fecha de incorporación: 29/03/11 Mensajes recientes
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, modificado hace 7 años.

RE: New liferay 7 API

Liferay Master Mensajes: 753 Fecha de incorporación: 9/01/14 Mensajes recientes
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, modificado hace 7 años.

RE: New liferay 7 API

Junior Member Mensajes: 63 Fecha de incorporación: 29/03/11 Mensajes recientes
Cheers Jorge!! Crystal-clear.