Monday, August 10, 2009
MOSS 2007:List of backup and recovery tools
http://technet.microsoft.com/en-us/library/cc287880.aspx
This article however doesnt mention The SharePoint Designer backup and recovery which is very useful in backing up and restoring almost all levels of MOSS sites(farm,web app,site collectio,subsites) ,mostlysubsites and in also performing backup and restore when one doesnt have direct access to the production server
Friday, August 7, 2009
MOSS 2007: Creating Multi Lingual portals
http://sharepoint-sezai-moss-2007.blogspot.com/2008/02/setting-up-multilingual-moss-2007-farm.html
http://old.markharrison.co.uk/blog/2007/02/moss-2007-multi-lingual-solutions.htm
Thursday, August 6, 2009
Creating a custom list content type
http://cairocafe.blogspot.com/2007/08/moss-2007-content-types.html
Wednesday, August 5, 2009
MOSS Taxonomy and benefits :An excellent article
The following is an article that i found in an excellent blog detailing the beneifts of developing a strong corporate taxonomy as part of a SharePoint 2007 implementation. Hopefully you will find it useful.
Here is the link to the article of which I too have an extract below:
http://joeshepherd.spaces.live.com/Blog/cns!9AE2097A4A610B63!120.entry
The case for a Taxonomy
Understanding the benefits:
Developing a metadata taxonomy is a core step in defining an effective SharePoint 2007 deployment that will be readily accepted by your customer base. This process consists of categorizing the content of your sites and deciding on how users will locate that content. SharePoint offers several key features that make business more flexible and efficient and a solid taxonomy is the foundation that each of these features are built upon. While these features will work without a well formed taxonomy, the existence of even the most simplistic taxonomy can greatly increase their effectiveness. A brief list of features and how they benefit from a taxonomy is detailed below.
- Content Types
SharePoint 2007 offers a feature known as a Content Type that can be defined by site and site collection administrators. Content Types are wrappers of MetaData that are created around any set of core content types that exist inside the “out – of – box” SharePoint deployment. These core content types are a Word Document and an InfoPath Form. Administrators can extend these core types and use them to create new custom content types within SharePoint. Administrators specify the MetaData that is associated with the new content type along with any workflows or templates that may be required.
For example, an administrator can create a custom Content Type of Policy that is based on a word document. That content type could then have certain attributes associated with it such as “Association” that specifies weather this policy applies to a specific department or to the entire organization. Custom workflows could also be attached to this Policy that sends out notifications upon changes to everyone who has an interest in the policy.
These MetaData attributes provide the greatest functionality if they can be tied back to a larger corporate taxonomy that lays the ground work for defining that MetaData. Content types are a powerful feature in SharePoint 2007 but in order to use them to their potential you must first develop a comprehensive plan on how to categorize your information. Doing so allows you to hone in on those attributes that provide the greatest flexibility and power. - Navigation
Navigation is one benefit of a well thought out taxonomy since it dictates how users navigate the site and its various sub-sites in search of content. Most organizations will opt for a hierarchical taxonomy in this area that closely mimics their organizational structure. This allows for a navigational structure that the user is familiar with.
For document repositories, such as the document center, navigation based on the taxonomy is important because it allows users to get to the information that they are looking for in a timely manner. If the user is looking for a project request form, the best scenario would be to have that form exist in a Forms library inside the document center. All forms in the organization would exist inside this library that could be further segregated by departments or any other lower level category. A taxonomy will help drive out these requirements up front in the planning stage when changes can me made with little to no cost impact. - Search and Indexing
By effectively leveraging content types that extend a well formed taxonomy, search results can be tailored to specific audiences within SharePoint. This feature will allow administrators to provide targeted search results based upon MetaData attributes for specific users. For instance if a user in accounting performs a search on Policies SharePoint can serve up a subset of that search result that is targeted only to personnel in the accounting department; thus returning only accounting specific policies. The Search mechanism works in tandem with the Content Types to leverage that MetaData derived from the taxonomy. - Audience Targeting
Just as search results can be targeted based on audiences so can content within the individual SharePoint sites themselves. This creates the ability to intermingle content in the accounting site and specify that that content only be visible to individuals in the accounting department. This provides an abstract layer of security at the site level that would otherwise have to be configured via roles and access permissions. Once again this capability is largely driven off the effective use of Content Types and those MetaData attributes. - Information Categorization and Retrieval
Just as you would organize the documents in your filing cabinet so should you take the time to develop a consistent classification system for the content of your SharePoint sites. Going through the work of establishing a solid taxonomy and MetaData system now will allow you to organize your information into categories that afford users the ability to rapidly locate any information or content they need. The taxonomy helps to ensure that everyone thinks about each item of content the same way. It provides a consistent way of classifying and describing content and information. It also allows you to ensure that the content is stored on the correct place, it is made available to the correct people and that it is managed in a manner that is consistent with that type of content.
Tuesday, August 4, 2009
Debugging custom SharePoint applications
First thing you need to do to avoid the old fashioned trial and error technique is to enable debugging. This could be achieved by setting the compilation element debug attribute to true in Web.Config from the virtual directory containing your SharePoint application, otherwise, breakpoints inside Visual Studio will be shown but will never be used.
Once you’ve done that, there is one more thing you need to do in order to be able to debug your SharePoint code in Visual studio which is attaching a debugger to W3WP.EXE, Attaching a debugger in Visual Studio will allow you to step through the code and find exactly where the error occurs.

