tag:blogger.com,1999:blog-112835292024-03-19T16:48:47.712+08:00Chester's BlogC#, .NET & MCMSChesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.comBlogger57125tag:blogger.com,1999:blog-11283529.post-80490539384234212482007-03-13T13:42:00.000+08:002007-03-20T16:28:49.249+08:00Shell Extensions - Context Menu<span style="font-family:verdana;font-size:100%;">I couldn’t blog for long time due to some personal reasons. Hope I’ll be able to blog without any breaks in future. I'm going to write something different this time, Context Menu for explorer.<br /><br />I wanted to write a context menu extension for the explorer using some Win32 API calls, which took me a while and it was really a pain. Had problems in debugging, needed to reboot the machine number of times, etc… So thought of coming up with a wrapper in .NET. The wrapper is mainly an abstract class which can be driven to create a personalized context menu extension. The assembly can be downloaded from </span><a href="http://www.fileden.com/files/2007/3/13/880394/Utils.ShellExtensions.ContextMenu.zip"><span style="font-family:verdana;font-size:100%;">here</span></a><span style="font-family:verdana;font-size:100%;"> and the source can be downloaded from </span><a href="http://www.fileden.com/files/2007/3/13/880394/Utils.ShellExtensions.ContextMenu_Source.zip"><span style="font-family:verdana;font-size:85%;">here</span></a><span style="font-family:verdana;font-size:100%;">.<br /><br /><strong><span style="font-size:100%;">How To use Utils.ShellExtensions.ContextMenu.dll</strong><br /><strong><span style="font-size:100%;"></strong><br />Deploy Utils.ShellExtensions.ContextMenu.dll in gac. Create a class library project. Add Utils.ShellExtensions.ContextMenu.dll to your project. Drive a class from BaseContextMenu. Make it com visible, install it in gac and register it for com.</span><br /><br /><strong><span style="font-size:100%;">Example</span></strong><br /><strong><span style="font-size:100%;"></span></strong><br /><img id="BLOGGER_PHOTO_ID_5041294320846742050" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggJZ0C0qPZcIfTEfPwsq1UWqWGdmX4NCQL3DM83R6Ln9hW4z3rdMHCPYT_PXqaO5zWENm4q0osEQriQ0ZRP6yl3YPf65EL8COBS-uVCpJIQRasCtYw1GEPXFbaLTGHH1yDHfYQ/s320/ContexMenu.JPG" border="0" /><br />[ComVisible(true), Guid("0056DA96-FFD6-4180-BAB2-8C9B6F552B2D")]<br />public class MyMenu : BaseContextMenu<br />{<br /> [ComRegisterFunction]<br /> public static void RegisterFunction(Type t)<br /> {<br /> //Register for files<br /> RegisterContextMenu.Register("*", t.GUID);<br /> //Register for folders<br /> RegisterContextMenu.Register("Directory", t.GUID);<br /> //Register for drives<br /> RegisterContextMenu.Register("Drive", t.GUID);<br /> }<br /><br /> [ComUnregisterFunction]<br /> public static void UnregisterFunction(Type t)<br /> {<br /> RegisterContextMenu.Unregister("*", t.GUID);<br /> RegisterContextMenu.Unregister("Directory", t.GUID);<br /> RegisterContextMenu.Unregister("Drive", t.GUID);<br /> }<br /><br /> public override void AssembleMenu()<br /> {<br /> System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(@"c:\test.bmp");<br /> System.Drawing.Bitmap bmp1 = new System.Drawing.Bitmap(@"c:\test1.bmp");<br /> MenuItems menuItems1 = new MenuItems("Test1",0,false);<br /> MenuItems menuItems2 = new MenuItems("Test2",1,false,bmp,true);<br /> MenuItems menuItems3 = new MenuItems("Test3",2,false,bmp1,false);<br /> menuItems2.Click +=new Utils.ShellContextMenu.MenuItems.MenuClickHandler(menuItems2_Click);<br /> menuItems3.Click +=new Utils.ShellContextMenu.MenuItems.MenuClickHandler(menuItems3_Click);<br /> //This order is important. Always insert the parent container and then the child!<br /> InsertMenu(menuItems1);<br /> AddMenu(menuItems1, menuItems2);<br /> AddMenu(menuItems1, menuItems3);<br /> }<br /><br /> private void menuItems2_Click()<br /> {<br /> System.Windows.Forms.MessageBox.Show("Menu Test2 clicked");<br /> }<br /><br /> private void menuItems3_Click()<br /> {<br /> System.Windows.Forms.MessageBox.Show("Menu Test3 clicked");<br /> }<br />}</span><br /></span>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com120tag:blogger.com,1999:blog-11283529.post-1151250597477207582006-06-25T23:27:00.000+08:002007-03-19T02:14:27.800+08:00MCMS Manager 6.2<span style="font-family:verdana;">This release is for users who want MCMS Manager to be worked with .NET framework 2.0. Also from the <a href="http://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=425734">previous version</a>, MCMS Manager works with MCMS 2002 SP2. In future if necessary otherwise there wont be any releases for .NET framework 1.1 (I'm really struggling to manage my time).</span><br /><span style="font-family:verdana;"></span><br /><span style="font-family:verdana;">Get the new version from </span><a href="http://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=427513"><span style="font-family:verdana;">here</span></a><span style="font-family:verdana;">. For more information check </span><a href="http://mcmsmanager.sourceforge.net/"><span style="font-family:verdana;">MCMS Manager</span></a><span style="font-family:verdana;"> Site. Please don't forget to post your </span><a href="http://mcmsmanager.sourceforge.net/phpBB2"><span style="font-family:verdana;">feedbacks</span></a><span style="font-family:verdana;">.</span>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com6tag:blogger.com,1999:blog-11283529.post-1150654901888106272006-06-19T02:13:00.000+08:002007-03-20T16:34:56.131+08:00MCMS Manager 6.1After a while.. This version includes,<br /><br />1. Adding Resource(s).<br />2. Windows Authentication support.<br />3. Authentication for the web service & more.<br /><br />Get the new version from <a href="http://sourceforge.net/project/showfiles.php?group_id=133592&amp;amp;package_id=146706&release_id=425734">here</a>. For more information check <a href="http://mcmsmanager.sourceforge.net/">MCMS Manager site</a>. Please don't forget to post your feedbacks <a href="http://mcmsmanager.sourceforge.net/phpBB2">here</a>.Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com3tag:blogger.com,1999:blog-11283529.post-1142781514928959762006-03-19T22:56:00.000+08:002007-03-20T16:30:40.090+08:00MVP for Microsoft Office Content Management Server (MCMS)I got a mail (not email - parcel - with certificate) from Microsoft stating that I got awarded as MVP for MCMS!<br /><br />I want to thank <a href="http://blogs.technet.com/stefan_gossner/default.aspx">Stefan</a>, <a href="http://www.mcmsfaq.com/">Spancer</a>, <a href="http://meiyinglim.blogspot.com/">Mei Ying</a>, <a href="http://andrewconnell.com/blog/">Andrew</a>, <a href="http://blogs.msdn.com/angus_logan/default.aspx">Angus</a> and <a href="http://joelsef.blogspot.com/">Jole Ward</a> for their guidance! Surely I couldn’t have made it this far without their help.Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com117tag:blogger.com,1999:blog-11283529.post-1140962500706042012006-02-26T21:52:00.000+08:002007-03-20T16:30:20.849+08:00The underlying connection was closed: An unexpected error occurred on a receive. (Web Service)<p>We had a web service which was working without any problem for few months and suddenly last week it started to give the above mentioned error. Even though I found some similar threads on the web, nothing helped me to solve the problem.<br /><br />After few hours of R&D I found a workable solution! Overriding the web service's proxy class fixed the error where I’ve created a new HttpWebRequest.<br /><br /><span style="color:#3333ff;">protected override System.Net.WebRequest GetWebRequest(Uri uri)<br />{<br />//Get a new HttpWebRequest<br />System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(uri);<br />webRequest.KeepAlive = false;<br />return webRequest;<br />}</span></p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com8tag:blogger.com,1999:blog-11283529.post-1140961874607489352006-02-26T21:17:00.000+08:002007-03-20T16:28:25.102+08:00Where am I Now?For last couple of months I was very busy with my new job (if you are not aware, currently I’m in Singapore and working for <a href="http://www.sonopress.com.hk/">Sonopress Pvt Ltd</a>) and couldn’t concentrate on maintain my blog as well as <a href="http://mcmsmanager.sourceforge.net/">MCMS Manager</a>.<br /><br />Now I’m somewhat settled and also playing Lead role ;). I should thank Ananth (my lead) for recognizing me within this short period of time and recommending my name for the above mentioned position!<br /><br />I’m sure that I’ll start my routine work very soon… (Surely there will be a release on <a href="http://mcmsmanager.sourceforge.net/">MCMS Manager</a> within couple of weeks!).Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com2tag:blogger.com,1999:blog-11283529.post-1135959678512561362005-12-31T00:05:00.000+08:002007-03-20T16:34:27.114+08:00Spencer's Article Series on 'ASP.NET 2.0 and MCMS 2002 SP2'Via <a href="http://www.harbar.net/">Spencer</a>:<br /><br /><div align="justify"><a href="http://www.mcmsfaq.com/articles/sp2ads.asp">MCMS ASP.NET 2 AdRotator</a></div><div align="justify"><blockquote><div align="justify">With the recent release of Service Pack 2 for MCMS, it is now<br />possible to take advantage of many ASP.NET 2.0 features within your<br />MCMS applications. The ASP.NET 2.0 AdRotator control has been enhanced to<br />allow for programatic population, which makes it much easier to produce a<br />AdRotator using MCMS Resource Gallery Items.</div></blockquote>[<a href="http://www.mcmsfaq.com/articles/sp2ads.asp">Read More</a>]</div><div align="justify"> </div><div align="justify"></div><div align="justify"></div><div align="justify"></div><div align="justify"></div><div align="justify"></div><div align="justify"></div><div align="justify"></div><div align="justify"><a href="http://www.mcmsfaq.com/articles/sp2mp.asp">Using ASP.NET Master Pages in your MCMS Applications</a></div><div align="justify"><blockquote>With the recent release of Service Pack 2 for MCMS, it is now<br />possible to take advantage of many ASP.NET 2.0 features within your MCMS<br />applications. One the best new features introduced with ASP.NET 2.0 is Master<br />Pages, which allow developers to enforce common layout and behaviour across<br />pages within an application. Whilst at first pass many Master Pages concepts are<br />similar to those of MCMS, there are a number of benefits to be gained by taking<br />advantage of Master Pages within MCMS applications.</blockquote></div><div align="justify"><div align="justify"></div><div align="justify"></div>[<a href="http://www.mcmsfaq.com/articles/sp2mp.asp">Read More</a>]</div>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com3tag:blogger.com,1999:blog-11283529.post-1135637338184356742005-12-27T06:28:00.000+08:002007-03-20T16:36:18.261+08:00MCMS Manager 6.0<p>This version includes,</p><p>1. Incremental Export/Import & User Backup/Restore<br />2. Resource hit Statistics<br />3. Extended Search</p><p>Get the new version from <a href="http://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=380920">here</a>. For more information check <a href="http://mcmsmanager.sourceforge.net">MCMS Manager site</a>. Please don't forget to post your feedbacks <a href="http://mcmsmanager.sourceforge.net/phpBB2">here</a>.</p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com10tag:blogger.com,1999:blog-11283529.post-1135269123348126642005-12-23T00:16:00.000+08:002005-12-23T01:00:11.513+08:00Modifying Resource Browser to Display Thumbnail for BitmapsThe 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.<br /><br />1. Create a class inheriting Microsoft.ContentManagement.WebAuthor.ResourcesBrowse<br />a) Create a class library.<br />b) Body of the class -<br /><span style="color:#0000ff;"><br />using System;<br />using System.Drawing;<br />using Microsoft.ContentManagement.WebAuthor;<br />using Microsoft.ContentManagement.Publishing;<br /><br />namespace MCMS<br />{<br />public class CustomResourceBrowser : ResourcesBrowse<br />{<br />public CustomResourceBrowser()<br />{<br />}<br /><br />//Create a new method to hide the default DataBindResourceColumnThumbnailUrl<br />protected new string DataBindResourceColumnThumbnailUrl(object dataitem)<br />{<br />Resource resource = (Resource)dataitem;<br />string url = string.Empty;<br />IntPtr Missing = IntPtr.Zero;<br />if(resource.FileExtension.ToLower()=="bmp")<br />{<br />using(Image image = Bitmap.FromStream(resource.OpenReadStream()))<br />{<br />using(Image thumbImage = image.GetThumbnailImage(32,32,null,Missing))<br />{<br />thumbImage.Save(@"PhysicalPath"+resource.Name,System.Drawing.Imaging.ImageFormat.Icon);<br />url = "http://WebPath/"+resource.Name;<br />}<br />}<br />}<br />else<br />{<br />url = resource.UrlThumbnail;<br />}<br />return url;<br />}<br />}<br />}<br /></span><br />2. Add the following references<br />a) using System.Drawing<br />b) System.Web<br />c) using Microsoft.ContentManagement.WebAuthor<br />d) using Microsoft.ContentManagement.Publishing<br /><br />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.<br /><br />4. Deploy the dll in the bin folder of your MCMS project.<br /><br />5. Make a copy of ResourcesBrowse.aspx - its default location "C:\Program Files\Microsoft Content Management<br />Server\Server\IIS_CMS\WebAuthor\Dialogs\ResourceBrowser\Management\"<br /><br />6. Open ResourcesBrowse.aspx in notepad and change the Page derivative as bellow<br /><span style="color:#0000ff;"><%@ Page language="c#" Codebehind="ResourcesBrowse.aspx.cs" SmartNavigation="true" AutoEventWireup="false"<br />Inherits="MCMS.CustomResourceBrowser" %><br /></span><br />This will make thumbnail in the temporary folder for bitmap files, which will be referred by Resource Manager - used to show the preview.<br /><br /><span style="color:#ff0000;">Note: Take precautions before using this method as ResourcesBrowse.aspx may get changed without any notification.</span>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com27tag:blogger.com,1999:blog-11283529.post-1133282906170212132005-11-30T00:44:00.000+08:002005-11-30T00:48:26.186+08:00MCMS Manager Site UpdatedI’ve updated the <a href="http://mcmsmanager.sourceforge.net/" target="_blank">MCMS Manager</a> site. Hope all of you will like the new look!Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com5tag:blogger.com,1999:blog-11283529.post-1133138588939056732005-11-28T08:30:00.000+08:002005-11-28T08:49:47.433+08:00Rational Guide to installing MCMS 2002 Service Pack 2Via <a href="http://www.harbar.net/">Spencer</a> :<br /><br /><blockquote>This article provides a step by step installation for MCMS SP2, including the<br />developer tools for VS.NET 2005, SQL Server 2005, development gotchas and<br />upgrading the WoodgroveNet sample site.</blockquote><br /><a href="http://www.mcmsfaq.com/articles/sp2install.asp">Rational Guide to installing MCMS 2002 Service Pack 2</a><p></p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com0tag:blogger.com,1999:blog-11283529.post-1132712079104110132005-11-23T01:55:00.000+08:002005-11-23T10:14:39.156+08:00MCMS Manager 5.3This version includes,<br /><br />1. Placeholder content Find and Replace<br />2. Template switching<br />3. Save search (postings/resource) result in CSV format<br /><br />Get the new version from <a href="http://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=373121">here</a>. For more information check <a href="http://mcmsmanager.sourceforge.net/">MCMS Manager</a> Site. Please don't forget to post your <a href="http://mcmsmanager.sourceforge.net/phpBB2">feedbacks</a>.Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com3tag:blogger.com,1999:blog-11283529.post-1132251832475267972005-11-18T01:59:00.000+08:002005-11-18T03:24:41.566+08:00A Web service to create PostingsThere can be situations where the only solution to access MCMS is via web services. KB 327750 (<a href="http://support.microsoft.com/Default.aspx?kbid=327750" target="_blank">How to use an MCMS Web service to ...</a>) can be used as a starting point on creating a web service for MCMS. This article explains how a posting can be created using a web service (only the web method is provided).<br /><br /><p>[WebMethod]<br>public bool CreatePosting(string userName, string password, string channelGuid, string postingName, string templateGuid, out string error)<br>{<br> //The above parameter list can contain more information about the posting such as display name, placeholder content, etc.<br> //It is always recommended to encrypt the password and decrypt it.<br> //Usually error will be very much useful to get the exact problem form MCMS.<br> error = "";<br> bool postiongCreated = false;<br> try<br> {<br> using(CmsApplicationContext cmsContext = new CmsApplicationContext())<br> {<br> //Authenticate the context in update mode<br> cmsContext.AuthenticateAsUser(userName, password, PublishingMode.Update);<br> //Get the channel object<br> Channel parentChannel = cmsContext.Searches.GetByGuid(channelGuid) as Channel;<br> //Get the template object<br> Template sourceTemplate = cmsContext.Searches.GetByGuid(templateGuid) as Template;<br> //To check whether they are found or not. If necessary it can be separated<br> //to two conditions<br> if(parentChannel!=null && sourceTemplate!=null)<br> {<br> //Can this user create a posting/this template can be used to create posting?<br> //If necessary it can be separated to two conditions<br> if(parentChannel.CanCreatePostings && sourceTemplate.CanUseForAuthoring)<br> {<br> try<br> {<br> Posting newPosting = parentChannel.CreatePosting(sourceTemplate);<br> //More information can be set here if available.<br> newPosting.Name = postingName;<br> //Commit the changes<br> cmsContext.CommitAll();<br> postiongCreated = true;<br> }<br> catch(Exception creationException)<br> {<br> //Oops.. An error occurred. Rollback!<br> cmsContext.RollbackAll();<br> error = creationException.ToString();<br> }<br> }<br> else<br> {<br> error = "User " + userName +" don't have rights to create a posting in "+ parentChannel.Name + " channel or the template " + sourceTemplate.Name + " cannot be used for authoring.";<br> }<br> }<br> else<br> {<br> error = "Channel/Source Template not found";<br> }<br> }<br> }<br> catch(Exception generalException)<br> {<br> error = generalException.ToString();<br> }<br>return postiongCreated;<br>}</p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com2tag:blogger.com,1999:blog-11283529.post-1131516636239911472005-11-09T09:40:00.000+08:002005-11-09T14:10:36.253+08:00MCMS Manager 5.2<p>In this release,</p><p>1. Improved version of Posting Size Checker<br />2. Improved version of Log generator<br />3. Resource gallery size check and more...<br /><br />Get the new version from <a href="https://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=369577">here</a>. For more information check <a href="http://mcmsmanager.sourceforge.net">MCMS Manager</a> site.</p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com5tag:blogger.com,1999:blog-11283529.post-1131499929774774662005-11-09T09:14:00.000+08:002005-11-09T16:06:24.520+08:00MCMS 2002 Service Pack 2 (Updated)Via <a href="http://blogs.technet.com/stefan_gossner/default.aspx">Stefan</a>:<br /><br /><a href="http://blogs.technet.com/stefan_gossner/archive/2005/11/08/413990.aspx">MCMS 2002 Service Pack 2 is now ready for download!</a><br /><br /><a href="http://blogs.technet.com/stefan_gossner/archive/2005/11/09/414055.aspx">Knowledge Base articles for MCMS 2002 SP2</a>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com0tag:blogger.com,1999:blog-11283529.post-1130178041312230992005-10-25T02:17:00.000+08:002005-11-08T01:34:33.340+08:00Book : Advanced Microsoft Content Management Server Development (Updated)<a href="http://www.packtpub.com/more_mcms/book">Advanced Microsoft Content Management Server Development</a> book is available now.<br /><br />Via <a href="http://andrewconnell.com/blog/">Andrew</a>:<br /><br /><a id="_f0c8d103c1f_HomePageDays_DaysList__ctl0_DayItem_DayList__ctl0_TitleUrl" href="http://andrewconnell.com/blog/archive/2005/11/07/2317.aspx">NOW AVAILABLE - Advanced Microsoft Content Server Development</a><br /><br />I can understand his feelings as I'm a first time Reviewer!<br /><br />Via <a href="http://blogs.technet.com/stefan_gossner/default.aspx">Stefan</a>:<br /><br /><a href="http://blogs.technet.com/stefan_gossner/archive/2005/11/07/413869.aspx">New MCMS Book has been released!</a>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com1tag:blogger.com,1999:blog-11283529.post-1130176114950377052005-10-25T01:44:00.000+08:002005-10-25T01:48:34.956+08:00MCMS Manager 5.1This release includes,<br /><br />1. Posting Size Checker - a new tool to check the size of Postings<br />2. UI Improvements<br />3. Channel level Posting Submit/Approve<br /><br />Get the new version from <a href="http://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=365689">here</a>. For more information check <a href="http://mcmsmanager.sourceforge.net/">MCMS Manager</a> site.Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com0tag:blogger.com,1999:blog-11283529.post-1129741169329031842005-10-20T00:44:00.000+08:002005-10-28T00:06:56.526+08:00Maximum uploadable size of a Resource to Resource Gallery<p align="justify">Resource can be uploaded to resource galleries via Site Manager as well as via Resource Manager (web author). The size of the resource file which can be uploaded via Resource Manager can be changed by modifying the httpRuntime attribute in the relevant web.config file (a sample for that with explanation can be found here – <a style="COLOR: blue; TEXT-DECORATION: underline; text-underline: single" href="http://download.microsoft.com/download/4/2/5/4250f79a-c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm#21529F34-A8D4-47B5-8B63-6FBE6A1BC91E">MCMS faq</a>).</p><p align="justify">Site Manager uses underlying ASP service to interact with MCMS server. So to change the upload resource size via Site Manager, some modification should be done in the IIS MetaBase.xml/service depending on Maximum size. If the maximum size is less than 100000 bytes, follow Step 1. Otherwise follow Step 2.</p><p><strong>Step 1 - To restrict the size less than 100000 bytes:</strong></p><ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in" type="disc"><li>Open MetaBase.xml file – this can be found in <windows installation path>\system32\inetsrv</li><li>Go to<br /><span style="MARGIN-LEFT: 0.5in"><IIsWebDirectory Location ="/LM/W3SVC/1/ROOT/NR/System/ResUpload"<br /><span style="MARGIN-LEFT: 0.5in">AppFriendlyName=""<br /><span style="MARGIN-LEFT: 0.5in">AppIsolated="2"<br /><span style="MARGIN-LEFT: 0.5in">AppRoot="/LM/W3SVC/1/Root/NR/System/ResUpload"<br /><span style="MARGIN-LEFT: 0.5in"><b>AspMaxRequestEntityAllowed="xxxxxx"</b><br /><span style="MARGIN-LEFT: 0.5in">></IIsWebDirectory></span> </span></span></span><br /><br /><span style="MARGIN-LEFT: 0.1in">Set the AspMaxRequestEntityAllowed to required maximum size – it should be in bytes and less than 100000 bytes.<br /></li><li>Stop the IIS (iisreset /stop).</li><li>Save MetaBase.xml(before saving, make a copy of that file).</li><li>Now start the IIS (iisreset /start).</li></ul><p><strong>Step 2 - To restrict the size more than or equal to 100000 bytes:</strong></p><p style="MARGIN-LEFT: 39pt; TEXT-INDENT: -0.25in"><ul style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in" type="disc"><li>Asp service (Site Manager uses this to interact with MCMS Server) counts 100000 bytes as a chunk. So if the size is 100000 bytes or more, it will be divided in to 100000 byte chunks, so it will get uploaded without the maximum limit boundary which can be specified in Step1 – to avoid this must validate this in asp service.</li><li>Open resupload.asp in notepad – it can be found in <MCMS Installation folder>\Server\IIS_NR\System\ResUpload – have a copy of it before doing any modification.</li><li>WriteFile function should be modified. Add the code(bold) given below before the creation of “AEBinFile.AEBinFile.1” object.<br /><br /><span style="MARGIN-LEFT: 21pt">……………</span><br /><span style="MARGIN-LEFT: 21pt">if len(strFileExt)=0 then<br /><span style="MARGIN-LEFT: 40pt">Response.End<br /><span style="MARGIN-LEFT: 21pt">end if<br /><span style="MARGIN-LEFT: 21pt"><b>Dim maxSize</b><br /><span style="MARGIN-LEFT: 21pt; TEXT-INDENT: 15pt"><b>maxSize = 1000000 ' maximum size of upload specified in MetaBase.xml</b><br /><span style="MARGIN-LEFT: 21pt; TEXT-INDENT: 15pt"><b>nCount = Request.TotalBytes</b><br /><span style="MARGIN-LEFT: 21pt"><b>if nCount > maxSize then</b></span><br /><span style="MARGIN-LEFT: 40pt"><strong>Response.Status = "500" 'Some error....</strong></span><br /><span style="MARGIN-LEFT: 40pt"><b>Response.End</b><br /><span style="MARGIN-LEFT: 21pt"><b>end if</b><br /><span style="MARGIN-LEFT: 21pt"><b></b>Set BinFile = Server.CreateObject("AEBinFile.AEBinFile.1")<br /><span style="MARGIN-LEFT: 21pt">…………</span></span></span></span></span></span></span></span></span></span></span></li></ul><p><span style="color:#ff0000;">Note: As modifying resupload.asp is not supported, take precautions before using the 2nd method.</span></span></span></span></p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com0tag:blogger.com,1999:blog-11283529.post-1129054782114772202005-10-12T02:14:00.000+08:002005-10-12T02:27:53.483+08:00MCMS Manager 5.0<p>This release includes, </p><p>1. Posting Comparer (new tool) - can compare postings/posting revisions<br />2. Resource Properties Editor - to edit Resource Properties<br />3. XML Editor - to edit XmlPlaceholder content<br /><br />Get the new version from <a href="http://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=362775">here</a>. For more information check <a href="http://mcmsmanager.sourceforge.net/">MCMS Manager</a> site. Please post your feedbacks!</p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com0tag:blogger.com,1999:blog-11283529.post-1129054430036457042005-10-12T02:02:00.000+08:002005-10-12T02:32:43.676+08:00MCMS Manager Performance Test (Initialization)<p>Performance test for <a href="http://mcmsmanager.sourceforge.net">MCMS Manager</a> was done with Search enabled (otherwise it must not take more than 5 sec to initialize).</p><p><b>Machine Configuration</b></p><p>Processor - Intel Pentium 4 Mobile CPU 1.80GHz<br />RAM - 256MB<br />O/S - Windows 2003</p><p><b>MCMS Configuration</b></p><p>Postings - 2982 (size - 8.5mb)<br />Resources - 50 (size - 0.5mb)<br />Templates - 20 (size - 0mb)</p><p>Total Application Size 9.0mb (here size is the size of objects generated by MCMS Manager).</p><p>Web Service (in the same machine) took <b>117.7800 Sec</b> to initialize where as Local API took <b>72.7053 Sec</b>.</p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com2tag:blogger.com,1999:blog-11283529.post-1128891595025861862005-10-10T04:57:00.000+08:002005-10-14T00:56:15.683+08:00Accessing Postings via HttpWebRequest/WebClient<p>After the post - <a style="COLOR: blue; TEXT-DECORATION: underline; text-underline: single" href="http://chestermr.blogspot.com/2005/09/using-comparehtml-to-compare-postings.html">Using CompareHTML to compare postings</a> , few people asked me - how to access postings via WebClient.<br /><br />Normally when we try to access posting via HttpWebRequest/WebClient, it will return "<span style="color:red;">The remote server returned an error: (500) Internal Server Error.</span>"<br /><br />The reason for the 500 server error is that authoring with MCMS is only supported with IE. And IE will always send the user agent string. So the code in WebAuthor requires this user agent string and does not check for this. As access with a user higher as subscriber is always treated as authoring the problem the above error will occur (thanks <a href="http://blogs.technet.com/stefan_gossner/default.aspx">Stefan</a> – for giving the correct reason!).<br /><br />To avoid the above error when accessing a posting with a higher role than subscriber, it is required to specify the “User Agent”.<br /><strong><br />Via HttpWebRequest<br /></strong><span style="color:#1000ff;">HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("url of the posting");<br />NetworkCredential networkCredential = new<br />NetworkCredential("username","password","domain");<br />httpWebRequest.Credentials = networkCredential;<br />httpWebRequest.UserAgent = "Mozilla/4.0+";<br />//UserAgent should be specified before getting the response.<br /></span><span style="color:#1000ff;">HttpWebResponse webResponse = (HttpWebResponse)httpWebRequest.GetResponse();</span><br /><br /><strong><span style="color:black;">Via WebClient</span><br /></strong></span><span style="color:#1000ff;">WebClient webClient = new WebClient();<br />NetworkCredential networkCredential = new<br />NetworkCredential("username","password","domain");<br />webClient.Credentials = networkCredential;<br />webClient.Headers.Add("User-Agent","Mozilla/4.0+");<br />//User-Agent should be specified in header before getting the response.<br />Stream webStream= webClient.OpenRead("url of the posting");</span></p>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com8tag:blogger.com,1999:blog-11283529.post-1128533802480244642005-10-06T01:23:00.000+08:002005-10-06T01:36:43.886+08:00MCMS Manager 4.4This version includes,<br /><br />1. UI enhancements.<br />2. <a href="http://meiyinglim.blogspot.com/">Mei Ying</a>'s <a id="BrowseResourcesSamples_ViewResources_ResourcesList__ctl4__ctl0_HyperLinkTitle" href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=9804F9C9-54D3-4735-9967-41CF1FD88740">HyperLink Dependency Report Generator</a> - I've made some modifications to fit MCMS Manager.<br />3. Disabled Search - so that if search is not necessary, it can be disabled - will increase the performance of MCMS Manager.<br /><br />It can be downloaded from <a href="https://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=361405">here</a>. For more information check <a href="http://mcmsmanager.sourceforge.net">MCMS Manager Site</a>.Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com0tag:blogger.com,1999:blog-11283529.post-1127878768954651182005-09-28T11:11:00.000+08:002007-03-20T16:36:34.887+08:00Using CompareHTML to compare postingsCompareHTML is a component which ships with MCMS which can be used to compare two postings. This blog explains how it can be used to compare two postings. It can be extended as needed.<br /><br />Add a reference to CompareHTML.dll. Also your class must have reference to System.Net, System.IO, and COMPAREHTMLLib.<br /><br />The code piece given below contains the part which can be used to compare two postings. As it is simple and self explanatory, I’m not going to walk through that.<br /><br />//Web client is used to get the content from the server<br />using(WebClient webClient = new WebClient())<br />{<br />NetworkCredential networkCredential = new NetworkCredential("username","password","domain");<br />webClient.Credentials = networkCredential;<br />string firstPosting = "";<br />string secondPosting = "";<br />using(Stream networkStream = webClient.OpenRead("first posting's url"))<br />{<br />using(StreamReader streamReader = new StreamReader(networkStream))<br />{<br />firstPosting = streamReader.ReadToEnd();<br />}<br />}<br />using(Stream networkStream = webClient.OpenRead("second posting's url"))<br />{<br />using(StreamReader streamReader = new StreamReader(networkStream))<br />{<br />secondPosting = streamReader.ReadToEnd();<br />}<br />}<br />//This is from CompareHTML.dll, which will compare both the content.<br />Compare postingCompare = new CompareClass();<br />string comparedPosting = postingCompare.CompareBuffers(firstPosting,secondPosting,false);<br />string pathDiffFile = "a place to save the compared html file";<br />using(StreamWriter streamWriter = new StreamWriter(pathDiffFile))<br />{<br />streamWriter.Write(comparedPosting);<br />}<br />//This is to open the created html file.<br />System.Diagnostics.Process.Start(pathDiffFile);<br />}<br /><br /><span style="color:#ff0000;">Note : As CompareHTML.dll is not documented, take precautions before using it as it may change at any stage without any notification. Also reverse engineering CompareHTML is a license violation!</span>Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com0tag:blogger.com,1999:blog-11283529.post-1126848970098137092005-09-16T13:04:00.000+08:002007-03-20T16:36:05.067+08:00MCMS Manager 4.3This version includes<br /><br />1. Posting Revert.<br />2. Resource Replace.<br />3. Multiple posting Approve, Submit, decline etc...<br /><br />Download the newer version of <a href="http://mcmsmanager.sourceforge.net/">MCMS Manager</a> from <a href="https://sourceforge.net/project/showfiles.php?group_id=133592&package_id=146706&release_id=356885">here</a>. Please post your feedbacks.Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com0tag:blogger.com,1999:blog-11283529.post-1125931734499394122005-09-05T22:29:00.000+08:002005-09-05T22:48:54.506+08:00MCMS Manager 4.2I've got plenty of feedbacks on ‘slowness’ of the current version of MCMS Manager compared with old ones. So, in this version I’ve used zip-compression to reduce the time taken for response. I hope this will be faster than the old one.<br /><br />Also with MCMS Manager 4.2, ‘Local MCMS API’ can be directly accessed by leaving the web service part in the login form blank. This will be surely faster than via web service. Go to <a href="http://mcmsmanager.sourceforge.net/">MCMS Manager Site</a> and download the new version. Please post your feedbacks!Chesterhttp://www.blogger.com/profile/05403958693769766991noreply@blogger.com6