SharePoint 2010 spscore PlaceHolderPageTitle PageParserPath Bug

Actually not sure if this is a bug or whatever, but whenever we take a copy of a MySite masterpage in SharePoint 2010 and make our own copy of it we get this error about the PlaceHolderPageTitle and spscore. Don’t quite remember how we figured this out but I couldn’t find much googling or binging.

To fix this, you need to go into your SharePoint 2010 MySite web.config and replace the existing

1
<pageparserpaths></pageparserpaths>

with the PageParserPath to your MySite masterpage as shown below:

1
2
3
<pageparserpaths>
        <pageparserpath VirtualPath="/my/_catalogs/masterpage/New_MySite.master" CompilationMode="Always" AllowServerSideScript="true" />
      </pageparserpaths>

Tags: , , ,

Upgrading A SharePoint WSP With A New Feature

I know this post is very specific, i’ll go into how to create a WSP from scratch, how to build specific features, etc. in future posts. In this scenario, you have an existing WSP project and added a new feature that creates a link in the Site Settings section called Awesome Link, also assume we used WSP Builder to build a nice WSP file for you, let’s call this file AwesomeLink.wsp

Step 1

This is easy, just copy AwesomeLink.wsp to a folder on your SharePoint server. We’ll call this folder c:\projects\WSPs

Step 2

Now we will use STSADM to upgrade the solution by opening up a Command Prompt, one of the quickest ways to do this is to click on Start > Run, then type in CMD and press OK.

Next navigate to the folder where you copied over the AwesomeLink.wsp file, in this case it’s c:\projects\WSPs

Step 3

Type this first command and press the Enter key:
stsadm -o upgradesolution -filename "AwesomeLinks.wsp" -name "AwesomeLinks.wsp" -immediate -allowgacdeployment

Then type the second command and press Enter:
stsadm -o installfeature -name "AwesomeLink" -force

Step 4

Next go to your SharePoint site and click on Site Actions > Site Settings > Modify All Site Settings
Click on Site Collection Features link located under the Site Collection Administration group.

That’s It!

You’re all done upgrading a SharePoint WSP, go take a break or play some Xbox 360!

Test IE6 On A Free Virtual PC Image

