I have written a Python script that converts metadata configuration captured in a MindMap file into JSON files that can be referenced in the JSON Path data entry box found in the Settings for a metadata field. The content of the JSON file has the format below:
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
I finally figured out how to complete this task. The steps once understood are fairly straight forward, I just was not able to find information in the documentation as easily as I had hoped.
In the end I used these steps:
Place JSON Files in the Project:
Reference JSON Files in Metadata Schema:
Example Configuration:
{ "properties": { "title": "Title", "description": "Description" } }
Further, the filter.xml file needed to be updated to include the directory created to store the JSON files such that the Jackrabbit plugin configuration would recognize it and not fail the build because they are considered to be foreign. This was done following these steps:
Locate the filter.xml File:
Edit the filter.xml File:
Example Configuration:
<?xml version="1.0" encoding="UTF-8"?> <workspaceFilter version="1.0"> <filter root="/apps/your-project"/> <filter root="/etc/your-project"/> <!-- Add your new directory here --> <filter root="/content/dam/your-new-directory"/> </workspaceFilter>
Save and Commit:
Once I had done these steps, my configured pipelines were able to build and then deploy the updates I made.
Thanks for the help @SreenivasBr , you got me thinking differently which allowed me to find what I needed. Hopefully these steps will help someone else in future.
Can AEM not access the mindmap directly? If yes, then AEM can process it and store the JSON for use within author.
If authoring the options is the problem, you can consider this - https://adobe-consulting-services.github.io/acs-aem-commons/features/generic-lists/index.html
The authors can make use of this feature to author the options and this can be referred in metadata schema options.
We are using OOTB AEM Experience Manager Cloud and want to keep things as close to OOTB as possible. To this end we are attempting to use the functions of the existing application rather than add ACS AEM Commons.
As to the commit, push and build of the project with the JSON files added to the repository, I had the jackrabbit-filter throw an error for where I added the files to the repo. So first things first, I need to understand better how to add the JSON files to the instance so that they are accepted as part of the project. Any suggestions to point me in the right direction there are welcome!
I finally figured out how to complete this task. The steps once understood are fairly straight forward, I just was not able to find information in the documentation as easily as I had hoped.
In the end I used these steps:
Place JSON Files in the Project:
Reference JSON Files in Metadata Schema:
Example Configuration:
{ "properties": { "title": "Title", "description": "Description" } }
Further, the filter.xml file needed to be updated to include the directory created to store the JSON files such that the Jackrabbit plugin configuration would recognize it and not fail the build because they are considered to be foreign. This was done following these steps:
Locate the filter.xml File:
Edit the filter.xml File:
Example Configuration:
<?xml version="1.0" encoding="UTF-8"?> <workspaceFilter version="1.0"> <filter root="/apps/your-project"/> <filter root="/etc/your-project"/> <!-- Add your new directory here --> <filter root="/content/dam/your-new-directory"/> </workspaceFilter>
Save and Commit:
Once I had done these steps, my configured pipelines were able to build and then deploy the updates I made.
Thanks for the help @SreenivasBr , you got me thinking differently which allowed me to find what I needed. Hopefully these steps will help someone else in future.
To use these configuration files as part of a metadata schema form's field configuration you will need to take a part of the full path to use in JSON Path field:
ui.apps/src/main/content/jcr_root/apps/<your-project>/config/metadata-config.json
I have highlighted above the section to use so that it is clear. In the UX it looks like this:
To upload and manage JSON files for metadata schema configuration in AEM, and follow best practices, here’s a streamlined process:
Best Practices for Uploading JSON Files for Metadata Configuration:
Location for JSON Files:
Use a dedicated folder under /content/dam for organizing metadata configuration files. You've already done this by adding your files under /content/dam/myprogram/json_metadata_field_config_files.
Ideally, store the files in a location like /content/dam/myprogram/json_metadata_field_config_files/ (as you have) so that they can be accessed by the JSON Path for metadata field definitions.
JSON Path:
In the JSON Path data entry box, you should reference the relative path from the root of the DAM to your file. Since the path you provided is /content/dam/myprogram/json_metadata_field_config_files/001-Asset-Type.json, you should enter that exact path:
/content/dam/myprogram/json_metadata_field_config_files/001-Asset-Type.json
Deployment and Availability:
After pushing the files via Git to the appropriate repository location (e.g., ui.content/src/main/content/jcr_root/dam/myprogram/json_metadata_field_config_files), the files need to be deployed to make them accessible in AEM.
Kick off the deployment pipeline in your AEM environment to push the files into the /content/dam/ directory. Once deployed, the metadata configuration (including the options) will be available for the metadata field definition.
Scripting and Automation:
To reduce manual work, your Python script is a great solution for generating the JSON files based on metadata configurations. If possible, set up an automated CI/CD pipeline that can handle changes in the configuration automatically, so the JSON files are updated and deployed without manual intervention.
Use a version-controlled repository (e.g., Git) for these JSON files so that they can be easily maintained and updated when changes are needed.
Maintainability and Versioning:
Keep JSON files well-organized and versioned in your Git repository. It’s a good practice to include the date or version information in the file name to easily track changes over time.
Example file naming convention: 001-Asset-Type-v1.json, 002-Category-v2.json, etc.
Error Handling and Validation:
Ensure your Python script validates the JSON file structure before generating it. This helps to avoid issues in AEM related to incorrect JSON formats or missing required fields.
Ease of Use for Authoring:
Once deployed, authors will be able to select these configurations via the Metadata Schema editor in AEM. It’s also possible to update the configurations without altering AEM directly, which provides a more efficient and scalable solution.
In Summary:
Enter Path in JSON Path Data Entry Box: /content/dam/myprogram/json_metadata_field_config_files/001-Asset-Type.json
Deploy JSON Files via Git: Commit, push, and deploy to make them accessible in AEM.
Automate: Use a script or CI/CD pipeline for easier maintenance.
Organize & Version: Store JSON files in a version-controlled manner.
Following these best practices will make it easier to maintain your metadata configurations while minimizing manual updates.
Hi @AmitVishwakarma,
Views
Likes
Replies
Views
Likes
Replies