내 커뮤니티 업적 표시줄을 확대합니다.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

References to word or pdf documents in DITA causes broken link

Avatar

Level 3

I am using on premise AEM service pack 12 with FMDITA 4.1.

I am trying to add word and pdf documents as attachments to dita xml using cross reference. But after generating AEM SITE from dita , the path to the documents is not getting resolved and causes broken link.

Following are the screenshots:

ravir73578276_1-1672990455509.png

 

ravir73578276_0-1672990430775.png

 

How can this issue be resolved any idea?

@DivrajSingh 

 

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee

@ravir73578276 : If you need references to non-dita assets to work as link to assets when rendering them on AEM Site page, you need to do following:

  1. While authoring such links you need to ask authors to add an attribute "format" having appropriate value like "docx" to identify that this link is special (see [A])
  2. And before you publish the content to AEM Site, you need to add a rule in "elementmapping.xml" to indicate the publishing process to handle this differently, see [B]. With this configuration the links to docx type files will point to their original loction in AEM Assets. (note that when you update elementmapping.xml you need to follow additional notes given in Installation and Configuration guide page 106)
  3. Then you can try publishing the map to AEM Site - it should work as you expect then

[A]: authored xref with format attribute

<xref href="GUID-8e29cf2b-fa8c-4c5e-8f8f-a6c54491d33f.docx" format="docx" scope="local"> </xref>

 

[B]: snippet for elementmapping.xml to enable links to non-dita assets to work on AEM Sites

<ditaelement>

    <name>xref</name>

    <class>- topic/xref</class>

    <componentpath>fmdita/components/dita/link</componentpath>

    <type>COMPOSITE</type>

    <target>para</target>

    <textprop>text</textprop>

    <xpath><![CDATA[//xref[@format='docx']]]></xpath>

    <attributemap>

      <attribute from="href" to="link" ispath="true" rel="SOURCE" />

      <attribute from="format" to="format" />

      <attribute from="scope" to="scope" />

    </attributemap>

</ditaelement>

 

 

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Employee

@ravir73578276 : If you need references to non-dita assets to work as link to assets when rendering them on AEM Site page, you need to do following:

  1. While authoring such links you need to ask authors to add an attribute "format" having appropriate value like "docx" to identify that this link is special (see [A])
  2. And before you publish the content to AEM Site, you need to add a rule in "elementmapping.xml" to indicate the publishing process to handle this differently, see [B]. With this configuration the links to docx type files will point to their original loction in AEM Assets. (note that when you update elementmapping.xml you need to follow additional notes given in Installation and Configuration guide page 106)
  3. Then you can try publishing the map to AEM Site - it should work as you expect then

[A]: authored xref with format attribute

<xref href="GUID-8e29cf2b-fa8c-4c5e-8f8f-a6c54491d33f.docx" format="docx" scope="local"> </xref>

 

[B]: snippet for elementmapping.xml to enable links to non-dita assets to work on AEM Sites

<ditaelement>

    <name>xref</name>

    <class>- topic/xref</class>

    <componentpath>fmdita/components/dita/link</componentpath>

    <type>COMPOSITE</type>

    <target>para</target>

    <textprop>text</textprop>

    <xpath><![CDATA[//xref[@format='docx']]]></xpath>

    <attributemap>

      <attribute from="href" to="link" ispath="true" rel="SOURCE" />

      <attribute from="format" to="format" />

      <attribute from="scope" to="scope" />

    </attributemap>

</ditaelement>