Posts Tagged ‘Development’
Friday, December 7th, 2007



This is the first of two posts covering how you can provide Federated Search to web sites that do not support the OpenSearch requirements of Search Server 2008.

Part 1. How to federate to a site that does not support a url based search?

This one is simple,  just make use of a search provider that does and use it as an intermediary to your required source.  In this example I will use Live.com to provide federated search to my web site www.21apps.com.

Step 1.  Export the Live.com FLD

MSSX comes with a FLD for Live.com out of the box,  we are going to use this as the basis for our FLD file.   From the Federated Locations page select Export from the Live.com item and save the file to your local drive.

Export FLD

Step 2.  Edit the FLD file to change the Internal name

Open the FLD file in notepad or other XML editor and change the Internal Name from Live to the domain you are federating to, in my case 21apps.com.  You could also make the other changes directly in the XML.

Edit FLD

Step 3. Upload the FLD and Edit the Location setting

From the Federated Locations page choose Import Location and select the file you edited in step 2.  After uploading click Edit Locations and change the following fields

Field Value
Display Name <your domain> i.e. 21apps.comEdit Display Name
Query Template Expand the Location Information section and change the Query Template
 
http://search.live.com/results.aspx?q={searchTerms}&format=rss&count={itemsPerPage}&first={startItem}&FORM=SHAREF

tohttp://search.live.com/results.aspx?q=site%3Awww.21apps.com+{searchTerms}&format=rss&count={itemsPerPage}&first={startItem}&FORM=SHAREF

where www.21apps.com is your domain

“More Results” Link Template Make a similar change to the More Results Link Templatehttp://search.live.com/results.aspx?q={searchTerms}&first=
{startItem}&FORM=SHAREM

to

http://search.live.com/results.aspx?q=site%3Awww.21apps.com+{searchTerms}&first={startItem}&FORM=SHAREM

 

 

Edit links

Click OK and the new Location should be listed and available to use.

Step 4.  Test it!

Navigate to your Search Centre and search for something to take you to the Results page.

Edit the page and select your new Location.

Set FLD

And that’s it,  Federated Search to www.21apps.com.   :)

21apps.com federated

In part 2 I will look at Federated search to a well known search engine that does not return it’s results in a nice friendly XML format.

Tuesday, June 19th, 2007



