Tuesday, November 24, 2009

Final, Finally or Finalize?

Final access modifier
  • Final can be used for classes, methods, and variables
  • Final varibles can't change from the initialized values
  • Final classes can't be subclassed
  • Final methods can't be overriden
  • C# uses the keyword "sealed" instead of "final" for classes and methods
  • A class or method can be "sealed"
  • A "const" may be used for equivalent of a "final" variable

Finally block
  • Finally is used in exception handling
  • Finally is a part of the try-catch-finally
  • Finally is executed even if no exception is thrown
  • Read more on finally in this post

Finalize() method
  • Finalize() is a non-explicit way to clean up resources
  • Memory resourses for the object are cleaned up using Finalize()
  • Finalize() is called during garbage collection to allow objects to clean up unmanaged resources
  • Finalize() should always be protected
  • Finalize() should release unmanaged resources only

Wednesday, November 18, 2009

How many ways to backup your SharePoint web site?

Quick notes on various methods available for SharePoint 2007 backup.

  • Through Central Admin GUI
    (Central Administration > Operations > Perform a Backup)
  • Command line backup using STSADM
    (stsadm -o backup -directory/site)
  • Using SharePoint Designer
    (Site > Administration > Backup Web Site)
  • Database Backup using MS SQL Server - Click here for more details
  • Microsoft System Center Data Protection Manager (DPM) - Click here for more details
  • Recycle Bin and versioning - Click here for more details
  • Third-party tools



Your Ad Here

Sunday, November 15, 2009

Why My Blog Doesn't Show in Google?

If you are worried about your blog not being listed in search results on Alexa, Bing, Clusty, Google, Yahoo or any other one, you're not alone. The answer - follow these simple tips, keep working and it'll show up soon.

1. Content is the king
We humans see a site while teh search engines read the sites. The best you can do is to improve your contents.

2. Networking is important
Links are as important for your blog as references are for you. Get your blog linked from your own other blogs and sites. Ask your friends and family to link to your blog. Read other blogs and leave comments often. One referral from popular sites is more valuable than three from some vague one-page site.

3. Keep it clean
Don't even try to fool the search engines. The days of long and unrelated "keyword" meta-tags are over. Unrelated white keywords on white background just to fool the search engines can do you more harm than benifit.

4. Plain text before cool animation
Pretty images and an impressive Flash piece may make your blog look great but as far as search is concerned, the contents are immensely valuable. Don't forget to use tags such as "ALT" and TITLE" with your images.

5. Update often
More often you update, more visits you'll have from the visitors and more updates from the search engines. An average search engines is not interested in a blog that was last updated three three years ago.

6. Listen to the experts
There is good advice on the Internet to help you. Listen to the experts and get benefited.

7. Title matters
The title of your blog is very important and so are the headings. Use these judiciously.

8. Submit to search engines and site directories
Manually submit your site to search engines such as Yahoo, Google etc.

9. Have patience
You don't jump to the top overnight. Search engines may take long to completely index your blog. Remember, perseverence pays.

Following these simple tips will help you get a higher rank fast. Good luck!

Wednesday, April 1, 2009

Visual Studio 2008 extensions for Windows SharePoint Services 3.0 - Problem

When you try to install Visual Studio Extensions for Windows SharePoint services or SharePoint 2007 on your Windows XP workstation, it fails after displaying the following or similar message:
"This product can only be installed if Windows SharePoint Services 3.0 has been installed"

You don't have to install WSS on your workstation. Even if you try, it fails after showing a message similar to the following:
"This product requirs Windows Server 2003 SP1. Install this service pack and re-run setup"

I attempted a few workaround and then came across Umakanth's blog post  that fixes this problem in one simple registry edit to make the setup program believe that SharePoint is installed on your workstation.

1.Run regedt32 and navigate to
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools]

2. If there is a key "Web Server Extensions" get into it else create one

3. If there is a key "12.0" get into it else create one

4. Create the following string value
Name = Sharepoint
Value = ”Installed”

5. Re-run the setup and see it work.
Wait! Though the extensions are installed, your project may still show errors like "Could not load file or assembly" when you reference "Microsoft.Sharepoint" and other assemblies.

