Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Febinjs6 4 posts 24 karma points
    Feb 15, 2012 @ 08:39
    Febinjs6
    0

    Umbraco 5 reading Home page children using REST service

    I am currently working on an **Umbraco 4 to 5 migration project**. I am stuck with reading the Home page childrens via  **REST service** of an Umbraco 5 site (for navigation). I knew that the REST services can be exposed via MVC areas/routes and controller actions, and 

    using **hive** to get **data from Umbraco** . I used to get the data from Umbraco 4 with the following code

        var nodes = uQuery.GetNodesByXPath(

        "//root/descendant-or-self::* [@isDoc and (@level = 2) and string(umbracoNaviHide) != '1']"

     

    I tried with the following code to fetch the data and it is not working

                var childs = RoutableRequestContext.Application.Hive.GetReader(new Uri("content://"));

                using (var uow = childs.CreateReadonly<IContentStore>())

                {

                    var childIds = uow.Repositories.GetChildRelations(FixedHiveIds.ContentRootSchema, FixedRelationTypes.DefaultRelationType).Select(x => x.DestinationId).ToArray();

                    IEnumerable<TypedEntity> children = uow.Repositories.Get<TypedEntity>(true, childIds);

                }

    Does anyone know how to **fetch** the data from **Umbraco5 using hive**?

Please Sign in or register to post replies

Write your reply to:

Draft