<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kit Menke&#039;s Blog &#187; MOSS2007</title>
	<atom:link href="http://kitmenke.com/blog/tag/moss2007/feed/" rel="self" type="application/rss+xml" />
	<link>http://kitmenke.com/blog</link>
	<description>Experiences with SharePoint, web development, and programming</description>
	<lastBuildDate>Fri, 20 Aug 2010 14:19:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Wrap ListViewWebPart Column Headers</title>
		<link>http://kitmenke.com/blog/2010/07/08/wrap-listviewwebpart-colum-headers/</link>
		<comments>http://kitmenke.com/blog/2010/07/08/wrap-listviewwebpart-colum-headers/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 18:55:58 +0000</pubDate>
		<dc:creator>Kit</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[MOSS2007]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://kitmenke.com/blog/?p=258</guid>
		<description><![CDATA[I recently got asked if it was possible wrap the column headers in a list view web part. The user had a WebPart with quite a few columns with long names and was trying to prevent the page from scrolling left to right. What we needed to do was wrap the column header so that [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got asked if it was possible wrap the column headers in a list view web part. The user had a WebPart with quite a few columns with long names and was trying to prevent the page from scrolling left to right.<br />
<span id="more-258"></span></p>
<p><a href="http://kitmenke.com/blog/wp-content/uploads/2010/07/2010-07-08-13-48-02.png"><img class="alignnone size-full wp-image-259" title="Column Header (nowrap)" src="http://kitmenke.com/blog/wp-content/uploads/2010/07/2010-07-08-13-48-02.png" alt="Column Header (nowrap)" width="600" height="165" /></a></p>
<p>What we needed to do was wrap the column header so that it fit more to the data in the grid.</p>
<p><a href="http://kitmenke.com/blog/wp-content/uploads/2010/07/2010-07-08-13-47-27.png"><img class="alignnone size-full wp-image-260" title="Column Header (wrapped)" src="http://kitmenke.com/blog/wp-content/uploads/2010/07/2010-07-08-13-47-27.png" alt="Column Header (wrapped)" width="600" height="165" /></a></p>
<p>The solution is relatively simple to implement; all you need is a Content Editor Webpart at the bottom of the page somewhere with the following JavaScript in it:</p>
<pre lang="javascript" escaped="true">&lt;script type=&quot;text/javascript&quot;&gt;
function WrapColumnHeaderText(columnName) {
    try {
        var tables = document.getElementsByTagName(&quot;table&quot;);
        for (i = 0; i &lt; tables.length; i++) {
            // find the table that is for the column we're looking for
            var attrItem = tables[i].attributes.getNamedItem(&quot;displayname&quot;)
            if (null != attrItem &amp;&amp; attrItem.nodeValue === columnName) {
                var cells = tables[i].getElementsByTagName(&quot;td&quot;);
                for (c = 0; c &lt; cells.length; c++) {
                    if (null != cells[c].attributes.getNamedItem(&quot;nowrap&quot;)) {
                        cells[c].attributes.removeNamedItem(&quot;nowrap&quot;);
                        // after removing nowrap, IE won't actually wrap the content
                        // until it &quot;changes&quot;.. so we touch it to force it to wrap
                        cells[c].innerHTML = cells[c].innerHTML;
                        break;
                    }
                }
            }
        }
    } catch (ex) {
        alert(ex.toString());
    }
}

function WrapColumnHeaders() {
    // TODO: repeat the line below to wrap more columns
    WrapColumnHeaderText(&quot;Company Product Code&quot;);
}

_spBodyOnLoadFunctionNames.push(&quot;WrapColumnHeaders&quot;);
&lt;/script&gt;
</pre>
<img src="http://kitmenke.com/blog/?ak_action=api_record_view&id=258&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kitmenke.com/blog/2010/07/08/wrap-listviewwebpart-colum-headers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Danger in using SPSite.OpenWeb()</title>
		<link>http://kitmenke.com/blog/2009/06/08/the-danger-in-using-spsiteopenweb/</link>
		<comments>http://kitmenke.com/blog/2009/06/08/the-danger-in-using-spsiteopenweb/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 22:37:39 +0000</pubDate>
		<dc:creator>Kit</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[MOSS2007]]></category>

		<guid isPermaLink="false">http://kitmenke.com/blog/?p=61</guid>
		<description><![CDATA[The SPWeb.OpenWeb() no argument constructor is very useful when it is used within a WebPart. However, if used in a console application, it cause some unexpected behavior for URLs that do not exist.]]></description>
			<content:encoded><![CDATA[<p>Recently I ran into a &#8220;feature&#8221; of SharePoint&#8217;s SPSite.OpenWeb() method (the no argument constructor specifically). If the OpenWeb() method is used with a URL that is not known to exist, it can result in some unexpected behavior.</p>
<p><span id="more-61"></span></p>
<p>Assuming you have the following site structure&#8230;</p>
<ul>
<li>SiteCollection
<ul>
<li>Subsite1</li>
<li>Subsite2</li>
<li>&#8230;</li>
</ul>
</li>
</ul>
<p>Can you find the bug?</p>
<pre lang="csharp" line="1" escaped="true">// !!! only use this code in a web part
// to get the SPWeb the web part is currently in !!!
string server = "http://myserver";
string siteUrl = "/sites/SiteCollection/This Subsite Does Not Exist";
using (SPSite site = new SPSite(server + siteUrl))
{
    using (SPWeb web = site.OpenWeb())
    {
        Console.WriteLine(site.Url);
        Console.WriteLine(web.Url);
    }
}</pre>
<p>The problem is on line #9. The URL for the SPWeb that was just opened is the same as the SPSite&#8217;s URL: http://myserver/sites/SiteCollection. <strong>There is no exception thrown.</strong></p>
<p>The behavior I expected, would be some sort of exception when opening a web that does not exist. Even worse is the fact that no error is thrown; it simply defaults to the top level site collection that exists. This means, you get the <strong><span style="color: #ff0000;">wrong</span></strong> SPWeb object.</p>
<p>A better way to get an SPWeb object is (updated 7/13/09 per Rikard&#8217;s comment):</p>
<pre lang="csharp" line="1" escaped="true">// better code to open a web
string server = "http://myserver";
string siteUrl = "/sites/SiteCollection";
string subSite = "This Subsite Does Not Exist";
using (SPSite site = new SPSite(server + siteUrl))
{
    using (SPWeb web = site.OpenWeb(subSite))
    {
        if (web.Exists)
        {
            // do work with the web...
            Console.WriteLine(site.Url);
            Console.WriteLine(web.Url);
        }
    }
}</pre>
<p>This code should be able to safely open a web at any location.  Keep in mind, trying to access any of the properties of a web that does not exist will result in:</p>
<blockquote><p>System.IO.FileNotFoundException: There is no Web named &#8220;/sites/SiteCollection&#8221;.</p></blockquote>
<p>Again, the exception is not thrown in the constructor, but when attempting to access the SPWeb&#8217;s properties&#8230; such as web.Url.</p>
<img src="http://kitmenke.com/blog/?ak_action=api_record_view&id=61&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kitmenke.com/blog/2009/06/08/the-danger-in-using-spsiteopenweb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Failed to extract the cab file in the solution.</title>
		<link>http://kitmenke.com/blog/2009/05/27/failed-to-extract-the-cab-file-in-the-solution/</link>
		<comments>http://kitmenke.com/blog/2009/05/27/failed-to-extract-the-cab-file-in-the-solution/#comments</comments>
		<pubDate>Wed, 27 May 2009 18:49:31 +0000</pubDate>
		<dc:creator>Kit</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[MOSS2007]]></category>
		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://kitmenke.com/blog/?p=33</guid>
		<description><![CDATA[Got the following message when trying to deploy a solution file to the server: Failed to extract the cab file in the solution. Luckily Robert Bogue had already found the answer: we had duplicated an entry for a web part in our solution&#8217;s .ddf file. Apparently, makecab allows you to have the same file in [...]]]></description>
			<content:encoded><![CDATA[<p>Got the following message when trying to deploy a solution file to the server:</p>
<blockquote><p>Failed to extract the cab file in the solution.</p></blockquote>
<p>Luckily <a href="http://thorprojects.com/blog/archive/2008/01/21/stsadm-strikes-again-failed-to-extract-the-cab-file-in-the-solution-.aspx">Robert Bogue</a> had already found the answer: we had duplicated an entry for a web part in our solution&#8217;s .ddf file. Apparently, makecab allows you to have the same file in the same location multiple times. I&#8217;m not really sure why it doesn&#8217;t just overwrite it, but in any case, the solution doesn&#8217;t know what to do with it either.</p>
<img src="http://kitmenke.com/blog/?ak_action=api_record_view&id=33&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kitmenke.com/blog/2009/05/27/failed-to-extract-the-cab-file-in-the-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enterprise Search and SharePoint</title>
		<link>http://kitmenke.com/blog/2009/05/21/enterprise-search-sql-and-sharepoint/</link>
		<comments>http://kitmenke.com/blog/2009/05/21/enterprise-search-sql-and-sharepoint/#comments</comments>
		<pubDate>Thu, 21 May 2009 15:48:28 +0000</pubDate>
		<dc:creator>Kit</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Enterprise Search]]></category>
		<category><![CDATA[ESSQL]]></category>
		<category><![CDATA[MOSS2007]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://kitmenke.com/blog/?p=18</guid>
		<description><![CDATA[I&#8217;ve learned a couple of different things from messing with Enterprise Search and SharePoint. A lot of this has to do with the initial setup and how different crawls affect the index. What this assumes: You know how to get to Central Admin and the Search Admin screens Any URLs below you will have to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve learned a couple of different things from messing with Enterprise Search and SharePoint. A lot of this has to do with the initial setup and how different crawls affect the index.</p>
<p>What this assumes:</p>
<ul>
<li>You know how to get to Central Admin and the Search Admin screens</li>
<li>Any URLs below you will have to replace &#8220;centraladmin&#8221; with your own server ip</li>
<li>The place where you can run incremental or full crawls is:
<p>http://centraladmin/ssp/admin/_layouts/listcontentsources.aspx</li>
</ul>
<p>Metadata properties:</p>
<ul>
<li>In order to have more columns to search, you must add them to the &#8220;Metadata&#8221;  in the ssp
<p>http://centraladmin/ssp/admin/_layouts/schema.aspx</li>
<li>Any metadata property has a 64 character limit when querying using Enterprise Search SQL (ESSQL)</li>
<li>In order for a column to show up in the Add Mapping dialog an  <strong><span style="text-decoration: underline;">INCREMENTAL</span></strong> crawl is required (column existed and just  didn&#8217;t have data in&#8230; added some data to the list making sure to populate the  new fields and then ran an incremental)</li>
<li>Adding a Managed Property requires a <strong><span style="text-decoration: underline;">FULL</span></strong> crawl in  order to populate the data in that field</li>
</ul>
<p>Search visibility:</p>
<ul>
<li>If a site has Search Visibility disabled, it will show up as a warning in  the crawl log. LISTS DO NOT</li>
<li>Changing a list&#8217;s Search Visibility (in advanced settings) will require a  <strong><span style="text-decoration: underline;">INCREMENTAL</span></strong> (full is not required) crawl in order to  start showing up in search results</li>
</ul>
<p>Search scopes:</p>
<ul>
<li>Changing an existing search scope requires you to update the scope  again<br />
Go back to Central Admin -&gt; ssp -&gt; Search Settings -&gt;  Start Updating<br />
After clicking Update&#8230; it almost always goes from 0% to 100%  after a while&#8230; no in between</li>
<li>Changing scopes does not require an incremental or full crawl (you simply  need to update the scope again) see above</li>
<li>For a search scope, to have it include list items your scope should have a &#8220;folder&#8221; with a value like (encoded url with trailing slash):
<p>http://moss/sitecollection/subsite/Lists/My%20List%20Name/</li>
</ul>
<p>Also, here is some very <strong>unhelpful</strong> microsoft documentation:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms493660.aspx">http://msdn.microsoft.com/en-us/library/ms493660.aspx</a></p>
<p>Leave a comment if you have questions!</p>
<img src="http://kitmenke.com/blog/?ak_action=api_record_view&id=18&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kitmenke.com/blog/2009/05/21/enterprise-search-sql-and-sharepoint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
