Showing posts with label sharepoint. Show all posts
Showing posts with label sharepoint. Show all posts

Sunday, August 14, 2011

Book Review: Microsoft SharePoint 2010 Enterprise Applications on Windows Phone 7

One of the most important developer space's on the Microsoft stack is the still emerging LOB app space for phone 7. This particular book is focused on SharePoint 2010 applications on Phone 7 which is an increasingly important sector of the increasingly important Phone 7 developer segment... yes I know a bit repetitive but still...

The thing in this book that really made it for me a "must have" for LOB wp7 folks is the fact that it separates the basic's skills need on each related platform (wp7 and sharepoint) and then includes the cross over elements of working with both platforms as well. Although narrowly focused this as I pointed out an increasingly important segment that this book is targeted towards and as an LOB developer sometimes myself its an important part of my collection.

The downside of this book would be the lack of depth for phone 7 and sharepoint specific information but that really is beyond the scope of the premise of the book so I can't fault that on the book but that also means that to make the most of this particular book you should probably look into something on sharepoint and another book on windows phone7.

remore about the book here: packtpub book site

Check out the book on Amazon at: http://www.amazon.com/Microsoft-SharePoint-Enterprise-Applications-Windows/dp/1849682585/

Tuesday, September 7, 2010

Silverlight 4 and SharePoint 2010 Integration

My first response to this is just say no. But, my personal biases against sharepoint aside, alot of people need to work with Sharepoint including myself in the past so with some trepidation I agreed to review the book 'Microsoft Silverlight 4 and SharePoint 2010 Integration' by Gaston Hillar. I don't know if I know Gaston personally but the fact I don't recall means if I have meet him and one of a zillion conferences it we never touched base outside of that. One thing I have noticed with packt books is that there seems to be less talking and more samples which is a good thing as far as I'm concerned and this book is no different. The chapters are broken out in detail covering related topics from just creating a web part in sharepoint (which if you have never done it before is a pain and having it well documented in a book is great) to WCF, RIA, Rich Media and all the points in between. The book isn't thick and short on words but as mentioned lots of examples which is what is important to me. I know many years ago when I learned classic ASP the book was lots of reading and I found over the years that it is more important to have samples you can follow along and a book that can be used as a reference with which this book has fallen into the catagory of books I'll keep just in case I have todo any sharepoint work again (which I'm less then fond of). I know I know some people like the google or even the bing but its nice to have it in print and for us old timers it is sooo much easier to read in print. In any case if you must do sharepoint, user Silverlight and build something hot but use this book to help get it in Sharepoint fast and spend more time doing something else :)

http://www.packtpub.com/microsoft-silverlight-4-and-sharepoint-2010-integration/book?utm_source=hackingsilverlight.blogspot.com&utm_medium=bookrev&utm_content=blog&utm_campaign=mdb_004103

Wednesday, March 5, 2008

Silverlight MIX Announcement(s)

In the keynote today Scott G annouced SL 2. is publicly available. very cool. my favorite part whas how much they showed our Entertainment Tonight work in Silverlight. among my favorite features annouced include (I will skip all the new bits Scott put out on his blog last week):

* support for Silverlight on MAC, Windows, Linux and Mobile devices
* improved preformance especially dynamic adaptive streaming and bit rate throttling, including IIS features to support to provide bit rate throttling.
* Silverlight Add templates in visual studio
* Burning Silverlight right into video using ecoder 2
* Multi-language including Silverlight in Python
* Rich WPF UI framework (layout, databinding, skinning and styling system)
* Robust networking (post, SOAP, WCF, sockets etc.)
* LINQ and Databinding
* Local Store and cache between browser sessions
* Controls include: data grids, list box, sliders, radios, buttons calender and date picker controls, checkboxs etc.
* all controls are being shipped with open source license.
* test framework for silveright.
* control templating stucture including the abilty to change animations, and restructure the visual tree
* full intellisense and design experience in VS
* DeepZoom.... formerly Silverdragon formerly SeaDragon taking smut to the next level allowing arbitrary zooming to any resolution smoothly.
* Silverlight Sharepoint bits to make it easier to put silverlight web parts in sharepoint

SeaDragon (DeepZoom) really is cool with the 2billion pixel size images... :)

Friday, October 26, 2007

ASP.NET Server Controls in VS 2008 and .NET 3.5 and Sharepoint

Today is going to be a bit of a rant. Background on the issue is that in VS 2005 I have written server controls for ASP.NET and Web Parts for Share Point. Typically for building Share Point web parts I like to developement them as server controls to so I have this nice easy structure to work with until I have something that does basically what I want. The trick with a server control is basically basic C# stuff. First you make a class and inherit from your base control and then you overwrite a method and add some declaritive stuff and then you can use it on your page by using a register in the ASPX. Then you can use your tag to create an instance of your control. Also this can then be put into its own dll and added to VS's toolbar and you can pass the dll around to friends etc and everyone can have this cool dll. Now to turn the control into a web part basically you change the base class, add a few using statements and change the output method name, make sure its all in a dll and your good. So far so good right?
For a server control, the class basically looks like this:

[ToolboxData("<{0}:SomeName id=\"\" runat=\"server\" />")]
public class SomeName: System.Web.UI.WebControls.WebControl
{ protected override void Render(HtmlTextWriter writer)
{
writer.Write(PresentHTML()); // some method we make...
}
}


We also add a few bindable properties like id or width or title or something that might look like this:


private string _Id = string.Empty;


[Bindable(true), Category("Appearance"), DefaultValue("")]