It’s really handy but there are three questions that I always receive from my colleagues when they get started to SharePoint programming, so I decided to share the answers with you.
The first one is: Sometimes, I set breakpoints and attach to the process but Visual Studio skips loading the symbols if I’m debugging a deployed assembly to the GAC and I fail to debug the code
Easy, Open Tools -> Options -> Debugging.
You’ll find an option labeled Enable Just My Code (Managed Only) as shown in the figure which is checked by default. Uncheck this option to be able to debug the assemblies located in the GAC.
There is a common myth among .NET developers in general and especially SharePoint ones, that in order to debug assemblies that have been deployed to the GAC, you need to copy the debug symbols (PDB File) to the GAC as well. This was true in the early days of .NET but this is no longer true.
Ok, this is easy too. Just follow the following steps.
Open the command prompt window, run IISAPP to get a list of the current instances of W3WP.exe.
Note the PID of the instance that corresponds to your web application.
Now return to VS, select Debug -> Attach to process and attach to the W3wp.exe instance with an ID equivalent to the PID you got in step 2 -> click Attach.
Now you can trace through the code and find the error causes easily.
But the question still remains, why sometimes are they more than one w3wp.exe instance? This is because the SharePoint Administration Site Collection and the SSP Administration site always have their own Application pools for error isolation purposes.
And the third question is : Is it possible to debug Inline code blocks ?
Actually, I hate Inline Code Blocks and it’s really a good practice to avoid it due to the performance issues when the JIT compiler compiles them but YES, you can do that.
So now you knew the process of debugging? Very boring and repetitive huh? Hmm, Can’t that be automated?Fortunately Jonathan Dibble, a brilliant developer, created a very handy “Debugger Feature” that can be installed and activated on a SharePoint site to automate this process. Once activated, the Debugger Feature adds an “Attach Debugger” menu item to the Site Actions menu. Extremely helpful and faster than doing that from visual studio.
To read the complete article go on to:http://sharepointmagazine.net/technical/development/getting-started-with-sharepoint-programming-simplifying-sharepoint-debugging-by-creating-the-troubleshooting-toolbox
Happy Debugging :)Monday, August 3, 2009
How to write to Event Log using visual C#
Event logging provides a standard, centralized way for your applications to record important software and hardware events. Windows supplies a standard user interface for viewing the logs, the Event Viewer. By using the common language's run-time EventLog component, you can connect to existing event logs easily, on both local and remote computers, and write entries to these logs. You can also read entries from existing logs and create your own custom event logs. In its simplest form, writing to an event log involves only a few steps to create a sample application. To do this, follow these steps:
- Open Visual Studio C#.
- Create a new Console application in Visual C#.
- The Console application creates a public class and an empty Main method for you.
- Verify that the project references at least the System.dll file.
- Use the using directive on the System and System.Diagnostics namespaces so that you do not have to qualify declarations from these namespaces later in your code.
You must use these statements before any other declarations.
using System;
using System.Diagnostics;
To write to an event log, you must have several pieces of information:
Your message, the name of the log you to which you want to write (which will be created if it does not already exist), and a string that represents the source of the event.
You can register a particular source with only a single event log; if you want to write messages to more than one log, you must define multiple sources.
string sSource;
string sLog;
string sEvent;
sSource = "dotNET Sample App";
sLog = "Application";
sEvent = "Sample Event";
Use two static methods of the EventLog class to check whether your source exists, and then, if the source does not exist, to create this source that is associated with a particular event log.
If the log name that you specify does not exist, the name is created automatically when you write your first entry to the log.
By default, if you do not supply a log name to the CreateEventSource method, the log file is named "Application Log."
if (!EventLog.SourceExists(sSource))EventLog.CreateEventSource(sSource,sLog);
To write a message to an event log, you can use the EventLog.WriteEntry static method.
This method has several different overloaded versions.
The following sample code shows the simplest method, which takes a source string and your message, and one of the more complex methods, which supports specifying the event ID and event type:
EventLog.WriteEntry(sSource,sEvent);
EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Warning, 234);
Save your application.
Run your application, and then check the Application log in the Event Viewer to see your new events.
Complete code
using System;
using System.Diagnostics;
namespace WriteToAnEventLog_csharp
{
/// Summary description for Class1.class
Class1{static void Main(string[] args)
{
string sSource;
string sLog;
string sEvent;
sSource = "dotNET Sample App";
sLog = "Application";
sEvent = "Sample Event";
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource,sLog);EventLog.WriteEntry(sSource,sEvent);
EventLog.WriteEntry(sSource, sEvent,EventLogEntryType.Warning, 234);}}}