Thursday, October 29, 2009

SharePoint 2010 New Features

Since the announcing of SharePoint 2010, SharePoint community has been buzzing with speculations on what the new version might offer. Here are the latest updates on SharePoint 2010 new features:

Overview

New User Interface including new Ribbon
Office 2007 style ribbon interface

Web Edit
Allows users to easily customize a site

Silverlight Web Part
Easy Silverlight solutions into SharePoint

Rich Theming
Few office-style themes, just like in Word and PowerPoint.

Multiple Browser Support
IE 7-8, Firefox and Safari. No news about Chrome and Opera

Visio Services
Lets you share data linked diagrams in real time

SharePoint Designer
Comes with a new UI, improved workflow and improved collaboration between designers

Business Connectivity Services (the evolution of the Business Data Catalog)
SharePoint Workspace
Incorporate offline-online synchronizations

Rich Media Support
No matter what type of rich media you’re using, SharePoint 2010 will make your life easier

IT Professional

Streamlined Central Administration
Way better organized Central Administration site

SharePoint Best Practices Analyzer
Farm health monitoring at its best with “Problems and Solutions” page

Usage Reporting and Logging
Consolidated logging and usage reporting capabilities

Large List Resource Throttling
Performance management of big lists of thousands and millions of items

Unattached Content Database Recovery
Allows temporary use of content databases, useful for recovery and restore purposes

Visual Upgrade
Easy migration from 2007 to 2010 while retaining the 2007 themes and UI

Developer

- Visual Studio 2010 SharePoint Tools
- Language Integrated (LINQ) for SharePoint
- Developer Dashboard
- Business Connectivity Services
- Client Object Model (OM)
- Silverlight Web Part

Courtesy: topsharepoint.com

Cheers,
--aaroh




How ASP.NET Developers can leverage SharePoint

Hi all,

While browsing something with respect to SharePoint and relation to ASP.NET.
I found a fantastic presentation from one of SharePoint MVP Jeremy (of SPSource fame - Reverse engineering tool for SharePoint) and brilliant comparison of ASP.NET against SharePoint.

This is the link: How ASP.NET Developers can leverage SharePoint.
And here is the full comparison.

Cheers,
--aaroh

Wednesday, October 28, 2009

Using Feature Properties and its benefits

Hi all,

While working for one of my project, I have to use feature properties. Let me introduce why we need "Feature Properties"

Q. What is exactly is a "Feature property" and why its useful?
Ans. Well, we know that feaure.xml file has certain elements as follows:

i) ActivationDependencies
ii) ElementManifests
iii)Properties

Each element has different use. For e.g.

i) ActivationDependencies is to indicate prevents the current Feature from being activated unless the Feature with the specified ID is activated.

For instance,
<Activationdependencies>
        <activationdependency featureid="11111111-1111-1111-1111-111111111111">
<ActivationDependencies>

ii) ElementManifests contains references to element manifests and element files that contain definitions for the Feature elements.

iii) Properties contains a list of the default values for Feature properties.

<Properties>
<Property
Key="Color"
Value="Blue"/>
<Property
Key="Shape"
Value="Triangle"/>
</Properties>

Benefits of feature properties:

1) Use of default values for storing the data.
Feature framework uses feature properties for storing the data values and its similar functionality of ASP.NET where web.config stores all data connections, global settings and default values.

In SharePoint, we can have exactly same functionality. For e.g.
We can develop a timer job to configuration settings

<Feature xmlns="http://schemas.microsoft.com/sharepoint/"...>
<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- The name of the timer job (will appear in Central Admin >> ). -->
<Property Key="JobTitle" Value="Aroh's Timer Job"/>
<!-- Connection String that the TimerJob will use -->
<Property Key="ConnString" Value="ConnectionString..."/>
<!-- The schedule to run the job in (24 hour format) -->
<Property Key="Schedule" Value="daily at 02:00:00"/>
</Properties>
</Feature>


We have write a method to tap FeatureActivated method:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
// Get all the properties from the feature.xml file
string jobTitle = properties.Feature.Properties["JobTitle"].Value;
string connString = properties.Feature.Properties["ConnString"].Value;
string dailySchedule = properties.Feature.Properties["Schedule"].Value;

// Create the job.
CustomTimerJob customTimerJob = new CustomTimerJob((SPWebApplication)properties.Feature.Parent, jobTitle);

// Set the properties for the job to run properly
customTimerJob.Properties.Add("ConnString", connString);
customTimerJob.Properties.Add("Schedule", dailySchedule);

// Set the schedule
SPSchedule mainSchedule = SPSchedule.FromString(dailySchedule);
customTimerJob.Schedule = mainSchedule;

// Activate the schedule
customTimerJob.Update();
}

Later on, we use timer's job "Execute" method to use feature properties

public override void Execute(Guid targetInstanceId)
{
// Set up configuration values
string connString = this.Properties["ConnString"] as string;
...
}

Another example is where we fixed URLs have to be used.
For e.g. We have a URL:
http://testserver/apac/tools

Now, we can use it in a feature properties as follows:

<Feature Id="40fefb9d-c00a-48fc-b5c8-98ed0263eb0f"
Title="[IT] Alert Notification Job"
Description="Description for AlertNotificationInstaller"
Version="12.0.0.0"
Hidden="FALSE"
Scope="WebApplication"
DefaultResourceFile="core"
ReceiverAssembly="Company.SystemChecklists, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fbfd703f61794815"
ReceiverClass="Company.SystemChecklists.AlertNotificationInstaller"
xmlns="http://schemas.microsoft.com/sharepoint/">
<Properties>
<Property Key ="ApacSite" Value="apac"/>
<Property Key ="ToolsSite" Value="Tools"/>
</Properties>
<ElementManifests>
<ElementManifest Location="elements.xml"/>
</ElementManifests>
</Feature>

And in the execute method (of timer job) we can use feature properties:

public override void Execute(Guid contentDbId)
{
siteName = this.Properties["ApacSite"].ToString();
webName = this.Properties["ToolsSite"].ToString();

// get a reference to the current web application
SPWebApplication webApplication = this.Parent as SPWebApplication;

// get a reference to the Site Collection in the content database
using (SPSite spSite = contentDb.Sites[siteName])
{
// get a reference to the Web
using (SPWeb spWebRoot = spSite.OpenWeb(this.Properties["ToolsSite"].ToString()))
{
// TIMER JOB LOGIC
}
}
}

2) Another use of feature properties is that XML files is not complied.
Therefore, if can to alter the URL from http://testserver/apac/tools to http://testserver/apac/IT/tools, it can be very easily changed in the feature properties itself and just upgrade the solution.

There is NO need to alter the DLL again.

Some important points to be noted:

>> If you want the timer job on Web scope instead on Web Application scope, first DEACTIVATE the feature
>> Alter feature.xml
>> ACTIVATE the feature.

If you don't deactivate the feature and directly change the feature.xml, then your timer job and your SharePoint instance will be screwed up. Solution is there in my post as well.

Cheers,
--aaroh

Low Code Reimagined with AI + Copilot Pitch Deck - Copy Copilot day (Virtual) - 2023

 Hi All,  I presneded a session at Pune UG on Low Code Reimagined with AI + Copilot Pitch Deck.  Video is at this address  https://www.youtu...