RSS Feed Feed your read!


Archives

September 2010 (2)
August 2010 (2)
June 2010 (2)
May 2010 (1)
April 2010 (2)
March 2010 (1)

Links

Photos
Archive
Archive (Calendar)

Tag Cloud

.Net, InfoPath, Sandboxed solutions, SharePoint 2007, SharePoint 2010, Virtual Machines, Visual Studio 2010
Sep 022010

SharePoint 2010 : Sandboxed visual webpart is possible!

 

As probably many of you have been told it’s not possible to create a visual webpart within a sandboxed solution. I know when I heard this it was a real downside and didn’t really make me enthusiastic about using this kind of solution. But, there’s a spark on the horizon, some people have already figured out how to work around this drawback!

 

I first noticed the possibility when working with the SharePoint 2010 Dev tools for visual studio from Codeplex but their template just simply doesn’t work. Of course now my curiosity flared up and I kept looking until I came across this great blogpost by Stefan Stanev which explains step by step how to achieve a sandboxed visual webpart + gives a downloadable sample project (POC) here.

Now this project probably won’t work immediately, it will build but will show error’s when you try adding the webpart because it has this post-build script (postbuild.ps1) which uses specific hard coded locations. Be sure to install the ILMerge tool (free Microsoft download here) to this location - C:\Program Files (x86)\Microsoft\ILMerge.

 

This sure got me thinking about sandboxed solutions again, hope it will convince you too!

 

Gr

Tom

Published: 9/2/2010  9:35 PM | 0  Comments | 0  Links to this post

Sep 012010

SharePoint Developer Tools for Visual Studio 2010

 

Found a handy new add-in for Visual Studio 2010 on CodePlex here called SharePoint Developer Tools for Visual Studio 2010. It’s a work in progress as I found out not all their templates are 100% but I think there are some useful and timesaving templates/features in there!

 

Gr

Tom

Published: 9/1/2010  7:42 PM | 0  Comments | 0  Links to this post

Aug 302010

Re-deploying InfoPath / Office add-ins

 

When I tried to install a new version of my InfoPath add-in i got the following error message:

 

  • “ Unable to install this application because an application with the same identity is already installed. To install this application, either modify the manifest version for this application or uninstall the preexisting application. “

 

Now I was sure i raised the version of the add-in + my installation msi removes any previous versions before performing a fresh install. (+ I uninstalled the old app first)

 

I finally stumbled onto this post which had exactly the same error as me and fixed it with the following run command: rundll32 dfshim CleanOnlineAppCache

 

So I uninstalled my add-in (again), ran the command, re-installed exactly the same .msi and it worked perfectly.

 

Gr

Tom

Published: 8/30/2010  3:18 PM | 0  Comments | 0  Links to this post

Aug 252010

MOSS 2007 People wildcard search webpart + refine your results.

I’ve been searching for a good way to use wildcard search in combination with people search (SharePoint User Profiles) and have found a few but not 100% what I was looking for.

 

My colleague Steven has found a solution for wildcard search which is pretty much the same as the Codeplex solution and DotNetMaffia solution for this problem.

My problem was that these solutions are designed for wildcard content search and not specifically for people search. Normally you’d perform a people search in SharePoint by using the “People Search Core Resuls webpart” which includes some nice people specific features such as:

 

- Refine your search (by example refine by job title)

- Sort by social distance

- …

 

Now all the wildcard search solutions I’ve come across don’t include these features because they all extend the “ CoreResultsWebPart “ instead of the “ PeopleCoreResultsWebpart “ and there is a very good reason for this, being that that class is sealed so you can’t extend it!

 

Now in my case I just need the “refine your search” feature + I only want to search the people scope so I’ve made some adjustments to Steven Van de Craen's original wildcard search solution.

 

By looking at the sealed class from the “ PeopleCoreResultsWebpart “ I found and included the methodes required for the refine feature (CollectRefinementData – SortRefinementDataForColumn – SetSortedRefinementDataOnHiddenObject - GetXPathNavigator). And off course I fixed the scope to only search for people.

 

So now I have all the functionality I need by simply extending the “CoreResultsWebPart”.

 

You can find an example of the code here as the methods are just too much to post here. Of course you can always Reflector the “PeopleCoreResultsWebPart” if you need any of the other functionality’s, it probably won’t be easy as I haven’t come across someone who reverse engineered the entire webpart.

 

Hope this helps someone out, I’m sure glad I figured it out so I didn’t have to choose between wildcard search or my nice people search functionality's.

 

