Archive for 'SharePoint'

Cleaning Up Orphaned Webs

Posted on 24. Oct, 2007 by .

0

Ran into an issue today with installing the October 9th SharePoint Security Patch. During the content database upgrade I received several errors that certain sites and webs were missing. This is due to the staging content database being migrated from a development content database, and there are slight differences in the configuration databases between the two environments. In any event, I found the following posting from Cory Burns that took care of the issue:

How to Clean Orphans from your environment.

(Be smart have backups prior whenever you are performing maintenance on your farm, use suggestions at your own risk.)

Configuration Orphans: These are the orphans that reside in your configuration database but have no child counterpart (contentDB entry). Cleaning these are the easiest of all the orphans. Simply detach the content database from your farm that was included in the result set and reattach it. This will refresh the sitelist that is tied to that content database and will remove the stale entry.

Sharepoint Tips and Tricks : Sharepoint Orphans Explained

Bookmark and Share

Continue Reading

Global Navigation Error After Creating Site from Site Template

Posted on 28. Sep, 2007 by .

0

Follow along:

  1. Create a new site template from SharePoint Designer.  Doesn’t really matter what the site template is for or what options you choose (based on my experience).
  2. Go into SharePoint and create a new site based on the new custom Site Template.
  3. Note that your top navigation bar (the global navigation) should now have a “Home” tab, and an “Error” tab.
  4. Click refresh.
  5. Your top navigation bar now appears as normal!

I’ll chalk this one up as a “feature”.

Bookmark and Share

Continue Reading

Unable to login to SharePoint Portal from SharePoint Server

Posted on 27. Sep, 2007 by .

1

One of our SharePoint servers at work was updated with the most recent round of security patches the other day.  Unfortunately, the result of this update was the inability to login to the SharePoint Portal from the server, and the search crawler not being able to access the site.

After some significant research on the matter I came across http://support.microsoft.com/kb/896861 which indicates that an IIS website that is using Integrated Windows Authentication and the URL is different from the computer name, will result in a 401.1 error.  The fix is to add the other names of the computer into a registry key and restart IIS.  After following the instructions in the knowledge base article I was able to login to the site from the server, and the search crawler was once again able to crawl the content.

Bookmark and Share

Continue Reading

SQL 2005 Maintenance Plans and SharePoint

Posted on 11. Sep, 2007 by .

0

If you are using SPS 2003 or MOSS 2007 with a SQL Server 2005 box that does not have SP2 installed, you may discover that your crawls never complete.  There is a bug in SQL 2005 that if you have a Reindex Maintenance Plan it clears some attributes of the SharePoint indexes when it reindexes which in turn breaks the search functionality of SharePoint.  Long story short, consider SP2 for SQL 2005 to be a system requirement of SharePoint.  More information available here:  http://support.microsoft.com/kb/930887

Bookmark and Share

Continue Reading

SharePoint Licensing

Posted on 25. Jun, 2007 by .

0

Lots of people out there are asking the same questions regarding SharePoint licensing. Are CAL’s for concurrent users? Do I need both Standard and Enterprise CAL’s? Can I mix Standard and Enterprise CAL’s in a given environment?

It has been difficult finding definitive responses to these questions, and it seems like if you ask 5 people you get 5 different opinions on the licensing. Finally I ran across this great FAQ from the Microsoft Office group specifically on SharePoint licensing, which answers the above questions and many more:

Microsoft Office SharePoint Server 2007 frequently asked questions – SharePoint Server – Microsoft Office Online

Bookmark and Share

Continue Reading

SPLimitedWebPartManager Memory Leak?

Posted on 05. Jun, 2007 by .

11

Have a look at the following code segment:

while(true)
{
    using (SPSite siteCollection =
        new SPSite("http://localhost"))
    using (SPWeb site =
        siteCollection.OpenWeb("/Marketing"))
    {
        SPFolder pagesFolder = site.GetFolder("Pages");

        foreach (SPFile page in pagesFolder.Files)
        {
            WL(page.Url);

            using (SPLimitedWebPartManager webPartManager =
                page.GetLimitedWebPartManager
                    (PersonalizationScope.Shared))
            {
            }
        }
    }
}

