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:
- Download your MOSS2007 with SP1 iso.
- Extract the ISO
- Since I use the x64 bit version only I deleted all except the x64 folder.
- Delete all content of the x64\updates folder
- Download WSS SP2 and MOSS SP2 from Microsoft Download
- Put you downloads in a folder e.g. c:\sp2
- Extract your files using command line c:\sp2>wssv3sp2-kb953338-x64-fullfile-en-us.exe /extract:c:\sp2
- And command line c:\sp2>officeserver2007sp2-kb953334-x64-fullfile-en-us.exe /extract:c:\sp2
- Go to c:\sp2 (or whatever you choose) and copy all files to your x64\updates folder
- Delete Wsssetup.dll, this is important. Otherwise only WSS SP2 will be installed.
- Run Setup.exe...
- Remember: if you use SQL server 2008, to install SP1 before running MOSS2007!
Note: WSS SP2 slipstream build can be found here: x86 x64.
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:
-
-
Edit the .bat file (by my installation placed at: C:\Program Files (x86)\Microsoft Commerce Server 2007\Microsoft Commerce Server 2009\Site\InstallInlineEditWebPart.cmd)
-
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
-
Install Silverlight
-
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" />
-
Open the properties window for your IIS server
-
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".
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
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.
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!
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.
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.
SPMessaging V0.2 released
Just released SPMessaging V0.2 on http://www.codeplex.com/SPMessaging. New Features are:
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
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>");
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;
}