Monday, November 22, 2010

This Month/ Today's Birth Days Using [Today] in a Calculated Formula (Birthday Lists)

Using [Today] in a Calculated Formula (Birthday Lists)
It is possible to use "Today" in a function as a reference to today's date
(despite what SharePoint tells you).  There is a very simple work around that
doesn't involve very much effort or complexity.

  1. First, create a new column in your list with the column name of "Today".  
    Click "OK".  (It doesn't matter what type of column or data it is, this is
    just a place holder and will be removed later).
    MK Note: Create column called Today… I also created a column called DOB (date field) where I will enter the birth date.
  2. Next, create a column with the data where you would like to use "Today" as a
    reference to today's date.  The column type should be "Calculated".  In the
    formula field, create your formula using "Today" as if it held the column date/time.
    SharePoint will calculate the formula based on the assumption that you will
    be using "Today" as a reference to the new column you just created.
    MK Note: I created a column called MonthCheck with the formula shown below:
     =IF(MONTH([Today])=MONTH([DOB]),"Birthday","NotBirthday")
  3. Next, edit the new column named "Today" that you created in the first step.  
    On the very bottom of the page,
    click "Delete", to delete the column.  In
    your formula, SharePoint will keep the reference to "Today" but it will
    change from referencing your column, to a reference to the current date.
  4. MK Note: Now you can create your new view in the list to display “This Month's Birthdays”.  Just apply a filter to Show only when the following is true: MonthCheck is equal to BirthdayI've also created a BirthDay Column (Capitalized the “D” to note the difference) as well that is a calculated column: =DATE(YEAR(Today),MONTH(DOB),DAY(DOB))
    You can then create a view to display Today's Birthdays by filtering to Show only when the following is true:
    BirthDay is equal to [Today]

This can be used in any of the Date and Time functions, but I haven't tested
it beyond that.

Notes:
If you want to edit the formula (CheckMonth) containing "Today" SharePoint will not let
you, and will give you the same error about not using Today or Me in a
function.  To get passed this problem you have to temporarily create another
Today column (and then delete it again).
The same functionality will also work with [Me].

Note:
You can only use the TODAY function as a default value; you cannot use it in a calculated column.

Tuesday, August 17, 2010

SharePoint Document Rating

To Implement Document Rating or Picture ratings in Moss 2007,



 

Use the below third party feature (.WSP) downloads:


 

http://sptoolbasket.codeplex.com/releases/view/21420


 

Refer below PDFs for steps to install and activate this feature:


 

SharePoint content rating: http://sptoolbasket.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=21960#DownloadId=56840

SharePoint Tool Basket: http://sptoolbasket.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=21960#DownloadId=69328


 

Hope it helps!

Wednesday, August 11, 2010

SharePoint 2007 Maximum Limitations


 


 

Following is a list of names and other parameters with the maximum allowable size on each.

Entity                        Max Permissible Size
Site Name                    128 characters
Site URL                 255 characters
Display name                 128 characters
Connection string                 384 characters
Email address                    128 characters
Version numbers                064 characters
Virtual Server Friendly Name            064 characters
SQL Database Name                123 characters
SQL Database Column                128 characters
SQL Database Table Name            128 characters
SQL Role Name                    128 characters
Server Name                    128 characters
Windows User Name                300 characters
Windows Password                300 characters
Dependencies per object            032 objects
Zone enumeration value            004 zones
Default SQL command timeout             300 seconds
Number of simultaneous
workflows that can be run*             015

If during your course of using the product, you inadvertently cross these limits, then you would end up with errors. These are hard limits.

 
 

* This is the maximum number of simultaneous workflows that can be in memory executing code. (NOTE: there is no limit to the number of workflow instances in progress in the database)


 

SharePoint 2007 figures & numbers

Site object

Guidelines for acceptable performance

Notes

Scope of impact when performance degrades

Site collection

50,000 per Web application

Total farm throughput degrades as the number of site collections increases.

Farm

Web site

250,000 per site collection

You can create a very large total number of Web sites by nesting the subsites. For example, 100 sites, each with 1000 subsites, is 100,000 Web sites. The maximum recommended number of sites and subsites is 125 sites with 2,000 subsites each, for a total of 250,000 sites.

Site collection

Subsite

2,000 per Web site

