Searchable file collection

Posted by Community Admin on 03-Aug-2018 09:56

Searchable file collection

All Replies

Posted by Community Admin on 09-May-2011 00:00

Hi all,

I'm new here, and haven't used Sitefinity much so far. I'm about to start working on a web site using Sitefinity 4.1, and have several questions in mind. I have to create the following system:

- Let users upload files
- Let users fill in custom fields for each of these files, 6 custom fields, which are multi-level lists where you can only pick a single option (ie: you select 6 values among predetermined choices)
- Let users search these files depending on these 6 fields, on the front side (like, they could do a search based on 2 of the 6 fields, which would lead them to a page with all the matching results... or more complex: letting them build a search filter, step by step)

What would be the best way to create such a system?

I thought of using custom hierarchical classifications to create the fields, and bind them to files. I wonder if there's a better solution, and whether there is or not, I'd appreciate all the advice and suggestions I can get.
Also, unless I missed something, disabling multiple choices requires diving into the Administration / Settings / Advanced maze. No easier way?

And I'm clueless about how to handle the search side.
By the way, consider I have a file with its Region field (one of the 6 fields) set to "France", France being below the "Europe" group (as it's a hierarchical list). If I do a search based on Region = "France", naturally, this file would be among the results. But I'd also like this file to be in the results if I do a search based on Region = "Europe" (ie: parents return results for all of their children). On the other hand, I don't want to force the site admins to check the boxes for all of the item parents in the back office (they'd only pick a single item for each list)... I hope that was clear enough. If it wasn't, let me know.

Thanks for reading, and thanks in advance for your help.

Posted by Community Admin on 12-May-2011 00:00

Hi Thomas,

For the file upload and filling custom fields I would suggest you to take a look at the implementation of our Jobs Module included in the Sitefinity SDK and this tutorial from our Documentation. You can choose then whether you will be populating these fields with tags/categories for users to choose among or you can implement drop downs with predefined values. Filtering the documents on these custom fields could be achieved by using the GetValue() method to obtain the value of the custom field, or you can simply put a tags/categories widget on your page that will filter them accordingly. Please let me know if the functionality you desired differs from the suggested solution, or if you need any additional information. I'll be glad to help you further.

Kind regards,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 12-May-2011 00:00

Hi Thomas,

Just a quick follow-up. I have attached a sample page that I've used for testing purposes, and I'm also pasting the sample code below.

var tagA_Id = new Guid("insert the Tag Guid from sf_taxa table in the Database");
var tagB_Id = new Guid("insert the Tag Guid from sf_taxa table in the Database");
var tagC_Id = new Guid("insert the Tag Guid from sf_taxa table in the Database");
var Cat1Id = new Guid("insert the Category Guid from sf_taxa table in the Database");
var Cat2Id = new Guid("insert the Category Guid from sf_taxa table in the Database");
var CatY_Id = new Guid("insert the Category Guid from sf_taxa table in the Database");
 
var content = App.WorkWith().BlogPosts().Where(bp => bp.Status == ContentLifecycleStatus.Live
                                                            && (
                                                                    (
                                                                         bp.GetValue<TrackedList<Guid>>("Tags").Contains(tagA_Id))
                                                                         && bp.GetValue<TrackedList<Guid>>("Tags").Contains(tagB_Id)
                                                                         && bp.GetValue<TrackedList<Guid>>("Tags").Contains(tagC_Id)
                                                                    )
                                                                &&
                                                                    (
                                                                        bp.GetValue<TrackedList<Guid>>("Category").Contains(Cat1Id)
                                                                        || bp.GetValue<TrackedList<Guid>>("Category").Contains(Cat2Id)
                                                                    )
                                                                &&
                                                                    (
                                                                        bp.GetValue<TrackedList<Guid>>("Category").Contains(CatY_Id)
                                                                    )
 
                                                               ).Get().ToList();
Grid1.DataSource = content;
Grid1.DataBind();

The code filters content items by multiple tags/categories. I believe you might find this sample useful for the search part implementation of your project. Please note that with GetValue() you can get the value of any of your custom fields not only the tags/categories. I hope you find this information useful.


All the best,
Boyan Barnev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 12-May-2011 00:00

Thanks a lot, Boyan. This will certainly help.
I'll check all of this out, and post back if I have more questions.

Based on what my client told me, I think I'm going to add all search/filter arguments in the URL (like: ?region=something&service=somethingelse...), as they want to pass through several pages as they refine their search.

