Example usage for com.liferay.portal.kernel.service LayoutSetPrototypeLocalServiceUtil getLayoutSetPrototypeByUuidAndCompanyId

List of usage examples for com.liferay.portal.kernel.service LayoutSetPrototypeLocalServiceUtil getLayoutSetPrototypeByUuidAndCompanyId

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service LayoutSetPrototypeLocalServiceUtil getLayoutSetPrototypeByUuidAndCompanyId.

Prototype

public static com.liferay.portal.kernel.model.LayoutSetPrototype getLayoutSetPrototypeByUuidAndCompanyId(
        String uuid, long companyId) throws com.liferay.portal.kernel.exception.PortalException 

Source Link

Document

Returns the layout set prototype with the matching UUID and company.

Usage

From source file:com.liferay.layout.set.prototype.exportimport.test.LayoutSetPrototypeExportImportTest.java

License:Open Source License

protected void exportImportLayoutSetPrototype(boolean layoutPrototype) throws Exception {

    // Exclude default site templates

    LayoutSetPrototypeLocalServiceUtil.deleteLayoutSetPrototypes();

    LayoutSetPrototype exportedLayoutSetPrototype = LayoutTestUtil
            .addLayoutSetPrototype(RandomTestUtil.randomString());

    Group exportedLayoutSetPrototypeGroup = exportedLayoutSetPrototype.getGroup();

    if (layoutPrototype) {
        LayoutPrototype exportedLayoutPrototype = LayoutTestUtil
                .addLayoutPrototype(RandomTestUtil.randomString());

        LayoutTestUtil.addLayout(exportedLayoutSetPrototypeGroup, true, exportedLayoutPrototype, true);
    } else {//from  w ww  .j a v  a  2 s . c  o  m
        LayoutTestUtil.addLayout(exportedLayoutSetPrototypeGroup, true);
    }

    exportImportPortlet(LayoutSetPrototypePortletKeys.LAYOUT_SET_PROTOTYPE);

    LayoutSetPrototype importedLayoutSetPrototype = LayoutSetPrototypeLocalServiceUtil
            .getLayoutSetPrototypeByUuidAndCompanyId(exportedLayoutSetPrototype.getUuid(),
                    exportedLayoutSetPrototype.getCompanyId());

    Group importedLayoutSetPrototypeGroup = importedLayoutSetPrototype.getGroup();

    Assert.assertEquals(exportedLayoutSetPrototypeGroup.getPrivateLayoutsPageCount(),
            importedLayoutSetPrototypeGroup.getPrivateLayoutsPageCount());
}