Trying to reorder an 800+ document library

Posted by Community Admin on 04-Aug-2018 14:42

Trying to reorder an 800+ document library

All Replies

Posted by Community Admin on 22-Jan-2015 00:00

Sitefinity 7.0

 Hello,

 Let me preface this post by stating that my original goal was to present documents alphabetically in a download list widget.  It seems the only way to do this is by manually clicking and dragging each document using the 'Reorder Documents' option.  This is not very efficient when it comes to large document libraries like the one I am working with, 800+ and growing.

Is there an easier way to sort the articles in the download list widget alphabetically?

 Another issue I came across after spending a whole day rearranging the documents, was that the 'Reorder Documents' option only lists 500 of the total documents.  Is there a way to have all of the documents listed so they can be reordered?  

 

Thanks in advance.

Posted by Community Admin on 27-Jan-2015 00:00

Hello,

In order to sort the documents in a Download list widget please open the Download list widget in edit mode, please click on Advanced -> ControlDefinition -> Views -> MasterListView and then find the SortExpression field. In this field you can set the sorting criteria. By default the documents are sorted by their publication date. If you would like to sort them by their Title you need to enter: Title ASC or Title DESC in the SortExpression field. Please save the changes and the documents in the download list widget will be saved as set in the advanced settings.

Regards,
Sabrie Nedzhip
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 27-Jan-2015 00:00

Thank you Sabrie, I'm new to Sitefinity, but seems to be very easy to pick-up.

 The SortExpression field works fine, but is there a way to get all of the documents in this one library to show up in the 'Reorder documents' option?  

A lot of these document title begin with articles like, "A" and "The" which completely nulls the purpose of ordering them alphabetically using just the SortExpression field.

Thank you.

Posted by Community Admin on 30-Jan-2015 00:00

Hello Eriq,

As far as I understand you have reordered the documents in the Sitefinity backend from the Reorder documents button under Content -> Documents and Files  -> <your document library> and you would like to display the documents in the same order on the frontend.

If so, can you please open the Download list widget in edit mode and under the Sort documents and files section please select As they are ordered in library. This way the documents will be displayed on the frontend as you have ordered them in your library.

Please refer to the following article for more details about the Download list widget.

Regards,
Sabrie Nedzhip
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 30-Jan-2015 00:00

Hello Sabrie,

 

Yes, I have already used the REORDER DOCUMENTS option and set the DOWNLOAD LIST WIDGET to sort the files as they are arranged in the library.  But the thing I noticed is that during the REORDER DOCUMENTS process, not all of the documents are showing up so they cannot be reordered.

 

I have 800+ documents in the library and the REORDER DOCUMENTS only shows exactly 500 of them.  So when end users see them in the  download list widget, the first few articles are showing up exactly the way I have ordered them, but at the end of the list there are always a few documents with no order because they did not show up in the REORDER DOCUMENTS window because of some limitation set.  

 Is there a setting  to show ALL of the documents in the library past the limit of 500 for REORDERING DOCUMENTS?

 

Thanks.

Posted by Community Admin on 04-Feb-2015 00:00

Hello,

Please note that the maximum number of documents which are retrieved by the DocumentsService and which are displayed under Content -> Documents and Files -> <your library> is set to 500 for performance reasons.

If you would like to display more than 500 documents, you can create a custom DocumentService (.cs file) which inherits from the default DocumentService and override the GetChildrenContentItems() items where you can set the service to retrieve the desired number of documents by setting the take parameter to the desired value.

Here is a sample code for the custom documents service for your convenience:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Sitefinity.Modules.Libraries.Web.Services;
using Telerik.Sitefinity.Web.Services;
using Telerik.Sitefinity.Modules.Libraries.Documents;
 
namespace SitefinityWebApp
    public class CustomDocumentService : DocumentService
    
        public override CollectionContext<DocumentLibraryItemViewModel> GetChildrenContentItems(string parentId, string providerName, string sortExpression, string filter, int skip, int take, string workflowOperation, bool excludeFolders = false, bool includeSubFoldersItems = false)
        
            take = 800;
            
    return base.GetChildrenContentItems(parentId, providerName, sortExpression, filter, skip, take, workflowOperation, excludeFolders, includeSubFoldersItems);
        
    

After that you need to tell Sitefinity to use your custom service. in order to do it, please go to the root of your project, then Sitefinity -> Services -> Content and open the DocumentService.svc file. Please change the service type with your custom one. In the context of the above sample it should look like below:
 
<%@ ServiceHost
    Language="C#"
    Debug="false"
    Service="SitefinityWebApp.CustomDocumentService"
    Factory="Telerik.Sitefinity.Web.Services.WcfHostFactory"
 %>

Please build the solution and restart the application in order for the changes to take effect. After performing the above, Sitefinity will use your custom service and will return 800 documents. If you would like always to return all the documents in the library, please set the take parameter to 0.

Regards,
Sabrie Nedzhip
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 05-Feb-2015 00:00

I will pass this on to our site administrator.

 

Thanks for all of your help Sabrie!

This thread is closed