Friday, March 26, 2010

Caching the PropertyBag in WSS3.0

For one of the req i have got the chance to go through the CKS code.Here i would like to onboard the code snippet.
The below code illustrates how to use Lock(),HttpRuntime.Cache and SPproperybag etc.
public class BlogSettings
{
private readonly object _Lock = new object();
private static readonly Cache Cache = HttpRuntime.Cache;
private SPWeb _CurrentWeb;
///
/// cached WebProperties
///

private readonly SPPropertyBag _WebProperties;
///
/// always create a new BlogSettings object to be able to store WebProperties
///

///
public BlogSettings(SPWeb oWeb)
{
_CurrentWeb = oWeb;
_WebProperties = null;
}
///
/// read BlogSettings from Cache. if the cache is not available, read blogsettings and store them in the cache (with sliding expiration).
/// this BlogSettings object is read only!
///

public BlogSettings(string url)
{
string webUrl = GetWebUrl(url);
string blogSettingsCacheName = string.Format("EBE{0}", webUrl);
lock (_Lock)
{
// try to get blogsettings for this webUrl from the cache
var blogSettings = Cache[blogSettingsCacheName] as SPPropertyBag;
if (blogSettings != null)
{
Trace.WriteLine("Using cached BlogSettings (webUrl=" + webUrl + ")");
}
else
{
// read blogsettings from web
Trace.WriteLine("Reading BlogSettings and store them in the cache (webUrl=" + webUrl + ")");
using (var site = new SPSite(url))
using (var web = site.OpenWeb())
{
var bs = new BlogSettings(web);
blogSettings = web.Properties;
int cacheTimeout = bs.PageOutputCacheTimeout;
Cache.Add(blogSettingsCacheName,
blogSettings,
null,
Cache.NoAbsoluteExpiration,
TimeSpan.FromMinutes(cacheTimeout),
CacheItemPriority.Normal,
null);
}
}
_WebProperties = blogSettings;
}
}

Tuesday, March 23, 2010

CKS:EBE Community website based on SharePoint

CKS:EBE2.0 has been availale on CodePlex.
CKS:EBE is a Feature?...Noooo...it is a huge application on WSS
The first thing to say about the CKS:EBE is that it is a feature, not a site template. Essentially this means that you can create a standard WSS blog site and use it, later you can add the EBE functionality if you want. This is very useful as it does not require you to make a decision about what type of blog you are going to use when you initially create the WSS site.
Every WSS developer should go through the code and analyze for Best practices.
It has been using for me while doing my current assignment.
This solution mainly focus the wss core things like features that contains all the pages, lists ,new columns,custom themes,storing Media files in Lists,HttpHandler and HttpModules,custom controls,braning files and lot of xsl needed for the EBE.

Sunday, January 17, 2010

More Pics on Winner Legue 09 function!

Winner Legue 09 function has happend on Nov09.
The actual link is
@http://naveedshare-licensetoplay.blogspot.com/2009/12/knowledge-champion-on-moss.html
I would like to add few pics on this board.




Thursday, January 14, 2010

SharePoint 2010 technical videos

The Channel 9 Learning Center is the destination for free technical training on MS Technologies.
Currently it has updated the portal with SharePoint2010.

Sunday, January 3, 2010

Validations on InfoPath2007?

I did two projects on Infopath2007 . I got the chance to work on high level info path object model and have played around one year on infopath surface.
I would like to post one of the simple screenshot which explain the validation of the form.

After reviewing related docs Supervisor group should change task status based upon errors.
In this screen shot based on Minor and Major errors(s) user should select the proper approval choice (COMPLETED, COVERWRAP, INVALIDXEMID, REJECTED, ALREADYAPPROVED, AWC, NOTSTARTED, FAILED and SUBMITTED etc).
These three controls would depend upon each other. I implemented rules to select proper options based upon severity else show error message on the form.

Wednesday, December 30, 2009

Variations in MOSS2007

From Last few months i have been working on WCM features for one of the world class intranet portal. Especially on PageLayouts for publishing article pages,List templates,Site Definition ,Conent Types,WebParts,Social sites from NewsGator and Variations.
In this post I would like to explain how to implement multilingual on MOSS.
1. Open the Site Settings of the top-level site and click on Variation Settings.
2. On the Variation Settings page

3. In the Site Settings page, click now on Variation Labels.
A. Click New Label and create the source label.
B. Enter English as the label name.
C. Set English as the display name.
D. Set the local to English (United States)
E. Check Set this variation to be the source variation.
F. Select appropriate site template
(In the below screencast we are using custom site definition)
G. Click OK.

4. Like that we r using 10 variation Labels

Based on the profile settings and browser settings default locale page would open.User can select required language based on the user control

Wednesday, December 2, 2009

Knowledge Champion on MOSS?

On 18th Nov Winners League'09 held in HCL,Noida.
I have selected as a SharePoint Knowledge Champion and am HCL T2ID SharePoint Trainer also.

I’m really pleased to get the award, as it’s nice to be recognized by HCL T2ID for what I’ve done. I find it useful (to me anyway!) to have a bit of reflection on what I’ve been up to for the last year.