Monday, February 06, 2012
 
   
 
Conchango Blogs Minimize
EMC Consulting Blogs

EMC Consulting Blogs

  1. 2012, Year of the SPDragon

     

    This my latest installment of SPDragon – Now with SharePoint 2010 Web Parts!!!

    image

    click on area below to watch on youtube

    SPDragon–click area to watch on YouTube

     

    Media Credits:

    chooyutshing via photopin cc cyndy666 via photopin cc Francesco Muratori via photopin cc tonbabydc via photopin cc Kyle Taylor, Dream It. Do It. World Tour via photopin cc Dave Morrow's Custom Creations via photopin cc Sprengben [why not get a friend] via photopin cc Stuck in Customs via photopin cc Jakob Montrasio via photopin cc

    Music:

    Artist/Composer: yuanji-chen
    Keywords: Chinese; Folk Electrical; China-wave

    Creative Commons license: Public Domain

    Published Mon, 30 Jan 2012 00:24:47 GMT by Scott.Currier
  2. What happened at Last Orders?

    We are very lucky to have Mark Wilson as one of our taverners as he writes up brilliant blogs to remind everyone who was there what happened and to show those who were not able to make it what they missed.

    Mark again has been a star and here is his blog for you to check out.

    Also for those of you who loved Leemail (the service that lets you sign up to any website, subscribe to any newsletter and never worry about what may happen to your email) but missed the link for a special invite just click here.

    I will be collating all of the presentations and will post them shortly.

    For now taverners watch this space.....

    image

    A packed house listening to Mike Short, VP of Innovation and R&D at O2/Telefonica

     

    image

    How about a prize for the person who can name the most taverners???

    image

    Let the dancing begin…

    Published Fri, 27 Jan 2012 15:14:45 GMT by Michelle.Flynn
  3. Last Orders at The Bar – The details

    A message from Matt Bagwell 

    "On the eve of the Last Orders at the Bar Fantastic Tavern event, I wanted to whet your appetite for the evening ahead and ensure that come rain or shine (mostly rain I suspect), you brave the weather, make the trip and are with us by 7pm at Ravensbourne.

    I have worked with Ravensbourne, their students and incubating companies, Greenwich Council and their start up businesses and The Future Laboratories to make sure we have plenty of thoughts on 2012 trends to hear about and assess. We will also be joined by Mike Short, VP of Innovation and R&D at O2/Telefonica, who will help us understand the vision for the Digital Peninsula and what is already happening. As I have said before – and to paraphrase Alan Kay – the best way to predict the future is to actually invent it. That is true of what a variety of organisations – including Ravensbourne – are actually doing and it is something different, something special.

    I've ordered enough beer and wine to sink a battleship (thanks EMC Consulting). Greenwich Council and our kind sponsors, Marcus Donald People, will feed you and make sure you have entertainment after the main event.

    And yes, my twitter feed tells no lies. Jesus really is a DJ. From Fabric. Playing just for you.

    I think we are set to finish on a high. Please be a part of it."

    The details

    Thursday 26th January 2012 From 6pm

    The informal formal bit starts at 7.15.

    Finishes when we drink the bar dry.

    Ravensbourne, 6 Penrose Way, Greenwich Peninsula, London SE10 0EW

    For map click here

    The nearest tube is North Greenwich (only a couple of stops from London Bridge), or for those of you who opted for the James Bond entrance your boat tickets will be emailed over shortly.

    If you have not signed up yet we have a few places left so mail me on michelle.flynn@emc.com

    Published Wed, 25 Jan 2012 13:51:00 GMT by Michelle.Flynn
  4. Cloudy with a chance of Blue Skies

    The current global economic climate is a major cause for concern for all industries and individuals alike. We haven't seen a global recession the likes of which we are currently experiencing since the early 20th century. 

    The public are looking to introduce household cost efficiencies to help them weather the economic storm and the clouds gathering over many businesses are a real reason for concern, but are they also a sign, a subtle hint of how they might one day see clear blue skies again?

    Strained metaphor I know, but I think one that if given some thought makes sense. Many businesses are carrying inflated operational costs due to ageing infrastructures and processes often defined in the mid 90's when distributed computing and the client server model was embraced in a backlash to the restrictive Mainframe architectures.

    It was around the mid 90's that the term 'Blue Sky' thinking first began to make its way into my vocabulary, it seemed that at every IT project or transformation programme meeting I attended I needed to think 'blue sky', now it seems I have to think Cloud, but I prefer white fluffy clouds on a back drop of 'blue skies' as opposed to the big storm clouds gathering over the economy and our industries.

    So what has all this got to do with a Cloud Computing blog, I hear you ask? 

    Well, Cloud Computing can deliver great cost efficiencies to businesses and reduce on going operational costs whilst increasing agility. The simple fact of the matter is that it can't fail to.

    Even if we look at the simplest business case that puts you on a path to Cloud Computing, I'm not even suggesting a full Cloud Computing architecture; you will reduce your costs.

    What is that business case? Infrastructure Consolidation

    Even without process re-engineering, organisational structure change, service definitions or enhanced virtualisation technology you can put yourself on the "Journey to the Cloud" and provide your business with reduced operational costs.

    For instance the latest Intel 7500 series will provide you with a 35-40% increase over the 5600 series allowing you to increase consolidation ratios further than before and improve your overall energy consumption.

    Now, that might seem like a bit of a 'marketing statement' and perhaps it is, but beneath the marketing and technology are real tangible business benefits. Simply increasing your consolidation ratio per physical server from 10VM's to 14WM's would decrease an overall IT estate with 800VM's from 80 to 60 physical servers. That would represent a 25% overall saving just on capital costs and annual energy bills for this portiton of your estate. 

    With an avearage 3 year operating cost of circa £128k (including energy, data center, software, software support and server administration) multipled by 80 servers resulting in a potential ongoing Operating Cost of circa £10m over 3years a 25% saving simply by embracing an infrastructure consolidation exercise and leveraging the latest processor technology could see your business saving £2.5m over 3years.

    So it might be in your power yet to help move the storm clouds gathering over your business and create some blue skies, with some nice fluffy white clouds.

    Published Mon, 23 Jan 2012 18:35:00 GMT by Dave.Shepherd
  5. Add “Change Item Order” to a Custom Link List

    I built a SharePoint 2010 Visual Studio solution which included a custom list definition based on a custom content type inherited from the out-of-the-box Links content type.  The out-of-the-box links list contains a “Change Item Order” button in it’s ribbon bar which I needed for my solution (see image below).  I thought I’d get in my custom list by inheriting from the Links content type but that didn’t happen.

    image

    So I had to get the Change Item order back in my ribbon.  Looking deeper I found that there’s a hidden page called reorder.aspx in _layouts which, with the combination of your list GUID, brings you to a page where you can reorder items.  Try it – go into your list settings and change the page part of the URL from listedit.aspx to reorder.aspx (e.g. http://sitename/_layouts/reorder.aspx?List=[GUID]).

    The links list appears to be the only list where this reordering impacts a list view.  You can reorder other lists or libraries using the _layouts/reorder.aspx?List=[GUID] page but it does nothing to change your list views.  Comparing the Links list view settings to other list view settings, you’ll see that you have an option in the Links list to “Allow users to order items” (screenshot below) which you don’t get with other types of lists.

    image

    However, the reorder values do stick when you go back to this reorder page for any type of list so in theory you could use this in a CAML query using a hidden field named “order” (e.g. string qry = "<OrderBy><FieldRef Name='Order' /></OrderBy>";) if you were to build a custom content query webpart which needed a link to a sorting interface.

    But for my solution, I’m inheriting from the links list content type so the sort works, I just don’t get the option in the ribbon bar.  Chris O’Brien gives a good overview of customizing the ribbon here (Adding ribbon items into existing tabs/groups (ribbon customization part 2).  With Chris’ guide and viewing the source on an OOB Links list view page, I was able to determine that I could get the XML I needed to display the “Change Item Order” in my ribbon by opening the CMDUI.XML and grab the button element XML for Ribbon.ListItem.Actions.ChangeItemOrder (below).

    <Button
    Id="Ribbon.ListItem.Actions.ChangeItemOrder"
    Sequence="20"
    Command="ChangeLinkOrder"
    Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-144"
    Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-192" Image32by32Left="-288"
    LabelText="$Resources:core,cui_ButChangeItemOrder;"
    ToolTipTitle="$Resources:core,cui_ButChangeItemOrder;"
    ToolTipDescription="$Resources:core,cui_STT_ButChangeItemOrder;"
    TemplateAlias="o1"/>

    Here’s the final XML I used for the element I added to my visual studio solution to get the “Change Item Order” button to appear in my custom link list.  Highlighted in below example:
    -- Registrationid=”30099” is my custom list definition's Type value.
    -- Location="Ribbon.ListItem.Actions.Controls._children is the location where I want to place my button in the ribbon.
    -- I changed the Id for the button from Ribbon.ListItem.Actions.ChangeItemOrder to Ribbon.ListItem.Actions.RibbonSortOrderButton (when viewing source on initial deployment of my custom list, I saw ChangeItemOrder was being trimmed by an OOB JavaScript function so by changing this Id I’m ensuring the OOB JavaScript isn’t trimming it)
    -- Sequence="25" is my custom sequence for the order in which this button appears (see Chris O’Brien’s blog for more info).
    -- Command="ChangeLinkOrder" is the OOB command which means I don’t have to add a CommandUIHandler.

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">

    <!--Change Item order Ribbon-->
    <CustomAction
    Id="XYZ.Webpart.Links.XYZLinksListDefinition.RibbonSortOrderButton"
    Location="CommandUI.Ribbon"
    RegistrationId="30099"
    RegistrationType="List"
    Title="List View Ribbon Customization" >
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
    <Button
    Id="Ribbon.ListItem.Actions.RibbonSortOrderButton"
    Sequence="25"
    Command="ChangeLinkOrder"
    Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-144"
    Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-192" Image32by32Left="-288"
    LabelText="$Resources:core,cui_ButChangeItemOrder;"
    ToolTipTitle="$Resources:core,cui_ButChangeItemOrder;"
    ToolTipDescription="$Resources:core,cui_STT_ButChangeItemOrder;"
    TemplateAlias="o1" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    </CommandUIExtension>
    </CustomAction>
    </Elements>
    Published Mon, 16 Jan 2012 17:22:00 GMT by matt.lally
  6. Must-Read Books: Refactoring

    Next up on the “Must Read” list is the follow-up book from Martin Fowler of the Gang of Four, Refactoring: Improving the Design of Existing Code.  I hesitated with this one for a bit, thinking about adding it to the “Should Read” book list rather than the “Must Read.”  I did this because, for many experienced developers, the topics of this book are going to seem elementary.  Anyone decently experienced is going to look at a section header such as “Changing a Reference object to a Value object” and think “why I am even wasting my time with this Programming 101 refresher?”  But, much like Design Patterns, the fact that much of the information in the book has already been deduced through a combination of ingenuity and experience does not mean that the refresher cannot be extremely valuable.  And not ruffle any feathers, but usually the people that are most dismissive of “refresher” material are exactly those that need it the most!  <g> 

     

    At the very least, this book is an encyclopedia of these changes, and while many or most of the changes will be elementary, even the sections on those changes might have a new insight or viewpoint that the developer has not considered.  Chapter 3, which I’ll discuss below, is particularly useful here.  Another benefit is that any development manager or mentor of younger developers would be well-served to be familiar with this book so that they can point their less experienced colleagues to the proper place to learn how to correct mistakes they have made.

     

    Like Design Patterns before it, this book is about more than just specific techniques for one language.  The advice for guidelines and techniques in this book can be applied across all object oriented programming.  It’s a common viewpoint to dismiss refactoring as a problem that you only encounter in projects involving legacy systems.  That’s not really the case, though, as it is common to see these types of problems in daily work when interfacing with different systems, reviewing the work done by less experienced developers, etc.

     

    The first 50 pages are a good introduction to draw someone in, as it provides a walkthrough of a standard refactoring problem.  This is a great read for the inexperienced programmer, as it can be an enlightening view into the daily problem solving in the lives of senior developers and architects.  The next chapter makes a case for refactoring, which can be interesting for some, but doesn’t hold a candle to Chapter 3.  Chapter 3 is 20 pages of gold, as it examines the “Smell” of problems in need of refactoring.  When confronted with a specific problem, it’s easy enough to know the solution.  This chapter focuses on how to identify problems that are present.  This is really a brilliant piece of writing, in that it is clear cut, with obvious warning signs on what to recognize to diagnose the problem.

     

    The next chapter, Building Tests, focuses on an area that we frequently don’t do enough of.  It focuses on JUnit, but the testing focus, as with the patterns and coding elsewhere, can be applied to other languages.  The other chapters, again, exactly like Design Patterns, group the common techniques and problems into common areas and then proceed through each of them in a very straightforward matter.  At the very least, the book makes a fantastic reference to keep around and to thumb through when you run into problems you can’t quite put your finger on, or when you’re just looking for a great refresh of some standard material.

    Published Mon, 16 Jan 2012 04:32:00 GMT by Brandon.McMillon
  7. Must-Read Books: Rapid Development

    My library of books should have a wing dedicated to Steve McConnell.  He’s a great writer, in that he discusses technical issues with an approachable style and a practical outlook.  Much like Peopleware, he’s looking for things that can be proven to work, not just treading out the same axiomatic fluff that eventually becomes mantra because it’s repeated so many times.  To give you an idea of the impact his books and articles have had, in 1998, he was named alongside Bill Gates & Linus Torvalds as the one of the 3 most important people in the software industry by Software Development Magazine.

     

    Today we’re going to focus on Rapid Development, mainly because it ties in so well with my previous blog on Peopleware.  Rapid Development is all about how to manage a program or a project.  It was written after his book Code Complete, which you can expect to see showing up in this blog shortly.  Code Complete focuses on the day-to-day practice of how to code and techniques to employ, while this book focuses more on the software engineering aspect, looking at methodologies and practices that work and don’t work, and why.

     

    Early on in the book, McConnell hits you with some of the “Classic Mistakes”, and this is sure to make you wince if you’re fairly experienced.  One of those winces for me was the “Overly Optimistic Schedule” (see my blog on this mistake).  Some of them won’t evoke such bad feelings, though…you might even get a little boost from memory of how you successfully navigated one of them.  For me, that one was the classic mistake of uncontrolled problem employees.  I don’t know that I actually solved the problem myself, but I don’t wince because everything turned out great.  You can read about it HERE.

     

    As an aside on hiring, I’ll point out that many people don’t realize that a bad hire doesn’t just “not help”…it actually hurts.  The wrong employee doesn’t just contribute at a rate lower than others, they can actually have a negative overall contribution to the team.  Think about all of the time invested in a person training them up, having weekly meetings with them, and how much time their mistakes take other people time to fix.  And then figure up all of the motivation and momentum that the “wrong” person can suck out of a team.  Someone that is incompetent or negative can completely sidetrack a team as they devote energy to dealing with them.  Too often, though, the belief is to just “fill the spot” with a candidate that’s less than stellar.  This lack of recognition of the value of each and every team member on a software team often shows the need for management to clue in and read one of the other “Must Read” books, Peopleware.

     

    Other classic mistakes that I’ll point out is the “overestimation of savings from new tools and technologies”, which goes hand-in-hand with the “Silver Bullet Syndrome.”  Both are related to human nature in that we always try to look for just one thing that will be the huge productivity boost the manager desires.  It’s not sexy to realize that you’re not going to get a 30% productivity gain from the application of one thing, like the latest version of Visual Studio, or moving everyone to the cool new language/library, or implementing Agile (especially given how many “Agile shops” are anything but Agile!), etc.  Large productivity gains are the combination of doing 1000 small things correctly, and then implementing the right changes that continue to build upon the base you already have.  But again, it’s human nature to always expect a little more, so not only does Steve McConnell cover this, but Dr. Fred Brooks (author of The Mythical Man Month) also wrote up a short treatise about it.  You can find “No Silver Bullet” easily with an internet search, and it has also been reprinted in later copies of The Mythical Man Month.  I’ll cover it in a blog here in the near future, as understanding accidental versus essential complexity is a key skill as a software designer.

     

    And to build on this idea of how 1000 small things must be done well for great productivity gains, McConnell devotes the last section of the book to be an encyclopedia of software best practices.  Well, it’s actually better than an encyclopedia because it breaks down and correlates each of the best practices to specific problems that it solves and trade-offs or issues that it might cause itself.  It’s not that you need to go and do every single one of these gains, it’s that you need to be aware of what you’re gaining from choosing a particular best practice, and what you might be losing or conflict you might be creating as well.  And the key to remember is that this isn’t written for the programmers specifically.  We’ve got enough books on “how to get better programming”, such as McConnell’s own Code Complete, the Gang of 4’s Design Patterns & Refactoring books, etc.  This is written for management and senior development to determine the best way to plan for development.  This is a software engineering book, which is why I said up front that it goes hand-in-hand with a book like Peopleware.  You’ll even see some overlap, such as both recommending taking advantage of The Hawthorne Effect.  Highly recommended.

    Published Sat, 14 Jan 2012 14:25:00 GMT by Brandon.McMillon
  8. Lessons Learned: Dealing with Problem Employees

    For obvious reasons, the names and specifics will be left out, but the lesson will remain.  I was brought in to advise a product team on the right architecture and tools for their next generation product.  I met a highly competent team that had been together for a long time, to the point where it wasn’t uncommon for everyone on the team to head to dinner or to watch a game together.  It was very close knit, and management had invested heavily in everyone.

     

    Management was also heavily invested in the future.  The current product was going to be completely revamped, and contracts were in place that required this.  So when 3 of the 7 members on the development team privately confided that the new product was a pipe dream and that they believed it would never work, you can imagine how seriously I took this!  And it wasn’t just the normal gripe: in some cases it was outright rebellion with undone work items, returning “it’s not possible” findings on relatively simple research tasks, and talking the future of the company down to even those that believed in what they were doing.  I found out about this because the positive members complained to me in confidence, saying it was really bringing them down.

     

    My plan was pretty straightforward.  I approach everything with a high degree of transparency, so I first talked to 2 of them to see if I could get them to “get on the bus” and at least open themselves up to this.  This was a disaster.  One of the members, I’ll call him The Pessimist, flat out told me that it wasn’t going to work, and that things would be better off if they would just quit dreaming.  I talked to him about the contracts and how this wasn’t really optional for his company, and he was fairly nonchalant about it, but adamant that he wasn’t going to change, and that the sooner everyone realized this for the failure it was, the better.  The second one agreed to an attitude change, but it was obvious that this was just an attempt to be a team player, as the negativity still crept in at every possibility.

     

    Part 2 of the plan was to go to management.  Within 2 weeks of my initial suspicions, I had informed management of just how serious this problem was.  I shared with them articles about problem employees, talked to them about possible remedies, and I found out that one of the managers went back for years with The Pessimist, and that even having a “hard” talk with The Pessimist was farther than they would be willing to go.  He was family, and they were settled just pulling his dead weight rather than having to lose a member of the family.  But as with most things in consulting, when the first attempt fails, but you know that you’re right, you try & try again.

     

    The first strategy was to separate the 3.  They were working together a lot and forming a cluster of negativity, so we worked on finding them tasks that didn’t overlap, and that had them working with the other, more positive employees.  The third member literally turned around just on that.  Within 2 weeks, he was enjoying what he was working on and it completely turned around.  Within the month, our second grumpy employee was happy as well.  By giving people the ability to pick areas they were working on, the second employee threw himself into support of the old product.  A month in, he had gone from a 60-40 split to nearly 100% on the older product, and he loved it.  Everyone else moved their responsibilities for the previous version to him, and he kept learning more about a product he loved.   Problem #2 was solved, as long term support for the previous product was going to span years, and he was happy being “the guy” for Tier 3 support and new features for the old product.  Only Mr. Pessimist remained.

     

    This problem was solved in the 2nd month.  I had 2 very “strong” talks with management about how a change needed to be made, and I hit the wall with them.  I was sure they would never be able to even put Mr. Pessimist on notice, let alone be able to fire him without improvement.  His productivity was down and he was still loading down the team.  And then he resigned.  Call it Deus Ex Machina, but it was based on him getting tired of working with people that didn’t share his same beliefs.  He simply packed up his ball and went home.  Now this left a particularly bad taste in my mouth at the time.  Not because it wasn’t good for the team that he left, but that I had failed to give management the “proof” they needed to make a change.  I’ve since learned that people make bad decisions for bad reasons all the time, and that you’re not going to win every battle.  But the good news is that the team replaced Mr. Pessimist with another good contributor, and within 18 months the new software was released.  The contracts were satisfied and everyone was happy.

     

    Best of all, management talked to me and said that they now “got it” with regards to the problem employees.  They admitted to knowing it was wrong, but they hadn’t really seen “how wrong” it was until the change was made.  But they had learned the lesson now, and understood what team dynamics meant.  In retrospect, I likely should have come up with some mechanism to isolate Mr. Pessimist outside of the team for a couple of weeks, either an offsite, or training, or some “deep project” that he could do at home.  That likely would have been enough to show the difference in attitudes and productivity when he returned, but hindsight is always 20-20!  Again, you can’t win them all, but it’s fun to try.

    Published Sat, 14 Jan 2012 01:12:00 GMT by Brandon.McMillon
  9. {Follow Up} Why Entertainment Industry still has Digital all wrong - Midem 2012

    Thanks to all of you that have emailed me regarding my post, I do enjoy the emails that I receive from around the world - and there were a number of questions posed that I decided to add as a supplement Blog post to the original post from yesterday... First off, questions around the iTunes image that was posted... I used to live in the UK and probably spent a fair amount of UK ££££ on the iTunes store over there - I had a different email address and as such used to flip back and forth between my...(read more)
    Published Thu, 12 Jan 2012 19:15:00 GMT by Derek.Dunlop
  10. The Fantastic Tavern - Last Orders at the Bar

    Here is an update from Matt for those of you who have signed up to the TFT on the 26th, and a reminder for those of you who have not signed up yet….

    “Some three years or so ago, I started the Fantastic Tavern. It was to be a meeting of people who cared about ‘digital’ – as it was then – gathering in a pub and having a conversation. Over the months, we have run 28 events and the community has grown to over 1000 Taverners.

    We have explored so much together and enjoyed a fair few pubs and pints. It's been a great experience, made possible by great contributions – of time and content – from people.

    Now it is time to assign the Fantastic Tavern to history.

    In keeping with the brand, the next – and last event – is Last Orders at the Bar and it will be held somewhere magical on the 26th January (that's in three weeks). There are still lots of details to be planned but I wanted to ensure that you get a flavor for the evening and get it – and your attendance – in the diary.

    Each year at about this time, we run a Trends Briefing. Typically friends and colleagues create the content and then pitch the trend to the audience. They in turn rate it as ‘hot’ or ‘not’ for the year ahead. Think Top Gear.

    It’s great fun and also very informative. As it’s not broken, I’ll not change it this year.

    Oh, go on then. Lets change it a bit. Change is good.

    Firstly, we are inviting the students of Ravensbourne to create the content, not the typical crowd. This should give all of us a unique, fresh and cutting edge perspective on what’s going to be important to us this year – as practitioners but also as part of society as a whole. The students are briefed and already working away on some great presentations.

    There will also be guest speakers not least my beloved friends from the Future Laboratories. Of course, we will not have time for one of their conventional trends briefing – an immersion I highly recommend – but they are preparing a point of view about 2012 to share with us. Trust me when I say that what they do and what they talk about is of the highest quality and well worth coming to hear.

    Finally, lets reinvent the pub bit.

    There is something – somewhere – that I have been involved in (a little) for several years and it's an incredible gem that I want to share with you. I’m going to ask you to take a trip with me. A short one.

    The Greenwich Peninsula, home to the 02 and Ravensbourne, lots of new enterprises and some established one (like TFL) and the Council itself – is an incredible place. Moreover, it represents an incredible idea. There is something different happening here – something powerful and full of promise.

    Today, at it’s heart there is Ravensbourne. I guarantee you that this place for learning and developing will power you away. Set aside your memories of education and come and see the future, now.

    Then also hear the vision therest of the Peninsula – a vision for an enabled community that is being planned to be a better, prosperous, open and exciting place to work, live, learn and be entertained. You may remember we all brainstormed ideas for that vision in 2011? They are coming to life.

    You have to see this to believe it, to understand its potential. Forget the Roundabout. This is where it’s at. It’s where something different is happening.

    So yes, I’m asking you to be at Ravensbourne, which is at Greenwich North, at 6.30 for a 7pm start in two weeks time.

    http://www.rave.ac.uk/about/maps-and-directions/

    If you would like to be there and bring your colleagues and friends and haven’t already signed up, please email

    Michelle.flynn@emc.com

    If you would like to take the boat from central London to the north Greenwich terminal, we can provide times and tickets. Tell us you would like to get there on the boat in your email.

    Greenwich Council, Marcus Donald and EMC Consulting have thrown some cash – very generously – into a tankard and there will be a pop-up pub, food and dancing.

    I think that we have a memorable night planned and I’d like to think you could all make it – to hear the trends that we should think about in 2012 and celebrate the Fantastic Tavern as itcomes to an end. “

    We already have over 100 people signed up so make sure you do not miss the grand finale.

    Published Thu, 12 Jan 2012 14:11:25 GMT by Michelle.Flynn
  11. Lessons Learned: The Overly Aggressive Project Schedule

    In August 1998, we had just shipped Visual Studio 6.0, and I was sitting in a room with my peers when the guy in charge of all of Visual Studio, having recently been poached from Borland for what was rumored to be a 7 figure payout, told the room that we would be shipping Visual Studio 7.0, which later came to be known as Visual Studio .Net, in less than 12 months.

     

    Yes, I said that right.  In less than 12 months, a completely new runtime using 1 completely new language (C#) and 1 re-worked language (VB.Net) would be running in a brand new, consolidated IDE.  Previous versions of Visual Studio might have looked like they were in the same IDE, but they weren’t.  There was a core framework in place for some products, but the older guard products were still running in a shell that was primarily developed for them, but made to look like the standard IDE.

     

    When our new leader showed us the schedule, it was met with a few gasps, a few laughs, and a lot of stunned silence at just how patently absurd it all was.  The runtime at that point was a mess, and not due to be consumable for months.  Much of the other work hadn’t even started yet, and the team was just coming off of a ship cycle where they had released 2 versions in the previous 18 months.  1 row up for me, a manager I recognized pretended to light up an imaginary joint, then took a hit and offered to pass it down the row.  When someone looked at him puzzled, he said “You should have some of what they’re having.”

     

    Realistically, 18-24 months made a lot of sense.  We were about 6 months away from the team having worked on the .Net runtime nearly a year, and around that time it was starting to become useful.  The IDE and all of the associated libraries, wizards, and controls couldn’t really start until after that milestone was achieved, so another 12-18 months to sort those out would have been right on par with previous versions of Visual Studio.  But new leadership, particular when a new leader just came in with a high price tag, wants to flex some muscle, so we got a schedule that was impossible.

     

    The result?  Visual Studio .Net shipped in late 2001, nearly 2.5 years late on a 12 month project.  And it wasn’t that it needed nearly 4 years to ship, it’s that the overly aggressive schedule up front caused all sorts of problems long term.  No one wanted to admit that the schedule was that wrong, and so there were a series of “micro-slips”, rather than accurately judging things again and giving the project the extra 6-12 months that it really needed.  And yes, I’m overgeneralizing to an extent here, but this was a major problem on the macro level.

     

    Want to know something else crazy?  Windows had made the same mistake from 1996-1999, during the project that eventually became Windows 2000.  But that’s a story for another day….
    Published Thu, 12 Jan 2012 04:41:00 GMT by Brandon.McMillon
  12. Must-Read Books: Peopleware

    This book is the 2nd book that any software manager should read (The Mythical Man Month being the first), in my humble opinion.  Ok, not just in my opinion, but in Fred Brooks’ as well.  He wrote the Mythical Man Month and has said that Peopleware deserves every bit as much credit as his book.

     

    Its brilliance is also highlighted by the fact that the failings it addresses are so commonly found.  In my experience, the most common failings of management are usually explained by a lack of understanding the human aspect of employees.  This manifests itself in a lot of ways, everything from a poorly laid out workspace that doesn’t allow employees to concentrate to how the best managers protect their employees from the typical corporate politics while the worst ones don’t.  And it’s not just their opinions.  Everything is backed up by studies and metrics used to analyze and separate the good from the bad.  And it’s for more than just developer-type organizations, as the real focus is on how to manage those that need to be creative for their occupation.  So if you’re running or plan to be running an organization focused on creativity (e.g. software development, consulting, writers, artists, etc), then is absolutely required reading, and now rather than later.

     

    The goal of any organization should be productivity.  I know, I know…this seems like a no brainer, but when looking at the facts we have organizations that focus on short term gains and constantly do things that can be proven to hurt productivity.  And while we have smart things like Agile trying to approach the productivity problem and what can make it better, these measures don’t come close to addressing how to optimize the work environment.   This is what Peopleware is all about.  The book is extremely approachable, in that every chapter is relatively short (less than 10 pages on average) and they each focus on a specific topic.  Here are some examples:

     

    The first 6 chapters & 34 total pages are devoted to the differences between trying to manage a manufacturing focused job versus how to manage creative types.  It discusses the truth behind Parkinson’s Law (“The amount of work will expand to fill the time allotted to it”), the overlap between ridiculous productivity gains claims and medicinal scams, and a host of other interesting topics.

     

    The next 7 chapters and roughly 60 pages focus on the office environment, which are some of the most straightforward and easy to make changes that exist for companies today.  Then we have 4 chapters for a total of 29 pages focused on hiring the right people, what to do with them once they get there, and how to avoid the high hidden costs of turnover.  You’ll learn about Horatio Hornblower, how hiring a juggler isn’t very different from hiring a developer, and how to build a self-healing system.  It is absolute gold in less than 30 pages, with at least one new idea every other page.

     

    The book finishes with sections on how to increase productivity and how to make work fun, which is one of the keys to increasing productivity and cutting back on turnover.  This really is one for the ages.

    Published Thu, 12 Jan 2012 04:38:00 GMT by Brandon.McMillon
  13. Why Entertainment Industry still has Digital all wrong - Midem 2012

    With Midem only two weeks away, the South of France will again, be a stage for the music industry to work itself into a frenzy to figure out the best route forward into discovering how to rescue itself from the brink of its own self-importance/ destruction. I’ve attended, spoke & networked through many of these events in the past, and looking at the list of attendees I’m not sure that there will be much success in pushing forward any new ideas or initiatives. So while, I have been asked to attend...(read more)
    Published Wed, 11 Jan 2012 16:41:00 GMT by Derek.Dunlop
  14. On Building a Custom Service Application for SharePoint 2010 - Part 9: Provisioning a Service Application Database

     

    Provisioning a service application database is conceptually the easiest task in this series but this particular post is a bit longer to adequately cover the details. If you’ve followed my posts up to this point you will find this topic the most important aspect of building non-trivial service application – its also a ton of fun because the possibilities start to open up. By the time you complete this post we will be past the halfway point in our series and you should be able to construct some interesting extensions to SharePoint 2010 in this regard – but we are far from done so stay with me.

    Part 1: The Basics

    As a reminder, the class that does the yeoman's work in our service application is DemoServiceApplication ( DemoServiceApplication : SPServiceApplication ) and this class currently has a Create method as follows (see post 8 in this series):

    public static DemoServiceApplication Create(string name, DemoService service)
    {
                return new DemoServiceApplication(name, service);
    }

    The above method is called from within the CreateDemoService page used from central administration as shown next

    // get reference to the installed service (installed from feature activation)
    DemoService service = SPFarm.Local.Services.GetValue<DemoService>();

    // create demoservice app
    DemoServiceApplication DemoApp = DemoServiceApplication.Create(title, service);
    DemoApp.Update();
    DemoApp.Provision();

    Because DemoServiceApplication is the server side work-horse of our service application this will be a good place to “hook” our database creation. This method (and class) will provision our database by instantiating our database class and methods  (see below) - that is - when the administration creates an instance the Demo service in central administration. As a place holder I’ll create a new class file called SPServiceApplicationDatabase.cs that will eventually be used to perform the provisioning

    The changes looks as follows

    First, the updated DemoServiceApplication class’s Create method (note: I added SPDatabaseParameters):

    image

    Also, I’ve added a placeholder class for the actual database provisioning code DemoServiceApplicationDatabase (same drill as all our classes)

    image

    I also went back  to SPService (DemoService) and added the database parameters in a new constructor as well for completeness.

    image

    Ok, once these methods and classes are “filled” out we almost have what we need to create a database. We also need to modify the call to .Create in the CreateDemoService page. It now looks as follows – note we have not yet added form controls to the create page (see red squiggles) that allow us to enter the actual database parameters.

    image

    Currently, our create form only appears as follows

    image

    Ok, that ends the basic object framework relationships for creating a database – albeit, not fleshed out just yet. We now need to turn our attention to the database creation itself. Keep in mind ANY database or service can be hooked into your service application BUT using a SQL database in the same farm (or one that is managed by the same team) ensures administrative support and consistency with your data. Any external data not controlled by you is a dependency you need to consider carefully.

    The next steps are placement of the sql script used to create the database and adding the actual creation methods for the database itself. To that end we first create a new “Mapped” folder in our project {SharePointRoot}\Template\SQL and place an empty SQL file in that location – the solution looks now as follows

    image

     

    Part 2: Adding the required methods and form elements to provision our SQL database

    Its time to revisit the DemoServiceApplicationDatabase class (see above). We need some methods to grab the SQL file and provision or delete the database. You also need to be aware of the options available for how the database will behave – I find the number of options here a little intimidating myself.

    http://msdn.microsoft.com/en-us/library/ms219505.aspx <== just keep things as simple as possible Smile

    http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.databaseoptions.autoclose(v=sql.90).aspx

    For example, Autoclose keeps the database humming along even if no user activity is happening. Do we need this? Is this a performance issue?

    We proceed anyway – lets add an override in our DemoServiceApplicationDatabase class to provision the db.

    image

    Next we jump back into the DemoServiceApplication class (our work horse) and provision the database in the Create method.

    Note: this is a shortcut to keep the code simpler but is not the best place to provision the database (in .Create that is) for the final solution. See next image

    Here is the DemoServiceApplication Create method now

    image

    Lastly, we need to tie this all together in the CreateDemoService page by adding the required form elements needed (see above) and figure out what we want to actually CREATE in SQL.

    First the form, we open the .aspx page and add all the form elements related to the red squiggles in the image above…the database parameters.

    The Create form itself is stored in the 14 directory structure ...14\TEMPLATE\ADMIN\... for example, in code the reference from  public class DemoService : SPService, IServiceAdministration it appears as follows.

    image 

    For the CreateDemoPage.cs, it would be derived from : LayoutsPageBase and look as follows (covered at a high level in previous posts)

     

    image

    I won’t get into the details of the create page so much but want to at least highlight the sections needed for this post. First, you will need to register a control in the page as follows – this will help build out the form elements we need:

    <%@ Register TagPrefix="wssuc" TagName="ContentDatabaseSection" src="~/_admin/ContentDatabaseSection.ascx" %>

    Next, we need to add the actual control to our create form that allows us to enter database configuration options, it looks as follows

    <wssuc:ContentDatabaseSection
                id="DemoServiceApplicationDBSection"
                title="Demo Database"
                IncludeSearchServer="false"
                IncludeFailoverDatabaseServer="true"
                runat="server"/>   

    When we run the form we now see the “Demo Database” section displayed. Yippy!!

    image

    We also need to add the logic in the code behind that calls our Create class with these new db parameters from the form

    Here is the complete list of form controls from MSDN http://msdn.microsoft.com/en-us/library/ms413880.aspx

    Here is the code from the Create form so far – a little hard to read

    image

    Here is a snippet of the code behind for our parameters

    In the button click event we add the following – keep in mind I am NOT doing proper validation checking. This is NOT production code.

    image

    I also refactored the Create page a little, so here is how the solution looks now.

    image

    Reference: Much of this material was adapted from chapter 15 of this book by Paolo Pialorsi. Worth a read

    http://weblogs.asp.net/paolopia/

    http://www.amazon.com/Microsoft%C2%AE-SharePoint%C2%AE-Developer-Reference-ebook/dp/B004VB3VB4/ref=sr_1_4?ie=UTF8&qid=1325900230&sr=8-4

    Part 3: Fleshing out SQL (but I need to wait until the next post)

    From above recall that we created a SQL file to provision our database but the file is empty. We now need to come up with some business logic we can provision to demo our new database. Recall that we have a hook into a SQL file that will be used for provisioning

    image

    At this stage we need to come up with some SQL so we can test everything out – including Read/Write from our client. Because I need to think about a decent scenario for this piece I’ll stop now and hold off until my next post.

    I hope you find these posts helpful

    Cheers!

     

    Published Sat, 07 Jan 2012 02:17:51 GMT by Scott.Currier
  15. SharePoint 2010 Validate Special Characters

    I have a colleague who re-built my custom list based site provisioning solution using a Visual Studio Workflow where I created it using custom SharePoint Designer Workflow actions.  The solution uses the value of what an end-user puts in the “Title” field of the form to generate a URL.  Because the URL can’t contain Special Characters (i.e. ~!@#$%^&*()-+=[]';,./{}\":<>?"), I have actions which validate the column in my solution, using regular expressions, where he didn’t add that to his VS workflow redo.

    My colleague left the project recently and not soon after I was alerted about an issue where the site provisioning failed for a user who put a colon and a comma in their Title – to workaround, we simply we had the user resubmit the form with instruction not to use the colon and comma in the Title field but I figured I could fix a reoccurrence by adding the validation on submission.  I didn’t want to jump into visual studio to update his form and workflow and then redeploy the whole thing so I thought “Simple solution…I’ll just add validation to the Title column in the list settings to check for special characters.”  I thought I would have found the formula out there already but had no luck so I’m putting it out now.

    So here’s a formula to check for special characters in a text column which you can add via List Settings to the Validation Settings (Figure 1) for the entire list or just to the column’s Column Validation (Figure 2)

    =AND(IF(ISERROR(FIND(",",Title)),TRUE),IF(ISERROR(FIND("&",Title)),TRUE),IF(ISERROR(FIND("!",Title)),TRUE),IF(ISERROR(FIND("@",Title)),TRUE),IF(ISERROR(FIND("~",Title)),TRUE),IF(ISERROR(FIND("#",Title)),TRUE),IF(ISERROR(FIND("$",Title)),TRUE),IF(ISERROR(FIND("%",Title)),TRUE),IF(ISERROR(FIND("^",Title)),TRUE),IF(ISERROR(FIND("*",Title)),TRUE),IF(ISERROR(FIND("(",Title)),TRUE),IF(ISERROR(FIND(")",Title)),TRUE),IF(ISERROR(FIND("-",Title)),TRUE),IF(ISERROR(FIND("=",Title)),TRUE),IF(ISERROR(FIND("+",Title)),TRUE),IF(ISERROR(FIND(":",Title)),TRUE),IF(ISERROR(FIND(";",Title)),TRUE),IF(ISERROR(FIND("<",Title)),TRUE),IF(ISERROR(FIND(">",Title)),TRUE),IF(ISERROR(FIND("?",Title)),TRUE),IF(ISERROR(FIND("'",Title)),TRUE),IF(ISERROR(FIND("{",Title)),TRUE),IF(ISERROR(FIND("}",Title)),TRUE),IF(ISERROR(FIND("[",Title)),TRUE),IF(ISERROR(FIND("]",Title)),TRUE),IF(ISERROR(FIND(".",Title)),TRUE),IF(ISERROR(FIND("/",Title)),TRUE),IF(ISERROR(FIND("\",Title)),TRUE),IF(ISERROR(FIND("""",Title)),TRUE))

    NOTE:  To validate double quotes, you need to enter double double quotes in your formula (highlighted above).  This sample formula is validating a single word field (i.e., Title) so you don’t need to enclose the field name in brackets ([ ])  where if the field name contains two words you do need the brackets (e.g. [Project Name]).  Also, in SharePoint 2010, the validation formulas can be very similar to data validation formulas used in the past for Microsoft Excel so if your struggling to find a decent sample for a formula search for Microsoft Excel formula examples.

    List Settings Validation Options Screenshots:

    image

    Figure 1 (For overall list – using this method, the validation message appears at top of list item edit form upon failure).

    image

    Figure 2 (For only the column – using this method, validation message appears below the field in the list item edit form upon failure).

    Published Fri, 06 Jan 2012 21:40:10 GMT by matt.lally
  16. Web Design in SharePoint 2010 - Branding and UI Customization Recommendations

    Have you ever wanted to create a new and different User Experience on top of a tried and true delivery platform?

    That is just what a new book published by Apress and written by my EMC Colleague Erik Swenson teaches people how to do.  I recently had the pleasure of previewing a copy and participating in editing those chapters that pertained to my area of expertise 'Information Architecture.'  For years I have been meeting with Intranet design customers who often say the same thing about their User Story with regard to utilizing the web channel as a more Usable Internal Communications vehicle: "I want to use SharePoint for my Corporate Intranet because of it's familiar office-like functionality and easy to maintain User administration and configuration interfaces, 'but I don't want my website it to 'look like SharePoint does by default right 'Out of The Box'."

    Erik's new Book "Practical SharePoint 2010 Branding and customization" helps web designers and their clients meet those needs in a unique and rewarding way that I've not seen other books do (or even attempt to do) in the past.  It puts practical 'hand-on' advice in layman's terms and makes UI Design techniques more accessible to a broader audience.  I can't remember how many times I have heard experienced UI Designers and Front-end developers (as well as other stakeholders who are relatively new to the game) say that "I wish this book I just read had more 'how to' instructions in it, I wish I could find another web design book that reads more like a 'Do It Yourself'' guide." or  "All this design philosophy and UI process methodology direction is great, but how do I take action on it?"

    If these concepts and those customer re-design requests resonates a chord within you, either as an aspiring web designer or as a project-dedicated Subject Matter Expert (or even as any other Software design team stakeholder), then this new book will definitely be an eye-opener for you that adds value to your journey through an otherwise challenging process.

    In this book Erik provides an 'Intro to SharePoint 2010 Branding,' an 'Overview of the User Experience \ Branding process', an easy to understand guide on how to 'Gather Branding Requirements,' concrete examples on 'Creating the Visual Design,' and practical hands-on guidance on 'Development Environment Setup.'  It goes on to offer deeper specifics on 'Building the Design,' Testing the Visual Build.' constructive 'Tips and Tricks.' as well as providing a couple of chapters on Tools, Resources, and CSS Reference material.

    I highly recommend this book as a good read for anyone who finds themselves involved in a large-scale web design effort.

    As an Instructional Design education manual for 2010 web design, It is truly a brilliant piece.

    find it on Amazon at:

     http://www.amazon.com/Practical-SharePoint-2010-Branding-Customization/dp/1430240261/ref=sr_1_1?s=books&ie=UTF8&qid=1325877291&sr=1-1

    I am sure that you will find it to be an excellent companion throughout your journey towards 'User-Friendly and Intuitive User Interface Design'

    thanks,

    Robert Dornbush

    Information Architect and Interaction Designer at EMC Consulting

     

    Published Fri, 06 Jan 2012 18:49:00 GMT by dornbush
  17. 3 things that really get on my nerves with using SQL Server

    Don't get me wrong I love SQL Server, I have been using it for many years in all its Windows favours...

    SQL Server 4.21a, 6.0, 6.5, 7, 2000, 2005, 2008, 2008 R2 and 2012

    If fact I trained under someone who used SQL Server 1 on OS/2 (there you go revealing my age)

    However, there are number of things that get under my skin, and here are my top 3 favourites

    1) Actual Execution Plan

       Why is this only displayed once the query has finished executing and returned all the results.
     
       This is particularly annoying if you have a never ending query, and the reason you are displaying
       the Actual Execution Plan is to endeavor to find the reason for your poor performance in the first
       place! A classic Catch 222 situation.

       I know you can display the Estimated Execution Plan, but this is only an estimation of what is
       going to happen not 100% what actually is happening or has happened.
     
       I don't know the internal mechanics of SQL Server enough, but there must be a point when the query
       engine has finished all its work and passing on its findings to the execution engine. Why can't
       the execution plan be displayed then!

    2) Inconsistent (I believe) DDL Commands

       While you can create a Table and an Index in another database. Syntax is

       CREATE TABLE AnyDataBase.AnySchema.AnyTable

       You can not create a View (or Procedure or Function) in another database!

       CREATE VIEW AnySchema.AnyView
       CREATE PROCEDURE AnySchema.AnyProcedure
       CREATE FUNCTION AnySchema.AnyFunction

       I can't see any reason for the limit on this restriction other than maybe working out the metadata across databases
       to ensure all objects bind correctly

       Also while you always CREATE TABLE and DROP TABLE, CREATE VIEW DROP VIEW etc you

       ALTER TABLE ADD COLUMN rather than ALTER TABLE CREATE COLUMN but you still ALTER TABLE DROP COLUMN

       To be fair this is probably an ANSI Standard but it is inconsistent!

    3) Inconsistent USE of the Command Termination ';' Semicolon Command
     
       BEGIN;
       PRINT 'Hello World';
       END;

       is OK! However if you run:

      USE AdventureWorks2008R2;
    GO

    BEGIN TRY
        -- Table does not exist; object name resolution
        -- error not caught.
        SELECT * FROM NonexistentTable;
    END TRY;
    BEGIN CATCH
        SELECT
            ERROR_NUMBER() AS ErrorNumber
            ,ERROR_MESSAGE() AS ErrorMessage;
    END CATCH;
     
    Results in

    Msg 102, Level 15, State 1, Line 6
    Incorrect syntax near ';'.
    Msg 102, Level 15, State 1, Line 11
    Incorrect syntax near 'CATCH'.

    But

    USE AdventureWorks2008R2;
    GO

    BEGIN TRY;
        -- Table does not exist; object name resolution
        -- error not caught.
        SELECT * FROM NonexistentTable;
    END TRY
    BEGIN CATCH;
        SELECT
            ERROR_NUMBER() AS ErrorNumber
            ,ERROR_MESSAGE() AS ErrorMessage;
    END CATCH;

    works OK!

    If you read this posting here this gives some explanation. It is partly a BUG, but also partly by design.
      
        http://connect.microsoft.com/SQLServer/feedback/details/498085/msft-mso-end-try-throws-an-error-if-terminated-with-a-semicolon

        But I just want consistency!


        Another one is that CTE insist that the previous line is correctly terminated, but (AFAIK) NO other
        function, command does!
       
        And before someone says it been rolled out incrementally via newer functionality, the even newer MERGE
        statement does NOT insist that the Termination character is present at the end of the previous statement!

    I maybe returning to this issue again in the future 

     

    Published Fri, 06 Jan 2012 16:28:00 GMT by Paul.McMillan
  18. SQL Server Error 18452, "Login failed. The login is from an untrusted domain" Windows 7

    The full error message is SQL Server Error 18452, "Login failed. The login is from an untrusted domain and cannot be used with Windows Authentication" 

    I have just got this error message again on a Windows 7 Workstation, that I am using SQL Server Management Studio on.

    It reminded me that I wanted to blog about the resolution to this and also add how to solve this for Named Instances as well.

    Firstly some background to the issue:

    I have a Windows 7 Workstation that I use SQL Server Management Studio to connect to SQL Servers in both a Production (PROD) and TEST Domains. However, I log on to the Workstation using a Local Windows Account. I have to do this as the PROD and Test Domains are predominantly XP, and the Group Policy that was developed for XP is different to that used in Vista and Windows 7. Currently, we are not able to operate in a mixed mode domain as a result the current roaming profiles we have DO NOT WORK for Window 7. This is a major problem because it means whenever you log off you have to re-assign Outlook Exchange connections and you lose all your internet favourites etc.

    So I have 3 Accounts all with the same Username

    LOCAL\MyUser

    PROD\MyUser

    TEST\MyUser

    I log onto my Windows WorkStation using LOCAL\MyUser and then want to connect seamlessly to both PROD and TEST SQL Servers using SQL Management Studio using Windows Authentication (Not SQL Authentication). I can either do one of three things:

    1) I can attempt to use the Shift Key and then Right Click on SQL Management Studio and 'Run as Different User' and use either PROD or TEST Accounts

    However, I cannot then intermix in SSMS Local SQL Server and different Domain SQL Servers - I am stuck with just those SQL Servers in the Domain I logged in on.....

     2) I can attempt to  use a Line Command as detailed by Jason Follas here:

    http://www.jasonfollas.com/wiki/(X(1)S(zucey4jfr2sr4maocepgrn55))/Default.aspx?Page=SQL%20Management%20Studio%20on%20Vista&AspxAutoDetectCookieSupport=1

    However, again I am limited to using just those SQL Servers in the one Domain, and secondly also I am prompted for the password each time as /savecred does not work with /netonly at the same time.

    3) Finally I can attempt to use Windows Credential Manager to store the various Domain Credentials for me. However, when I did this (the first time) it did not work and I still had the SQL Server Error 18452 Message. I could not find out the answer until Google popped up the following link and Arsine's answer (thanks again Arsine!)

    http://social.msdn.microsoft.com/Forums/hu-HU/sqlsecurity/thread/c05a90e4-cb16-46f6-9072-37083c65696d

    I have to create a Windows Credential and add the SQL Server Port (1443) to the end of the Internet or Network Address in the form :<SQL_Port_Number>

    So to seamlessly connect to SQL Servers in Any Domain from Windows 7 in SQL Management Studio you need to
     
    •         Use Control Panel, User Accounts, Manage Your Credentials, Add a Windows Credential
     
    •         Add all the SQL Servers you want by Fully Qualified Name but you must include the PORT Number as say  :1433
     
    •         Example:
     
    •         ANYSERVER.ANYCOM.TEST:1433
     
    •         Username: TEST\AnyUser 
    •         Password: TEST Password
     
    •         Press Add Button
     
    Note: Each SQL Server will have to be added separately
     
    Note: If there are any Password changes then all references in Windows Credentials will need to be updated

    This way you can control all SQL Servers in ALL Domains seamlessly from one instance of SQL Server Management Studio
     
    I would like to add two additional points to Arsine's excellent posting

    A) I find that it is best to Fully Qualified Name the ServerName in Windows Credentials and SQL Management Studio rather than just the Servername . So use ANYSERVER.ANYCOM.TEST rather than just ANYSERVER

    B) If you have a NAMED INSTANCE of SQL Server you must create multiple entries in Windows Credentials, one using the default SQL Server Port 1433 and one for each Port allocated for the Named Instance such as 2335 so use

    ANYSERVER.ANYCOM.TEST:1433

    as well as  

    ANYSERVER.ANYCOM.TEST:2335

    Note: Of course this will have to be defined as ANYSERVER.ANYCOM.TEST\NamedInstanceName in SQL Management Studio

    To find out the Port that SQL is running on (there are many methods) I suggest you read the link below by Colin Stasiuk which contains by far the most comprehensive solutions I can find. I didn't like hunting throug Registry Entries and looking at the SQL Server Logs was by far the quickest solution (noting the 'possible gotcha' detailed )

    http://sqlserverpedia.com/blog/sql-server-bloggers/what-tcp-port-is-sql-server-running-under/

    Finally I know I could have used SQL Server Authentication without a problem to achive the same thing but I did not want to go through this less secure method.

    PS. To avoid having to use the Shift Key when Right-Clicking for 'Run As Different User" in Windows 7:

    • Just go to registry run regedit.exe, search for “runasuser”, then under it you’ll find empty value REG_SZ named “Extended”.
    •  Delete every “Extended” (there should be around 5 of them
    • Result is that there is no need to press shift key anymore, the option will ALWAYS appear when you Right-Click

     

     

    Published Fri, 06 Jan 2012 11:57:00 GMT by Paul.McMillan
  19. 2012 Search: Who will find you & how?

    In 2011 Google did the unthinkable or for a lot of people, the “about time” by dropping their all new Panda algorithm that would change the old school way that it had spidered and indexed sites previously. This in part was a pre-cursor for Google+ and more social results, but more importantly to weed out and drop the spam and poor content that seemed to endlessly end up in your search results. For the traditional Google end user, business as usual really, apart from some small inclusions from social...(read more)
    Published Wed, 04 Jan 2012 15:59:00 GMT by Derek.Dunlop
  20. On Building a Custom Service Application for SharePoint 2010 - Part 8: Client Access via Proxy Classes

    This post will finish up post 7 by beefing our client access to the service application with logic to enable/disable the service from central administration without deleting it.

    First, lets take a look at DemoApplicationProxy with some new additions – note I added Guid serviceAppID where serviceAppID will eventually return the DemoServiceApplication identifier. (refer to the last post for supporting material)

    image

    I also need to add two methods, the first is one here makes the connection between our server and client code bases.

    image 

    oops: in the image above my "return" is in the wrong place – but you get the idea

    A few comments about the above code. Most importantly, its coded to return data only if (at least) one instance of the service application is enabled using SPObjectStatus.Online. This is a fake out. Recall that even without a service instance created we can grab a reference that still allows the service application to work. In our non-WCF, single server mode this simply simulates the on/off capability of the CA management screen. Its not code that will end up in the final solution. In fact, I could not even get the on/off behavior to work properly without this code. I don’t know if its because I lack some information around using instances on a single server, non-WCF service application or something else. So that clarification will need to wait for a future post.

    As seen in previous posts, the next image shows how this looks in central administration where SPObjectStatus is controlled. I’ll demo the behavior at the end of this blog post.

    image

    The second point related back to post 7 and where I disclose that the DemoServiceInstance really does nothing for us just now – I’ve included it mainly because this will end up a necessary component as we move into a multi-server, WCF based server application. 

    The next method returns an instance of the service application based on SPServiceContext passed in by the client.

    image

    Finally, I refactor the the client code (our page web part) to use the service context and proxy class as follows.

    image

    The results of these changes allow the service application to work only when the its properly started.

    If stopped, the page appears as follows,

    image

    Results on page,

    image

    If started,

    image

    The page now appears with data,

    image

    Now that we’ve added the proxy classes to our application we can see these show up in “Manage Service Applications”

    image

     

    We are now nearing the end of usefulness of this non-WCF demo BUT I have 2 or 3 topics I want to touch on before we shift into using WCF end points.

    My proposed agenda for the next three posts are: provisioning a service application database, using REST to call into this service application (a fun one), and finally adding Powershell administrative commands. After that we begin our WCF version of this application with a discussion (and code) regarding load balancing, publishing services out to other farms, and claims based authentication related topics. The last installment of this series will be refactoring the business logic for something more “real” as a final demo.

    See you next time – Cheers!

    Published Wed, 04 Jan 2012 15:58:00 GMT by Scott.Currier
  21. A way to find the Real Total Lines of T-SQL Code in a SQL Database

    Version 2

     In my previous post 

    http://consultingblogs.emc.com/paulmcmillan/archive/2012/01/03/find-the-total-lines-of-t-sql-code-in-a-sql-database.aspx

    I said that the code was not perfect because it just counts the number of Line Feeds and you could have a number of
    lines which do not have any text and as such these will be added to the count line total. Therefore you need to
    eliminate any lines with just "whitespace" to get the "real" line count value from the actual line count. I said that perhaps I would have a go at doing this in the future...

    Well I realised that this was quiet easy to do, by extending the logic

    The logic of the code is to get the total length of text and also the total length of text with all the Line Feeds removed
    NCHAR(10). The difference minus 1 is the Number of Lines in the Text.

    To eliminate all Whitespace lines (those with no code in) which could consist of any or all of the following

     Spaces Characters NCHAR (32)
     Tab Characters NCHAR (9)
     Carriage Returns NCHAR (13)
     Corrupted Carriage Return and Line Feed Lines NCHAR (13) + NCHAR (10) + NCHAR (10) - I have seen instances of this
     
    I would need to remove these instances of 'Noise' from the text first and then find the total length after removing the Line Feeds from what remained after the noise was removed.

    I have also added in the Schema Name to the Object Name as the initial version did not have this information and I noticed
    it was possible to skew the results if Objects had the same name but in different Schemas
     

    The Version 2 of this code is below....

     

    CREATE PROCEDURE [dbo].[esp_GetObjectNumberOfRows]

    (

    @DatabaseName SYSNAME = '',

    @GroupingType NCHAR (1) = 'N', -- N = Object Name, T = Object Type, D = Database

    @ExecuteSQL BIT = 1, -- Default Execute SQL On

    @PrintSQL BIT = 0 -- Default Debug SQL Off

    )

    /*

    Paul McMillan

    EMC Consulting 2012

    Version 1

    My Project Manager asked me to find out 'How many lines of code have we in the System'. I could not

    believe that no one has ever had to do this before so I googled 'sql server stored procedure number of lines' and found

    the following posting from Gordon Bell (many thanks!) on Stack Overflow in November 2008. See link below

    http://stackoverflow.com/questions/291574/query-to-list-sql-server-stored-procedures-along-with-lines-of-code-for-each-pro

    However, the solution Gordon provided did not allow you to pass in a DatabaseName as a Parameter (and I had to find this

    out for all the databases in a system) - I could have run it in each database individually but I thought I would take

    the base code and allow a DatabaseName to be passed in as a parameter.

    Furthermore, I thought I would update the code to use the latest SQL sys.objects and sys.sql_modules system tables

    rather than older sysobjects ans syscomments system tables.

    Additionally, I thought I would add a Grouping Parameter, so you can return either the

    1) Total Lines of Code for each Stored Procedure and each Function for any Database. GroupingType = 'N' - Default

    2) Total Lines of Code for all Stored Procedures and all Functions for any Database. GroupingType = 'T' - Default

    3) Total Lines of Code for all Stored Procedures and Functions for any Database . GroupingType = 'D'

    Finally as this is written using Dynamic SQL I have a Switches for Print SQL (Debug) and Execute SQL

    Version 2

    I said that the code was not perfect because it just counts the number if newlines and you could have a number of

    lines which do not have any text and as such these will be added to the count line total. Therefore you need to

    eliminate any lines with just "whitespace" to get the "real" line count value. I said that prehaps I would

    have a go at doing this in the future...

    Well I realised that this was quiet easy to do, by extending the logic

    The logic of the code is to get the total length of text and also the total length of text with all the Line Feeds removed

    NCHAR(10). The difference minus 1 is the Number of Lines in the Text.

    To eliminate all Whitespace lines (those with no code in) which could consist of any or all of the following

    Spaces Characters NCHAR (32)

    Tab Characters NCHAR (9)

    Carriage Returns NCHAR (13)

    Corrupted Carriage Return and Line Feed Lines NCHAR (13) + NCHAR (10) + NCHAR (10) - I have seen instances of this

     

    I would need to remove these instances of 'Noise' from the text first and then find the total length after removing the Line Feeds from what remained after the noise was removed.

    I have also added in the Schema Name to the Object Name as the initial version did not have this information and I noticed

    it was possible to skew the results if Objects had the same name but in different Schemas

    */

    AS

    BEGIN;

    IF @DatabaseName = ''

    SET @DatabaseName = DB_NAME(); -- Default is current database

    DECLARE @SQLMessage NVARCHAR (MAX);

    -- Testing Code

    --DECLARE @DatabaseName SYSNAME = 'master';

    --DECLARE @GroupingType NCHAR (1) = 'T'; -- N = Object Name, T = Object Type, D = Database

    SET @SQLMessage = '

    SELECT

    ' + NCHAR (39) + @DatabaseName + NCHAR (39) + ' AS DatabaseName,

    ' +

    CASE WHEN @GroupingType = 'N' THEN 'T.ObjectName, ' ELSE '' END +

    CASE WHEN @GroupingType IN ('N', 'T') THEN '

    CASE WHEN T.ObjectDescription = ''Stored Procedure''

    THEN SUM(T.ProcedureCount)

    ELSE SUM(T.FunctionCount)

    END AS ObjectCount,' ELSE 'SUM(T.ProcedureCount) + SUM(T.FunctionCount) AS ObjectCount, ' END +

    CASE WHEN @GroupingType IN ('N', 'T') THEN 'T.ObjectDescription, ' ELSE '' END + '

    SUM(T.ActualLinesOfCode) - 1 AS TotalActualLinesOfCode,

    SUM(T.RealLinesOfCode) - 1 AS TotalRealLinesOfCode

    FROM

    (

    SELECT

    CASE WHEN o.type = ''P'' THEN 1 ELSE 0 END AS ProcedureCount,

    CASE WHEN o.type IN (''FN'', ''IF'', ''TF'') THEN 1 ELSE 0 END AS FunctionCount,

    s.name + ''.'' + o.name AS ObjectName,

    (LEN(C.definition) - LEN(REPLACE(C.definition, NCHAR(10), ''''))) AS ActualLinesOfCode,

    (LEN(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(C.definition, '' '', ''''), NCHAR(9), ''''), NCHAR(13), ''''), NCHAR(10) + NCHAR(10), NCHAR(10)), NCHAR(10) + NCHAR(10), NCHAR(10))) - LEN(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(C.definition, '' '', ''''), NCHAR(9), ''''), NCHAR(13), ''''), NCHAR(10) + NCHAR(10), NCHAR(10)), NCHAR(10) + NCHAR(10), NCHAR(10)), NCHAR(10), ''''))) AS RealLinesOfCode,

    CASE WHEN o.type = ''P'' THEN ''Stored Procedure'' -- STORED_PROCEDURE

    WHEN o.type IN (''FN'', ''IF'', ''TF'') THEN ''Function'' -- SQL_SCALAR_FUNCTION, SQL_INLINE_TABLE_VALUED_FUNCTION, TABLE_FUNCTION

    END AS ObjectDescription

    FROM ' + @DatabaseName + '.sys.objects o

    INNER JOIN ' + @DatabaseName + '.sys.sql_modules c

    ON c.object_id = o.object_id

    INNER JOIN ' + @DatabaseName + '.sys.schemas s

    ON o.schema_id = s.schema_id

    WHERE o.type in (''P'', ''FN'', ''IF'', ''TF'')

    ) AS T

    ' +

    CASE WHEN @GroupingType IN ('N', 'T') THEN 'GROUP BY ' ELSE '' END +

    CASE WHEN @GroupingType = 'N' THEN 'T.ObjectName, ' ELSE '' END +

    CASE WHEN @GroupingType IN ('N', 'T') THEN 'T.ObjectDescription' ELSE '' END + '

    ORDER BY 1' + CASE WHEN @GroupingType IN ('N', 'T') THEN ', T.ObjectDescription DESC' ELSE '' END

    + CASE WHEN @GroupingType IN ('N') THEN ', T.ObjectName ASC' ELSE '' END + ';';

    IF @PrintSQL = 1

    PRINT @SQLMessage;

    IF @ExecuteSQL = 1

    EXEC (@SQLMessage);

    END;

    Published Tue, 03 Jan 2012 14:42:00 GMT by Paul.McMillan
  22. Find the Total Lines of T-SQL Code in a SQL Database

    My Project Manager asked me to find out 'How many lines of code have we in the System'. I could not
    believe that no one has ever had to do this before so I googled 'sql server stored procedure number of lines' and found
    the following posting from Gordon Bell (many thanks!) on Stack Overflow in November 2008. See link below

    http://stackoverflow.com/questions/291574/query-to-list-sql-server-stored-procedures-along-with-lines-of-code-for-each-pro

    However, the solution Gordon provided did not allow you to pass in a DatabaseName as a Parameter (and I had to find this
    out for all the databases in a system) - I could have run it in each database individually but I thought I would take
    the base code and allow a DatabaseName to be passed in as a parameter.

    Furthermore, I thought I would update the code to use the latest SQL sys.objects and sys.sql_modules system tables
    rather than older sysobjects ans syscomments system tables.

    Additionally, I thought I would add a Grouping Parameter, so you can return either the

    1) Total Lines of Code for each Stored Procedure and each Function for any Database. GroupingType = 'N' - Default
    2) Total Lines of Code for all Stored Procedures and all Functions for any Database. GroupingType = 'T' - Default
    3) Total Lines of Code for all Stored Procedures and Functions for any Database . GroupingType = 'D'

    Finally as this is written using Dynamic SQL I have a Switches for Print SQL (Debug) and Execute SQL

    Note: The code is not perfect because it counts the number if newlines and you could have a number of these with no text on them and these will be added to the count line total. Therefore you need to eliminate any lines with just whitespace from them to get the "real" line count value. Perhaps I will have a go at doing this in the future.

    The code to run this is below 

    and it is called via 

    EXEC dbo.esp_GetObjectNumberOfRows

    @DatabaseName = 'master',

    @GroupingType = 'N',

    @ExecuteSQL = 1,

    @PrintSQL = 0;

     

    CREATE PROCEDURE dbo.esp_GetObjectNumberOfRows

    (

    @DatabaseName SYSNAME = '',

    @GroupingType NCHAR (1) = 'N', -- N = Object Name, T = Object Type, D = Database

    @ExecuteSQL BIT = 1, -- Default Execute SQL On

    @PrintSQL BIT = 0 -- Default Debug SQL Off

    )

    /*

    Paul McMillan

    EMC Consulting 2012

    My Project Manager asked me to find out 'How many lines of code have we in the System'. I could not

    believe that no one has ever had to do this before so I googled 'sql server stored procedure number of lines' and found

    the following posting from Gordon Bell (many thanks!) on Stack Overflow in November 2008. See link below

    http://stackoverflow.com/questions/291574/query-to-list-sql-server-stored-procedures-along-with-lines-of-code-for-each-pro

    However, the solution Gordon provided did not allow you to pass in a DatabaseName as a Parameter (and I had to find this

    out for all the databases in a system) - I could have run it in each database individually but I thought I would take

    the base code and allow a DatabaseName to be passed in as a parameter.

    Furthermore, I thought I would update the code to use the latest SQL sys.objects and sys.sql_modules system tables

    rather than older sysobjects ans syscomments system tables.

    Additionally, I thought I would add a Grouping Parameter, so you can return either the

    1) Total Lines of Code for each Stored Procedure and each Function for any Database. GroupingType = 'N' - Default

    2) Total Lines of Code for all Stored Procedures and all Functions for any Database. GroupingType = 'T' - Default

    3) Total Lines of Code for all Stored Procedures and Functions for any Database . GroupingType = 'D'

    Finally as this is written using Dynamic SQL I have a Switches for Print SQL (Debug) and Execute SQL

    */

    AS

    BEGIN;

    IF @DatabaseName = ''

    SET @DatabaseName = DB_NAME(); -- Default is current database

    DECLARE @SQLMessage NVARCHAR (MAX);

    -- Testing Code

    --DECLARE @DatabaseName SYSNAME = 'master';

    --DECLARE @GroupingType NCHAR (1) = 'T'; -- N = Object Name, T = Object Type, D = Database

    SET @SQLMessage = '

    SELECT

    ' + NCHAR (39) + @DatabaseName + NCHAR (39) + ' AS DatabaseName,

    ' +

    CASE WHEN @GroupingType = 'N' THEN 'T.ObjectName, ' ELSE '' END +

    CASE WHEN @GroupingType IN ('N', 'T') THEN '

    CASE WHEN T.ObjectDescription = ''Stored Procedure''

    THEN SUM(T.ProcedureCount)

    ELSE SUM(T.FunctionCount)

    END AS ObjectCount,' ELSE 'SUM(T.ProcedureCount) + SUM(T.FunctionCount) AS ObjectCount, ' END +

    CASE WHEN @GroupingType IN ('N', 'T') THEN 'T.ObjectDescription, ' ELSE '' END + '

    SUM(T.LinesOfCode) - 1 AS TotalLinesOfCode

    FROM

    (

    SELECT

    CASE WHEN o.type = ''P'' THEN 1 ELSE 0 END AS ProcedureCount,

    CASE WHEN o.type IN (''FN'', ''IF'', ''TF'') THEN 1 ELSE 0 END AS FunctionCount,

    o.name AS ObjectName,

    (LEN(C.definition) - LEN(REPLACE(C.definition, NCHAR(10), ''''))) AS LinesOfCode,

    CASE WHEN o.type = ''P'' THEN ''Stored Procedure'' -- STORED_PROCEDURE

    WHEN o.type IN (''FN'', ''IF'', ''TF'') THEN ''Function'' -- SQL_SCALAR_FUNCTION, SQL_INLINE_TABLE_VALUED_FUNCTION, TABLE_FUNCTION

    END AS ObjectDescription

    FROM ' + @DatabaseName + '.sys.objects o

    INNER JOIN ' + @DatabaseName + '.sys.sql_modules c

    ON c.object_id = o.object_id

    WHERE o.type in (''P'', ''FN'', ''IF'', ''TF'')

    ) AS T

    ' +

    CASE WHEN @GroupingType IN ('N', 'T') THEN 'GROUP BY ' ELSE '' END +

    CASE WHEN @GroupingType = 'N' THEN 'T.ObjectName, ' ELSE '' END +

    CASE WHEN @GroupingType IN ('N', 'T') THEN 'T.ObjectDescription' ELSE '' END + '

    ORDER BY 1' + CASE WHEN @GroupingType IN ('N', 'T') THEN ', T.ObjectDescription DESC' ELSE '' END

    + CASE WHEN @GroupingType IN ('N') THEN ', T.ObjectName ASC' ELSE '' END + ';';

    IF @PrintSQL = 1

    PRINT @SQLMessage;

    IF @ExecuteSQL = 1

    EXEC (@SQLMessage);

    END;

    Published Tue, 03 Jan 2012 12:06:00 GMT by Paul.McMillan
  23. On Building a Custom Service Application for SharePoint 2010 - Part 7: Better Engineering with Proxy Classes

     

    By post 6 we managed to construct an operational service application with a minimum of code that could actually do something useful. However, its worth noting that it has some big drawbacks compared to a more professional rendition of the same. The following is a short list (the list is actually much longer) of items we will refactor for the purpose of raising our application to an acceptable level of engineering.

    1. Service application clients should not bind directly to any instance of a service application. Why? Because multiple instances of a service application can exist within the farm and each one may have a different set of user managed configurations. Also, a single application instance will be running on a specific farm server thus defeating SharePoint’s built-in load balancing. Finally, given the last two points its now very clear that the following code (from the last post) only assumes the First known instance is the one we need DemoServiceApplication app = service.Applications.Cast<DemoServiceApplication>().First();  Not good.

    2. We also must be able to configure what “proxy group” the service application belongs to relative to an existing SharePoint web application. This is one of the major strengths of service applications. That is, the ability to group services anyway you wish and have them applied to specific web applications. This is also a great idea for multitenant hosting scenarios. 

    image

    PS: Don’t confuse a programmatic proxy (as in SOAP or WCF) with the proxy I’m discussing here. The above image shows a proxy group which is a purely “logical” grouping that really just borrows the word “proxy” as a descriptive name only – this is an administrative configuration and one of the principle advancements in Service Applications. 

    3. The code presented so far only assumes a single instance of the service application (maybe, but its actually worse) will be available on a single server – remember that SPServiceInstance provides you the On/Off ability on a per-server basis (see the next image)

    image

    In our current solution this is represented by the DemoServiceInstance class located in the SPServiceInstance.cs file 

    image 

    Instance Bait and Switch

    Let’s begin with the last point concerning DemoServiceInstance.

    The CreateDemoService.cs file from the solution is the ONLY bit of code that references DemoServiceInstance and that code DOES NOT actually create an instance of the Service – in fact we could comment out this code and it would have no effect on the operation of the Service Application! The following snippet was taken from Andrew Connells SA sample code http://msdn.microsoft.com/en-us/library/gg543112.aspx – we now remove it as it doing nothing in our demo sample.

    image

    We can also remove the SPServiceInstance class itself and still no impact on the service application is felt. The below image shows the SPServiceClass being removed.

    image

    It turns out the service still works !……but why is the service still functioning? Because, as you recall from Part 6 the client web part is concretely binding directly to the DemoServiceApplication we created when adding a new SPServiceApplication instance. In our case we call DemoServiceApplication.Create (shown in the image as part of CreateDemoService.aspx / .cs). The client web part only needs to grab a reference to the service application using code similar to what we have shown a number of times, that is service.Applications.Cast<DemoServiceApplication>().First();

    The upshot of this bad code is that we have completely circumvented the ability to have multiple servers handling service application requests redundantly in the farm environment.  All requests are just routed to the same instance of the Service Application. So lets reverse course just a little and follow these next few steps to remedy the situation. The following steps ultimately enables our ability to activate a particular service on a particular server.

    1. Let’s leave Andrew’s code out of the Create page for now

    2. Add back the SPServiceInstance class

    3. Add a Create method for the SPServiceInstance class that we can use to setup multiple instances as needed

    4. In the farm feature for the solution lets be sure we have one instance setup per server (which means we need to iterate through all farm servers to add the SPServiceInstance object).

    Lets add the create method to DemoServiceInstance.   

    image

    Next, on activation add an instance of the service application to each server in the farm from our Feature. In the interest of “full disclosure” I’m developing on a single server VM and have not tested this code (our “non-WCF” demo service application) on a multi-server farm (yet)

    image

    That’s pretty much it for this class in general. Done and done. The rest of the plumbing takes place pretty much behind the scenes and you need not do anything further for now.

    Our next issue (actually the first major point of this blog) is what to do about the concrete binding situation – this is the most critical problem we have at this point and it should be corrected. What we actually need is a way for our client to call back to our service application in a way that separates where the service application actually executes.  The actual SPServiceApplication instance used need not be known to the client – and -- the client should have no clue what server is actually handling the method request. This is where we introduce proxy classes. Proxy classes are client side classes that act as the go-between from the client to the server side instances.

    The two important classes in this regard are SPServiceProxy and SPServiceApplicationProxy. These classes have a relationship that mirrors the relationship that SPService and SPServiceApplication have.

    SPServiceProxy is rather trivial so I will simply add it to our solution. Here is the only code we need to include for now

    image

    I would only point out the decoration called SupportedServiceApplication as having the same Guid as our custom SPServiceApplication called DemoServiceApplication as shown here beginning with “048DC….” below is the original DemoSerivceApplication from previous posts. More on that at a later time.

    image

    Of course the important class is DemoServiceApplication but now we need to include its “client side equivalent” to minimize the coupling between client and server. Our next class will be called DemoApplicationProxy and  from this point forward the rubber really starts hitting the road. So lets see what our solution looks like now

    image

    We can start building out the contents of SPServiceApplicationProxy.cs as follows (same drill as before)

    image

    We also need to wire this up properly to the solution so it can be properly created. Remember, this is a client class and therefore should be instantiated at the same time we create the service application (NOT WHEN DEPLOYING VIA A FEATURE). This class creation is administrator controlled. As such, we add the creation of this class to the CreateDemoService.cs code behind for our create page we defined in a previous post and looks (now) as follows

    image

    This post is now long enough – we have added the last two major classes for this “non-WCF” version of a service application. In the next post I will finish up a few loose ends and demo once again. Lots more to go Smile

    Cheers!

    Published Tue, 03 Jan 2012 03:38:22 GMT by Scott.Currier
  24. On Building a Custom Service Application for SharePoint 2010 - Part 6: Adding Business Logic and Client

    Its time we put our little Service Application to work doing something useful. For this post we have a couple of considerations

    1. What will be the client that consumes the Service Application and how?
    2. Should our business logic be self contained or depend on external data sources?

    In the case of MS Project Server, for example, all the logic is self contained within SharePoint. For service applications like Search, User Profiles, and other related services they can utilize or actually rely on external connectivity and data.

    From the perspective of a client (and this series) I will utilize a visual web part as this will visually indicate our service is working properly. I’ll make one important note in this regard. Client COULD mean ANYTHING that consumes a service application. Not only web parts but other services, scripts, forms, etc. It all depends of course on how the service application requirements are defined. Once you are past the basics then “how” a service application interacts will depend totally on you.

    Lets add a visual web part project as our client as shown in the next image

    image  

    I also need to work up some business logic that shows off our service application – lets hold on that thought for a bit. Instead, lets decide what to demo based on the data we consume. For that I decided to try external data via a public service. So for this service application I chose a Bing API for searches.

    This will be a working, yet, totally contrived solution – for one thing an API can be consumed directly by a web part – for this demo we will pretend our service application will act as a go-between with the external data and our client (say because of some business logic the service application applies to the data). The other immediate issue in this scenario is that our service application instance can be disabled on a site but the client web part could still be added to a page – not so good. I will eventually refine and refactor the solution in a later post to help clarify the logic for this demo.

    Anyway, lets continue and add a SOAP client to the web application pointing at BING. The solution now looks as follows.

    image

    The next question is what the code will look like that binds the data from the service application to our web part client. Lets begin with adding our business logic to SPDemoApplication.cs and looks as follows

    image

    At the bottom you can see the GetSearchResults (this code is a proxy to the BING API) and pulls back search results into our service application. The code (up close) is as follows:

    image

    Where request.AppId is my application Id allocated to the Bing API. Of course this is located within the DemoServiceApplication class. Next, we need to expose the results to our web part. At this point we use a little trick to concretely bind the data (and is not a recommended strategy). The code here is mainly to show you the ideas. In the client web part we assume a few things and use the following lines to expose the search method required.

    In the page load of the visual web part we place this code to bind the data to the service application.

    DemoService service = SPFarm.Local.GetChild<DemoService>();
    DemoServiceApplication app = service.Applications.Cast<DemoServiceApplication>().First(); // <== see http://woutersdemos.codeplex.com/
    List<VideoResult> results = app.GetSearchResults("SharePoint"); // <== lets hardcode a search term, “SharePoint” !

    Not great but it truly works – also, several variations of this style of binding is possible. In the following posts I’ll discuss a much better way to accomplish this without resorting to tricks. Here is more of the web part code page behind

    image

    The visual web part we created also contains a repeater control to display the search results.

    image

    To recap, our solution deploys our demo service application, a client web part (as shown above) and a proxy server that connects back to the Bing API. Lets first test by making sure NO service application is configured. We go into central administration and delete any instance of the demo application.

    image

    Now, no service application instance is defined per the above image. Next, we add our web part client to a test page by first activating the client feature.  We then create a web part page (I won’t bore you with that process)

    image

    Next we add the web part to our Sample.aspx page and watch it fail Smile as expected

    image

    Ok, lets now go into central administration and properly create a new instance of the service application.

    image

    and

    image

    Ok, the BIG moment – lets go back into our web part page and see if things are working properly.

    image

     

    As you can see we’ve proven that we now have connectivity with our service application. We are starting to close in on a fully operational system but unfortunately we are not even halfway home as yet.

    Now that we have the basics under our belts I’ll perform another refactor and generally clean up the application so we are ready for a finished product.

    Cheers!

    Published Mon, 02 Jan 2012 07:27:42 GMT by Scott.Currier
  25. On Building a Custom Service Application for SharePoint 2010 - Part 5: Adding Administrative Code

    This post picks up from post 3 in this series. In this post I’ll refactor our solution to include creating an instance of the service application (and a user selected name) from a “create page” in central administration. 

    I begin by refactoring our create page, now called CreateDemoService.aspx with its code behind called CreateDemoService.cs as shown in our updated solution.

    image

    From the installment post 3 we updated our SPService called DemoService with the IServiceAdminitration interface

    image

    By adding the IServiceAdminitration to DemoService we can link our CreateDemoService.aspx page to our service application. We are also required to implement the additional interface methods as shown in the above image – but we will not do anything with them at the moment. By the way, if you look back at the solution you will note that DemoService is located in the SPService.cs file.

    Its important to understand the order of events (so far) in provisioning our “do nothing” service application.

    The first thing that happens after the solution is installed in the farm is that we activate the Feature associated with DemoService as shown in Part 3 as

    image

    When this feature is activated the DemoService is “officially” installed. Now, we have not yet provisioned the “Application” portion of the service. This is the business end of the Service Application and is represented by the SPServiceApplication.cs file in the solution above and contains the following code.

    image

    Note that the code above does very little other than create a DemoServiceApplication (and later will contain our business logic). To have DemoServiceApplication provisioned we expect the user to actually initiate that process via the CreateDemoService.aspx page

    The code used to initialize DemoServiceApplication is rather straight forward

    // get reference to the installed service (installed from feature activation)
    DemoService service = SPFarm.Local.Services.GetValue<DemoService>();

    // create demoservice app
    DemoServiceApplication DemoApp = DemoServiceApplication.Create(title, service);
    DemoApp.Update();
    DemoApp.Provision();

    Also, the actual “title” passed in will be the displayed title for the user when an instance of the service is created.

    We also have one last thing to consider for this installment – that is we need this service running as an instance on particular servers.  An administrator has the option to select what services are running on particular servers. In our case we will not flesh this out in its entirety but know that we will want to add back a class that represents this instance on the server (looking at the solution above this is represented by SPServiceInstance.cs and contains the following code (you’ve seen before) slightly refactored.

    image

    For now we will not stress how this service is “wired” with the rest of the Service Application and will reserve that discussion for a later post.

    The important aspect is that these classes come together in SPServiceInstance.cs for final provision using the code below

    image

    The following is what this application now looks like from the point of view in Central Administration

    First,

    image

    image

    The above looks like post 3 but the main difference is that we can properly name and instance our service application on the server

    Next, is the image of what this looks like (and will be familiar)

    image

    Finally,

    image

    Although this bare bones application is close to posts 2 & 3, its now refactored with the bits and pieces in the correct locations plus the added ability to select a custom name for the service instance. In the next post we will continue to build this out

    Cheers!

    Published Mon, 02 Jan 2012 02:50:51 GMT by Scott.Currier
Print