This past week I’ve been deep diving into the Content organize structure.
How does a document get routed from the drop folder to the destination Document library?
All the MSDN examples and blog posts handle the normal out of the box functionality. But I literally didn’t found one how to do all this via code. (If you have one, send me the link and I’ll add you on my personal hero list  )

Also, very few of the websites that I found handles the content organizer cross sites.
After a lot of digging (disassemble, reflector , analyzing the SharePoint dll’s (again)) I can make a well-founded statement that those sites were in their good mind not or almost not to talk about it.

I’ll sketch the problem:
Imagine you have a rootsite with content organizer rules listed based on content types.
Say you have 5 subsites, and all of these subsites use their own content type (for ease of use we say that the content types are all defined on the rootweb, so no change or additional fields on the content type in the subsite).
Now I want to do some content routing from the rootweb to the subsites. Should be fairly easy but sadly it is not.
A “connection” must first be made at central admin level in order to use the “connection” to push the content from the drop folder in the rootweb to the dropfolder in the subsite.
So for a “simple” power user tool you are fairly quickly blocked in using the content organizer if you want to do content pushing outside of the web. Because you need a farm admin to create those “connections” and this is sometimes not possible when managing a big farm.

The place where I’m working now, I have to create a sort of content routing with site creations on the fly. So I investigated this structure and wanted to list the shortcomings.
Don’t know why there isn’t a nicer way of this structure or why Microsoft splitted this into central admin, power user sections.

But the main reason of this blog is that there is absolutely none blog/ msdn article/ technet, you name it , no information is available on how to create a connection manually from inside the site collection.
I’m investigating this issue with Tom van Gaever (fellow SharePoint junior evangelist 😉 link to his blog is here ) and we’ll be trying to find a capable solution slash sort of automation.
I’ll keep you guys posted on the development on a weekly basis. Hopefully I can post a codeplex project so that you can use it also.

Wilke (a collegue of mine) has developed a very interesting tool to learn about the SPWebConfigModification  API (link).

This tool  gives an example of web config modifications without actually applying them to the web.config

Very well written article so don’t wait any longer 🙂

Today I had an error (one of many if you are a developer) and it threw me off a bit.

I’m using a visual webpart (VS 2010 with SP 2010) and it has an asp:repeater with buttons. Ok so far so good, now i’m testing the buttons and I got the following error:

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation=”true”/> in configuration or <%@ Page EnableEventValidation=”true” %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Ok, after a lot of searching you can find:

add a <pages enableEventValidation=”true”/> in the ASCX file – wrong

add a <%pages enableEventValidation=”true”/%> (or something with extra symbols) in the ASCX – wrong

add public void Page_preinit(…) { page.enableEventValidation=”false” }       – wrong

replace all trues with false  – wrong

the only thing you need to do is to set EnableViewState=”false” 🙂

happy hunting for the bugs

*! Edit !*

I must first say that above “solution” does fix things but I’ve discovered later in the game that this will not help you when you want to do special things.

I’ve got an updatePanel, inside of it an Asp:Repeater and inside the repeater a FileUpload

than that’s quit a different story all together.

In the end, the way it works for me, I’ve added <triggers> <asp:PostBackTrigger control=”name of the repeater” /> </triggers>

And I’ve put the enableviewstate to true

also because I have multiple controls the ID cannot be the same (ofcourse) so you need to add an event “ItemDatabound” to your repeater (in the code behind)

For each row you need to change the ID of the control

For Example:

var item = (DataRowView)e.Item.DataItem;

var button = (Button)e.Item.FindControl(” ID NAME”);

button.CommandArgument = e.Item.ItemIndex.ToString();

button.ID = ” ID NAME” + e.Item.ItemIndex.ToString();

Every control is unique because I have name of the ID control + Indexnumber .

There are other ways but remember, you maybe also need to retrieve the unique control, so item.itemindex is the most easiest way to go

hope it helps someone

well it’s pretty late here (almost 1 o’clock at night) and i’m still working.

Just spend 15minutes looking for a small dll which I couldn’t find.

Where is the <subject> (it’s pretty late did I mention that 😉 ) file?

