Sunday, 15 March 2009

How to allow Anonymous Access to one list (e.g. a picture library) in your SharePoint 2007 site

It is a 3 stage process to enable anonymous access to a specific list in your site (and only that list, not the rest of the site). This is particularly handy if you want to allow users to see images (via the html img tag) in MOSS-generated workflow emails - but don't want to make the whole site public. This is really the equivalent of an unauthenticated /Images directory in an ASP.NET web app).

If you follow the instructions from this article from MSDN under the heading "Enable anonymous access for individual lists", you will realise that the steps under that heading don't work by themselves. That is, you have to perform all steps listed for enabing anonymous access in the site collection and site level before you can enable anonymous access for lists:
http://technet.microsoft.com/en-us/library/cc263363.aspx#Section4.

To enable anonymous access to a particular list on your site, you need to do the following (in this order):
  1. Enable Anonymous access for your site collection through Central Admin->Application Management->Authentication Providers->Default-> Check On Anonymous Access
  2. Enable Anonymous access for the site through Site Actions->Site Settings->Site Permissions->Settings->Check on Anonymous Access
  3. Enable Anonymous access on the list you want available to anonymous users e.g. Site Actions->Site Settings->Site Administration-> Site Libraries and Lists->Click Customize PictureLibrary->Permissions for this picture Library->Settings->Anonymous Access-> Check On the 'View' checkbox.
Note that if you do 2 before 3, you will be presented with a list with all the options greyed out (i.e. you cannot check on "View" permission for anonymous users.)


Saturday, 14 March 2009

Windows Workflow Replicator Tasks & The SharePoint 2007 SDK (version 1.4 - August 2008) still doesn't install the ECM Activities into the GAC for you

I'm currently working on an application that creates multiple SharePoint tasks (based on a contact list) as part of a SharePoint workflow. Once all the tasks are completed, the workflow can continue. I recalled that I went through the Contact Replicator sample in the SharePoint 2007 SDK around a year ago and knew that would help me in my endeavours.

However, None of the SDK sample projects compile off the bat. I remember having this issue about a year ago. Again today, I just installed the latest MOSS 2007 SDK (updated August 2008) to find the missing ECM dll issue (or annoyance) is still there. The problems is that none of the sample projects in the SDK will compile until you've:
  1. Built the solution (and allowed Visual Studio 2008 to convert it automatically from 2005 format if neccessary)
  2. Installed the compiled the ECM Acitivty Library Dll and copied it into the gac (copying it into "C:\Windows\assembly" via Windows Explorer or using

    gacutil /i "C:\Program Files\2007 Office System Developer Resources\Samples\Workflow\ECMActivities\bin\Debug\Microsoft.Office.Samples.ECM.Activities.dll"

  3. Close and Reopen any sample projects you had open in Visual Studio.
Seeing as the SDK has a full blown installer, I had hoped the good folks in the the MOSS team would have fixed this problem - but I will have to continue living in hope.

Tuesday, 10 March 2009

How to Get "Run As" Context Menu in Vista/Windows 2008 for running SharePoint 2007 stsadm.exe

To run the SharePoint Administration tool Stsadm.exe on a SharePoint 2007 server, you must run as a SharePoint Server Farm Administrator - otherwise you will just get a blunt "Access Denied." error message. Trying to run any stsadm command whatsoever will be met with the same terse response. This is because the local administrator (when the database is on a separate server to MOSS) will not have sufficient privileges on your MOSS Content database.

Today, I needed to run stsadm.exe on a Windows 2K8 server. However, I didn't want to log off and log back on as another user every time I wanted to do this. Unfortunately, now Vista and Windows 2K8 "Run As" functionality only supports running as a local administrator - not a specific user anymore (e.g. like the SharePoint farm administrator account defined on another server - in Active Directory). Others have also complained about this issue on Microsoft Connect - https://connect.microsoft.com/WindowsServerFeedback/feedback/ViewFeedback.aspx?FeedbackID=329528

There are 2 options to get around this issue without logging off and on as another user:

1) Use the commandline RunAs tool (if you like a lot of typing or prefer batch files - see my previous entry at http://ddkonline.blogspot.com/2008/06/using-impersonation-batch-files-and.html)
2) Use ShellRunAs. Thankfully, the hardworking guys at Sysinternals have the following tool which allows you to add the Context menu for Run As back where it should be:

