Rich Text (RTE) от AEM добавляет домен Author к ссылкам? - PullRequest
0 голосов
/ 23 февраля 2019

На недавно созданном сервере AEM 6.3 Author (Service Pack 2) компонент RTE автоматически добавляет наш URL автора к любому активу, выбранному с помощью средства выбора активов.

Домен добавляется только после выбора актива инажав ОК.Прежде чем щелкнуть «ОК», единственный путь там - это относительный путь.

Author domain is not prepended to link yet

Но сразу после выбора актива в JCR можно подтвердить, чтопуть содержит домен автора.

Author domain prepended to link, as seen from JCR

И если вы откроете резервную копию селектора ресурсов, то и там будет виден предопределенный путь.

enter image description here

Я не уверен, что это корень проблемы, но первый раз, когда я вижу, что абсолютная ссылка появляется во время обработки, это когда файл Link.js (/libs/clientlibs/granite/richtext/core/js/commands/Link.js) создает узел HTML для тега.Несмотря на то, что url является относительным, childNodes[0].href является абсолютным:

var helperSpan = context.createElement('span');
helperSpan.innerHTML = '<a href=\"' + url + '\"></a>';
attributes.href = helperSpan.childNodes[0].href;
attributes[CUI.rte.Common.HREF_ATTRIB] = helperSpan.childNodes[0].href;

Предварительно указывать URL нашего автора явно не то, что нам нужно.Любые идеи, почему это могло бы произойти?

Я не думаю, что диалог влияет на что-либо, но вот сенсорный диалог XML для справки:

