Monday, February 18, 2013

SharePoint 2013 App Part scrollbars

I had this problem the other day with no scrollbar showing up when the content of my App Part was larger than the iframe.

It turned out to be the /_layouts/15/1033/styles/themable/corev15.css that was the reason. This file is included on my App Part aspx page, in order to get the same style as the rest of the site.

The simple solution to the problem was just to add a style tag with overflow to the body tag on the App Part aspx page.

<body style="overflow:auto;">

Result:

image

If you wanner resize from your iframed page, its possible by use of the postMessage command.

Found on the forum posted by Yina Arenas

<script type="text/javascript">

    window.onload = function () {

        var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);

        var regex = new RegExp(/[Ss]ender[Ii]d=([\daAbBcCdDeEfF]+)/);

        results = regex.exec(this.location.search);

        if (null != results && null != results[1]) {

            target.postMessage('<message senderId=' + results[1] + '>resize(500,200)</message>', '*');

        }

    }

</script>

Futher more Richard diZerega has written this very good blog post on Optimizing User Experience of Apps for SharePoint 2013

Wednesday, February 13, 2013

FullControl is not allowed in apps on the SharePoint 2013 App Store.

When building an app for SharePoint App Store, the FullControl permission is not allowed. This was not easy to find and is very well “hidden” in the documentation on permissions. However building local deployed apps the FullControl permission is allowed.
To quote Microsoft: Only Read, Write, and Manage rights are allowed for Office Store apps. If you try to submit an app to the Office Store that requires FullControl rights, your app is blocked from submission.
http://msdn.microsoft.com/en-us/library/fp142383.aspx#Perm_rightlist

Thursday, January 17, 2013

_api JSON Viewer

Update: Version 2 is now available on the Office App Atore.

My first SharePoint 2013 app develop togetter with Anders Dissing has just been released on the SharePoint 2013 app store.
 _api JSON Viewer
One of the first things you wish for when working with SharePoint 2013 REST api, is a way to display the raw data, so you know what you have to work with. The _api JSON Viewer app is the tool that does exactly that, with a very user-friendly display and simple functionality. It even allows you to view JSON data across the site collection and every apps. This is a must have app for anyone working with the SharePoint 2013 REST api.
ScreenShot1
It’s a free app, so go and get it.

Thursday, November 08, 2012

WebpartToolPart category "Appearance" expanded by default - How to revert this ?

I had this problem myself the other day and it seems that all the solutions I found where mostly javascript based. But this is not a good solution in my mind, therefore I did some reflection and came up with this solution, all server side.

public override ToolPart[] GetToolParts()
{

var list = new List<ToolPart>(base.GetToolParts());

foreach (var wptp in list.OfType<WebPartToolPart>())
{
HideExpandIndexes(wptp);
}

return list.ToArray();
}