http://technet.microsoft.com/en-us/sysinternals/cc300361.aspx

To install this command in the context menu, you can simply use the following:

ShellRunas.exe /reg

Et VoilĂ ! - instant RunAs goodness shall return to your context menu.


Tuesday, 17 February 2009

Fix - "An error occurred either in Outlook or SharePoint. Contact the SharePoint site administrator. HTTP 400." when Synching MOSS 2007 with Outlook

Today I chose the option to Synch with Outlook 2007 (on a Microsoft Virtual PC 2007 image) from one of my SharePoint calendars in the same Virtual PC). However, the calendar items were not appearing in the Outlook version of the calendar. When I clicked Send/Receive, I kept getting this error:

Task 'SharePoint' reported error (0x8000FFFF) : 'An error occurred either in Outlook or SharePoint. Contact the SharePoint site administrator. HTTP 400.'

The fix which worked for me is to stop the System Event Notification Service and Start it again
  1. At a command prompt, type "net stop sens" and Enter
  2. Then to restart it, type "net start sens".

Friday, 13 February 2009

IX Web Hosting - The Great Terms of Service Switcheroo/Con - Warnings about a Humpty-Dumpty Speak Hosting Provider



My friends, be ever vigilant with your web site hosts as they could cut you off when they feel like it and change their Terms and Conditions at the flip of a switch. Whenever you see your hosting provider "revamp" their plans, look out because "Unlimited" means the exact opposite - you will get less than you got before.

I have always been wary when something "Unlimited" is promised and I typically turn around and walk in the other direction. This loaded term, "Unlimited" has become one of the most heavily abused terms used in the IT and Telecommunications Industries. The following article snippet puts it very well:

"As many webmasters who have been burnt can attest, "unlimited" in web hosting lingo usually does not really mean "unlimited" when it applies to disk space and bandwidth. While the rest of a web host's feature list is usually written in English, this word is best understood as being written in the language of Humpty Dumpty."

The article goes on (obviously the author has been burnt in the same way I have):

"Deconstructing the Meaning of "Unlimited" in Humpty-Dumpty-Speak

In Lewis Carroll's Through the Looking Glass, Humpty Dumpty redefined the meaning of the word "glory" to mean "a nice knock-down argument". When Alice, to whom he was speaking, protested that that was not the correct meaning of the word, Humpty Dumpty replied:

"When I use a word," Humpty Dumpty said in a rather scornful tone, "it means just what I choose it to mean -- neither more nor less."

In the same way, when web hosts use the word "unlimited" to say that you get "unlimited disk space" or "unlimited bandwidth" (or its equivalent "unlimited data transfer"), the word "unlimited" usually gets redefined to some other meaning, at the web host's discretion. The exact meaning varies from host to host, in the spirit of Humpty Dumpty, but it invariably means the opposite of the "unlimited" found in the English language."