The interface for enumerating subsites of a given Web site does not perform well as the number of subsites surpasses 2,000.

Site view

Document

5 million per library

You can create very large document libraries by nesting folders, using standard views and site hierarchy. This value may vary depending on how documents and folders are organized, and by the type and size of documents stored.

Library

Item

2,000 per view

Testing indicates a reduction in performance beyond two thousand items. Using indexing on a flat folder view can improve performance.

List view

Document file size

50MB (2GB max*)

File save performance is proportional to the size of the file. The default maximum is 50 MB. This maximum is enforced by the system, but you can change it to any value up to 2 GB.

Library, file save performance

List

2,000 per Web site

Testing indicates a reduction in list view performance beyond two thousand entries.

List view

Field type

256 per list

This is not a hard limit, but you might experience list view performance degradation as the number of field types in a list increases.

List view

Column

2,000 per document library4,096 per list

This is not a hard limit, but you might experience library and list view performance degradation as the number of columns in a document library or list increases.

Library and list view

Web Part

50 per page

This figure is an estimate based on simple Web Parts. The complexity of the Web Parts dictates how many Web Parts can be used on a page before performance is affected.

Page

The following table lists the recommended guidelines for people objects.

People object

Guidelines for acceptable performance

Notes

Users in groups

2 million per Web site

You can add millions of people to your Web site by using Microsoft Windows security groups to manage security instead of using individual users.

User profile

5 million per farm

This number represents the number of profiles which can be imported from a directory service, such as Active Directory, into the people profile store.

Security principal

2,000 per Web site

The size of the access control list is limited to a few thousand security principals (users and groups in the Web site).

The following table lists the recommended guidelines for search objects.

Search object

Guidelines for acceptable performance

Notes

Search indexes

One per SSPMaximum of 20 per farm

Office SharePoint Server 2007 supports one content index per SSP. Given that we recommend a maximum of 20 SSPs per farm, a maximum of 20 content indexes is supported. Note that an SSP can be associated with only one index server and one content index. However, an index server can be associated with multiple SSPs and have a content index for each SSP.

Indexed documents

50,000,000 per content index

Office SharePoint Server 2007 supports 50 million documents per index server. This could be divided up into multiple content indexes based on the number of SSPs associated with an index server.

Content sources

500 per SSP*

This is a hard limit enforced by the system.

Start Addresses

500 per content source*

This is a hard limit enforced by the system.

Alerts

1,000,000 per SSP

This is the tested limit.

Scopes

200 per site

This is a recommended limit per site. We recommend a maximum of 100 scope rules per scope.

Display groups

25 per site

These are used for a grouped display of scopes through the user interface.

Crawl rules

10,000 per SSP

We recommend a maximum 10,000 crawl rules irrespective of type.

Keywords

15,000 per site

We recommend a maximum of 10 Best Bets and five synonyms per keyword.

Crawled properties

500,000 per SSP

These are properties that are discovered during a crawl.

Managed properties

100,000 per SSP

These are properties used by the search system in queries. Crawled properties are mapped to managed properties. We recommend a maximum of 100 mappings per managed property.

Authoritative pages

200 per relevance level

This is the maximum number of sites in each of the four relevance levels.

Results removal

100

This is the maximum recommended number of URLs that should be removed from the system in one operation.

Crawl logs

50,000,000

Number of individual log entries in the crawl log.

The following table lists the recommended guidelines for logical architecture objects.

Logical architecture object

Guidelines for acceptable performance

Notes

Shared Services Provider (SSP)

3 per farm (20 per farm maximum)

  

Zone

5* per farm

The number of zones defined for a farm is hard coded to 5.

Web application

99 per SSP

This limit includes the number of Web applications on child farms consuming resources on this SSP.

Internet Information Services (IIS) application pool

8 per Web server

Maximum number is determined by hardware capabilities.

Site collection

50,000 per Web application

  

Content database

100 per Web application

  

Site collection

50,000 per database

  

The following table lists the recommended guidelines for physical objects.

Physical object

Guidelines for acceptable performance

Notes

Index servers

1 per SSP*

  

Application servers running Excel Calculation Services

No limit

  

Query servers

No limit

Because 100 content databases are supported for each query server, the number of query servers required per farm is based on the number of content databases in the farm. For example, if there are 500 content databases in your farm, you will need at least 5 query servers.

