Example usage for com.liferay.portal.kernel.service LayoutPrototypeLocalServiceUtil fetchLayoutPrototypeByUuidAndCompanyId

List of usage examples for com.liferay.portal.kernel.service LayoutPrototypeLocalServiceUtil fetchLayoutPrototypeByUuidAndCompanyId

Introduction

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

Prototype

public static com.liferay.portal.kernel.model.LayoutPrototype fetchLayoutPrototypeByUuidAndCompanyId(
        String uuid, long companyId) 

Source Link

Document

Returns the layout prototype with the matching UUID and company.

Usage

From source file:com.liferay.layout.prototype.internal.exportimport.data.handler.test.LayoutPrototypeStagedModelDataHandlerTest.java

License:Open Source License

@After
@Override/* w  w  w.  j a  v a2 s.c om*/
public void tearDown() throws Exception {
    super.tearDown();

    if (_layoutPrototype != null) {
        _layoutPrototype = LayoutPrototypeLocalServiceUtil.fetchLayoutPrototypeByUuidAndCompanyId(
                _layoutPrototype.getUuid(), _layoutPrototype.getCompanyId());

        LayoutPrototypeLocalServiceUtil.deleteLayoutPrototype(_layoutPrototype);
    }
}

From source file:com.liferay.layout.prototype.internal.exportimport.data.handler.test.LayoutPrototypeStagedModelDataHandlerTest.java

License:Open Source License

@Override
protected StagedModel getStagedModel(String uuid, Group group) {
    try {/*from  w w  w  .  j  a va 2  s.c  om*/
        return LayoutPrototypeLocalServiceUtil.fetchLayoutPrototypeByUuidAndCompanyId(uuid,
                group.getCompanyId());
    } catch (Exception e) {
        return null;
    }
}

From source file:com.liferay.layout.set.prototype.exportimport.data.handler.test.LayoutSetPrototypeStagedModelDataHandlerTest.java

License:Open Source License

@After
@Override/*from   w w  w . j av  a2 s  .  c o  m*/
public void tearDown() throws Exception {
    super.tearDown();

    if (_layoutSetPrototype != null) {
        _layoutSetPrototype = LayoutSetPrototypeLocalServiceUtil.fetchLayoutSetPrototypeByUuidAndCompanyId(
                _layoutSetPrototype.getUuid(), _layoutSetPrototype.getCompanyId());

        LayoutSetPrototypeLocalServiceUtil.deleteLayoutSetPrototype(_layoutSetPrototype);
    }

    if (_layoutPrototype != null) {
        _layoutPrototype = LayoutPrototypeLocalServiceUtil.fetchLayoutPrototypeByUuidAndCompanyId(
                _layoutPrototype.getUuid(), _layoutPrototype.getCompanyId());

        LayoutPrototypeLocalServiceUtil.deleteLayoutPrototype(_layoutPrototype);
    }
}

From source file:com.liferay.layout.set.prototype.exportimport.data.handler.test.LayoutSetPrototypeStagedModelDataHandlerTest.java

License:Open Source License

protected LayoutPrototype getImportedLayoutPrototype(Map<String, List<StagedModel>> dependentStagedModelsMap,
        Group group) throws Exception {

    List<StagedModel> dependentLayoutPrototypeStagedModels = dependentStagedModelsMap
            .get(LayoutPrototype.class.getSimpleName());

    Assert.assertEquals(dependentLayoutPrototypeStagedModels.toString(), 1,
            dependentLayoutPrototypeStagedModels.size());

    LayoutPrototype layoutPrototype = (LayoutPrototype) dependentLayoutPrototypeStagedModels.get(0);

    LayoutPrototype importedLayoutPrototype = LayoutPrototypeLocalServiceUtil
            .fetchLayoutPrototypeByUuidAndCompanyId(layoutPrototype.getUuid(), group.getCompanyId());

    Assert.assertNotNull(importedLayoutPrototype);

    return importedLayoutPrototype;
}