(Thanks to http://www.thesitewizard.com/webhosting/unlimited-space-bandwidth.shtml)

So in the same Humpty-Dumpty manner, after I renewed my hosting account after 2 years with the same provider, I automatically had the "Unlimted Plan" thrust upon me and my world has come crashing down (well maybe that was a little dramatic...just my website did...)

Now I've been a loyal customer have been moderately content with my hosting provider for my site http://www.ddkonline.com for the last 3 or so years. However, I think the global credit crisis of 2008/2009 has turned them loopy in a nasty way. 4 days ago my site was brought down without warning and I was send a stream of 6 emails and tickets saying that I had 'violated their terms of service' (repeatedly referred to as ToS).

I was angry about this (and it was a bit of a shock as well) as I had only used 50GB/300GB ie around 1/6th of my signed up allocation. I thought they must have the wrong guy - but I became increasingly frustrated when I replied to the message - and recieved the exact same text copy and pasted to me each time from different people (or at least the robot on the other side had a different alias each time). This is the slightly hostile message I kept on receiving:

Your initial inquiry:
We are notifying you that your account has been found to violate our “Fair-Use” Resource Assignment portion of our Terms of Service, due to the amount of disk usage that is being taken.

We ask that you either reduce disk usage or look for dedicated hosting for this site.

We have a shared hosting environment that we must maintain at a certain level of performance. This performance is monitored and balanced by us, however there are times when accounts can cause the server’s load to increase degrading the performance for all other customers on this server.

To protect your account from further action you must agree to our request for compliance. Please respond to this message stating your intent to do so. You may either log into your control panel with us, and access this ticket via the 24/7 help desk, or provide this ticket number to our Live Chat or phone representatives. Failure to respond to this message within 72 hours will result in the suspension of the affected domain with us until such a time as this matter is resolved.

Please do not reply to this email as it is sent to you automatically and your answer will not be received. Instead, please respond to us by updating the ticket. Alternatively, you can reach us by 24/7 Live Chat at
http://www.ixwebhosting.com/index.php/pages.LiveChat
or by telephone at 1-800-385-0450 (international +1-614-534-1961).

Thank you!

Helpdesk System
IX Web Hosting
https://www.ixwebhosting.com

I spoke to 24 hour "support" and they apologised and then spat the same clause back at me - even when I asked how much I needed to reduce my disk usage by. No one knew what the "unlimited limit" was (was it 10GB? 20GB?) - so I was somehow meant to perform a feat of mindreading prowess not seen since David Copperfield pulled Claudia Schiffer! No Thank you very much, IX Web Hosting. I signed up when the plan was stated as 150GB in clear text. However, It appears that they did the "old Switcheroo" on my account, updated my plan to "unlimited" and slapped them witha new Humpty-Dumpty Terms of Service.

Digging a little deeper, this appears to be a common loophole in the contracts of budget hosting providers - they can change the terms at ANY TIME - and then cut you off without warning. Regardless of whether they have violated the 99.9% uptime clause themselves by being down for more than 4 days.

Needless to say, I have told them to cancel my account, refund the 2 years I have prepaid and I will now move to a more worthy provider. Let your feet do the walking, I say. My 3 word review on IX Web Hosting: "Don't Use them."

Here is my cancellation email to them:

"Hi Alex,

I would like to close my account and get my outstanding balance refunded as it does not provide what was originally promised when I signed up with IXWebHosting.

It originally had ***150Gb*** available (I currently only have 50GB used), and control panel now says I have 300Gb available. This reading is misleading if you believe I have violated your ToS.

My site has also been down for the last 4 days which doesn't match with your terms of service either. This has also interfered with my blog site which was also down for the period. This inconvenience is forcing me to move to another provider - I need to be sure that the host is reliable and delivers what is advertised - which IX Web Hosting has not.

Can you please close my IXWebHosting account and refund me the balance (I paid up to the end of 2010 because I was content until this debacle occurred).

Thank you.
David Klein (a disappointed customer)"

[Update 1 - 13 Feb 2009]
Apparently there are alot of people who were hit by a massive hack-fest on IXWeb Servers - http://ixwebhostwarning.wordpress.com/ and the IX Web Hosting support response hasn't been too good. They also don't deliver on their promises of regular backups too - their support people lie about it and have been caught out. So I'm not the only one having issues with their service.

[Update 2 - 13 Feb 2009]
This site also gives a good rundown of all the pitfalls of cheap providers that hide behind "acceptable terms of use" cop-out clauses which means they promise more than they deliver
http://ultracheaphosts.com/. On the other hand, this site guide you in the right direction when looking for a new host - http://whreviews.com/. HostGator looked like a good option until I received this response from them (basically they have a 50GB limit):

Hello,

Thank you for considering hostgator as your new webhost provider! When is comes to disk space we do provide unlimited disk space for you. However we do have a limit on Inodes(files) which will be about 50,000. This is because we take backup's ever Sunday and do to the amount of customer we have we must keep this in place so that we can ensure we can get all of our customers backed up without a problem. If you have any other questions or concerns please do not hesitate to reply back and ask!

Thank You!
Hostgator Sales
Luke B-P

I am now considering the GoDaddy.com Windows Deluxe Plan with 150GB space available. No way am I touching the unlimited plans :o)