All you need is to drag the SharePoint assemblies from folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI on your ShaerPoint server and drop to c:\windows\assembly folder of your workstation. Make sure that the files are from a 32-bit server.

Sunday, March 1, 2009

Search Web Parts in MOSS 2007

MOSS 2007 has nine built-in web parts for search to provide a powerful tool to customize the search results and the user interface without writing lengthy code. These web parts are listed below:
Advanced Search Box
  • People Search Box
  • People Search Core Results
  • Search box
  • Search Core Results
  • Search High Confidence Results
  • Search Paging
  • Search Statistics
  • Search Summary

Saturday, February 28, 2009

Public Web Sites Hosted on MOSS 2007

When I asked someone about a few local web sites being hosted on MOSS 2007, her answer was, "Everyone uses MOSS." I wasn't surprized by the answer though it didn't help me. At wssdemo, I found a list of hundreds of web sites hosted on MOSS 2007: http://www.wssdemo.com/Pages/websites.aspx

Tuesday, February 24, 2009

Approval Workflow Status Values in MOSS 2007

The workflow approval status values are listed below:
the integer values:

0 - Not Started
1 - Failed on Start
2 - In Progress
3 - Error Occurred
4 - Stopped by User 
5 - Completed
6 - Failed on Start, Retrying
7 - Error Occurred, Retrying
8 - View Query Overflow
15 - Canceled
16 - Approved
17 - Rejected

Thursday, February 19, 2009

The 12 Hive in MOSS 2007 Explained

The legendary 12 hive folder is where the OOB system files are located afterSharePoint 2007 installation. 


It is located at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12" in a standard MOSS 2007 installation. This folder contains the following sub-directories:


  • ADMISAPI - This folder maps to IIS virtual directory  for SharePoint Central Administration web service
  • BIN - MOSS utilities binary files such as STSADM.EXE. Sub-directory LCIDD stores language specific binary files in individual folders for each language. 
  • CONFIG - As the name suggests configuration files used by MOSS
  • Data - Indexing services save indexes here.
  • HCCab - A set of cab files containing manifest and content information used by the SharePoint help sytem are stored in LCID subdirectory
  • Help - The help files used by the configuration wizard
  • ISAPI - This folder maps to IIS virtual directory "_vti_bin" and stores all the standard Web Services for SharePoint except SharePoint Central Administration.
  • LOGS - SharePoint logs.
  • Resources - Localization resources for SharePoint sites
  • TEMPLATE - The templates for a SharePoint web site. The features and xml files are also stored in subdirectories of this folder.

A snapshot of 12 hive folder (Click image to zoom)

Thursday, February 12, 2009

Server Roles in a MOSS Farm

The architecture of a MOSS farm may contain one or more servers. These servers have various roles which can be divided into three broad categories, Web Front End (WFE), application server and database server.


1. Web Front End (WFE) Servers
The fast and lightweight WFE servers interact with the user. The MOSS site is hosted on the IIS installation on WFE. These servers connect to the database servers to query the MOSS database for grabbing the requested content and rendering the results in the client browser. All WFEs in a farm must be identical and may be load balanced.

2. Application Servers
An application server provides all shared service level capabilities to the users through WFEs.Just like WFEs, load balancing can be implemented on the application servers too. Following are some examples of the shared services hosted on an application server:
  • Search Indexing
  • Search Query
  • Excel Calculation Service
  • Windows SharePoint Services Search
3. Database Servers
The database server has the maximum impact on the availability of the MOSS solution because it is the single point of data storage for all MOSS data (users, applications and configurations). Redundancy and high availability can be ensured by clustering or mirroring.

Thursday, February 5, 2009

Some SharePoint Jargons

Here is a quick reference of a few  abbreviations, acronyms, and   commonly used while working with SharePoint:

