Skip to main content

Posts

SharePoint Audience

Import classes and methods in Microsoft.Office.Server.Audience name space: 1. The AudienceManager class is the entry point for the audience feature in Microsoft Office SharePoint Server 2007. Audiences: This property return all the audiences as AudienceCollection GetUserAudienceIDs: Get all the audience IDs to which the specified user (or current user) belongs to. 2. Audience class: Audiences are groups of users determined by their memberships in Microsoft Exchange distribution lists (DL) or SharePoint groups, or by rules configured by a portal administrator. Audiences allow organizations to target content to users based on their job or task, as defined by their membership in a SharePoint group or distribution list, by the organizational reporting structure, or by the public properties in their user profiles. GetMembership: Gets an ArrayList of UserInfo objects that contains membership information for this audience. IsMember: Determines wheth...

ASP.NET Inline Code Syntax Reference

Rendering Code Syntax: and Code enclosed by is just executed, while expressions that include an equal sign, , are evaluated and the result is emitted as content. Data Binding Syntax: Code located within a code block is only executed when the DataBind method of its parent control container is invoked. Expression Syntax: ASP.NET 2.0 adds a new declarative expression syntax for substituting values into a page before the page is parsed. This is useful for substituting connection string values or application settings defined in a Web.config file for server control property values. It can also be used to substitute values from a resource file for localization.

Using resource file in VSTO 2005 project

VSTO 2005 have default resource file in MyProject folder. If you right click the project in VSTO 2005 and choose properties, you will see project properties window. In the properties window, there is a tab called Resources. You can add default resources, such as images, strings and icons. For the string of different culture, you have to add new resource file into the project. The resource file name follows the format of Resources. language-culture .resx. For example, the resource file for Canadian French is Resources.fr-CA.resx. You add the new resource file by right click the project and choose Add -> New Item.... In the Add New Item dialog, choose Resources File. In the file name box, enter the proper file name as described above, then click OK. You can then add culture specific resources into the newly created resource file.

.NET Generic Constraints Syntax

Generic supports four types of constraints: Interface: Allow only types that implement specific interfaces to use your generic Base class: Allow only types that is or inherited form specific base class to use your generic Constructor: Allow only types that implement specific constructors to use your generic Reference or value type: Limit the types to use your generic either reference type or value type Examples for these constraints: Interface: T must implement IComparable interface public class MyGenericClass where T: IComparable Base class: T must be or inherited from MyBaseClass public class MyGenericClass where T: MyBaseClass Constructor: T must have at least the default constructor available public class MyGenericClass where T: new () Reference or value type: T must be a reference type public class MyGenericClass where T: class Reference or value type: T must be a value type public class MyGenericClass where T: struct

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...