ReferencingExt option

Build 1501 on 14/Nov/2017  This topic last edited on: 29/Oct/2012, at 16:11

The ReferencingExt option outputs in the XML the values of the sub-attributes associated with the attribute that references the object.

For example, if the 'audio' object with id 44043 is referenced by the 'story' object with id 63942, and such reference has a caption 'Referencing caption 1', executing ../do.ashx?cmd=objsnav&ids=44043&options=referencingext&max=7 produces:

  <audio id="obj44043" . . .>

    . . .

    <nav:referencing>

      . . .

      <nav:referencingBy attrName="package.objs">

        <nav:refs handle="1">

          <ref idref="obj63942">

            <title />

            <caption>Referencing caption 1</caption>

            <nav:refObject idref="obj63942">

              <story id="obj63942" . . .>

                . . .

              </story>

            </nav:refObject>

          </ref>

          . . .

        </nav:refs>

      </nav:referencingBy>

      . . .

    </nav:referencing>

    . . .

  </audio>

i.e. a result similar to the one obtained with the 'Referencing' option, but where the 'nav:refs' element contain a sub-element identical to the XML of the referencing attribute - but with the referenced id and object replaced by the referencing id and object. Commpare the XML above:

          <ref idref="obj63942">

            <title />

            <caption>Referencing caption 1</caption>

            <nav:refObject idref="obj63942">

              <story id="obj63942" . . .>

                . . .

              </story>

            </nav:refObject>

          </ref>

with the XML of the referencing story:

  <story id="obj63942" >

    . . .

    <objs nav:handle="1">

      <ref idref="obj44043">

        <title></title>

        <caption>Referencing caption 1</caption>

        <nav:refObject idref="obj44043">

          <audio id="obj44043" . . . >

            . . .

          </audio>

        </nav:refObject>

      </ref>

    </objs>

    . . .

  </story>

This type of XML output is useful when it is necessary to combine data from the referencing objects with sub-attributes of the references - for example to produce a list of the stories referencing an audio with the caption that is used in each story for that specific audio.

The example above uses a multi-reference attribute ('story.objs'), a similar output is generated for access attributes - that are a kind of multi-reference. For example, if the 'user' object with id 6907 has full permissions on the folder with id 6909, executing ../do.ashx?cmd=objsnav&ids=6907&options=referencing&max=6 produces:

  <user id="öbj6907" . . .>

    . . .

    <nav:referencing>

      . . .

      <nav:referencingBy attrName="folder.access">

        <nav:refs handle="1">

          <securityAccess idref="obj6909">

            <grant>all</grant>

            <nav:refObject idref="obj6909">

              <folder id="obj6909" . . . >

                . . .

              </folder>

            </nav:refObject>

          </securityAccess>

          . . .

        </nav:refs>

      </nav:referencingBy>

      . . .

    </nav:referencing>

    . . .

  </user>

Finally, something similar is done also for references via sub-attributes of list or multi-refrence attributes. In this case the id of the referencing object is replaced within the sub-attribute XML. For example if the 'pubMode' object with id 1594 is used to publish the audio with id 4403 in the publishing destination with id 1595, executing ../do.ashx?cmd=objsnav&ids=1594&options=referencing&max=6 produces:

  <pubMode id="obj1594" . . .>

    . . .

    <nav:referencing>

      . . .

      <nav:referencingBy attrName="pubDest.objs.pubModeRef">

        <nav:refs handle="1">

          <ref idref="obj44043">

            <pubModeRef idref="obj1595">

              <nav:refObject idref="obj1595">

                <pubDest id="obj1595" . . .>

                  . . .

                </pubDest>

              </nav:refObject>

            </pubModeRef>

            <pubData xml:space="preserve" />

            <extraParams xml:space="preserve" />

            <userRef idref="obj1705">

              <nav:refObject idref="obj1705" />

            </userRef>

            <pubTime>2012-10-19T10:27:04.233Z</pubTime>

            <nav:refObject idref="obj44043">

              <audio id="obj44043">

                . . .

              </audio>

            </nav:refObject>

          </ref>

          . . .

        </nav:refs>

      </nav:referencingBy>

      . . .

    </nav:referencing>

    . . .

  </pubMode>

note how the id of the referencing object - the publishing destination with id 1595 - has been placed in the 'pubModeRef' element, that normally holds the id of the publishing mode, i.e. the referenced object.

Specifying both the 'Referencing' and 'ReferencingExt' options at the same time is equivalent to specify 'ReferencingExt'.