Web server/database server ratio

8 Web servers per database server

The scale out factor is dependent upon the mix of operations.

Web server/domain controller ratio

3 Web servers per domain controller

Depending on how much authentication traffic is generated, your environment may support a greater number of Web servers per domain controller.

You can find the full article on technet, with graphs and test environment settings that will help to complete the scenario.

Hope it helps

Tuesday, July 27, 2010

Configure usage reporting

About usage reporting
Usage reporting is a service that enables site administrators, site collection administrators, and Shared Services Provider (SSP) administrators to monitor statistics about the use of their sites. Usage reporting also includes usage reporting for search queries that can be viewed by SSP administrators for search and site collection administrators.

To configure usage reporting, a farm administrator must first enable Windows SharePoint Services usage logging for the farm that hosts the Web application containing the SSP. The SSP administrator enables and configures the usage reporting service. Then, site collection administrators can activate the reporting feature to enable usage reports on the site collection.

After usage reporting is enabled, site administrators and site collection administrators can view site usage summary pages that have the following information for their sites and site collections:

Requests and queries in the last day and the last 30 days.

Average number of requests per day over the last 30 days.

A chart of requests per day over the last 30 days.

A list of the top page requests over the last 30 days.

A list of top users over the last 30 days.

A chart of top referring hosts over the last 30 days.

A chart of top referring pages over the last 30 days.

A list of top destination pages over the last 30 days.

Top queries for the last 30 days (if search usage reporting is enabled).

Search results top destination pages (if search usage reporting is enabled).

SSP administrators for the search service can view a search usage reports page that tracks the following information.

Number of queries per day over the previous 30 days.

Number of queries per month over the previous 12 months.

Top queries over the previous 30 days.

Top site collections originating queries over the previous 30 days.

Queries per search scope over the previous 30 days.

Site collection administrators for the SSP site can view a usage summary page that tracks the following information:

Total amount of storage used by the site collection.

Percent of storage space used by Web Discussions.

Maximum storage space allowed.

Number of users for all sites in the hierarchy.

Total hits and recent bandwidth usage across all sites.

Site collection administrators can also view a site usage report that includes monthly and daily page hit totals filtered by the following criteria:

Page

User

Operating system

Browser

Referrer URL

Usage reporting is very useful for managing complex site hierarchies with many sites, a large number of page hits, and a large number of search queries, and it is recommended that the service be enabled for deployments of complex site hierarchies. For less complex deployments, usage reporting might not be necessary. It is also possible to disable the service temporarily to conserve resources when other those resources are needed for other processes.

Enable Windows SharePoint Services usage logging
Before you can enable usage reporting in a SSP, you must first enable Windows SharePoint Services usage logging for the farm hosting the Web application containing the SSP.

Use the following procedure to enable usage logging for the farm.

Enable usage logging for the farm
1.On the Central Administration home page, click Operations.

2.On the Operations page, in the Logging and Reporting section, click Usage analysis processing.

3.On the Usage Analysis Processing page, in the Logging Settings section, select Enable logging.

4.Type a log file location and number of log files to create.

5.In the Processing Settings section, select Enable usage analysis processing, and then select a time to run usage processing.

6.Click OK.

For information about how to perform this procedure using the Stsadm command-line tool, see Usage Analysis: Stsadm properties (Office SharePoint Server).

Enable usage reporting
After Windows SharePoint Services usage logging is enabled in the server farm, SSP administrators must enable the usage reporting service. SSP administrators can control the complexity of usage analysis processing, and select whether or not reporting is enabled for search queries.

Use the following procedure to enable usage reporting.

Enable usage reporting:
1.On the SSP home page, in the Office SharePoint Usage Reporting section, click Usage reporting.

2.On the Configure Advanced Usage Analysis Processing page, in the Processing Settings section, click Enable advanced usage analysis processing.

3.In the Search Query Logging section, select Enable search query logging.

4.Click OK.

If advanced usage analysis processing is not selected, usage reporting statistics will be minimal.

For information about how to perform this procedure using the Stsadm command-line tool, see Usage Analysis: Stsadm properties (Office SharePoint Server).

Activate usage reporting
After usage reporting is enabled for the SSP, site collection administrators must activate the reporting feature. Until the reporting feature is activated on a site collection, usage reports are not available.