Posted by Community Admin on 14-May-2011 00:00

Hi Thomas,

Thank you for the follow up. For now I'll mark this thread as closed on my side, please feel free to reopen it once you have obtained additional information on the matter and if you need any further assistance delivering the desired functionality. It was a pleasure for me to assist you.

Regards,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 25-May-2011 00:00

For the record, I can't manage to run the Jobs module.
I get a Telerik.OpenAccess.RT.sql.SQLException. Exception message in French:

La base de données 'C:\Documents and Settings\(...)\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS\master.mdf' existe déjà. Choisissez un autre nom de base de données.
Impossible de joindre le fichier 'C:\Program Files\Telerik\Sitefinity 4.1\SDK\Content\Samples\asp\CSharp\Jobs\SitefinityWebApp\App_Data\Sitefinity.mdf' en tant que base de données 'master'.


At some point, I added the missing Sitefinity.mdf mentioned above (found a master.mdf file somewhere on my disk,  copied it there and renamed it to Sitefinity.mdf), and got the module to run (or at least it would start and ask me for my Sitefinity license). Then I updated my Sitefinity to 4.1 SP1, and I also updated the SDK to the same version. After that, I could no longer compile the Jobs module, it would complain about some project references it couldn't resolve. So I downgraded the SDK to 4.1, which let me compile the module again. But now, I can't solve the above error anymore. Not a smooth experience...

Can anyone help? Thanks.

Edit: same result using the Sitefinity.mdf file from the C:\Program Files\Telerik\Sitefinity 4.1\SDK\Content\DatabaseData\Empty folder.

Edit 2: may be related to this issue, but I can't manage to fix it yet.

Edit 3: working around this issue by working on a distant database for now.

Posted by Community Admin on 28-May-2011 00:00

Hello Thomas,

Can you please clarify the steps you are taking when running  the Jobs module from the SDK. Are you using the SDK Browser that we released with our 4.1 SDK? If so, when you select to run a module, be it in visual studio or directly display it in the browser, the SDK Browser asks you to create a database for it - you can just point it to your SQL Server instance and provide it with valid account that has CREATE permissions and it will create the DB automatically for you. Please take a look at the attached screenshot for more details.

Best wishes,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 30-May-2011 00:00

Hi,

No, I didn't use the SDK Browser, I just simply launched the sln file from the Windows explorer. Checking out the SDK Browser, I see the "Run sample in browser" and "Open in Visual Studio" buttons are greyed out and not clickable. This could be due to the fact I have Visual Studio 2010 Express? Or possibly because it couldn't connect to the Internet due to our company proxy? Or maybe because it says "Not Licensed" in the bottom left corner (then again, I can't see where to put my license)... *shrugs*

Anyway, to be able to keep going, what I did was create a new project using the Project Manager, use a distant database, and work from there. I decided to create a custom widget for my needs, as a custom module (such as the Jobs one) seems way too complicated for what I need. I don't need something customizable or reusable, just something to drop on one page and be done with it.

On a side note, a colleague gave me a code sample to access classifications using their name rather than guid, isn't that more desirable in general? To me, it seems more readable and makes it so you don't depend on a particular guid. Is there a significant performance impact or something else I should be aware of? Or is it due to the multilingual aspect?

Posted by Community Admin on 01-Jun-2011 00:00

Hi Thomas,

I don't think the last two(licensing/internet connection) could be the reason, maybe the Visual Studio edition could cause this. Anyways, now that you've taken a different approach to this, I just wanted to clarify on your latest question, that there should be no problem using either, as it doesn't matter in terms of performance (since it's a overload of the same method). I personally recommend using Guid when referencing an item that can be renamed, as the Guid stays the same, while the title might change.

Kind regards,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 14-Jun-2011 00:00

Hi,

I'm running into another problem: when trying to rename a classification, and saving, I get an alert that just says "Error". Not very useful. It's the same if I just edit a classification, change nothing at all and just try to resave it. Actually, this happens even if I try to create a new classification.

The existing classifications (the 6 of them) were automatically created from C# code, then added to the "Documents & Files" page through the backend. This is still with Sitefinity 4.1 SP1.

Is this a known issue? What can I do?

Edit: I see this happens with the deployed application on a distant server, but works fine locally. Both sites use the same database. Any way to debug this?

Posted by Community Admin on 15-Jun-2011 00:00

Hi Thomas,

