Skip to main content

Posts

Location, Location, Location

In WSS 3.0 Site definition, we have a manifest.xml file to describe the content in solution file and how to deploy the content. In the XML element of manifest.xml file, there are many location attributes to use. It is confusing where these locations reference. Here are some clues: 1. SiteDefinitionManifest node: The location of this node reference to SiteTemplates folder under TEMPLATE directory. For example: <SiteDefinitionManifest Location="MyCustomSite" /> will create a subdirectory called MyCustomSite under …12\TEMPLATE\SiteTemplates and copy all the contents under MyCustomSite directory in solution file into …12\TEMPLATE\SiteTemplates\MyCustomSite. In your solution file, you need to have a directory called MyCustomSite and put all your customized site pages in it. Inside this directory, you need to create a directory called XML and put onet.xml inside it. 2. FeatureManifest node: The location of this node references to FEATURES folder under …12\TEMPLATE. For exampl...

Element.xml explained

Some xml elements in Element.xml file in WSS 3.0: 1. Root element: Elements. It contains a Id attribute, which is a guid to uniquely identify this element. 2. Receivers element: This element is inside Elements. It contains ListTemplateId attribute which specifies what type of list will be attached to list item event handler. For example, a value of 101 means that the event handler will be attached to all document libraries. 3. Receiver element: This element is inside Receivers element. It contains several sub elements in it to define the class to receive list item event. A sample configure is like this: <receiver> <name>DigiDoc signature check event <type>ItemUpdated <sequencenumber>5000 <assembly>wssDigiDoc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=44b3223b8da05605 <class>wssDigiDoc.ddocEventHandler </> Name: A descriptive name Type: The event type that this receiver class will handle. The possible values are: ItemAdd, ItemUpdate, It...

Features.xml explained

Some xml elements in Features.xml file in WSS 3.0: 1. Root element: Feature. It contains following attributes: Id: The guid to uniquely identify this feature. Title: The title of the feature appears in feature list Description: The descriptive text appears in feature list Version: Feature version number Scope: The scope this feature applies to. The possible values are: Web, Site, WebApplication and Farm Hidden: A boolean value to indicate if to show this feature in feature list xmlns: Xml namespace, always "http://schemas.microsoft.com/sharepoint/" ImageUrl: The image icon that appears at the left of the feature in feature list. The image should be in \IMAGES if no path is given. ReceiverAssembly: This is the full qualified assembly name that contains the event handler of feature installation/uninstallation, activation/deactivation. ReceiverClass: This is the class name in ReceiverAssembly that actually handles feature related events. This class must inherit SPFeatureReceiv...

Users, AllUsers and SiteUsers

SPWeb object has three properties related to user collection: Users: The individual user added into site. This use does not belong to any site group. AllUsers: All the users in site group of this site, including both the individual users and the users in site groups. SiteUsers: All the available users in the site collection, including some hidden users added by WSS.

Change the field display color based on its value

This is tested on WSS 3.0. I have a custom list definition. There is a field called "Status" in this list definition. I want to change the display color of this field based on its value. Here is the steps: In the schema.xml file of this list, find the "Status" field definition. It should be inside /List/MetaData/Fields. Based on this field, create another Computed type field. Here is the code snippet: <Field Type="Text" DisplayName="Status" ReadOnly="TRUE" Required="TRUE" MaxLength="255" ID="{d9daabac-0014-4c1e-8c06-093ff0c7ecfc}" SourceID="{142fdfdd-7e46-4ca3-b9d3-56ae0ead646e}" StaticName="Status" Name="Status" ColName="nvarchar3" RowOrdinal="0" /> <Field ID="{0864C5F6-688C-4ee5-A4FE-3FB17CD5EE1E}" ReadOnly="TRUE" Type="Computed" Name="ColorStatus" DisplayName="Status" Dir="" DisplayNameS...

Request URL

Example: http://localhost:8080/webapp/webform1.aspx?cmd=edit&UserName=John%20Smith Request.RawUrl: /webapp/webform1.aspx?cmd=edit&UserName=John%20Smith Request.Path: /webapp/webform1.aspx Request.PhysicalPath: D:\Web Dev\WebApp\WebForm1.aspx Request.BaseDir: /WebApp Request.Url.Host: localhost Request.Url.Port: 8080 Request.Url.Scheme: http Request.Url.CurrentDocument: WebForm1.aspx Request.Url.Query: ?cmd=edit&UserName=John%20Smith Request.Url.DisplayQuery: ?cmd=edit&UserName=John Smith Request.Url.AbsoluteUri: http://localhost:8080/webapp/webform1.aspx?cmd=edit&UserId=123 Request.Url.Authority: localhost:8080