I’m sure like everyone else you wish IE6 would just go away which it eventually will. The hate for IE6 has gone as far as dedicated websites such as IE Death March and wallpaper However in the meantime if you need to test on IE6 there are a few ways this can be done:

  • Run Xenocode IE6 Browser emulator
  • Install Tredosoft’s MultipleIE
  • Visit Browsershots.org
  • Or just remote into a server running IE6
  • Today I’m going to show you an alternative method testing IE6 in the most accurate manner possible, using a Virtual Machine:

    1. First download VPC (Virtual PC) if you don’t already have it
    2. Then install IE6-XPSP3.exe which is a VPC disk image for testing in a native IE environment.
    3. After you get this image up and running, if you start running Windows Update be sure not to install IE8 :)

    Tags: , ,

    Using MySpace REST API with OAuth and C#

    In this example we will make a REST call to MySpace, get back 100 of our friends and display them on a web page. Because we’re accessing personal private information, you need to pass some authorization parameters with your REST call, and MySpace has adapted the OAuth authorization standard. Before I start explaining more about the code, make sure you already have a MySpace account, then follow the next few steps:

    1. Go to: http://developer.myspace.com/ and
    2. Click on Build on the top nav.
    3. Select Create on-site app button, and fill out your app info.
    4. When you get to the section for upload app xml, click on skip this step.
    5. Make a note of your OAuth Consumer Key and OAuth Consumer Secret because you will need it later.
    6. Under the Canvas Surface tab, select External IFrame option.
    7. Then you have to add the app, otherwise you may get 401 access denied error attempting to make a request.

    Okay, hit save and you should be good for now. Let’s open up Visual Studio 2008 and begin!

    1. Create a Website called MySpaceApp or whatever you want.
    2. Copy this file OAuthBase.cs into your project
    3. Add using OAuth namespace at the top of Default.cs
    4. Declare variables for your consumer key, consumer secret and request server:
      1
      2
      3
      4
      5
      
      <code>
      protected string consumerKey = "http://www.myspace.com/123456789";
              protected string consumerSecret = "12abcd345678efghi90jk";
              protected string requestServer = "http://api.myspace.com";
      </code>
    5. Create a public MakeRequest() method returning a DataSet.
      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
      
      <code>
      public DataSet MakeRequest(string restCall)
              {
                  // Form the full REST request url
                  Uri url = new Uri(requestServer + restCall);
                  DataSet ds = new DataSet();
       
                  // Instantiate OAuthBase and declare variables
                  OAuthBase oAuth = new OAuthBase();
                  string nonce = oAuth.GenerateNonce();
                  string timeStamp = oAuth.GenerateTimeStamp();
                  string normUrl = string.Empty;
                  string normParams = string.Empty;
                  string strRequest = string.Empty;
       
                  // Create an OAuth signature
                  string signature = oAuth.GenerateSignature(url,
                      consumerKey, consumerSecret, string.Empty, string.Empty,
                      "GET", timeStamp, nonce, OAuth.OAuthBase.SignatureTypes.HMACSHA1,
                      out normUrl, out normParams);
       
                  // Construct the OAuth authenticated REST url
                  strRequest = normUrl + "?" + normParams + "&" + UrlEncode("oauth_signature") + "=" + UrlEncode(signature);
       
                  return MakeWebRequest(strRequest);
              }
      </code>
    6. Next create a MakeWebRequest() method returning a DataSet
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      
      <code>
      protected DataSet MakeWebRequest(string restCall)
              {
                  // Make web request
                  HttpWebRequest request = WebRequest.Create(restCall) as HttpWebRequest;
                  using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
                  {
                      // In this example we are getting back XML
                      XmlTextReader xReader = new XmlTextReader(response.GetResponseStream());
       
                      DataSet ds = new DataSet();
                      ds.ReadXml(xReader);
                      xReader.Close();
       
                      return ds;
                  }
              }
      </code>
    7. Finally create a GetFriendList() method that will make the REST request and bind it to a Repeater displaying all your friends.

      1
      2
      3
      4
      5
      6
      7
      
      <code>
          protected void GetFriendList()
          {
              rptFriends.DataSource = fb.MakeRequest("/v1/users/YOUR_USER_ID/friends.xml?page_size=100");
              rptFriends.DataBind();
          }
      </code>
    8. I also built this REST Test Tool that uses OAuthBase.cs that will help you create sample REST calls so you can validate the OAuth parameters.

    Tags: , , , ,

    Quick Ajax Example Using jQuery

    About 2 years ago I posted an article called “Quick Ajax Example Using Prototype.js” and some visitors commented that my instructions weren’t clear so I just wanted to post a quick follow up. This is basically the same example using the more efficient jQuery library.

    1. Create a file named ShowTime.aspx that will display the current time when the page is called. Follow steps 1-4 from my old article.
    2. Create a ShowTime.html file with a link click to see updated time without page refresh and a

      to display the updated time when the link is clicked.

    3. Call jQuery library from google between your tags like this
    4. Now add this jQuery script inside the tags after calling jQuery library.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      
      <code>
      $(function(){
      	$("#gettime").click(function(){
      		$("#time").load("http://dev.hostreaction.net/examples/showtime.aspx");
      	});
       
       
      });
      </code>
    5. Check out the demo and view source to get the exact HTML and jQuery.
    6. To briefly explain what’s going on in step 4: everything between the $(function(){ ... }); loads as soon as the DOM is loaded. Then we attach a “click” event to the “gettime” link (notice the # sign corresponding to the link ID attribute, jQuery uses CSS selectors). Inside the “click” event we run the .load function which is an ajax call to “showtime.aspx” and we tell it to display it to

      element.

    Tags: , , ,

    Custom nav links for Performance Point Server 2007 Dashboard

    First let me explain what nav links i’m talking about and how they’re created by Peformance Point 2007 Dashboard Designer. These nav links appear at the top of the default Dashboard and represent the different pages of reports. They are automatically generated by Dashboard Designer by injecting JavaScript into a DIV element called “ppsmaPageOverview”. It starts off by creating a label and container for the dashboard with this function “createPageOverview”. Then the related pages are called with this function “createPageOverviewTab”, these functions also check for a property to see if that tab is selected or not (all this done dynamically with JavaScript). This is not the most elegant method of generation navs, but that’s how Dashboard Designer does it.

    So alot of times I’m asked to modify those links, like the layout, rename links or even add a custom link that can’t be generated by Dashboard Designer. This product is so new that solutions for this tasks aren’t posted yet, which forces me to come up with a solution. I’m not saying my solution is the best, if someone from Microsoft could chime in or email me a better solution then i’d gladly thank them and use it!

    Ok I was asked to add a “Print Report” link to the auto-generated list navigation. My workaround was to create a new “Web Page” from “Report Templates” and in that web page I entered the link to an auto-generated PDF file. That was it, you can of course create a custom aspx page that embeds your PDF or has custom controls on it and link to that in the “Web Page” as well.

    Tags: , , , , ,

    Is The “Enter” key not working for SharePoint search?

    Blame it on those dumb hidden fields:


    Place them between

    and after “PlaceHolderMain”.

    I spent hours trying to figure out the cause of this on Firefox, even tried writing some custom JS but in the end all i needed to do was include these in my master page!

    Trying out wordpress iphone app

    Just testing all features of the wordpress iPhone app. So far it’s a clean interface which males it easy to navigate. I’ll take a pic and see how nicely it integrates. However previewing a post the layout rendering was a little funky. Overall it seems to work well and is a convienent app for posting from the couch.

    Update: the app crashed when trying to take a new photo and attach it. Gonna try again. Funky markup was due to some ads, photo worked second time around but I guess you can’t position the photo. Also be sure to hit DONE to finish up your post and SAVE to publish.

    photo

    Tags: , ,

    Akamai Secure Sreaming Flash Video

    I recently had to work with Akamai Secure Flash Sreaming for on-demand videos and wanted to share some notes on how we got this to work.

    You’ll need 2 zip files from Akamai:

    1. Akamai Flash Media Kit
    2. Akamai Secure Token Generator

    Inside the Akmai Flash Media Kit you will have to open CS3SampleOnDemand.fla in Flash and edit the ActionScript. First declare a constant for the token:

    CONNECTION_AUTH_PARAMS=”THEVALUEFROMYOURFLASHVARS_TOKEN”;

    Then you will pass the autorization token to the Akamai object like this:

    ak.authParams = CONNECTION_AUTH_PARAMS;

    I also have a DLL with using the Type D Authentication from Akamai, please email me if you need it.

    Tags: ,

    SharePoint URL Shortcuts

    Sometimes some projects visually hide the SharePoint navigation links so I wanted to list some here because I can never remember them:

  • Site Content and Structure – sitemanager.aspx
    All Site Content – viewlsts.aspx
    Site Content Type Gallery – mngctype.aspx
    Site Features – ManageFeatures.aspx
  • More to come…

    Tags: ,