public string id
{
get
{ return _Id;
}
set
{ _Id = value;
}
}


Again straight forward stuff. right? We also might add other functionality of course and we have it in a name space but this is the key bits above. Now to turn this into a 'WebPart' we make it look something like this:

[DefaultProperty("Text"),
ToolboxData("<{0}:MyWebPart runat=server>"), XmlRoot(Namespace = "MyWebPart")]
public class MyWebPart : WebPart
{
private string _Id = string.Empty;
[Bindable(true), Category("Appearance"), DefaultValue("")]

public string id
{
get
{ return _Id;
}
set
{ _Id = value;
}
}

protected override void RenderWebPart(HtmlTextWriter writer)
{
writer.Write(PresentHTML()); // our private method that does the real work...
}
}
not a big change and again pretty straight forward. I dont' show all the properties and methods like the one reference to 'PresentHTML' which is just a private method that returns a string. This is the basic stuff needed for sharepoint. The one other thing is to make sure you have the using statements that reference all our Sharepoint bits:


using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.WebPartPages;
using Microsoft.SharePoint.WebControls;


and of course the sharepoint dll that your building to needs to be referenced. So to use the server control version you have to create a Register tag in your ASP.NET that looks like this:


<%@ Register TagPrefix="prefix" Namespace="ControlNameSpace" %>


then in the ASPX page we can add the tag for our control to test it without all the jumping around you need todo with Share Point. In this case it might look like this:



This is 'All Good' in VS 2005 but the other day (earlier this morning) I had to make it work in VS 2008 for embededing a webpart 'Silverlight' control into Sharepoint. So I got to the test page of the silverlight project and do basically the above and make a web part that writes out all my Silverlight stuff (actually it was Devin's Silverlight app). This way we care wire up bits that the web part needs to pass into the Silverlight class todo its thing for when it actually has to live in Sharepoint. I would have thought this easy enough...


So I add the class and set it up as a server control. I add the references, and the register for the tag prefix and namespace reference and then add a tag to the control that should create the silverlight app. I compile it and try to run it and it blows up entirely. After fighting with this for some time it turns out that you need to have an 'Assembly' reference in the register tag in VS 2008/.NET 3.5 for a server control to be able to run in ASP.NET 3.5. So then it looks something more like this:


<%@ Register TagPrefix="prefix" Namespace="ServiceNamespace" Assembly="SilverlightApp" %>


The part that bothered me is that if the class is in the same assembly as the rest of the site and we call out the name space and class specifically it should be able to find the default assembly since its run in that assembly... but alas I was wrong. Not that, that is a surprise but it always seems to surprise me when I am. :)

Silverlight 1.1 As A Sharepoint Web Part

Recently I did a project where I had to embed a Silverlight web part into sharepoint. You would think this is easy if you haven't done web parts before. At least thats what I thought. Granted I have done web parts but it always surprises how much jumping around I had todo. I found what worked best for me was to create the 1.1 project as a silverlight based server control in a web site that ran all the bits and then to install that in the same domain as the sharepoint server. At first I tried to make the web part duplicate what the server control did but for some reason Sharepoint would make it render is such a way that the silverlight ended up hidden... I tried a few things but decided to use an iframe. This way the web part only outputs a iframe pointed at the controls default page that loads the silverlight interface. Works like a charm too. :) That sounds good but the steps ended up being something like this:

Silverlight Site Configuration

1. Copy the Silverlight Website folder to Server Location.
2. Open IIS Manager (Start-> All Programs -> Administrative Tools -> Internet Information Services (IIS) Manager)
3. Open Server Node (local Computer)
4. Open ‘Web Sites’ node.
5. Open Default running web site node
6. Right Click web site node and select New -> Virtual Directory
7. When the Virtual Directory Creation Wizard comes up click next
8. Enter the correct Alias ‘[some name]’
9. Click ‘Next’
10. Click ‘Browse’ and find the physical location of the site directory by drilling down in the ‘Browse For Folder’ and then select ‘OK’
11. Click ‘Next’
12. Select ‘Run Scripts’ check box
13. Click ‘Next’
14. Click ‘Finish’

Web Part Configuration

1. Make sure the wep part project is compiled.
2. Copy the project to the Sharepoint server.
3. Copy the WebPart.dll to the bin directory under the wwwroot.
4. From the VS command prompt navigate to the bin directory under wwwroot.
5. gacutil the dll which should look something like this: gacutil –i WebPart.dll
6. from this same location in the VS command prompt use the command: sn –T WebPart.dll to find the strong name key. For example: 7dd6db7c5d0189b7
7. Find the Sharepoint Web.config by opening up the IIS Manager and selecting the core site and then right click on the web.config and file the file location.
8. Add a ‘safecontrol’ node to the safecontrols section like this:
Assembly="WebPart, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=7dd6db7c2d0088b7"
Namespace="[some name space]"
TypeName="*"
Safe="True"
/>

9. Make sure the dwp file has a valid public token.
10. Go to the Sharepoint home page.
11. Click Site Actions and select ‘Show Page Editing Toolbar’
12. Click Page button in the toolbar.
13. Select ‘Add Web Parts’ -> Import
14. Click Browse and find the dwp file in the project.
15. Click ‘Upload’
16. Select ‘Add to: Top Zone’
17. Click ‘Import’
18. Close the import right hand bar
19. Select publish from the toolbar

So I'm not saying this is the right method or the best way todo it but it worked for me in my case... abit of a hack but well its Sharepoint :)