public string Handle(System.Collections.Specialized.NameValueCollection request) { string path = request["path"]; var filter = CreateFilter(request["filter"]); var parent = navigator.Navigate(urls.StartPage, path); var childItems = filter.Pipe(parent.GetChildren().Union(nodes.GetChildren(path))); var children = childItems.Select(c => ToJson(c)).ToArray(); return("{\"path\":\"" + Encode(parent.Path) + "\", \"children\":[" + string.Join(", ", children) + "]}"); }
public void Handle(HttpContextBase context) { string path = context.Request["path"]; var filter = CreateFilter(context.Request["filter"]); var parent = navigator.Navigate(urls.StartPage, path); var childItems = filter.Pipe(parent.GetChildren().Union(nodes.GetChildren(path))); var children = childItems.Select(c => ToJson(c)).ToArray(); context.Response.ContentType = "application/json"; context.Response.Write("{\"path\":\"" + Encode(parent.Path) + "\", \"children\":[" + string.Join(", ", children) + "]}"); }
public void GetChildren_Includes_UploadFolder() { initializer.Start(); vnf.Register(nodeProvider); var result = vnf.GetChildren("/"); Assert.That(result.Count(), Is.EqualTo(1)); Assert.That(result.First().Name, Is.EqualTo("upload")); }
public void Handle(HttpContextBase context) { string path = context.Request["path"]; var filter = CreateFilter(context.Request["filter"], context.Request["selectableTypes"], context.Request["selectableExtensions"]); var parent = navigator.Navigate(urls.StartPage, path); var childItems = parent != null ? adapters.ResolveAdapter <NodeAdapter>(parent).GetChildren(parent, Interfaces.Managing).Where(filter) : Enumerable.Empty <ContentItem>(); childItems = childItems.Union(virtualNodes.GetChildren(path)).ToList(); var children = childItems.Select(c => ToJson(c)).ToArray(); context.Response.ContentType = "application/json"; context.Response.Write("{\"path\":\"" + Encode(parent.Path) + "\", \"children\":[" + string.Join(", ", children) + "]}"); }