SharePoint

SharePoint 2010 WebPart Enhancements

Posted by mjimison on October 23, 2009
2010, SharePoint, WebPart / 1 Comment

It’s been too long since my last post. I struggle as a blogger because I feel my time is better spent reading bloggers like Andrew Connell, Waldek Mastykarz, Eric Shupps, and so on, rather than writing my own content. I never imagined this long of a gap between my last posts, but the recent SharePoint conference has re-inspired me to begin writing again.

I was one of the lucky few who was registered and set to hit Vegas for the 2009 SharePoint conference. However, as luck would have it, the H1N1 virus had other plans for me, and I was forced to stay at home and watch all of the conference online. Although I missed out on a lot of the fun, I was able to soak in a lot of the information, and so I want to summarize some of the new features for anyone who wasn’t able to attend, or didn’t get to all of the sessions they had hope to watch.

Most of the content in this post came from a great session on Advanced WebPart development, which was done by Maurice Prather, from ShareSquared. Here are the main points I’d like to highlight:

Versioning

Anyone who has had an author put a lot of content into a Content Editor WebPart, and ask the question “Why is my content not changing when I restore a version?” is going to be happy about this addition. WebParts are now versioned with pages, so you no longer are only left with the option of putting your content into the publishing content fields. There are a lot of  strong opinions out there saying the content editor WebPart shouldn’t even be used, but if you’re in an organization who has decided to continue using it, being able to version that data will be a big help. It will also be nice for keeping configuration setups for other WebParts such as the content query WebPart, where you’ve gone through revisions and want to roll back to earlier settings.

Visual WebParts

This is really not something new to SharePoint 2010. What’s new is Visual Studio’s excellent automation of a system many have been using for a long time. ASP.Net developers are often more comfortable when working within a designer GUI where controls can be dragged and dropped. While using CreateChildControls is perfectly valid, and still a good way to go, creating an experience where less code is written often leads to more productivity. The trick has always been the following:

  1. Create a User Control within Visual Studio
  2. Push the User Control into the ControlTemplates directory inside the 12 Hive (located at: 12 Hive/Templates/ControlTemplates)
  3. Create a WebPart class and use Page.LoadControl inside CreateChildControls to load in your User Control

This same concept is exactly what Visual Studio is now doing for you, but its taking out many of the steps you would perform manually, and making it a much more complete experience.
(Note: Visual WebParts will not work when part of a Sandboxed Solution, something i plan to recap in another post)

Cross-Site Scripting Safeguards (XSS)

This affects old and new WebParts, and it’s important to understand how your current solutions could be affected, even if they will still otherwise work in SharePoint 2010. Simple properties on a WebPart class are normally displayed in the Editor Toolbar (in the default Miscellaneous category if not specified). Many times a developer might take the value of a property entered in the editor, and directly output it to the screen (i.e. new LiteralControl(QuoteOfTheDay) ). The issue with this is that if any html, script, etc… were injected into this property, by outputting it to the screen, malicious code could be run that affects all users to the site. Properties now have a new RequiresDesignerPermission attribute to determine if a property needs designer permissions in order to display on the editor toolbar, and SafeControl entries now have a new SafeAgainstScript attribute to control whether a control is protected. The default behavior without specifying either is that only designers can edit the properties. When SafeAgainstScript is set to true, and RequiresDesignerPermission attribute is set to false, then and only then, can Contributors gain access to edit the property. Going forward this should help to ensure developers are properly encoding values, etc…, before they mark a control as SafeAgainstScript and set RequiresDesignerPermission to false, if they are going to be outputting properties onto the screen.

(Note: personalized properties will not be affected by this new addition, since they would only display for an individual user, and would not be a risk to other viewers)

Miscellaneous

Here are a few things to look forward that don’t necessarily warrant their own section, but are nonetheless interesting:

  • The ASP.Net WebPart class is still the preferred class to inherit over the SharePoint WebPart class
  • More functionality is being added to the ASP.Net WebPart class
  • Developers are encouraged to deploy WebParts as features, and not directly through the solution manifest file or other means
  • Thew new enhanced WIKI allows WebParts to be dropped into anywhere inside the main content area, without having to put it into a WebPartZone (This is all happening behind-the-scenes through a dynamic zone that pushes WebParts into placeholders)