Use the following procedure to activate the reporting feature.

Activate the reporting feature:
1.On the Site Actions menu, click Site Settings.

2.On the Site Settings page, in the Site Collection Administration section, click Site collection features.

3.On the Site Collection Features page, click the Activate button for the Reporting feature.

For information about how to perform this procedure using the Stsadm command-line tool, see Usage Analysis: Stsadm properties (Office SharePoint Server).

Monitor usage reporting

Usage reporting can be viewed in several places:

Site administrators, including administrators of the SSP administration site, can view usage reporting for their site by clicking Site usage reports in the Site Administration section of the Site Settings page.

Site collection administrators can view usage reporting by clicking Site collection usage reports in the Site Collection Administration section of the Site Settings page.

Site collection administrators for the SSP administration site can view a usage summary by clicking Usage summary in the Site Collection Administration section of the Site Settings page.

SSP administrators for search can view search usage reports by clicking Search usage reports in the Search section of the SSP home page.

For information about how to perform this procedure using the Stsadm command-line tool, see Usage Analysis: Stsadm properties (Office SharePoint Server).


ref: http://technet.microsoft.com/en-us/library/cc262541(office.12).aspx

Thursday, July 22, 2010

Applying custom Master Page for perticular page inside a site

Issue:

Quick Launch should not appear only for perticual list pages(NewForm.aspx, EditForm.aspx etc)


Solutions:

Step 1) Create Custom Master Page (xyz)

Step 2) Apply this Custom Master Page to the List Forms


Step1:Create Custom Master Page (xyz):


1) Open Sharepoint site (http;//madhunomula/rnd/) in Sharepoint Designer

2) Browse for Master page Catalog( _Catalogs -- Masterpage --- MadhuMasterPage.master (your master page))

3) Copy and paste the Master pages in same location and rename it ( _Catalogs -- Masterpage --- CustomMadhuMasterPage.master )

4) Remove quick launch menu from thsi custom master page)



Step2: Apply this Custom Master Page to the List Forms

1)Browse for Lists --- Customlist ---NewForm.aspx


2) In the menu bar of Designer Format---Master Page --- Attach Master Page ----Specific Master page ---Browse for custom Master page (CustomMadhuMasterPage.master)

3)Ok

Done

Friday, July 16, 2010

Preventing Folder Creation on MOSS 2007 Document Libraries

Question:

we have created Custom Folder Content types. users are having Contribute permission. They should not allow to create folders, but they can upload documents.

**********************************************************************************
Answers:
------------------------------------
1.Document Library Setting -->Advanced settings --> Folders ( Display "New Folder" command on the New menu? ) click on no radibox.

2. If you attach folder content on the Document library then remove it
Document Library Setting -->Advanced settings -->Content Types -->Remove your content type from Document library.
-----------------------------------
**********************************************************************************
Write event handler:

ItemAdding properties:
if (((string)properties.AfterProperties["ContentType"]) == “Folder”)
{
properties.ErrorMessage = "You can't create folders";
properties.ListItem.Delete();
}
}


Note:

This solution works when the folder is created using the Doc Library menu interface. If, however, the user opens the doc library in Windows Explorer view the ContentType check does not catch it.

Add this and you will catch the Explorer view events as well:

if ((((string)properties.AfterProperties["ContentType"]) == “Folder”) properties.AfterUrl.ToString().Contains(“/”))

Monday, July 12, 2010

Create a custom list form (EditForm) with few Read only fields And Associating with A List

Creating Cusotm EditForm Page for this test list and enabling few fields as read only
Step 1
Open site with sharepoint desingner
http://madhunomula/RND


Step 2:
Browse the perticular list
Lists--> Test List-->
Step3:
Copy the EditForm and Paste in the Same location
Step 4:
Checkout the copied form and rename to EditFormNew.aspx
Open this form in designer and remove the existing Data form webpart from webpartzone
Step5:
File --Edit--View--Insert----->Sharepoint Controls--> Custom List Form,
Now select the List Name and Select the form type as Edit Item Form
Step6:
Now in Disign click on the control ex Title
And in code view change the control property ControlMode="Edit" to "Display"

Note:
It is not possible to ControlMode="Edit" to "Display" for Dropdown list, date time control, peopl picker control,
So right click on the control and change Format Item As Text and change the disable-output-escaping as yes
xsl:value-of select="@Decision" escaping="yes"




