{"id":4822,"date":"2018-01-08T17:17:37","date_gmt":"2018-01-08T11:47:37","guid":{"rendered":"\/?p=4822"},"modified":"2019-08-21T18:40:35","modified_gmt":"2019-08-21T13:10:35","slug":"adding-custom-asset-metadata-in-aem-cms","status":"publish","type":"post","link":"https:\/\/www.argildx.us\/technology\/adding-custom-asset-metadata-in-aem-cms\/","title":{"rendered":"Adding Custom Asset Metadata in AEM CMS and How to Use It"},"content":{"rendered":"
PROBLEM STATEMENT<\/strong><\/h5>\n

Working in AEM CMS and need to add custom metadata like tags, dates, or text properties to images and videos? Read this quick how-to from our AEM experts.<\/span><\/p>\n

Step 1:<\/strong><\/h5>\n

Go to projects page ( http:\/\/<host>:<port>\/projects.html<\/span> )<\/p>\n

Select \u2018Tools\u2019 from the right rail and then go to \u2018Assets\u2019 and select \u2018Metadata Schema\u2019.<\/p>\n

\"Side\u00a0\"Side \"Side<\/p>\n

Step 2:<\/strong><\/h5>\n

Click on add button and provide a name to your schema.<\/p>\n

In this case, I have created a schema named \u2018DemoSchema\u2019.<\/p>\n

\"Schema<\/p>\n

Step 3:<\/strong><\/h5>\n

Select your schema from the list by checking the checkbox and click on edit.<\/p>\n

Here you will get an empty form in tab layout with all the widgets present in the right section,\u00a0we can drag and drop widgets to our form.<\/p>\n

\"Form<\/p>\n

Step 4:<\/strong><\/h5>\n

Provide a name for your tab from settings and drag widgets onto the form.<\/p>\n

Step 5:<\/strong><\/h5>\n

Select a widget and go to setting option on the top right.<\/p>\n

\u00b7 Provide name to a field using \u2018Field Label\u2019.<\/p>\n

\u00b7 In \u2018Map to property\u2019 field give the property path in which you want the value to be stored inside the image file. This property will be automatically created once this field will get authored.<\/p>\n

\u00b7 Give placeholder (If required), choose distinct options like required, editable, empty in read-only.<\/p>\n

\u00b7 If a field is wrongly placed either drag it to right position or delete it using the delete icon below properties.<\/p>\n

Step 6:<\/strong><\/h5>\n

After making your schema. Select your schema and click on \u2018Apply to folders icon on the top rail and select the folders on which you want your schema to be applied.<\/p>\n

\"Schema<\/p>\n

Properties will look like this:<\/p>\n

\"Assets<\/p>\n

Step 7:<\/strong><\/h5>\n

To utilize these properties in sightly used in AEM CMS, make a java class using resource API.<\/p>\n

In Java, I have injected the image path and then I\u2019ve extracted resource out of it using resource resolver and extracted properties out of it.<\/p>\n

@Model(adaptables\u00a0= {\u00a0Resource.class,\u00a0SlingHttpServletRequest.class\u00a0}, cache =\u00a0true)\u00a0\r\n\r\npublic\u00a0class\u00a0ImageMetadataModel\u00a0{\u00a0\r\n\r\n\u00a0\r\n\r\n@Inject\u00a0\r\n\r\n@Optional\u00a0\r\n\r\nprivate\u00a0String\u00a0imagePath;\u00a0\r\n\r\n\u00a0\r\n\r\n@SlingObject\u00a0\r\n\r\nprivate\u00a0ResourceResolver\u00a0resourceResolver;\u00a0\r\n\r\n\u00a0\r\n\r\npublic\u00a0String\u00a0getProperty\u00a0()\u00a0{\u00a0\r\n\r\nResource\u00a0resource\u00a0=\u00a0resourceResolver.getResource(imagePath\u00a0+\u201c\/jcr:content\u201d);\u00a0\r\n\r\nString\u00a0property\u00a0=\u00a0\u201c\u201d;\u00a0\r\n\r\nif\u00a0(resource\u00a0!=\u00a0null) {\u00a0\r\n\r\nValueMap\u00a0valueMap\u00a0=\u00a0resource.getValueMap();\u00a0\r\n\r\nif\u00a0(valueMap.containsKey(\u201cpropertyname\u201d)) {\u00a0\r\n\r\nproperty\u00a0=\u00a0valueMap.get(\u201cpropertyname\u201d,\u00a0String.class);\u00a0\r\n\r\n}\u00a0\r\n\r\n}\u00a0\r\n\r\nreturn\u00a0property;\u00a0\r\n\r\n}\u00a0\r\n\r\n}<\/pre>\n

Interested in more training and support for your organization using AEM CMS? <\/span>Request a consultation<\/span><\/a> to discuss Argil DX managed services.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

PROBLEM STATEMENT Working in AEM CMS and need to add custom metadata like tags, dates, or text properties to images and videos? Read this quick how-to from our AEM experts. Step 1: Go to projects page ( http:\/\/<host>:<port>\/projects.html ) Select \u2018Tools\u2019 from the right rail and then go to \u2018Assets\u2019 and select \u2018Metadata Schema\u2019. \u00a0 … Read more<\/a><\/p>\n","protected":false},"author":9,"featured_media":7292,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","content-type":"","footnotes":""},"categories":[66],"tags":[81,65,25,82,83,84,41,85,27,86,87,88,89,90],"yst_prominent_words":[534,2369,2377,1427,1831,2017,1833,2376,1220,2372,2378,2370,837,979,2373,2374,2371,1111,2375,2379],"acf":[],"yoast_head":"\nAdding Custom Asset Metadata in AEM CMS and How to Use It<\/title>\n<meta name=\"description\" content=\"Working in AEM CMS and need to add custom metadata like tags, dates, or text properties to images and videos? Know all about it here.\" \/>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.argildx.us\/technology\/adding-custom-asset-metadata-in-aem-cms\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding Custom Asset Metadata in AEM CMS and How to Use It\" \/>\n<meta property=\"og:description\" content=\"Working in AEM CMS and need to add custom metadata like tags, dates, or text properties to images and videos? Know all about it here.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.argildx.us\/technology\/adding-custom-asset-metadata-in-aem-cms\/\" \/>\n<meta property=\"og:site_name\" content=\"Argil DX\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-08T11:47:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-21T13:10:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.argildx.us\/wp-content\/uploads\/2018\/01\/Adding-Custom-Asset-Metadata-in-AEM-CMS-.png\" \/>\n\t<meta property=\"og:image:width\" content=\"431\" \/>\n\t<meta property=\"og:image:height\" content=\"233\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.argildx.us\/#website\",\"url\":\"https:\/\/www.argildx.us\/\",\"name\":\"Argil DX\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.argildx.us\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.argildx.us\/technology\/adding-custom-asset-metadata-in-aem-cms\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.argildx.us\/wp-content\/uploads\/2018\/01\/Adding-Custom-Asset-Metadata-in-AEM-CMS-.png\",\"width\":431,\"height\":233,\"caption\":\"Assets, article link, description, caption, credits, tags, date, source\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.argildx.us\/technology\/adding-custom-asset-metadata-in-aem-cms\/#webpage\",\"url\":\"https:\/\/www.argildx.us\/technology\/adding-custom-asset-metadata-in-aem-cms\/\",\"name\":\"Adding Custom Asset Metadata in AEM CMS and How to Use It\",\"isPartOf\":{\"@id\":\"https:\/\/www.argildx.us\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.argildx.us\/technology\/adding-custom-asset-metadata-in-aem-cms\/#primaryimage\"},\"datePublished\":\"2018-01-08T11:47:37+00:00\",\"dateModified\":\"2019-08-21T13:10:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.argildx.us\/#\/schema\/person\/7583783869e92b1d4ccd40dbb2aef076\"},\"description\":\"Working in AEM CMS and need to add custom metadata like tags, dates, or text properties to images and videos? Know all about it here.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.argildx.us\/technology\/adding-custom-asset-metadata-in-aem-cms\/\"]}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/www.argildx.us\/#\/schema\/person\/7583783869e92b1d4ccd40dbb2aef076\",\"name\":\"Arpit Rathi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.argildx.us\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/20e56987516b8528ddbcb4f9fa8aabe6?s=96&d=mm&r=g\",\"caption\":\"Arpit Rathi\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/posts\/4822"}],"collection":[{"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/comments?post=4822"}],"version-history":[{"count":0,"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/posts\/4822\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/media\/7292"}],"wp:attachment":[{"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/media?parent=4822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/categories?post=4822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/tags?post=4822"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.argildx.us\/wp-json\/wp\/v2\/yst_prominent_words?post=4822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}