With this code segment I’m just connecting to a site and iterating over the page collection, grabbing and instance of the page’s SPLimitedWebPartManager as I go. Since SPLimitedWebPartManager implements the IDisposable pattern I am being a good citizen and wrapping its instantiation in a using {} block. The problem with this code segment is that this is what it does to the process memory:

image

Now, if I change the source code to this:

while(true)
{
    using (SPSite siteCollection =
        new SPSite("http://localhost"))
    using (SPWeb site =
        siteCollection.OpenWeb("/Marketing"))
    {
        SPFolder pagesFolder = site.GetFolder("Pages");

        foreach (SPFile page in pagesFolder.Files)
        {
            WL(page.Url);

            using (SPLimitedWebPartManager webPartManager =
                page.GetLimitedWebPartManager
                    (PersonalizationScope.Shared))
            {
                webPartManager.Web.Dispose();
            }
        }
    }
}

The memory picture looks much different now:

image

The only difference being the addition of an explicit Dispose() within the webPartManager using.

A look inside the SPFile.GetLimitedWebPartManager call reveals that it calls an internal GetLimitedWebPartManagerInternal() method on the SPFile SPWeb member variable. A closer look at this method shows the following code:

SPWeb web = this.Site.OpenWeb();
if (this.AllowUnsafeUpdates)
{
    web.AllowUnsafeUpdates = this.AllowUnsafeUpdates;
}
SPWebPartManager manager = web.GetWebPartManagerInternal(pageUrl, requestedView, forRender, includeHidden, out bytes);

We see here that a new SPWeb object is getting spun up, and in the call to GetWebPartManagerInternal an assignment is going to be made to the SPLimitedWebPartManager m_web member variable. If we look at the Dispose() implementation for SPLimitedWebPartManager, we see the following:

public void Dispose()
{
    if (!this.m_disposed)
    {
        if (this.m_manager != null)
        {
            this.m_manager.Dispose();
        }
    }
    else
    {
        return;
    }
    this.m_webParts = null;
    this.m_manager = null;
    this.m_disposed = true;
}

Nothing is being done to dispose of the m_web! If I explicitly dispose of m_web, then memory stays low.

Is anyone encountering the same?

Bookmark and Share

Continue Reading

Exporting DataView with Custom Parameter

Posted on 30. May, 2007 by .

0

This past week I have been working with a DataView that needed to filter a list by the title of the PublishingPage containing the DataView web part.  In order to provide this functionality, I created a straight-forward custom parameter:

public class PageTitleParameter : System.Web.UI.WebControls.Parameter
{
   
protected override object Evaluate(System.Web.HttpContext context, System.Web.UI.Control control)
    {
        SPListItem listItem
= SPContext.Current.ListItem;

        if (listItem != null)
        {
           
try
            {
               
return listItem.Title;
            }
           
catch
            {
               
return string.Empty;
            }
        }

        return string.Empty;
    }
}

Creating custom Parameters has been covered elsewhere, so I won’t bother going into that, it works pretty much the same in SharePoint as in any ASP.NET application.  Where things get different, is after you export your shiny-new DataView web part to SharePoint.  If your experience is anything like mine, when you add your web part to a page instead of seeing your rendered DataView, you see “Parsing Error:  Object reference not set to an instance of an object”.

So what went wrong?  If you look carefully at the parser error, you will likely see that the TagPrefix that you setup when you registered your custom parameter in SharePoint Designer has been replaced with something like “cc3”, “cc4”, etc.  In order to fix this, instead of exporting the web part from SPD straight into SharePoint, save it to a file first.  Open the .webpart file that you saved and add your @Register directive for “cc3” or “cc4” or whatever your custom parameter’s TagPrefix happened to become.  You can now go into the Web Part Gallery and upload your web part. 

Good luck!

Bookmark and Share

Continue Reading

Running ASP.NET app within a SharePoint Virtual Server

Posted on 29. May, 2007 by .

0

For my own development efforts, I use Axosoft’s OnTime product which is free for a single user (yeah!).  I have a single SSL for Axosoft and for my WSS Team Site installation, so I needed for both to coexist peacefully in a single virtual server.  Out of the box Axosoft was throwing several errors, at which point I came across this link from Microsoft: 

How to enable an ASP.Net application to run on a SharePoint virtual server

After completing the steps in the article OnTime began working flawlessly!  Nice!

Bookmark and Share

Continue Reading