It appears to be not in all of the standard directories, atleast I didn’t find it there.

The simple thing to do is to copy / past this line below and you’re good to go on creating custom WCF.

C:WindowsassemblyGAC_MSILMicrosoft.SharePoint.Client.ServerRuntime
14.0.0.0__71e9bce111e9429cMicrosoft.SharePoint.Client.ServerRuntime.dll

Stupid I know, but it did the job and references the file 🙂

hope it helps someone

Well had another problem all of a sudden with SP 2010.

I wasn’t able to make any list or library because this error kept popping up.

So again thinking of what did I do now, what did I changed that wasn’t allowed to? For a change I didn’t do anything that wasn’t allowed , deployed a few webparts, but that couldn’t be the problem.

After some searching I can across this site ( link)

It stated that it could be a production bug.

If you go to the central admin -> manage web apps -> general settings of the web app with the problem and re enable the security validation. Wait a minute, yeah i’ve changed this not to lang ago because I had issues with some generating/adding open xml (office) documents.

No that can’t be it….. Sure enough the error was gone.

The short explenation: Silverlight Application is unable to connect to the WCF endpoint configured by the product for enabling Client Object Model, if Security validation is set to Off. (copy/paste from the site)

hope this will help someone in the end. It’s a stupid error to have, but an error none the less 🙂

Hey everyone

Today I had a problem that kept me busy for 2 hours.

I loaded up an old webpart (was in type class library and I’ve build the webpart entirely via code) and I wanted to debug it.

Deployed the webpart and activated the feature, checked the DLL was in the GAC (global assembly cache).

Visual Studio loaded up the solution, added a breakpoint in the constructor, attach to process. Ok the red dot was filled so all was good.

Ok let’s go debugging, eeuhm, that’s strange the webpart is being displayed and the breakpoint isn’t being hit.

After searching for 30min, I used my best friend (google 😉 )

Found a few possible solutions, saying that it’s a 32-64bit setting in IIS. Ok let’s change it (advanced setting in IIS web app ) , nope didn’t work

Another one was in Microsoft.netframeworkv4…… ASPNET_REGIIS -ir , nope didn’t work as well

Last one , basic setting in IIS , change to classic and V4 , still nothing.

Changed the 32-64bit, V4 back to normal and starting to look again.

To make a long story short. If you can attach to the process, it all appears normal but VS2010 doesn’t want to hit any breakpoints. Go to Tools -&gt; attach to process -&gt; select the W3WP and before you hit attach, check the “attach to” field.

If this is on Automatically, this could be your problem. Especially when it says “Automatic: Managed (v4.0) code, T-SQL code” .

Change it to manual and only select “Managed (v2.0, v1.1, v1.0) code”.

This did it for me 😀

happy debugging

hey everyone

Today I started up the CAML Builder again (I know, Linq to SharePoint rulez, but underneath it still translates to CAML 🙂 ).
So it started giving me an error saying that the user isn’t getting access to the Content Database.

Ok, SQL 2008 management studio (for those who have to install it on a server 2008, good luck but I’m not a too bad of a guy 🙂 http://goneale.com/2009/05/24/cant-install-microsoft-sql-server-2008-management-studio-express/ )

open -> security -> right click user -> properties -> user mapping (got an error saying that certain db’s are not listed) ok ok , uh? where are my content db’s. Those are the db’s that are not listed

Ok rightclick the db’s , no access, figures …. and is normal, at install and creating content db, SharePoint 2010 is only giving sa and another account access and all the rest, well you shouldn’t be snooping arround in the catacombs of SharePoint SQL he .

But my problem still existed, I couldn’t use the CAML Builder 🙁

SO, as every good SharePoint we’ll have to be all round and via some googleing (lost the url where I found the solution, but I’m just spreading the word, give credit who’s credit due 🙂 )

the solution is in the SharePoint Powershell
$w = Get-SPWebApplication -identity “name of the web app”
$w.GrantAccessToProcessIdentity(“domainusername”)

et voila user has access to the sql content db of the web app.

If you have a blog, post it , It kept my busy for atleast 4 hours before I found what I was looking for.