<dialog xmlns:DICOM="http://ns.adobe.com/DICOM/" xmlns:ExtensisFontSense="http://www.extensis.com/meta/FontSense/" xmlns:GCamera="http://ns.google.com/photos/1.0/camera/" xmlns:GettyImagesGIFT="http://xmp.gettyimages.com/gift/1.0/" xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" xmlns:MP="http://ns.microsoft.com/photo/1.2/" xmlns:MicrosoftPhoto="http://ns.microsoft.com/photo/1.0" xmlns:MicrosoftPhoto_1_="http://ns.microsoft.com/photo/1.0/" xmlns:Z="urn:schemas-microsoft-com:" xmlns:aas="http://ns.apple.com/adjustment-settings/1.0/" xmlns:acdsee="http://ns.acdsee.com/iptc/1.0/" xmlns:adhocwf="http://ns.adobe.com/AcrobatAdhocWorkflow/1.0/" xmlns:adobe_dam="http://www.adobe.com/adobe_dam/1.0" xmlns:ag="http://www.acquitygroup.com" xmlns:album="http://ns.adobe.com/album/1.0/" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:apple-fi="http://ns.apple.com/faceinfo/1.0/" xmlns:attr="http://ns.swcc.com/attr/1.0/" xmlns:author="http://springernature.com/ns/xmpExtensions/2.0/authorInfo/" xmlns:bext="http://ns.adobe.com/bwf/bext/1.0/" xmlns:cc="http://creativecommons.org/ns#" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:creatorAtom="http://ns.adobe.com/creatorAtom/1.0/" xmlns:crossmark="http://crossref.org/crossmark/1.0/" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:crx="http://www.day.com/crx/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:def="http://mediabeacon.com/ns/default/1.0/" xmlns:desc="http://ns.adobe.com/xfa/promoted-desc/" xmlns:dex="http://ns.optimasc.com/dex/1.0/" xmlns:drone-dji="http://www.dji.com/drone-dji/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:exifEX="http://cipa.jp/exif/1.0/" xmlns:fd="http://www.adobe.com/aemfd/fd/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:idPriv="http://ns.adobe.com/xmp/InDesign/private" xmlns:illustrator="http://ns.adobe.com/illustrator/1.0/" xmlns:jav="http://www.niso.org/schemas/jav/1.0/" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:lr="http://ns.adobe.com/lightroom/1.0/" xmlns:mb="http://brightech.com/ns/mb" xmlns:mediapro="http://ns.iview-multimedia.com/mediapro/1.0/" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:oauth="http://oauth.net/" xmlns:panorama="http://ns.adobe.com/photoshop/1.0/panorama-profile" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaField="http://www.aiim.org/pdfa/ns/field#" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" xmlns:pdfaType="http://www.aiim.org/pdfa/ns/type#" xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/" xmlns:pdfx="http://ns.adobe.com/pdfx/1.3/" xmlns:pdfxid="http://www.npes.org/pdfx/ns/id/" xmlns:photomechanic="http://ns.camerabits.com/photomechanic/1.0/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:plus="http://ns.useplus.org/ldf/xmp/1.0/" xmlns:pmtm="http://www.hdrsoft.com/photomatix_settings01" xmlns:prefix0="MSImagingV1" xmlns:prism="http://prismstandard.org/namespaces/basic/2.1/" xmlns:prism_1_="http://prismstandard.org/namespaces/basic/3.0/" xmlns:prismusagerights="http://prismstandard.org/namespaces/prismusagerights/2.1/" xmlns:prl="http://prismstandard.org/namespaces/prl/2.1/" xmlns:psAux="http://ns.adobe.com/exif/1.0/aux/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rep="internal" xmlns:s7sitecatalyst="http://www.day.com/s7sitecatalyst/1.0/" xmlns:s7userdata="http://www.day.com/s7userdata/1.0/" xmlns:scg="http://www.adobe.com/social/scg/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:slingevent="http://sling.apache.org/jcr/event/1.0" xmlns:sn="http://springernature.com/ns/xmpExtensions/2.0/" xmlns:social="http://www.adobe.com/social/1.0" xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#" xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stFNT="http://ns.adobe.com/xap/1.0/sType/Font#" xmlns:stMfs="http://ns.adobe.com/xap/1.0/sType/ManifestItem#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:swf="http://ns.adobe.com/swf/1.0/" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:viewerpreset="http://www.day.com/viewerpreset/1.0/" xmlns:vlt="http://www.day.com/jcr/vault/1.0" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpBJ="http://ns.adobe.com/xap/1.0/bj/" xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/" xmlns:xmpG="http://ns.adobe.com/xap/1.0/g/" xmlns:xmpGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:xmpNote="http://ns.adobe.com/xmp/note/" xmlns:xmpPLUS="http://ns.adobe.com/xap/1.0/PLUS/" xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:xmp_1_="http://ns.abobe.com/xap/1.0/" jcr:primaryType="cq:Dialog" height="625" helpPath="en/cq/current/wcm/default_components.html#Text" xtype="dialog">
   <items jcr:primaryType="cq:WidgetCollection">
      <tab1 jcr:primaryType="cq:Widget" anchor="100%" title="Text" xtype="panel">
         <items jcr:primaryType="cq:WidgetCollection">
            <text jcr:primaryType="cq:Widget" height="500" hideLabel="true" name="./text" xtype="richtext">
               <rtePlugins jcr:primaryType="nt:unstructured">
                  <links jcr:primaryType="nt:unstructured">
                     <linkDialogConfig jcr:primaryType="nt:unstructured" height="316">
                        <linkAttributes jcr:primaryType="cq:WidgetCollection">
                           <linkAdvanced jcr:primaryType="cq:Widget" collapsed="true" collapsible="true" inputValue="advanced" name="./linkdialog/cq:adhocLinkTrackingTab" title="Link tracking" xtype="dialogfieldset">
                              <items jcr:primaryType="cq:WidgetCollection">
                                 <enable jcr:primaryType="nt:unstructured" attribute="enabletracking" fieldDescription="override analytics framework settings" fieldLabel="Custom link tracking" name="./linkdialog/cq:adhocLinkTrackingEnableTracking" xtype="checkbox">
                                    <listeners jcr:primaryType="nt:unstructured" check="function(component){var dlg=component.findParentByType('rtelinkdialog');dlg.enableSCFields(component.checked);}" />
                                 </enable>
                                 <events jcr:primaryType="nt:unstructured" attribute="adhocevents" fieldDescription="e.g.: event2, event7" fieldLabel="Include SiteCatalyst events" name="./linkdialog/cq:adhocLinkTrackingEvents" xtype="textfield" />
                                 <evars jcr:primaryType="nt:unstructured" attribute="adhocevars" fieldDescription="e.g.: eVar1: pagedata.url, prop4: 'const'" fieldLabel="Include SiteCatalyst variables" name="./linkdialog/cq:adhocLinkTrackingEvars" xtype="textfield" />
                              </items>
                           </linkAdvanced>
                        </linkAttributes>
                     </linkDialogConfig>
                  </links>
                  <paraformat jcr:primaryType="nt:unstructured" features="*">
                     <formats jcr:primaryType="cq:WidgetCollection">
                        <paragraph jcr:primaryType="nt:unstructured" description="paragraph" tag="p" />
                        <h2 jcr:primaryType="nt:unstructured" description="heading 2" tag="h2" />
                        <h3 jcr:primaryType="nt:unstructured" description="heading 3" tag="h3" />
                        <h4 jcr:primaryType="nt:unstructured" description="heading 4" tag="h4" />
                        <blockquote jcr:primaryType="nt:unstructured" description="quote" tag="blockquote" />
                     </formats>
                  </paraformat>
                  <styles jcr:primaryType="nt:unstructured" features="*">
                     <styles jcr:primaryType="cq:WidgetCollection">
                        <picLeft jcr:primaryType="nt:unstructured" cssName="float-left" text="Left Align Picture" />
                        <picRight jcr:primaryType="nt:unstructured" cssName="float-right" text="Right Align Picture" />
                        <picCenter jcr:primaryType="nt:unstructured" cssName="float-center" text="Center Align Picture" />
                        <button jcr:primaryType="nt:unstructured" cssName="button" text="Button" />
                        <largeButton jcr:primaryType="nt:unstructured" cssName="button large" text="Large Button" />
                     </styles>
                  </styles>
                  <edit jcr:primaryType="nt:unstructured" defaultPasteMode="wordhtml" stripHtmlTags="true" />
                  <justify jcr:primaryType="nt:unstructured" />
                  <spellcheck jcr:primaryType="nt:unstructured" features="*" />
                  <subsuperscript jcr:primaryType="nt:unstructured" features="*" />
                  <undo jcr:primaryType="nt:unstructured" features="*" />
                  <misctools jcr:primaryType="nt:unstructured" />
                  <format jcr:primaryType="nt:unstructured" />
                  <findreplace jcr:primaryType="nt:unstructured" features="*" />
               </rtePlugins>
               <htmlRules jcr:primaryType="nt:unstructured">
                  <docType jcr:primaryType="nt:unstructured">
                     <typeConfig jcr:primaryType="nt:unstructured" useSemanticMarkup="false" />
                  </docType>
                  <links jcr:primaryType="nt:unstructured">
                     <targetConfig jcr:primaryType="nt:unstructured" mode="none" />
                  </links>
               </htmlRules>
            </text>
            <isRichTextFlag jcr:primaryType="cq:Widget" ignoreData="true" name="./textIsRich" value="true" xtype="hidden" />
         </items>
      </tab1>
   </items>
</dialog>

1 Ответ

0 голосов
/ 28 февраля 2019

Мы были на AEM Service Pack 6.3.2.Установка накопительного пакета обновления 6.3.3.3 устранила проблему.

В частности, это были обновления компонента Coral RTE в пакете com.adobe.granite.ui.coralui3-rte-0.0.32-CQ630-B0022.(«Пакет содержимого, который предоставляет совместимые с ExtJS версии RTE Core и Coral RTE в качестве клиентских библиотек».)

Оказывается, что файл Link.js (libs / clientlibs / granite / richtext / core /)js / commands / Link.js) действительно содержит ошибку, как мы и предполагали.

Код, используемый для чтения:

var helperSpan = context.createElement('span');
helperSpan.innerHTML = '<a href=\"' + url + '\"></a>';
...
attributes[CUI.rte.Common.HREF_ATTRIB] = helperSpan.childNodes[0].href;

А теперь это:

var helperSpan = context.createElement('span');
helperSpan.innerHTML = '<a href=\"' + url + '\"></a>';
...
attributes[CUI.rte.Common.HREF_ATTRIB] = url;
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...