Archive for November, 2008

Thunderbird and gmail: an alternative Outlook

Friday, November 28th, 2008

I recently purchased a new notebook.  And as always I vowed to try and rid myself of the evil that is Microsoft! This time around I downloaded Go-OO (based on Open Office) to replace Office – so far so good. Next in line was an Outlook alternative. I initially installed Thunderbird. My situation involved multiple e-mail accounts from Yahoo and gmail to various POP accounts that I have somehow managed to accumulate over the years. I wanted a solution where I could have one point of access to all of them without having to go online if I didn’t have to.  So I set up all my accounts on Thunderbird and was happy for a few days…

Zimbra?

Doing a bit of web investigation I came upon Zimbra mail client(?), recently bought by Yahoo. Having a Yahoo e-mail account, I decided to investigate Zimbra as an alternative to Outlook.  Initially I got exited, I could add my other POP account to retrieve mail, while I could use my Yahoo mail as an on/off line synchronised mailbox.

It only took me 3 days to bin it!  I was horrified at the application overhead, averaging over 100Mb of RAM for the java based application plus another 30 odd Mb for the Zimbra serive!  What the hell? Another down side was that the Yahoo mail support is almost, but no quite, IMAP.  You can synchronise online folders offline.  So I happily started creating folders and sub folders via the Zimbra desktop app only to realize later that these folders were exclusively local. OK I thought, so ‘ll create them online.  Yes you can, BUT you cannot create sub folders and you cannot edit these folders from the desktop.  OK that was it I had enough.

Thunderbird & gmail

Luckily I haven’t uninstalled Thunderbird by this time yet!  I then went odd to my gmail account online and discovered that it now supports IMAP! Very interesting, seems I’ve been out of the gmail loop a while! Another interesting thing I noticed was that you can set up your gmail account to fetch mail from other email accounts. Nice! Also by using Thunderbird I could set-up my gmail as an IMAP account Thus my mail always lives online, but is avalable locally on my computer and can be accessed from anywhere in the world via the web and IMAP (which I have on my Windows Mobile 6 phone), sweet!

So my current solution looks like this:

  • gmail set-up to retrieve all my POP e-mails (you can configure up to 5 POP accounts to be fetched)
  • my Yahoo account forwards all mails to my gmail account (depending on your account this may or may not be possible – alternatively you can set it up as a POP account)
  • I have set up folders on my gmail via Thunderbird (to manage all my stored mail more organised than the Google one-size-fits-all method)
  • I my gmail IMAP account on my Windows Mobile 6 HTC Touch phone – what a pleasure!

Calendar?

I hear you ask.  Currently I syncronise my HTC’s WM6 calendar with my office’s corporate Exchange.  Then I have GooSync running on my phone to synchronise all my appointments to my Google calendar and back.  I have installed the Thunderbird 2-way google calendar synchronisation plugin.  Now everything is in sync via Google Calendars.  “Toight, thoight loike a toiger!”

Again so far so good – get away from me you evil Outlook!

Notes on Integrating SQL Server Reporting Services with MOSS 2007

Friday, November 28th, 2008

If you need to configure SSRS with MOSS 2007 you may find this post very helpful. Another nice walk through can be found here. I have had to set up RS on MOSS on my own without any prior knowledge (or help) and this helped me a lot.  I will not go through the entire process, but I will highlight some issues I had with the integration:

1. Remember to install the latest service packs for SSRS and MOSS

2. Remember to install the SSRS add-in for SharePoint if you don’t see the Reporting Services section in the Application Management section of the SP Central Administration pages then this is your first stop:

3. Run the Reporting Services Configuration Manager and make sure you have no red crosses.

4. Make sure you Default Web Site is still running – SharePoint usually uses port 80, rendering the default web site inactive.  To resolve this, change the port to something like 8080 and start it again.

Some Tips

Check if your RS site is up:

When changing the default web site port it means that RS’s location also changes.  Always check if you can still access reporting services by viewing the following address in IE:

http://localhost:8080/ReportServer

(replace localhost with your host’s name and replace 8080 with the port you set your default website to)

You should see a listing of the local websites:

If you see that things are looking up!

Check the rsconfigreportserver.config file:

(default location is C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer)

Make sure the RS URL includes the port number (if you have changed the port for the default website):

rdreportserver.config

rdreportserver.config

(rs2005 should be your host’s name and 8080 should be your default web site port)

This setting should be updated by the installation/integration, but is not always.

Specify the Report Server correctly in the SharePoint Configuration

This one kept me going in circles and second-guessing myself for a few hours.  I kept getting the dreaded error:

Server was unable to process request. —> The request failed with HTTP status 404: Not Found.

I got this when trying the Set Server Defaults under Reporting Services (Application Management).  I also got it when I tried to deploy a custom report from VS BI Studio.  My mistake? I forgot to add /ReportServer to my server name in the Manage Integration settings.  This is what is should look like:

(again replace rs2005 above with your host server name and 8080 with your default web site port)

So instead of the setting above I only entered the server and port! Missed that one completely!

Cannot find this file specified in the manifest file

Tuesday, November 25th, 2008

Quick tip for Visual Studio SharePoint developers.  When you remove a web part from your project and you try to deploy it again you will get this error.  To solve it, simply edit the manifest.xml file in the \pkg folder in your project folder and remove the reference to the item that has been removed:

Remove the item from the manifest.xml

Remove the item from the manifest.xml and save.

Now the project should deploy as it should.

