Kentico 11 hiding media files from universal site search - search

I have multiple PDF media files in a Kentico 11 website which I have redirected to our new website where the updated media file documents now reside. We must keep these old media files on the original website due to various resources which reference these file links (which now redirect to the new site with the updated files).
I would like to exclude these old media files from being found through the universal website search on the original website.
The files need to remain on the original website for redirect purposes but want to exclude them from search.
Thank you for any help.

I assume the media files are stored in the Content Tree using (your own copy of) the CMS.File page type? You have to update your Search index to exclude this CMS.File page type or excluded a certain path. Kind of depends how you can identify these files.
Something like:
Path: /YourArchivedDocuments/%
Page types: CMS.File
This will exclude all CMS.File types that are located anywhere below the YourArchivedDocuments folder.
See more info about how to exclude on devenet:
https://docs.kentico.com/k11/configuring-kentico/setting-up-search-on-your-website/using-locally-stored-search-indexes/creating-local-search-indexes/defining-local-page-indexes#Defininglocalpageindexes-Addingexcludedcontent
If you have the media stored in the Media Library you probably have coded a Custom Search Index since Kentico won't index Media library files out of the box. So you would have to adjust your custom code.

Related

Kentico Media Library search feature not searching sub folders of selected folder

Is there any way for Kentico Media Library application to search the sub folders of selected folder?
Files copied from FTP need to be "imported" into Kentico. If they were separated by folders/sub folders, you have to go to every single folder and "import" that folder's files.
I should not have to use Kentico API to do this simple task.
I am afraid but the search is looking into the current folder only. You can send a request to productmanagement#kentico.com as a feature request.
For the import - I see your point but there could be also the opposite need - what if someone wants to import only certain files from certain folder(s). It is the same as if you would upload the files through the UI - you need to do it per folder. But I hear what you are saying maybe there could be some setting for this. Again, you can send the feature request directly to the product managers.

Kentico permanent link vs direct path

I'm working on some site that all links (dynamic + hard-coded) to media library are permanent links (with getmedia...), which made it so hard to locate the exact folder of the files and update them. I've asked some developer and heard that permanent links are more secure as the system can check who have access to download the materials. Is it a fair statement and why/why not? Thanks for your input!
This is not a fair or correct statement. Access is set at the individual medial library directory, not an individual file level.
For example, if you have an Images media library which has no security behind it, you can access it directly with a URL of:
/site/media/images/logo.png or /getmedia/<guid>/logo.png
and the image will display without issue.
Now you have another media library called "Secure_Files", if you attempt to access:
/site/media/secure_files/file1.pdf
You'll get an error or a login page because the security is set on the
/site/media/secure_files directory.
Here is the documentation on securing media libraries.
By default, Kentico does not check the See library content permission for visitors on the live site. If you wish to require users to have this permission to view media library content, you need to enable the following settings in the Content -> Media category of the Settings application:
Use permanent URLs
Check file permissions
See the note at the very bottom of this documentation page.
Permanent Link is made up of:
/getmedia/
Guid ID
Image Path
.aspx
Eg: /getmedia/C73B5-6A0-4F6-878-3C29D792014/IMG_3860.jpg.aspx
Direct Path is made up of:
/
Site Name
Media Library Folder Name
Image Path
Eg: /google/media/Blog-images-from-Kentico-Cloud/IMG_360.jpg

Adding files with external link to Documents & Media

I'm trying to add an external link to a file and this external link should be stored in the same way as a file is stored inside of Liferay's Documents and Media portlet instead of uploading a file.
We have a collection of both PDFs and web forms (externally to liferay) and I want them all to be browsable and searchable from the same location within the Documents and Media portlet.
Does anyone know any kind of hack to accomplish this?
Forget the document library portlet for your special case. It's not possible to store link to external file nor asset.
To me the best choice is a custom Web content structure and template. Build a structure that can store external reference and description and any other info you need.
Associate a template to the structure to have a display form.
Use an asset publisher to view data in page. Using this way the content will be searchable and browseable.
#baxtheman

Creating a link to a downloadable file in Orchard CMS

I've spent several hours trying to figure this out; hopefully, it's an easy solution and the difficulty is simply because I'm brand new to Orchard CMS and no where near an expert web developer...
I've created a Products Download page and need to insert hyperlinks to files that exist on the file system.
the path to the file (on disk) is : c:\Orchard CMS\Downloads\ProductOne\File1.zip
in the page editor, I insert a hyperlink reference with the following URL: /Downloads/ProductOne/File1.zip
When I hover over the hyperlink, it looks correct: http://localhost:12345/Downloads/ProductOne/File1.zip
However, when I click the link, I receive the following exception:
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Any help would be extremely appreciated!
If you don't want to play with source code and web.config files you should use Orchard Media feature. It allows you to upload files into Orchard filesystem and manage those. Links to files uploaded this way look like http://www.myorchardsite.com/Media/[Media folder path]/YourFile.zip
If you are not an experienced developer, I'd strongly advise you to take this approach. The only drawback is that you'd have to reupload those files into Orchard. But this is not as bad as it looks - you can zip them and upload as a single file (Orchard will take care of unpacking the archive if you check the checkbox below upload field).
You need a web.config file that allows the files to be served. You can use one from one of the content directories that can be found in modules or themes.

SharePoint - Obtaining all files from a web

I have a requirement wherein I have to obtain all the files of a web recursively (i.e. traversing through the folders and sub folders) and display them for the user through SP Object Model.
This has to be security trimmed, in the sense, if the user doesn't have sufficient privileges to view or open the file, then that file shouldn't be taken into account. Is it possible to obtain all the files without looping through each and every document library, folders and sub folders?
Also, I don't want the default document libraries like web part gallery, master page gallery,etc to be listed out. Any insights on how to achieve this?
The Content Query Web Part can get you most of the way there. Out-of-the-box you could set this up to show all files (based on a content type or content type category) from a site collection. You could even filter to remove system files although that might be a little tricky to get the filters right.
If that doesn't get you far enough, then you could write a web part that extends the Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart class. You could override the Filters (by setting the FilterField1, FilterType1, FilterOperator1, FilterValue1, etc).
The security trimming should happen for you by the default behavior of the ContentQueryWebPart. The Web Part and Master Page galleries will get filtered out based on your content type settings so you shouldn't have to worry about those.

Resources