<%-- ================================================================= Licensed Materials - Property of IBM WebSphere Commerce (C) Copyright IBM Corp. 2011, 2016 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ================================================================= --%> <%-- ***** * SEOSitemap.jsp generates all the SEO URLs for static pages that a store admin want to be indexed by Google search engine. * This JSP is invoked by the SiteMapGenerateCmd, when 'SEO' feature is enabled for the particular store. * This file does not generate the catalog related SEO URLs. * parameters: * storeId: the storeId of the store to which the sitemap file is generated. * catalogIds: list of catalog Ids that belong to this store. ***** --%> <%@ page import="com.ibm.commerce.datatype.TypedProperty" %> <%@ page import="java.util.*" %> <%@ page import="java.net.URLEncoder"%> <%@ page contentType="text/xml" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://commerce.ibm.com/base" prefix="wcbase"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <%@ taglib uri="http://commerce.ibm.com/foundation" prefix="wcf" %> <%@ taglib uri="flow.tld" prefix="flow" %> <%@ include file="Common/RestConfigSetup.jspf" %> <%-- *** * Retrieve parameters for deciding how many URLs to create and the beginning index for the current iteration. *** --%> <%-- *** * If the sitemapGenerate command is executed on a staging server, then the command need pass hostName to the jsp, where * hostName is the serverName which will be hosting the sitemap xml file to be generated. *** --%> <%-- *** * Get storeId and create storeDB *** --%> <%-- Generate a list of language names (index matches with that of the storeDB.supportedLanguages) --%> <% TypedProperty prop = (TypedProperty)request.getAttribute("RequestProperties"); // For remote store, the map is transferreds as a string. Object langIdsToNameObj = prop.get("languageIdsToName"); HashMap languageIdsToName = null; if(langIdsToNameObj instanceof String[]) { String langIdsToNameStr = ((String[])langIdsToNameObj)[0]; String[] mapArray = langIdsToNameStr.split(","); languageIdsToName = new HashMap(); for(int i=0;i< mapArray.length;i++) { String[] map = mapArray[i].trim().split("="); languageIdsToName.put(map[0], map[1]); } } else { languageIdsToName = (HashMap)langIdsToNameObj; } List languageIds = (List)pageContext.getAttribute("languageIds"); List languageNames = (List)pageContext.getAttribute("languageNames"); for (HashMap dbLanguage : languageIds) { languageNames.add(languageIdsToName.get(dbLanguage.get("languageId").toString())); } %> <%-- *** * The master catalog will be used if no catalogId is provided in the request *** --%> <%-- *** * Begin generate URLs for views TopCategoriesDisplay for each catalogId. *** --%> <%-- *** * For Each language supported by the store, generate URLs for view: * TopCategoriesDisplay *** --%> <%-- languageURLs is a List of HashMaps, each HashMap has two keys: url and lang. --%> <%-- Generate alternate language tags (xhtml), this will be the same for all URL tags with the same catalog id. --%> ${alternateLanguageTags} <%-- *** * End of topCategoriesDisplay *** --%> <%-- *** * For Each language supported by the store, generate URLs for content pages from Composer such as: * help, about us, contact us, etc. * Only need generate URLs with one catalogId. *** --%> <%-- *** * begin of page *** --%> <%-- languageURLs is a List of HashMaps, each HashMap has two keys: url and lang. --%> <%-- Generate alternate language tags (xhtml), this value will be the same for each URL with the same page --%> ${alternateLanguageTags} <%-- *** * End of page *** --%> <%-- *** * End of for Each language supported by the store, generate URLs for content pages from Composer such as: * help, about us, contact us, etc. *** --%> <%-- End - JSP File Name: SEOSitemap.jsp --%>