{"id":283,"date":"2013-07-17T08:41:37","date_gmt":"2013-07-17T08:41:37","guid":{"rendered":"http:\/\/www.andreagirardi.it\/blog\/?p=283"},"modified":"2014-01-22T14:23:57","modified_gmt":"2014-01-22T14:23:57","slug":"debug-content-model-in-alfresco","status":"publish","type":"post","link":"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/","title":{"rendered":"Debug content model in Alfresco"},"content":{"rendered":"<p>When you need to customize Alfresco content model, not always everything works fine so, it&#8217;s necessary to find a way to check if your model is correct or not. It&#8217;s possible to use the built-in Get Class Definitions webscript to debug. Basically, you can use this webscript to see if an expected content type exists on Alfresco or not. You can also use this webscript to see if an expected content type exists on Alfresco or not. All you have to do is to call the webscript with your class name which in this case myroot:mycontent for me.<\/p>\n<pre lang=\"xml\">http:\/\/localhost:8086\/alfresco\/service\/api\/classes\/myroot_mycontent<\/pre>\n<p>Or you can call the same webscript without a class name, in this case webscript will dump every content type that exists on Alfresco.<\/p>\n<p>The response will be something like that:<\/p>\n<pre lang=\"xml\">\r\n\r\n   {\r\n      \"name\": \"labtest:Labtest_content\",\r\n      \"isAspect\": false,\r\n      \"isContainer\": false,\r\n      \"title\": \"Labtest content model\",\r\n      \"description\": \"\",\r\n      \"parent\":\r\n      {\r\n         \"name\": \"cm:content\",\r\n         \"title\": \"content\",\r\n         \"url\": \"\/api\/classes\/cm_content\"\r\n      },\r\n      \"defaultAspects\":\r\n      {\r\n         \"sys:referenceable\":\r\n         {\r\n            \"name\": \"sys:referenceable\",\r\n            \"title\": \"Referenceable\",\r\n            \"url\": \"\/api\/classes\/labtest_Labtest_content\/property\/sys_referenceable\"\r\n         },\r\n         \"sys:localized\":\r\n         {\r\n            \"name\": \"sys:localized\",\r\n            \"title\": \"Translation\",\r\n            \"url\": \"\/api\/classes\/labtest_Labtest_content\/property\/sys_localized\"\r\n         },\r\n         \"cm:auditable\":\r\n         {\r\n            \"name\": \"cm:auditable\",\r\n            \"title\": \"Auditable\",\r\n            \"url\": \"\/api\/classes\/labtest_Labtest_content\/property\/cm_auditable\"\r\n         }\r\n      },\r\n      \"properties\":\r\n      {\r\n         \"cm:name\":\r\n         {\r\n            \"name\": \"cm:name\",\r\n            \"title\": \"Name\",\r\n            \"description\": \"Name\",\r\n            \"dataType\": \"d:text\",\r\n            \"defaultValue\": null,\r\n            \"multiValued\": false,\r\n            \"mandatory\": true,\r\n            \"enforced\": true,\r\n            \"protected\": false,\r\n            \"indexed\": true,\r\n            \"url\": \"\/api\/classes\/labtest_Labtest_content\/property\/cm_name\"\r\n         },\r\n         \"labtest:Labtest_result_name\":\r\n         {\r\n            \"name\": \"labtest:Labtest_result_name\",\r\n            \"title\": \"Labtest result name [java uses to get this content]\",\r\n            \"description\": \"\",\r\n            \"dataType\": \"d:text\",\r\n            \"defaultValue\": null,\r\n            \"multiValued\": false,\r\n            \"mandatory\": false,\r\n            \"enforced\": false,\r\n            \"protected\": false,\r\n            \"indexed\": true,\r\n            \"url\": \"\/api\/classes\/labtest_Labtest_content\/property\/labtest_Labtest_result_name\"\r\n         },\r\n         \"cm:content\":\r\n         {\r\n            \"name\": \"cm:content\",\r\n            \"title\": \"Content\",\r\n            \"description\": \"Content\",\r\n            \"dataType\": \"d:content\",\r\n            \"defaultValue\": null,\r\n            \"multiValued\": false,\r\n            \"mandatory\": false,\r\n            \"enforced\": false,\r\n            \"protected\": false,\r\n            \"indexed\": true,\r\n            \"url\": \"\/api\/classes\/labtest_Labtest_content\/property\/cm_content\"\r\n         }\r\n      },\r\n      \"associations\":\r\n      {\r\n         \r\n         \"labtest:labtest_static_components\":\r\n         {\r\n            \"name\": \"labtest:labtest_static_components\",\r\n            \"title\": \"Labtest static components\",\r\n            \"url\": \"\/api\/classes\/labtest_Labtest_content\/association\/labtest_labtest_static_components\",\r\n            \"source\":\r\n            {\r\n               \"class\": \"labtest:Labtest_content\",\r\n               \r\n               \"mandatory\": true,\r\n               \"many\": true\r\n            },\r\n            \"target\":\r\n            {\r\n               \"class\": \"labtest:Labtest_static_component\",\r\n               \r\n               \"mandatory\": false,\r\n               \"many\": true\r\n            }\r\n         }\r\n         ,\r\n         \"labtest:labtest_dynamic_components\":\r\n         {\r\n            \"name\": \"labtest:labtest_dynamic_components\",\r\n            \"title\": \"Labtest dynamic components\",\r\n            \"url\": \"\/api\/classes\/labtest_Labtest_content\/association\/labtest_labtest_dynamic_components\",\r\n            \"source\":\r\n            {\r\n               \"class\": \"labtest:Labtest_content\",\r\n               \r\n               \"mandatory\": true,\r\n               \"many\": true\r\n            },\r\n            \"target\":\r\n            {\r\n               \"class\": \"labtest:Labtest_dynamic_component\",\r\n               \r\n               \"mandatory\": false,\r\n               \"many\": true\r\n            }\r\n         }\r\n      },\r\n      \"childassociations\":\r\n      {\r\n         \r\n         \r\n      },\r\n      \"url\": \"\/api\/classes\/labtest_Labtest_content\"\r\n   }\r\n<\/pre>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-linkedin\"><a rel=\"nofollow\" data-shared=\"sharing-linkedin-283\" class=\"share-linkedin sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span>LinkedIn<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-reddit sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span>Reddit<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow\" data-shared=\"sharing-twitter-283\" class=\"share-twitter sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow\" data-shared=\"sharing-facebook-283\" class=\"share-facebook sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span>Facebook<\/span><\/a><\/li><li class=\"share-skype\"><a rel=\"nofollow\" data-shared=\"sharing-skype-283\" class=\"share-skype sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=skype\" target=\"_blank\" title=\"Share on Skype\"><span>Skype<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-pocket sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span>Pocket<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>When you need to customize Alfresco content model, not always everything works fine so, it&#8217;s necessary to find a way to check if your model is correct or not. It&#8217;s possible to use the built-in Get Class Definitions webscript to debug. Basically, you can use this webscript to see if an expected content type exists [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-linkedin\"><a rel=\"nofollow\" data-shared=\"sharing-linkedin-283\" class=\"share-linkedin sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span>LinkedIn<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-reddit sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span>Reddit<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow\" data-shared=\"sharing-twitter-283\" class=\"share-twitter sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow\" data-shared=\"sharing-facebook-283\" class=\"share-facebook sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span>Facebook<\/span><\/a><\/li><li class=\"share-skype\"><a rel=\"nofollow\" data-shared=\"sharing-skype-283\" class=\"share-skype sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=skype\" target=\"_blank\" title=\"Share on Skype\"><span>Skype<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-pocket sd-button share-icon\" href=\"https:\/\/www.andreagirardi.it\/blog\/debug-content-model-in-alfresco\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span>Pocket<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[14],"tags":[12],"_links":{"self":[{"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/posts\/283"}],"collection":[{"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/comments?post=283"}],"version-history":[{"count":3,"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":286,"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/posts\/283\/revisions\/286"}],"wp:attachment":[{"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/media?parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/categories?post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.andreagirardi.it\/blog\/wp-json\/wp\/v2\/tags?post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}