Summary

I hope this has been informative to some of you as to what we have to look forward to in WebParts inside SharePoint 2010. I am sure as Beta is released in November, and the product gets to release, there will be even more  gems to discover inside this new and very promising effort from Microsoft.

Cheers,
Matt

Share this post:

  • email
  • Twitter
  • Facebook
  • del.icio.us
  • Digg
  • Google Bookmarks
  • StumbleUpon

Twitter Search WebPart

Posted by mjimison on March 04, 2009
ASP.Net, C#, Linq, SharePoint, Twitter, WebPart / 15 Comments

Download now: WSP Solution | Source Code (zip)

I used to play in a punk rock band, and we often joked that with only so many bar chords to play, we often copied our own songs unintentionally. When you are writing a blog, it can be difficult to know when someone else has already written on the subject you’ve chosen, or if you’ve just coincidentally stumbled upon something already out there. I am positive there are other Twitter-related SharePoint posts written, but I haven’t seen any offer a configurable webpart like I’m about to do. If it’s been done before, I still consider the time I spent valuable, because this was a fun item to tackle.

Finished Product Screenshots: (Click for larger images)

Here are the inspirations for my post, including some of the source code for querying the Twitter Search API via Linq:

Here is how I made this project my own:

  1. Created a solution that contains a site-scoped feature for adding a Twitter Search WebPart to your site (WSP available for Download)
  2. WebPart has the main Twitter search API query abilities:
    1. General search term
    2. From user
    3. To user
    4. About user
    5. Hashtag
  3. Added the ability to define a QueryString variable that overrides the webpart configuration and takes the search directly from the QueryString
  4. Used caching in combination with Since_Id to cut back on amount of data being brought back with each request
  5. Solution deploys a custom css file to the 12 hive, which is embedded into the head of pages that include the webpart (easy to customize for your style)
  6. Enhanced the Linq query to bring back the profile images (or substitute Twitter’s default image when one is not present)
  7. Added the ability to turn profile images on and off in results display
  8. Used regular expressions to hyperlink usernames and urls embedded in status updates (text search returns has html stripped)
  9. There are no SharePoint references in the webpart, and it inherits from the regular WebPart class, so it could easily be used in an ASP.Net 3.5 Application

The source code and wsp file are both available for download. You will need WSPBuilder installed if you wish to work with the provided source code, as that is my choice of development tool, and since Linq, lambda expressions, etc… are used, you will also need the ASP.Net 3.5 Framework to run this webpart.

Installation Instructions:

  1. Download wsp to your server
  2. Run the following stsadm commands on the solution file (Best to run in directory where you have copied the solution)
    1. stsadm -o addsolution -filename MattJimison.Twitter.wsp
    2. stsadm -o deploysolution -name MattJimison.Twitter.wsp -url http://yoursite.com -immediate -allowgacdeployment
    3. stsadm -o execadmsvcjobs
    4. stsadm -o activatefeature -filename TwitterSearchWebPart\feature.xml -url http://yoursite.com
  3. The WebPart will be located under the group ‘mattjimison.com’

Closing Thoughts:
This was a fun project to create. There are already so many great Twitter applications out there, and I thought it would be fun to get a WebPart started. There was a lot more I wanted to do, but I might save that for a future post. Although you could derive a solution using the oob xml webpart, it would not be as configurable, utilize Since_Id that the Twitter API recommends, or be easy for a non-developer to work with. I see this webpart as a great way to keep tabs on what people are saying about something (your company for instance) or focus in on some key individual communications while remaining on your own site. Thanks for reading, and be sure to look me up on Twitter.

Cheers.

Matt


Downloads
WSP Solution
Source Code (zip)


Source code for main webpart class:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Caching;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
 
namespace MattJimison.Twitter
{
    [Guid("d7bd616b-fa72-4299-a1c1-4c2d79f1970d")]
    public class TwitterSearchWebPart : WebPart
    {
 