Creating a Web Part with Custom Properties VB.NET

Tuesday, November 25th, 2008

For the VB programmers out there I thought I’d show the VB.NET syntax for creating a SharePoint web part custom property referencing when building a custom web part.  Below is also a link to a detailed article on custom SharePoint web part properties if you require more details.

Declaring A  Custom Property

The following is an example of declaring a custom property for a SharePoint web part that will show up in the web part’s property pages. The declaration should be in your web part class.  Also remomber to add “Imports System.ComponentModel” to your imports section:

 <WebBrowsable(True), _
         Personalizable(True), _
         Category("Custom"), _
         DisplayName("Link base URL"), _
         WebDisplayName("Base link URL"), _
         Description("Specify the URL to redirect to.")> _
         Public Property theURL() As String
            Get
                Return url
            End Get
            Set(ByVal value As String)
                url = value
            End Set
        End Property

The property will display as follows (when the web part is edited):

Custom Property

Custom Property

The property can now be referenced in your code as per usual.

A more detailed walk through in C# can be found on Liam Clearly’s blog.

Simple Generic SharePoint Connected Web Part

Tuesday, November 25th, 2008

There are many ways and complexities around developing connected web parts.  Most times you just need a simple generic connected web part.  With my project I was under a lot of time constraints and when I had to develop a connected web part, most articles and examples I found went into too much detail.  Not that it is a bad thing, but I just had to get it done.  So here is my quick simple connected web part.

The long and the short of it is that your web part needs to interface to other web parts.  This interface is basically the link between the web parts: as in when you select Connections from the Edit menu on the web part:

Web Part Connections

Web Part Connections

In order enable a connected web part (apart from actually creating a web part in Visual Studio – which I will not go into here) you need two steps:

  1. Create an interface class to be used by your web part
  2. Use the interface class in your web part to get the linked value

Step 1: Creating the interface class

Here is a simple interface class, note that it inherits from ConsumerConnectionPoint. Ensure you have a reference “Imports System.Reflection”. Also replace YourWebPart below with the name of you web part class:

''' <summary>
''' This class provides a generic connection to any other web part field.
''' </summary>
Public Class FieldConsumerConnectionPoint
Inherits ConsumerConnectionPoint
Public Sub New(ByVal callbackMethod As MethodInfo, _
ByVal interfaceType As Type, ByVal controlType As Type, _
ByVal name As String, ByVal id As String, _
ByVal allowsMultipleConnections As Boolean)
MyBase.New(callbackMethod, interfaceType, controlType, _
name, id, allowsMultipleConnections)
End Sub
Public Overrides Function GetEnabled(ByVal control As Control) _
As Boolean
Return CType(control, YourWebPart).ConnectionPointEnabled
End Function
End Class

Step 2: Implement the interface class the web part

In the the example code below my connection was focussed on retrieving a numeric value. I have grouped the interfacing code into a region so I can easily reuse it in other web parts.  The function GetConnectionValue returns -1 if the web part is not connected, or the value from the connected web part.  Here’s the interface region:

#Region "Web Part Connection Interface"
''' <summary>
''' Returns the ID of the current connection.
''' </summary>
''' <remarks>Returns -1 if the web part is not connected.</remarks>
''' <returns>Integer</returns>
Function GetConnectionValue() As Integer
Dim returnID As Integer = 0

 'check if there is a valid connection:
If _provider Is Nothing Then Return -1 

 'check connection & get field value:
If Not (_provider Is Nothing) Then
_provider.GetFieldValue(New FieldCallback(AddressOf GetFieldValue))
End If

 'get the the value of the connected field:
Dim prop As PropertyDescriptor = _provider.Schema
If Not (prop Is Nothing) AndAlso Not (_fieldValue Is Nothing) Then
Try
returnID = CInt(CStr(_fieldValue))
Catch ex As Exception
End Try
End If

 Return returnID
End Function

 ''' <summary>
''' The connection provider.
''' </summary>
''' <remarks>is set to nothing when no connection exits.</remarks>
Private _provider As IWebPartField

 ''' <summary> ''' The value of the connected field.
''' </summary>
''' <remarks>Returns nothing when no connection exists.</remarks>
Private _fieldValue As Object

 ''' <summary>
''' Retrieves the field value from the connected web part.
''' </summary>
Private Sub GetFieldValue(ByVal fieldValue As Object)
_fieldValue = fieldValue
End Sub

 Public Property ConnectionPointEnabled() As Boolean
Get
Dim o As Object = ViewState("ConnectionPointEnabled")
If Not (o Is Nothing) Then
Return CBool(o)
Else
Return True
End If
Get
Set(ByVal value As Boolean)
ViewState("ConnectionPointEnabled") = value
End Set
End Property

 <ConnectionConsumer("FieldConsumer", "Connpoint1", _
GetType(FieldConsumerConnectionPoint), AllowsMultipleConnections:=True)> _
Public Sub SetConnectionInterface(ByVal provider As IWebPartField)
_provider = provider
End Sub
#End Region

(Apologies for the poor formatting – still getting used to the online editor PLUS I also wanted to paste the text so it can be easily copied)

Now you can implement the connection, for example:

appID = GetConnectionValue()
Select Case appID
Case Is = -1 'not connected
Title.Text = "<b>Not Connected</b><br>"
Case Is = 0  'nothing selected
Title.Text = "<font size=""+1"">Nothing Selected</font><br>"
Case Else
'use the value here
End Select

And that’s about it: quick and dirty to get you going fast!