The Dawning 5000A is the 10th fastest super computer in the world and it runs Windows HPC 2008 as an operating system.  The system uses AMD x86-64 Opteron Quad Core Processors and has 122880 GB of memory.

Ref: http://www.top500.org/system/9787

Contrary to popular belief it is possible to programmatically manipulate the SharePoint's web.config.  When attempting to programmatically manipulate the web.config it is wise to have a utility to promptly roll back your modifications.  The Kid has provided us with just such a utility.

Download Web.Config Modification Manager For SharePoint 

The Modification Manager is available in both an application page (ASPX) and solution setup versions.  If you download the application page version you will notice the following code which is used to remove modification from the web.config. Notice that the code first removes the modification, then an update is done on the oApp object, and finally the ApplyWebConfigModifications() method is called.

   1: for (int i = l.Count - 1; i >= 0; i--)
   2:   oApp.WebConfigModifications.Remove( oApp.WebConfigModifications[l[ i ]] );
   3:   if (oApp.WebConfigModifications.Count < iStartCount)
   4:   {
   5:      oApp.Update();
   6:      SPFarm.Local.Services.GetValue<SPWebService>().ApplyWebConfigModifications();
   7:   }
 

What:Custom Themes and Branding for the SharePoint Intranet
Join us for an insightful discussion on how to meld a SharePoint Intranet to reflect your corporate identity. Our talk focuses on three major areas. The first covers out of the box options for applying a theme. The second covers creating a custom theme and the third covers creating a custom brand. The presentation includes a mixture of live demonstration and slides.
When:Monday, November 10, 2008 6:00 PM to 8:00 PM
Where:Tulsa Community College Northeast Campus
3727 East Apache
Tulsa, Oklahoma 74115   United States

David McCoullough, Brett Byford, and I will be delivering the above presentation at the next Tulsa SharePoint User Group Meeting.  All are welcome.

My friend and coworker at SpringPoint David McCoullough is blogging.  David is a talent ASP.NET developer who has attacked SharePoint development with a ferocious passion.  Welcome to the BlogoSphere David!

 

SPWeb.Groups and SPWeb.SiteGroups

WSS 3.0 deprecates the site group concept used in WSS 2.0.  As a result manipulating groups and security objects through the object model can be less than obvious.

For Example, a developer may try to add a group to a sub site (SPWeb) using this syntax SPWeb.Groups.Add(Group Name). However, in WSS 3.0 and MOSS 2007 this code will result in the following error:

“You cannot add a group directly to the Groups collection. You can add a group to the SiteGroups collection.”

To resolve this error and create a group use the following object model syntax:  SPWeb.SiteGroups.Add().  This code will create a new group at the site collection level. Groups created at the site collection level are basically the same as “Cross Site Groups” from WSS 2.0. 

Note: All sub sites that are inheriting permissions from a parent site will see the groups added using SPWeb.SiteGroups.Add() when iterating through the SPWeb.Groups collection.

Ref: http://msdn.microsoft.com/en-us/library/ms469194.aspx

Associating a Group with a Site

It is important to realize that groups are never really “Added” to sites (SPWebs) but are instead associated. For example, if you have created a sub site that does not inherit permissions from its parent and you would like to “Add” a project manager group to that site you would use the following code.

   1: // Get a reference a group by name.
   2: SPGroup oGroup = webSite.SiteGroups[groupName];
   3:  
   4: // Get the role definition to assign ex: Full Control
   5: SPRoleDefinition oRole = webSite.RoleDefinitions[roleDefinition];
   6:  
   7: // Create the role assignment object
   8: SPRoleAssignment oRoleAssignment = new SPRoleAssignment(oGroup);
   9:  
  10: // Add the role definition to the role assignemnt. 
  11:  
  12: // Assign the specific permission to the security principal for this role assignemnt.
  13: oRoleAssignment.RoleDefinitionBindings.Add(oRole);
  14:  
  15: // Add the role assignment to the web
  16: webSite.RoleAssignments.Add(oRoleAssignment);
  17:  
  18: webSite.Update();

This code associates a site collection (Cross Site) Group with a SPWeb and assigns a role definition such as “Full Control.” With the code discussed in this post we could create a group, then give that group full control to a sub site.

How do I create a custom list?

   1: Guid listId = webSite.Lists.Add("Sample", "Sample List", SPListTemplateType.GenericList);
   2:               
How to determine if a list already exists within an SPWeb?
   1: public static bool DoesListExist(SPWeb web, String listName)
   2:        {
   3:            foreach (SPList list in web.Lists)
   4:            {
   5:                if (true == list.Title.Equals(listName, StringComparison.OrdinalIgnoreCase))
   6:                    return true;
   7:            }
   8:            return false;
   9:        }