        #region Properties / Fields
        private bool m_DisplayImage = true;
        [Personalizable(PersonalizationScope.User)]
        [WebBrowsable(true)]
        [Category("Twitter Search")]
        [WebDisplayName("Display Profile Image")]
        [WebDescription("Display Profile Image")]
        public bool DisplayImage
        {
            get { return m_DisplayImage; }
            set { m_DisplayImage = value; }
        }
 
        [Personalizable(PersonalizationScope.User)]
        [WebBrowsable(true)]
        [Category("Twitter Search")]
        [WebDisplayName("Search Text")]
        [WebDescription("Search Text")]
        public string SearchText { get; set; }
 
        [Personalizable(PersonalizationScope.User)]
        [WebBrowsable(true)]
        [Category("Twitter Search")]
        [WebDisplayName("From")]
        [WebDescription("From User")]
        public string From { get; set; }
 
        [Personalizable(PersonalizationScope.User)]
        [WebBrowsable(true)]
        [Category("Twitter Search")]
        [WebDisplayName("To")]
        [WebDescription("To User")]
        public string To { get; set; }
 
        [Personalizable(PersonalizationScope.User)]
        [WebBrowsable(true)]
        [Category("Twitter Search")]
        [WebDisplayName("About")]
        [WebDescription("About User")]
        public string About { get; set; }
 
        [Personalizable(PersonalizationScope.User)]
        [WebBrowsable(true)]
        [Category("Twitter Search")]
        [WebDisplayName("Hashtag")]
        [WebDescription("Hashtag")]
        public string HashTag { get; set; }
 
        [Personalizable(PersonalizationScope.User)]
        [WebBrowsable(true)]
        [Category("Twitter Search")]
        [WebDisplayName("QueryString Variable")]
        [WebDescription("QueryString Variable")]
        public string QueryStringVariable { get; set; }
 
        public List<Tweet> CachedTweets
        {
            get
            {
                if (HttpContext.Current.Cache[m_Query] != null)
                {
                    return (List<Tweet>)HttpContext.Current.Cache[m_Query];
                }
                else
                {
                    return new List<Tweet>();
                }
            }
 
            set
            {
                if (HttpContext.Current.Cache[m_Query] == null)
                {
                    HttpContext.Current.Cache.Add(m_Query, value, null, DateTime.Now.AddMinutes(5),
                        Cache.NoSlidingExpiration, CacheItemPriority.Normal, null);
                }
                else
                {
                    HttpContext.Current.Cache[m_Query] = value;
                }
            }
        }
 
        public string CachedSinceId
        {
            get
            {
                if (HttpContext.Current.Cache[m_SinceIdPrefix + m_Query] != null)
                {
                    return (string)HttpContext.Current.Cache[m_SinceIdPrefix + m_Query];
                }
                else
                {
                    return null;
                }
            }
 
            set
            {
                if (HttpContext.Current.Cache[m_SinceIdPrefix + m_Query] == null)
                {
                    HttpContext.Current.Cache.Add(m_SinceIdPrefix + m_Query, value, null, DateTime.Now.AddMinutes(5),
                        Cache.NoSlidingExpiration, CacheItemPriority.Normal, null);
                }
                else
                {
                    HttpContext.Current.Cache[m_SinceIdPrefix + m_Query] = value;
                }
 
            }
        }
 
        private string m_Query = null;
        private readonly string m_DefaultProfileImage = "http://static.twitter.com/images/default_profile_normal.png";
        private readonly string m_SinceIdPrefix = "SinceId::";
        private readonly string m_UrlTemplate = "http://search.twitter.com/search.atom?q={0}&since_id={1}";
        private static XNamespace m_AtomNS = "http://www.w3.org/2005/Atom";
        private static Regex m_TwitterName = new Regex(@"@([\w_]+)", RegexOptions.Compiled);
        private static Regex m_Url = new Regex(@"(https?://([\w-]+\.)+[\w-]+([^ ]*))", RegexOptions.Compiled);
 
        #endregion
 
        #region CreateChildControls
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
 
