Folder Schema missing for Assets | Community
Skip to main content
New Participant
May 12, 2018
Solved

Folder Schema missing for Assets

  • May 12, 2018
  • 12 replies
  • 7852 views

HI Team ,

I am going through a documentation below.

https://helpx.adobe.com/experience-manager/6-3/release-notes/folder-metadata-schema.html

We are using AEM 6.3 CFP2 . However we do not see this option on the tools section of AEM .

Can you please let me know  how to enable this option .

Thanks

Harish

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Hemant_arora

You need to install AEM 6.3.2.0 CFP1 and then the folder metadata schema option will appear

I just did that. Here is the link to download AEM-CFP-6.3.2.1

https://www.adobeaemcloud.com/content/marketplace/marketplaceProxy.html?packagePath=/content/companies/public/adobe/packages/cq630/cumulativefixpack/AEM-CFP-6.3.2.1

IT WORKS AS EXPECTED

Refer to Folder Metadata Schema

12 replies

smacdonald2008
New Participant
May 15, 2018

@@hemant arora - excellent community interaction - we marked your response as correct!

Hemant_arora
New Participant
May 15, 2018

Here is a sample AEM fiddle script to add foldermetadataschema to subfolders programatically

package apps.acs_002dtools.components.aemfiddle.fiddle;

import com.day.cq.search.*;

import com.day.cq.wcm.api.*;

import com.day.cq.dam.api.*;

import org.apache.sling.api.*;

import org.apache.sling.api.resource.*;

import org.apache.sling.api.servlets.*;

import java.io.IOException;

import javax.jcr.*;

import java.util.*;

public class fiddle extends SlingAllMethodsServlet {

    @Override

    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {

          // Code here

        //response.getWriter().println("Hello from " + request.getResource().getPath());

        Resource resource = request.getResourceResolver().getResource("/content/dam/AEM63App");

     

Resource res = request.getResourceResolver().getResource(resource.getPath()+"/jcr:content");

ValueMap properties = res.adaptTo(ValueMap.class);

String metaDataSchemaValue = properties.get("folderMetadataSchema", String.class);

response.getWriter().write(""+metaDataSchemaValue);

      

Session session =  request.getResourceResolver().adaptTo(Session.class);

        if (resource != null) {

           if (resource != null) {

Iterator<Resource> linkResources = resource.listChildren();

while (linkResources.hasNext()) {

Resource childResource = linkResources.next();

try{

Node childNode = childResource.adaptTo(Node.class);

childNode = childNode.getNode("jcr:content");

childNode.setProperty("folderMetadataSchema",metaDataSchemaValue);

session.save();

response.getWriter().write(""+childNode.getProperty("jcr:title").getString());

    

}catch(RepositoryException re){}

}

}

            response.setStatus(SlingHttpServletResponse.SC_OK);

        } else {

            response.setStatus(SlingHttpServletResponse.SC_INTERNAL_SERVER_ERROR);

            response.getWriter().write("ERROR");

        }

    }

       

    }

Hemant_arora
New Participant
May 15, 2018

Yes, its not inherited if there are existing subfolders inside a folder and you apply schema to only the parent folder.

But in case you have already applied schema to a parent folder and you are creating nee subfolders inside the parent then it will ask you to add a metadata schema while creating subfolder.

You can add folder metadata schema to subfolders programatically in case you have more number of subfolders.

You will be required to either write a workflow or event listener which will observe whenever a subfolder is created and the parent of which has a specific metadata schema applied, so copy that property to subfolder too.

of if you have less number of subfoders you can directly select the schema and use the option of apply to folder(s)

or

go to crx/de and add the property to the jcr:content node

folderMetadataSchema       /conf/global/settings/dam/adminui-extension/foldermetadataschema/test

or add that to your code and build it.

But yes when you create a new subfolder you will have to select.

I believe inheritance happens in case of assets only and not in folders.

deepalakshmip35
New Participant
April 23, 2020

Hi Hemant,

 

It is really a great explanation on creating a folder metadata and inheriting the folder metadata schema to sub-folders

Now I'm using AEM 6.5.

So still, do we have to create either workflow or event listener to inherit folder schema to subfolders? it won't apply by default as metadata schema works?

 

One more thing I'm trying to maximize the filed width as like the "Folder Title" field of the "Details" tab, but by default folder schema comes with a two-column view.

Is this possible to maximize the field width in folder metadata schema?

 

HarishDvAuthor
New Participant
May 15, 2018

Hi Hemant,

There is still an issue here.

The Schema Taxonomy looks like it it applicable for one folder.

The subfolders within this folder do NOT inherit this new schema.

Can we somehow get this applicable to sub folders ?

Thanks

Harish

Hemant_arora
New Participant
May 15, 2018
HarishDvAuthor
New Participant
May 15, 2018

Hi Hemant,

Thanks for the above info.

I just realised i am using the version 6.3.1.2 .

Can you please confirm the package i need to install , on top of this to get this feature ?

Thanks

Harish

Hemant_arora
Hemant_aroraAccepted solution
New Participant
May 14, 2018

You need to install AEM 6.3.2.0 CFP1 and then the folder metadata schema option will appear

I just did that. Here is the link to download AEM-CFP-6.3.2.1

https://www.adobeaemcloud.com/content/marketplace/marketplaceProxy.html?packagePath=/content/companies/public/adobe/packages/cq630/cumulativefixpack/AEM-CFP-6.3.2.1

IT WORKS AS EXPECTED

Refer to Folder Metadata Schema

Hemant_arora
New Participant
May 14, 2018

oh I understand your question now. Let me check that feature in 6.3.2.0. I was checking that on 6.4

HarishDvAuthor
New Participant
May 14, 2018

Hi Hemant,

I think you are missing my question .

I don't need a schema on assets. I am looking at adding a custom schema for asset folder. In other words I am trying to add some custom metadata on the sling:orderedFolder Node & NOT on dam:Asset.

Please look at my screen shot above.

Thanks

Harish

Hemant_arora
New Participant
May 14, 2018

Go to tools-> assets-> metadata schemas

Create a new schema

Edit the Schema

Add columns and custom fields

save the schema.

Now select this newly created schema and select the apply to folder option

select the folder where you want to apply the schema.

click on overwrite and you are done.

Now go to that folder and select any asset , click on properties , you will see the new custom metadata schema form with the custom fields that you defined.

so all existing and new files in that folder will follow the custom schema that you created and applied.

Here is the link for more information Metadata Schemas