Recycle Bin.. Continued..End Game

After all this, one thing still remains – the javascript function mentioned in the install instructions. So here goes. <script language=javascript> function Custom_AddDocLibMenuItems(m, ctx) {   var RootFolder = GetRootFolder(ctx);   setupMenuContext(ctx);    if (currentItemFileUrl == null)       currentItemFileUrl = itemTable.ServerUrl;   if (currentItemFSObjType == null)       currentItemFSObjType = itemTable.FSObjType;   var currentItemEscapedFileUrl =       escapeProperly(unescapeProperly(currentItemFileUrl));       // document library might contain folders;…


Recycle Bin.. Continued

Setup instructions A) Setting up the configuration   1) Copy the xml files ‘Configuration.xml’ and ‘TrashConfiguration.xml’ to the location ‘C:\Sharepoint\’ 2) Open the file ‘Configuration.xml’ in notepad and make a note of the values for ‘Mirror’, ‘Recycle’ and ‘Main’. 3) In the ‘Configuration.xml’ file modify the value for domain, User and Pass, to the corresponding…


Recycle Bin.. Continued

Project Structure: Handler 1: Handles Upload(insert) and Delete events , Name: DocLibrary ————– BaseEventSink.cs (from the first post) ————– EventSinkData.cs(from the second post)   Handler 2: Handles the Restore event (which is in fact the insert event again), Name: WasteBasket ————– BaseEventSink.cs (from the third post) ————– EventSinkData.cs(from the fourth post) We also need two configuration files…

1

Recycle Bin.. Continued

The second class for the second event handler: /*=====================================================================   File:      EventSinkData.cs   Summary:   Class to collect data for the event sink. ———————————————————————   using System; using System.Xml; using System.Xml.Serialization; using System.Text; using System.IO; using System.Configuration; using System.Collections.Specialized; using System.Collections;   namespace RecycleBin.SharePoint.Configuration {       [XmlRoot(“Data”,Namespace=””)]         /// <summary>       /// Summary description for…


Recycle Bin.. Continued

Now that we have handled the Upload and Delete events, let us handle the Restore event. Implemented in a class library which contains similar classes as the earlier library. Again we have a BaseEventSink class which is extended from the default available with the event handler toolkit and the EventSinkdata class  /*=====================================================================   File:      BaseEventSink.cs  …


Recycle Bin.. Continued

/*=====================================================================   File:      EventSinkData.cs   Summary:   Class to collect data for the event sink. ———————————————————————   using System; using System.Xml; using System.Xml.Serialization; using System.Text; using System.IO; using System.Configuration; using System.Collections.Specialized; using System.Collections;   namespace RecycleBin.SharePoint.Configuration {       [XmlRoot(“Data”,Namespace=””)]         /// <summary>       /// Summary description for EventSinkData.       /// </summary>       public class EventSinkData…


Recycle Bin

With v2 of Sharepoint, restoring deleted documents was a much sought after elixir. And to that effect were made a number of attempts at coaxing the product to allow us to retain copies of the deleted items. Once such simplistic approach was documented and well presented by Maxin V Karpov and Eric Schoonover in the…

2

Musings…

Its been quite some time since I consciously dug out time to write something here. The past couple of months have been a helluva time. I started with getting the feelers on office 12 and then the whole bunch of technological challenges that throws up. Most of my time has been spent just getting to know the “stuff…

2

Listless

This is something really silly. Any list that is a part of a site can be accessed by using a small snippet that looks more or less like this:SPSite site = new SPSite(http://localhost”);SPWeb web = site.OpenWeb();SPList list = web.Lists[index];Now lets say you want to add an item to an ordinary list. The snippet would go…


Trustworthy!!

The other day I landed on a very interesting issue. Before I break in the solution, let me just try and explain the problem the way it came in. Well, there was this guy who had created a custom web part to fetch a report from some database. He was supposed to be using a SQL…

1