SharePoint Development Blog

Nick Boumans
View my LinkedIn Profile Follow me on Twitter View my Profile on FaceBook View my projects on CodePlex View my presentations on SlideShare



Recent posts

Tags

Categories

Navigation

Pages

Archive

Blogroll

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Install MOSS 2007 and WSS 3 on Windows Server 2008 R2

As you probably know, SharePoint 2010 will need Windows 2008 Server x64. So time for me to already install a x64 server system and tryout MOSS2007 on Win2008 R2. Trying to install MOSS2007 including SP1 (slipstream from MSDN) I got the following error on my Windows 2008 R2 64x server:

You can Install MOSS2007 or WSS3.0 on Windows 2008 R2 Server. You need to make a slipstream with SP2 of WSS3.0 and MOSS (you have to make your own slipstream since it is not downloadable yet).

To make a MOSS2007 SP2 slipstream:

  1. Download your MOSS2007 with SP1 iso.
  2. Extract the ISO
  3. Since I use the x64 bit version only I deleted all except the x64 folder.
  4. Delete all content of the x64\updates folder
  5. Download WSS SP2 and MOSS SP2 from Microsoft Download
  6. Put you downloads in a folder e.g. c:\sp2
  7. Extract your files using command line c:\sp2>wssv3sp2-kb953338-x64-fullfile-en-us.exe /extract:c:\sp2
  8. And command line c:\sp2>officeserver2007sp2-kb953334-x64-fullfile-en-us.exe /extract:c:\sp2
  9. Go to c:\sp2 (or whatever you choose) and copy all files to your x64\updates folder
  10. Delete Wsssetup.dll, this is important. Otherwise only WSS SP2 will be installed.
  11. Run Setup.exe...
  12. Remember: if you use SQL server 2008, to install SP1 before running MOSS2007!

Note: WSS SP2 slipstream build can be found here: x86 x64.

 

 

Posted: May 14 2009, 19:36 by Nick Boumans | Comments (6) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: SharePoint General

Commerce Server Inline Product property edition WebPart for SharePoint

One thing where missing using Commerce Services for SharePoint is the ability to administrate products. The following Web Part makes Inline product property edition for commerce server 2009 possible. This silver light control (hosted in ASP.NET web part) helps business people to update product information on their ecommerce websites. http://www.microsoft.com/downloads/details.aspx?FamilyID=fce87672-90cf-4ead-b100-6bbc24d96f66&displaylang=en

To Install:

  1. Follow the installation steps described in the document cs2009InlineEditor: http://www.microsoft.com/downloads/details.aspx?FamilyID=fce87672-90cf-4ead-b100-6bbc24d96f66&displaylang=en (bottom of the download page).
  2. Edit the .bat file (by my installation placed at: C:\Program Files (x86)\Microsoft Commerce Server 2007\Microsoft Commerce Server 2009\Site\InstallInlineEditWebPart.cmd)
  3. Change the path to the stsadm.exe tool and the url of your site in this .bat file

@ECHO OFF

@SET stsadm="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe" //your stsadm location
@SET url="yourMossUrl"

 

ECHO **********************************************************************
ECHO Adding WSP
ECHO **********************************************************************

%stsadm% -o addsolution -filename "MicrosoftCommerceInlineEditWebPart.wsp"
%stsadm% -o execadmsvcjobs

ECHO **********************************************************************
ECHO Deploying WSP
ECHO **********************************************************************

%stsadm% -o deploysolution -name  "MicrosoftCommerceInlineEditWebPart.wsp" -url %url%

-immediate -allowGacDeployment -allowCasPolicies -force
%stsadm% -o execadmsvcjobs

ECHO **********************************************************************
ECHO Activating Silverlight Feature for editing Commerce Server product properties
ECHO **********************************************************************

%stsadm% -o activatefeature -name "InlineProductEditorWebPart" -url %url% -force
%stsadm% -o execadmsvcjobs

ECHO **********************************************************************
ECHO Activating Silverlight Feature for Inline Product Property Editor resources
ECHO **********************************************************************

%stsadm% -o activatefeature -name "InlineProductEditorResource" -url %url% -force
%stsadm% -o execadmsvcjobs

ECHO **********************************************************************
ECHO Restarting IIS
ECHO **********************************************************************

iisreset

  1. Install Silverlight 
  2. Open your web.config file and add the follow line to the end of the save controls