private void HideExpandIndexes(WebPartToolPart part)
{

var field_helper = part.GetType().GetField("_helper", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
var _helper = field_helper.GetValue(part);

var field_expandIndexes = _helper.GetType().BaseType.GetField("_expandIndexes", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
var _expandIndexes = field_expandIndexes.GetValue(_helper);

var field_items = _expandIndexes.GetType().GetField("_items", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
var _items = (Hashtable)field_items.GetValue(_expandIndexes);

_items.Clear();
}





The code can be improved to a finer detail, but it solves the problem for the moment.

Tuesday, November 06, 2012

SharePoint Manager 2013 (ver: 1.0.12.1106) released

SharePoint Manager 2013 (ver: 1.0.12.1106) is now out of beta and official released for SharePoint 2013 RTM. http://spm.codeplex.com/releases/view/97332

The new version has an expanded view of the SharePoint object model and has been tested on SharePoint 2013 RTM.

As a bonus, the new SharePoint Manager 2013 (ver: 1.0.12.1106) is also available for SharePoint 2010 as a separate download.

Saturday, October 13, 2012

SharePoint Manager 2013 Beta 2

Finally I have been able to release a new version of SPM2013, its has not been easy because of the new node system for the SharePoint object model viewer.

Get it here! SharePoint Manager 2013 beta 2

Previously I was working on SharePoint Manager 2010 v2 Alpha, but it has stopped. The reasons was that first of all it was based on WPF GUI and not WinForms. That should have been cool, but it ended up taking a lot of my time, and not focusing on the application. Further more I did not like the feel of the SPM2010 v2 Alpha, because the PropertyGrid component had to be imbedded into the WPF app as a native winform control and the performance of this is not very good. So all in all I decided to scrap the v2 Alpha version and use some of the code in the SPM2013 beta 2 project, specially the node object model classes.

So what's new in the beta 2?

Splash Screen with validation rules

SplashScreen SPM2013 Preflight check

The splash screen has now been fitted with some validation rules to ensure that you are able to run the application. It should help people telling them that they do not have SharePoint installed or do not have admin rights and so on.

 

Full blown object model

Full blown node model was a legacy from the SharePoint Manager 2010 v2 Alpha project where nearly all SharePoint objects are represented by a new node model. This was however a much large task getting done than first anticipated and took a lot work to get right. To see the full node model in function, select the menu: “View” –> “Object Model” –> “Full”.

ViewFull SPM2013Beta2

The Medium model view is as close to the Beta 1 application as possible.

 

Base on Managed Extensibility Framework (MEF)

The application makes full use of the MEF framework from Microsoft. This will make it very easy for others to extended on the application. The node system fully supports the MEF framework and therefore it will be easy to create separate dll that extends the model without having to recompile the SPM application.

Faster and fewer bugs.

Because of the new node model, some nodes loads faster now and are able to hold correct focus when refreshing the model. The beta 2 will now only open up one site collection in order to save time and memory. Many of the old bugs from beta 1 has now been done in beta 2, some just disappeared because of change of code.

 

Enjoy!

Carsten Keutmann

Thursday, March 01, 2012

Arctic SharePoint Challenge 2012

I’m very happy to announce that I will be a jury member on the Arctic SharePoint Challenge this year. (Spinning of the March 22-24th) I think its going to be a blast and a lot of fun Smiley med åben mund

What is the ASPC2012? …

#ASPC​ aims to stimulate collaborative learning, networking and idea generation for participants through hands-on time-limited challenges. We are fiercely competitive, but vastly helpful and extremely sharing (also across teams) realizing that the collective learning is more important than personal gain!

We are working on the optimal formula for 2012, so the rules are still not forged in stone, but expect something similar to last year, only better/more fun/more awesome.

I’ll also be doing some sessions on Advanced SharePoint Caching for developers, SharePoint Patterns and Practices Guidance and MVP pattern for SharePoint Web-parts.

Wednesday, January 25, 2012

Using the MVP pattern for SharePoint Web Parts Presentation

I did a webcast presentation for Adelaide SharePoint User Group this Tuesday. However no recording was made, therefore only the PowerPoint and Demo code is available here: MVPPresentation.zip

MVPDiagram

MVP Pattern rocks for SharePoint!

Thursday, July 14, 2011

Push changes from the SharePoint Content hub to a SiteCollection

When working with the Content hub, you may need the content type you just added to the hub, to be pushed out to a specific site collection immediately. This can be done by activating the timer jobs specified here, or you can just force an activation of the Feature “TaxonomyFieldAdded” on the target SiteCollection.

The TaxonomyFieldAdded feature is a site scoped and hidden feature, its job is to enable the site as Content hub receiver and sync up with the hub immediately. Therefore a reactivation of the feature will get the latest changes from the Content hub, and do not take a lot of time waiting for the timer jobs to finish.

PowerShell:

Enable-SPFeature "TaxonomyFieldAdded" -url "http://mydomain/mySiteCollection/" –force

Code: C#

//The FeatureDefinition id of “TaxonomyFieldAdded” is "73ef14b1-13a9-416b-a9b5-ececa2b0604c". The last “true” is for “Force” feature activation.

site.Features.Add(
new Guid("73ef14b1-13a9-416b-a9b5-ececa2b0604c"), true);

 

So this enables the scenario where you can create a Site Feature Receiver that will publish a content type on the content hub, then force the sync to the local site collection and create a list that uses the content type. All within the same receiver and only takes a couple of seconds to execute.

Monday, May 02, 2011

My Presentation at SharePoint Saturday in Copenhagen (April 30 / 2011)

I did a presentation on SharePoint Enterprise Development with lots of code in it.

For anyone that wants the presentation, you can download it from here code.zip

The zip file contains the PowerPoint presentation and demo code.

Thank you all for a fantastic SharePoint Saturday in Copenhagen.

Saturday, January 22, 2011

SharePoint Manager 2010 v2 in development

I’m currently working on a new version (Alpha) of the SharePoint Manager 2010 application. This new version will be a much more complete view of the SharePoint object model with data. It is based the look and feel of the “old” version, but done with WPF instead of the GDI+ windows form of the old version.

image

Because the old version of SPM was done in a rater unplanned manner, the code ended up being a mess and making it harder to update and create new functionality. Therefore I decided to create a new version from the bottom up and do things right from the beginning. This means that the new version supports the MEF (Managed Extensibility Framework 3.5)  technology from Microsoft. Other applications that supports MEF is Visual Studio 2010 and MEF was included into .NET 4.0, so that shows that the technology is here to stay. MEF is implemented into the core of SPM2010 v2 and therefore enables anyone replace or hook into anything in the application, by just providing there own DLL.  The idea is that this application should be the base for a hole range of tools and functions, that seems as natural part of the application, but is actually just “Add-ins” DLL’s located i the application folder.

Some of the new features of the v2 will be.

  • MEF support for extensibility.
  • Hugh increase of SharePoint objects displayed.
  • WPF
  • Splash screen.
  • Check for SharePoint and user rights on start up.
  • Improved Xml text editor with color coding.
  • A dynamic Settings system.

Things that should have been so good, turns out to the worse.

WPF is the new presentation framework from Microsoft that will replace the old GDI+ forms technology. This also seems very promising when working directly on the machine, everything still feels quick and snappy. But when using the WPF over a Remote Desktop (RD) the app can slow down because of RD’s lack of support for WPF. Basically RD just transfers the raw bit map when working with WPF where GDI+ is lot faster. Also a major component of SPM2 is the PropertyGrid control that is missing from WPF library and forcing me to include the “old” GDI+ PropertyGrid component into the WPF application, this also slows things down, but on the plus side, at least I known that the PropertyGrid works properly.

Join the project team?

The idea of the application is just to provide the basic framework and extend it from there on. Therefore the core team will be kept small, however because of the MEF system, it will be possible to include team members that will provide there own contribution in form of their own DLLs thereby not conflicting with anyone else in the development process.

So if you like to help out please notify me carsten@keutmann.dk

Documentation for extending the application
This is always the most funny part of a project so I love to save it for the last thing I do. Smiley, der blinker
Really… there will be some documentation on how to extend the application and some Visual Studio demo projects and so on, more to come.

Download

You can find the new version here!

Monday, April 19, 2010

WSPBuilder systems compatibility

The following table show the compatibility with different systems. The WSPBuilder is a normal console application build in c# .NET. The WSPBuilder Extensions is addon made for Visual Studio, but its still the same console application running in the background when building from Visual Studio.

System WSPBuilder 0.9.9.0728 WSPBuilder 2010*
.NET 2.0 Yes Yes
x32 bit Yes Yes
x64 bit Yes Yes
All versions of Windows with .NET installed Yes Yes
Visual Studio 2005 Yes Yes
Visual Studio 2008 Yes Yes
Visual Studio 2010 No Yes
SharePoint 2007 Yes Yes
SharePoint 2010 No Yes

* Note: WSPBuilder 2010 may still be in beta.

WSPBuilder 2010 supports all the same systems as the previous WSPBuilder versions, so you can use it for building SharePoint 2007 (Wss 3.0) solutions without any problems.

Extract WSP packages with WSPBuilder

It is possible to extract (unpack) the contents of a WSP package into the file system with use of WSPBuilder. This function currently only supports a full extract of everything, so you have to pick what you need afterwards. The command syntax is:

WSPBuilder.exe -o extractwsp
-Filename : (Optional) Define the WSP file to extract. Default is the last created WSP file from the current directory.
-TargetPath : (Optional) Defines the target path to extract the wsp file in. Default is the current directory.
-Overwrite : (Optional) Overwrite existing files.

Example:

WSPBuilder.exe –o extractwsp –filename mypackage.wsp –overwrite true

Warning! I have not fully tested the ExtractWSP functionality in every possible scenario, so please understand.

The function is supported from WSPBuilder version 0.9.9.0728 and forward, including the WSPBuilder 2010 versions.

Sunday, April 18, 2010

Project structure for SharePoint

I made a suggestion on how to create a SharePoint project structure in my "SharePoint Development" presentation at Microsoft Copenhagen back in January, but there is no documentation on it in the PowerPoint presentation.

http://www.keutmann.dk/sharepointblog/SharepointDevelopment.zip

In my experience, I find that keeping the number of WSP packages down to a minimum is the easiest thing to managed. Therefore I put all my SharePoint artifacts in one project. Some large SharePoint solutions may require more than one WSP package, but generally not many. I also separate the business logic from the SharePoint project, so it will not be GUI dependent. I use this structure as a general template whenever I create a new Visual Studio solution.

MyCompany.Framework
This project is not specific per solution, but can be used as a library across multiple solutions. This project do not contain any business or SharePoint logic, only clean .NET code. I usually create a lot of.NET Extensions in this project.

MyCompany.SharePoint.Framework
This project is for generally SharePoint related extensions and is still generic across multiple solutions. A lot of .NET SharePoint Extensions is added to this project.

MyCompany.BusinessModel (or ObjectModel)
This project will contain all my business logic and data objects. The project will not contain any UI logic.

MyCompany.MyProjectName (SharePoint Project)
This is the SharePoint artifact project from where I will build my WSP package by use of WSPBuilder. All the SharePoint webparts, features and so on will be created here. It is usually set to deploy to Global Assembly Cache. However if company policy requires the code to be deploy with Code Access Security (CAS), I will create an additional SharePoint project, so I have one project for the GAC and one for the WebApplications bin folder.

MyCompany.Test
The project for Units tests.

I do not say that this is the best structure, but I find it as a good template to start from, specially that I can reuse the Framework projects from solution to solution.

Thursday, April 15, 2010

Thursday, January 07, 2010

TechTalk on SharePoint Development at Microsoft Copenhagen

Wednesday I held a TechTalk on SharePoint development at Microsoft Copenhagen. A lot of people attended and it was very nice.

The presentation Sharepoint Development.pptx.

A good example of a “Company.SharePoint.Framework” project in Visual Studio. http://spexlib.codeplex.com/

SharePoint User Group in Denmark http://www.spbg.dk/

Monday, January 04, 2010

Renewed as a Microsoft SharePoint Server MVP for another year!

Just got the e-mail from Microsoft (a little late because the first e-mail must have been eaten by a spam filter or something and therefore never arrived). I’ve been renewed as a Microsoft SharePoint Server MVP for another year!

Tuesday, December 01, 2009

WSPBuilder 2010 Beta


I have been working hard for some time now getting WSPBuilder ready for SharePoint 2010 and Visual Studio 2010. The current status is that WSPBuilder now supports fully the new functionality of the wsp package introduced in SharePoint 2010. Also the WSPBuilder Extension for Visual Studio has been undergoing a major overhaul. Especially the Visual Studio Project/Item templates are currently totally rewritten and new templates will be added with new functionality.

Visual Designer is now supported in WSPBuilder 2010 projects. This means that you will able edit your pages (aspx) and user controls (ascx) with the visual designer in Visual Studio. The reason for this is because the WSPBuilder 2010 project template in Visual Studio is now based on the C# WebApplication project template.
However the special folder types for the Web Application template are not supported and are therefore not added to the project on creation and will have no effect if added later.


Visual Web Part are now available.



Backward compatibility with "old" software like SharePoint 2007 and the previous versions of Visual Studio are very important in the WSPBuilder project. Therefore WSPBuilder 2010 will still fully support SharePoint 2007 and Visual Studio 2005 and 2008. Furthermore I was able to keep it all in one installation file regardless of what system you have x86, x86 / SP2007, SP2010 / VS2005, VS2008, 2010, without going on compromise on the functionality. This simply means one installation file fits them 'all.

One major change that have been done in WSPBuilder 2010, is the change of 12 hive folder name. It will from now on be called "SharePointRoot" according to the official announcement. The old "12" folder is still supported as normal; actually there is no difference between 12 and SharePointRoot regarding functionality in WSPBuilder. But SharePointRoot is less confusing when targeting SharePoint 2010.



SharePointRoot is the new "12" folder.

Now that WSPBuilder 2010 is able to build both SharePoint 2007 and 2010 packages, it will in the build process display a compatibility statement telling the develop if SharePoint 2007 are still supported or not.


Solution compatibility tells you what version of SharePoint this package is compatibel with and the picture show that only SharePoint 2010 is supported.

So when will WSPBuilder 2010 be done?
To quote Blizzard "It's done when it's done!" I'll try to make every beta as much a complete version before releasing it. Currently there are no plans for major changes in the project structure for WSPBuilder, only more functionality and addons.


New features of WSPBuilder 2010

* Fully supports SharePoint 2010 Beta 2.
* Fully supports SharePoint 2007.
* Manifest.config introduced for managing new functionality of the SharePoint 2010 WSP package schema.

New features of WSPBuilder Extensions 2010
 * Support for Visual Studio 2010 Beta 2.
* Backward support for Visual Studio 2005 and 2008.
* Visual Studio Visual designer supported.
* No need to install Extensions to open the project in Visual Studio.
* Pages and user controls designer editing are now supported.
* Item template "Visual Web Part" has been added.
* Web Part will have custom code added if selected, removing the web part on feature deactivate.

Plans for new features in WSPBuilder Extensions 2010
(have not been implemented yet!)

* WSP import project template in Visual Studio.
* Delegate Control item template.
* Layout Page item template.
* New Wizard system for Item templates.
* ...and other item templates.

Important!
Only Visual Studio 2010 Beta 2 is supported. There are no plans to support beta 1.

Known bugs in the Beta 1.2
Workflow templates in Visual Studio do not work properly.

Download
Please look on codeplex under Download. It’s the last file of the 4 available.

http://wspbuilder.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30858




Sunday, November 15, 2009

SharePoint Manager 2010 Release

My good friend and colleague Anders Dissing that has taken over the SharePoint Manager project has now released a SharePoint Manager 2010 version on codeplex!

Anders blog on: SharePoint Manager 2010 Release

Download here!

SharePoint 2010 and WSPBuilder

A lot of people at the SPC2009 conference asked me about the future of WSPBuilder. Facts are that SharePoint 2010 is under way and the new SharePoint tools for Visual Studio 2010 are going to replace VSeWSS.

Here some conclusions from the SPC2009 conference.

  1. SharePoint tools for Visual Studio 2010 will only support SharePoint 2010.
  2. SharePoint tools will only support Visual Studio 2010.
  3. Currently there will be NO new tools for SharePoint 2007 and Visual Studio 2008 (except for the version of VSeWSS 1.3)

This means that all the current solutions out there for SharePoint 2007 will still need to depend on a 3rd party tool to get the job done.

Regarding WSPBuilder, a new version will be release to support the new possibilities in the WSP package for SharePoint 2010. The new version will still provide support for SharePoint 2007 packages, so bug fixes and added functionality will also be available for old 2007 projects. I plan for that WSPBuilder Extensions will support 3 versions of Visual Studio 2005 / 2008 / 2010 in one MSI packaged.

So WSPBuilder will still be around for a couple more years to support SharePoint 2007. Only time will tell if it will be popular for SharePoint 2010.