diff --git a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/constants/SamplePortletKeys.java b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/constants/TaglibSamplePortletKeys.java similarity index 71% rename from modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/constants/SamplePortletKeys.java rename to modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/constants/TaglibSamplePortletKeys.java index d6ff8d1e41a639..7a21c8641ec58e 100644 --- a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/constants/SamplePortletKeys.java +++ b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/constants/TaglibSamplePortletKeys.java @@ -8,12 +8,12 @@ /** * @author Miguel Arroyo */ -public class SamplePortletKeys { - - public static final String SAMPLE_PORTLET = - "com_liferay_sample_web_portlet_SamplePortlet"; +public class TaglibSamplePortletKeys { public static final String SEARCH_PAGINATOR_DISPLAY_CONTEXT = "SEARCH_PAGINATOR_DISPLAY_CONTEXT"; + public static final String TAGLIB_SAMPLE_PORTLET = + "com_liferay_sample_web_portlet_TaglibSamplePortlet"; + } \ No newline at end of file diff --git a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/display/context/SearchPaginatorDisplayContext.java b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/display/context/SearchPaginatorDisplayContext.java index ad3621d057a782..8eed485613cc0e 100644 --- a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/display/context/SearchPaginatorDisplayContext.java +++ b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/display/context/SearchPaginatorDisplayContext.java @@ -7,7 +7,7 @@ import com.liferay.frontend.taglib.clay.servlet.taglib.util.DropdownItem; import com.liferay.frontend.taglib.clay.servlet.taglib.util.DropdownItemBuilder; -import com.liferay.frontend.taglib.sample.web.internal.constants.SamplePortletKeys; +import com.liferay.frontend.taglib.sample.web.internal.constants.TaglibSamplePortletKeys; import com.liferay.portal.kernel.dao.search.SearchContainer; import com.liferay.portal.kernel.dao.search.SearchPaginationUtil; import com.liferay.portal.kernel.portlet.LiferayPortletRequest; @@ -51,11 +51,11 @@ public SearchContainer getSearchContainer() { searchContainer.setId("DropdownItemSearchContainer"); searchContainer.setOrderByCol( SearchOrderByUtil.getOrderByCol( - _renderRequest, SamplePortletKeys.SAMPLE_PORTLET, + _renderRequest, TaglibSamplePortletKeys.TAGLIB_SAMPLE_PORTLET, "order-by-col", "name")); searchContainer.setOrderByType( SearchOrderByUtil.getOrderByType( - _renderRequest, SamplePortletKeys.SAMPLE_PORTLET, + _renderRequest, TaglibSamplePortletKeys.TAGLIB_SAMPLE_PORTLET, "order-by-type", "asc")); List dropdownItems = new ArrayList<>(); diff --git a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/portlet/SamplePortlet.java b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/portlet/TaglibSamplePortlet.java similarity index 90% rename from modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/portlet/SamplePortlet.java rename to modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/portlet/TaglibSamplePortlet.java index ec7d0241b67496..f2ce0df9053d73 100644 --- a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/portlet/SamplePortlet.java +++ b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/portlet/TaglibSamplePortlet.java @@ -5,7 +5,7 @@ package com.liferay.frontend.taglib.sample.web.internal.portlet; -import com.liferay.frontend.taglib.sample.web.internal.constants.SamplePortletKeys; +import com.liferay.frontend.taglib.sample.web.internal.constants.TaglibSamplePortletKeys; import com.liferay.frontend.taglib.sample.web.internal.display.context.SearchPaginatorDisplayContext; import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet; import com.liferay.portal.kernel.util.Portal; @@ -37,14 +37,14 @@ "javax.portlet.expiration-cache=0", "javax.portlet.init-param.template-path=/META-INF/resources/", "javax.portlet.init-param.view-template=/view.jsp", - "javax.portlet.name=" + SamplePortletKeys.SAMPLE_PORTLET, + "javax.portlet.name=" + TaglibSamplePortletKeys.TAGLIB_SAMPLE_PORTLET, "javax.portlet.resource-bundle=content.Language", "javax.portlet.security-role-ref=power-user,user", "javax.portlet.version=3.0" }, service = Portlet.class ) -public class SamplePortlet extends MVCPortlet { +public class TaglibSamplePortlet extends MVCPortlet { @Override public void doDispatch( @@ -52,7 +52,7 @@ public void doDispatch( throws IOException, PortletException { renderRequest.setAttribute( - SamplePortletKeys.SEARCH_PAGINATOR_DISPLAY_CONTEXT, + TaglibSamplePortletKeys.SEARCH_PAGINATOR_DISPLAY_CONTEXT, new SearchPaginatorDisplayContext( _portal, renderRequest, renderResponse)); diff --git a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/resources/META-INF/resources/init.jsp b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/resources/META-INF/resources/init.jsp index b6edd62d3ed586..696f751dce222d 100644 --- a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/resources/META-INF/resources/init.jsp +++ b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/resources/META-INF/resources/init.jsp @@ -11,7 +11,7 @@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %><%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %><%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %> -<%@ page import="com.liferay.frontend.taglib.sample.web.internal.constants.SamplePortletKeys" %><%@ +<%@ page import="com.liferay.frontend.taglib.sample.web.internal.constants.TaglibSamplePortletKeys" %><%@ page import="com.liferay.frontend.taglib.sample.web.internal.display.context.SearchPaginatorDisplayContext" %> \ No newline at end of file diff --git a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/resources/META-INF/resources/partials/search_paginator.jsp b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/resources/META-INF/resources/partials/search_paginator.jsp index 629bcc66c1c9b1..32d932d4fe24e3 100644 --- a/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/resources/META-INF/resources/partials/search_paginator.jsp +++ b/modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/resources/META-INF/resources/partials/search_paginator.jsp @@ -8,7 +8,7 @@ <%@ include file="/init.jsp" %> <% -SearchPaginatorDisplayContext searchPaginatorDisplayContext = (SearchPaginatorDisplayContext)request.getAttribute(SamplePortletKeys.SEARCH_PAGINATOR_DISPLAY_CONTEXT); +SearchPaginatorDisplayContext searchPaginatorDisplayContext = (SearchPaginatorDisplayContext)request.getAttribute(TaglibSamplePortletKeys.SEARCH_PAGINATOR_DISPLAY_CONTEXT); %> diff --git a/modules/test/playwright/tests/frontend-taglib/frontend-taglib-sample-web/searchPaginator.spec.ts b/modules/test/playwright/tests/frontend-taglib/searchPaginator.spec.ts similarity index 77% rename from modules/test/playwright/tests/frontend-taglib/frontend-taglib-sample-web/searchPaginator.spec.ts rename to modules/test/playwright/tests/frontend-taglib/searchPaginator.spec.ts index 965394197fc9a6..37cf8b8668e794 100644 --- a/modules/test/playwright/tests/frontend-taglib/frontend-taglib-sample-web/searchPaginator.spec.ts +++ b/modules/test/playwright/tests/frontend-taglib/searchPaginator.spec.ts @@ -5,13 +5,14 @@ import {Locator, expect, mergeTests} from '@playwright/test'; -import {apiHelpersTest} from '../../../fixtures/apiHelpersTest'; -import {featureFlagsTest} from '../../../fixtures/featureFlagsTest'; -import {isolatedSiteTest} from '../../../fixtures/isolatedSiteTest'; -import {loginTest} from '../../../fixtures/loginTest'; -import getRandomString from '../../../utils/getRandomString'; -import getPageDefinition from '../../layout-content-page-editor-web/utils/getPageDefinition'; -import getWidgetDefinition from '../../layout-content-page-editor-web/utils/getWidgetDefinition'; +import {apiHelpersTest} from '../../fixtures/apiHelpersTest'; +import {featureFlagsTest} from '../../fixtures/featureFlagsTest'; +import {isolatedSiteTest} from '../../fixtures/isolatedSiteTest'; +import {liferayConfig} from '../../liferay.config'; +import {loginTest} from '../../fixtures/loginTest'; +import getRandomString from '../../utils/getRandomString'; +import getPageDefinition from '../layout-content-page-editor-web/utils/getPageDefinition'; +import getWidgetDefinition from '../layout-content-page-editor-web/utils/getWidgetDefinition'; export const test = mergeTests( apiHelpersTest, @@ -31,7 +32,7 @@ test( await test.step('Create a content site and the frontend taglib sample widget', async () => { const widgetDefinition = getWidgetDefinition({ id: getRandomString(), - widgetName: 'com_liferay_sample_web_portlet_SamplePortlet', + widgetName: 'com_liferay_sample_web_portlet_TaglibSamplePortlet', }); await apiHelpers.headlessDelivery.createSitePage({ @@ -39,6 +40,10 @@ test( siteId: site.id, title: getRandomString(), }); + + await page.goto( + `${liferayConfig.environment.baseUrl}/web${site.friendlyUrlPath}` + ); }); await test.step('Open navigator dropdown', async () => {