STSADM.EXE - custom commands for WCM, by Andrew Connell

Just a quick post about a tool I just found: the STSADM.EXE WCM Custom commands tool, developed by Andrew Connell (see his blog).

This tool lets enables some administrative actions specifically related to Web content management in Office Sharepoint Server 2007 like publishing all items in a web, generating the XML elements file for content types and site columns.

This is the link to the tool: http://www.andrewconnell.com/blog/articles/MossStsadmWcmCommands.aspx

 


Codeplex projects for SharePoint

There are already some very useful projects and toolkits available for WSS3 and MOSS 2007.
While reviewing the Codeplex site I filtered on some of the most interesting ones for me now:

And this is just to begin! There are lots more and certainly more to come.


Publishing Content types and site columns using features - specifying required fields in the XML schema

Today I came across something strange after having created site columns and content types (for publishing) using features.
Two features are used:

  • Site fields/columns definition where I specify the definition of each site column.
  • Content types: based on publishing content types to be used by page layouts. This feature refers to the fields created by my first feature.

My problem was that all required fields defined by my site columns feature were not being validated as required field after saving the page. In other words, the page was saved without error messages being shown for the required fields.
Site column definition specifies the field is required however:

<Field ID="GUID_HERE" Name="MyDateField" StaticName="MyDateField"
SourceID=http://schemas.microsoft.com/sharepoint/v3
Group="My publishing group"DisplayName="MyDateField"
Type="DateTime"
Format="DateTime"
Required="TRUE"
Sealed="TRUE"
StorageTZ="UTC"></Field>

The reason for this behavior: fields being marked as Required="True" in the fields definition feature are not automatically set as required in the content type.

<ContentType ID="ID_HERE" Name="MyContenttype" Group="Mygroup" Sealed="FALSE" Version="0">
<FieldRefs>
<FieldRef ID="{82734328-4682-43a9-A516-96C96FBBEE40}" Name="MyTextField" />
<FieldRef ID="{3843B4BD-CB7C-4339-A499-638501E0E44F}" Name="MyDateField" Required="TRUE" />
</FieldRefs>
<DocumentTemplate TargetName="/_layouts/CreatePage.aspx" />
</ContentType>

In the above sample the first field will not be validated in the page layout, even if this field has been set as required in the <Field> definition file. The second field in the content type, setting Required="TRUE" explicitly will be correctly validated.

If you create your publishing content types directly using the MOSS interface you will probably never run into the problem.
 


MOSS 2007 custom search page - javascript error

This is an error I encountered when creating a custom search page in MOSS 2007.

After creating a new custom search page and placing the Core Search Results, Search Results Paging webparts I always had a Javascript error "Object Expected", line xxx when clicking on Next page. 
The line number corresponds the href of the paging link : javascript:PostToUrl(''). My first idea is that some basic required javascript library has not been loaded.

Luckilly I found someone with a similar problem, actually a different problem with the same solution: http://www.sharepointblogs.com/joeldhall/archive/2007/01/04/17470.aspx

In Joel's solution just adding the Search Box webpart and setting it to closed in order to hide it is sufficient. Unfortunately in my case this is not. If I close the web part the error reappears.

Maybe someone else knows why this happens and has a better solution? 


Scott Guthrie talks about Orcas and ASP.NET Ajax

Last Thursday Scott Guthrie was in Belgium and gave two presentations: one on the new version of Visual Studio, code named "Orcas" and the second on ASP.NET and Ajax tips and tricks.

The presentation was organized by VISUG, was free, and clearly had a lot of success here in Belgium.  

He presented several new features including:

  • Support for .NET 2.0, 3.0 and the new .NET 3.5 projects, this means you can already start using the new Visual Studio with your old .NET 2.0 projects.
  • Improved debugging capabilities for Ajax and client-side JavaScript: I just loved the way your Internet Exporer client page is loaded as a separate item in Visual Studio Explorer, and in which you can then debug. For anyone having debugged JavaScript using alert() statements, it's finally over!
  • Intellisense support for client JavaScript classes
  • Improved CSS editing WYSIWYG: Visual Studio uses the same features as in Microsoft Expression.
  • LINQ: it was only the second time I saw a demo on this new technology. Still have to read further about it, I'll start with this: http://www.asp.net/sandbox/app_blinq.aspx?tabid=62
  • Also related to LINQ: the database schema mapping to object classes. By dragging your tables into the designer, Visual Studio automatically generates the classes for you. You can watch the video on this on Scott's blog: http://weblogs.asp.net/scottgu/archive/2007/01/28/video-using-linq-with-asp-net-in-vs-orcas-part-1.aspx.

There was lots more little nice things but these stood out for me. Can't wait for the CTP to come out and begin playing.

During the second presentation, on ASP.NET tips and tricks: even having read his blog regularly I still learned a few new things. Be sure to check out his blog: http://weblogs.asp.net/scottgu/

And what about Sharepoint: the talk wasn't about Sharepoint but he did mention that a service pack for Sharepoint will come out later this year. The service pack will have support for Ajax in Sharepoint. So that's good news... weren't it for the fact that I need to use Ajax for my current Sharepoint project.
So for this I will probably take a look at the SharePoint Ajax Toolkit.

 

Copyright © 2007 Katrien De Graeve.