Use data from your data source
A data source is a system where you store and manage the data for your organization. These are your systems of record like JIRA, SQL Databases, PIM, or PLM. AEM Guides provides the feature to connect with your data source and use the data from them.
You can also connect to JSON data files using a file connector. Upload the JSON file from your computer or browse it from the 蜜豆视频 Experience Manager assets. Then, create content snippets or topics using the generators.
Data Sources panel
Select Data Sources
Based on your setup your administrator can configure a data source connector:
-
If you鈥檙e using the October 2023 release or later, learn how to configure a data source connector from the user interface in the Cloud Services Installation and Configuration Guide.
-
If you鈥檙e using the July 2023 or September 2023 release, learn how to configure a data source connector in the Cloud Services Installation and Configuration Guide.
-
If you鈥檙e using the 4.3.1 release or later, learn how to configure a data source connector from the user interface in the On-premise Installation and Configuration Guide.
-
If you鈥檙e using the 4.3 release, learn how to configure a data source connector in the On-premise Installation and Configuration Guide.
Show list view or tile view
You can toggle between the List view or tile View to view the various data sources in the form of a list or as tiles.
Select a data source to view the content snippet generators and the topic generators available for the selected data source.
List view
List of connected data sources.
Tile view
View the connected data sources as tiles.
You can use the data from data sources in two ways:
- Insert a content snippet
- Create a topic
Insert a content snippet from your data source
蜜豆视频 Experience Manager Guides provides the feature to connect with your data source. You can fetch your data, insert it into your topics, and edit it. You can easily create a content snippet using the content snippet generator and reuse it within your topics.
Perform the following steps to create a content snippet using the content snippet generator and insert it in your topic:
-
Select Data Sources
-
Select a data source to view the content snippet generators available for the selected data source.
The Data Sources panel lists the available content snippet generators.
-
Select Add to add a new content snippet generator. The Add content snippet generator panel opens.
-
Enter the query in the Data query text box. Select Copy sample query to quickly copy a data query. Instead of manually creating the query, you can copy and paste the sample query into the Data query text box. Then, simply edit the query as per your data requirements.
note note NOTE Experience Manager provides different sample queries for all resources in the various data sources. These map to the data source from which you are fetching the data. -
If you use a file connector, you can upload the JSON file from your computer or browse a JSON file from 蜜豆视频 Experience Manager assets.
note note NOTE You will view the options to upload or browse files in place of a data query if you use a file connector. -
Select the template which maps with your data source from the Data mapping template dropdown.
The out-of-the-box templates for the selected data source are displayed in the drop-down. For example, you can view the 鈥渟ql-table鈥 template for datasource named 鈥淧ostgreSQL鈥 datasource.note note NOTE If your administrator has configured customized templates, then you鈥檙e also shown those templates in the drop-down list (based on the template path configurations done by your administrator). You can also use Velocity tools in the templates. Learn more about how to use Velocity tools. -
The Resource dropdown appears for some connectors like REST Client, Salsify, Akeneo, and Microsoft ADO. Select any resource from the dropdown and connect to it to create a content snippet or a topic using the generator for it.
note note NOTE Your administrator can configure default resources or add resources for multiple URLs while configuring the data source connectors. -
Select Fetch to fetch the data from the data source and apply the template on the data that results from the SQL query.
-
You can view the data in the preview or the DITA source view.
-
The preview shows how the data will be displayed when inserted into the content. The preview displays a small fraction of the data in the format of the selected template.
For example:- If you鈥檝e selected the sql-table template, you can view the SQL data in a tabular format.
- If you鈥檝e selected the jira-ordered-list template, you can view an ordered list for the Jira issues.
-
The source view shows the data in the DITA source view.
-
Add a content snippet generator. View the data in source or preview mode.
-
To save the results of the query, enter the name of the generator and then select Add. A new content snippet generator is added to the list.
note note NOTE You need to follow the file naming convention for the name of the new content generator. You cannot have a space in the name of the content snippet generator. Also, you cannot save a new content generator with the name of an existing content generator. An error occurs.
Options for a content snippet generator
Right-click on a content snippet generator to open the Options. Using the options, you can perform the following operations:
-
Preview: Use this option to open a pane and view a small fraction of how the data is displayed in the output.
-
Insert: Use this option to insert the selected content snippet into the topic opened for editing in the Editor. As the data is inserted as a snippet, you can also edit the data within your topic in the Editor.
note note NOTE Insert option appears only while you are editing a topic. -
Edit: Use this option to make changes in the content snippet generator and save it.
-
Delete: Use this option to delete the selected content snippet generator.
-
Duplicate: Use this option to create a duplicate or a copy of the selected content snippet generator. The duplicate is created with a suffix (like generator_1) by default.
Insert a query data
You can also use the Query data
Edit and insert a data snippet.
Create a topic using the topic generator
A topic generator helps you create topics containing data from your sources. You can quickly create a topic generator and then generate the topics using the generator. Each topic can contain data in various formats, like tables, lists, and paragraphs. For example, in a topic, you can add a table that includes the details of all new products and a list of all the products which will be discontinued for sale.
The topic generator can create the topics containing the data and a DITA map for all topics. You also can <conref>
these topics in your content. This helps you keep your data in sync with the data source, and you can easily update them.
Create a topic
Perform the following steps to create a topic using the topic generator:
-
Select a data source to view the content snippet generators and the topic generators available for the selected data source.
Add a topic generator for a connected data source.
-
Select Add
-
Enter the values in the fields under the following three tabs of the Add topic generator panel:
Fetch Configuration
Add the Data Query, Data mapping template, and Root node details for the topic generator and give it a unique name in the Fetch Configuration panel.
-
Enter the query in the Data query text box. Select Copy sample query to quickly copy a data query. Instead of manually creating the query, you can copy and paste the sample query into the Data query text box. Then, simply edit the query as per your data requirements.
note note NOTE Experience Manager provides different sample queries for all resources in the various data sources. These map to the data source from which you are fetching the data. -
If you use a file connector, you can upload the JSON file from your computer or browse a JSON file from 蜜豆视频 Experience Manager assets.
note note NOTE You will view the options to upload or browse files in place of a data query if you use a file connector. -
Select the template which maps with your data source from the Data mapping template dropdown.
note note NOTE If your administrator has configured customized templates, then you鈥檙e also shown those templates in the drop-down list (based on the template path configurations done by your administrator). For example, you can create a topic template containing an ordered list, tables, paragraphs, or other DITA elements. -
Enter the Root node. This is the node at which you want to access your data. The topic generator then creates each topic at the level defined in the root node. For example, you can add 鈥榠ssues鈥 as the root node in Jira. So, if a query returns 13 issues, you will get 13 topics, one topic for each issue.
-
Select Fetch to fetch the data from the data source and apply the template on the data that results from the SQL query. The preview shows a small fraction of how the topic appears in the format of the selected template. For example, you can view a single Jira issue with all the fields that result from the query.
-
Enter the name of the topic generator.
note note NOTE You need to follow the file naming convention for the name of the new topic generator. You cannot have a space in the name of the topic generator. Also, you cannot save a new topic generator with the name of an existing topic generator. An error occurs.
Output Configuration
Enter the Output path and Topic naming convention details in the Output Configuration panel. Generate a DITA map and name it.
- Enter the Output path details where you want to save your topics.
- In the Topic naming convention, you can enter a value or a variable with velocity tags. The new topics will follow the convention. For example, you can enter the
$key
to create topics based on Jira keys. - Enable the option Generate a map if you want to create a map that contains all the generated topics.
- Enter the name of the new DITA map.
note note NOTE The Topic generator generates the DITA map on the same output path as the topics. Metadata
Select the metadata properties from the drop-down to pass to the topics. Name dropdown lists both the custom and the default properties.
For example, in the following screenshot,
dc:description
,dc:language
,dc:title
, anddocstate
are the default properties for which you can define the values. You can create a custom property like author and define its value.Add the metadata properties in the Metadata panel to pass to the topics.
-
-
Enter the generator鈥檚 name and select Save to save the query results. A new topic generator is added to the list.
-
Select Save and Generate to save the topic generator and generate new topics from the topic generator.
Generate new topics from an existing topic generator.
note note NOTE If the topics already exist, then the generator updates the data in the existing topics.
Options for a topic generator
Right-click on a topic generator to open the Options. Using the options, you can perform the following operations:
-
Generate: This option generates the topics for the selected topic generator. You can also use this option to update the existing topics. It connects to the data source and fetches the updated data. While generating the content, this option is disabled, and you view a loader.
note note NOTE If your topic already exists, you can either overwrite the data in the topic or save it as a new version. Generate a topic, and if the file already exists, save it as a new version or overwrite it.
-
View Log: Select this option to view the content generation log file. The log file opens in a new tab. You can view the errors, warnings, information messages, and exceptions in the log file. This option is enabled if you have generated the content for the selected topic generator.
-
Preview: Use this option to open a pane and view a small fraction of how the data is displayed in the output.
-
Edit: Use this option to change and save the topic generator. This option is disabled while you鈥檙e generating the content.
-
Delete: Use this option to delete the selected topic generator. This option is disabled while you鈥檙e generating the content.
-
Duplicate: This option creates a duplicate or copy of the selected topic generator. The duplicate is created with a suffix (like
topic-sample_1
) by default.
Use Velocity tools in the data source templates use-velocity-tools
Experience Manager templates also support the Velocity tools (version 2.0). These tools help you apply various functions to the data you fetch from the data sources. Learn more about the use of the and the functions that you can apply.
Perform the following steps to use a Velocity tool in a template:
-
Edit a Velocity template in the Editor.
-
Add a tool and its function in the
<tool.function>
format. For example:- To generate a random number using the math tool, use
$mathTool.random
. - To generate the sum of numbers using the math tool, use
$mathTool.add(num1, num2)
.
- To generate a random number using the math tool, use
-
Use the template to create a content snippet or topic.
-
After you apply the template to the data, you can view the data in the preview or the DITA source view.
You can use the following tools within the Velocity templates to apply various functions to the data you fetch from the connector:
-$alternatorTool
$classTool
$contextTool
$conversionTool
$dateTool
$comparisonDateTool
$displayTool
$escapeTool
$fieldTool
$loopTool
$linkTool
$listTool
$mathTool
$numberTool
$renderTool
$resourceTool
$sortTool