Friday, December 23, 2005

Modifying Resource Browser to Display Thumbnail for Bitmaps

The Resource Browser (Web Author - Resource Manager) ships with MCMS doesn't provide a thumbnail preview for bmp files. That is acceptable as bmp is not a web image format. But if you are interested in showing a thumbnail for bmp files, it can be done via a customized Resource Manager.

1. Create a class inheriting Microsoft.ContentManagement.WebAuthor.ResourcesBrowse
a) Create a class library.
b) Body of the class -

using System;
using System.Drawing;
using Microsoft.ContentManagement.WebAuthor;
using Microsoft.ContentManagement.Publishing;

namespace MCMS
{
public class CustomResourceBrowser : ResourcesBrowse
{
public CustomResourceBrowser()
{
}

//Create a new method to hide the default DataBindResourceColumnThumbnailUrl
protected new string DataBindResourceColumnThumbnailUrl(object dataitem)
{
Resource resource = (Resource)dataitem;
string url = string.Empty;
IntPtr Missing = IntPtr.Zero;
if(resource.FileExtension.ToLower()=="bmp")
{
using(Image image = Bitmap.FromStream(resource.OpenReadStream()))
{
using(Image thumbImage = image.GetThumbnailImage(32,32,null,Missing))
{
thumbImage.Save(@"PhysicalPath"+resource.Name,System.Drawing.Imaging.ImageFormat.Icon);
url = "http://WebPath/"+resource.Name;
}
}
}
else
{
url = resource.UrlThumbnail;
}
return url;
}
}
}

2. Add the following references
a) using System.Drawing
b) System.Web
c) using Microsoft.ContentManagement.WebAuthor
d) using Microsoft.ContentManagement.Publishing

3. Create a temporary folder with appropriate rights for a web user to write data to that. Have the folder in a saver place as it can be assessed by anyone. Make it as a virtual directory. In the PhysicalPath above class replace it with the path of this directory and WebPath with the virtual directory name.

4. Deploy the dll in the bin folder of your MCMS project.

5. Make a copy of ResourcesBrowse.aspx - its default location "C:\Program Files\Microsoft Content Management
Server\Server\IIS_CMS\WebAuthor\Dialogs\ResourceBrowser\Management\"

6. Open ResourcesBrowse.aspx in notepad and change the Page derivative as bellow
<%@ Page language="c#" Codebehind="ResourcesBrowse.aspx.cs" SmartNavigation="true" AutoEventWireup="false"
Inherits="MCMS.CustomResourceBrowser" %>

This will make thumbnail in the temporary folder for bitmap files, which will be referred by Resource Manager - used to show the preview.

Note: Take precautions before using this method as ResourcesBrowse.aspx may get changed without any notification.

19 Comments:

Blogger eemali said...

Private Label Rights

2:00 AM  
Anonymous kajal sharma said...

Independent high services in Mumbai, from collage, corporate world, glamour world, high society, they want enjoyment with others we just meets their desire and demands.

8:21 PM  
Blogger Drik Lover said...

My name is Sonam Oberoi, ludhiana - I am a

young from ludhiana. I am tall, slender, and dress fashionably. Dehradun- I really love men. I don‘t care how

you look like or how old you are. Independent

Ludhiana Escort -
If you are a real gentleman and you are polite, Ludhiana female models courteous and have very

clean cleanliness I will give you the best time of your life.

Ludhiana Escort Service
Ludhiana Escorts
Independent Ludhiana Escort
Escorts In Ludhiana
Ludhiana Escort Female
Ludhiana Escorts Agency

Jalandhar Escorts
Jalandhar Escort Service
Jalandhar Escorts Agency
Jalandhar Escorts Loves
Jalandhar Escorts Female
Independent Jalandhar Escort

Dehradun Escorts
Dehradun Escort Service
Dehradun Escorts Agency
Dehradun Escorts Loves
Dehradun Escorts Female
Indepenent Dehradun Escort

3:55 AM  
Blogger Drik Lover said...

My name is Sonam Oberoi, ludhiana - I am a young from ludhiana. I am tall, slender, and dress fashionably. Dehradun- I really love men. I don‘t care how you look like or how old you are. Independent Ludhiana Escort - If you are a real gentleman and you are polite, Ludhiana female models courteous and have very clean cleanliness I will give you the best time of your life.

4:43 PM  
Blogger Bubli Roy said...

We are offering one of the most new motives and inexpensive rates of Independent Escort in Dehradun with many collections only on for all new strugler clients. Dehradun Escorts Services , Escorts in Dehradun, Dehradun Escorts Girls, Dehradun Escort Models, Dehradun Call Girls, Independent Escorts in Dehradun, Dehradun Escorts, Dehradun Escorts Agency.

Dehradun Call Girls
Dehradun Escort

2:47 AM  
Blogger Julisa Roy said...

Asian escorts are sweet, they listen to you patiently and loves you passionately like you are the only one in this world who matters to them. Hence many straight as well as lesbian and bisexual people now readily looking out for an asian escorts nyc agency which can provide them a beautiful Asian lady with whom they can spend a magical night.

Agra Escort Service
Agra Call Girls
Escort In Agra

Agra Escort Service
Agra Call Girls
Escort In Agra

1:46 AM  
Anonymous Anonymous said...

agra escort
agra escorts
agra escort
agra escort
agra escort

10:26 PM  
Blogger sweeti sharma said...



Agra Escorts Services

Hey, I'm Sweeti your 19yrs doll from Agra Escorts Agency .Let me melt all of your stress away, with total relaxation in Cyko escorts agency and FUN!!