Associating This Page with A List

After you create a custom list form, you can associate it with the list for which it was created. Until you associate the custom list form with the list, the custom list form will not appear in the browser when users create, view, or edit items in that list.

In the earlier example, you created EditFormNew.aspx for the Test list,

so the next step is to associate EditFormNew.aspx with the Test list.

1.In the Folder List, right-click the list or library with which you want to associate the custom list form — in this example, Test List— and then click Properties on the shortcut menu.
2.In the List Properties dialog box, click the Supporting Files tab.
3.If your list is configured to allow multiple content types, in the Content type specific forms list, click the content type for which you want to use the custom list form.
Each time you change the content type, the text boxes change to display the forms used for the current content type. Each content type can use a separate set of custom list forms.

4.Under Disply item form, click Browse, locate and click the custom list form — in this example, EditFormNew.aspx — and then click OK.
The path to the custom list form now appears in the New item form box.

5.Click OK.
If you have followed the example, you can test the new custom form. To do this, click Default.aspx in the Folder List, and then click F12 to open the page in the browser. In the browser, under Announcements, click Add new announcement to open the custom new item form.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------
By Default append changes list data will not show in custom edit form

To overcome this issue add one more given line to the field following


< SharePoint:AppendOnlyHistory runat="server" fieldname="YourCommentsFieldName" controlmode="Display" >




Sunday, July 11, 2010

MOSS 2007 - Save site as a template missing

You would go to

http://siteurl/_layouts/savetmpl.aspx

and then you would be able to save the site as a template.

Madhu N

Friday, March 12, 2010

Creating Ajax webparts

1)Download ASP.NET AJAX 1.0.

2)First of all you need to add

· System.Web
· System.Web.Extensions (v1.06)
· System.Web.Extensions.Design (v1.06)
. Syste.Data

3)Code:
using System;
using System.Web;

using System.Data;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

