Archives

Archives / 2008 / November
  • Announcing: ChartPart for SharePoint

    Tags: SharePoint

    ChartPart for SharePoint ChartPart for SharePoint is a new Web Part for Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 that allows you to create graphs and charts from existing lists in SharePoint in a very easy way.

    ChartPart for SharePoint

    The ChartPart for SharePoint is developed using Microsoft .NET Framework 3.5 SP1 and the Microsoft Chart Controls for Microsoft.NET Framework, which means that there is no need for any third party licenses to create the charts (read Dundas or similar).

    ChartPart for SharePoint is a simple web part that you install on your SharePoint servers and then you can add it to any web part zone or page and edit the web part. The ChartPart provides an intuitive interface to select the list you are interested in making a chart from and then narrow down your value selection by selecting a view and then select the X-axis and Y-axis values.

    Other features of the ChartPart are the possibility to select graph type, select colors, show legends and more, read more at the Codeplex site.

    The ChartPart for SharePoint is now available for download on Codeplex at http://www.codeplex.com/ChartPart/ so the best way to learn how to use it is to download it and install it. Report any anomalies and I will try to get them fixed as soon as possible. I have already some plans for future releases until I/we have a final version 1.0. Ideas and suggestions are welcome and please leave me a note if you use it or make any derivative of it.

    Technorati tags: , , , ,

  • Live Mesh, Skydrive and Office Live

    Tags: Microsoft Office, Windows Live

    Microsoft is currently extremely offensive on their new cloud services targeted to consumers and business users with their Live services. I use a number of them daily with the Live Mesh as the newest addition.

    A couple of months back I started to move my and my family's documents to Skydrive, 5Gb free online storage, and I’ve made some efforts to get started with the Office Live Workspace, to have a better place work working with the documents. Then Live Mesh came into the picture, and it lets me automatically sync documents between our PC’s and cell phones – really awesome!

    All of these three services are really good, but currently none of them is perfect, and the problem is that they do not work together at all. Below is a comparison of some of the features. All three services can be accessed from a standard browser and has features for sharing files and documents with other people.

      Live Mesh Skydrive  Office Live
      Live Mesh Skydrive Office Live Workspace
    Storage Space 5Gb 5Gb (25Gb announced) 500Mb
    API (i.e. programmable) Yes No No
    Synchronization with workstations Yes No No
    Calendars No* No* Yes
    Custom lists No No Yes
    Remote Desktop access Yes No No**
    Office integration No*** No Yes (plugin)
    Mobile devices support Yes**** No No
    Office Live applications integration No Yes***** No
    Office file previews No No Yes
    Office Live 14 support ****** No No Yes

    * You have the feature in other Windows Live applications ** SharedView is used instead *** If the folder is synchronized with the local PC, then an update to the Office document is synced into the Mesh instantly **** Currently in a limited closed beta **** Integration with Office Live Photo Gallery announced ****** Currently not available

    As you can see there are several features that do not overlap.

    What I would like to see is some kind of merge or collaboration between of these three services.

    Imagine having 25Gb online storage of which you can have parts synchronized with different machines and full integration with the Microsoft Office suite (or other Office-like suites for that matter).

    I did pop this question to one of the Microsofties at the Live booth at the PDC a few weeks ago, and the reply was that there were no plans of this. I think this is really bad. Yes I understand that they are three different services but I think that the underlying storage should be the same and that some of (if not all) the features above should be available in all three of them. If it would become true, this would truly be a powerful service that no one can neglect to use.

    Then just add some subscription to this and let’s say that you can have 100Gb online storage, then I would for sure place all my data and images up there in the cloud.

    Do you use any of these services and what do you think?

  • BreakRoleInheritance and AllowUnsafeUpdates

    Tags: SharePoint

    I have just struggled a while with a SharePoint Web Part that constantly threw an error, see below. This Web Part is creating a SharePoint list when it is first loaded by a user and it should create a list with permissions so that only the user has access to it (i.e. a personal list). This is done by breaking the role inheritance of the list using BreakRoleInheritance(false), so that no inherited roles are copied. I’ve used the method for this previously in the solution, but then this was done on a POST request and now it should do almost the same during a GET request, that is when the user navigates to the page.

    All this is done under elevated privileges and looks something like this

    SPSecurity.RunWithElevatedPrivileges(delegate() {
      using (SPSite site = new SPSite(url)) {
        using (SPWeb web = site.OpenWeb(url.Replace(site.Url, string.Empty))) {
          web.AllowUnsafeUpdates = true;
          Guid guid = web.Lists.Add(name, string.Empty, SPListTemplateType.DocumentLibrary);
          SPList list = web.Lists[guid];
          ...
          list.BreakRoleInheritance(false);
          ...
          list.Update();
        }
      }
    });

    This gives me the following error when running during a GET request.

    "Updates are currently disallowed on GET requests.  To allow updates on a GET, set the 'AllowUnsafeUpdates' property on SPWeb."

    If I rewrite the code and change the BreakRoleInheritance(false) to BreakRoleInheritance(true)  and set the AllowUnsafeUpdates to true once again it works fine and I have to manually get rid of all the roles.

    Why is it so?

    If you step through the code in the working sample you will see that after the BreakRoleInheritance(true) line the AllowUnsafeUpdates property of the SPWeb object has changed to false. The AllowUnsafeUpdates property will reset to false whenever any ISecurable object changes their role definitions, and in the BreakRoleInheritance method you have a call to an internal function that invalidates the SPWeb object which resets the AllowUnsafeUpdate property.

    The exception is then thrown after breaking the role inheritance and when the method tries to remove the roles from the list. I initially thought that it was the other way around and therefore was a bit confused.

    So the correct way is this:

    SPSecurity.RunWithElevatedPrivileges(delegate() {
      using (SPSite site = new SPSite(url)) {
        using (SPWeb web = site.OpenWeb(url.Replace(site.Url, string.Empty))) {
          web.AllowUnsafeUpdates = true;
          Guid guid = web.Lists.Add(name, string.Empty, SPListTemplateType.DocumentLibrary);
          SPList list = web.Lists[guid];
          ...
          list.BreakRoleInheritance(true);
          web.AllowUnsafeUpdates = true;
          // remove roles manually
          ...
          list.Update();
        }
      }
    }};

    Happy programming…

    Note: there is a reason why this is implemented in this way, to prevent cross-site-scripting attacks, if you are unsure about what you are doing you should consider an alternate way of solving your problem.

  • Windows Search Index Tool - updated

    Tags: Windows Vista, Software

    I made some updates to my Windows Search Index Tool so it also displays all the inclusion and exclusion rules and even functionality for adding and removing rules. So now you can easily exclude folders by creating a rule like this:

    On the Rules tab, click on the Add button. The button should only be enabled if you are running in elevated privileges on Vista. Enter the pattern, like the image shows and choose if it is an inclusion or exclusion rule and hit Add.

    Add new rule

    Note: Only do this if you are sure on what you are doing!

    You can download the Windows Search Index Tool here. Update: link is now correct

  • About SharePoint 14

    Tags: SharePoint

    SharePoint 14 is the next version of Microsoft SharePoint and during the PDC 2008  nothing new was revealed about SharePoint 14, but some small parts of the Office 14 clients were seen. SharePoint 14 will, most certainly, be released at the same time as Office 14 which most probably will be released when Windows 7 is released. My guess is that this point in time is in about a year.

    Windows 7 will pretty soon hit the beta stage, pre-beta bits are already out, and the Office 14 and SharePoint 14 products must enter the beta stage in the near future, to be able to have a release within a year or so. Closed or open beta remains to be determined.

    I have done some thinking about what will SharePoint 14 contain for the world to embrace, and I thought that I should write them down (so I later can see how right or wrong I am). Some of you out there have maybe seen the pre-beta bits of SharePoint 14 so please correct me if I’m wrong…

    Probable changes

    Here are the stuff that I think will most probably be in SharePoint 14, not listed in any special order:

    • A web standards compliant user interface – The web user interface will support the web standards
    • Non-table driven interface – The user interface is not solely based on a table-driven design, but rather a more simple approach using DIVs, which makes it more customizable
    • AJAX based interface – this is one thing that I’m rather confident about being updated
    • .NET 4 based – SharePoint will use the .NET Framework 4. This will also give support for the new WF stuff.
    • No changes to the WebPart classes – I have not seen any changes in the WebPart classes in the .NET 4 beta framework. Making changes to these parts would break current existing SharePoint applications.
    • Developer tools – the Visual Studio extensions for SharePoint will go to version 2 and finally be useful
    • An STSADM GUI – a more user friendly way to work with SharePoint administration. STSADM will still be there for sure, but a user interface (web based or not) that makes it more easy to manage features will probably be there.
    • Licensing – I would not be surprised if we get a new SharePoint edition, such as a SharePoint Publishing Edition, that has a better price level if you just want to use the publishing features of MOSS.
    • Excel Services - MOSS 2007 contained the first version of Excel Services and version 2 will most probably have some really nice enhancements that make Excel Services even more powerful.
    • API changes – the API’s will not change so much that it breaks current applications but rather have some fixes that makes it even better and easier to program against. See my previous post on this.
    • Social Networking and Enterprise 2.0 – the social networking pieces will be taken to another level. What happened to Townsquare?
    • Groove – Groove and SharePoint will now be fully integrated
    • 64-bit only – SharePoint will only be available on 64-bit platforms
    • Other stuff
      • Option to customize the application.master in a better way
      • Tight integration with the new Office Live products
      • FAST Search features out of the box
      • Document standard support: ODF, OOXML, PDF, all ISO approved document formats
      • Silverlight everywhere!

    Changes/features I would like to see

    Here are some other changes or features that would make me happy:

    • Claims based authentication. Easy configuration to use the Geneva Server and Framework for authentication
    • Based on the MVC framework – if this was the case then no one would be happier than me!
    • Installation possible on workstation OS (Vista and Windows 7)
    • Return of the Office to HTML renderer. The download has disappeared from Microsoft download but my guess is that this one will return.

    Of course there are many, many more features that I would like to see…

    What’s your take?

    NOTE: This is just my guesses, so don’t accuse me if the stuff above is not present in the upcoming version…

  • Introducing Windows Search Index Tool

    Tags: Windows Vista

    Windows Search is a great for indexing your files and is included in Windows Vista by default (version 3). Version 4 is available for download from the Microsoft site.

    I recently had some problems when my index suddenly was corrupt and I had to restart indexing all files, which takes a long time if you are using your computer and do not want it to interfere with your work. Somehow it started working again but I have not been able to get it to index up all my files, there are always files left to index.

    To find out what’s going on and why it sometimes takes so long to index files I whipped up a small tool to help me out in my investigations, which I now I’m happy to share. I still have to do some investigation on why I still have a lot of files that don’t index and it looks like it is the Internet Explorer history, which of course changes all the time…

    Anyway, here is the tool for you to grab, just download the ZIP file and unpack it and run.

    The tool will show you your current Windows Search status and how many files there are in the index as well as how many that there are left. To see what’s currently indexing you have to run the program under elevated privileges or click the Elevate button (on Vista only).

    Windows Search Index Tool Windows Search Index Tool Windows Search Index Tool
    The tool displaying that the index is paused due to low battery The index tool shows that a full crawl is done, but the current indexed file is not shown The current file being indexed is shown after the Elevate button is pressed

    The tool also shows you what your current scopes are. You have to option to select a file and verify that it is in the index, and it will also show you why it’s indexed.

    Hope you like it and please share your comments…

    Note: I have not tested this anymore than on my Vista SP1 machine running Windows Search 4 and I do not guarantee anything…

About Wictor...

Wictor Wilén is a Director and SharePoint Architect working at Connecta AB. Wictor has achieved the Microsoft Certified Architect (MCA) - SharePoint 2010, Microsoft Certified Solutions Master (MCSM) - SharePoint  and Microsoft Certified Master (MCM) - SharePoint 2010 certifications. He has also been awarded Microsoft Most Valuable Professional (MVP) for four consecutive years.

And a word from our sponsors...

SharePoint 2010 Web Parts in Action