Has anyone else had a bad experience like this with IX Web Hosting or any other web site hosting provider? Drop me a comment.

Friday, 6 February 2009

Using Reflection in CodeSmith Templates to Generate your UI

We are currently evaluating whether to use The Text Template Transformation Toolkit (aka T4 - used by MS internally for MVC and Entity Frameworks and built into VS 2008 - see http://www.olegsych.com/2007/12/text-template-transformation-toolkit/) or CodeSmith for generation of our UI layer. This will save us time when getting started with a new application and remove a lot of the monkey work that needs to be done in the UI layer. This code generation will also be a selling point for the Oakton Application Framework.

Our planned process is to:

1) Create our Data Transfer Objects with the lists and properties we wish to display in the User Interface (ie not generate the UI directly from the database schema).
2) Quickly generate basic pages using Reflection on our Data Transfer Objects (Dtos)

This is a simplified example of using CodeSmith templates and the System.Reflection namespace to spit out html for your page based on the properties of your Dto classes (or any other classes that you wish to bind to your UI).

<%--
Name: GenerateUIFromDtoViaReflection_Draft0-1
Author: David Klein
Description: Using Reflection to Generate UI from Dto Assembly when has correct Mapping Attributes
Note: Make sure that referenced assemblies are in the GAC or in the CodeSmith /bin directory so they can be
resolved correctly.
--%>
<%@ CodeTemplate Language="C#" TargetLanguage="Text" Src="" Inherits="" Debug="True"
Description="Template description here." %>
<%@ Property Name="AssemblyPath"
Type="System.String" Default="c:\temp\MyDtoAssembly.dll" Optional="false"
Category="Strings" Description="The path to your dto."
Editor="System.Windows.Forms.Design.FileNameEditor" %>
<%@ Property Name="TypeName"
Type="System.String" Optional="false" Category="Strings"
Description="Fully qualified name for your Dto" %>
<%@ Assembly Name="System.Data" %>
<%@ Assembly Name="Oakton.Sample.Common.Dto" %>
<%@ Assembly Name="Oakton.Framework.Common" %>
<%@ Assembly Name="Oakton.Sample.Common" %>
<%@ Import Namespace="System.Reflection" %>
<%@ Import Namespace="Oakton.Sample.Common.Dto" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Oakton.Framework.Common" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Windows.Forms" %>

<%
//Debugger.Break();
MessageBox.Show(TypeName);
Assembly assembly = System.Reflection.Assembly.LoadFile(AssemblyPath);
Type objectType = assembly.GetType(TypeName);

//System.Type objectType = System.Type.GetType(TypeName);
//System.Windows.Forms.MessageBox.Show("Is null {0}", (objectType == null).ToString());

PropertyInfo[] properties = objectType.GetProperties();

foreach(PropertyInfo property in properties)
{

//Add Property of Dto to UI
string fieldName = property.Name;
%>
<div class="row">
<label>
<asp:Literal ID="<% =fieldName %>Literal" runat="server" Text='<%%$ Resources:CommonResources, CustomerDetail_<% =fieldName %> %%>' />
</label>
<span class="input">
<asp:TextBox runat="server" ID="<%=fieldName%>TextBox" Text='<%%# Bind("<% =fieldName %>")%%>'
SkinID="short" />
</span>
</div>
<%


}
%>