<SafeControl Assembly="System.Web.Silverlight, Version=2.0.5.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI.SilverlightControls"
TypeName="*" Safe="True" />

  1. Open the properties window for your IIS server
  2. Click the "MIME Types" button.  In the new dialog window, choose "Add" to add a new MIME type.  The extension is ".XAP", and the MIME type is "application/x-silverlight-app".



 

Posted: May 13 2009, 15:06 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Cool Commerce Server 2009 Links

MSDN Commerce Server 2009 Forum: http://social.msdn.microsoft.com/Forums/en-US/commserver2009/threads 

Virtual PC with all configured software required to run commerce server 2009. This VPC has Commerce Server 2009 , Microsoft Office SharePoint® Server 2007 (MOSS)  & SQL Server,  fully installed and configured.  You can download it from Microsoft connect website. https://connect.microsoft.com/Downloads/DownloadDetails.aspx?SiteID=643&DownloadID=16926

Template Pack for Commerce server 2009 which contains a fully-featured contemporary shopping Web site that offers a new, contemporary presentation skin on the Default Site: http://www.microsoft.com/downloads/details.aspx?FamilyID=2df25ab7-f38d-439e-9391-ef8f025e8064&displaylang=en. To install: 1) run setup 2) rename the config file as described in the manual 3) create a new sharepoint webapplication and sitecollection using the wizard. There is a nice .css file after installing this package which is easy customizable. 

Inline product property edition for commerce server 2009. This add-on product is used for product administration purposes for business users. This silver light control (hosted in ASP.NET web part) helps business people to update product information on their ecommerce websites. http://www.microsoft.com/downloads/details.aspx?FamilyID=fce87672-90cf-4ead-b100-6bbc24d96f66&displaylang=en

Posted: May 12 2009, 14:11 by Nick Boumans | Comments (1) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Commerce Server

SoapException trying to invoke Commerce Server 09 WebService

The adventure works catalog is shown well in SharePoint. I can enter the store. By trying to invoke a webservice I got the following error: 

[code:xml]

System.Web.Services.Protocols.SoapException: Failed to perform the specified catalog operation because the current user is not authorized to perform it.Operation = 'Grant view access for a catalog' Scope = 'CatalogScope_adventure works catalog' ---> Microsoft.CommerceServer.NotAuthorizedException: Failed to perform the specified catalog operation because the current user is not authorized to perform it.Operation = 'Grant view access for a catalog' Scope = 'CatalogScope_adventure works catalog'   at Microsoft.CommerceServer.Catalog.Internal.CatalogAuthorization.ValidateScopedOperation(AuthorizationScope scope, String entityName, Int32 operationId)   at Microsoft.CommerceServer.Catalog.Internal.ProductCatalog.GetCatalog(CatalogExecutionContext executionContext, String catalogName, String language, JoinTableInformation joinTableInformation, Boolean getFromCache)   at Microsoft.CommerceServer.Catalog.Internal.CatalogServerContextBase.GetCatalog(String catalogName, String language, Boolean getFromCache)   --- End of inner exception stack trace ---   at Microsoft.CommerceServer.Catalog.Internal.WebServiceUtility.PropagateOrLogException(Exception except)   at Microsoft.CommerceServer.Catalog.Internal.CatalogServerContextBase.GetCatalog(String catalogName, String language)

[/code]

Solution:

  • Type: azman.msc in the run box

  • The autorization manager will be shown
  • Right Click Authorization Manager --> Open Authorization Store --> XML File --> Browse for CatalogAuthorizationStore.xml (in WebService Folder)

  • Right Click the CatalogAdministrator --> Assign Users and Groups --> From Windows and Active Directory
  • Assign an account with Administrator privileges

If you receive the following error when trying to use the catalog manager: "Failed to retrieve the AzMan Scope named InventoryCatalog_Adventure Works Inventory." The resolution is to open Azman store and create a new scope for the catalog.

Posted: May 12 2009, 13:16 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Commerce Server

Infrastructure Commerce Server 2009 in MOSS2007 Farm

By planning an installation of Commerce Server in a MOSS Farm the first thing I tought was installing Commerce Server 2009 on a seperate server. Why? To keep a difference between the several server installations, and I thought at a later moment it would be possible to connect with Commerce Server to another MOSS Farm. My braindump was this:

After some research I came to another architecture because you have to install Commerce Server 09 on each MOSS Server (only Web FrontEnd Servers are required). Simply because you can't specify the MOSS Server location. It only recognizes a local MOSS Installation (on your CS09 server). Please take a look to the next picture: http://msdn.microsoft.com/en-us/library/dd452198.aspx and keep this in mind planning your SharePoint / CS09 infrastructure.

