Example usage for com.liferay.portal.kernel.theme ThemeDisplay setLayoutSet

List of usage examples for com.liferay.portal.kernel.theme ThemeDisplay setLayoutSet

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.theme ThemeDisplay setLayoutSet.

Prototype

public void setLayoutSet(LayoutSet layoutSet) 

Source Link

Usage

From source file:com.liferay.journal.search.test.JournalArticleIndexerSummaryTest.java

License:Open Source License

protected ThemeDisplay createThemeDisplay(HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse) throws Exception {

    ThemeDisplay themeDisplay = new ThemeDisplay();

    themeDisplay.setCompany(CompanyLocalServiceUtil.getCompany(_group.getCompanyId()));
    themeDisplay.setLayout(LayoutTestUtil.addLayout(_group));

    LayoutSet layoutSet = _group.getPublicLayoutSet();

    themeDisplay.setLayoutSet(layoutSet);

    Theme theme = ThemeLocalServiceUtil.getTheme(_group.getCompanyId(), layoutSet.getThemeId());

    themeDisplay.setLookAndFeel(theme, null);

    themeDisplay.setRealUser(_user);//from   w  w  w.  ja v  a 2s. co  m
    themeDisplay.setRequest(httpServletRequest);
    themeDisplay.setResponse(httpServletResponse);
    themeDisplay.setTimeZone(TimeZoneUtil.getDefault());
    themeDisplay.setUser(_user);

    return themeDisplay;
}

From source file:com.liferay.layout.type.controller.test.LayoutTypeURLTest.java

License:Open Source License

private ThemeDisplay _initThemeDisplay() throws Exception {
    _company.setVirtualHostname(_VIRTUAL_HOSTNAME);

    ThemeDisplay themeDisplay = new ThemeDisplay();

    themeDisplay.setCompany(_company);// w w  w  .  j av a2  s  .  c o  m
    themeDisplay.setI18nLanguageId(StringPool.BLANK);
    themeDisplay.setLayout(_publicLayout);
    themeDisplay.setLayoutSet(_publicLayout.getLayoutSet());
    themeDisplay.setSecure(false);
    themeDisplay.setServerName(_VIRTUAL_HOSTNAME);
    themeDisplay.setServerPort(8080);
    themeDisplay.setSiteGroupId(_group.getGroupId());
    themeDisplay.setUser(TestPropsValues.getUser());
    themeDisplay.setWidget(false);

    return themeDisplay;
}