From ac329934973993089443166fb340bc325c566814 Mon Sep 17 00:00:00 2001 From: Arnaud Dieumegard Date: Tue, 24 Nov 2020 15:38:46 +0100 Subject: [PATCH] [569058] Special character handling in search index (#81) * [569058] Special character handling in search index - Fix special characters handling in search index search field Change-Id: Icf4162ec4f6cb300beb5856b1ffb3fc4509625fd Signed-off-by: Arnaud Dieumegard --- .../core/searchIndex/SearchIndex.java | 16 ++-- .../core/task/IndexingConceptsTask.java | 2 +- .../method._0T5DxV4yEeGfnvXFIF-hXQ.pt | 8 +- .../indexesVerification.verification | 73 ++++++++++--------- ...ssionClosedUsedResourceWithViewpoints.test | 5 +- 5 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/generated/org/polarsys/kitalpha/doc/gen/business/core/searchIndex/SearchIndex.java b/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/generated/org/polarsys/kitalpha/doc/gen/business/core/searchIndex/SearchIndex.java index ed67e92423..cf5527b0c1 100644 --- a/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/generated/org/polarsys/kitalpha/doc/gen/business/core/searchIndex/SearchIndex.java +++ b/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/generated/org/polarsys/kitalpha/doc/gen/business/core/searchIndex/SearchIndex.java @@ -1,4 +1,4 @@ -//Generated with EGF 1.6.1.201906060805 +//Generated with EGF 1.6.2.202001031546 package org.polarsys.kitalpha.doc.gen.business.core.searchIndex; import java.util.Map.Entry; @@ -44,8 +44,8 @@ public static synchronized SearchIndex create(String lineSeparator) { + "\t\t\taddedConceptCount = addedConceptCount + 255;" + NL + "\t\t} " + NL; protected final String TEXT_5 = NL + "\t\tconceptsList["; protected final String TEXT_6 = "]["; - protected final String TEXT_7 = "][0] = \""; - protected final String TEXT_8 = "\";" + NL + "\t\tconceptsList["; + protected final String TEXT_7 = "][0] = encodeURIComponent(\""; + protected final String TEXT_8 = "\");" + NL + "\t\tconceptsList["; protected final String TEXT_9 = "][1] = \""; protected final String TEXT_10 = "\";" + NL + "\t\t"; protected final String TEXT_11 = "][2] = \""; @@ -55,13 +55,13 @@ public static synchronized SearchIndex create(String lineSeparator) { + "\t var element = document.getElementById('possible_keywords');" + NL + "\t var t = \"\";" + NL + "\t for (x=0; x < tabCount; x++){" + NL + "\t\t \tvar concepts = conceptsList[x];" + NL + "\t \tfor(i=0;i\" + value2 + \"
\");" + + "\t \t\t\t\tt = t.concat(\" \" + decodeURIComponent(value2) + \"
\");" + NL + "\t \t\t\t} else {" + NL - + "\t \t\t\t\tt = t.concat(value4 + \" \" + value2 + \"
\");" + + "\t \t\t\t\tt = t.concat(value4 + \" \" + decodeURIComponent(value2) + \"
\");" + NL + "\t \t\t\t}\t \t\t" + NL + "\t \t\t}" + NL + "\t \t}" + NL + "\t }" + NL + "\t " + NL + "\t $(\"#p2\").html(t);" + NL + "\t if (element != null) {" + NL + "\t \telement.value = value;" + NL + "\t }" + NL + "\t }).keyup();" + NL + "\t " + NL @@ -137,7 +137,7 @@ protected void method_content(final StringBuffer stringBuffer, final PatternCont stringBuffer.append(count); stringBuffer.append(TEXT_7); stringBuffer.append(EscapeChars - .removeNewline(EscapeChars.forHTML(entry.getValue().getConceptName().replace("\"", "\\\"")))); + .removeNewline(entry.getValue().getConceptName().replace("\\", "\\\\").replace("\"", "\\\""))); stringBuffer.append(TEXT_8); stringBuffer.append(listCount); stringBuffer.append(TEXT_6); diff --git a/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/src/org/polarsys/kitalpha/doc/gen/business/core/task/IndexingConceptsTask.java b/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/src/org/polarsys/kitalpha/doc/gen/business/core/task/IndexingConceptsTask.java index b5163a912b..96d5be9f38 100644 --- a/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/src/org/polarsys/kitalpha/doc/gen/business/core/task/IndexingConceptsTask.java +++ b/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/src/org/polarsys/kitalpha/doc/gen/business/core/task/IndexingConceptsTask.java @@ -508,7 +508,7 @@ private void indexPage(Map indexItems, IFile file) while (mTable.find()) { for (Entry entry : indexItems.entrySet()) { - String currentConcept_html = EscapeChars.forHTML(entry.getValue().getConceptName()); + String currentConcept_html = entry.getValue().getEscapedForHTMLConceptName(); for (int i = 1; i <= mTable.groupCount(); i++) { String listGroup = mTable.group(i); if (listGroup.contains(currentConcept_html)) { diff --git a/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/templates/pattern._0T5DwF4yEeGfnvXFIF-hXQ/method._0T5DxV4yEeGfnvXFIF-hXQ.pt b/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/templates/pattern._0T5DwF4yEeGfnvXFIF-hXQ/method._0T5DxV4yEeGfnvXFIF-hXQ.pt index 0ec795c912..dbade43495 100644 --- a/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/templates/pattern._0T5DwF4yEeGfnvXFIF-hXQ/method._0T5DxV4yEeGfnvXFIF-hXQ.pt +++ b/Docgen/business/plugins/org.polarsys.kitalpha.doc.gen.business.core/templates/pattern._0T5DwF4yEeGfnvXFIF-hXQ/method._0T5DxV4yEeGfnvXFIF-hXQ.pt @@ -50,7 +50,7 @@ int i = 0; for(Entry entry : indexItems.entrySet()) { i++; %> - conceptsList[<%=listCount%>][<%=count%>][0] = "<%=EscapeChars.removeNewline(EscapeChars.forHTML(entry.getValue().getConceptName().replace("\"", "\\\"")))%>"; + conceptsList[<%=listCount%>][<%=count%>][0] = encodeURIComponent("<%=EscapeChars.removeNewline(entry.getValue().getConceptName().replace("\\", "\\\\").replace("\"", "\\\""))%>"); conceptsList[<%=listCount%>][<%=count%>][1] = "<%=i+"_"+DocGenHtmlUtil.getValidFileName(entry.getValue().getConceptName())%>"; <% if (entry.getValue().getIconTag() != null && !entry.getValue().getIconTag().isEmpty()) { %> conceptsList[<%=listCount%>][<%=count%>][2] = "<%= entry.getValue().getIconTag().replaceAll("\"", "'").replaceFirst("../", "") %>"; @@ -76,15 +76,15 @@ for(Entry entry : indexItems.entrySet()) { for (x=0; x < tabCount; x++){ var concepts = conceptsList[x]; for(i=0;i" + value2 + "
"); + t = t.concat(" " + decodeURIComponent(value2) + "
"); } else { - t = t.concat(value4 + " " + value2 + "
"); + t = t.concat(value4 + " " + decodeURIComponent(value2) + "
"); } } } diff --git a/Docgen/business/tests/rcptt/org.polarsys.kitalpha.doc.gen.business.ecore.test.rcptt/verification/indexesVerification.verification b/Docgen/business/tests/rcptt/org.polarsys.kitalpha.doc.gen.business.ecore.test.rcptt/verification/indexesVerification.verification index e76607646e..80af965607 100644 --- a/Docgen/business/tests/rcptt/org.polarsys.kitalpha.doc.gen.business.ecore.test.rcptt/verification/indexesVerification.verification +++ b/Docgen/business/tests/rcptt/org.polarsys.kitalpha.doc.gen.business.ecore.test.rcptt/verification/indexesVerification.verification @@ -4,7 +4,7 @@ Element-Name: indexesVerification Element-Type: verification Element-Version: 2.0 Id: _ADomsCNXEeu9mdq5tbB1Yw -Save-Time: 11/10/20, 2:19 PM +Save-Time: 11/24/20, 1:54 PM Verification-Type: org.eclipse.rcptt.verifications.workspace ------=_contents/org.eclipse.emf.ecore.doc/output/output/index.html-770447c8-8db6-3fd5-9653-0c2fd2a92ef1 @@ -38,41 +38,42 @@ bnRVVAUAAQAAAABQSwUGAAAAAAEAAQA/AAAAcAEAAAAA Content-Type: q7/binary Entry-Name: contents/org.eclipse.emf.ecore.doc/output/output/ecore/searchIndex.html -UEsDBBQACAgIAAAAIQAAAAAAAAAAAAAAAAAIAAkALmNvbnRlbnRVVAUAAQAAAAC1WWtv2zgW/ewB5j9w -NDOIgyCW9crDsQO0sbuTRTottlksFkUh0BJtM1UkL0Un9g7y3/dSski9yJkv29oxTR6ec0nqXNHUjz9M -f5p/unv89+cF+u3x4wP6/M/3D/d3yDq37X95d7Y9f5yXDf5o7KBHhtOccpqlOLHtxe/W7Y8/TDf8OSk+ -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f.ecore.doc/output/output/ecore/searchIndex.html-984b1e83-fd6c-3ac4-ba3b-f57c9b8a33e8-- ------=_contents/org.eclipse.emf.ecore.doc/output/output/modelindex.html-19804eee-a482-31c9-858b-b2453a24714a Content-Type: q7/binary diff --git a/detachment/tests/rcptt/org.polarsys.kitalpha.detachment.tests.rcptt/test cases/SessionClosedUsedResourceWithViewpoints.test b/detachment/tests/rcptt/org.polarsys.kitalpha.detachment.tests.rcptt/test cases/SessionClosedUsedResourceWithViewpoints.test index e65804a129..a084c9799c 100644 --- a/detachment/tests/rcptt/org.polarsys.kitalpha.detachment.tests.rcptt/test cases/SessionClosedUsedResourceWithViewpoints.test +++ b/detachment/tests/rcptt/org.polarsys.kitalpha.detachment.tests.rcptt/test cases/SessionClosedUsedResourceWithViewpoints.test @@ -6,8 +6,7 @@ Element-Type: testcase Element-Version: 3.0 External-Reference: Id: _CRo1AHW9Eea2Ve0UEUBuKQ -Runtime-Version: 2.1.0.201606221726 -Save-Time: 12/12/17 2:24 PM +Save-Time: 11/24/20, 2:08 PM Testcase-Type: ecl ------=_.description-216f885c-d591-38ce-8ea2-e4f8cb4d6ffa @@ -80,7 +79,7 @@ get-view "Project Explorer" | get-tree | select "org.polarsys.kitalpha.vp.componentsample.runtime.model/model/VideoOnDemand.aird" | get-menu Open | click with [get-view "Project Explorer" | get-tree] { get-item "org.polarsys.kitalpha.vp.componentsample.runtime.model/model/VideoOnDemand.aird" - | get-property childCount | equals 3 | verify-true + | get-property childCount | equals 4 | verify-true get-item "org.polarsys.kitalpha.vp.componentsample.runtime.model/model/VideoOnDemand.aird/VideoOnDemand.afm - \\[platform:\\/resource\\/org.polarsys.kitalpha.vp.componentsample.runtime.model\\/model\\/VideoOnDemand.afm\\]/Metadata _C6TcsHWrEeaTEc45KkXUqA" | get-property childCount | equals 3 | verify-true }