Create an alpha index of content items?

Topics: General
Feb 28, 2012 at 8:25 PM
Edited Feb 28, 2012 at 8:26 PM

I want to create an alpha list of my items for a specific content type. There are about 300 items, and I just want an alpha list where each letter of the alphabet shows up as a link and clicking the link takes you to a page with all the items where the title starts with that letter. 

Is this something that can be done with Projector? If so, how? I created a projection and it's a paginated list. It'll be pretty useful for a lot of scenarios but i'm not sure if it can support what I want in this particular alpha list scenario. 

Coordinator
Feb 28, 2012 at 8:40 PM

Yes. Use the grouping feature.

Feb 28, 2012 at 8:49 PM

Sorry, but where do i do that? Is it in the query setup, or the projector setup? 

I'm trying it right now and i see you can create groups of filters within the query. Would I create one such group for every letter of the alphabet? 

Coordinator
Feb 28, 2012 at 9:02 PM

Look at the video on Youtube about Orchard Projector. I discuss it at the end,

Feb 28, 2012 at 9:08 PM

I think I found it: Query -> Properties -> (Add Title Property) -> Grouping -> Title Property

But when I try to view the projection I'm getting a page with no content Items listed. I went back in and changed grouping to None and started getting out of memory exceptions. I also got some out of memory exceptions the first time I tried to set the layout for a projection as a grid. But later I tried viewing the grid one again and it worked the 2nd and 3rd times. 

WebDev.WebServer40.exe shot up to ~950MB, and DevEnv.exe go up to 475MB before the out of memory exception hit. 

Feb 28, 2012 at 9:09 PM

Thanks, I'll take a look at the video. 

Coordinator
Feb 28, 2012 at 9:17 PM

Can you repro the memory exception ? I am interested

Feb 28, 2012 at 9:42 PM

Sure, i'll try to get a consistent repro and post the steps. May email you some recipes in case my data helps repro the mem error.

Coordinator
Feb 28, 2012 at 9:59 PM

please email if it can help repro

Feb 28, 2012 at 10:05 PM

 

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Text.StringBuilder.ExpandByABlock(Int32 minBlockCharCount) +151
   System.Text.StringBuilder.Append(Char* value, Int32 valueCount) +73
   System.Text.StringBuilder.AppendHelper(String value) +30
   System.Text.StringBuilder.Append(String value) +196
   System.IO.StringWriter.Write(String value) +34
   System.Web.WebPages.WebPageBase.Write(Object value) +76
   CallSite.Target(Closure , CallSite , _Page_Themes_GETheme_Views_Document_cshtml , Object ) +137
   ASP._Page_Themes_GETheme_Views_Document_cshtml.Execute() in c:\projects\OrchardEnlistments\autroute\src\Orchard.Web\Themes\GETheme\Views\Document.cshtml:32
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +279
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +113
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model) +32
   Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) in c:\projects\OrchardEnlistments\autroute\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:134
   Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.<>c__DisplayClass28.<Discover>b__15(DisplayContext displayContext) in c:\projects\OrchardEnlistments\autroute\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:118
   Orchard.DisplayManagement.Descriptors.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in c:\projects\OrchardEnlistments\autroute\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:55
   Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in c:\projects\OrchardEnlistments\autroute\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:179
   Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in c:\projects\OrchardEnlistments\autroute\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:98
   Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in c:\projects\OrchardEnlistments\autroute\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:71
   Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable`1 parameters) in c:\projects\OrchardEnlistments\autroute\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:38
   Orchard.DisplayManagement.Implementation.DisplayHelperBehavior.InvokeMember(Func`1 proceed, Object target, String name, INamedEnumerable`1 args) in c:\projects\OrchardEnlistments\autroute\src\Orchard\DisplayManagement\Implementation\DisplayHelperFactory.cs:27
   ClaySharp.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:29
   ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:13
   ClaySharp.ClayBehaviorCollection.InvokeMember(Func`1 proceed, Object self, String name, INamedEnumerable`1 args) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:29
   Orchard.Mvc.ViewEngines.ThemeAwareness.<>c__DisplayClass7.<FindView>b__5(ViewContext viewContext, TextWriter writer, IViewDataContainer viewDataContainer) in c:\projects\OrchardEnlistments\autroute\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:63
   Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutView.Render(ViewContext viewContext, TextWriter writer) in c:\projects\OrchardEnlistments\autroute\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:90
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in c:\projects\OrchardEnlistments\autroute\src\Orchard\Mvc\Routes\ShellRoute.cs:147
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8969201
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Coordinator
Feb 28, 2012 at 10:10 PM

What are you doing to have it ? Projection page ? On how many content items ?

Feb 28, 2012 at 10:13 PM

Emailed you an export of my MetaData & Data. The projection filter is set to return all items of a particular content type (of which there are around 218 in the database. But each record for this type has several string properties that can be very long (they are HTML blurbs of varying lengths). It is set to order by Title part. 

Feb 28, 2012 at 10:14 PM

Error comes after i click the "View" link on the Projection, from: Dashboard-> Content -> (My projection) -> View

Coordinator
Feb 28, 2012 at 11:15 PM

Just tried with around 400 items including long text, and I can't see a big hit on memory.

Also I can't repro with your files because they reference very specific records. 

You might be better try to identify where the memory exception is coming from, or give me a whole module and some data.

Feb 28, 2012 at 11:21 PM

Thought you might be able to repro it with the Migrations.cs i sent too, but I guess you need the drivers and models and all that. If I have to package stuff to send but that will take some time. I'll work on this more tomorrow. 

Coordinator
Feb 28, 2012 at 11:49 PM

You might also want us to check this before we release 1.4 :/ ... tomorrow