// start setting of spotlight public void spotLightTranslate( Node slNode, Element spElement, String locale, Map<String, String> urlMap) { try { Element spotLightTitle = spElement.getElementsByTag("h2").first(); Element spotLightDescription = spElement.getElementsByTag("p").first(); Elements spotLightAnchorElements = spElement.getElementsByTag("a"); Element spotLightAnchor = spotLightAnchorElements.first(); // start image String spotLightImage = FrameworkUtils.extractImagePath(spElement, sb); log.debug("spotLightImage " + spotLightImage + "\n"); if (slNode != null) { if (slNode.hasNode("image")) { Node spotLightImageNode = slNode.getNode("image"); String fileReference = spotLightImageNode.hasProperty("fileReference") ? spotLightImageNode.getProperty("fileReference").getString() : ""; spotLightImage = FrameworkUtils.migrateDAMContent(spotLightImage, fileReference, locale, sb); log.debug("spotLightImage " + spotLightImage + "\n"); if (StringUtils.isNotBlank(spotLightImage)) { spotLightImageNode.setProperty("fileReference", spotLightImage); } else { sb.append("<li> Image not found for spot light component on locale page. </li>"); } } else { sb.append("<li>spotlight image node doesn't exist</li>"); } } // end image if (spotLightDescription.getElementsByTag("a") != null && !spotLightDescription.getElementsByTag("a").isEmpty()) { slNode.setProperty("description", spotLightDescription.html()); // start if (spotLightAnchorElements.size() > 1) { spotLightAnchor = spotLightAnchorElements.get(1); } else { spotLightAnchor = null; sb.append( "<li>Link is not found on locale page for the spotlight component. This needs to be deleted manually.</li>"); } // end } else { slNode.setProperty("description", spotLightDescription.text()); } if (spotLightAnchor != null) { String linkText = spotLightAnchor.text(); String linkUrl = spotLightAnchor.absUrl("href"); if (StringUtil.isBlank(linkUrl)) { linkUrl = spotLightAnchor.attr("href"); } // Start extracting valid href log.debug("Before spotlight LinkUrl" + linkUrl + "\n"); linkUrl = FrameworkUtils.getLocaleReference(linkUrl, urlMap, locale, sb); log.debug("after spotlight LinkUrl" + linkUrl + "\n"); // End extracting valid href slNode.setProperty("linktext", linkText); javax.jcr.Node ctaNode = slNode.getNode("cta"); if (ctaNode != null) { if (linkUrl != null) { // ctaNode.setProperty("linktype", "Url"); ctaNode.setProperty("url", linkUrl); } } } if (spotLightTitle != null) { Elements spotLightLink = spotLightTitle.getElementsByTag("a"); if (spotLightLink.isEmpty()) { slNode.setProperty("title", spotLightTitle.text()); } else { Element spotLightLinkEle = spotLightLink.first(); String slLinkText = spotLightLinkEle.text(); String slLinkUrl = spotLightLinkEle.absUrl("href"); if (StringUtil.isBlank(slLinkUrl)) { slLinkUrl = spotLightLinkEle.attr("href"); } // Start extracting valid href log.debug("Before spotlight LinkUrl" + slLinkUrl + "\n"); slLinkUrl = FrameworkUtils.getLocaleReference(slLinkUrl, urlMap, locale, sb); log.debug("after spotlight LinkUrl" + slLinkUrl + "\n"); // End extracting valid href slNode.setProperty("title", slLinkText); javax.jcr.Node titleLinkNode = slNode.getNode("titlelink"); if (titleLinkNode != null) { if (slLinkUrl != null) { titleLinkNode.setProperty("linktype", "Url"); titleLinkNode.setProperty("url", slLinkUrl); } } } } log.debug("Updated title, descriptoin and linktext at " + slNode.getPath()); } catch (Exception e) { e.printStackTrace(); } }
// start setting of heropanel public void heroPanelTranslate( Node heroPanelNode, Element ele, String locale, Map<String, String> urlMap, int imageSrcEmptyCount) { try { String title = ele.getElementsByTag("h2") != null ? ele.getElementsByTag("h2").text() : ""; String desc = ele.getElementsByTag("p") != null ? ele.getElementsByTag("p").first().text() : ""; Element anchor = ele.getElementsByTag("a").first(); String anchorText = anchor != null ? anchor.text() : ""; String anchorHref = anchor.absUrl("href"); if (StringUtil.isBlank(anchorHref)) { anchorHref = anchor.attr("href"); } // Start extracting valid href log.debug("Before heroPanelLinkUrl" + anchorHref + "\n"); anchorHref = FrameworkUtils.getLocaleReference(anchorHref, urlMap, locale, sb); log.debug("after heroPanelLinkUrl" + anchorHref + "\n"); // End extracting valid href // start image String heroImage = FrameworkUtils.extractImagePath(ele, sb); log.debug("heroImage before migration : " + heroImage + "\n"); if (heroPanelNode != null) { Node heroPanelPopUpNode = null; Element lightBoxElement = null; Elements lightBoxElements = ele.select("div.c50-image").select("a.c26v4-lightbox"); heroPanelPopUpNode = FrameworkUtils.getHeroPopUpNode(heroPanelNode); lightBoxElements = !lightBoxElements.isEmpty() ? lightBoxElements : ele.select("div.c50-text").select("a.c26v4-lightbox"); if (lightBoxElements != null && !lightBoxElements.isEmpty()) { lightBoxElement = lightBoxElements.first(); } if (heroPanelPopUpNode == null && lightBoxElement != null) { sb.append( "<li>video pop up is present in WEB page but it is not present in WEM page.</li>"); } if (heroPanelPopUpNode != null && lightBoxElement == null) { sb.append( "<li>video pop up is present in WEM page but it is not present in WEB page.</li>"); } if (heroPanelPopUpNode != null && lightBoxElement != null && StringUtils.isNotBlank(title)) { heroPanelPopUpNode.setProperty("popupHeader", title); } if (heroPanelNode.hasNode("image")) { Node imageNode = heroPanelNode.getNode("image"); String fileReference = imageNode.hasProperty("fileReference") ? imageNode.getProperty("fileReference").getString() : ""; heroImage = FrameworkUtils.migrateDAMContent(heroImage, fileReference, locale, sb); log.debug("heroImage after migration : " + heroImage + "\n"); if (StringUtils.isNotBlank(heroImage)) { imageNode.setProperty("fileReference", heroImage); } else { imageSrcEmptyCount++; } } else { sb.append("<li>hero image node doesn't exist</li>"); } heroPanelNode.setProperty("title", title); heroPanelNode.setProperty("description", desc); heroPanelNode.setProperty("linktext", anchorText); heroPanelNode.setProperty("linkurl", anchorHref); } // end image if (imageSrcEmptyCount > 0) { sb.append( "<li> " + imageSrcEmptyCount + " image(s) are not found on hero elements on locale page.</li>"); } } catch (Exception e) { e.printStackTrace(); } }
private void migrateHero( Element heroElement, Node sBHeroNode, String locale, Map<String, String> urlMap, String catType, String type) throws PathNotFoundException, RepositoryException, JSONException { if (heroElement != null) { Elements heroEles = heroElement.getElementsByClass("frame"); if (heroEles != null) { int eleSize = heroEles.size(); NodeIterator heroNodes = sBHeroNode.hasNode("hero_panel") ? sBHeroNode.getNodes("hero_panel*") : null; if (heroNodes != null) { int size = (int) heroNodes.getSize(); for (Element heroEle : heroEles) { if (heroNodes.hasNext()) { Node heroPanelNode = heroNodes.nextNode(); Element title = heroEle.getElementsByTag("h2").first(); Element description = heroEle.getElementsByTag("p").first(); Element anchor = heroEle.getElementsByTag("a").first(); if (title != null) { heroPanelNode.setProperty("title", title.text()); } else { sb.append(Constants.HERO_CONTENT_HEADING_ELEMENT_DOESNOT_EXISTS); } if (description != null) { heroPanelNode.setProperty("description", description.text()); } else { sb.append(Constants.HERO_CONTENT_DESCRIPTION_ELEMENT_DOESNOT_EXISTS); } if (anchor != null) { heroPanelNode.setProperty("linktext", anchor.text()); if (heroPanelNode.hasNode("cta")) { Node ctaNode = heroPanelNode.getNode("cta"); String aUrl = anchor.absUrl("href"); if (StringUtils.isBlank(aUrl)) { aUrl = anchor.attr("href"); } aUrl = FrameworkUtils.getLocaleReference(aUrl, urlMap, locale, sb); if (!aUrl.equals("") && !aUrl.isEmpty()) { ctaNode.setProperty("url", aUrl); } else { sb.append(Constants.HERO_CONTENT_ANCHOR_LINK_IS_BLANK); } } else { sb.append(Constants.HERO_COMPONENT_CTA_NODE_NOT_FOUND); } } else { sb.append(Constants.HERO_CONTENT_ANCHOR_ELEMENT_DOESNOT_EXISTS); } if (heroPanelNode.hasNode("image")) { Node imageNode = heroPanelNode.getNode("image"); String fileReference = FrameworkUtils.extractImagePath(heroEle, sb); fileReference = FrameworkUtils.migrateDAMContent(fileReference, "", locale, sb); if (!fileReference.equals("")) { imageNode.setProperty("fileReference", fileReference); } else { sb.append(Constants.HERO_CONTENT_IMAGE_LINK_IS_BLANK); } } else { sb.append(Constants.HERO_CONTENT_IMAGE_NODE_NOT_FOUND); } } else { sb.append( Constants.MISMATCH_IN_HERO_SLIDES + "Element size is " + eleSize + " and panel nodes are " + size); } } if (heroNodes.hasNext()) { sb.append( Constants.MISMATCH_IN_HERO_SLIDES + "Element size is " + eleSize + " and panel nodes are " + size); } } else { sb.append(Constants.HERO_CONTENT_NODE_NOT_FOUND); } } else { sb.append(Constants.HERO_CONTENT_PANEL_ELEMENT_NOT_FOUND); } } else { sb.append(Constants.HERO_CONTENT_PANEL_ELEMENT_NOT_FOUND); } }
private void migrateHeroLarge( Document doc, Node trainingAndEventsLeftNode, String locale, Map<String, String> urlMap) { // TODO Auto-generated method stub try { String h2Text = ""; String pText = ""; String aText = ""; String aHref = ""; int pCount = 0; Node heroPanelNode = null; Elements heroElements = doc.select("div.c50-pilot"); if (heroElements.size() > 0) { if (!heroElements.select("div.frame").isEmpty()) { heroElements = heroElements.select("div.frame"); } Node heroNode = trainingAndEventsLeftNode.hasNode("hero_large") ? trainingAndEventsLeftNode.getNode("hero_large") : null; if (heroNode != null) { NodeIterator heroPanelNodeIterator = heroNode.hasNode("heropanel_0") ? heroNode.getNodes("heropanel*") : null; if (heroPanelNodeIterator != null) { if (heroElements != null) { int eleSize = heroElements.size(); int nodeSize = (int) heroPanelNodeIterator.getSize(); if (eleSize != nodeSize) { log.debug("Hero component node count mismatch!"); sb.append( "<li>Hero Component count mis match. Elements on page are: " + eleSize + " Node Count is: " + nodeSize + "</li>"); } for (Element ele : heroElements) { if (heroPanelNodeIterator.hasNext()) { heroPanelNode = (Node) heroPanelNodeIterator.next(); Elements h2TagText = ele.getElementsByTag("h2"); if (h2TagText != null) { h2Text = h2TagText.text(); heroPanelNode.setProperty("title", h2Text); } else { sb.append(Constants.HERO_CONTENT_HEADING_ELEMENT_DOESNOT_EXISTS); } Elements descriptionText = ele.getElementsByTag("p"); if (descriptionText != null) { if (descriptionText.size() > 2) { for (Element desEle : descriptionText) { pCount++; pText = pText + desEle.text(); if (pCount == 2) { break; } } } else { pText = descriptionText.first().text(); } heroPanelNode.setProperty("description", pText); } else { sb.append(Constants.HERO_CONTENT_DESCRIPTION_ELEMENT_DOESNOT_EXISTS); } Element anchorText = ele.getElementsByTag("a").first(); if (anchorText != null) { aText = anchorText.text(); aHref = anchorText.absUrl("href"); if (StringUtil.isBlank(aHref)) { aHref = anchorText.attr("href"); } // Start extracting valid href log.debug("Before heroPanelLinkUrl" + aHref + "\n"); aHref = FrameworkUtils.getLocaleReference(aHref, urlMap, locale, sb); log.debug("after heroPanelLinkUrl" + aHref + "\n"); // End extracting valid href heroPanelNode.setProperty("linktext", aText); heroPanelNode.setProperty("linkurl", aHref); } else { sb.append(Constants.HERO_CONTENT_ANCHOR_TEXT_IS_BLANK); } // start image String heroImage = FrameworkUtils.extractImagePath(ele, sb); log.debug("heroImage before migration : " + heroImage + "\n"); if (heroPanelNode.hasNode("image")) { Node imageNode = heroPanelNode.getNode("image"); String fileReference = imageNode.hasProperty("fileReference") ? imageNode.getProperty("fileReference").getString() : ""; heroImage = FrameworkUtils.migrateDAMContent(heroImage, fileReference, locale, sb); log.debug("heroImage after migration : " + heroImage + "\n"); if (StringUtils.isNotBlank(heroImage)) { imageNode.setProperty("fileReference", heroImage); } } else { sb.append("<li>hero image node doesn't exist</li>"); } // end image } } } else { sb.append(Constants.HERO_CONTENT_PANEL_ELEMENT_NOT_FOUND); } } else { log.debug("hero panel node is not found"); } } else { if (heroElements.isEmpty()) { log.debug("Hero Large node and elements are not found"); } else { sb.append(Constants.HERO_NODE_NOT_AVAILABLE); } } } else { sb.append("<li>Hero component not found in web url</li>"); } } catch (Exception e) { sb.append(Constants.EXCEPTOIN_IN_UPDATING_HERO_CONTENT); log.error("hero Error" + e); } }
private void migrateSpotLight( Elements spEles, Node midSizeLowerLeftNode, String locale, Map<String, String> urlMap) throws PathNotFoundException, ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException { if (spEles != null) { int elesize = spEles.size(); NodeIterator spNodes = midSizeLowerLeftNode.hasNode("spotlight_large_v2") ? midSizeLowerLeftNode.getNodes("spotlight_large_v2*") : null; if (spNodes != null) { int size = (int) spNodes.getSize(); for (Element spEle : spEles) { if (spNodes.hasNext()) { Node spNode = spNodes.nextNode(); Element title = spEle.getElementsByTag("h2").first(); if (title != null) { spNode.setProperty("title", title.text()); } else { sb.append(Constants.SPOTLIGHT_HEADING_ELEMENT_NOT_FOUND); } Element description = spEle.getElementsByTag("p").first(); if (description != null) { spNode.setProperty("description", description.text()); } else { sb.append(Constants.SPOTLIGHT_DESCRIPTION_ELEMENT_NOT_FOUND); } spEle.getElementsByTag("p").first().remove(); Elements bullets = spEle.getElementsByTag("li"); if (bullets.size() == 0) { Element bullet = spEle.getElementsByTag("p").first(); if (bullet != null && !bullet.ownText().isEmpty()) { String link = FrameworkUtils.extractHtmlBlobContent(bullet, "", locale, sb, urlMap); String bulletValue[] = {link}; spNode.setProperty("bullets", bulletValue); spEle.getElementsByTag("p").first().remove(); } else { sb.append(Constants.SPOTLIGHT_ANCHOR_ELEMENT_NOT_FOUND); } } else { List<String> list = new ArrayList<String>(); for (Element li : bullets) { String link = FrameworkUtils.extractHtmlBlobContent(li, "", locale, sb, urlMap); link = link.replace("<li>", "").replace("</li>", ""); list.add(link); } spNode.setProperty("bullets", list.toArray(new String[list.size()])); } Element splink = spEle.getElementsByTag("p").first(); if (splink != null) { Element spLink = splink.getElementsByTag("a").first(); if (spNode.hasProperty("linktext")) { if (spLink != null) { spNode.setProperty("linktext", spLink.text()); if (spNode.hasNode("cta")) { Node ctaNode = spNode.getNode("cta"); String aUrl = spLink.absUrl("href"); if (aUrl.equals("")) { aUrl = spLink.attr("href"); } aUrl = FrameworkUtils.getLocaleReference(aUrl, urlMap, locale, sb); ctaNode.setProperty("url", aUrl); } } else { sb.append(Constants.SPOTLIGHT_ANCHOR_ELEMENT_NOT_FOUND); } } } else { if (spNode.hasProperty("linktext")) { sb.append(Constants.SPOTLIGHT_ANCHOR_ELEMENT_NOT_FOUND); } } if (spNode.hasNode("image")) { Node imageNode = spNode.getNode("image"); String fileReference = FrameworkUtils.extractImagePath(spEle, sb); fileReference = FrameworkUtils.migrateDAMContent(fileReference, "", locale, sb); if (fileReference != "") { imageNode.setProperty("fileReference", fileReference); } else { sb.append(Constants.SPOTLIGHT_IMAGE_NOT_AVAILABLE); } } else { sb.append(Constants.SPOTLIGHT_IMAGE_NODE_NOT_AVAILABLE); } } else { // // sb.append(Constants.SPOTLIGHT_ELEMENT_MISMATCH+size+Constants.SPOTLIGHT_ELEMENT_COUNT+elesize+".</li>"); } } if (size != elesize) { sb.append( Constants.SPOTLIGHT_ELEMENT_MISMATCH + size + Constants.SPOTLIGHT_ELEMENT_COUNT + elesize + ".</li>"); } /*if(spNodes.hasNext()){ sb.append(Constants.SPOTLIGHT_ELEMENT_MISMATCH+size+Constants.SPOTLIGHT_ELEMENT_COUNT+elesize+".</li>"); }*/ } /*else{ sb.append(Constants.SPOTLIGHT_NODE_NOT_FOUND); }*/ } /*else{ sb.append(Constants.SPOTLIGHT_ELEMENT_NOT_FOUND); }*/ }
private void migrateHero( Elements heroLargeElements, Node midSizeUpperLeftNode, String locale, Map<String, String> urlMap) throws PathNotFoundException, ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException, JSONException { Node heroLargeNode = null; Value[] panelPropertiest = null; if (midSizeUpperLeftNode.hasNode("hero_large")) { heroLargeNode = midSizeUpperLeftNode.getNode("hero_large"); Property panelNodesProperty = heroLargeNode.hasProperty("panelNodes") ? heroLargeNode.getProperty("panelNodes") : null; if (panelNodesProperty.isMultiple()) { panelPropertiest = panelNodesProperty.getValues(); } } else { log.debug( "<li>Node with name 'hero_large' doesn't exist under " + midSizeUpperLeftNode.getPath() + "</li>"); log.debug( "Node with name 'hero_large' doesn't exist under " + midSizeUpperLeftNode.getPath()); } if (heroLargeElements != null) { Element heroLargeElement = heroLargeElements.first(); if (heroLargeElement != null) { int eleSize = heroLargeElement.select("div.frame").size(); Elements heroLargeFrameElements = heroLargeElement.select("div.frame"); Node heroPanelNode = null; if (heroLargeFrameElements != null) { if (eleSize != heroLargeNode.getNodes("heropanel*").getSize()) { sb.append(Constants.MISMATCH_IN_HERO_SLIDES); heroLargeElement.select("div.frame").first().remove(); heroLargeFrameElements = heroLargeElement.select("div.frame"); } int i = 0; for (Element ele : heroLargeFrameElements) { String heroPanelTitle = ""; String heroPanelDescription = ""; String heroPanelLinkText = ""; String heroPanellinkUrl = ""; Elements heroTitleElements = ele.getElementsByTag("h2"); if (heroTitleElements != null) { Element heroTitleElement = heroTitleElements.first(); if (heroTitleElement != null) { heroPanelTitle = heroTitleElement.text(); } else { sb.append(Constants.HERO_CONTENT_HEADING_ELEMENT_DOESNOT_EXISTS); log.debug("No h2 first element found with in the class 'frame' of div."); } } else { sb.append(Constants.HERO_CONTENT_HEADING_ELEMENT_DOESNOT_EXISTS); log.debug("No h2 found with in the class 'frame' of div."); } Elements heroDescriptionElements = ele.getElementsByTag("p"); if (heroDescriptionElements != null) { Element heroDescriptionElement = heroDescriptionElements.first(); if (heroDescriptionElement != null) { heroPanelDescription = heroDescriptionElement.text(); } else { sb.append(Constants.HERO_CONTENT_DESCRIPTION_ELEMENT_DOESNOT_EXISTS); log.debug("No p frist element found with in the class 'frame' of div."); } } else { sb.append(Constants.HERO_CONTENT_DESCRIPTION_ELEMENT_DOESNOT_EXISTS); log.debug("No p elemtn found with in the class 'frame' of div."); } Elements heroPanelLinkTextElements = ele.getElementsByTag("b"); if (heroPanelLinkTextElements != null) { Element heroPanelLinkTextElement = heroPanelLinkTextElements.first(); if (heroPanelLinkTextElement != null) { heroPanelLinkText = heroPanelLinkTextElement.text(); } else { sb.append(Constants.HERO_CONTENT_ANCHOR_TEXT_IS_BLANK); log.debug("No b tags first elemtn found with in the class 'frame' of div."); } } else { sb.append(Constants.HERO_CONTENT_ANCHOR_TEXT_IS_BLANK); log.debug("No b tag found with the class 'frame' of div."); } Elements heroPanelLinkUrlElements = ele.getElementsByTag("a"); if (heroPanelLinkUrlElements != null) { Element heroPanelLinkUrlElement = heroPanelLinkUrlElements.first(); if (heroPanelLinkUrlElement != null) { heroPanellinkUrl = heroPanelLinkUrlElement.absUrl("href"); if (heroPanellinkUrl.equals("")) { heroPanellinkUrl = heroPanelLinkUrlElement.attr("href"); } // Start extracting valid href log.debug("heroPanellinkUrl before migration : " + heroPanellinkUrl); heroPanellinkUrl = FrameworkUtils.getLocaleReference(heroPanellinkUrl, urlMap, locale, sb); log.debug("heroPanellinkUrl after migration : " + heroPanellinkUrl); // End extracting valid href } else { sb.append(Constants.HERO_CONTENT_ANCHOR_LINK_IS_BLANK); log.debug("No anchor first element found with in the class 'frame' of div."); } } else { sb.append(Constants.HERO_CONTENT_ANCHOR_LINK_IS_BLANK); log.debug("No anchor element found with in the class 'frame' of div."); } // start image String heroImage = FrameworkUtils.extractImagePath(ele, sb); log.debug("heroImage path : " + heroImage); // end image log.debug("heroPanelTitle : " + heroPanelTitle); log.debug("heroPanelDescription : " + heroPanelDescription); log.debug("heroPanelLinkText : " + heroPanelLinkText); log.debug("heroPanellinkUrl : " + heroPanellinkUrl); if (panelPropertiest != null && i <= panelPropertiest.length) { String propertyVal = panelPropertiest[i].getString(); if (StringUtils.isNotBlank(propertyVal)) { JSONObject jsonObj = new JSONObject(propertyVal); if (jsonObj.has("panelnode")) { String panelNodeProperty = jsonObj.get("panelnode").toString(); heroPanelNode = heroLargeNode.hasNode(panelNodeProperty) ? heroLargeNode.getNode(panelNodeProperty) : null; log.debug("hero_node_Name : " + heroPanelNode.getName()); } } i++; } else { sb.append(Constants.HERO_CONTENT_NODE_NOT_FOUND); log.debug("No list panelProperties found for the hero compoent order."); } if (heroPanelNode != null) { Node heroPanelPopUpNode = null; Elements lightBoxElements = ele.select("div.c50-image").select("a.c26v4-lightbox"); if (lightBoxElements != null && !lightBoxElements.isEmpty()) { heroPanelPopUpNode = FrameworkUtils.getHeroPopUpNode(heroPanelNode); } if (StringUtils.isNotBlank(heroPanelTitle)) { heroPanelNode.setProperty("title", heroPanelTitle); if (heroPanelPopUpNode != null) { heroPanelPopUpNode.setProperty("popupHeader", heroPanelTitle); } else { if (lightBoxElements != null && lightBoxElements.size() != 0) { sb.append("<li>Hero content video pop up node not found.</li>"); log.debug( "No pop-up node found for the hero panel node " + heroPanelNode.getPath()); } } } else { sb.append(Constants.HERO_SLIDE_TITLE_NOT_FOUND); log.debug("Title is blank with in the 'frame' class of div."); } if (StringUtils.isNotBlank(heroPanelDescription)) { heroPanelNode.setProperty("description", heroPanelDescription); } else { sb.append(Constants.HERO_SLIDE_DESCRIPTION_NOT_FOUND); log.debug("Description is blank with in the 'frame' class of the div."); } if (StringUtils.isNotBlank(heroPanelLinkText)) { heroPanelNode.setProperty("linktext", heroPanelLinkText); } else { sb.append(Constants.HERO_SLIDE_DESCRIPTION_NOT_FOUND); log.debug("Link Text doesn't exists with in the class 'frame' of the div."); } if (StringUtils.isNotBlank(heroPanellinkUrl)) { heroPanelNode.setProperty("linkurl", heroPanellinkUrl); } else { sb.append(Constants.HERO_SLIDE_LINKURL_NOT_FOUND); log.debug("Link url doesn't exists with in the class 'frame' of the div."); } if (heroPanelNode.hasNode("image")) { Node imageNode = heroPanelNode.getNode("image"); String fileReference = imageNode.hasProperty("fileReference") ? imageNode.getProperty("fileReference").getString() : ""; heroImage = FrameworkUtils.migrateDAMContent(heroImage, fileReference, locale, sb); log.debug("heroImage : " + heroImage); if (StringUtils.isNotBlank(heroImage)) { imageNode.setProperty("fileReference", heroImage); } } else { sb.append(Constants.HERO_SLIDE_IMAGE_NODE_NOT_FOUND); log.debug("'image' node doesn't exists in " + heroPanelNode.getPath()); } } } } else { log.debug("<li>Hero Large Frames/Panel Elements is not found</li>"); log.debug("No div found with class 'frame'"); } } else { sb.append(Constants.HERO_LARGE_COMPONENT_NOT_FOUND); log.debug("No first element found with class 'c50-pilot'"); } } else { sb.append("<li>Hero Large component is not found on web publisher page</li>"); log.debug("No element found with class 'c50-pilot'"); } }