I posted recently on how Soapbox was reporting my uploaded videos as “Copyright Violation”.   Well someone was listening or they have improved things as it’s now available for all to enjoy,  if you didn’t watch the YouTube one that is :) or want to view with more clarity (Soapbox beats YouTube on this front hands down.


Video: InfoPath form in a WebPart

Saturday, June 16th, 2007



This demo shows how to enable the InfoPath Form Viewer WebPart and configure it to show your InfoPath forms.

This is the second part of my presentation at the SharePoint User Group UK meeting in Telford.

The presentation covers

  • Adding InfoPath form view as a safe control
  • Enabling the web part in the site collection gallery
  • Adding the web part
  • Useful tip when it errors with a ‘Form Closed’ display
  • Setting the web part properties, and an easy way to find the information

The safe control information referred to in the presentation.

<!– Info Path Demo –>
<SafeControl Assembly=”Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” Namespace=”Microsoft.Office.InfoPath.Server.Controls” TypeName=”XmlFormView” Safe=”True”/>

Monday, May 28th, 2007



Many of you WSS V2 developers will have come across the “1#;Some text” value that lookup fields return. Some of you will have added code to you own utility classes to parse them to give the ID and Field values. In WSS V3 it gets much easier out of the box with the introduction of the SPFieldLookupValue object which will provide the LookupId and LookupValue fields for you.

SPListItem task = SPContext.Current.ListItem;
SPFieldLookupValue lookup = new SPFieldLookupValue((string)task["FIELD NAME"]);
int id = lookup.LookupId;
string value = lookup.LookupValue;

This class SPFieldUserValue is also provided making it easy to get to the User information from User fields liked Created or Modified.

Saturday, May 26th, 2007



It is always good to read little tips and tricks that help make things easier. Today I read two

Configuring IntelliSense with CAML Files When Developing for Windows SharePoint Services 3.0 – by Ted Pattison on MSDN, IntelliSense is so cool!

When developing for Windows SharePoint Services 3.0, you are often required
to create and modify XML files that contain Collaborative Application Markup
Language (CAML). It is recommended that you configure Microsoft Visual Studio on
your development workstation to reference a XML schema file named WSS.XSD so
that IntelliSense works properly when working with CAML-based files.

and Spencer Harbar posted about the new SnagIt addin for Visual Studio Team Edition

Use this new SnagIt output to quickly create images to describe and show
tasks, bugs or design ideas. It’s a quick way to add screenshots to bug reports
with the click of a button. And, it eliminates the hassle of attaching an
image.
http://www.techsmith.com/community/blogcomments.asp?thread=356

Saturday, April 14th, 2007



Spender Harber posted a recent article “Test Driven” SharePoint Development

…a first stab at providing some guidance for those looking to implement SDL approaches to SharePoint, and a call to action for the developer community to adopt “Test Driven” SharePoint development.

I’m in, anyone else?

Tuesday, April 10th, 2007



I am really excited to be working with some recent but very deserving Microsoft MVPs in the form of Ishai Sagi and Liam Cleary on the SharePoint Nested Tasks project.

Ishai has confirmed that Lawrence Liu has asked that the solution is merged with the SharePoint Community Kit, which will help to spread the good work being planned.

This will also be the first project I have worked on with true round the clock coding oppotunities with Ishai in Australia, Liam and I in the UK and others around the globe (sorry project just starting so haven’t had chance to talk to the other team members yet). Hope to meet up with Liam in person as he is presenting at the SUGUK meeting tomorrow night in Manchester.

Sunday, December 10th, 2006



..continued from part 3

Section 9 Playtime – Page 139

The last task is to add a link to each item and remove it from the cart. It is suggested that you do this in a non-Ajax way first and then add the Ajax and the example on http://wiki.pragprog.com/cgi-bin/wiki.cgi/PT-D-4 covers this in detail however I found the following problems.

Not working in JavaScript disabled browser

<td>

<%= link_to_remote “remove”, :url => { :action => :remove_from_cart , :id => cart_item.product} %>

</td>

This line renders the link as an onclick event which will not work if javascript is disabled. This may be a bug in my version of Ruby on Rails where the href=”#” should render the link if javascript is disabled.

<a href=”#” onclick=”new Ajax.Request(’/store/remove_from_cart/2′, {asynchronous:true, evalScripts:true}); return false;”>remove</a>

To resolve this issue I replaced this with

<% form_remote_tag :url => {:action => :remove_from_cart, :id => cart_item.product } do %>

    <%= submit_tag “remove” %>

<% end %>

This produces a form similar to the ones used for the Index.rhtml

If using JavaScript the redirect_to_index will not work, this is because the form_remote_tag (or link_remote_tag) enable XHR request which will not force a redirect of the main browser. This should be written as form_tag (or link_tag) to work without Ajax and updated to use remote once the remove_from_cart.rjs has been created. Generally you will tend to write this in the finished format now that you know how the remote calls work.

 

Friday, December 8th, 2006




continued in part 4…

.. continued from part 2

Iteration D3: Highlight Changes

This error had me stumped for a while, although it did force me to read through and really understand how the code was working. Something I have found a little difficult in Ruby is the debugging. Coming from a .Net background we have been spoilt with the debugging capabilities of Visual Studio, sometimes to the determent of knowing what is actually going on.

The error occurs when added a new product to the Cart. You get two dialog boxes the first gives “RJS Error: [Object Error]” followed by “Element.update(”cart”, …” this error showed the correctly rendered HTML that was inserted into the cart after clicking ok.

The “Highlight” effect was also missing from the cart item. Reason the <tr> tag for the cart item did not have the id <tr id=”current_item”> However the logic here look sound as the highlight did work for adding additional items of existing products. The problem must therefore be in the Cart.rb file which handles the add_product method.

The line @items << CartItem.new(product) should read @items << current_item = CartItem.new(product)

This assigns the newly created cart item to the current_item variable which is in turn added to the cart items.

Friday, December 1st, 2006



First Impression

Wow! That was easy!

After doing the normal Google -> Review -> Google some more process I was left with a long list of things to look at and also some other examples of people who have been down the same path. All of the development was completed on Windows XP SP2 (except the deployment to Linux which was running under VMWare).

  1. Install Instant Rails – This will get you up and running in no time, you don’t need to know anything about Rails or Ruby at this pointOne thing that you will notice if moving from the .net world is that you don’t need to compile it
  2. Read the Instant and follow the short tutorials, this is in the help\index.html directory where you installed Instant Rails
    1. Tutorial 1 – OnLamp.com
    2. Tutorial 1 – OnLamp.com
  3. Consider an Editor – I used RadRails but I’m still looking for something more…
  4. Watch the Screencasts to get a feel for what you should could do and how quickly (once you know Ruby)At this point you may want to purchase a Mac so that you can use the cool TextMate. I have already requested a Mac Book Pro as my next Laptop J
  5. Copy the code, but hand craft it to complete the Putting Flickr on Rails screencast
    This will help you find your way around the environment, debug the application (you will get an Invalid Key error, tip ‘look at the Flickr gem code initialization’)
  6. Purchase the book Agile Web Development with Rails, the second edition is out and fully up to date with version 1.2 of Instant Rails. The book details how to get the vendor version if it is not released yet. This is a really easy book to read, very well written and really does make a difference.
  7. If you enjoy reading and want something a little off the wall you could try Why’s (Poignant) Guide to Ruby, I have found this funny, but difficult to get into – but the Foxes did get the Chunky Bacon into the samples (you need to read it for that one J)
  8. Update Use source control – Subversion will do the trick
  9.  

Subscribe to some feeds Planet Ruby On Rails, Loud Thinking – David Heinemeier Hansson

Going forward I’m looking at improving my html development, I need to stop using tables!, I need to improve my JavaScript (http://script.aculo.us/ ) and I am looking at Unbuntu, MySQL, SQLLite, Lighttpd, Mongrel to name but a few.

Exciting times!