How to determine if a column (field) already exists?

   1: if (!list.Fields.ContainsField("Description"))
   2:                     list.Fields.Add("Description", SPFieldType.Note, false);

How to add a lookup column to a list?

   1: Guid listGuid = webSite.Lists["lookupList"].ID;
   2:                 Guid listId = webSite.Lists.Add("Sample", "Sample List", SPListTemplateType.GenericList);
   3:                 SPList list = webSite.Lists[listId] as SPList;
   4:                 list.Fields.AddLookup("Sample Lookup", listGuid, true);

Shane Carter has founded the Bartlesville SharePoint User Group which is a sister group to the newly founded Bartlesville .NET User Group.  The group's web site is http://sharepoint.bdnug.com/.  I will present tomorrow at the SharePoint group's lunch time meeting.  Details below:

 

Date: October 3rd at 11:30 AM.
We will be meeting at the Information Center (IC) building on 511 S. Keeler in room 625.

Speaker:

Dennis J. Bottjer will be presenting "Tips for Improving SharePoint Performance".
Agenda:
11:30-11:45 Grab your lunch provided by Astra Solutions.
11:45-12:30 Technical Presentation.
12:30-12:45 Door prizes and wrap up.

I see customers expressing more interest in is SharePoint Search.  Many clients are shocked to learn SharePoint has a powerful and very configurable search engine built in.  Search can crawl anything from network shares to public web sites.  Out of the box SharePoint supports the crawling and indexing of many file types which of course include Microsoft Office Documents.  However, SharePoint can be made aware of additional file types such as PDF's and DWG's. Furthermore, IFilters can be installed which allow search to index the content contained within files. 

For more information concerning supported file types and IFilters read this Technet Article.  The article lists all default file types and commonly added file types.  There are also links to configuration instructions.  This is a good article to keep book marked as a reference.

The .NET Framework allows developers to write managed code.  The term managed refers to how memory is handled by a computer system.  For example, C/C++ code is commonly known as unmanaged because developers must allocate and de-allocate memory.  In contrast, the .NET Framework provide a mechanism known as the Garbage Collector (GC) to de-allocate or collect object no longer in use.

I have found it particularly helpful to consider SharePoint a very large ASP.NET Application.  If you can visualize SharePoint as an ASP.NET application it becomes familiar and relatable.  If you begin to deconstruct SharePoint you will notice that it is comprised of Active Server Pages (ASPX), Master Pages, Style Sheets (CSS), User Controls (ASCX), Server Controls, Web Services (ASMX), Handlers, etc.  All these artifacts are common to ASP.NET developers.

SharePoint provides a rich API for developers to program against and extend this large "ASP.NET Application."  Two object commonly used in SharePoint development are SPSite and SPWeb.  Despite the names of these objects it must be understood that an SPSite object represents a site collection.  While an SPWeb object represent a site beneath a site collection.  Both of these object are managed wrappers of unmanaged code.  Furthermore, both of these object implement IDisposible.  So now for the million dollar question... When should you as a developer explicitly dispose of these object?  Well, the answer is, it depends.    

   1: String title;
   2:  
   3: using(SPSite siteCollection = new SPSite("http://mossdev"))
   4: {
   5:   using(SPWeb site = siteCollection.OpenWeb())
   6:    {
   7:        title = site.Title;
   8:    }
   9: }  

 

In the example above we created a new SPSite and SPWeb object.  We explicitly created a new SPSite object while we called the OpenWeb() method of SPSite to return a new SPWeb Object.  Since in effect we created new instances of both object we should dispose of both objects.   Note that, wrapping the objects within a using statement will automatically dispose of that object when it is no longer needed.   A good example of when not to dispose of an SPSite or SPWeb object is when a reference to an existing object is returned from a method call.  For example, the method call SPControl.GetContextSite() will return a reference to an SPSite object we did not create therefore we should not dispose of this particular SPSite object.  Disposing of this particular instance will crash current page and possibly the site.

Disposing of SharePoint objects such as SPSite and SPWeb will free both managed and unmanaged resources as soon as possible which will increase system performance and scalability.

Last week I was in Redmond, WA from April 13th to April 18th attending the Microsoft MVP Global Summit.  This was my second year attending the event and it was quite amazing.  Some of the highlights included participating in Open Spaces Sessions and seeing both Ray Ozzie and Steve Ballmer speak.  Steve is quite energetic to say the least.