ADSI - Active Directory Service Interfaces
AJAX - Asynchronous JavaScript and XML
BDC - Business Data Catalog
BLOB - Binary Large Objects
CAML - Collaborative Application Markup Language
CAS - Code Access Security
DPM - Data Protection Manager
ECS - Excel Calculation Serv ice
GAC - Global Access Cache
IIS - Internet Information Server
ITIL - Information Technology Infrastructure Library
KPI - Key Performance Indicator
LDAP - Lightweight Directory Access Protocol
LINQ - Language Integrated Query
LOB - Line of Business, Large Objects
MOSS - Microsoft Office SharePoint server
OLAP - Online Analytical Processing
OOB - Out of the Box
SLA - Service Level Agreement
SKU - Stock Keeping Unit
SSP - SharePoint Service Provider
STS - SharePoint Team Services
WCF - Windows Communication Foundation
WFE - Web Front End
WSDL - Web Services Description Language
WSP - Windows SharePoint Solution Package
WSS - Windows SharePoint Services

Monday, January 26, 2009

Default Security Levels in SharePoint 2007

User security levels can be assigned by the administrator. There are four levels by default. Custom security levels can be created by various permutations and combinations of the permissions. The four out-of-the-box (OOB) levels are as listed below:
  • Reader - Has read-only access to the Web site.
  • Contributor - Can add content to existing document libraries and lists.
  • Web Designer - Can create lists and document libraries and customize pages in the Web site.
  • Administrator - Has full control of the Web site.

Monday, January 19, 2009

WSS 3.0 Web Services

A complete reference is available at this MSDN link for the following WSS 3.0 web services:

Administration Web Service
Alerts Web Service
Authentication Web Service
Copy Web Service
Document Workspace Web Service
Forms Web Service
Imaging Web Service
List Data Retrieval Web Service
Lists Web Service
Meetings Web Service
People Web Service
Permissions Web Service
SharePoint Directory Management Web Service
Site Data Web Service
Sites Web Service
Search Web Service
Users and Groups Web Service
Versions Web Service
Views Web Service
Web Part Pages Web Service
Webs Web Service

Sunday, December 21, 2008

MOSS 2007 Web Services

MOSS 2007 web services are actually ASP.NET Web Services (ASMX). The physical files for these ASMX web services are located in the IIS virtual directory "_vti_bin" which physically maps to the folder "%Program Files%\Common Files\Microsoft Shared\web server extensions\12\ISAPI" through SharePoint metadata and HttpModules. Following are a few out of the box services available with MOSS 2007:

Search - spsearch.asmx
Lists - Lists.asmx
List Data Retrieval  - DspSts.asmx
People - People.asmx
Permissions - Permissions.asmx













spsearch service and methods


The admin web service for "Central Administration" is located in IIS virtual directory "_vti_adm" which physically maps to the folder  "%Program Files%\Common Files\Microsoft Shared\web server extensions\12\ADMISAPI."

Each one of these services consist of a *.wsdl.aspx file and a *.disco file too besides .asmx files for the service WSDL (Web Services Description Language), and  the service discovery implementation.

The URL for the Admin.asmx web service:
http://:portnumber/_vti_adm/Admin.asmx

The URL for all other services is:
http:///_vti_bin/.asmx

Sunday, December 14, 2008

Differences between interface and abstract class

The interfaces and abstract classes, both can't be instantiated. While an abstract class contains both implemented and non-implemented methods, an interface contains only abstract methods.

INTERFACE
  • An interface is pure contract
  • Interface must be public
  • It may be left unused after declaration
  • When used, Implementing class must override all methods provided by that interface.
  • It contains only unimplemented methods and no function definitions
  • Variable must be abstract and final
  • Methods take abstract as default.
  • A single class can implement multiple interfaces.
  • Interface properties are included with "implements" key word

ABSTRACT CLASS
  • Abstract class must contain at least one abstract method
  • It can contain function body
  • It contains both implented and unimplemented method.
  • It allows both abstract and non abstract methods.
  •  It must be used if declared, otherwise compiler gives an error.
  • It may be public or protected.
  • Only one class can extend abstract class.
  • Abstract properties are included with extends keyword.

Thursday, December 4, 2008

Advanced features of MOSS 2007

  • User Interface (UI) and navigation enhancements
  • Document management enhancements
  • Enhanced Search, Workflows, Lists  
  • Office 2007 Integration
  • New Web Parts and Site-type templates
  • Business Data Catalog
  • Search Center
  • Report Center
  • Business Intelligence and Excel Server
  • Forms Server and InfoPath
  • The “Features” feature