namespace AjaxWebpart
{
[Guid("0eebf43e-a235-480b-a6df-54269c30892b")]
public class AjaxWebpart : System.Web.UI.WebControls.WebParts.WebPart
{
public AjaxWebpart()
{
this.ExportMode = WebPartExportMode.All;
}
private GridView grdSearch;
private TextBox txtSearch;
private Button btnSearch;
private Label lblMsg;
private UpdatePanel updatePanel;
private UpdateProgress updateProgress;
private static readonly object EventSubmitKey = new object();

//protected override void Render(HtmlTextWriter writer)
//{
// // TODO: add custom rendering code here.
// // writer.Write("Output HTML");
//}
[WebBrowsable(true), WebDisplayName("Image URL"), WebDescription("Image URL"), Personalizable(PersonalizationScope.Shared)]
public string LoadingImageURL
{
get
{
object _obj = ViewState["LoadingImageURL"];
if (_obj == null)
{
return string.Empty;
}
else
{
return (string)ViewState["LoadingImageURL"];
}

}
set { ViewState["LoadingImageURL"] = value; }
}
public event EventHandler Submit
{
add { Events.AddHandler(EventSubmitKey, value); }
remove { Events.RemoveHandler(EventSubmitKey, value); }
}
private void btnSearch_Click(object source, EventArgs e)
{

grdSearch.Visible = false;

System.Threading.Thread.Sleep(1500);

////Create DataTable Structure
DataTable Dtable = new DataTable("tmpTable");
////User_ID Col
Dtable.Columns.Add("User_ID", typeof(int));
Dtable.Columns["User_ID"].AutoIncrement = true;
Dtable.Columns["User_ID"].AutoIncrementSeed = 1;
////User_Name Col
Dtable.Columns.Add("User_Name", typeof(string));
////User_Department Col
Dtable.Columns.Add("User_Department", typeof(string));

DataRow dr = default(DataRow);

dr = Dtable.NewRow();
dr["User_Name"] = "Madhu Nomula";
dr["User_Department"] = "Sharepoint";
Dtable.Rows.Add(dr);

dr = Dtable.NewRow();
dr["User_Name"] = "Swathi Nomula";
dr["User_Department"] = "Technical";
Dtable.Rows.Add(dr);

dr = Dtable.NewRow();
dr["User_Name"] = "chinna Nomula";
dr["User_Department"] = "Production";
Dtable.Rows.Add(dr);

dr = Dtable.NewRow();
dr["User_Name"] = "Chinni Nomula";
dr["User_Department"] = "Technical";
Dtable.Rows.Add(dr);

string searchFor = "%";

if (txtSearch.Text != string.Empty)
{
searchFor = txtSearch.Text;
}

DataView dtView = new DataView(Dtable);
dtView.RowFilter = "User_Name LIKE '%'+'" + searchFor + "'+'%'";

if (dtView.Count > 0)
{
grdSearch.Visible = true;
grdSearch.AutoGenerateColumns = true;
grdSearch.DataSource = dtView;
grdSearch.DataBind();
lblMsg.Text = string.Empty;
}
else
{
lblMsg.Text = "Sorry, No Data Found!.";
grdSearch.Visible = false;
}


}



protected override void CreateChildControls()
{
Controls.Clear();

updatePanel = new UpdatePanel();
{
updatePanel.ID = "UpdatePanel1";
updatePanel.ChildrenAsTriggers = true;
updatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional;
}

updateProgress = new UpdateProgress();
updateProgress.ID = "UpdateProgress1";

string templateHTML = null;
if (LoadingImageURL == string.Empty)
{
templateHTML = "Loading ...";
}
else
{
templateHTML = "
'Loading...'
";
}

updateProgress.ProgressTemplate = new ProgressTemplate(templateHTML);

updateProgress.AssociatedUpdatePanelID = updatePanel.ClientID;

this.Controls.Add(updatePanel);

grdSearch = new GridView();
grdSearch.ID = "GrdSearch";

txtSearch = new TextBox();
txtSearch.ID = "txtSearch";

btnSearch = new Button();
btnSearch.Text = "Search";
btnSearch.ID = "BtnSearch";

lblMsg = new Label();
lblMsg.ID = "lblMsgError";

btnSearch.Click += btnSearch_Click;

updatePanel.ContentTemplateContainer.Controls.Add(txtSearch);
updatePanel.ContentTemplateContainer.Controls.Add(btnSearch);
updatePanel.ContentTemplateContainer.Controls.Add(grdSearch);
updatePanel.ContentTemplateContainer.Controls.Add(lblMsg);
updatePanel.ContentTemplateContainer.Controls.Add(updateProgress);

}


protected override void OnInit(EventArgs e)
{

base.OnInit(e);

//get the existing ScriptManager if it exists on the page
ScriptManager AjaxManager = ScriptManager.GetCurrent(this.Page);
if (AjaxManager == null)
{

//create new ScriptManager and EnablePartialRendering
AjaxManager = new ScriptManager();
AjaxManager.EnablePartialRendering = true;

//Fix problem with postbacks and form actions (DevDiv 55525)
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ID, "_spOriginalFormAction = document.forms[0].action;", true);

//tag:"form" att:"onsubmit" val:"return _spFormOnSubmitWrapper()"
//blocks async postbacks after the first one
//not calling "_spFormOnSubmitWrapper()" breaks all postbacks
//returning true all the time, somewhat defeats the purpose of the
//_spFormOnSubmitWrapper() which is to block repetitive postbacks,
//but it allows MS AJAX Extensions to work properly

if ((this.Page.Form != null))
{
string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];
if (!string.IsNullOrEmpty(formOnSubmitAtt) & formOnSubmitAtt == "return _spFormOnSubmitWrapper();")
{
this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";
}
//add the ScriptManager as the first control in the Page.Form
this.Page.Form.Controls.AddAt(0, AjaxManager);

}
}
}

protected override void RenderContents(System.Web.UI.HtmlTextWriter writer)
{
updatePanel.RenderControl(writer);
}

//Class for Building progress tempales
public class ProgressTemplate : ITemplate
{
private string template;

public ProgressTemplate(string temp)
{
template = temp;
}

public void InstantiateIn(Control container)
{
LiteralControl ltr = new LiteralControl(this.template);
container.Controls.Add(ltr);
}


}
}

}


--------------

4)Now Extend the SharePoint web.config file, which is typically found in a directory with the following structure: drive\inetpub\wwwroot\VirtualDirectories\port number.

Modify the web.config as per the settings in this url

