<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><!--RSS generated by Windows SharePoint Services V3 RSS Generator on 06/07/2009 04:14:59--><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Liam Cleary [SharePoint MVP]</title><link>http://www.helloitsliam.com</link><description>RSS feed for the Posts list.</description><copyright>helloitsliam.com</copyright><managingEditor>Liam Cleary</managingEditor><webMaster>Liam Cleary</webMaster><lastBuildDate>Mon, 06 Jul 2009 11:14:59 GMT</lastBuildDate><generator>SharePoint CKS:EBE</generator><ttl>60</ttl><image><title>Liam Cleary [SharePoint MVP]</title><url>http://www.helloitsliam.com/_layouts/images/homepage.gif</url><link>http://www.helloitsliam.com</link></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/helloitsliam" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Retrieve XML from List and View</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/NB2M57aGL_o/retrieve-xml-from-list-and-view.aspx</link><guid isPermaLink="false">/archive/2009/07/01/retrieve-xml-from-list-and-view.aspx</guid><description><![CDATA[<div class="ExternalClassAE6E5670A9344907876EB74C57A2EF73">
<p>Recently I was asked if there was a way to retrieve and present XML from a list. This of course is very straight forward but the complication here was that it needed to be available to an anonymous user who would consume the XML stream. </p>
<p>After a little thought I decided that we could use the &quot;owssvr.dll&quot; method. For those that have not used this before it is very simple. You make a call to the following URL: </p>
<p><a href="http://{siteurl}/_vti_bin/owssvr.dll">http://{siteurl}/_vti_bin/owssvr.dll</a> </p>
<p>Pass it a few parameters and then an XML stream is returned. So to test this I used the posts list on my blog with the following URL: </p>
<p><a href="http://www.helloitsliam.com/_vti_bin/owssvr.dll?Cmd=Display&amp;List={A462AB0D-84CF-4918-9950-D562530A5377}&amp;XMLDATA=TRUE">http://www.helloitsliam.com/_vti_bin/owssvr.dll?Cmd=Display&amp;List={A462AB0D-84CF-4918-9950-D562530A5377}&amp;XMLDATA=TRUE</a> </p>
<p>The GUID that you pass is the actual GUID for the list that you wish to retrieve the data from. I tried this and all worked well until I tried it as an anonymous user to the site. When I tried it as a logged in user it came back with a blank page. Very strange I thought, but then I realized that a limitation of this method is lookup fields. When I tried it as an Anonymous user it simply kept prompting me again and again for permissions and then failed with an access denied error. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/070109_2050_RetrieveXML1.png"> </p>
<p>So this approach for me did not work. If you do want to use it and you are going to consume it internally then it is perfect and renders as you need it too. Below is sample output: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/070109_2050_RetrieveXML2.png"> </p>
<p>So what do I try next, I thought about building a custom web service but didn't really want to go to all that trouble so I decided to create a custom HttpHandler instead. This seemed a very simple and straight forward way of achieving this. Also it would give the ability to retrieve the XML from a list and the selected View that was created. </p>
<p>So let's create a custom HttpHandler for this. For this you won't even need to use Visual Studio. I use Notepad++ and created a file called &quot;GetListXML.ashx&quot;. I then started to add the following code: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/070109_2050_RetrieveXML3.png"> </p>
<p>As note here make sure that the class element is the same name as the actual class listed below, sounds silly I know but it will never work otherwise. I then created the class as shown below: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/070109_2050_RetrieveXML4.png"> </p>
<p>Once the class is created we then need to add a &quot;ProcessRequest&quot; method which will run the core code. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/070109_2050_RetrieveXML5.png"> </p>
<p>The key here is to make sure we grab the current context, so we can then declare some variables that read the &quot;Request&quot; object. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/070109_2050_RetrieveXML6.png"> </p>
<p>For this to work I needed to pass it a Site URL, List ID and an ID for the selected View. To find these out I used the SharePoint UI or you could use a simple tool like this one: </p>
<p><a href="http://blogs.msdn.com/ronalus/archive/2007/09/08/a-little-guid-picker.aspx">http://blogs.msdn.com/ronalus/archive/2007/09/08/a-little-guid-picker.aspx</a> </p>
<p>So now we need to add the following code so it will return the required XML. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/070109_2050_RetrieveXML7.png"> </p>
<p>So now we have the code completed, obviously there is more code here such as a &quot;try {} catch {}&quot; block etc. Now we have created the file, we save it and add it to the &quot;_vti_bin&quot; directory. </p>
<p>C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI </p>
<p>Once in there we can then call it with the following syntax: </p>
<p><a href="http://{siteurl}/_vti_bin/GetListXML.ashx?SiteURL={ActualSiteUrl}&amp;ListID={ListGuid}&amp;ViewID={ViewGuid}">http://{SiteUrl}/_vti_bin/GetListXML.ashx?SiteURL={ActualSiteUrl}&amp;ListID={ListGuid}&amp;ViewID={ViewGuid}</a> </p>
<p>When I ran this for my blog site I thought I would test it using the list that would not work with the &quot;owssvr.dll&quot; method. The URL I used was: </p>
<p><a href="http://www.helloitsliam.com/_vti_bin/GetListXML.ashx?SiteUrl=http://www.helloitsliam.com&amp;ListID={A462AB0D-84CF-4918-9950-D562530A5377}&amp;ViewID={F10F58D9-716B-46EF-9FEF-E276A2B5EEF4}">http://www.helloitsliam.com/_vti_bin/GetListXML.ashx?SiteUrl=http://www.helloitsliam.com&amp;ListID={A462AB0D-84CF-4918-9950-D562530A5377}&amp;ViewID={F10F58D9-716B-46EF-9FEF-E276A2B5EEF4}</a> </p>
<p>This returned the following in the browser: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/070109_2050_RetrieveXML8.png"> </p>
<p>As you can see this method works really well and seems to work better than using the out of the box RPC Protocols. </p>
<p>Happy coding. <span style="font-family:Wingdings">J</span> </p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Liam Cleary</dc:creator><pubDate>Wed, 01 Jul 2009 21:53:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Development/default.aspx">Development</category><category domain="http://www.helloitsliam.com/archive/tags/How To Code/default.aspx">How To Code</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/07/01/retrieve-xml-from-list-and-view.aspx</feedburner:origLink></item><item><title>Hotfix for SP2 issue that reverts SharePoint products to Trial Version has been released</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/g2uYGqhopQY/hotfix-for-sp2-issue-that-reverts-sharepoint-products-to-trial-version-has-been-released.aspx</link><guid isPermaLink="false">/archive/2009/06/25/hotfix-for-sp2-issue-that-reverts-sharepoint-products-to-trial-version-has-been-released.aspx</guid><description><![CDATA[<div class="ExternalClass355096062B1F4B5E9556F445904EDB32"><div>
<p style="line-height:normal;margin:0in 0in 0pt;vertical-align:top" class="MsoNormal"><span style="font-family:'Verdana','sans-serif';color:black;font-size:8.5pt">In case you have not seen this already, a hot fix has been released to fix the Service Pack 2 issue of setting your license key to a trial one. Here is the original post from Stefan.</span></p>
<p style="line-height:normal;margin:0in 0in 0pt;vertical-align:top" class="MsoNormal"><span style="font-family:'Verdana','sans-serif';color:black;font-size:8.5pt"> </span></p>
<p style="line-height:normal;margin:0in 0in 0pt;vertical-align:top" class="MsoNormal"><span style="font-family:'Verdana','sans-serif';color:black;font-size:8.5pt">Microsoft has released a fix for the <a href="http://blogs.msdn.com/sharepoint/archive/2009/05/21/attention-important-information-on-service-pack-2.aspx"><span style="color:blue">SP2 problem that reverts the license into a Trial version</span></a> after installing Service Pack 2.</span></p>
<p style="line-height:normal;margin:0in 0in 10pt;vertical-align:top" class="MsoNormal"><span style="font-family:'Verdana','sans-serif';color:black;font-size:8.5pt">More details can be found in the following KB article:</span></p>
<p style="line-height:normal;margin:0in 0in 10pt;vertical-align:top" class="MsoNormal"><b><span style="font-family:'Verdana','sans-serif';color:black;font-size:8.5pt"><a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;971620"><i><span style="color:blue">971620</span></i></a></span></b><i><span style="font-family:'Verdana','sans-serif';color:black;font-size:8.5pt"> - When you install the 2007 Microsoft Office servers Service Pack 2, the product expiration date is activated incorrectly</span></i><span style="font-family:'Verdana','sans-serif';color:black;font-size:8.5pt"></span></p>
<p style="line-height:normal;margin:0in 0in 10pt;vertical-align:top" class="MsoNormal"><span style="font-family:'Verdana','sans-serif';color:black;font-size:8.5pt">As the link to the fix binaries in the KB is currently broken here are the correct download locations:</span></p>
<ul type="disc">
<li style="line-height:normal;margin:0in 0in 10pt;color:black;vertical-align:top;tab-stops:list .5in" class="MsoNormal"><span style="font-family:'Verdana','sans-serif';font-size:8.5pt">32-bit version: <a href="http://download.microsoft.com/download/2/F/5/2F51AB71-1325-49D2-9CB9-18DEC4780E99/office2007-kb971620-fullfile-x86-glb.exe"><span style="color:blue">http://download.microsoft.com/download/2/F/5/2F51AB71-1325-49D2-9CB9-18DEC4780E99/office2007-kb971620-fullfile-x86-glb.exe</span></a></span></li>
<li style="line-height:normal;margin:0in 0in 10pt;color:black;vertical-align:top;tab-stops:list .5in" class="MsoNormal"><span style="font-family:'Verdana','sans-serif';font-size:8.5pt">64-bit version: <a href="http://download.microsoft.com/download/5/B/B/5BBD34A9-C528-42B0-8A5F-9A8997B25C32/office2007-kb971620-fullfile-x64-glb.exe"><span style="color:blue">http://download.microsoft.com/download/5/B/B/5BBD34A9-C528-42B0-8A5F-9A8997B25C32/office2007-kb971620-fullfile-x64-glb.exe</span></a></span></li></ul></div></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Liam Cleary</dc:creator><pubDate>Thu, 25 Jun 2009 14:39:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Administration/default.aspx">Administration</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/06/25/hotfix-for-sp2-issue-that-reverts-sharepoint-products-to-trial-version-has-been-released.aspx</feedburner:origLink></item><item><title>MOSS 2007 – Capture direct view clicks</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/HV3lkhoAdVw/moss-2007-–-capture-direct-view-clicks.aspx</link><guid isPermaLink="false">/archive/2009/06/03/moss-2007-–-capture-direct-view-clicks.aspx</guid><description><![CDATA[<div class="ExternalClassD7A13A6BA037484B9C988951B3A49198">
<p>If like me you have worked on a mix of intranet, extranet and internet you will have no doubt been asked about capturing direct file clicks. So an example would be you wish to know the top PDF document that is being clicked on your public facing site. Out of the box SharePoint does its best with the usage analysis framework but does not capture everything that you may need. In this post I will show you how to use custom code to capture specific file type links and log them to a list. Firstly let's create the list to store the values, to do this I am going to create a content type and then associate this with a custom list. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap1.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap2.png"> </p>
<p>Now have our new content type albeit a very basic one, we can then create our new list and associate accordingly. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap3.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap4.png"> </p>
<p>So to make this work we could use some code that resides within the &quot;Global.asax&quot;, I like this approach as it means you do not need Visual Studio to make changes and they can be done on the fly, however this is not the best approach. For this we will create a custom &quot;HttpModule&quot; that we will register within the &quot;web.config&quot;. So to begin let's create a class library project in Visual Studio and ensure it inherits from the &quot;IHttpModule&quot; class. I am going to name my class &quot;CountDirectLinks.cs&quot; and then create a utility class for any functions etc that I need and call that &quot;CountDirectLinksUtilities.cs&quot;. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap5.png"> </p>
<p>So firstly ensure that we are inheriting correctly and have the correct namespaces for this to work. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap6.png"> </p>
<p>We now need to create the base methods for capturing the relevant events. To do this we will use the following code: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap7.png"> </p>
<p>This initialize method attaches to the current context and calls the &quot;<a href="http://msdn.microsoft.com/en-us/library/system.web.httpapplication.authenticaterequest.aspx">AuthenticateRequest</a>&quot; method. This allows us to intercept anything that happens after a user has been authenticated. We could use other methods if needed such as &quot;<a href="http://msdn.microsoft.com/en-us/library/system.web.httpapplication.beginrequest.aspx">BeginRequest</a>&quot;; this would capture anything before it was authenticated. In our case we wish to get the clicked links when someone has been authenticated. Our code should look like the following: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap8.png"> </p>
<p>Now part of this solution was to allow the Administrator to specify the file types that they wish to capture and log. To do this we will simply create the following &quot;appSettings&quot; within the web.config. We will also add two extra ones for the root site URL and the list name that we are to log to. This could be done differently but I chose this for this example. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap9.png"> </p>
<p>The list of file types will simply be a separate list that we will then read into the HttpModule and use accordingly. So firstly let's create our code for inserting the content into our list. We need to create the method and then get the values from the &quot;AppSettings&quot; within the &quot;web.config&quot; using the &quot;<a href="http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx">ConfigurationManager</a>&quot; namespace. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap10.png"> </p>
<p>We then add the following code to get a <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.aspx">SPSite</a> and <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.aspx">SPWeb</a> object. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap11.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap12.png"> </p>
<p>Now we can add our code that will create the new list item. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap13.png"> </p>
<p>Notice that I am calling a utility method called &quot;GetFileName&quot; this is because when I grab the URL I get something like this: </p>
<p><a href="http://intranet/Dev/Shared Documents/myDocument.pdf">http://intranet/Dev/Shared%20Documents/myDocument.pdf</a> </p>
<p>I would need to parse this out so I would get just the name of the file instead. Even though this would work I felt it would be better to call a function that would give me access to the metadata fields that were associated with the actual file. This would then allow me to extend the solution further by getting other details about the file rather than just the URL. For this example I get the actual name of the file as shown in the library or list. </p>
<p>This method is a re-hash of the one I used in my Search API posts a while back. The code should be similar to this: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap14.png"> </p>
<p>So now we have our method created that will actually insert to our logging table, now let's modify the &quot;<a href="http://msdn.microsoft.com/en-us/library/system.web.httpapplication.authenticaterequest.aspx">AuthenticateRequest</a>&quot; method so it reads the file types and then inserts the log as needed. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap15.png"> </p>
<p>As you can see this grabs the current &quot;<a href="http://msdn.microsoft.com/en-us/library/system.web.httpapplication.aspx">HttpApplication</a>&quot; which comes from the initialize event, grabs the file types as an array and parses them and inserts the log when needed. Okay so now we have built it, let's built and deploy. In my case it creates a DLL, which I add to the GAC (development box), and then add the following entry to the &quot;HttpModules&quot; section of the &quot;web.config&quot; file. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap16.png"> </p>
<p>So test this we can upload some files into a library and then access them. The following screenshots is the process I took: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap17.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap18.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap19.png"> </p>
<p>If we now look in the custom logging list we can now see two entries for the viewed files: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/060309_1047_MOSS2007Cap20.png"> </p>
<p>If you remember we are only logging PDF, PNG and DOCX file extension but this could be changed. </p>
<p>As you can see with a little customization we could capture all kinds of content about the current user or visitor accessing the site. In the next post we will extend it to capture more information and events through the system. <span style="font-family:Wingdings">J</span></p>
<p> </p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Liam Cleary</dc:creator><pubDate>Wed, 03 Jun 2009 11:51:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Development/default.aspx">Development</category><category domain="http://www.helloitsliam.com/archive/tags/How To Code/default.aspx">How To Code</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/06/03/moss-2007-–-capture-direct-view-clicks.aspx</feedburner:origLink></item><item><title>SharePoint on the iPhone?</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/9STP-_Kn3lY/sharepoint-on-the-iphone.aspx</link><guid isPermaLink="false">/archive/2009/05/15/sharepoint-on-the-iphone.aspx</guid><description><![CDATA[<div class="ExternalClass36F55EF6AC3E4DA4A6E5089B6CCED984">
<p>Yes that is correct; I did say SharePoint on the iPhone!! Recently I got an iPhone and since then I have been obsessed with it. It is a fantastic tool for work as well as looking sexy!! Since getting it I have been teaching myself how to write programs for it and looking into how to get it to talk to SharePoint. As I have been working on it, I have wondered why no-one had written anything, and then out of the blue I stumbled across the following two links: </p>
<p><a href="http://www.isharephone.com/">http://www.isharephone.com/</a> (Not tested yet) </p>
<p><a href="http://www.spyk.com/Pages/Default.aspx">http://www.spyk.com/Pages/Default.aspx</a> (Tested and using) </p>
<p>After looking into them I decided to try the iShare for the iPhone. So after I installed it what do we get? </p>
<p>You are able to add multiple accounts; mine is set to my blog site. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo1.png"> </p>
<p>Once you set up the connection you are then able to select the browse button and view your structure of the site. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo2.png"> </p>
<p>If we now click on the downloads library we can then see the types of the library. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo3.png"> </p>
<p>If we now click into the articles category we should now see our documents </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo4.png"> </p>
<p>Upon clicking on one of the PDF documents it will then load and the render the file as needed. </p>
<div>
<table style="border-collapse:collapse" border="0">
<colgroup>
<col style="width:319px">
<col style="width:319px"></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left:7px;padding-right:7px">
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo5.png"></p></td>
<td style="padding-left:7px;padding-right:7px">
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo6.png"></p></td></tr></tbody></table></div>
<p> </p>
<p>If we go back to the root and this time select the links list it renders as shown below. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo7.png"> </p>
<p>Let's say we want to add a new one, we can press the plus button at the top right. You should then see the content types that are available to select from listed. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo8.png"> </p>
<p>I will choose the link option and I am then presented with the fields that I need to complete, one of which is URL. If I press the URL field I am presented with the keyboard as normal and can then type. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo9.png"> </p>
<p>Once done I press OK and then my new link is listed within the list. </p>
<div>
<table style="border-collapse:collapse" border="0">
<colgroup>
<col style="width:319px">
<col style="width:319px"></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left:7px;padding-right:7px">
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo10.png"></p></td>
<td style="padding-left:7px;padding-right:7px">
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo11.png"></p></td></tr>
<tr>
<td style="padding-left:7px;padding-right:7px">
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo12.png"></p></td>
<td style="padding-left:7px;padding-right:7px"> </td></tr></tbody></table></div>
<p> </p>
<p>If I wanted to also see my posts on the blog and make some quick edits I could access the posts library from the root site. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo13.png"> </p>
<p>To see one of the posts I simply select the post and it renders in a form view. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo14.png"> </p>
<p>I can then select Edit from the menu bar and it will allow me to edit the content of each field. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo15.png"> </p>
<p>Now this is great but what about if you don't know what it is you are looking for. You are able to search from the application. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1513_SharePointo16.png"> </p>
<p>You can then work with the links, files etc as you would normally. All in all this is a great product, ok no it may not render the entire site as I wanted but it renders in it a way that means I can make quick changes updates etc while on the go. </p>
<p>I am using it myself for some of the SharePoint sites at work where I need to be able to view and update things while on the move. I recommend you pop onto the App Store and download a copy of it!! </p>
<p><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=305862898&amp;mt=8"><img style="border-bottom:0px solid;border-left:0px solid;border-top:0px solid;border-right:0px solid" border="0" alt="Download iShare - SharePoint for iPhone on the iTunes appstore" src="http://www.spyk.com/Products/iShare/PublishingImages/downloadBanana.gif"></a> </p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Liam Cleary</dc:creator><pubDate>Fri, 15 May 2009 16:18:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/iPhone/default.aspx">iPhone</category><category domain="http://www.helloitsliam.com/archive/tags/WSS/default.aspx">WSS</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/05/15/sharepoint-on-the-iphone.aspx</feedburner:origLink></item><item><title>MOSS2007 – 302 to 301 “Pages” Redirect</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/KoHaKlEVIy8/moss2007-–-302-to-301-“pages”-redirect.aspx</link><guid isPermaLink="false">/archive/2009/05/15/moss2007-–-302-to-301-“pages”-redirect.aspx</guid><description><![CDATA[<div class="ExternalClass7E18DF1701BC46F689E5BDC279DAC5FE">
<p>As most of you will no doubt know, SharePoint uses 302 to redirect pages and sites to the default pages. In a good external site you would really want these to be changed to 301 redirects. What are these redirects and what do they do?<span style="color:black"><br><br><strong>Permanent 301 </strong><br>Permanent 301 redirects are just as they sound. They are permanent redirects from an old URL to a new one. These redirects tell the search engines that the old location is to be removed from their index and replaced with the new location. Using 301 redirects is the most search engine friendly way to redirect traffic and engines, and far outweighs that of various JavaScript and Meta refresh redirects.<br><br><strong>Temporary 302</strong><br>Temporary 302 redirects are also as they sound; temporary. Here you are telling the search engines to read and use the content on the new page, but to keep checking the original URL first as it will ultimately be reestablished.</span> </p>
<p>The main issue with 302 headers is that the redirected locations don't get crawled by search engines which don't follow temporarily moved pages. This is not an issue for intranet sites normally but for external sites this is a problem. </p>
<p>There are tons of ways of fixing this, a few are the following: </p>
<p><a href="http://www.thesug.org/Blogs/lsuslinky/archive/2009/04/17/Fixing_the_302_redirect_problem_in_SharePoint_.aspx.aspx">http://www.thesug.org/Blogs/lsuslinky/archive/2009/04/17/Fixing_the_302_redirect_problem_in_SharePoint_.aspx.aspx</a> </p>
<p><a href="http://vettekerry.wordpress.com/2008/09/09/moss-seo-302-pages-redirect/">http://vettekerry.wordpress.com/2008/09/09/moss-seo-302-pages-redirect/</a> </p>
<p><a href="http://blog.seo-hardcore.com/caching/sharepoint-2007-301-redirects">http://blog.seo-hardcore.com/caching/sharepoint-2007-301-redirects</a> </p>
<p><a href="http://www.sharepointblogs.com/tmt/archive/2008/01/21/sharepoint-2007-redirect-solved-using-301-instead-of-302-redirects.aspx">http://www.sharepointblogs.com/tmt/archive/2008/01/21/sharepoint-2007-redirect-solved-using-301-instead-of-302-redirects.aspx</a> </p>
<p>To add to the list I decided to simply add some code to the &quot;Global.asax&quot; file. This is only a temporary fix, as the proper way of doing it would be to use an Http Handler. I know there are lots of pros and cons to using the &quot;Global.asax&quot; within a SharePoint environment but for this *quick* fix it worked okay. </p>
<p>Now for my requirement I simply needed to ensure that when someone typed: <a href="http://www.sharepointsite.com/Pages/">http://www.sharepointsite.com/Pages/</a> that it did a redirect using 301 not 302. The redirection from the site URL of <a href="http://www.sharepointsite.com/">http://www.sharepointsite.com</a>, had already been fixed using a Http Handler, however the functionality for the pages redirect was not in this version. So let's look at what it does to begin with. I am using the following URL on my laptop: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1027_MOSS20073021.png"> </p>
<p>When I access this site you can see using Fiddler that a 302 redirect takes place. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1027_MOSS20073022.png"> </p>
<p>Now with the code block below the following happens: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1027_MOSS20073023.png"> </p>
<p><strong>NOTE: The code block is very simple, not the most elegant code but as stated before should really be developed into an Http Handler. </strong></p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/051509_1027_MOSS20073024.png"> </p>
<p>Now I know that this is the ideal approach to resolve this issue so this is just an idea of what can be done to fix this issue without having to write a full module that fixes this. You can take the code you would write for the handler and use that within the &quot;Global.asax&quot; as well if needed. </p>
<p> </p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Liam Cleary</dc:creator><pubDate>Fri, 15 May 2009 11:28:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Development/default.aspx">Development</category><category domain="http://www.helloitsliam.com/archive/tags/How To Code/default.aspx">How To Code</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/05/15/moss2007-–-302-to-301-“pages”-redirect.aspx</feedburner:origLink></item><item><title>MOSS2007 - Incoming Email (Multi SMTP Domain Configuration)</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/6THQ5E844To/moss2007-incoming-email-multi-smtp-domain-configuration.aspx</link><guid isPermaLink="false">/archive/2009/05/09/moss2007-incoming-email-multi-smtp-domain-configuration.aspx</guid><description><![CDATA[<div class="ExternalClassB8B9F670AA614311B175A99CFA3879D0">
<p>If like me you have worked with quite a few SharePoint installs, probably at some point you will have configured incoming email. It works well and relies on the following: </p>
<ol>
<li>SMTP Server installed on MOSS Server </li>
<li>Targeted Drop Folder for SharePoint to Monitor </li>
<li>Routable email addresses </li>
<li>Specific email aliases for the lists or libraries </li></ol>
<p>One thing I had always wondered was how come you could only use a single domain. The configuration below shows what I mean: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc1.png"> </p>
<p>The reason for this was what happened if you were in a hosted environment with multiple site collections you could only enable incoming email for one domain when in fact you would want to use multiple. Now this could be achieve by using exchange etc and routing them to the single domain alias that the SMTP Server on MOSS uses. </p>
<p>After some investigation by me and a colleague (Willie) it became evident that the process within MOSS for incoming email did not check the actual domain part. So if your email address is the following: </p>
<p><a href="mailto:mylibrary@mosserver.domain.com">mylibrary@mosserver.domain.com</a> </p>
<p>The incoming process in MOSS only reads the &quot;<span style="color:red">mylibrary</span>&quot; part. It is the SMTP Server that is checking the domain. The MOSS part is purely reading the files as they hit the drop folder and then checking which library to send it to. So with this being case I did some further investigation and managed to build the system so I could route the following email addresses to the same library: </p>
<p><a href="mailto:0605091@win2k8x64.labs.local">0605091@win2k8x64.labs.local</a> </p>
<p><a href="mailto:0605091@domain1.com">0605091@domain1.com</a> </p>
<p><a href="mailto:0605091@domain2.com">0605091@domain2.com</a> </p>
<p> </p>
<p>So to configure this I did the following: </p>
<p>Firstly I needed to ensure that SMTP Server was installed on the MOSS Server. To begin with my server has six IP address: </p>
<p><em>192.168.1.130 = Default SMTP Server </em></p>
<p><em>192.168.1.131 = Domain 1 SMTP Server (Creating now) </em></p>
<p><em>192.168.1.132 = Domain 2 SMTP Server (Creating now) </em></p>
<p><em>192.168.1.133 = Not used </em></p>
<p><em>192.168.1.134 = Not used </em></p>
<p><em>192.168.1.135 = Not used </em></p>
<p> </p>
<p>From the IIS6 Compatibility Internet Services Manager I was able to check the default SMTP server was running on the following IP address over port 25. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc2.png"> </p>
<p>We now needed to create a new SMTP Server for each domain that we wish to use. Simply right click and select &quot;New &gt;&gt; SMTP Virtual Server&quot;. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc3.png"> </p>
<p>We need to select one of the IP Addresses added to the server for each virtual server; in this case we used the following: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc4.png"> </p>
<p>The key is next, we need to set the drop folder to the same as the default one that SharePoint is configured to read from: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc5.png"> </p>
<p>Next add the domain you need: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc6.png"> </p>
<p>Now we needed to repeat the process for each of the domains I was testing. Below is a shot of IIS Manager after they were configured: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc7.png"> </p>
<p>To make my life easier I installed the Telnet Client on my Windows 2008 Server and connected to each SMTP Server IP Address and ran normal SMTP Commands to create an email from the same address <a href="mailto:test@mail.com">test@mail.com</a>, and then sent it to the above addresses: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc8.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc9.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc10.png"> </p>
<p>Once the emails were created in the telnet client they were then added to the drop folder. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc11.png"> </p>
<p>As you can see with the following screenshots, each email clearly has a different &quot;x-reciever&quot; address which matches our addresses we wish tom test. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc12.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc13.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc14.png"> </p>
<p>After a while you should then see the drop folder empty as the SharePoint Timer job runs and moves the emails. The mails should then appear in the specified library. Notice they all appear irrelevant of the domain being used. The only common thing is the list/library alias of 0605091. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc15.png"> </p>
<p>To prove they are the right emails each body of the email was set with a different message saying which domain it came from. If we now open each one you should now see the following: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc16.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc17.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050909_0903_MOSS2007Inc18.png"> </p>
<p>So as you can see SharePoint does support multiple domains for Incoming emails even if the user interface within Central Administration and the list / library settings do not allow it. In a real world environment you still may use something like Exchange to receive the initial emails and then route to where you need them within the SMTP Server on MOSS. All in all this gives us a lot of flexibility for using incoming email within MOSS 2007. <span style="font-family:Wingdings">J</span></p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Liam Cleary</dc:creator><pubDate>Sat, 09 May 2009 10:06:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Administration/default.aspx">Administration</category><category domain="http://www.helloitsliam.com/archive/tags/How To/default.aspx">How To</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/05/09/moss2007-incoming-email-multi-smtp-domain-configuration.aspx</feedburner:origLink></item><item><title>MOSS2007 – Using the Search API (Part 3)</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/afqGhMtw43E/moss2007-–-using-the-search-api-part-3.aspx</link><guid isPermaLink="false">/archive/2009/05/04/moss2007-–-using-the-search-api-part-3.aspx</guid><description><![CDATA[<div class="ExternalClass5AC7F864832A4087B8C4477BB66549E5">
<p>In the last few posts we have looked at some of the Search API basics. One of the issues I mentioned earlier was that the &quot;PublishingRollupImage&quot; does not show itself in the search results. Using the following XSL code you can see this: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi1.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi2.png"> </p>
<p>I decided to use the Search Coder tool and see if this would display the &quot;PublishingRollupImage&quot;. I ran the same search query as before and the following was returned: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi3.png"> </p>
<p>However I noticed that the required field did not return any data again. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi4.png"> </p>
<p>As you can see this is obviously an issue with the core search API. So I set about trying to fix this issue and the idea was to use the code we created last time (which is a CAML query) and somehow use it inside the standard Search Results Web Part. So the architectural idea is as follows: </p>
<ol>
<li>Create new Web Part that inherits from the Search Core Results Web Part </li>
<li>Create a new XSLT for the Results </li>
<li>Create a custom XSLT Extension </li></ol>
<p>So let's create the web part. Firstly open up Visual Studio and choose to create a web part project. Make sure you inherit from the following: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi5.png"> </p>
<p>Based on our design, we only need to override the following method called &quot;ModifyXsltArgumentList&quot;: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi6.png"> </p>
<p>We need to add a reference to our custom XSLT extension that we have not added yet. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi7.png"> </p>
<p>So now we have our web part done lets add the XSLT extension code. This for ease and convenience will be added to our web part as a new class. Not the best approach but for this demonstration should be fine. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi8.png"> </p>
<p>The code is more or less the same as the previous post so does not need documenting here. <span style="font-family:Wingdings">J</span> </p>
<p>I was going to create a new XSLT but thought it may be easier to use one of the ones that exist here: </p>
<p><a href="http://www.codeplex.com/sctxsl">http://www.codeplex.com/sctxsl</a> </p>
<p>I chose to use the following XSLT: <a href="http://sctxsl.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=12070#DownloadId=32021">http://sctxsl.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=12070#DownloadId=32021</a> </p>
<p>So now let's tie it all together. We will add our new web part to the search page as shown below and add the XSL we used earlier to return the raw XML: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi9.png"> </p>
<p>We need to modify the fields list so it includes the &quot;PublishingRollupImage&quot;. To do this we need to modify the &quot;Selected Columns&quot; that are listed within the &quot;Results Query Options&quot;. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi10.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi11.png"> </p>
<p>We also need to modify the XSLT by pasting the one that we downloaded from Codeplex. We also need to modify the following lines: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi12.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi13.png"> </p>
<p>Notice that we are adding references to the new XSLT Extension and calling it for our item URL. Once this is all put together it renders as shown below: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1519_MOSS2007Usi14.png"> </p>
<p>This now means that I can custom style my results anyway I wish and know the &quot;PublishingRollupImage&quot; will display. And this works because we are using a custom XSLT Extension class. This is a great way of solving the &quot;PublishingRollupImage&quot; problem, it has not been tested with lots of results but should function fairly ok as it is only called if it needs to be called. <span style="font-family:Wingdings">J</span> </p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Administrator</dc:creator><pubDate>Mon, 04 May 2009 16:22:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Development/default.aspx">Development</category><category domain="http://www.helloitsliam.com/archive/tags/How To Code/default.aspx">How To Code</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/05/04/moss2007-–-using-the-search-api-part-3.aspx</feedburner:origLink></item><item><title>MOSS2007 – Using the Search API (Part 2)</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/PJ9yLPZBxfE/moss2007-–-using-the-search-api-part-2.aspx</link><guid isPermaLink="false">/archive/2009/05/04/moss2007-–-using-the-search-api-part-2.aspx</guid><description><![CDATA[<div class="ExternalClass97887B8D15AF4DBC945B785A157448D9">
<p>In my last <a href="http://www.helloitsliam.com/archive/2009/05/01/moss2007-–-using-the-search-api-part-1.aspx">post</a> we looked at some basic Search API code using our forms application. As a response to this Daniel from &quot;Zevenseas&quot; he has a tool, if you haven't already got it, go get it from here: <a href="http://mosssearchcoder.codeplex.com/"><span style="text-decoration:underline">http://mosssearchcoder.codeplex.com</span></a><span style="font-family:Tahoma;color:black;font-size:7pt"> </span></p>
<p>This application will allow you to create all the Search Queries and even generates the C# code that you may need. Recommend you go get it!! </p>
<p>In this post I wanted to look at changing the code we wrote last time and turn it into a web part. So let's begin. Create a new Web Part project and call it the following: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi1.png"> </p>
<p>The code will be the same for our search etc and also our &quot;PublishingRollupImage&quot; CAML Query. The only change is that instead of passing the URL to perform the search query, we use the following: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi2.png"> </p>
<p>The code from this point down is more of less the same. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi3.png"> </p>
<p>In the previous post we had a checkbox that enabled the &quot;PublishingRollupImage&quot; check. In the web part I wanted to change this to check if this field had been added to the list of fields and then only run of it was. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi4.png"> </p>
<p>The user interface for this is simply a set of labels and boxes that are rendered using the following syntax for each item. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi5.png"> </p>
<p>Now we have our web part built it should render as the following (Ignore the layout etc, just showing functionality): </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi6.png"> </p>
<p>When we run this without the &quot;PublishingRollupImage&quot; field it shows as below: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi7.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi8.png"> </p>
<p>When we run this with the &quot;PublishingRollupImage&quot; field it shows as below: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi9.png"> </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050409_1416_MOSS2007Usi10.png"> </p>
<p>As you can see this is now functioning as in the previous post. In the next post we will look at changing this and using the Search Core Results Web Part and using our custom CAML code we created previously. <span style="font-family:Wingdings">J</span> </p>
<p> </p>
<p> </p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Administrator</dc:creator><pubDate>Mon, 04 May 2009 15:22:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Development/default.aspx">Development</category><category domain="http://www.helloitsliam.com/archive/tags/How To Code/default.aspx">How To Code</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/05/04/moss2007-–-using-the-search-api-part-2.aspx</feedburner:origLink></item><item><title>MOSS2007 – Using the Search API (Part 1)</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/KfdEigR6dwo/moss2007-–-using-the-search-api-part-1.aspx</link><guid isPermaLink="false">/archive/2009/05/01/moss2007-–-using-the-search-api-part-1.aspx</guid><description><![CDATA[<div class="ExternalClass8790407E2B514006B9F52E5A26DC81EA">
<p>On a few projects recently there has been a need to use the search API. You may wonder why you would think to use the search API at all considering we have all the aggregation we need with the Content Query Web Part. I hear you and yes I understand however there are occasions when you will need to use this. The CQWP is great but does have a few problems when you reach over the 2000 lists in a site collection limit, even though you can set the limit using the &quot;&lt;Lists /&gt;&quot; parameter to unlimited it still tends to fail. A quick way of resolving this is to use the search API, not only is very easy and quick to use, but it also allows for cross site collection searches out of the box. </p>
<p>So in this post I am going to show you the basics of using the search API. So to begin with I am not going to build a web part or control, I am simply going to build a windows application that just returns to rudimentary data from the search we perform. </p>
<p>Firstly I have created a form that looks like this: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi1.png"> </p>
<p>The form is fairly straight forward and not sexy in anyway. It has a textbox for the portal URL, a few boxes for the actual search query and then the results. Of course there is a button to run this query also. So let's begin with the code. The first thing to note here is that you need to add the following references: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi2.png"> </p>
<p>We then need to connect to the site we want to use. Below is the standard statement I would use, notice this is coming from the textbox field on the form. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi3.png"> </p>
<p>Once we have our connection to the site we then combine the various textbox values to create the full SQL Query. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi4.png"> </p>
<p>We then need to tell the code to run a &quot;FullTextSQLQuery&quot;, notice I have enabled &quot;Stemming&quot;, &quot;Trimming of Duplicates&quot; and made sure the results are &quot;RelevantResults&quot;. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi5.png"> </p>
<p>Now we have our query created and out base settings for the &quot;FullTextSQLQuery&quot; we need to actually execute this and populate the &quot;ResultTable&quot; </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi6.png"> </p>
<p>After the &quot;ResultTable&quot; is populated a dataset is populated with these values, this just makes it easier for my example here. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi7.png"> </p>
<p>Now I am going to create a &quot;StringBuilder&quot; so I can separate the type field values and then format these so my results are dynamic based on the fields type in the query. If I did not do this I would have needed to rely on typing each field that was selected out for the results to work. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi8.png"> </p>
<p>Lastly we populate the textbox with the results. So let's see what it looks like: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi9.png"> </p>
<p>I am using a basic query as shown above: </p>
<p><span style="color:red"><strong>&quot;SELECT Title, URL FROM Scope () WHERE FREETEXT(DEFAULTPROPERTIES, 'Administrator') ORDER BY RANK&quot; </strong></span></p>
<p>The results for this are as follows, excuse the formatting here. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi10.png"> </p>
<p>So what if we wanted to run a similar query that returned users &quot;My Sites&quot; instead. Let's modify the query again: </p>
<p><span style="color:red"><strong>&quot;SELECT Title, URL FROM Scope() WHERE &quot;scope&quot;= 'People' AND FREETEXT(DEFAULTPROPERTIES, 'Administrator') ORDER BY RANK&quot; </strong></span></p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi11.png"><span style="color:red"><strong> </strong></span></p>
<p>The returns just the administrators my site link, if we take off the end part of the query we get the entire &quot;My Site&quot; site links. </p>
<p><span style="color:red"><strong>&quot;SELECT Title, URL FROM Scope () WHERE &quot;scope&quot;= 'People'&quot; </strong></span></p>
<p>Now what about if we wanted to get only pages based on a specific content type? The query needs to be modified as shown below: </p>
<p><span style="color:red"><strong>&quot;SELECT Title, URL FROM Scope() WHERE ContentType = 'Article Page' ORDER BY RANK&quot; </strong></span></p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi12.png"><span style="color:red"><strong> </strong></span></p>
<p><span style="color:red"><font color="#000000">Or you could search for multiple content types with the following syntax: </font></span></p>
<p><span style="color:red"><strong>&quot;SELECT Title, URL FROM Scope() WHERE ContentType = 'Article Page' OR ContentType = 'Page' OR ContentType = 'Welcome Page' ORDER BY RANK&quot; </strong></span></p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi13.png"><span style="color:red"><strong> </strong></span></p>
<p>As you can see with a little playing around you can get any of the fields to show up and then use them in the search. In the next few posts I will expand on how we can use the Search API to produce some powerful results. </p>
<p>One of the only issues that I have found is the issue of certain fields not showing up in the search results. This is a pain and can stop you deciding to use it. Even though the field is indexed and is present in the Shared Service Provider it does not show up in the search results. To show you how you can expand the code slightly I have changed my initial form to include the following: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi14.png"> </p>
<p>This check runs some kind during the search process and grabs the relevant &quot;PublishingRollupImage&quot; details. This is basically using a CAML query based on the URL of the item found in the search. </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi15.png"> </p>
<p>The result is the following: </p>
<p><img alt="" src="http://www.helloitsliam.com/Lists/Photos/050109_1532_MOSS2007Usi16.png"> </p>
<p>In the next part we will look at moving this into the SharePoint and changing the output to XML and using XSLT to style it. <span style="font-family:Wingdings">J</span></p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Administrator</dc:creator><pubDate>Fri, 01 May 2009 16:41:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Development/default.aspx">Development</category><category domain="http://www.helloitsliam.com/archive/tags/How To Code/default.aspx">How To Code</category><category domain="http://www.helloitsliam.com/archive/tags/Office System 2007/default.aspx">Office System 2007</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/05/01/moss2007-–-using-the-search-api-part-1.aspx</feedburner:origLink></item><item><title>European SharePoint Best Practice Conference- Thoughts</title><link>http://feedproxy.google.com/~r/helloitsliam/~3/IYekVDWQMZA/european-sharepoint-best-practice-conference-thoughts.aspx</link><guid isPermaLink="false">/archive/2009/04/09/european-sharepoint-best-practice-conference-thoughts.aspx</guid><description><![CDATA[<div class="ExternalClass97C3C90DFB954E189BD15AB51327603F">
<p><strong>What can I say about the conference? </strong></p>
<p>Really just need to say massive great big thanks to Steve Smith @ Combined Knowledge for organizing a fantastic event. The Venue, Speakers, Sessions and Everyone there was fantastic. It was great to be part of the conference and see how excited people are about the SharePoint technologies. As with all conferences the best time comes when the sessions have finished and you have discussions out and about in the evening. I had many conversations that I won't forgot at about 2am in the morning in restaurants, bars and the hotel lobby, we always seemed to struggle to actually get into Bed at a reasonable time. Great conversation with Joel Oleson, Daniel McPherson and Neil Hodgkinson<strong> </strong>about the future of the human race as well as toilets. Not quite related to SharePoint but a great laugh!! </p>
<p>As you may have noticed if you are a Twitter follower, the whole conference and sessions were being tweeted out, I publically apologize to those who could not keep up with my Twitters or the slowness you may have experienced while it happened. It was great to see people appreciating the tweets when they could not attend the conference. Twitter is fantastic, for a SharePoint conference it was a great way to get feedback, comments and really share the whole experience. I have now been labeled a &quot;Twitter Whore&quot; by Bob Fox!! Cheers Bob. </p>
<p>You can catch-up on the whole conference tweets using this link: </p>
<p><a href="http://search.twitter.com/search?q=+%23spbpuk">http://search.twitter.com/search?q=+%23spbpuk</a> </p>
<p>If you wish to read my tweets then use this link (There are a few): </p>
<p><a href="http://search.twitter.com/search?q=&amp;ands=&amp;phrase=&amp;ors=&amp;nots=&amp;tag=spbpuk&amp;lang=all&amp;from=helloitsliam&amp;to=&amp;ref=&amp;near=&amp;within=15&amp;units=mi&amp;since=&amp;until=&amp;rpp=50">http://search.twitter.com/search?q=&amp;ands=&amp;phrase=&amp;ors=&amp;nots=&amp;tag=spbpuk&amp;lang=all&amp;from=helloitsliam&amp;to=&amp;ref=&amp;near=&amp;within=15&amp;units=mi&amp;since=&amp;until=&amp;rpp=50</a> </p>
<p>Anyway all I can say is make sure you attend the next conference, it is a great atmosphere and great time to meet the rest of the UK and Global SharePoint community. </p></div>]]></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Liam Cleary</dc:creator><pubDate>Thu, 09 Apr 2009 12:12:00 GMT</pubDate><category domain="http://www.helloitsliam.com/archive/tags/Conferences/default.aspx">Conferences</category><category domain="http://www.helloitsliam.com/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.helloitsliam.com/archive/2009/04/09/european-sharepoint-best-practice-conference-thoughts.aspx</feedburner:origLink></item></channel></rss>
