Archive for the ‘SharePoint’ Category

AgileDash Business Plan

Friday, May 28th, 2010

AgileDash, our flagship product which is an Agile project management tool which we be capable of running in multiple platforms.  The first platform AgileDash will be available on is Microsoft SharePoint, which we are naming AgileDash SP.  AgileDash SP was originally planned to be released for the new and powerful Microsoft SharePoint 2010 platform.  However, as much as I want to develop against SharePoint 2010, most people and potential customers are still using 2007 and they will be for the near future.  There are several reasons for this, the main reason is that SharePoint 2010 is 64 bit only.  This is a good thing since it gives 2010 the ability to be more powerful by being able to scale vertically as well as horizontally.  This also comes with a price to pay that a lot of customers are running 32 bit hardware still, they have heavy investments in this hardware and it will take time for them to convert over.

Now with all of that said, this was not a light decision on our part.  SharePoint 2010 offered a rich client API for us to develop against with Silverlight and jQuery.  SharePoint 2007 however does not offer this, and its extremely difficult to develop against when it comes to client side applications, in particular rich interface applications such as Silverlight.  I ran across something that changed my decision drastically, Marc D Anderson has been working on a jQuery framework called SPServices that acts as a proxy to the SharePoint 2007 web services that lets you easily and naturally program against.  He is actively developing this framework and it supports a large degree of functionality.  I plan on working closely with Marc to develop and get this framework working in Silverlight.

I plan to start testing several scenarios in Silverlight calling out to the SPService jQuery library immediately.   I will be posting about my findings on how this is working, what the performance is like, etc.

Preliminary UI for AgileDash SP

Monday, May 24th, 2010

So I have tinkering with multiple types of UI to go with on AgileDashSP, and I thought it would be very cool if I could pull off a rich user interface while keeping functionality high, I would love to hear opinions if you think the sticky notes just complicate the UI.  They can be scaled up and down as they are vector graphics, so I can make them smaller if needed, but you fit less information on them as they get smaller. I do plan on implementing a clever way to view the info at a quick glance if the text does get trimmed.

Please let me hear your feedback!

SharePoint 2010 Preparation Tool & Server 2008 R2

Wednesday, May 12th, 2010

So heres a tip, if you try to install SharePoint 2010 on Server 2008 R2 when you run the “Install software prerequisites” step it will fail.  It took me a little why to realize why, I first tried to disable my firewall, and then UAC, etc.  But nope, all you have to do is disable Internet Explorer Enhanced Security.  That simple, just goto “Server Manager”, scroll down a little ways to Security and there is an icon on the right that says “Configure IE SEC”, and just turn it off.  If this is going to be a production server, when you are done installing it is a good idea to turn this back on as to avoid any potential security issue.

Well thats simple right?  To bad the errors you get from the prerequisite installer don’t say anything, and getting an error 13 showing in your logs which translates to “Bad Data” is not very helpful either.

SPList.GetItems and SPQuery

Tuesday, February 10th, 2009

So with SharePoint you can write CAML based XML Queries to get data from a list, you can also restrict these queries to Views. But after having to troubleshoot an odd issue, I think I have found a rather interesting SP bug or very undesired behavior.

For instance, SPList.GetItems has two overloads:
SPList.GetItems(SPQuery)
SPList.GetItems(SPQuery, string ViewName)

So if I do something like SPList.GetItems(myQuery, myView.ID.ToString(“B”).ToUpper());

I would expect the query to return back with the columns of that view right? Wrong, in fact it doesn’t seem to run the query at all and it returns back all the columns. If I run it with just the query I get back 1 row.

However, and this is the kicker, if I do something like this:
SPQuery query = new SPQuery(myView);
query.Query = myQuery;
SPList.GetItems(query);

It works as expected? This is obviously incorrect behavior, now I am pretty sure I understand why it doesn’t work. I am thinking the ViewXML is not generated until after the query is bound to a view, but for the overload that takes a view name, that means that version is broken. I have SP1 installed, I am kind baffled as to why this is broken….

SharePoint List Column Names

Monday, February 9th, 2009

In SharePoint when you create a list the Column (Field) names of the list are XML Escaped, this means if you have a name with spaces such as “My Column 1″ you will get “My_x0020_Column_x0020_1″ but what’s even worse is that if you have two columns that exceed the maximum length, such as “My Column that is really long 1″ and “My Column that is really long 2″ even though those are unique when they are XML Escaped they exceed the maximum length and are therefore trimmed and given auto generated integer id’s appended to them so they will now appear as “My_x0020_Column_x0020_that_x0020_i0″ and “My_x0020_Column_x0020_that_x0020_i1″ which is very troublesome.