http://msdn.microsoft.com/en-us/library/bb861898.aspx

Thursday, March 11, 2010

MOSS 2010( Sharepoint 2010) Key features

Introduction

Sharepoint is a product that is truly what you make of it, and has always been more platform than simple product. Companies who invested in proper customization and integration have been able to benefit from it much more than organizations who simply deployed Sharepoint and made it available out of the box.

Sharepoint 2010 is much more usable out of the box. The new ribbon interface is intuitive and familiar to Office users, and the product is much tighter, but the need for customization and integration remains. Luckily, Sharepoint 2010 is more focused than ever on being a platform for developers.

Microsoft announced about the SharePoint 2010 technical preview.

Key Features

  • New User Interface including new Ribbon
  • Web Edit
  • Silverlight Web Part
  • Rich Theming
  • Multiple Browser Support
  • Visio Services
  • SharePoint Designer
  • Business Connectivity Services (the evolution of the Business Data Catalog)
  • SharePoint Workspace
  • Rich Media Support
  • Central Administration

SharePoint 2010 is packed with exciting new features. Content authors, administrators and developers can all expect an improved experience.

Content Authoring Improvements

  • Improved WYSIWYG Editor (Web Edit with Live Preview)
  • Improved Theming
  • Silverlight Web Part
  • Ribbon Toolbar
Administration Improvements
  • Streamlined Central Administration
  • Best Practices Analyzer: analyzes farm health and can automatically fix common configuration errors out-of-the-box. Extensible and rules-based.
  • Unified Logging Database
  • Resource throttling for large lists and libraries

Development Improvements

  • Visual Studio 2010 Tools including a Package Designer and Web Part Editor
  • LINQ for SharePoint
  • Developer Dashboard: Page-level debugging/trace output
  • Business Connectivity Services (BCS) replaces Business Data Catalog (BDC) with SharePoint Designer 2010 and Visual Studio 2010 will provide BCS-specific tooling.
  • Client Object Model (OM) is a new SharePoint API that runs on the client and can be called from JavaScript, .NET, or Silverlight

Limitations

SharePoint 2010 has hardware and other limitations:

  1. SharePoint 2010 will only be available in a 64-bit version. This change is not limited to servers. Developers running on 32-bit hardware will need new machines.
  2. SharePoint 2010 will require a 64-bit version of SQL Server 2005 or 2008 (2000 is no longer supported).
  3. Not all applications written for SharePoint 2007 will work in 2010. Certain APIs will be no longer be available. Others will be deprecated.
  4. The basic flow for many tasks as changed. That, coupled with the laundry list of productivity-enhancing features means that any 2010 deployment should be accompanied by training for users, administrators, and developers.

Monday, March 8, 2010

Silverlight Integration with Moss 2007

What is Silver light?
Silver light is a new technology form Microsoft that enables developer to build rich, interactive user experience for web based applications.

It is a cross –browser, cross-platform plug-in that Microsoft developed to enable more compelling and interactive media based application experience on the web
It supports .Net 3.5(C#, LINQ, VB and XML serialization are also supported.), Ajax also more dynamic technologies like Phython, Java script and Ruby.

It also provides extensive library controls to customize , binding, change style templates…etc.

XAML—Extensible Application Markup Language
Silver light XAML is the subset of WPF(Windows Presentation Foundation ) XAML.
Using XAML you can layout your UI and then associate with your controls
XAML provides seleveral “structural” containers to position your controls

Ex: Canvas and add other controls to build complete UI or small part of UI.

When you are building your XAML in visual studio shows you the view that we can expect to work with it.
The view split in to Designer and XAML view.
You can Drag drop controls in to the XAML view and add properties in XAML view.
To use full-drag and drop you need to use Expression blend.—Which also provides rich set of tools to manipulate your silver light control.
Because Expression blend and Visual studios are integrated you can right click on Page.XAML to open in “Open in Expression Blend”.

Silver light integration with Moss:

Pre-requisites:
Windows server 2008/2003 Entp.
Windows sharepoint services 3.0 +wss sp1
Moss 2007 Enpt edition+Moss sp1
Visualstudios 2008 Professional edition above with SP1
Silverlight 2 tools for visual studios 2008sp1
Silverlight2 client runtime
Visual studio extensions for windows sharepoint services 3.0 versions 1.2
Expression Blend 2 SP1

After you have installed above you have to make sure that your development environment configured for Sharepoint and silver light integration.

1) Change MIME type in IIS to support silverlight application.
2) Change web.config file in your root sharepoint direction to support silver light application
3) Ensure that syste.web.silverlight .dll is added in your GAC.

