The darkie speaks

The darkie is an Internet Business Architect with the Professional Services arm of a large computer manufacturer. His expertise is in the Microsoft .NET servers, specifically, Commerce Server, MSIB, Content Management Server and Sharepoint Portal Server. He has delivered training, and consulting on several large deployments for government and fortune 1000 companies.

Thursday, July 29, 2004

MCMS2k2 - Developer series introduction

Building web sites with Microsoft Content Management Server 2002 - Introduction
By: Israel Vega Jr.

Purpose
I have been built several inter/intra/extranet sites using Microsoft Content Management Server 2002, 2001 and the previous product nCompass Resolution.  When learning the tool, I realized quickly that there is little training content available that can be used in field.  I have read many articles and readme files of sample code but I continued to be frustrated with the disconnect between implementation and the business purpose.  Without the context, I was lost and usually just stored the sample on a drive for later (of course I never use them later but I have them).

I started to write this series to hopefully provide the developer with tools that can be used over and over again on several engagements.  I will share many tips and techniques that will help you stretch the solutions you build on CMS.  I encourage you to take a step back when you build the solutions and attack the problem more generically and by all means simple.  This will enable you to reuse the tools and code snippets you use regardless of context.

In the series, I will cover the following topics:

Building navigation controls – using .NET data binding to build navigation and breadcrumb controls
Integrating forms into CMS solutions – building a custom placeholder to select form controls
Building summary controls – building a simple summary control framework to make your summary pages more flexible
Building utility scripts – Approving all content, and creating a channel structure from an Excel spreadsheet

…and many more. 

It is assumed that the reader has a basic understanding of ASP.NET, data-binding, Visual Studio 2003, and MCMS 2002.   If you are interested in any pf these articles, pleased email me and I will distribute them to you.

About the author
Israel Vega, Jr. is an Internet Business Architect with the professional services arm of a major computer manufacturer.  He has expertise in Microsoft .NET servers, specifically, Commerce Server, Content Management Server, MSIB, and Sharepoint Portal Server.  He has delivered training, and consulting on several projects, some of which utilized one or more of the .NET servers.  He can be reached via email at ivega@inkblot.biz or on his blog http://thedarkie.blogspot.com/.



Wednesday, July 28, 2004

CMS2k2 - Default styles that should be implemented for authors

Here are the OOB styles and the matching HTML tags that should be implemented on every CMS engagment.  They are used by CMS to allow content contributors to format text when adding content.  They are also used to format the display of the content when it is copied from another source such as Word.  You should override all of these styles by specifying the presentation in the style sheet to ensure site consistency.


CMS authoring style CSS Style
Normal = BODY {}
Paragraph = P{}
formatted = PRE{}
address = ADDRESS{}
h1 = H1{}
h2 = H2{}
h3 = H3{}
h4 = H4{}
h5 = H5{}
h6 = H6{}
Numbered list = OL{}
1. numbered list item = LI{}
Bulleted list = UL{}
Bullet list item = \*Same as LI*Directory List = DIR{}
Directory List Item = \*Same as LI*Definition term = DT{}
definition = DL{}
Menu = MENU{}
Bold = STRONG{}
Italic = I{}
Underline = U{}
Hyperlink = A:link{}
= A:active{}
= A:visited{}
= A: Hover{}

CS2k2 - Adventures in catalog managment

I was at a client today and I ran into a problem with the Commerce Server product picker and the expression builder. It seems that when you use a property definiton that contains an "_" for your product Id, it fails when you try to define an expression.  The error that is raised reads something like, "Unable to create expression. ProductID.Product_X5F_code could not be found".
 
It looks as though if the product id field and/or variant id field contains an "_" character (actually the code filters other allowed characters such as "-"), the code replaces the invalid character with a "_X{ascii numeric value of character}_" in order to create the XML node name for the data island. The code is in the APP_NAME_BIZDESK\Catalogs\Editor\common.asp page inside the sReplaceSpaces function. The "_" is a valid, allowed character for a product identifier field, "product_code" in our case, so I modified the code in the file to allow the "_" character and the expressions now work correctly. I have included the fix below.

In the Function
 sReplaceSpaces (ByRef sString)
...Some code here

Change the line:
((iChar >=  91) And (iChar <=  96))


To:
((iChar >=  91) And (iChar <=  94)) Or _ 
((iChar =  96)) Or _

...more code here
End Function

Commerce Server 2002 - BizDesk refresh cache problems

Have you ever into a problem with BizDesk when
trying to refresh the caches?  Does, "An Error occurred while refreshing the
catalog" sound familiar?  I have run into this issue many times and I wanted to share some learnings.

The issue is related to MS KB article 825329.  In the article, it tells you to change the code in order to append the full URL before redirecting.   I discovered a small problem with the script.  When the comparison is performed, the Replace() function is called however, by default, the Replace() is case sensitive.  Below is what I believe is the correct script.

Change BDRefresh.asp from:
Response.Redirect "BDRefresh.aspx?" & Request.ServerVariables("QUERY_STRING")  

To:
Response.Redirect
"http://" & Request.ServerVariables("SERVER_NAME") & ":" &
Request.ServerVariables("SERVER_PORT") &
Replace(LCase(Request.ServerVariables("SCRIPT_NAME")), "bdrefresh.asp", "bdrefresh.aspx")
& "?" & Request.ServerVariables("QUERY_STRING")

Change RefreshApp.asp from:
Response.Redirect("RefreshApp.aspx?" & Request.QueryString) 

To:
Response.Redirect
"http://" & Request.ServerVariables("SERVER_NAME") & ":" &
Request.ServerVariables("SERVER_PORT") &
Replace(LCase(Request.ServerVariables("SCRIPT_NAME")), "refreshapp.asp", "refreshapp.aspx")
& "?" & Request.ServerVariables("QUERY_STRING") 

Additional resources: Known Issues in Commerce Server 2002 Service Pack 2 - http://support.microsoft.com/default.aspx?kbid=825329
Refreshing Commerce Server Caches - http://www.microsoft.com/technet/prodtechnol/comm/comm2002/deploy/refresh.mspx

Sunday, July 25, 2004

My first post

Greetings from my hotel room.
 
"The darkie speaks" is an online outlet for my writings and random thoughts related to .NET and .NET Server Technologies.  It will focus on MSIB, Content Management Server, Commerce Server, SharePoint, WSS and .NET.
 
Please visit and comment freely, I am not easily offended.
 
Thank you for your time and enjoy!