Expand my Community achievements bar.

SOLVED

Add custom elements or attributes in search using customizing the searlizationconfig.html

Avatar

Level 4

Hi I have customized my asset UI search by following the below document and added custom attributes to the dita search.  Can some provide any document that contains detail steps to configure and test this?

https://experienceleague.adobe.com/en/docs/experience-manager-guides/using/install-guide/on-prem-ig/...

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Employee

yes, 

 

use the rules in serialization.config file as highlighted below :

 

<ruleset filetypes="xml dita">
  <!-- Element rules -->
  <rule xpath="//*[contains(@class, 'topic/topic')]/*[contains(@class, 'topic/prolog')]//*[not(*)]" text="yes" attributeset="all-attrs" />
 
<!-- Attribute rules -->
<rule xpath="//*[contains(@class, 'topic/topic')]/*[contains(@class, 'topic/prolog')]//*/@*[local-name() != 'class']" />
<!-- MORE rules -->
<rule xpath="//*[contains(@class, 'topic/topic')]/shortdesc" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/context/p" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/conbody/p" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/title" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/steps/step/cmd" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/conbody/fig/title" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/steps/step/info/fig/title" text="yes" />
</ruleset>
 
<ruleset filetypes="ditamap">
<rule xpath="//*[contains(@class, 'map/map')]/title" text="yes" />
</ruleset>
 
once data is indexed, the filter can be used on topic title, or on shortdesc text or on other created rules.
 
 

Example :

if following is the topic title tag ...

<title>TestSearch</title>

 

 

title  as Element Name

TestSearch as Value

 

 
 

View solution in original post

8 Replies

Avatar

Level 4

Hello,

 

Can any one suggest, how the DITA Element will work in the Asset UI search?

Beaula123_0-1718174453861.png

 

Avatar

Employee

Hi , 

 

Following are the steps to use DITA Element Search

 

1. navigate to URL <server>/crx/de, overlay the /libs/fmdita/config folder to /apps. Once this is done, copy the serializationconfig.xml file from /libs/fmdita/config/ and paste it to  /apps/fmdita/config
 
2. With Admin user, Navigate to Tools -> Search Forms. Check the checkbox for Assets Admin Search Rail and click on Edit. On the right scroll down and search for DITA Element Predicate. Drag and drop this to the left side of the screen. Save the changes
 
3. For the non admin users to perform search, navigate to <Server_URL>/useradmin. Now search for the group. Go to Permissions tab. Navigate to /conf/globa/settings/dam. Give Read permission on dam for the group. This will enable the non admin users to perform DITA ELEMENT search
 
4. Navigate to <Server_URL>/system/console/configMgr. Here search for Component com.adobe.fmdita.config.ConfigManager. Check the checkbox for Enable DITA Metadata Extraction. Save the changes. If any changes are done on the serializationconfig.xml file (mentioned in step 1), you need to again open and save the com.adobe.fmdita.config.ConfigManager  [URL : <Server_URL>/system/console/configMgr]
 
5. Now to serialize the existing data, navigate to Tools -> XML Documentation -> DITA Metadata Extraction.
    a. To select a file, choose the option ‘Select a file’ and browse to select the desired file. 
    b. To select a folder, choose the option ‘Select Folder(s)’. You can choose multiple folders using the browse option and adding each folder using the ‘Add’ button
 
6. You can serialize the desired content by clicking Start. Serialization would be done based on the rules set in the serializationconfig.xml file.
 
7. Below are some sample rules for DITA-TOPICS and DITAMAPS:
 
<ruleset filetypes="xml dita">
  <!-- Element rules -->
  <rule xpath="//*[contains(@class, 'topic/topic')]/*[contains(@class, 'topic/prolog')]//*[not(*)]" text="yes" attributeset="all-attrs" />
 
<!-- Attribute rules -->
<rule xpath="//*[contains(@class, 'topic/topic')]/*[contains(@class, 'topic/prolog')]//*/@*[local-name() != 'class']" />
<!-- MORE rules -->
<rule xpath="//*[contains(@class, 'topic/topic')]/shortdesc" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/context/p" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/conbody/p" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/title" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/steps/step/cmd" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/conbody/fig/title" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/steps/step/info/fig/title" text="yes" />
</ruleset>
 
<ruleset filetypes="ditamap">
<rule xpath="//*[contains(@class, 'map/map')]/title" text="yes" />
</ruleset>
 
8. You can now perform search on the DITA element

Avatar

Level 4

Thank you @nitshar ,

This is very helpful. I followed the steps and configured the DITA Element search. But I am not getting any search results, if I do the search. Can you please suggest, what are the Element Name and Attribute?

 

Beaula123_0-1718265527458.png

 

Avatar

Employee

Hi,

 

Prolog (metadata) elements, is required on the assets for this filter to work.

 

Example :

<topic id="GUID-2d5c9e47-065b-4048-be9f-9f742b2d032d">
<title>new</title>
<prolog>
<author type="test_author"> DITA Authors </author>
<metadata>
<audience experiencelevel="expert" type="programmer"></audience>
<category>Green</category>
</metadata>
</prolog>

<body>
<p> test content </p>
</body>
</topic>

 

Now, once the content is serialize, DITA Element filter can be used using prolog metadata:

Example :

audience as Element Name

experiencelevel as Attribute

expert as Value

 

Avatar

Level 4

@nitshar , Is there any way we can do with out using prolog element ?

Avatar

Correct answer by
Employee

yes, 

 

use the rules in serialization.config file as highlighted below :

 

<ruleset filetypes="xml dita">
  <!-- Element rules -->
  <rule xpath="//*[contains(@class, 'topic/topic')]/*[contains(@class, 'topic/prolog')]//*[not(*)]" text="yes" attributeset="all-attrs" />
 
<!-- Attribute rules -->
<rule xpath="//*[contains(@class, 'topic/topic')]/*[contains(@class, 'topic/prolog')]//*/@*[local-name() != 'class']" />
<!-- MORE rules -->
<rule xpath="//*[contains(@class, 'topic/topic')]/shortdesc" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/context/p" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/conbody/p" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/title" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/steps/step/cmd" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/conbody/fig/title" text="yes" />
<rule xpath="//*[contains(@class, 'topic/topic')]/taskbody/steps/step/info/fig/title" text="yes" />
</ruleset>
 
<ruleset filetypes="ditamap">
<rule xpath="//*[contains(@class, 'map/map')]/title" text="yes" />
</ruleset>
 
once data is indexed, the filter can be used on topic title, or on shortdesc text or on other created rules.
 
 

Example :

if following is the topic title tag ...

<title>TestSearch</title>

 

 

title  as Element Name

TestSearch as Value

 

 
 

Avatar

Level 4

Hi @nitshar ,

Currently we have added serializationconfig.xml code for complete path.

For example, 

The rule: <rule xpath="//*[contains(@class, 'topic/topic')]/body/p/ul/li" text="yes" />

The search working if the content has same tag structure as /body/p/ul/li.

This seems to be limited. Can you please suggest if there is any option that's work for the tag?

For example, a single rule for ul>li that works with in /p/ tag or out of /p/ tag.

 

Thanks in advance.