Note: another option is to serve CS functionality by webservices and call them from your MOSS environment.

I Hope Microsoft will look at expanding the possible deployment options in upcoming CS releases. For now install it on the same box!

 

Posted: May 11 2009, 08:17 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: SharePoint General

RunWithElevatedPrivileges seems not working - wrong security context

You wrote a function using the RunWithElevatedPrivileges delegate and it seems not working? 99% chance your CurrentUser is still the security context of the caller of the code, not the system account.

To fix this you'll need to get a new SPSite reference:

 SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                //Gets a new security context using SHAREPOINT\system
                //or even: using (SPSite oSite = new SPSite(this.Page.Request.Url.ToString()))
                using(SPSite oSite = new SPSite(SPContext.Current.Site.ID))
                {
                    using (SPWeb oWeb = oSite.OpenWeb())
                    {
                        oWeb.AllowUnsafeUpdates = true;
                        // Add a record to the new list
                        SPList oList = oWeb.Lists["mylistname"];
                        if (oList != null)
                        {

                            SPListItem item = oList.Items.Add();                
                            item["Title"] = "new item";
                            // item.update to committ
                            item.Update();
                        }
                    }
                }                                                               
            }); 

You can dispose  the new security context after using it, since it is a different context than the one which is opened by the HttpContext. Looking to the lists "Created by" field of the inserted item, you will notice the SHAREPOINT\system (System) account.

Posted: May 07 2009, 18:50 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: SharePoint General

SPMessaging on YouTube

http://www.youtube.com/watch?v=jf5QS-JiKRM

 

 

Posted: May 06 2009, 16:13 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: SharePoint General

Microsoft Certified Trainer - MCT

Finally my MCT programm (and instruction skills) are approved. So now I'm a Microsoft Certified Trainer (MCT).

Congratulations! On behalf of Microsoft, we are happy to welcome you to the Microsoft Certified Trainer (MCT) Program.

  

Posted: May 05 2009, 16:38 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Career

SPMessaging V0.2 released

Just released SPMessaging V0.2 on http://www.codeplex.com/SPMessaging. New Features are:

  • Ability to delete your own messages from an icon on the WebPart;
  • Autohyperlink urls (http://) and emailaddresses.

Release is still Beta. I have to add exceptionhandling and delete some "dirty" functions. However if you plan to release something if it's "perfect" it will not be released Wink so here it is: http://www.codeplex.com/SPMessaging.

WebPart is currently for MOSS Since I load a userprofile for getting the url to the UserPicture from e.g. the mySite. Hope to make it WSS compatible in another release also.  

Some nice Regular Expressions used:

// Remove Domain part from username
string userName = Regex.Replace(SPContext.Current.Web.CurrentUser.LoginName.ToString(),
      ".*\\\\(.*)", "$1",RegexOptions.None);

// Make hyperlink of http:// url
string strContent = txtWhatAreYouDoing.Text;
Regex urlRegex = new Regex(@"(http:\/\/([\w.]+\/?)\S*)",
                    RegexOptions.IgnoreCase | RegexOptions.Compiled);
strContent = urlRegex.Replace(strContent,"<a href=\"$1\" target=\"_blank\">$1</a>");

// Make hyperlink of emailadres
Regex emailRegex = new Regex(@"([a-zA-Z_0-9.-]+\@[a-zA-Z_0-9.-]+\.\w+)",                 
                RegexOptions.IgnoreCase | RegexOptions.Compiled);
strContent = emailRegex.Replace(strContent, "<a href=mailto:$1>$1</a>");

Posted: May 05 2009, 15:06 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

CAML Query comparing current user with a list field

I used the next query to check or the current user (logged in) is the same as the user stored in a specific listfield. 

SPQuery query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name=\"Sender\" /><Value Type='User'>" + SPContext.Current.Web.CurrentUser.LoginName.ToString() + "</Value></Eq></Where><OrderBy><FieldRef Ascending='DESC' Name='Created' /></OrderBy>";
SPListItemCollection collListItems = myList.GetItems(query); //myList is a listobject of type SPList

You can get the SPUser object in the following way:

 private SPUser GetUserFromList(SPListItem item)
        {          
            string strUserValue = item["Sender"].ToString();
          
            int intIndex = strUserValue.IndexOf(';');
            int intID = Int32.Parse(strUserValue.Substring(0, intIndex));
            SPUser oUser = this.site.SiteUsers.GetByID(intID);
            return oUser;           
        }

Posted: May 05 2009, 14:14 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5