Gr Tom

Published: 8/25/2010  8:31 PM | 0  Comments | 0  Links to this post

Jun 142010

Application pool password “recovery” possibility removed from SharePoint 2010

 

As some of you may know, in SharePoint 2007 it was possible to get the username & password for the application pool identity by deploying a webpart with a small piece of code as shown in Tobias Zimmergren's post here. This post showed us the need for running a least-privileged installation in SharePoint 2007 because this password was stored as plain text.

 

So I thought I’d try this out for SharePoint 2010 and what do you know, it doesn’t work anymore. Microsoft clearly saw this “bug” and resolved it by making sure the app.Password method can’t be called directly in code. If you need the password I think you’ll still be able to get it but not as plain text to be shown for the whole world to see.

 

If anyone does find a way around this and it’s still a bug, feel free to comment!

 

Gr

Tom

Published: 6/14/2010  3:38 PM | 20  Comments | 0  Links to this post

Jun 112010

Options for running 64-bit VPC (.vhd) from Windows 7 (non server OS).

 

If you’re working with SharePoint 2010 images you are aware that these need to run on a 64bit  system. Now the problem is that Microsoft’s own Virtual PC software does not support 64bit images, so Microsoft has Hyper-V for this (only available in Windows Server).

 

Now if you want to download and run SharePoint images provided by Microsoft they will have .vhd hard disks which run a 64bit OS and as not everyone is running a Windows Server instance on their machine you won’t have Hyper-V to run these.

 

Here are at least some of your options to get past this problem without installing Windows Server on your machine.

 

1. Converting your virtual hard disk

 

Now there are tools to convert .vhd disks to .vmdk and the other way around such as “StarWind V2V Image Converter”. So in our case you convert you’re .vhd file to a .vmdk file which you can then run with VMware player which does support 64-bit OS. I’ve tried this and it does work but it sure takes a long time, time you possibly don’t have…

 

2. Free 3rd party software that runs both .vhd and .vmdk and supports 64-bit OS.

 

I’ve now found a great piece of software called “VMLite Workstation” which is completely free and available for download after registration. This tool allows you to create virtual machines from almost any type of hard disk (.vhd - .vmdk - .vdi - .hdd) and multiple OS’s including 64-bit.

 

This way you just download the hard disks in .vhd format from Microsoft and create a new Virtual machine with VMLite and you’re working in 5 min’s!

 

http://www.vmlite.com/

 

Hope this saves you some time!

 

Gr

Tom

Published: 6/11/2010  2:44 PM | 22  Comments | 0  Links to this post

May 052010

SharePoint outgoing mail to SharePoint incoming mail library

I was trying to submit an infopath form through infopath form services (browser) with an e-mail to an incoming mail library on a SharePoint in another domain. I noticed that the mail was appearing in the drop folder, and was beging deleted after a minute (TimerService) but it didn't get added to my library.


When i tried to send exactly the same mail from Outlook it worked like a charm. This problem gave me a couple of hours headache and then i found this Microsoft kb saying basicly it's not supported to prevent loops. So a mail coming from workflow / alert / form services is not allowed in incoming mails for a library.


Now the good news is that there is a solution to this which i found here .

Solution
1. copy Smtpreg.vbs into the c:\inetpub\AdminScripts - smtpreg is available to download from MS. (google it)
2. create a vbs file from the script below and copy it to the AdminScripts folder (I named mine wss)
3. run the following commands to register the script
cd c:\inetpub\adminscripts
cscript smtpreg.vbs /add 1 OnArrival DeleteMsg CDO.SS_SMTPOnArrivalSink "mail from=*"
cscript smtpreg.vbs /setprop 1 OnArrival DeleteMsg Sink ScriptName "c:\Inetpub\AdminScripts\wss.vbs"
4. This will now catch all mail on arrival and remove the offending header.
So after hours of searching i finally found a "hack" to succesfully get Infopath form service mails to get picked up by the SPTimerService and saved in my incoming mail library.
Hope this helps someone out there!


Gr
Tom

Published: 5/5/2010  3:22 PM | 16  Comments | 0  Links to this post

Apr 212010

Infopath form server - passing url parameter to a infopath form

 