A few days prior to the event I received a phone call from SearchITChannel.com's, senior news editor, Barbara Darrow wanting to interview me about being an MVP and the up coming summit.  I was flattered by her call and took time to answer her questions.  On Monday the 14th she sent me this link http://searchitchannel.techtarget.com/news/article/0,289142,sid96_gci1309724,00.html to her story in which I am quoted.  The story includes quotes from several fellow MVP's including Shane Young. 

I have really enjoyed attending the MVP summit twice now because it is an opportunity for MVP's to give Microsoft direct product feedback and boy do we.  The event is also a great opportunity to network with other MVP's and Microsoft Employees.

  

Technorati Tags: ,,

Problem: We were installing code on a MOSS 2007 Medium Farm Deployment.  We noticed the servers were missing sever WSS/MOSS 2007 related patches.  We applied the missing patches but then realized Search was no longer functioning properly.  One of the most noticeable issues was we could no longer access the "Search Settings" page under the primary SSP.  Prior to applying the patches this page was accessible but now we just saw a 403 Forbidden Error.  The event logs and the SharePoint logs weren't much help either.  Basically, we knew the problem had something to do with permissions but we couldn't find any hits where to look.  Additionally, this seemed to be the only page having issues.

Solution: After searching several blogs and MSDN I finally found a single post http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2793573&SiteID=17&mode=1 by Jörgen Bjerkesjö that provided the solution.  The problem is caused by the local wss_wpg server account not having write access to the %windir%\tasks folder, usually c:\windows\tasks folder.  This folder is used by Windows Task Scheduler.  So to fix the problem the wss_wpg account needs to be given write access to the c:\windows\tasks folder on the index server. 

Note: The c:\windows\tasks folder is a hidden folder by default.

Steps:

  • On Index Server or all server in farm
  • Open a command prompt and type attrib -s %windir%\tasks <enter>
  • Browse to %windir%\tasks, right click and select properties.  Add the WSS_WPG group and grant Read & Write permissions on the tasks folder.
  • Open a command prompt and type attrib +s %windir% \tasks <enter>
  • On Monday January, 28th my SpringPoint colleague Scott Brenton and I will be co-presenting on Visual Studio 2008 RTM at the Tulsa Developers .NET User Group.  Our presentation is a Tips and Tricks session with a little something for everyone.  We will have tips for beginners and seasoned pros.  The presentation will begin with and intro of Visual Studio 2008 and by the conclusions attendees should understand the benefits of upgrading.  Furthermore, the Visual Studio 2008 environment should not feel completely foreign.  Our presentation will include such topics as:

    • Keyboard Short Cuts
    • Refactoring
    • Auto-Implemented Properties
    • VSTO Projects
    • JavaScipt Intellisense and Debugging
    • Project Navigation
    • Source Server
    • MS Build and Build Targeting
    • Solution Upgrading

    Problem:

    We just installed a Medium MOSS 07 Farm.  The Farm has two front end webs and a dedicated indexing server.  The two front end webs are configured to execute search queries.  The SSP Admin site was loading and a search content source could be selected.  However, after specify a schedule for the selected content source and clicking ok an access denied error would appear on the schedule management window.  The message said "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))."  The MOSS Error Logs captured the following nastiness:

    w3wp.exe (0x0B5C) 0x0E48 Search Server Common MS Search Administration 86zc High Exception caught in Search Admin web-service proxy (client). System.Web.Services.Protocols.SoapException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Microsoft.Office.Server.Search.Administration.SearchWebServiceProxy.RunWithSoapExceptionHandling[T](String methodName, Object[] parameters)

    ... and more

    Resolution:

    The log and error message hinted at some kind of permission issue.  We also noticed that the logs specifically implicated our third server in the farm, our dedicated index server.  After some searching on MSDN and TechNet we learned that the C:\Windows\Tasks directory was not configured properly.  The local WSS_WPG machine needed to be given read and write permissions to the C:\Windows\Tasks directory.  Once we had assigned appropriate permissions and completed an IISReset form good measures we were able to save a schedule. 

    For more info review this MS KB posting: http://support.microsoft.com/kb/926959

     

    As a consultant a chief complaint I hear about SharePoint is a lack of documentation.  MS must have been listening because the Documentation Team is now blogging: http://blogs.msdn.com/sharepointdeveloperdocs/ as a way to get needed answers to customers  faster. 

    Tonight (12/03/2007) I attended the Tulsa, OK .NET User Group's Visual Studio InstallFest organized by David Walker.  The event had an amazing turnout with over 150 people in attendance.  We had a great time networking and installing Visual Studio 2008.

    | |
    More Posts Next page »