Thursday 28 July 2011

Remote Builds using PS

Enable Powershell Remoting
=====================
Login to each server that needs to run PS scripts, this will allow centralised deployment of PS Scripts.

Friday 22 July 2011

Working with QR Server in FS4SP

Overview:  The Query Results Server is an IIS website that allows you to check that FAST search is working.  You can see if managed properties are being populated, navigators are working ect...
Tips:
  • To use QR-Server you must be on the local machine use the url: http://localhost:13280/
  • SP2010 uses a users session for security so using QR-Server won't work (always returns empty results) so you need to turn off security as follows:
1.> Turn off security in the config file C:\FASTSearch\etc\qrserver\qtf-config.xml (take a copy before modifying the file);
2.> Comment out the line element instance-ref name="securityfql" critical="1"
3.> PS C:\FASTSearch\bin> .\nctrl.exe restart qrserver
This will make the QR-Server take the xml config security change.
4.> Perform your query

Thanks to Job Maelene for all his FS4SP patience.


More Info:
leonardocsouza has a great series on FS4SP

Thursday 21 July 2011

Managed Properties in FAST

Problem: Create mapped managed properties in FAST (FS4SP) using PoweShell.
Initial Hypothesis:  You can create Managed Properties that are mapped to crawled properties using the UI thru CA.  However, for deployment thru environments it is better to script the mapped managed properties creation using Powershell.
Instructions:
1.> I created a Document Library that has extra columns for: Section, Appointment, Clinic & Hospital number as shown below.
2.> Ensure you have performed a "Full Crawl" on the Content SSA (FS4SP has 2 SSA in order for it to work, the content/index and the query SSA).
3.> PS to retriev the crawled property names, they will be at the bottom of the txt file created and are prefixed with "ows_".
4.> Find the crawled property name, this will be used in the next PS script that associates the crawled property with the managed property.  Open c:\cp.txt to see the crawled property name, this is usually at the bottom of the file.
5.> Use PS to 1) create a new managed property, 2) map the appropraite crawled property onto the managed property.
6.> Run the Full Crawl again thereby propulating the Managed Properties
7.> Check the managed properties in Central Admin (CA)
8.> Perform a search to ensure the managed property works i.e. clinic:CL123

Office Web Apps on a DC

Problem: Office Web Apps on a developer machine which has it's own domain controller.  Can view word documents in the browser, editing of docx files stangely works.

http://technet.microsoft.com/en-us/library/ff431687.aspx

FAST previews/thumbails need Office Web Apps running.

Summary: Install Office Web Apps pre AutoSPInstalller is run.  Then activate in the autospinstaller.  Otherwise install the office web apps but only do the config of the web apps, don't run the SP config wizard.

Tuesday 12 July 2011

Adding FAST for SharePoint to PowerGUI

Problem: Add FAST for SharePoint 2010 intellisense support in PowerGUI.
Resolution: Open PowerGUI and add the FAST for SharePoint library.

Monday 11 July 2011

VS2010 Strongly Name key issue

Problem: Visual Studio 2010 using TFS2010 on multiple developer machines keeps erroring on all developers VM's after they get the latest code "cannot import the following key file" and mentions the sn key.

Resolution: On the projects properties > Signing > Click the drop down for "Choose a strong name key file:" Click the option, click "Cancel" button.  You are prompted with a dialog "enter password to enter file", add the keys password and select OK.  VS will stop erroring after you have done this once.

More Info: http://stackoverflow.com/questions/2815366/cannot-import-the-following-keyfile-blah-pfx-the-keyfile-may-be-password-protec

Building a WCF Web Service for InfoPath data

Problem: Create a WFC web Service to store an InfoPathForm

Initial Hypothesis:  Project consists of 3 parts: 1)SQL Server table for storing form data, 2)WCF web service for exposting the storage web service method and 3) consuming the Web Service using infoPath.

1) SQL Script to create the datbase table.  Once the table is available for storage we need to build the WCF web Service.
2) WCF web service:
2.1) Add the LINQ to SQL proxy (dbml file) to persist the data
2.2) Assign
2.3) Wire up the WCF WS
Edit as needed (apply business logic)
2.4) Expose the WCF thru an IIS website on your Dev machine (Create an IIS web site to host the WCF):
2.5) Publish the WCF using VS2010 as shown below to the local machine
Ensure the WCF service is available using the browser.

3) Consuming the WCF WS in InfoPath forms



How to Add a Service Reference?


1.> Ensure the WCF exists i.e. http://wcf-service/FormService.svc

2.> Generate the WCF proxy (VS > Right click the WFE project > Add Service Reference > Insert the url and save the WS reference)

3.> Copy the contents of the app.config bindings & endpoints elements into the web.config (this needs to be automated in the deployment script thru a configurable feature) Web.config is shown below:

4.> Call the WCF web Service (consumer)
WCFBanner.BannerClient ws = new WCFBanner.BannerClient();
WCFBanner.PatientBanner pb = ws.GetPatientBannerByPatientId("G3");
lit1.Text = "PatientId: " + pb.PatientId;
ws.Close();

Additional Info:
Comparing SharePoint InfoPath lists vs forms