{"id":17,"date":"2013-09-09T11:32:00","date_gmt":"2013-09-09T11:32:00","guid":{"rendered":""},"modified":"2021-08-31T10:12:25","modified_gmt":"2021-08-31T09:12:25","slug":"wcm-workspace-findbynamedocumenttypes-sitearea-or-findbytypedocumenttypes-sitearea-does-not-return-root-level-items","status":"publish","type":"post","link":"https:\/\/www.srivittal.com\/wp\/?p=17","title":{"rendered":"WCM Workspace findByName(DocumentTypes.SiteArea, &#8220;&#8221;) or findByType(DocumentTypes.SiteArea) does not return root level items"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left;\">When you are developing using the custom WCM API, espcially where I am using 8.0.0.1, I could not get to the root level site areas at all using the above methods. It was driving me crazy when I went in detail through the documentation where they have mentioned this work around.<\/p>\n<p>Use the following method and it will work to get to the root Site Areas.<\/p>\n<p>QueryService queryService = workspace.getQueryService();<\/p>\n<p>Query query = queryService.createQuery(SiteArea.class);<br \/>query.addSelector(Selectors.nameLike(&#8220;SA_%&#8221;));<br \/>ResultIterator results = queryService.execute(query); <\/p>\n<p>Hope this works for others.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When you are developing using the custom WCM API, espcially where I am using 8.0.0.1, I could not get to the root level site areas at all using the above methods. It was driving me crazy when I went in detail through the documentation where they have mentioned this work around. Use the following method &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,13,21,16],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-ibm","category-portal","category-wcm","category-websphere","entry entry-center"],"_links":{"self":[{"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":1,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions\/77"}],"wp:attachment":[{"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}