            try
            {
                AddStylesheet();
                BuildQuery();
                DisplayResults(GetTweets());
            }
            catch (Exception ex)
            {
                this.Controls.Add(new LiteralControl(ex.Message + "<br />" +
                    ex.StackTrace + "<br />" + ex.Source));
            }
        }
        #endregion
 
        #region AddStylesheet
        /// <summary>
        /// Add stylesheet reference to page's head section
        /// </summary>
        private void AddStylesheet()
        {
            //Dynamically add css reference
            HtmlLink cssLink = new HtmlLink();
            cssLink.Href = "~/_layouts/MattJimison/css/twitter.css";
            cssLink.Attributes.Add("rel", "Stylesheet");
            cssLink.Attributes.Add("type", "text/css");
            cssLink.Attributes.Add("media", "all");
            Page.Header.Controls.Add(cssLink);
        }
        #endregion
 
        #region BuildQuery
        /// <summary>
        /// Build dynamic query or read from querystring
        /// </summary>
        private void BuildQuery()
        {
            //If Querystring variable is set, read from QueryString
            if (!String.IsNullOrEmpty(QueryStringVariable) &&
                !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString[QueryStringVariable]))
            {
                m_Query = HttpContext.Current.Request.QueryString[QueryStringVariable];
            }
 