Can you, please, inspect the error using a tool like FireBug and let me know of the results, as the error message is pretty generic. If the  same project is working fine locally, then the problem could be in your deployment environment settings. . Could you verify in IIS - HandlerMappings section wheter all .svc extensions have been set to "All verbs" in the "verbs" section of "Request restrictions" option. Thanks in advance.

Kind regards,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 15-Jun-2011 00:00

Hi Boyan,

In IIS, I right clicked my web site, clicked "Properties", went to "Home Directory", "Configuration", and could confirm there was indeed a ".svc" entry set with Verbs set to "All". (Couldn't find a mention of "Request restrictions", but it may not matter... This is with IIS 6, by the way.)

Having debugged a little with Firebug, I see:
- function _saveChanges is called, isFormValid is true, then clientManager.InvokePut is called
- A while later, in Telerik.Sitefinity.Resources.Scripts.MicrosoftAjax.js, there is a call to d._webRequest.completed(Sys.EventArgs.Empty) which triggers the error
- This completed function contains a call to: c(a,a._executor,K)
- This c function contains a call to: a(e,d)
- This a function contains a call to: b[a](c,d)
- This b[a] function contains: return b.apply(a,arguments) - and it doesn't seem like "b" has an "apply" method... which seems to be the problem.

Any ideas? Thanks.

Edit: in case this may be a clue or related, the site on distant servers also have troubles with my license (« You are running a trial version of Sitefinity 4.1. » appears on the front from time to time), while the license is visible on the backend. No difference if I try to reactivate it.
The backend suffers from other problems as well, like the "Upload documents or other files" page not letting you upload files (the rectangle where the Silverlight element is is empty).

Edit 2: I managed to solve the Silverlight upload plugin issue by adding extension mime types (.xaml, .xap, .xbap) in my web site config. But the classification bug remains. I also can't create roles, etc.

Posted by Community Admin on 20-Jun-2011 00:00

Hello Thomas,

Thank you for the additional information. The errors you are reporting are related to MS AJAX variables, so it's really hard to guess what might be the reason behind. Can you please let me know when this error started appearing and if you have done any changes prior to it. The reason I'm asking this is that you mentioned you already have some categories present, so I assume this functionality did work up to a certain point in time. Have you by any means changed something related to scripts that are loaded or CDN in the backend configuration settings? Or maybe added some custom fields to taxonomies/modified the backend page?

Best wishes,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 20-Jun-2011 00:00

Hello Boyan,

No, I don't think it ever worked. Everything I've successfully created was done locally, from Visual Studio. So these categories I cannot edit from the distant server were created when I was running my site from my own machine, the database being the same as the one used by the distant server.

Posted by Community Admin on 20-Jun-2011 00:00

Hello Thomas,

So you're saying that the project runs fine locally when running it from VS integrated server or our Project manager, is that right?

Kind regards,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 20-Jun-2011 00:00

Yes, that's right.

Posted by Community Admin on 27-Jun-2011 00:00

Hi Boyan,

Can you help? Is there a way I can retrieve the settings used by the integrated server, for example?
I'm supposed to release our first Sitefinity 4 site next week...

Thanks.

Posted by Community Admin on 27-Jun-2011 00:00

Hello Thomas,

Thank you very much for the patience, and please excuse the delay in my answer, I understand the urgency of the situation, it looks like I've missed your previous reply. Since the project is running fine using an integrated server that's good news - meaning the project itself is working properly, and we can isolate the problem to be an infrastructure settings issue, I believe. Going back through our conversation history I remember you having an issue with Silverlight not being configured properly as well,. I'm sorry, maybe I should have asked you earlier, but can you, please, make sure you have everything in IIS set up as per the following article from our Documentation? Provided you have a 100% working project on a local server, following the instructions should enure the same functionality on IIS, please try the above guide and get back to me with some updated information on the situation. Thanks in advance.

Best wishes,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 28-Jun-2011 00:00

Hi Boyan,

I had already seen this page. I closely followed all the steps, from 1 to 15 (for IIS 6).
I also followed the steps at the bottom ("Configuring folder permissions"), although I was a bit confused as it mentioned things I couldn't find, such as "Read & execute".

Here are 2 screenshots of my configuration, in case you can find anything suspicious. I do not believe "Scripts and Executables" was needed, but I put it rather than "Scripts only", just in case.

Any idea?

PS: stopping the web site, recycling the app pool and restarting the web site is enough to test new settings each time, right?

Posted by Community Admin on 30-Jun-2011 00:00

Hi,

I have a similar problem with a site, it work locally but I obtain dysfunctions on the remote server. I can save any actions. I just got a popup Error....

I'm on windows server 2003 and IIS6, I follow the documentation. My "Network User" on IIS pool have full control right on App_Data folder and Silverlight configuration are made.

It probably miss some informations into installation documentation but I don't find the solution. If you have a clue ?

Regards,
Nicolas

Posted by Community Admin on 30-Jun-2011 00:00

Hi,

I investigate about the popup error, I obtains this with Firebug :

Content-Length  103
Content-Type    text/html
Server  Microsoft-IIS/6.0
Date    Thu, 30 Jun 2011 09:46:11 GMT
Connection  close
Requête
Host    myServeur.fr.world:13980
User-Agent  Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding gzip, deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection  keep-alive
X-Requested-With    XMLHttpRequest
SF_UI_CULTURE   en
Content-Type    application/json; charset=UTF-8
Content-Length  103
Cookie  .SFAUTH-InsiteTest3=1730C4576A5BCCECEC3FC667BE053852F0EF5B0B278A2A6A3626C4BDF534C93A33A6F105BC164A4546BFB286ACB127A14DD9F0CFA3461E905A76B33465E750606842D0A307D1758405E9B1D2637DBB134C8DAD77E0A4FACA110D26EB32D7419D8B223938012551F840921CDFAB5B85D24B65809816E25239FB4441CEA8DDCF4A825F062D8DFDCCEFEBC093AA4CA91D57AECF7C5BB0A3CEA63CC5D774329E7E086A0B7763E08DE888F83D0A2A1C008CACACC075F5F315540FB5730BD4B54F52C4B973E8D316FC4317095C6849BED60A46; .SFROLES-InsiteTest3=t+gOVCERCzd0xebyWh4qH44dfhbsSa08iLcCxRS6T3tuH/n7+qPlfeNxmGlgXXngNVmvAfFMuT3CddwDPWBKXHJ2NQLrLpXVD5L0GJRfKLJ7WtWe6lxou5zeey3/FzZ1URUKzxx74x5RuhzMYGeuLpyd+H95J3wYirkL8yd1ZFfenNpCNIjJHmc7wvqgsjjrqFgs4hJQyTWL122CIPLDs8KjBof8d86UoICuWJpZ5p5VNNOd4LCFrtRPJMJMNRCyohp1iu1kGRTG7ox3iEF9mgzqP8s6mn69/Ua9lgYgjQQeIikoR9F7EtE0sbo6NLSPY8oqocOiTV5jOOWOFS+J4Fk0qukRLBsjMIpaAbzozycHsxvPOfEuO+fuy757H2iVW2fj8mtqVhOjc8nkYOttfD2Bn68BEuQ6cEhat8IuWd6JGF1f0tnjB4JTbmGH9QGNk5f0KTgVHuNh+VwFc7bTE/8lErsCs0O2apRmdap4Quzt07HWyN5GpL+4DbYvFdMSjAxNVUjfdJGt3OHwuBnidMoIhUQ/G6D1hvT6eVvJHMt1TOa0UKKbjUR47JRKp9E0Z4pgA0IFXZvAExE4IQbvDSoe2RpAb7FzcFwhB4j5lJantH8MAFqCrCYnUCpFs6U1IzYlo+loas/WnNpEtedKor2iEqu/ai4ojXivt1DFNUHL3AeaTpohO/4BAAA=; .ASPXAUTH=A3575A522BC669B46843B91972F23C79A0180D2A4C20010EBA87FEDF2B4D8B19156C1E666E27B993A348AB022C96196055D11D685BBBBF970BF8977F09DB54372DF74D86396A37CBA1640BE917D8F50D

But I don't know why It made this....

Regards,
Nicolas

Posted by Community Admin on 30-Jun-2011 00:00

Hi,

Can you, please, enable a trace log of the web services exceptions  when browsing the News page and clicking around (loading the page, trying to edit an article, creating an article, deleting an article etc - just browse around on that section for a while so you can reproduce the errors and they will be recorded in the log). You can find more information on how to enable and save the log on this KB article. Please do the above actions and then send me the SdrConfigExample.e2e file from the root of your website. This will tell us why the web service is failing. Also if possible send us the error logs from ~/App_Data/Sitefinity/Logs. Thank you for your cooperation in advance on this point.

One other thing that comes to my mind, and if possible, please test whether the site will run fine on another server, although very small, there might be a probability that this is a host-related problem.

Best wishes,
Boyan Barnev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 01-Jul-2011 00:00

Hi Boyan,

the error isn't visible into Sitefinity Log.
The GET method of services works fine, but when it's PUT I obtains all times a Http 404.

And I'll already try on two servers....

Regards,
Nicolas

Posted by Community Admin on 01-Jul-2011 00:00

Hi Nicolas,

Is there info inside service tracer log? The issue looks like specific to the IIS server. Do you have problems running the project from the ProjectManage or Visual Studio web servers?
There might be a problem if you have some tools installed on IIS like UrlScan

All the best,
Ivan Dimitrov
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 01-Jul-2011 00:00

Hi Ivan,

Ah, good call. UrlScan 2.5 is indeed installed on our servers. What are our options, then? We cannot just uninstall it. Can we configure it so it plays nicely with Sitefinity?

Thanks.

Posted by Community Admin on 01-Jul-2011 00:00

Hi Ivan,

I get UrlScan logs :

[07-01-2011 - 13:59:06] ---------------- Initializing UrlScan.log ----------------
[07-01-2011 - 13:59:06] -- Filter initialization time: [07-01-2011 - 13:59:06]  --
[07-01-2011 - 13:59:06] ---------------- UrlScan.dll Initializing ----------------
[07-01-2011 - 13:59:06] UrlScan will return the following URL for rejected requests: "/<Rejected-By-UrlScan>"
[07-01-2011 - 13:59:06] URLs will be normalized before analysis.
[07-01-2011 - 13:59:06] URL normalization will be verified.
[07-01-2011 - 13:59:06] URLs must contain only ANSI characters.
[07-01-2011 - 13:59:06] Requests with Content-Length exceeding 30000000 will be rejected.
[07-01-2011 - 13:59:06] Requests with URL length exceeding 260 will be rejected.
[07-01-2011 - 13:59:06] Requests with Query String length exceeding 2048 will be rejected.
[07-01-2011 - 13:59:06] Only the following verbs will be allowed (case sensitive):
[07-01-2011 - 13:59:06]     'GET'
[07-01-2011 - 13:59:06]     'HEAD'
[07-01-2011 - 13:59:06]     'POST'
[07-01-2011 - 13:59:06] Requests for following extensions will be rejected:
[07-01-2011 - 13:59:06]     '.exe'
[07-01-2011 - 13:59:06]     '.bat'
[07-01-2011 - 13:59:06]     '.cmd'
[07-01-2011 - 13:59:06]     '.com'
[07-01-2011 - 13:59:06]     '.htw'
[07-01-2011 - 13:59:06]     '.ida'
[07-01-2011 - 13:59:06]     '.idq'
[07-01-2011 - 13:59:06]     '.htr'
[07-01-2011 - 13:59:06]     '.idc'
[07-01-2011 - 13:59:06]     '.shtm'
[07-01-2011 - 13:59:06]     '.shtml'
[07-01-2011 - 13:59:06]     '.stm'
[07-01-2011 - 13:59:06]     '.printer'
[07-01-2011 - 13:59:06]     '.ini'
[07-01-2011 - 13:59:06]     '.log'
[07-01-2011 - 13:59:06]     '.pol'
[07-01-2011 - 13:59:06]     '.dat'
[07-01-2011 - 13:59:06] Requests containing the following headers will be rejected:
[07-01-2011 - 13:59:06]     'translate:'
[07-01-2011 - 13:59:06]     'if:'
[07-01-2011 - 13:59:06]     'lock-token:'
[07-01-2011 - 13:59:06]     'transfer-encoding:'
[07-01-2011 - 13:59:06] Requests containing the following character sequences will be rejected:
[07-01-2011 - 13:59:06]     '..'
[07-01-2011 - 13:59:06]     './'
[07-01-2011 - 13:59:06]     '\'
[07-01-2011 - 13:59:06]     ':'
[07-01-2011 - 13:59:06]     '%'
[07-01-2011 - 13:59:06]     '&'
[07-01-2011 - 14:00:54] Client at 184.44.121.29: Sent verb 'PUT', which is not specifically allowed. Request will be rejected.


Regards,
Nicolas

Posted by Community Admin on 01-Jul-2011 00:00

Hi Ivan,

I add PUT in [AllowVerbs] section in urlscan.ini and it solve the problem. But I'm not familiar with this tool, can you confirm me that's the good way ?

Regards,
Nicolas

This thread is closed