Wednesday, June 23, 2010

Question for readers

I want to hear from you, leave a comment answering this question:

How do you envision GIS being used with SharePoint?

Thanks

Thursday, June 10, 2010

Spatial Web Parts with Silverlight in SharePoint 2010

In SharePoint 2010 (SP2010) you can create a silverlight web part pretty easy by just creating a custom control, then deploy the XAP file to the clientbin folder.  I should note that the pre-canned silverlight web part that I am using does not allow for DCOM bridges to be used, so to communicate between multiple silverlight web parts you would have to the Messaging API, which is quite easy, but that's for another day.

Getting Started, Open Visual Studios 2010, and create an empty SharePoint Project and a Silverlight Application.  For the Silverlight Application project ensure that the "Host the Silverlight Application in the new Web Site" is unchecked.

Now we are cooking with fire, and we can create our Silverlight application.  For this example, I will just add a map and one layer to the project. 
The next step is to place the XAP file in a location that can be used by SharePoint.  Right click on the Silverlight Application we just created and select Properties.  Click on the build tab and change the output path to: "..\..\..\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin\".  Remove the quotes when you put this into the Output Path.

Save and compile the project.  If you get any errors, it's most likely you need to reference the proper ESRI silverlight libaries.
The next step is to configure the SharePoint Project. Add a new item to the SharePoint project and select Module. Double click on the Elements.xml file.

Configure the elements file to match the above image, you need to change the path of the Url to "_layouts/clientsbin/ XAPFILENAME.XAP" and change the Path from the textfile name to the XAP file name.

Click on the module and select the Project Output Refer -> Add a member -> Choose the Silverlight Application name -> in the Deployment Type Select ElementFile -> press OK
Select Build From main toolbar -> Configuration Manager -> Uncheck all the builds except for the SharePoint Project Name and make sure the SharePoint Project has deploy checked.

Save the Project and deploy to SharePoint. 

Open your SharePoint site -> Edit Page -> Add Silverlight Web Part -> enter in the text box the following "_layouts/clientbin/XAPFILENAME.XAP".  You should now see your web part.

Tuesday, May 11, 2010

Serialization With Silverlight

Say you want to serialize an object using silverlight, well you can't use the binaryformater() like in windows forms development, so what to do.  Silverlight has a the DataContractSerializer class which "Serializes and deserializes an instance of a type into an XML stream or document using a supplied data contract."  So this means that you are passing XML string data.

From the windows help: "Use the DataContractSerializer class to serialize and deserialize instances of a type into an XML stream or document. For example, you can create a type named Person with properties that contain essential data, such as a name and address. You can then create and manipulate an instance of the Person class and write all of its property values in an XML document for later retrieval, or in an XML stream for immediate transport."


Here is my code:
Enjoy

Getting Started with Geoprocessing and ArcObjects in .NET

Not a programmer and don't know where to start?
Here is a great "how to get started" article for from ArcUser magazine.

Enjoy

Thursday, April 29, 2010

The Joys of Installs

Today I decided to roll up my sleeves and install SharePoint 2010 beta.
First I decided that I wanted to use Windows 7 64-bit, which was a mistake. All the documents point to the fact that you can do an install on win7-64bit, but you can't. You need to alter the config.xml file.

So I alter everything, and now the setup likes it, yippee, and get the 300 prerequisites installed. (See: http://blogs.msdn.com/opal/archive/2009/10/25/sharepoint-2010-pre-requisites-download-links.aspx for pre-reqs) Now I'm ready to install SP 2010 and configure it. Oh wait, I'm not... error after error, and most of the answers are found here, www.google.com because Microsoft's help is crap.

Getting sick of the errors, and a glutton for punishment, I decided to format my HD and install Windows 2008, which is the desired OS for sharepoint.

Installation was long, but it went like a breeze, and I did have one funny moment when this appeared:

Take a close look, it says the file should be less than 1 mb, but it was well over 6 mb and growing. Thanks Microsoft.

Now on to installing Silverlight and the MapIt Demo.

Tuesday, April 27, 2010

Google Charts

Google charts is a great/free resource for doing charting.  Many organizations have restrictions on what software you can install, but with google charts no software is needed, just an internet connection.  See this link.  


Here is a simple example:
To get this image, all you have to do is reference this url: http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World


You can simply couple this with python using the webbrowser library. To open the image in a web browser via python try this:


import webbrowser
url = http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World
webbrowser.open(url)

Thursday, April 15, 2010

Don't Buy This


This is the worst children's toy ever. I hate cubicles because they prevent creativity. I would never buy my child this.

Here is more information.