            else
            {
                //Dynamically Build Query
                List<string> patterns = new List<string>();
                if (!String.IsNullOrEmpty(SearchText))
                    patterns.Add(SearchText);
 
                if (!String.IsNullOrEmpty(From))
                    patterns.Add("from:" + From);
 
                if (!String.IsNullOrEmpty(To))
                    patterns.Add("to:" + To);
 
                if (!String.IsNullOrEmpty(About))
                    patterns.Add("@" + About);
 
                if (!String.IsNullOrEmpty(HashTag))
                    patterns.Add("#" + HashTag);
 
                //Join patterns with + delimiter
                m_Query = String.Join("+", patterns.ToArray());
 
                //UrlEncode
                m_Query = HttpUtility.UrlEncode(m_Query);
 
            }
        }
        #endregion
 
        #region GetTweets
        /// <summary>
        /// Obtain list of tweets from Twitter search API and merge with cached
        /// items using the previous SinceId
        /// </summary>
        /// <returns>Returns combined list of tweets</returns>
        private List<Tweet> GetTweets()
        {
            List<Tweet> results = new List<Tweet>();
 
            //Do not search on empty  query
            if (String.IsNullOrEmpty(m_Query))
                return results;
 
            //Retrieve cached results from same query
            List<Tweet> oldResults = CachedTweets;
 
            //Load in the search results
            XDocument xDoc = XDocument.Load(string.Format(m_UrlTemplate, m_Query, CachedSinceId));
 
            //Populate the Tweet list
            //Users that have default image won't have this image in search results so that is what
            //DefaultIfEmtpy(m_DefaultProfileImage).First() is for, to point to static image
            List<Tweet> newResults =
            (from tweet in xDoc.Descendants(m_AtomNS + "entry")
             select new Tweet
             {
                 Title = (string)tweet.Element(m_AtomNS + "title"),
                 Published =
                    DateTime.Parse((string)tweet.Element(m_AtomNS + "published")),
                 Id = (string)tweet.Element(m_AtomNS + "id"),
                 Link = tweet.Elements(m_AtomNS + "link")
                    .Where(link => (string)link.Attribute("rel") == "alternate")
                    .Select(link => (string)link.Attribute("href"))
                    .First(),
                 ProfileImage = tweet.Elements(m_AtomNS + "link")
                    .Where(link => (string)link.Attribute("rel") == "image")
                    .Select(link => (string)link.Attribute("href"))
                    .DefaultIfEmpty(m_DefaultProfileImage).First(),
                 Author = (from author in tweet.Descendants(m_AtomNS + "author")
                           select new Author
                           {
                               Name = (string)author.Element(m_AtomNS + "name"),
                               Uri = (string)author.Element(m_AtomNS + "uri"),
                           }).First()
             }
             ).ToList();
 
            //Concat old and new values and sort by id descending
            results = oldResults.Concat(newResults).OrderByDescending(tweet => tweet.Id).ToList();
 
            //Cache results when present
            if (results.Count > 0)
            {
                //Split the id up to grab the numerical portion
                //Example of how it comes through: tag:search.twitter.com,2005:1282047900
                string[] idParts = results[0].Id.Split(':');
                CachedSinceId = idParts[idParts.Length - 1];
                CachedTweets = results;
            }
 
            return results;
        }
        #endregion
 
        #region DisplayResults
        /// <summary>
        /// Creates dynamic controls containing data
        /// </summary>
        /// <param name="results">List of tweets to display</param>
        private void DisplayResults(List<Tweet> results)
        {
            //Variable setup
            Literal content = new Literal();
            StringBuilder txt = new StringBuilder();
            string profileImage = null;
            string authorName = null;
            string authorUri = null;
            string publishDate = null;
            string link = null;
            string title = null;
            string bodyClass = null;
 
            //Parent Panel
            Panel panel = new Panel();
            panel.CssClass = "tweet-searchheader";
 
            //Display Header
            if (!String.IsNullOrEmpty(m_Query))
            {
                //Decode since m_Query is url-encoded and htmlencode for protection
                txt.Append("<div class='tweet-search'><strong>Search Terms:</strong> " +
                    HttpUtility.HtmlEncode(HttpUtility.UrlDecode(m_Query)) + "</div>");
            }
 
            //Display no results found
            if (results.Count == 0)
            {
                txt.Append("<div class=\"tweet-emptysearch\">The search returned no results.</div>");
            }
 
            //Display header
            content.Text = txt.ToString();
            panel.Controls.Add(content);
            this.Controls.Add(panel);
 
            //Return on empty queries
            if (results.Count == 0)
            {
                return;
            }
 
            //start ol
            txt = new StringBuilder();
            txt.Append("<ol class=\"tweet-statuses\">");
 
            //Iterate through results and add to controls
            foreach (Tweet result in results)
            {
                //Set variables
                authorName = result.Author.Name.Replace("'", "");
                authorUri = result.Author.Uri;
                publishDate = result.Published.ToString("G");
                link = result.Link;
                title = AddHyperlinks(result.Title);
 
                //Start li
                txt.Append("<li class=\"tweet-status\">");
 
                //Image handling only shows when images are to be displayed
                if (DisplayImage)
                {
                    profileImage = result.ProfileImage;
                    txt.AppendFormat("<span class=\"tweet-thumb\"><a class=\"tweet-url\" href=\"{0}\" " +
                        "target=\"_blank\"><img class=\"tweet-photo\" src=\"{1}\" alt=\"{2}\" /></a></span>",
                        authorUri, profileImage, authorName);
                }
 
                //Author Link
                bodyClass = (DisplayImage) ? "tweet-statusbody" : "tweet-statusbodyplain";
                txt.AppendFormat("<span class=\"{0}\"><strong><a class=\"screenname\" href=\"{1}\" target=\"_blank\">{2}</a></strong> ",
                    bodyClass, authorUri, authorName);
 
                //Status Message
                txt.AppendFormat("<span class=\"tweet-entrycontent\">{0}</span> ", title);
 
                //Footer Message
                txt.AppendFormat("<span class=\"tweet-entrymeta\"><a href=\"{0}\" class=\"tweet-entrydate\" target=\"_blank\">Posted at {1}</a></span></span>",
                    link, publishDate);
 
                //Clear Element
                txt.Append("<div class=\"clear\"></div>");
 
                //End li
                txt.Append("</li>");
            }
 
            //end ol
            txt.Append("</ol>");
 
            //Add Content
            panel = new Panel();
            panel.CssClass = "tweet-container";
            content = new Literal();
            content.Text = txt.ToString();
            panel.Controls.Add(content);
            this.Controls.Add(panel);
 
        }
        #endregion
 
        #region AddHyperlinks
        /// <summary>
        /// Replace @username and hyperlink text with html anchor tags
        /// </summary>
        /// <param name="text">status text</param>
        /// <returns>status text with auto hyperlinks</returns>
        private string AddHyperlinks(string text)
        {
            text = m_Url.Replace(text, "<a href=\"$1\" target=\"_blank\">$1</a>");
            text = m_TwitterName.Replace(text, "<a href=\"http://www.twitter.com/$1\" target=\"_blank\">@$1</a>");
            return text;
        }
        #endregion
 
    }
}