Tuesday, November 4, 2008

User Controls v/s Custom Controls

User Controls
  • Custom, reusable controls created like forms
  • Reside in .ascx files
  • Can't be added to Visual Studio toolbox
  • Used either by dragging and dropping on an .aspx page or by adding manually with "@register" tag
  • Created by using existing Webserver and HTML server controls
  • The class is derived from System.Web.UI.UserControl class
Custom Control
  • Reusable controls
  • Developed by a developer or vendor
  • Derived from System.Web.UI.Control class for non-visual elements
  • Derived from System.Web.UI.WebControl class for visual interface
  • Deployed either in Bin directory or in Global Assembly Cache (GAC)
 

 

 

Saturday, October 4, 2008

Some good SharePoint Blogs

Just a list for some good resources (blogs, websites etc.) related to SharePoint, ASP.NET, and other related subjects. I'll keep updating this list as often as possible.

Monday, March 31, 2008

Try, Catch (and Finally)

The purpose of the try, catch, and finally blocks is to trap unexpected exceptions. A common usage is to obtain and use resources in a try block, trap exceptional circumstances in a catch block, and release the resources in the finally block. With a combination of input validation controls and keeping expected errors in mind while coding, the use of try-catch-finally can minimize the possibility of an ASP.NET application crashing.

 
Try Clause
  • The try block encloses the code being executed.
  • The exceptions may be thrown on completion of this block.
  • There is only one Try block per try-catch-finally combination.

 
Catch Clause
  • The catch blocks are optional.
  • Thess blocks catches the exceptions.
  • The catch blocks are executed only if exceptions occur.
  • The catch blocks may be defined without arguments though not recommended.
  • It is suggested to have the object argument derived from System.Exception
  • There may be more than one specific catch clause in the same try-catch statement.

 
Finally Clause
  • The finally block is optional.
  • When used, finally block is executed without fail.

Tuesday, February 5, 2008

Site Collection versus Site

There are ocassions when you ask yourself if it makes sense to create a new site collection or a new site. The question may look simple to many but a bad decision may have serious consequences. Many organisations keep only one site collection and add a lot of sites to it leaving no room for scaling. Site collections have several advantages such as distributed administration. Dave Wollerman wrote an excellent article explaining the advantages of having multiple site collections.
Site Collection Logical Architecture

Thursday, October 4, 2007

Input Validation in ASP.NET

Input validation is very important for web application because an open input field can lead to successful hack attempts, system crashes, malicious data manipulation, data corruption, and notorious Denial of Service (DoS) situation. ASP.NET has five built-in validator controls to make life easier. A validator is a control that checks one input control for a specific type of error condition and displays a description of that problem. These controls improve performance besides simplifying validations.
  • RequiredFieldValidation
  • CompareValidator
  • RangeValidator
  • RegularExpressionValidator
  • CustomValidator

Monday, October 1, 2007

What is HL7?

  • Full form of HL7: Health Level Seven
  • Accredited standards to share clinical and administrative data
  • Promoted by Health Level Seven Inc. (USA) Ann Arbor, MI (USA)
  • Freely available without licenses or license fees 
  • Copyrighted for accuracy and integrity
  • HL7 message format: human readable ASCII
  • HL7 message  -> consists of segments
  • Over 120 different segment types are available
  • Segments are separated by line feeds (\r or 0x0D)
  • A segment begins with a three letter name such as MSH
  • Segment examples: MSH (Message Header), PID (Patient Info)
  • Segment -> consists composites (or fields)
  • Composites are separated by | characters (or \F\)
  • Composites may contain other composites (sub-composites or sub-fields)
  • Sub-fields are separated by ^ characters (or \S\)
  • Sub-composites may contain other composites (sub-sub-composites or sub-sub-fields)
  • Sub-sub-fields are separated by & characters (or \T\)
  • HL7 website: http://www.hl7.org/
  • HL7 on Wikipedia: http://en.wikipedia.org/wiki/HL7
  • HL7 glossary of terms: http://www.hl7.org/ehr/documents/public/documents/Glossary%20of%20terms.pdf