Liferay 6 Development Documentation
portletConfig.getPortletName(), themeDisplay.getPlid(), PortletRequest.RENDER_PHASE); } } portletURL.setWindowState(WindowState.MAXIMIZED); portletURL.setParameter(\portletURL.setParameter(\portletURL.setParameter(\return portletURL.toString(); 17. Update struts-config-ext.xml
File path: /myliferay-ext/docroot/WEB-INF/ext-web/docroot/WEB-INF/struts-config-ext.xml
struts-config
PUBLIC
\
Software
Foundation//DTD
Struts
Configuration
1.2//EN\
\
18. Add ProductDeleteAction.java File path: /myliferay-ext/docroot/WEB-INF/ext-impl/src/com/accentrix/ecatalog/product/action/ProductDeleteAction.java /** * */ Liferay 6 Development Documentation package com.accentrix.ecatalog.product.action; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletConfig; import javax.portlet.PortletRequest; import javax.portlet.WindowState; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import com.accentrix.ecatalog.product.service.ProductLocalServiceUtil; import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.struts.PortletAction; import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.util.WebKeys; import com.liferay.portlet.ActionRequestImpl; import com.liferay.portlet.PortletURLImpl; /** * @author tom.wu * */ public class ProductDeleteAction extends PortletAction { @Override public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { protected String getRedirctURL(PortletConfig portletConfig, ActionRequest actionRequest) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); PortletURLImpl portletURL = new PortletURLImpl((ActionRequestImpl) actionRequest, } String[] productUuids = StringUtil.split(ParamUtil.getString(actionRequest, \if (productUuids != null) { } String url = this.getRedirctURL(portletConfig, actionRequest); super.sendRedirect(actionRequest, actionResponse, url); for (int i = 0; i < productUuids.length; i++) { } ProductLocalServiceUtil.deleteProduct(productUuids[i]); portletConfig.getPortletName(), themeDisplay.getPlid(), PortletRequest.RENDER_PHASE); portletURL.setWindowState(WindowState.MAXIMIZED); portletURL.setParameter(\ Liferay 6 Development Documentation } } return portletURL.toString(); 19. Update products.jsp a) b) c) Add “Delete” button Add checkbox for each search result Add JavaScript for checkbox File path: /myliferay-ext/docroot/WEB-INF/ext-web/docroot/html/portlet/product/products.jsp <%@ include file=\ <%@taglib uri=\ <%@ page import=\<%@ page import=\<% ProductSearch searchContainer = (ProductSearch) request.getAttribute(\ searchContainer.setRowChecker(new RowChecker(renderResponse)); //add checkbox to each row String name = ParamUtil.getString(request, \%> action=\ searchURL %>\ method=\ name=\ onSubmit='<%= renderResponse.getNamespace() + \ themeDisplay.getPathThemeImages() + \ ' type=\ value='<%= LanguageUtil.format(pageContext, \ type=\ value=\ Liferay 6 Development Documentation function />productForm.action=\ name=\ value=\ windowState=\ currentURL %>\ function document. document. Liferay.provide( window, ' if (confirm('<%= UnicodeLanguageUtil.get(pageContext, } \ document. Liferay.Util.listCheckedExcept(document. ); }, ['liferay-util-list-fields'] submitForm(document. \} 20. Update struts-config-ext.xml File path: /myliferay-ext/docroot/WEB-INF/ext-web/docroot/WEB-INF/struts-config-ext.xml path=\ type=\ scope=\ name=\ name=\ name=\ 6. FAQ(Frequent Asked Questions) 1. [Question] How to deploy Liferay on different container such as JBoss? [Answer] According the admin document, Liferay could be deploy to JBoss. Page 37 in 2. [Question] How to configure Liferay to use non-embedded