Share this post:

  • email
  • Twitter
  • Facebook
  • del.icio.us
  • Digg
  • Google Bookmarks
  • StumbleUpon

How to Change the IIS Path for a SharePoint Web Application

Posted by mjimison on February 26, 2009
C#, PowerShell, SharePoint / 7 Comments

When creating a new web application in SharePoint, you choose the physical location of where the IIS website will be created. Once the application is born, however, there is no longer an option to change this path in Central Administration. You can very easily change it in IIS (by going to your website’s Properties -> Home Directory -> Local Path), but once this is done, you will start running into trouble, as solution deployments will point to the web.config file at the old location.

Three quick steps need taken to successfully move the web application:

  1. Copy the current directory’s contents into your new directory
  2. Make the change to the website’s local path in IIS (as described above)
  3. Update the SharePoint web application to point to the new path

Note: If you have multiple servers in your farm, steps 1 and 2 will need made on each web server, but step 3 will only need done once.

The third step can be done without having to extend the site. Here are a couple options.

Option 1: C# Console Application (Reference Microsoft.SharePoint.dll)

using System;
using System.IO;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
 
namespace IisPath
{
  class Program
  {
    static void Main(string[] args)
    {
      try
      {
        //Open the site your web application hosts
        using (SPSite site = new SPSite("http://yoursite.com"))
        {
 
          //Grab a reference to the site's web application's IIS Settings
          //Change SPUrlZone if application is not in default zone
          SPIisSettings iisSettings = site.WebApplication.IisSettings[SPUrlZone.Default];
 
          //Point to your new path
          iisSettings.Path = new System.IO.DirectoryInfo(@"D:\wss\VirtualDirectories\yoursite.com");
 
          //Call the Update method of the web application
          site.WebApplication.Update();
 
        }
      }
      catch (Exception ex)
      {
        Console.WriteLine(ex.Message);
        Console.ReadLine();
      }
    }
  }
}

Option 2: PowerShell Script

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
 
#Point to the site your web application hosts to grab a reference to the web application
$SPSite = new-object Microsoft.SharePoint.SPSite("http://yoursite.com")
$WebApp = $SPSite.WebApplication
 
#Change SPUrlZone if not in default zone
$IISSettings = $WebApp.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default]
 
#Point to your new directory
$IISSettings.Path = "D:\wss\VirtualDirectories\yoursite.com"
 
#Update Web Application
$WebApp.Update()
$SPSite.Dispose()

I hope this has been helpful, and as always, thank you for reading.

Cheers.

Share this post:

  • email
  • Twitter
  • Facebook
  • del.icio.us
  • Digg
  • Google Bookmarks
  • StumbleUpon

What this Blog Might Do

Posted by mjimison on February 24, 2009
General, SharePoint / No Comments

Being in web development for over 5 years, I often wonder why its taken me so long to start a blog.

The answer is simple, though: greed

I’ve been spending my time reading great blogs. I’ve been far more concerned with trying to pick something up, than to put something out. However, there have been many times I’ve found a ’starting point’ that had 60-70% of what I needed, but not everything. With SharePoint development gaining momentum, I thought a new blog would be a good opportunity to:

  1. Expand on ideas initially presented on other blogs
  2. Share solutions I’ve come up with on projects related to my work at Interactive Intelligence
  3. Wrap things up into solutions that non-developers will feel comfortable deploying

I’ve got experience in other technologies related to web development, and so from time to time, when appropriate, I may branch away from SharePoint to hit up related topics such as C#, ASP.Net, JavaScript, CSS, and more. However, my goal here is to just put meat on the table to serve up for consumption. I’ve got a good list of starting topics, and so I’m excited to start getting to it.

Cheers.

Share this post:

  • email
  • Twitter
  • Facebook
  • del.icio.us
  • Digg
  • Google Bookmarks
  • StumbleUpon