After that

Follow the below basic steps:

1) Create silverlight web application Project VS 2008.
2) Create .xap file
3) Create new-->sharepoint webpart
4) Add reference of System.web.silverlight.DLL to this webpart
4) In child controls

System.web.UI.silverlightcontrols.silverlight test= new System.web.UI.silverlightcontrols.silverlight();

test.ID="testID";
test.source="http://xyz/xaps/silver.xap"; // URL of silver light application
test.width= new system.web.UI.webcontrols.unit(900);
test.Height= new system.web.UI.webcontrols.unit(650);

this.contols.ADD(test);

5) Deploy the webpart.

Wednesday, March 3, 2010

Creating a Web Part with Client-side Script (Java Script etc)

Calling Java script functions in webparts:



We can call Java script functions in sharepoint webparts in 2 ways
1) Embed a script in a Web Part
2) Linking a script file to webpart

1) Embed a script in a Web Part :
Method 1:
1) You can explicitly specify your script in a Web Part and have the script loaded only once for all instances of the same Web Part on a Web Part Page. The IsClientScriptBlockRegistered method of the System.Web.UI.Page class can check if the script has been loaded for the same Web Part Page.

private const string HelloIncludeScriptKey = "HelloIncludeScript";
private const string EmbeddedScriptFormat = "< script language=javascript >function Hello(){alert('Hello world');} </ script> ";

public Web_Part2()
{

this.PreRender += new EventHandler(Web_Part2_PreRender);

}

void Web_Part2_PreRender(object sender, EventArgs e)
{

if (!Page.IsClientScriptBlockRegistered(HelloIncludeScriptKey))
Page.RegisterClientScriptBlock(HelloIncludeScriptKey, EmbeddedScriptFormat);
//syntax: Page .RegisterClientScriptBlock(key of the script, ScriptFormat string);
}
Button btn;
protected override void Render(HtmlTextWriter writer)
{
btn.RenderControl(writer);
}
protected override void CreateChildControls()
{
btn = new Button();
btn.ID = "btn";
btn.Text = "Click";
btn.OnClientClick = "Hello()";//call the JS function
this.Controls.Add(btn);
}



Method 2:
Using StringBuilder:

protected override void Render(HtmlTextWriter writer)
{
btnclk.RenderControl(writer);
}
Button btnclk;
protected override void CreateChildControls()
{
//base.CreateChildControls();
btnclk = new Button();
btnclk.ID = "btnclk";
StringBuilder strscript = new StringBuilder();
strscript.Append("alert('hello world'); return false;");
btnclk .Attributes .Add ("onclick",strscript .ToString ());
}

Method 3:
Including “ < script> ” tags in writer.write in Render Method:
protected override void Render(HtmlTextWriter writer)
{
writer.Write("< script >");
writer.Write("function helloworld(){ alert('hello world'); return false;}");
writer.Write("</script >");
btnclk1.RenderControl(writer);

}
Button btnclk1;
protected override void CreateChildControls()
{
btnclk1 = new Button();
btnclk1.ID = "btnclk1";
btnclk1.Attributes.Add("onclick", "helloworld();");
}


2) Linking a script file to webpart:
//JS file name : hello.js

function hello()
{
alert('hello this is external script alert');
}

We need to place this js file in this path :

C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\EmployeeWebpart\1.0.0.0_91f29f0c96ff744c

EmployeeWebpart-----folder with webpart name
1.0.0.0_91f29f0c96ff744c---folder with version_public key token



// Referring External Javascript in Createchild controls method

ClientScriptManager cs = Page.ClientScript;
// Include the required javascript file.
if (!cs.IsClientScriptIncludeRegistered("hello"))
cs.RegisterClientScriptInclude(this.GetType(), "hello", "/_wpresources/EmployeeWebpart/1.0.0.0_91f29f0c96ff744c/hello.js");

//Test:
Testbutton = new Button();
Testbutton.Text = "Click me";
Testbutton.OnClientClick = "hello()"; // specify function name here