Search Results

Search found 231 results on 10 pages for 'stanley kelly'.

Page 1/10 | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • Morgan Stanley chooses Solaris 11 to run cloud file services

    - by Frederic Pariente
    At the EAKC2012 Conference last week in Edinburg, Robert Milkowski, Unix engineer at Morgan Stanley, presented on deploying OpenAFS on Solaris 11. It makes a great proofpoint on how ZFS and DTrace gives a definite advantage to Solaris over Linux to run AFS distributed file system services, the "cloud file system" as it calls it in his blog. Mike used ZFS to achieve a 2-3x compression ratio on data and greatly lower the TCA and TCO of the storage subsystem, and DTrace to root-cause scalability bottlenecks and improve performance. As future ideas, Mike is looking at leveraging more Solaris features like Zones, ZFS Dedup, SSD for ZFS, etc.

    Read the article

  • Linux to Solaris @ Morgan Stanley

    - by mgerdts
    I came across this blog entry and the accompanying presentation by Robert Milkoski about his experience switching from Linux to Oracle Solaris 11 for a distributed OpenAFS file serving environment at Morgan Stanley. If you are an IT manager, the presentation will show you: Running Solaris with a support contract can cost less than running Linux (even without a support contract) because of technical advantages of Solaris. IT departments can benefit from hiring computer scientists into Systems Programmer or similar roles.  Their computer science background should be nurtured so that they can continue to deliver value (savings and opportunity) to the business as technology advances. If you are a sysadmin, developer, or somewhere in between, the presentation will show you: A presentation that explains your technical analysis can be very influential. Learning and using the non-default options of an OS can make all the difference as to whether one OS is better suited than another.  For example, see the graphs on slides 3 - 5.  The ZFS default is to not use compression. When trying to convince those that hold the purse strings that your technical direction should be taken, the financial impact can be the part that closes the deal.  See slides 6, 9, and 10.  Sometimes reducing rack space requirements can be the biggest impact because it may stave off or completely eliminate the need for facilities growth. DTrace can be used to shine light on performance problems that may be suspected but not diagnosed.  It is quite likely that these problems have existed in OpenAFS for a decade or more.  DTrace made diagnosis possible. DTrace can be used to create performance analysis tools without modifying the source of software that is under analysis.  See slides 29 - 32. Microstate accounting, visible in the prstat output on slide 37 can be used to quickly draw focus to problem areas that affect CPU saturation.  Note that prstat without -m gives a time-decayed moving average that is not nearly as useful. Instruction level probes (slides 33 - 34) are a super-easy way to identify which part of a function is hot.

    Read the article

  • C++ : C++ Primer (Stanley Lipmann) or The C++ programming language (special edition)

    - by Kim
    I have a Computer Science degree (long2 time ago) .. I do know Java OOP but i am now trying to pick up C++. I do have C and of course data structure using C or pascal. I have started reading Bjarne Stroustrup book (The C++ Programming Language - Special Edition) but find it extremely difficult esp. some section which i don't have exposure such as Recursive Descent Parser (chapter 6). In terms of the language i don't foresee i have problem but i have problem as mentioned cos' those topic are usually covered in a Master Degree program such as construction of compiler. I just bought a book called C++ primer (Stanley Lipmann) which i heard it is a very good book for C++. Only setback is it's of course no match with the amount of information from the original C++ creator. Please advice. Thanks.

    Read the article

  • C++ Primer (Stanley Lipmann) or The C++ programming language (special edition)

    - by Kim
    I have a Computer Science degree (long2 time ago) .. I do know Java OOP but i am now trying to pick up C++. I do have C and of course data structure using C or pascal. I have started reading Bjarne Stroustrup book (The C++ Programming Language - Special Edition) but find it extremely difficult esp. some section which i don't have exposure such as Recursive Descent Parser (chapter 6). In terms of the language i don't foresee i have problem but i have problem as mentioned cos' those topic are usually covered in a Master Degree program such as construction of compiler. I just bought a book called C++ primer (Stanley Lipmann) which i heard it is a very good book for C++. Only setback is it's of course no match with the amount of information from the original C++ creator. Please advice. Thanks.

    Read the article

  • Exporting Environment Variables in Ubuntu Linux

    - by stanigator
    I know many people have asked about environment variables before, but I am having a hard time dealing with these paths while ensuring I don't mess around with the original settings. How would you go about executing these commands in Ubuntu in terms of environment variables? Thanks in advance! Please put /home/stanley/Downloads/ns-allinone-2.34/bin:/home/stanley/Downloads/ns-allinone-2.34/tcl8.4.18/unix:/home/stanley/Downloads/ns-allinone-2.34/tk8.4.18/unix into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph. IMPORTANT NOTICES: (1) You MUST put /home/stanley/Downloads/ns-allinone-2.34/otcl-1.13, /home/stanley/Downloads/ns-allinone-2.34/lib, into your LD_LIBRARY_PATH environment variable. If it complains about X libraries, add path to your X libraries into LD_LIBRARY_PATH. If you are using csh, you can set it like: setenv LD_LIBRARY_PATH If you are using sh, you can set it like: export LD_LIBRARY_PATH= (2) You MUST put /home/stanley/Downloads/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.

    Read the article

  • Free Online Performance Tuning Event

    - by Andrew Kelly
      On June 9th 2010 I will be showing several sessions related to performance tuning for SQL Server and they are the best kind because they are free :).  So mark your calendars. Here is the event info and URL: June 29, 2010 - 10:00 am - 3:00 pm Eastern SQL Server is the platform for business. In this day-long free virtual event, well-known SQL Server performance expert Andrew Kelly will provide you with the tools and knowledge you need to stay on top of three key areas related to peak performance...(read more)

    Read the article

  • change image upon selection, searching list for the src value jQuery

    - by Charles Marsh
    Hello all, Can anyone see anything that is wrong with this code it just isn't working... Should be clear what I am trying to do jQuery(document).ready(function($) { $('#product-variants-option-0').change(function() { // What is the sku of the current variant selection. var select_value = $(this).find(':selected').val(); if (select_value == "Kelly Green") { var keyword = "kly"; }; var new_src = $('#preload img[src*="kly"]'); $('div.image').attr('src', new_src); }); }); The selection: <select class="single-option-selector-0" id="product-variants-option-0"> <option value="Kelly Green">Kelly Green</option> <option value="Navy">Navy</option> <option value="Olive">Olive</option> <option value="Cocoa">Cocoa</option> </select> I'm trying to search an unordered list: <ul id="preload" style="display:none;"> <li>0z-kelly-green-medium.jpg</li> <li>0z-olive-medium.jpg</li> </ul>

    Read the article

  • jQuery find value then replace SRC

    - by Charles Web Dev
    Hello all, Can anyone see anything that is wrong with this code it just isn't working... I am tring to: get the value of #product-variants-option-0 search #preload for the relevant image and then change div.image img src to that image jQuery(document).ready(function($) { $('#product-variants-option-0').change(function() { // What is the sku of the current variant selection. var select_value = $(this).find(':selected').val(); if (select_value == "Kelly Green") { var keyword = "kly"; }; var new_src = $('#preload img[src*=keyword]'); $('div.image img').attr('src', new_src); }); }); The selection: <select class="single-option-selector-0" id="product-variants-option-0"> <option value="Kelly Green">Kelly Green</option> <option value="Navy">Navy</option> <option value="Olive">Olive</option> <option value="Cocoa">Cocoa</option> </select> I'm trying to search an unordered list: <ul id="preload" style="display:none;"> <li><img src="0z-kelly-green-medium.jpg"/></li> <li><img src="0z-olive-medium.jpg"/></li> </ul> The image I'm trying to replace is this:

    Read the article

  • How to determine a windows executables DLL dependencies programatically?

    - by Kelly
    Anybody know how to determine what DLL's a binary depends on using programmatic methods? To be clear, I am not trying to determine the DLL dependencies of the running exec, but of any arbitrary exec (that may be missing a required DLL). I'm looking for a solution to implement in a C/C++ application. This is something that needs to be done by my application at runtime and can't be done by a third party app (like depends). Thanks. -Kelly

    Read the article

  • Getting a WebView to act exactly like Safari

    - by Kelly McDonald
    (edited to give a better description of the answer I gave) I have created a very simple browser in InterfaceBuilder consisting of a nav bar and a webview. Everything works fine except when I try to tab between input fields is the webview, the focus goes to the nav bar. I'm assuming I need to do something with the responder chain, but I haven't been able to figure out what. Any advice? Thanks, Kelly

    Read the article

  • How do I make the Cylinder in the model?

    - by Stanley Chiu
    I have a class which will draw cylinders with deformer's index in the FBX file. The deformer which was in the 3ds max's biped. ex: If I have 22 bones in the deformer's structure, I will draw 22 cylinders. But I was in trouble that I want to let these cylinders in the model. And then I refer to the example (XNA Club Simple Animation 4.0) for my program. But these cylinders are not in correct positions with the model. How do I make these cylinders in correct positions with the model?

    Read the article

  • Hosting a web application on discountasp.net using sql ce 5

    - by David Stanley
    I am hoping that someone may have experience with this, since the discountasp site is very lacking in straightforward answers. I am building a lightweight web application and have decided to have sql ce as the database for it. Two questions regarding this: Do i need to get an actual database hosted as well as the site, in order for it to work? Do you know if discountasp supports the use of sql ce (not with webmatrix or any cms builds, completely custom)? If they don't, do you have any experience/recommendations with getting this done?

    Read the article

  • Trouble upgrading from 12.04 to 14.04.1 lts

    - by Stanley Hlatshwayo
    After running these commands from the command line: sudo apt-get update sudo apt-get dist-upgrade sudo do-release-upgrade -d i get the following error message: W:Failed to fetch http://extras.ubuntu.com/ubuntu/dists/oneiric/main/source/Sources 404 Not Found , E:Some index files failed to download. They have been ignored, or old ones used instead. PLEASE HELP anyone. How can i fix this bug?

    Read the article

  • I can't figure out how to run ubuntu .iso from thumbdrive?

    - by Judge Cole Stanley
    I downloaded Ubuntu 12.04.1 and I can't find a solid way to run it from the disk version of Ubuntu 11.04 for a clean install. I think the hard drive is messed up, or else I would install 11.04, but it won't work. So I wanna install 12.04.1 from a thumbdrive, so I can actually use this computer without using the demo and installing everything when it dies, or shuts off... Please help? I want to make it at least bootable from a thumbdrive, just so I can lightly browse the internet and what not... it doesn't have to be a hard install.

    Read the article

  • Set selected using jQuery

    - by Charles Marsh
    Evening All, Happy new year! I'm trying to change the selected option within this list.. Its only working for some and not others? selectedVal will either be Kelly Green, Navy etc... var selectedVal = $(this).text(); $("#product-variants-option-0 option[text=" + selectedVal+"]").attr("selected","selected") ; This is the select list: <select class="single-option-selector" id="product-variants-option-0"> <option value="Gunmetal Heather">Gunmetal Heather</option> <option value="Kelly Green">Kelly Green</option> <option value="Navy">Navy</option> </select>

    Read the article

  • TicTac Photo and Windows 7

    - by Ben
    Hello, My wife has been creating a tictac photo album. I had to upgrade to windows 7 as i had enough of Vista so i backed up the tic tac photo file and the photos to an external hard disk and performed a fresh install of win7. Now here is the problem. TicTacPhoto says it can find the photos in the album. The locations were as follows: Vista: C:\Users\Kelly\Pictures Win 7 C:\Users\Kelly\My Pictures When i try to create a Pictures folder under Kelly it popups a message about merging the two folders and simply moves the pictures to the My Pictures folder. Does anyone know a way to make a foler called pictures so i can eliminate the file path problem and then try again with tic tac photo support to get them to fix my file. My wife is going to kill me as its our wedding album and she has spent upwards of 30hrs designing it and me upgrading to win 7 means its all my fault. She does not understand file paths etc. Im going to try and open the album file in a text editor and see if i can see anything but thought i would ask here as well. Any help appreciated.

    Read the article

  • SharePoint 2010 MSDN Labs

    - by Kelly Jones
    Eric Ligman, from Microsoft, posted a great blog post this week listing all of the SharePoint 2010 Virtual Labs that are available from Microsoft.  His blog entry is here: http://blogs.msdn.com/b/mssmallbiz/archive/2012/03/13/sharepoint-server-2010-msdn-virtual-labs-available-to-you-online-plus-more-sharepoint-2010-resources.aspx He also posted other resources as well. I’ve copied his Virtual Lab links here: SharePoint Server 2010 Virtual Labs MSDN Virtual Lab: SharePoint Server 2010: Introduction MSDN Virtual Lab: Getting Started with SharePoint 2010 MSDN Virtual Lab: SharePoint 2010 User Interface Advancements MSDN Virtual Lab: SharePoint Server 2010 Connectors & Using the Business Data Connectivity (BDC) Service MSDN Virtual Lab: SharePoint Server 2010: Advanced Search Security MSDN Virtual Lab: SharePoint Server 2010: Configuring Search UIs MSDN Virtual Lab: SharePoint Server 2010: Content Processing and Property Extraction MSDN Virtual Lab: SharePoint Server 2010: Developing a Custom Connector MSDN Virtual Lab: SharePoint Server 2010: Fast Search Web Crawler MSDN Virtual Lab: SharePoint Server 2010: Federated Search MSDN Virtual Lab: SharePoint Server 2010: Linguistics MSDN Virtual Lab: SharePoint Server 2010: People Search Administration and Management MSDN Virtual Lab: SharePoint Server 2010: Relevancy and Ranking MSDN Virtual Lab: Customizing MySites MSDN Virtual Lab: Designing Lists and Schemas MSDN Virtual Lab: Developing a BCS External Content Type with Visual Studio 2010 MSDN Virtual Lab: Developing a Sandboxed Solution with Web Parts MSDN Virtual Lab: Developing a Visual Web Part in Visual Studio 2010 MSDN Virtual Lab: Developing Business Intelligence Applications MSDN Virtual Lab: Enterprise Content Management MSDN Virtual Lab: LINQ to SharePoint 2010 MSDN Virtual Lab: Visual Studio SharePoint Tools MSDN Virtual Lab: Workflow In addition to the SharePoint Server 2010 Virtual Labs, here are a few other SharePoint 2010 resources that I thought you might also be interested in: Technical reference for Microsoft SharePoint Server 2010 SharePoint 2010: IT Pro Evaluation Guide Connecting SharePoint 2010 to Line-of-Business Systems to Deliver Business-Critical Solutions Configure SharePoint Server 2010 as a Single Server with Microsoft SQL Server: Test Lab Guide Microsoft SQL Server 2012 Reporting Services Add-in for Microsoft SharePoint Technologies 2010 Deploying FAST Search Server 2010 for SharePoint FAST Search Server 2010 for SharePoint Add or Remove an Index Column Upgrade worksheet for SharePoint Server 2010 Microsoft SharePoint Server 2010 Technical Library in Compiled Help format Microsoft SharePoint Foundation 2010 Technical Library in Compiled Help format Microsoft FAST Search Server 2010 for SharePoint Technical Library in Compiled Help format Microsoft Reseller partner Learning Path Microsoft solutions partners and ISVs Learning Path Microsoft partner Practice Accelerator for SharePoint Microsoft partner SharePoint 2010 Internal Use Licenses SharePoint Case Studies SharePoint MSDN Forums SharePoint TechNet Forums Microsoft SharePoint 2010 page on Microsoft Partner Network portal

    Read the article

  • Practical Performance Monitoring and Tuning Event

    - by Andrew Kelly
      For any of you who may be interested or know of someone in the market for a performance Monitoring and Tuning class I have just the ticket for you. It’s a 3 day event that will be held in Atlanta Ga. on January 25th to the 27th 2011. For those of you that know me or have been to my sessions you realize I like to provide more than just classroom theory and like to teach real world and above all practical methodology when it comes to performance in SQL Server. This class covers all the essentials...(read more)

    Read the article

  • Illegal characters for SharePoint 2010 Content Type name

    - by Kelly Jones
    Quick tip: you can’t include a backslash in the name of the SharePoint 2010 Content Type.  In fact, there are several illegal characters:  \  / : * ? " # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab. What, you didn’t know that after entering one of these characters in the name?  Is it because you saw this screen: Oh, that’s right….you need to turn off custom errors in the layouts folder…See this blog post for details and you’ll also need to turn off for the web application. Once you do that, you’ll see this: I wonder why the SharePoint team just doesn’t let the user know that the content type name contains illegal characters before the user hits the create button. Here’s a copy of the complete error (for the search engines): Server Error in '/' Application. -------------------------------------------------------------------------------- The content type name 'asdfadsf\asdfasf' cannot contain: \  / : * ? " # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Microsoft.SharePoint.SPInvalidContentTypeNameException: The content type name 'asdfadsf\asdfasf' cannot contain: \  / : * ? " # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: [SPInvalidContentTypeNameException: The content type name 'asdfadsf\asdfasf' cannot contain: \  / : * ? " # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab.]    Microsoft.SharePoint.SPContentType.ValidateName(String name) +27419522    Microsoft.SharePoint.SPContentType.ValidateNameWithResource(String strVal, String& strLocalized) +423    Microsoft.SharePoint.SPContentType.set_Name(String value) +151    Microsoft.SharePoint.SPContentType.Initialize(SPContentType parentContentType, SPContentTypeCollection collection, String name) +112    Microsoft.SharePoint.SPContentType..ctor(SPContentType parentContentType, SPContentTypeCollection collection, String name) +132    Microsoft.SharePoint.ApplicationPages.ContentTypeCreatePage.BtnOK_Click(Object sender, EventArgs e) +497    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981   -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

    Read the article

  • Can&rsquo;t eject external USB or Firewire drive in Windows 7

    - by Kelly Jones
    As a SharePoint developer, I work a lot with Virtual Machines (presently using Windows Virtual PC, with Windows 7).  I’m using these VMs with my laptop, and in order to get better performance, I’ve moved them to external hard drives.  (These drives have faster RPMs, larger caches, and a larger capacity, than the internal drive.)  I have one large external drive at home, another similar drive at the office, and a small, slow portable drive that I carry with me. So, at the end of each day at the office, I copy the files from the external drive to my portable drive and then once I get home, I copy them from the portable to the larger external drive I leave at home.  I do this for a couple of reasons: so I can work at home and secondly, so I have backup copies.  (Often, I feel like I’m in the movie “Office Space” when copying the files before I leave the office). Anyway, after the files are copied, I safely eject the external drives, and then hibernate my laptop.  I’ve been doing this for over a year now, but within the last couple of months I started to have issues disconnecting the drives.  Intermittently, some application/process would have a lock on some file on the drive that would keep Windows from safely ejecting it. After looking into it, I found that it was actually the Windows search service that was accessing the drive! Since I wasn’t using Windows search to look for stuff on these drives, I removed them as locations to index. To do this in Windows 7, you need to go to Indexing Options (just type “Indexing” into the search box in the Start menu…).  One of the choices displayed will then be Indexing Options, so click on it and you should then see a window similar to this:   Click on the Modify button and you’ll see this window: Notice the different drives listed above.  My “FreeAgent XTreme (F:)” drive was checked for some reason, which was causing the indexing service to scan the drive looking for new files to make available in the search results.  Ever since I unchecked this box, I’ve been able to safely eject the drive.

    Read the article

  • Integrating Windows Form Click Once Application into SharePoint 2007 &ndash; Part 1 of 2

    - by Kelly Jones
    Last year, I had the opportunity to build a solution that involved integrating a Windows Form application into a SharePoint 2007 (WSS version 3.0). In this post, I’ll layout our architecture thinking and in part two, I’ll describe the technical details. Business Case Our challenge was this: we needed an easy way for a small group of our users to upload documents, in batches.  They also needed to quickly set the meta data values, as well as set security on individual files. Using the out of the box uploads just didn’t fit.  The single file upload allows set the meta data, but our users would be uploading dozens of files.  The multiple upload would allow our users to upload batches of files, but it doesn’t allow them to set the meta data during upload.  Also, neither upload method allows the users to set the permissions on the file. Our Solution We looked into building a web control of some kind, but ruled that out due to security complexities (if I remember correctly).  Another option would have been using a technology like Silverlight (or Flash?), but our team didn’t have the skills necessary to build with these. So, after looking at what was technically possible, and also what skills our team had, we settled on a Windows Form application.  We also decided to deliver it to the clients via Click Once, so we would have the ability to easily update the application in the future. Lessons Learned After deploying our solution, we’ve learned a few lessons.  First, you’ll need to have the .Net Framework installed on the client computers.  We knew this, but we still ran into issues making sure our users had the proper framework version installed.  Second, we had issues with authentication.  Our issues were due to our testing domain being a separate Active Directory domain from the domain that our end users and their workstations were members of.  (See my earlier post about Clearing Saved Passwords for the fix to our problem). Our third issue was how we dealt with uploading files that were named the same.  Our application would replace the existing file with the new file, which is the way we expected it to work.  However, our users wanted to upload weekly reports, named the same as the previous week.  We solved this by using folders within the document library to keep the sets of reports separate from previous weeks. One last thing to consider before implementing a solution like this, is what browsers and platforms your users will be working from.  We only needed to support IE and Windows, which works fine.  However, if you need to support Firefox, there are add-ons that allow Click Once to work with Firefox.  This is still a Windows only solution though.  In order to support Macs, you’d have to focus on either browser techniques (AJAX?) or Silverlight/Flash. Summary Our users are happy with the Click Once app.  It allowed them to move all of their content to our SharePoint site in under a couple hours, which they were thrilled with.  We’re happy because we can easily deploy updates, our development time was small, and we met all of our business requirements.

    Read the article

  • Can&rsquo;t install Transport HUB in Exchange 2010

    - by Kelly Jones
    When building my latest SharePoint 2010 demo virtual machines, I decided to try installing Exchange 2010 as well.  Now, I’m not an Exchange admin, but I thought “how hard can this be?”  Well, a little more than I thought. Pretty early during the install, I got an error saying that it couldn’t “install Transport HUB”.  I double checked that my VM was meeting all of the requirements, both hardware and software, and everything looked fine. After much researching, it turns out that the error was caused by not having IPv6 enabled on the network adapter inside the virtual machine.  I had turned it off because I thought I wouldn’t need it.  I guess Exchange 2010 does.

    Read the article

  • Updating a SharePoint master page via a solution (WSP)

    - by Kelly Jones
    In my last blog post, I wrote how to deploy a SharePoint theme using Features and a solution package.  As promised in that post, here is how to update an already deployed master page. There are several ways to update a master page in SharePoint.  You could upload a new version to the master page gallery, or you could upload a new master page to the gallery, and then set the site to use this new page.  Manually uploading your master page to the master page gallery might be the best option, depending on your environment.  For my client, I did these steps in code, which is what they preferred. (Image courtesy of: http://www.joiningdots.net/blog/2007/08/sharepoint-and-quick-launch.html ) Before you decide which method you need to use, take a look at your existing pages.  Are they using the SharePoint dynamic token or the static token for the master page reference?  The wha, huh? SO, there are four ways to tell an .aspx page hosted in SharePoint which master page it should use: “~masterurl/default.master” – tells the page to use the default.master property of the site “~masterurl/custom.master” – tells the page to use the custom.master property of the site “~site/default.master” – tells the page to use the file named “default.master” in the site’s master page gallery “~sitecollection/default.master” – tells the page to use the file named “default.master” in the site collection’s master page gallery For more information about these tokens, take a look at this article on MSDN. Once you determine which token your existing pages are pointed to, then you know which file you need to update.  So, if the ~masterurl tokens are used, then you upload a new master page, either replacing the existing one or adding another one to the gallery.  If you’ve uploaded a new file with a new name, you’ll just need to set it as the master page either through the UI (MOSS only) or through code (MOSS or WSS Feature receiver code – or using SharePoint Designer). If the ~site or ~sitecollection tokens were used, then you’re limited to either replacing the existing master page, or editing all of your existing pages to point to another master page.  In most cases, it probably makes sense to just replace the master page. For my project, I’m working with WSS and the existing pages are set to the ~sitecollection token.  Based on this, I decided to just upload a new version of the existing master page (and not modify the dozens of existing pages). Also, since my client prefers Features and solutions, I created a master page Feature and a corresponding Feature Receiver.  For information on creating the elements and feature files, check out this post: http://sharepointmagazine.net/technical/development/deploying-the-master-page . This works fine, unless you are overwriting an existing master page, which was my case.  You’ll run into errors because the master page file needs to be checked out, replaced, and then checked in.  I wrote code in my Feature Activated event handler to accomplish these steps. Here are the steps necessary in code: Get the file name from the elements file of the Feature Check out the file from the master page gallery Upload the file to the master page gallery Check in the file to the master page gallery Here’s the code in my Feature Receiver: 1: public override void FeatureActivated(SPFeatureReceiverProperties properties) 2: { 3: try 4: { 5:   6: SPElementDefinitionCollection col = properties.Definition.GetElementDefinitions(System.Globalization.CultureInfo.CurrentCulture); 7:   8: using (SPWeb curweb = GetCurWeb(properties)) 9: { 10: foreach (SPElementDefinition ele in col) 11: { 12: if (string.Compare(ele.ElementType, "Module", true) == 0) 13: { 14: // <Module Name="DefaultMasterPage" List="116" Url="_catalogs/masterpage" RootWebOnly="FALSE"> 15: // <File Url="myMaster.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" 16: // Path="MasterPages/myMaster.master" /> 17: // </Module> 18: string Url = ele.XmlDefinition.Attributes["Url"].Value; 19: foreach (System.Xml.XmlNode file in ele.XmlDefinition.ChildNodes) 20: { 21: string Url2 = file.Attributes["Url"].Value; 22: string Path = file.Attributes["Path"].Value; 23: string fileType = file.Attributes["Type"].Value; 24:   25: if (string.Compare(fileType, "GhostableInLibrary", true) == 0) 26: { 27: //Check out file in document library 28: SPFile existingFile = curweb.GetFile(Url + "/" + Url2); 29:   30: if (existingFile != null) 31: { 32: if (existingFile.CheckOutStatus != SPFile.SPCheckOutStatus.None) 33: { 34: throw new Exception("The master page file is already checked out. Please make sure the master page file is checked in, before activating this feature."); 35: } 36: else 37: { 38: existingFile.CheckOut(); 39: existingFile.Update(); 40: } 41: } 42:   43: //Upload file to document library 44: string filePath = System.IO.Path.Combine(properties.Definition.RootDirectory, Path); 45: string fileName = System.IO.Path.GetFileName(filePath); 46: char slash = Convert.ToChar("/"); 47: string[] folders = existingFile.ParentFolder.Url.Split(slash); 48:   49: if (folders.Length > 2) 50: { 51: Logger.logMessage("More than two folders were detected in the library path for the master page. Only two are supported.", 52: Logger.LogEntryType.Information); //custom logging component 53: } 54:   55: SPFolder myLibrary = curweb.Folders[folders[0]].SubFolders[folders[1]]; 56:   57: FileStream fs = File.OpenRead(filePath); 58:   59: SPFile newFile = myLibrary.Files.Add(fileName, fs, true); 60:   61: myLibrary.Update(); 62: newFile.CheckIn("Updated by Feature", SPCheckinType.MajorCheckIn); 63: newFile.Update(); 64: } 65: } 66: } 67: } 68: } 69: } 70: catch (Exception ex) 71: { 72: string msg = "Error occurred during feature activation"; 73: Logger.logException(ex, msg, ""); 74: } 75:   76: } 77:   78: /// <summary> 79: /// Using a Feature's properties, get a reference to the Current Web 80: /// </summary> 81: /// <param name="properties"></param> 82: public SPWeb GetCurWeb(SPFeatureReceiverProperties properties) 83: { 84: SPWeb curweb; 85:   86: //Check if the parent of the web is a site or a web 87: if (properties != null && properties.Feature.Parent.GetType().ToString() == "Microsoft.SharePoint.SPWeb") 88: { 89:   90: //Get web from parent 91: curweb = (SPWeb)properties.Feature.Parent; 92: 93: } 94: else 95: { 96: //Get web from Site 97: using (SPSite cursite = (SPSite)properties.Feature.Parent) 98: { 99: curweb = (SPWeb)cursite.OpenWeb(); 100: } 101: } 102:   103: return curweb; 104: } This did the trick.  It allowed me to update my existing master page, through an easily repeatable process (which is great when you are working with more than one environment and what to do things like TEST it!).  I did run into what I would classify as a strange issue with one of my subsites, but that’s the topic for another blog post.

    Read the article

1 2 3 4 5 6 7 8 9 10  | Next Page >