ACS Blogs

A blog site for Architecting Connected Systems staff to tell the world about their exploits in
SharePoint 2007/2010, Windows Workflow Foundation (3.0/4.0) and other great technologies!
Welcome to ACS Blogs Sign in | Join | Help
in Search

CJG

  • Updating List Item Metadata Column Value

    Not easy, no way...but just like some of my fellow SharePoint experts, we persist and conquor! Metadata Service is awesome, just basic SOA pattern in yet another different implementation.  Nothing special, but working with a specific implementation brings interesting challenges...as always.  So how do you update a list item's column value when its a metadata column?  Some assumptions first:

    1. You have setup a Metadata Service Application and Proxy 
    2. You have setup a TermStore with a Group called "All Sites"
    3. You have two termsets defined with values ("Department" and "ITRequestType")
    4. You have a site associated to the metadata service
    5. You have a list called "UserRequest" with two meta data columns pointing to your termsets
    NOTE:  A precaution, in order for a metadata term to have a WSSID, it must have been used and a listitem added to the "TaxonomyHiddenList" list.  It is hidden, so you can't see, and you can't update it to be "unhidden" as it seems there is an eventhandler on it to keep you from doing so!  I dumped the list fields out, but it might be tricky to figure out how to add a listitem to the list.  Something to be done later :)

    Here's the code:

    $site = new-object Microsoft.SharePoint.SPSite("http://intranet.contoso.com/sites/it")
    $web = $site.rootweb
    $list = $web.Lists["UserRequests"]
    $department_field = $list.fields["Department"]
    $itrequesttype_field = $list.fields["RequestType"]

    $session = new-object Microsoft.SharePoint.Taxonomy.TaxonomySession($site);
    $termstore = $session.TermStores[0]
    $group = $termstore.groups["all sites"]
    $departmenttermset = $group.termsets["department"]
    $requesttypetermset = $group.termsets["itrequesttype"]

    $term = $departmenttermset.terms["it"]
    $t_it = new-object Microsoft.sharepoint.taxonomy.taxonomyfieldvalue($department_field)
    $t_it.wssid = [Microsoft.sharepoint.taxonomy.taxonomyfield]::getwssidsofterm($site,$termstore.id,$departmenttermset.id, $term.id,$false,1)[0]
    $t_it.TermGuid = $term.id
    $t_it.label = $term.name

    $newitem = $list.items.Add()
    $newitem["Title"] = "A new item";
    $newitem.update()
    $newitem = $list.items.getitembyid($newitem.id)

    $newitem["Department"] = $t_it
    $newitem.update()

    Refresh the list on the site, you should see the label show up for the metadata column!  Sweet!

    Enjoy this one, I'm proud of it!
    Chris

  • SharePoint 2010 Generic Solution Validator

    I have posted the Generic Solution Validator to codeplex.

    http://bit.ly/4V8Yv7

    Chris

  • SharePoint Timer Jobs

    Have I mentioned how much I don't like Timer Jobs?  Let me rephrase that, timer jobs that other people write that aren't designed correctly?  Yeah, irks me.  So we can't say that all the Timer Jobs in the Beta are perfect, some have some issues, but its beta and we should come to expect not everything is going to work right now. 

    For those that really cause us trouble though, how do we debug them?  We can attach to the owstimer.exe service I suppose, but then you are causing more problems with the other jobs waiting to get some of the precious CPU cycles while your debugging.

    So how about we try a different approach?  I like using SQL Profiler, it is one of my favorite tools. It comes in really handy to figure out what really is going on on a SharePoint page (the Developer Dashboard is nice, but don't let it fool you, there is more going on than what it tells you) and...Timer Jobs.  problem is, sql profiler requires you to get really specific about what you want to see.  Not much you can do when everything coming in is tagged as a ".NET Application"...except for...turn everything OFF!

    Turn off all the services, turn off all the timer jobs you don't want to look at or care about.  Turning off services is easy enough to do...timer jobs...ugg...little more difficult.  What about searching for a timer job?  Yeah, good luck with that one with just Out of the Box.

    So I built a neat little tool and posted it to codeplex.  It lets you turn all the timer jobs off, now two of them cannot be turned off, but they don't end up causing much traffic, so no worries there.  With this tool you can search for timer jobs by Name, Title, ID, Schedule and Lock Type.  You can update, updateable properties and click "Update".  You can disable, enable and "Run Now" with just a click of a button!

    Sweet!  Download the source code here:  http://bit.ly/4ydtNr

    I plan on doing some heavy reverse engineering on some of these bad boys...I encourage you to do the same!

    Chris

  • SharePoint Remote Blog Storage (RBS) - Step by Step Install

    I just setup RBS/RBS Filestream on my 2010 farm.  Not so sure about the functionality being pushed to the SQL Server team for this.  I really liked the COM based approach of EBS in 2007 (which is now marked as obsolete, but supposedly still supported - and when I say 'supported' I simply mean it still works - going forward in 2010), but hey, when you don't have budget/time, send it off to someone else that does right?  These steps will get your RBS FILESTREAM sql provider working sorry no screen shots, you only get those in the courses.

    So why RBS? What is it you ask?  It stands for Remote Blog Storage.  We'll, lets start with the fact that when you add a document to SharePoint goes into the content database (the binary is serialized into a stream and put into the database, but not really put into the database, but a pointer in sql server row to a set of 8k pages somewhere on disk that represents those files).  All documents go into the content database with out discrimination.  Should there be discrimination?  Yep.  Some people would migrate file shares to sharepoint which would include install isos, some being in the gigabyte size.  These days we can safely say that SQL Server it is a high volume transactional store and yes, it has the ability to store blobs, just not as efficiently as some applications would like.  Because of this, IT depts would say "No" don't put that large file in sharepoint. 

    Well of course that leads to confusion as to what goes in and out of SharePoint (the fileshare lived another day in 2007).  In 2007, the SharePoint team introduced EBS which was a COM component based implementation of passing off the BLOB to something else to manage.  RBS is the continuing evolution of this with SQL Server becoming the management point.  Now IT Depts can say, sure throw that into SharePoint!  No confustion, SharePoint is now the hub of everything!  IT Depts can set the size at which RBS kicks in and sends the file somewhere else.  If the RBS becomes obsolete there are ways to migrate back into SharePoint or change the RbsID to migrate to a new store (you will see the new RbsId column in the content database).  Writing an EBS or RBS implementation is NOT easy.  I did an EBS for 2007, and I'll be the first and not last to tell you, the COM interactions, memory management, and file manager components require some thought and patience.  That being said, you will be at the mercy of Microsoft and 3rd parties to create scalable robust EBS/RBS implementations for your sharepoint system.

    After publishing this, we had a nice twitter conversation about StoragePoint. It has some awesome RBS connectors!  You should check them out!

    The detailed TechNet version of RBS install process is here.  Mine is a more condensed version of the basic steps.

    If you like this, be sure to follow me on twitter! More to come!

    Exercise 1 – Setup RBS FILESTREAM

    Purpose:         Setting up RBS FILESTREAM is fairly simple.  In this lab we will configure RBS in SQL Server and then RBS Client for Sharepoint 2010

    Result:           
    A content database that uses RBS FILESTREAM

    Task 1 – Enable FILESTREAM on SQL Server

    1. Open SQL Server Configuration Manager
    2. Click “Sql Server Services”
    3. Right click “SQL Server (MSSQLServer)”, select “Properties”
    4. Click the “FILESTREAM” tab
    5. Check all the checkboxes

    1. Click “Apply”
    2. Open SQL Server Management Studio
    3. Connect to the localhost server
    4. Right click the instance, select “Properties”
    5. Click the “Advanced” tab
    6. For the “Filestream Access Level, select “Full access enabled”
    7. Click “OK”
    8. Restart the SQL Server service

    Task 2 – Prep the databases

    1. Open a query window, run the following sql command:


    use [WSS_Content_100]

    if not exists (select * from sys.symmetric_keys where name = N'##MS_DatabaseMasterKey##')create master key encryption by password = N'Pa$$w0rd'

     

    1. Run the following:


    if not exists (select groupname from sysfilegroups where groupname=N'RBSFilestreamProvider')alter database [WSS_Content_100]

     add filegroup RBSFilestreamProvider contains filestream

     

    1. Run the following:


    alter database [WSS_Content_100] add file (name = RBSFilestreamFile, filename = 'c:\Blobstore') to filegroup RBSFilestreamProvider

     

    1. Expand “Databases”
    2. Right click “Databases”, select “New Database”
    3. For the name type, “RemoteBlobStorage”
    4. Click “Ok”

    Task 3 – Install the RBS Client

    1. Run d:\lab work\RBS_x64.msi
      • NOTE: This task is to walk you through the GUI of the install program to see the various items that you COULD configure, later you will see that this is not necessary as we will re-run in a silent mode for SharePoint - product team has also suggested that you NOT run this step as it may add extra settings that could cause problems later!)

    1. Click “Next”

    1. Click “I accept the terms…”
    2. Click “Next”
    3. Click “Next”

    1. Click “Next”

    1. Click “Test Connection”
    2. Click “Next”

    1. Click “Next”
    2. Check the “Show the advanced configuration options” checkbox

    1. Click “Next”
    2. Review the settings:

    1. Click “Next”
    2. Review the properties of the “Maintainer Task”, this is used to clean up orphaned records that may not exist in SharePoint anymore (a user deleted the file in the document library).  Check all the checkboxes:

    1. Click “Next”
    2. For this lab, set all the logging setting to “Verbose”:

    1. Click “Next”
    2. Click “Install” - AGAIN NOTE - this is for FYI only, you should click "Cancel" if doing this for real
    3. Click “OK” in the task window

    Task 3 – Configure SharePoint 2010

    1. Open a SharePoint Management Console
    2. Run the following commands from the location of the RBS_X64.msi file (this would need to be run against each content database that you want to support RBS):


    msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content_100" DBINSTANCE="servername" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1

     

    msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi DBNAME="WSS_Content_100" DBINSTANCE="servername" ADDLOCAL="Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer"

     

    1. Open the rbs_install_Log.txt file, at the end of the file, look for:
      • Product: SQL Remote Blob Storage -- Configuration completed successfully.
    2. You can also check the content database and look for some new tables "mssql*"
    3. Run the following (note this only works if the web app has one content database):


    $cdb = Get-SPContentDatabase –WebApplication  http://servername:100

    $rbss = $cdb.RemoteBlobStorageSettings

    $rbss.Installed()

    $rbss.Enable()

    $rbss.SetActiveProviderName($rbss.GetProviderNames()[0])

    $rbss

     


    Task 4 – Test your RBS Provider

    1. On the SQL Server, open the “c:\BlobStore” folder, this is where your blobs will go by default
    2. Open the team site (http://servername:100)
    3. Add a new document called “MyRBSFile” to your document library (make sure it is above 100K as you can set the file size boundary in RBS to move between content db and RBS connectors)
    4. Refresh the c:\BlobStore folder, you should see a new file in one of the directories
    5. Run the following query against your Content database (NOTE: run this against your dev enviornment ONLY so as to not cause any locks on your prod databases):


    select ad.SiteId, ad.id, leafname, rbsid

      from alldocs ad, alldocstreams ads

      where ad.id = ads.id

      and rbsid is not null

     

     

     

    1. You should get a query back with information on all files that have been submitted to the RBS. 

    Enjoy!
    Chris

  • SharePoint Federated Results

    Here are some simple steps to get Federated search results to work in SharePoint 2010.  Its actually really simple, Kudos to the search team.  Note that this sets up a new Bing federated result, there is already one in there, but this walks you through setting up from scratch.

    Enjoy!
    Chris

    Exercise 1 – Setup Federation

    Purpose:         Learn to pull in outside search results (federation) from Bing.

    Result:           
    Federated search results

    Task 1 – Configure your Search Application

    1. Open SharePoint Central Administration
    2. Click “Application Management”
    3. Click “Manage service applications”
    4. Click “My Search Application”
    5. Click “Federated Locations”
    6. Click “New Location”

    1. For location name, type “Bing”
    2. For display name, type “Bing”
    3. For description type, federated results from Bing Search provider”
    4. For author, type “Microsoft”
    5. For version type “1.0.0.0”
    6. Leave the Trigger as “Always”
      • NOTE your options, prefix and pattern can be applied to the search keywords in deciding to send a query to the federated provider
    7. For location type, click “OpenSearch 1.0/1.1”
    8. For the query template, type http://www.bing.com/search?q={searchTerms}&format=rss
    9. Note your ability to modify the formatting of the results returned from the provider
    10. Note your ability to restrict the federated results at a site collection level
    11. Note your ability to set credentials for the federated provider
    12. Click “OK’

    Task 2 – Set your Search Application

    1. Open Central Administration
    2. Click “Application Management”
    3. Click “Configure service application associations”
    4. Click “Default”
    5. Check “My Search Application”
    6. Click “Set as default”
    7. Click “OK”

    Task 2 – Test your new federation provider

    1. Open your search center (http://servername:115)
    2. Run a search for “SharePoint”, you should get no federated results
    3. Click “Site settings->Edit Page”
    4. Find the “Top federated results” web part
    5. Click “Edit web part”

    1. Select “Bing”
    2. Click “OK”
    3. Run a search for “SharePoint”, you should get back a single federated result (the top one):

    1. Click “Site Actions->Edit Page”
      • NOTE: you may have to click back to the home page, run a search and then click “Site Actions->Edit Page”, there seems to be an issue with resending the same query in Beta
    2. Edit the Top Federated Results web part, expend “Display Properties”
    3. In “Results Per Page”, set it to 3
    4. Click “Ok”, rerun your search, you should now see the top 3 results:

  • SharePoint 2010 Management Shell

    By default the SharePoint 2010 management Shell runs as 32bit.  If you want the 64bit version you must resort to firing it from the "C:\Windows\SysWOW64\WindowsPowerShell\v1.0" directory and adding the Microsoft.SharePoint dlls:

    [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint')

    This causes issues when you try to load up 64bit COM components and other x64 dlls

    Fun fun...
    Chris

  • Solution Validators - Sandboxed Solutions

    So you read my last post and decided that maybe SandBoxed Solutions isn't that great of an idea.  You decided to implement a Solution Validator to limit what your ole developers are doing.

    You got the validator created and you installed it, but then realized, its not quite right.  So, you undeploy it right?  Oh, wait, every object that goes in the Object hierarchy table has to have a "public" contructor for deserialization (ie, pulled out of the ConfigDB and turned into memory). Otherwise you get a nice error in Visual Studio and/or Central Admin and you won't be able to retract the solution.

    Exception in RefreshCache. Exception message : "MySolutionValidator.MySolutionValidator cannot be deserialized because it does not have a public default constructor."

    K, if you followed the little article up there, then you'll notice that particular piece is missing!  Now your stuck...how do you get it out?  Well, you gotta run a command against the config database: NOTE:  This is a highly dangerous operation, if you mess it up, your Farm gets deleted!

    delete from Objects
    where properties like '%MySolutionValidator%' --or to be more safe, the full assembly name

    You could also run the following stsadm command provided you do the query to find the id in the Config database:

    select id, properties from Objects
    where properties like '%MySolutionValidator%'

    STSADM -o deleteconfigurationobject -id “id retrieved from object table”

    This will clear the object and the retract will succeed.  This will be the case for ANYTHING that goes into the object hierarchy table.

    Chris

     

  • Missing Server Side Dependencies - 8d6034c4-a416-e535-281a-6b714894e1aa

    So what is this you ask?  Well, I did a little digging, I watched the Timer Job and the query it sent ( to the content database of the central admin site):

    SELECT tp_WebPartTypeId, COUNT(1), tp_Assembly, tp_Class
    FROM AllWebParts (NOLOCK)
    WHERE tp_WebPartTypeId IS NOT NULL GROUP BY tp_WebPartTypeId, tp_Assembly, tp_Class

    You get back a result set that has a null for the tp_Assembly column for the web part. What is this web part you ask, well it is the Microsoft.Office.Server.Search.WebControls.SearchTopologyView web part in the Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c assembly.

    If you do a query to see where these 6 instance are:

    select *
    from AllWebParts
    where tp_WebPartTypeId = '8D6034C4-A416-E535-281A-6B714894E1AA'

    You will see that the web part exists on two pages:

    • SearchAdministration.aspx
    • SearchFarmDashboard.aspx

    Open those pages, notice...It DOES exist!

    Now, here is the funny thing - rerun the queries.  As soon as you open those pages, the databsae gets updated and the error will go away.  Weird!!!

    Enjoy!
    Chris

  • SharePoint 2010 User Profile Properties (SubType) - Error

    When creating a custom User Profile Property, be sure to check the "Default User Profile Subtype" checkbox.  If you don't you won't see the property on the manage properties page and won't be able to get to it through the UI.

    However, I figured a way to get to it...just paste in the browser (to get your appid just click on another property to edit, then change the name query string):

    http://sharepoint2010:20974/_layouts/EditProperty.aspx?Name=[PROPRETYNAME]&IsSection=False&ProfileType=&ApplicationID=31948422%2D08be%2D4c84%2D8e9c%2D40d3bb10970f

    And you will be able to get to it and check the checkbox

    Another issue, when you click the "Add new mapping", if you don't select anything, it will add the "Select Attribute" to your mappings, this is obviously wrong and will not  make your ForeFront Sync happy.

    Also note that after adding a  new property, your log will get several "Sync" errors for each site collection saying you don't have that property in the site!

    Enjoy!
    Chris

  • SharePoint 2010 BDC Error

    Sooo, I have this lovely app def file, that uploads perfectly.  But when I go to use one of the entities in a list column, I get this interesting issue (notice that I don't get columns, but the first named TypeDescriptor):

     

    Fair enough, I'll remove the wrapper from around my return columns from the query. This USE to work in 2007 by the way:

    <TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="ProductDataRecord">
    <TypeDescriptors>
    ....Column descriptors....
    </TypeDescriptors>
    </TypeDescriptor>

    Re-upload, and whalla...it works like it did in 2007!

     

    But, on adding an item with item resolution, you get this lovely error:

    The root TypeDescriptor with Name 'Reader' belonging to Method with Name 'Find_Customers', of Entity with Name 'Customers' and Namespace 'Northwind' has a TypeName that is not assignable to System.Data.IDataReader or is not a Collection TypeDescriptor, which is necessary when using LobSystems of Type Database.

    Fair enough, sooo, I go and change it in the app def file:

    <TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="Reader">

    And on upload, you get this lovely error:

    ReturnTypeDescriptor of MethodInstance with Name 'Find_Customers_Instance' on Entity (External Content Type) with Name 'Customers' in Namespace 'Northwind' should not be a Collection TypeDescriptor for MethodInstances of Type 'SpecificFinder'

    Oh yeah baby...a catch 22 loop!!!  Anyone? Bueller?  Bueller?

    It just keeps getting better doesn't it???
    Chris

     

  • Microsoft Forefront Protection 2010 for SharePoint Beta 2

    Not alot of people actually installed antivirus software on their SharePoint 2007 environments.  The unfortunate thing is, only Microsoft had something that would actually plug in (as far as I know anyway and I did a lot of research).  The only solution has been ForeFront security (NOTE: this is NOT the same thing as ForeFront Identity).  If you are on SharePoint 2007, you should know that they released SP3 of ForeFront security a few months ago, I just now found out which really shows you how important it is in the community (ie, not very).  You should download and install the new SP3!

    One piece of software that you should start out testing and considering for your 2010 environment is the Microsoft Forefront Protection 2010 for SharePoint Beta 2.  It is also available for download from here.

    Chris

  • SharePoint 2010 web.config file changes

    I took a look at the new SharePoint 2010 web.config file, and here are the changes I have found so far:

    New sections include:

    • 3 new SharePoint sections:
    • WorkflowServices - new SharePoint based section
    • OutputCacheProfiles - basic asp.net section
    • ObjectCache - basic asp.net section
    • New Workflow section
    • authorizedRuleTypes

    New sections groups:

    • "system.web.extensions" - this drives the AJAX funtionality
    • "microsoft.sharepoint.client" - this drives the WCF client proxies for service applications
    • "ReportingServices" - for Reporting service integration
    • "Bpm" - Performance Point section

     Safe controls added:

    • Too many to list here, but all are newer 14.0.0.0 assemblies for SharePoint 14

     A flurry of merge actions (for understanding a merge action check this other blog entry)

     For IIS 6.0 system.web section:

    • No HttpHandlers are configured.
    • CustomErrors is Off
    • No HttpModules are configued

    Several new assemblies are complied:

    • System.Web.Extensions
    • Microsoft.Web.CommandUI
    • Microsoft.SharePoint.Search
    • Microsoft.Office.Access.Server.UI
    • Microsoft.SharePoint.Publishing

     New ExpressionBuilder added:

    • SatelliteResources

     New Build Provider added:

    • ".json"  

    Controls section added by default now:

    • "asp" of System.Web.UI

     Default siteMap provider is now called "CurrentNavigation" (use to be CurrentNavSiteMapProvider).  Includes new providers:

    • ExtendedSearchXmlContentMapProvider
    • GlobalNavigation
    • CurrentNavigation
    • MySiteSubNavProvider

    Removed the:

    • UsagePagesSiteMapProvider

    New WebPart Transformers:

    • TransformableBIDataProviderToFilterValuesTransformer
    • TransformableBIDataProviderToWebPartParametersTransformer
    • TransformableBIDataProviderTransformer
    • TransformableFilterValuesToEntityInstancesTransformer

    New Mobile Controls Section:

    • SPMobileHtmlDeviceAdapters
    • SPMobileChtmlDeviceAdapters
    • SPMobileXhtmlDeviceAdapters

    SessionState is removed from the IIS 6.0 system.web section

    FULL IIS 7.0 "system.webServer" section has been added

    • Modules removed
      • OutputCache
      • FormsAuthenciation
      • UrlAuthorization
      • WindowsAuthentication
      • RoleManager
      • Session 
    • Handlers removed
      • SPHttpHandler!!! - everything is done via the modules!

    System.Workflow.ComponentModel.WorkflowCompiler

    • In SP2010, you cannot use a "While", "ConditionedActivityGroup" or a "Replicator" activity in SharePoint web applications.  They have set "Authorized" to "False"!!! - WHY?
    • Rather than all types in mscorlib, they have explicitly set it so you can only use
      • Guid
      • DateTime
      • Boolean
      • Double
      • String
      • Hashtable
      • ArrayList
      • DebuggableAttribute
      • ComplationRelaxationAttribute
      • RuntimeCompatibilityAttribute
      • Int32
      • TimeSpan
      • Generic Collections
    • New authorized types
      • SPItemKey
      • SPWorkflowUserContext
    • New assemblies
      • Microsoft.Office.Access.Server.Application
      • Microsoft.Office.Workflow.Actions

    Four new location settings with a timeout of 3600ms:

    • _layouts/UploadEx.aspx
    • _layouts/ctdmsettings.aspx
    • _layouts/policyconfig.aspx
    • _layouts/metanavsettings.asxp
    Two new location settings with webServices protocol clear:
    • _vti_bin/EwaInternalWebService.json
    • _vti_bin/DynamicGridContent.json

    New location settings random:

    • _layouts/pptInsertPicture.aspx
    • _vti_bin/powerpointBroadcastHost.asmx
    • _vti_bin/powerpointBroadcastHost_1_0.asmx - what the heck is this for I wonder?
    • _vti_bin/present.asmx

    Two new appSettings keys - why the hell these are here and not a config section is beyond me!

    • PptServer_Pipe
    • PptServer_BroadcastManager
    Follow me on twitter!
  • SharePointDevWiki.com - Jeremy Thake

    I hearby delcare that Jeremy Thake at SharePointDevWiki.com has full permission to use any content on ArchitectingConnectedSystems.com with full permissions to reproduce the content displayed here!

    Enjoy Jeremy!
    CJG

    Follow me on twitter!

  • SharePoint 2010 REST-like Services - Getting them to work!

    Given that it is only beta, I still have to give SharePoint 2010 some leaway yet, until RTM comes out, who knows if
    these things will be the same or not. 

    Anyone that has programmed Facebook API, knows they have one of the most intense and best documented REST-ful
    service layers on the planet!  I have many applications that use their API and the OpenID login IP-STS.  If you were to
    look at Facebook and their implementation, you would know it is the BEST way to implement REST services.  I give them
    full credit for the revolution that has started!

    Given that, let's look at SharePoint 2010 and its REST-like services.  Here's my issues:

    1. Performance sucks
      1. Implementation should have been with HttpHandler vs "Accept" header in the HTTP request with the requested
        format you want returned.  This adds 23 bytes to every request, oh and wait, it gets better, for some reason you
        need a "if-match" header too, another 15 bytes.  Facebook simply does this in the request URL listdata.atom or
        listdata.xml - wow, how easy is that?
      2. My favorite tweet about this REST Implementation: "Oh my god, they killed REST, you bastards!"
    2. Documentation so far is poor
      1. Take for instance the "POST" for adding a new item, the documentation is wrong, it says to do this:

    POST /_vti_bin/ListData.svc/Employees HTTP/1.1
    Accept: application/atom+xml
    Content-Type: application/atom+xml
    Host: www.contoso.com
    Content-Length: ###
    Expect: 100-continue
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
    xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
    xmlns="http://www.w3.org/2005/Atom">
    <category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" term="Microsoft.SharePoint.Linq.EmployeesItem" />
    <title />
    <author>
    <name />
    </author>
    <updated>2009-04-30T02:15:21.1353156Z</updated>
    <id />
    <link href="http://www.contoso.com/_vti_bin/ListData.svc/Projects(2)"
    rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Projects"
    type="application/atom+xml;type=feed" />
    <link href="http://www.contoso.com/_vti_bin/ListData.svc/Projects(3)"
    rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Projects"
    type="application/atom+xml;type=feed" />
    <content type="application/xml">
    <m:properties>
    <d:Created m:type="Edm.DateTime" m:null="true" />
    <d:FullName>James Earl Jones</d:FullName>
    <d:HireDate m:type="Edm.DateTime">1987-04-29T19:15:14.7861156-07:00</d:HireDate>
    <d:ID m:type="Edm.Int32">0</d:ID>
    <d:Modified m:type="Edm.DateTime" m:null="true" />
    <d:Path m:null="true" />
    <d:Salary m:type="Edm.Double">195000</d:Salary>
    <d:Version m:null="true" />
    <d:Owshiddenversion m:type="Edm.Int32" m:null="true" />
    </m:properties>
    </content>
    </entry>

    The error is in the "category" element, you are not using "Linq", you should be using "DataService".

    Changing the term attribute will fix your issues:

    <category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
    term="Microsoft.SharePoint.Linq.EmployeesItem" />

    TO:

    <category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
    term="Microsoft.SharePoint.DataService.EmployeesItem" />

    You should also wrap your WebRequest calls in an try/catch handling a WebException.
    You can then interrogate the ResponseStream and see what error you are actually getting back and
    fix any other issues you might run into!

    As always, Enjoy!
    Chris

    Follow me on twitter!

  • FAST Search for SharePoint - Step by Step Install

    By popular demand, here is the FAST Search step by step install steps!  If you like it, add me to twitter http://twitter.com/givenscj

    Enjoy!
    Chris

    Task 1 – Setup FAST Search Center         

    1. Open SharePoint Central Administration
    2. Click “Application Management”
    3. Click “Create Site Collection”
    4. Select the web application called “SharePoint –115”
    5. For site name, type “FAST Search”
    6. For url, type FAST
    7. For template, select “Enterprise->FAST Search Center”
    8. For site collection admin, type “Administrator”
    9. Click “Create”

    Task 2 – Install FAST Search

    1. Run the following command to extract the files (beta installer doesn’t work quite right)
      • D:\Lab Work\<labno>\ en_fast_search_server_sharepoint_2010_beta_x64_x16-29476 /extract:c:\temp
    2. Run “C:\temp\PrerequistieInstaller”
    3. The splash screen will open:

    1. Click “Next”
    2. The prereqs for FAST Search will be installed

    1. Click “Finish”
    2. Run “fsserver”
      • This will create a new directory called “C:\FASTSearch”
    3. Click “Start”, right click “Computer”, select “Properties”
    4. Click “Advanced System Settings”
    5. Click “Environment Variables”
    6. Add the following to your path variable
      • “C:\FASTSearch\installer\scripts”
    7. Run the SharePoint 2010 Management Shell
    8. Run the following:
      • Psconfig.ps1 –action i –roleName single –userName contoso\administrator –localMachineName <FQDNservername> -databaseConnectionString <dbservername> –databaseName FASTSearch
    9. Enter the password, “Pa$$w0rd”
    10. For self signed password, type “Pa$$w0rd”
    11. Reboot the computer
    12. Run the following command:
      • ConfigureSharePointAuthorization –installedMode Advanced

    Task 3 – Start Services

    1. Open the services applet, ensure the following are started:
      • All “FAST*”
      • Forefront*
      • SharePoint Server Search 14
      • SharePoint Foundation Search V4

    Task 4 – Setup FAST Search Query Service

    1. Open SharePoint Central Administration
    2. Click “Application Management”
    3. Click “Manage service applications”
    4. Click “New->Search Service”
    5. For name, type “FAST Search Query”
    6. For the type, select “FAST Search Query”
    7. For the application pool for admin server, type “FASTSearchAdminPool”
    8. For the application pool for search query and site settings”, type “FASTSearchQueryPool”
    9. For Query Service Location, type “https://sharepoint2010.contoso.corp:13286”
    10. For Administration Service Location, type “net.tcp://sharepoint2010.contoso.corp:13256”
    11. For Resource Store Location, type “http://sharepoint2010.contoso.corp:13255”
      • NOTE: these port numbers are in the “C:\FASTSearch\Install_Info.txt” file – minus the actual protocol data unfortunately
    12. For account, type “contoso\administrator”
    13. Click “Ok”
    14. Click “Application Management”
    15. Click “Manage service applications”
    16. Click “New->Search Service”
    17. For name, type “FAST Search Connector”
    18. For type, select “FAST Search Connector”
    19. For application pool, type “FASTConnectorPool”
    20. For content distributor, type “sp2010.contoso.com:13329”
    21. For the content collection, type “sp”
      • NOTE:  the content collection “sp” is the default one created by the install and configuration steps
    22. Click “OK”

    Task 5 – Setup Certificate

    1. Open a SharePoint 2010 Management Console
    2. Run the following commands (be sure to replace the two bolded items with your server and application name): 
    $currentdir = pwd
    $sharepointSTSCertFilename = Join-Path -Path $currentdir -ChildPath 'MOSS_STS.cer'
    $fastsearchqrserver = 'fs14qrserver.mydomain.com'
    $fastSSAName = 'FASTSearchServiceApplication'
     
    $stsCert = (Get-SPSecurityTokenService).LocalLoginProvider.SigningCertificate
    $stsCert.Export("cert") | Set-Content -encoding byte $sharepointSTSCertFilename
     
    $queryServiceLocationValue = "http://" + $fastsearchqrserver + ":13287"
    Set-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $fastSSAName -Identity "FASTSearchQueryServiceLocation" -Value $queryServiceLocationValue
    Set-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $fastSSAName -Identity "FASTSearchQueryServiceWinAuth" -Value false
    Get-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $fastSSAName
    IISReset

    Open a FAST Search Management Console
    1. Run the following commands (be sure to replace the path to the certificate):
    $sharepointSTSCertFilename = 'FULLPATH_TO_MOSS_STS.cer'
     
    # Import SharePoint Security Token Service Certificate
    $trustedPeopleCertStore = new-object System.Security.Cryptography.X509Certificates.X509Store('TrustedPeople', [System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine)
    $trustedPeopleCertStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
    $sharepointSTSCert = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
    $sharepointSTSCert.Import($sharepointSTSCertFilename)
    $trustedPeopleCertStore.Add($sharepointSTSCert)
    $trustedPeopleCertStore.Close()
     
    # Configure FAST Search Server to trust SharePoint Security Token Service certificate
    Set-FASTSearchQRProxyMOSSConfiguration -STSThumbprint $sharepointSTSCert.Thumbprint -RestartServices true

    1. Open the C:\FASTSearch\bin\QRProxyService.exe.config
    2. Uncomment the following line that starts with:

    <!--<binding name="HTTP_CLAIMS_INSECURE">...

    1. Enable HTTPS searching by running the following commands
    #HTTPs - EXPORT CERT

    $currentdir = pwd
    $sharepointSTSCertFilename = Join-Path -Path $currentdir -ChildPath 'MOSS_STS.cer'
    $fastsearchqrserver = 'sharepoint2010.contoso.corp'
    $fastSSAName = 'FAST Search Query'
    $sharepointServicesCertFilename = Join-Path -Path $currentdir -ChildPath 'MOSS_SERVICES.pfx'
    $sharepointServicesCertPassphrase = $host.ui.PromptForCredential("Need Credentials", "Please enter a passphrase for the SharePoint Services Cert", "CERT_PASSPHRASE", "")
    $tempStringValue = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($sharepointServicesCertPassphrase.Password)
    $plainTextPassPhrase = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($tempStringValue)
    $stsCert = (Get-SPSecurityTokenService).LocalLoginProvider.SigningCertificate
    $stsCert.Export("cert") | Set-Content -encoding byte $sharepointSTSCertFilename
    $sharePointCertStore = new-object System.Security.Cryptography.X509Certificates.X509Store('SharePoint', [System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine)
    $sharePointCertStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadOnly)
    $servicesCert = $sharePointCertStore.Certificates.Find([System.Security.Cryptography.X509Certificates.X509FindType]::FindBySubjectName,'SharePoint Services', $false)
    $servicesCert.Export("pfx", $plainTextPassPhrase) | Set-Content -encoding byte $sharepointServicesCertFilename
    $servicesCert2 = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
    $servicesCert2.Import($sharepointServicesCertFilename, $plainTextPassPhrase, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::DefaultKeySet)
    $trustedPeopleCertStore = new-object System.Security.Cryptography.X509Certificates.X509Store('TrustedPeople', [System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine)
    $trustedPeopleCertStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
    $trustedPeopleCertStore.Add($servicesCert2)
    $trustedPeopleCertStore.Close()
     
    $queryServiceLocationValue = "https://" + $fastsearchqrserver + ":13286"
    Set-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $fastSSAName -Identity "FASTSearchQueryServiceLocation" -Value $queryServiceLocationValue
    Set-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $fastSSAName -Identity "FASTSearchQueryServiceWinAuth" -Value false
    Get-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $fastSSAName
    IISReset

    #HTTPS - IMPORT CERT

    $sharepointSTSCertFilename = 'c:\users\administrator\MOSS_STS.cer'
    $sharepointServicesCertFilename = 'c:\users\administrator\MOSS_SERVICES.pfx'
    $sharepointServicesCertPassphrase = $host.ui.PromptForCredential("Need Credentials", "Please enter the passphrase for the SharePoint Services Cert", "CERT_PASSPHRASE", "")
    $tempStringValue = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($sharepointServicesCertPassphrase.Password)
    $plainTextPassPhrase = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($tempStringValue)

    # Import SharePoint Security Token Service Certificate
    Add-PSSnapin Microsoft.FASTSearch.Powershell
    $trustedPeopleCertStore = new-object System.Security.Cryptography.X509Certificates.X509Store('TrustedPeople', [System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine)
    $trustedPeopleCertStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
    $sharepointSTSCert = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
    $sharepointSTSCert.Import($sharepointSTSCertFilename)
    $trustedPeopleCertStore.Add($sharepointSTSCert)

    # Import SharePoint Security Token Service Certificate
    $trustedPeopleCertStore = new-object System.Security.Cryptography.X509Certificates.X509Store('TrustedPeople', [System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine)
    $trustedPeopleCertStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
    $sharepointSTSCert = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
    $sharepointSTSCert.Import($sharepointSTSCertFilename)
    $trustedPeopleCertStore.Add($sharepointSTSCert)
    $trustedPeopleCertStore.Close()
     
    # Import SharePoint Services Certificate
    $sharepointServicesCert = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
    $sharepointServicesCert.Import($sharepointServicesCertFilename, $plainTextPassPhrase, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::DefaultKeySet)
    $personalCertStore = new-object System.Security.Cryptography.X509Certificates.X509Store('My', [System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine)
    $personalCertStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
    $personalCertStore.Add($sharepointServicesCert)
    $personalCertStore.Close()
    $rootCertStore = new-object System.Security.Cryptography.X509Certificates.X509Store('Root', [System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine)
    $rootCertStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
    $rootCertStore.Add($sharepointServicesCert)
    $rootCertStore.Close()
     
    # Configure FAST Search to trust SharePoint Security Token Service Certificate
    Set-FASTSearchQRProxyMOSSConfiguration -STSThumbprint $sharepointSTSCert.Thumbprint -RestartServices true
    $sharepointServicesCertThumbprint = $sharepointServicesCert.Thumbprint
    netsh http add sslcert ipport=0.0.0.0:13286 certhash=$sharepointServicesCertThumbprint 'appid={a5455c78-6489-4e13-b395-47fbdee0e7e6}'

    Task 6 – Re-index content

    1. Open SharePoint Central Administration
    2. Click “Application Management”
    3. Click “Manage service applications”
    4. Click “FAST Connector”
    5. Click “Content Sources”
    6. Click “New Content Source”
    7. For name, “SharePoint Sites”
    8. For start address, type http://servername:100
    9. Check the “Start full crawl of this content source”
    10. Click “OK”
    11. Wait for the crawl to finish

     Task 7 – Test FAST Search

    1. Open the http://servername:115 site
    2. Type in and run a query

     

More Posts Next page »
Powered by Community Server, by Telligent Systems