Sunday, July 4, 2010

MOSS 2007: Enforce document storage business rules by using Document Policy.

o Create a custom document policy.
o Deploy a document policy by using a policy feature.
o Specify logic for a document policy by using a policy resource
  • .  Create Policy Feature:  Code Snippet
  • .  Create Policy Manifest:  Code Snippet
  • .  Create Policy Configuration Page:  Code Snippet
  • .  Register the Policy Feature in the Policy Catalog. 
Reference:    Ton Stegeman

Note:  Script may have not entirely workable.  Please recheck the steps.

o Expiration:  Manage document retention rules by using the expiration feature policy.
o Expiration:  Launch a workflow when a document expires.

Saturday, July 3, 2010

How To Paste Your Code Snippet in Blogspot.

1.   Goto Blogcrowds
2.   Copy and paste your coding in the text area.  Click 'Parse' button.
3.   Copy the parsed code snippet, and paste it in the HTML mode in your post.
4.   Add <blockquote></blockquote>to any lines to get much elegant look.

OR....

1.  Goto to Bloggerindraft.  Make sure that you have logged in into your Blogspot account.
2.  Follow steps from this site, BlogPandit.


Reference:  BlogPandit

SPContext. What Is It? (More Complex Example)

Perform a query on the current site for cases where item IDs are greater than 100.

SPSiteDataQuery oSiteQuery = new SPSiteDataQuery();

oSiteQuery.Query = "<Where>" +
                                " <Gt>" +
                                " <FieldRef Name="ID" />" +
                                " <Value Type = "Number"> 100 </Value>" +
                                " </Gt>" +
                               "</Where>";

oSiteQuery.ViewFields = "<FieldRef Name="Title" />"

DataTable oQueryResults = SPContext.Current.Web.GetSiteData(oSiteQuery);
oQueryResults.TableName = "queryTable";
oQueryResults.WriteXML("C:\queryTable.xml");

SPContext. What Is It?

1.  Its a SharePoint Class.
2.  It represents the context in an HTTP request.

3.  We use SPContext to return context (background / situation / perspective)information about such objects as:


- Current Web App
- Current Site Collection
- Current Site
- Current List
- Current List Item

e.g:

-  SPWebApplication WebAppCur = SPContext.Current.WebApplication;
-  SPSite SiteCollCur = SPContext.Current.Site;
-  SPWeb WebCur = SPContext.Current.Web;
-  SPList ListCur = SPContext.Current.List;

Note:  Site represents SiteCollection and Web represents Site in SharePoint 2007.