Agra escorts service
Agra escorts service
Agra escort
Escort in agra
Agra independent escorts
Agra call girls

Contact me For Fun in Agra

2:38 PM  
Blogger Unknown said...

Escorts in Agra are versatile, seductive and high class in any position. Our Independent Escorts in Agraacc are expert adult entertainers and forms, keep to make your days and nights colorful,
Agra Escort
Agra Escorts
Agra Escort Service
Escorts In Agra
Udaipur Escort
Udaipur Escorts
Udaipur Escort Service
Lucknow Escort
Lucknow Escorts
Lucknow Escort Service

5:27 PM  
Blogger sooni Goa said...

If you want a reliable source of escorts then hiring from a reputed escort agency is a good choice.
Chandigarh call girls service
Chandigarh escort
Jaipur Escorts
Jaipur call girls,
Pune Escort
Agra Escorts Agency
Goa Escort Service
Agra Escorts

4:45 AM  
Blogger Mona Malik said...

such a nice post! great love to read this one.
lucknow escorts
Lucknow Escorts
lucknow call girls
escorts in lucknow
Escorts In Lucknow
call girls in lucknow
mathura escorts
Mathura Escorts
Mathura escorts
Mathura call girls
escorts in mathura
Escorts In Mathura
call girls in mathura
lucknow escorts
Lucknow Escorts
lucknow call girls
escorts in lucknow
Escorts In Lucknow
call girls in lucknow
agra escorts
Agra Escorts
Agra escorts
Agra call girls
escorts in agra
Escorts In Agra
call girls in agra
gwalior escorts
Gwalior Escorts
gwalior call girls
escorts in gWalior
Escorts In GWalior
call girls in gWalior
lucknow escorts
Lucknow Escorts
lucknow call girls
escorts in lucknow
Escorts In Lucknow
call girls in lucknow

1:15 PM  
Blogger Priya Priya said...

Escorts Service in Mumbai welcomes you all. Myself Priya Sharma, 23 years old Female Escorts working for
Escorts service in Mumbai. I have much experienced and I know each and everything that how to satisfy. Mumbai Escorts


Female Escorts in Mumbai


Mumbai Escorts Services


Escorts in Mumbai


Mumbai Independent escorts

3:52 PM  
Anonymous Anonymous said...

When I was in Bangalore I booked Bangalore Escorts. She has perfect body figure and I was totally
satisfied with the services from Female Escorts Service in Bangalore. She has perfect body figure and
gave the excellent service to me and satisfied me with the best services.

3:52 PM  
Blogger Bangalore Escorts Service said...

We are serving those call girls who have some additional push to full fill the first long for you. It's no compelling reason to go for the other standard and exhausting escorts' office. We have extraordinary females who are energetically prepared to hang you up for sexual fun. They all are searching for the pleasure with new men for minimal expenditure. You will get the chance to have all sort of females who can influence you to get the intercourse service in different styles.

Bangalore Escorts
Escorts in Bangalore
Independent Bangalore Escorts Girls
Bangalore Escorts Girls
Sexy Bangalore Escorts
Indian Escorts in Bangalore

2:41 PM  
Anonymous Ruhi Sharma said...

Our Escorts Agency in Bangalore has been set the gigantic standard to another agency provider. We procure the females who have some brilliant standard to draw in the clients. Before they get enlisted all lady needs to finish our few tests after that, they got procure for you. They are from a prominent foundation and have attractive appeal to commit you with energy. They have a vast illicit relationship of serving more than 100 clients and the level of satisfaction drive us to be on top on the rundown.
Bangalore Escorts

Bangalore Escorts Service

Escorts in Bangalore

Independent Bangalore Escorts

Indian Bangalore Escorts

Sexy Bangalore Escorts

4:40 PM  
Anonymous Ruhi Sharma said...

Our Escorts Agency in Bangalore has been set the gigantic standard to another agency provider. We procure the females who have some brilliant standard to draw in the clients. Before they get enlisted all lady needs to finish our few tests after that, they got procure for you. They are from a prominent foundation and have attractive appeal to commit you with energy. They have a vast illicit relationship of serving more than 100 clients and the level of satisfaction drive us to be on top on the rundown.
Bangalore Escorts

Bangalore Escorts Service

Escorts in Bangalore

Independent Bangalore Escorts

Indian Bangalore Escorts

Sexy Bangalore Escorts

4:48 PM  
Anonymous Sanaya Gill said...

We are guarantee that our Escorts service in Bangalore is the best satisfied, you can enlist them whenever. When you feel that you need of truthful to goodness sidekick who makes your inclination, we always present for you with amazing choices. At that point, our agency is open all day, every day at your administration for the sexual fun and happiness.
Bangalore Escorts

Escorts in Bangalore

Independent Bangalore Escorts Girls

Bangalore Escorts Girlsl

Call Girls in Bangalore

4:55 PM  
Anonymous Priya Gupta said...

Welcome to Bangalore Escorts Agency, we are a well-repudiated and well-established Bangalore Escorts agency; we pride ourselves on having the most exquisite selection of escorts in Bangalore for you.
http://mspriya.in/

http://mspriya.in/about.html

http://mspriya.in/services.html

http://mspriya.in/contact.html

http://mspriya.in/rates.html

5:00 PM  
Blogger kelly sharma said...

Really impressive post. I read it whole and going to share it with my social circles. I enjoyed your article and planning to rewrite it on my own blog

Chandigarh Call Girls
Chandigarh Escort Service
Chandigarh Escort
Escort in Chandigarh
Escorts service in Ludhiana

1:35 AM  

Post a Comment

<< Home