To avoid this, there is a trick where you can use shortened column names when you first create the list, then go back and change the field to your “friendly” name. SharePoint will keep your first column name and use that as its internal name and use your “friendly” name as it’s display name.

So that works fine but there are other known issues, for instance if you do a CAML Query and get a datatable back or you simply call GetDataTable on one of the Views you will get a DataTable back with the internal names as the column names instead of the friendly names.

To resolve this I wrote a simple little helper method that you run your table through before you bind it that fixes this issue:

DataTable table = list.GetItems(list.DefaultView).GetDataTable();
foreach(DataColumn column in table.Columns)
{
    column.ColumnName = list.Fields.GetFieldByInternalName(column.ColumnName).Title;
}

DateTime Precision with MOSS 2007

Sunday, January 4th, 2009

So apparently when you add an item to a List in MOSS that is a date time field, and then retrieve it you lose some precision. I just spent a good deal of time trying to figure out why my unit test equality kept failing, well if I looked at Ticks for the item that was stored, and then look at Ticks for the same item I just retrieved it turns out a couple of milliseconds of precision were trimmed off. So since I didn’t care about Time in my case I only needed to compare the dates I used date1.Date.CompareTo(date1.Date) == 0 little snippet and it worked fine.

Something to keep in mind if you run into the same problem…

MOSS 2007 Web Template Odd Behavior

Friday, December 12th, 2008

So I have been trying to figure out why a web template I have added using stsadm -o addtemplate would not show up using GetCustomWebTemplate API.

According to MSDN:
“Returns the collection of site templates for the site collection based on the specified locale ID (LCID).”

If I run the stsadm -o enumtemplates I can see the template listed. However, when I run the GetCustomWebTemplate() method I get zero returned. So out of curiiousity I switched over to GetWebTemplates() which according to MSDN:

“Returns the collection of site definitions that are available for creating Web sites within the site collection. ”

See a similarity there? In any case the difference is GetWebTemplates returns ALL of the WebTemplates and not just the custom ones. So guess what shows up on the bottom of this list? The template I just added…

But what really mystifies me is if I add the template through the UI in “Site Templates” it shows up for GetCustomWebTemplate(), this seems like a bug to me as the behavior is so different.

So lessons learned for adding custom web templates to MOSS 2007:

- Added through UI, you can use GetCustomWebTemplates OR GetWebTemplates
- Added through stsadm, you CANNOT use GetCustomWebTemplates, only GetWebTemplates

MOSS 2007 RSS Feeds and Export List

Saturday, November 22nd, 2008

Need to do some simple things in SharePoint but can’t figure it out, such as getting the RSS Feed of a list?  Exporting a list to Excel? 

Here are a couple of solutions I came up with for MOSS 2007:

How to retrieve the RSS Feed link for a SharePoint List?

private string GetRSSUrl()
{
 string listFeedPath = “~/_layouts/listfeed.aspx?List=”;
 
 SPList myList = GetMyList();
 string safeListID = GetMyListID();
 
 return String.Format(“{0}{1}”, listFeedPath, safeListID);
}
  
 private static SPList GetMyList()
 {
  return SPContext.Current.Site.OpenWeb(“/”).Lists["MyList"];
 }
  
 private string GetMyListID()
 {
  return Server.UrlEncode(GetMyList().ID.ToString());
 }

How to Export to Spreadsheet for a SharePoint List? 

private string GetExportToSpreadSheetUrl()
{
 string exportPath = SPContext.Current.Site.OpenWeb(“/”).Url + “/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy”;
 string safeListID = GetMyListID();
 string safeListViewID = GetMyListViewID();
 return String.Format(“{0}&List={1}&View={2}&CacheControl=1″, exportPath, safeListID, safeListViewID);
}
 
private static SPList GetMyList()
 {
  return SPContext.Current.Site.OpenWeb(“/”).Lists["MyList"];
 }
  
 private string GetMyListID()
 {
  return Server.UrlEncode(GetMyList().ID.ToString());
 }
  
 private string GetMyListViewID()
 {
  return Server.UrlEncode(GetMyListView().ID.ToString());
 }
  
 //You have to do it this way or it won’t work properly…
 protected void OnLoad(EventArgs e)
 {
  btnExportExcel.OnClientClick = String.Format(“javascript: window.open(‘{0}’);”, GetExportToSpreadSheetUrl());
 }