Quick way to view active content model in Alfresco

When debugging custom project setups, I ran across a great tip to quickly check whether a content model is deployed in Alfresco. It uses a seeded webscript that provides a nicely formatted JSON view of the requested type, aspect, etc.

Simply visit the following URL, and adjust as needed. In the model name, substitute underscore for colons. If the class name is omitted it will dump everything. This works in at least 4.x.

  • [host:port]/alfresco/service/api/classes[/class]

For example, here’s a link and output for the type cm:content, assuming localhost:

Output:

   {
      "name": "cm:content",
      "isAspect": false,
      "isContainer": false,
      "title": "Content",
      "description": "Base Content Object",
      "parent":
      {
         "name": "cm:cmobject",
         "title": "cmobject",
         "url": "/api/classes/cm_cmobject"
      },
      "defaultAspects":
      {
         "sys:referenceable":
         {
            "name": "sys:referenceable",
            "title": "Referenceable",
            "url": "/api/classes/cm_content/property/sys_referenceable"
         },
         "sys:localized":
         {
            "name": "sys:localized",
            "title": "Translation",
            "url": "/api/classes/cm_content/property/sys_localized"
         },
         "cm:auditable":
         {
            "name": "cm:auditable",
            "title": "Auditable",
            "url": "/api/classes/cm_content/property/cm_auditable"
         }
      },
      "properties":
      {
         "cm:name":
         {
            "name": "cm:name",
            "title": "Name",
            "description": "Name",
            "dataType": "d:text",
            "defaultValue": null,
            "multiValued": false,
            "mandatory": true,
            "enforced": true,
            "protected": false,
            "indexed": true,
            "url": "/api/classes/cm_content/property/cm_name"
         },
         "cm:content":
         {
            "name": "cm:content",
            "title": "Content",
            "description": "Content",
            "dataType": "d:content",
            "defaultValue": null,
            "multiValued": false,
            "mandatory": false,
            "enforced": false,
            "protected": false,
            "indexed": true,
            "url": "/api/classes/cm_content/property/cm_content"
         }
      },
      "associations":
      {
      },
      "childassociations":
      {
      },
      "url": "/api/classes/cm_content"
   }

Hat tip to the Coding In A Hurry blog.

Share this page: Email this to someoneTweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInPin on PinterestShare on Reddit

I love your comments. Don't be shy, reply!

Leave a Reply

Your email address will not be published. Required fields are marked *

The "are you a human" quiz *