Monday, December 28, 2009

Custom WSS components

Although it is a great job by WSS sites which you create through the browser, there is a point where you would need to create custom features like web parts, workflows, event handlers  which fit to your requirements. For this surely you would need coding fro custom WSS components.

WSS Features
It is better to learn from the WSS features. Features provide the mechanism for defining site elements and adding them to a target site or site collection through a process known as feature activation. The element types that can be defined by a feature include menu commands, link commands, page templates, page instances, list definitions, list instances, event handlers, and workflows.

Your first WSS Custom feature
  • Start Visual studio
  • Create a new C# class library DLL project named "HelloWorld" (New Project---ProjectType=Visual C#---Template=Class library)

  • Before creating the feature.xml file, consider that the files for this feature must be deployed in their own special directory inside the WSS system directory named FEATURES. The FEATURES directory is located inside another WSS system directory named TEMPLATE.

    c:\Program Files\Common Files\
    Microsoft Shared\web server extensions\12

  • To make the deployment easier create a directory named TEMPLATE inside the root directory of the project. 
  • Now inside TEMPLATE directory create another directory named FEATURES and inside FEATURES create a directory with the same name of the project "HelloWorld"
  • Next, create an XML file named feature.xml inside the HelloWorld directory. This is where you will added the XML-based information that defines the high-level attributes of the feature itself. Add the following XML to the feature.xml file to add a top-level Feature element along with attributes that define the feature itself.
          < Feature
                      Title="Hello World First Feature"
                      Description="This is my very first custom feature"
                          <ElementManifests Location="ElementManifests" />
  • You must create a new GUID, from tools--Create GUID--Select fourth option (Registry format)--click copy--paste in the feature id element.
  • Now it’s time to create the element.xml file and define a single CustomAction element that will be used to add a simple menu command to the Site Actions menu. Add the following XML, which defines a CustomAction element to elements.xml.

    <Elements xmlns=""> 
        Title="Hello World"
        Description="A custom menu item added using a feature"
        ImageUrl="_layouts/images/menuprofile.gif" > 
     </CustomAction >
    This CustomActions element has been designed to add a menu command to the Site 
    Actions menu. It provides a user-friendly Title and Description as well as a URL 
    that will be used to redirect the user when the Menu command is selected. 

    Installing the feature 
    • First copy the HelloWorld feature directory to the system FEATURES directory. copy the folder inside TEMPLATE--FEATURES in the project created and paste it inside "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES"
    • Then you have to execute a STSADM.EXE commands.
    • Go to c:\program files\common files\microsoft shared\ web server extensions\12\bin through commandline.
    • Then execute the following command
     STSADM.EXE -o installfeature -filename HelloWorld\feature.xml -force

    • Now you can check the successful feature installation by go to the site you created and then Site Actions--Site Settings--Under Site Administration; Site Features
    • Here you can view all the site features currently installed, here you can see the "Hello World First Feature" 
    • Either you can activate it through browser by clicking Activate button or through command line.

    • command line from the same place where you installed the feature
      STSADM -o activatefeature -filename HelloWorld\feature.xml -url -force

Wednesday, December 23, 2009

Site Customization

The best thing is you can decide how to customize its top-level site.WSS provides many options for configuring and customizing sites.In the top-right corner of the page, you can see the Site Actions menu. This menu provides commands that allow you to create new site elements, customize the current page, and navigate to the Site Settings page.

But the thing is , customizing is visible only to the users who has the sufficient level of permissions. ;)

The Create Page

Create Page allows users to customize the current site by creating new site elements  such as lists, document libraries, Web Part Pages, and child sites.

These standard element types have been designed to facilitate team-level collaboration. They include list types for collaborating on list-based items such as announcements, contacts, links, calendar events, tasks, and issue tracking.

Creating a List for Leave Request inside a company

  • Click the custom List link under custom Lists.
  • Give "Leave Request" as the Name
  • For the description type "This is a List for handling leave requests inside the company"

  • Now click Ok. You will be redirected to the Leave Request List.
  • Here Go to Settings--Create Column
  • Give the column Names and select the data type.The best thing is you have lots of optons for defining the columns to be fitted to your requirements. Feel free to experiment all the options.

  • Give following names and data types and create columns
          (Column name - type of Information)
  • Reason-
  • From -Date and Time
  • To-Date and Time 
  • Approved By- Person or Group
  • Leave Type-Choice (menu to choose from)
  • Number of days-Number
  • Then Click ok. Now go to New---New Item
  • Here You can see that you can enter the leave information.

  • After creating the list you can do any type of edition by going to Leave Request---Settings---List Settings
  • From here you can add new columns, edit and update columns, delete columns, etc.
  • Create your own multiple Lists and try different options provided. Feel free to Try... Good Luck!

First SharePoint Site

 WSS site is a storage container for content. The site content is primarily stored in different forms as follows,
  • Lists
  • Document Libraries
  • Image Libraries
  • Child Sites or sub sites
 Sites are securable entities, because site content are accessible to a configurable set of users or user groups. The permission level also can be determined by the site administrator, either for
  • Full Control- Has Full Control
  • Design-Can view, edit, update, delete, approved and customized
  • Contribute- Can view, edit, update and delete
  • Read- Can view only
Let's look how the SharePoint brings the simplicity in making sites.
  • Under the Windows Start menu, find the Administrative Tools group and then select the SharePoint 3.0 Central Administration menu to launch the WSS Central Administration application. Over the next few steps you will use this application to create a new site
  • On the Application Management page, locate and click the link titled Create Site Collection in the SharePoint Site Management section. This will take you to a page where you will enter the details that WSS requires whenever you want to create a new site collection
  • The figure shows filling the Title, Description, URL and Template fields. You can select any of the templates from the given list. For this example select Blank Template.

    • When giving user permissions, you can enter the user names inside the LAN network. It facilitate to check the user existence inside the network and to search users inside the network.
    • Then click OK

    • Now You have successfully created your first SharePoint site.  Congradulations

    • You can access it by going through the URL you gave. Make sure to log on to the site with the username which you gave user permissions.

        Windows SharePoint (WSS) - For What ?

        SharePoint technologies provide an effective solution for creating team sites to facilitate collaboration in a LAN-based environment. At the opposite end of the spectrum, SharePoint technologies also make it easier to manage content in an Internet-facing site that can scale to accommodate thousands of users in a Web farm environment.

        Also it is far more we can accomplish when we use WSS as a development platform. In this SharePoint Blog Series, I am going to give you a better idea about using WSS as a development platform.

        For an installation on a Virtual PC image, we recommend a host computer with at least a 2 GHz Pentium processor and 2 GB of RAM

        You can download WSS from here

        After the installation

        After installing WSS, it creates and configures a Web Application named SharePoint 3.0 Central Administration application.

        This SharePoint central administrative application provides pages that allow us to perform various administrative chores,
        • Convert a standard existing IIS web site into a WSS Web Application
        • Create a new IIS Web site and automatically configure it to be a WSS Web Application.
        All these operations can be performed without bothering about using any of the IIS administration tools directly.