Example usage for com.liferay.portal.kernel.model LayoutConstants TYPE_EMBEDDED

List of usage examples for com.liferay.portal.kernel.model LayoutConstants TYPE_EMBEDDED

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model LayoutConstants TYPE_EMBEDDED.

Prototype

String TYPE_EMBEDDED

To view the source code for com.liferay.portal.kernel.model LayoutConstants TYPE_EMBEDDED.

Click Source Link

Usage

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsSupportsEmbeddedPortletsWithTypeEmbedded() {
    _layout.setType(LayoutConstants.TYPE_EMBEDDED);

    Assert.assertTrue(_layout.isSupportsEmbeddedPortlets());
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypeEmbeddedReturnsFalse() {
    for (String type : _TYPES) {
        if (type.equals(LayoutConstants.TYPE_EMBEDDED)) {
            continue;
        }/*w  w  w .jav  a 2  s. c o  m*/

        _layout.setType(type);

        Assert.assertFalse(_layout.isTypeEmbedded());
    }
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypeEmbeddedReturnsTrue() {
    _layout.setType(LayoutConstants.TYPE_EMBEDDED);

    Assert.assertTrue(_layout.isTypeEmbedded());
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypeEmbeddedWithLayoutTypeController() throws Exception {
    Registry registry = RegistryUtil.getRegistry();

    LayoutTypeController layoutTypeController = new LayoutTypeControllerImpl(LayoutConstants.TYPE_EMBEDDED);

    for (String type : _TYPES) {
        if (type.equals(LayoutConstants.TYPE_EMBEDDED)) {
            continue;
        }//  w  w  w . j a  va  2 s  .c  om

        _layout.setType(type);

        Map<String, Object> properties = new HashMap<>();

        properties.put("layout.type", type);

        ServiceRegistration<LayoutTypeController> serviceRegistration = registry
                .registerService(LayoutTypeController.class, layoutTypeController, properties);

        try {
            Assert.assertTrue(_layout.isTypeEmbedded());
        } finally {
            serviceRegistration.unregister();
        }
    }
}

From source file:com.liferay.tool.datamanipulator.handler.content.LayoutHandler.java

License:Open Source License

private List<KeyValuePair> _getLayoutTypes() {
    List<KeyValuePair> layoutTypes = new ArrayList<KeyValuePair>();

    layoutTypes.add(new KeyValuePair("", ""));

    layoutTypes.add(new KeyValuePair(LayoutConstants.TYPE_ARTICLE, LayoutConstants.TYPE_ARTICLE));

    layoutTypes.add(new KeyValuePair(LayoutConstants.TYPE_EMBEDDED, LayoutConstants.TYPE_EMBEDDED));

    layoutTypes.add(new KeyValuePair(LayoutConstants.TYPE_PANEL, LayoutConstants.TYPE_PANEL));

    layoutTypes.add(new KeyValuePair(LayoutConstants.TYPE_PORTLET, LayoutConstants.TYPE_PORTLET));

    return layoutTypes;
}