I wanted to load a new infopath form into a Xmlformview webpart in Sharepoint, but at the same time pass a url queryparameter to the infopath form.
At first you might think that this can't be done without code behind on the infopath form but I found an easy way to do this based on an article (Steven Van De Craen) of a collegue of mine.
The methods are quit simple

  1. Make sure u get a url parameter in the publishing page by clicking a link (ex http://moss/pages/createdoc.aspx?parameter=23
  2. Create a new custom SharePoint webpart that extends the Microsoft.Office.InfoPath.Server.Controls.XmlFormView class.
  3. Add an eventhandler in the onInit of the webpart for this.initialise
  4. In the handler add code to change the XML nodes in the infopath doc (pass parameter to a hidden field or something).

public class XmlFormViewExtender : Microsoft.Office.InfoPath.Server.Controls.XmlFormView
{
private bool _error = false;
private string _xpath = null;
private string _param = null;
[Personalizable(PersonalizationScope.Shared)]
[WebBrowsable(true)]
[System.ComponentModel.Category("My Property Group")]
[WebDisplayName("parameter")]
[WebDescription("parameter Property")]
public string Param
{
get
{
if (_param == null)
{_param = "par";
}
return _param;
}
set { _param = value; }
}
[Personalizable(PersonalizationScope.Shared)]
[WebBrowsable(true)]
[System.ComponentModel.Category("My Property Group")]
[WebDisplayName("XPath")]
[WebDescription("XPath Property")]
public string XPath
{get
{
if (_xpath == null)
{
_xpath = "/my:form/my:param";
}
return _xpath;
}
set { _xpath = value; }
}
protected override void OnInit(EventArgs e)
{
this.Initialize += new EventHandler(XmlFormViewExtender_Initialize);
base.OnInit(e);
}
protected void XmlFormViewExtender_Initialize(object sender, Microsoft.Office.InfoPath.Server.Controls.InitializeEventArgs e)
{
if (XmlForm != null)
{
string value = this.Page.Request.QueryString[Param];
XPathNavigator _xNavMain = this.XmlForm.MainDataSource.CreateNavigator();
XPathNavigator result = _xNavMain.SelectSingleNode(XPath, this.XmlForm.NamespaceManager);
result.SetValue(value);
}
}
I've also created 2 properties (Param, XPath) for the webpart that hold the name of the parameter it should get (querystring) and the Xpath where to place the value of this param.
So the result of this webpart is that the value of the url parameter par will be filled into the XML of the infopath form in "/my:form/my:param" and will show this data when rendering the form.

 

Hope this helps someone out!

Published: 4/21/2010  3:20 PM | 16  Comments | 0  Links to this post

Apr 062010

MOSS 2007 anonymous access + forms based authentication


We've also had some problems after this because when we went into a list / library we still got our login page while we had followed all the steps mentioned in the article.


Turns out the problem was that our site was based on a publishing site template.
The solution is to deactivate a feature for the site and turn anonymous authentication off and on again as mentioned in this kb : http://support.microsoft.com/kb/927082/en-us?spid=11373&sid=200

 

  • Click Start, click Run, type cmd in the Open box, and then click OK.
  • Type the following lines at the command prompt. Press ENTER after each line.
    cd /d %commonprogramfiles%\Microsoft Shared\Web Server Extensions\12\Bin
    stsadm -o deactivatefeature -url http://ServerName -filename ViewFormPagesLockDown\feature.xml
  • Type exit to exit the command prompt.

 

Note After you run this command-line tool against your site, you must toggle the Site Settings advanced permissions to turn off Anonymous access. Then, turn on Anonymous access again. You must do this for the command to take effect on content that exists in the site.

 

After this we could open the list with our anonymous user but when we tried creating a new list item (by clicking the new button we saw after setting the anonymous access permissions add for the list) we got the login screen again.

 

Solution: Check if your list doesn't have a lookup column to another list that does not have anonymous authentication turned on. If so grant anonymous "view" access on the lookup list.

Hope this helps you out!

Published: 4/6/2010  3:19 PM | 31  Comments | 0  Links to this post

Mar 252010

Reattaching SharePoint 2007 content databases

I had to reinstall and reconfigure a MOSS 2007 server after a corrupt installation.


Went I reattached the old content DB it showed no problems, and I could see the old site collections added to my web application.


But when i tried to surf to the url of the site collection I got a http 500 internal server error.
At first I thought I hadn't installed / configured the new IIS on the server correctly, or the version of the content DB and moss installation wasn't the same. But when i created a new site collection in the old content db it worked perfectly.


After hours of searching I came to the conclusion that the existising site collections were created in dutch, while my new installation did not contain the language packs.
So when in doubt and your not sure about the content your importing, try installing language packs for MOSS 2007...

Published: 3/25/2010  3:13 PM | 26  Comments | 0  Links to this post