If you are interested in some of the Patterns (e.g. Dtos and how they should be populated by Transfer Object Assemblers), mentioned above, see (Gasp! It's not from Microsoft!) the Java J2EE patterns site at http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObjectAssembler.html.
The same principles apply regardless of your selected language.



Wednesday, 4 February 2009

The Big Microsoft BI Shake Up - Performance Point Server (PPS) is Dead - Microsoft now bringing BI to the Masses in SharePoint Enterprise for Free


Microsoft just announced in its "Bringing BI to the Masses" announcement on 27th January that a new component of SharePoint .vNext will be created - PerformancePoint Services for SharePoint - http://www.microsoft.com/presspass/features/2009/jan09/01-27KurtDelbeneQA.mspx.

It has also announced on 8th January in it's "BI - Just do it in Excel" statement that it is increasing Excel BI capabilities with an Excel Add-in Pack code-named Gemini - http://www.technewsworld.com/story/Microsoft-BI-Just-Do-It-in-Excel-65595.html

The official word on Performance Point:
"Based on customer feedback, we have decided to consolidate the scorecard, dashboard and analytical capabilities from Office PerformancePoint Server into Microsoft Office SharePoint Server Enterprise and rebrand them as PerformancePoint Services for SharePoint.

In addition, in mid-2009, we will release Office PerformancePoint Server 2007 Service Pack 3 (SP3), which will include updates to the current product’s planning module. Thereafter, we will no longer continue with a stand-alone version of Office PerformancePoint Server 2007."


When Microsoft purchased ProClarity in 2006, there was a big hubub around how Microsoft was becoming serious about the BI space - and how it would finally get the graphical analysis tools it needed to compete. In reaction, Oracle bought Hyperion and IBM bought Cognos.

However, as shown in the announcements above, the market response for this dedicated product in the intervening period has been less than favourable and Microsoft has announced on January 23rd that it will discontinue the separate PerformancePoint 2007 product per se. Other components of PPS will live on in the next version of SharePoint - rumoured to be released in 2010.

With all this activity, looks like I won't be doing any PerformancePoint exams anytime soon!



Tuesday, 3 February 2009

Logitech G15 Gaming Keyboard (Rev. 2) Mini-Review




After reading several good (and not-so-good) reviews of the Logitech G15 (Rev. 2) keyboard, I just got my brand new Logitech G15 the other day. Here are some of my first impressions:
  1. There is a series of function keys along the left hand side of the keyboard (Labelled "G1" to "G6"). I am so used to the Esc key being at the top left hand side that I kept pressing the G1 to escape out of applications. To solve this, I just mapped the G1 key to Esc in Windows by default
  2. The RSS feed feature is very nice - your favourite RSS feeds flash past on your keyboard LCD while you are gaming/at work while not taking up screen space.
  3. The illuminated keyboard is very handy to see the keyboard at night (esp for function keys) - and allows 3 different brightness settings.
  4. The Windows Lockout key is a godsend. No more dropping out of your games by accidentally pressing the Windows Key!
  5. This keyboard is HUGE! It is nothing compared to Revision 1 of the G15 but it is large nonetheless (see pictures below). I really have to squeeze it into my laptop bag.
  6. It is a pain to get the POP email notifier (so you get nice little notifications popping up in the LCD screen) working with Gmail. You actually have to install an application called sTunnel (http://www.stunnel.org)to get the app to talk to the gmail servers via https- http://forums.logitech.com/logitech/board/message?board.id=hardware&message.id=419 Problem is, when the Logitech POP reader finally was able to check my email, it reads 167 emails and then the Logitech application crashes. I will have to try some of the alternative gmail readers for the G15 - but they don't look like they play nice with Vista.
  7. There is something different about the left hand side of the G15 key layout. I've never had this problem before on a keyboard - but sometimes I find myself typing at an offset of one key to the left (I don't normally look at the keyboard to type - but with the G15, I have to look to get my bearings occasionally). This is probably the most disconcerting aspect of the keyboard that I've found so far.
  8. The auto-update feature in the Logitech software doesn't work. Make sure you go to the Logitech site and download the latest driver software manually - as they have added nice features like the RSS reader.
  9. There were some build issues with the keyboard - the caps/number lock led cover was not attached to they keyboard properly when I opened it from the packaging.
So all in all I'd give the G15 Revision 2 a score of 4/10 - some of these niggling issues above are too big to ignore. I tried to find a demo model in the stores (in Officeworks, etc), but some of these issues only come out when you have used it for a couple of days. I have to say "Buyer Beware" for this one.