Sunday, December 17, 2017

Patch Installation steps in SharePoint 2010

Hi,

1.What are the steps involved in Security update installation?

Below are the steps for installing any Cumulative Update/Service pack/Hot Fix/patch on SharePoint Farm (with multiple server scenario).
  • To be on safer side take copy of Inetpub and 14Hive (15Hive, 12Hive) folders.
  • Make note of Previous Upgrades from Central Admin(CA). Also review "Health Analyzer" reported issues on CA.
  • Make note of the BUILD number (farm version).
  • Install the patch on all servers in the Farm. You can do so simultaneously but don’t run the configuration wizard yet.
  • Ensure you restart all servers in the farm, after patch is installed.
  • Now run Configuration wizard first on Server hosting the CA site. Wait until it completes.
  • If wizard fails, try to fix the issue.
  • Run the configuration wizard on the next server in the farm, wait until it completes and repeat the same action on remaining servers.
  • After patching is done, verify the BUILD version if there is going to be a version number change.

2.Would there be any risk/ challenges during updating patch?

  • Config wizard may run for longer duration at step 9 as it can take some time for that step to process, especially if your content databases are large. There should not be any issue as long as it is progressing.
  • Config wizard may fail. Re-run it through CA once and if that too fails, try using ps command.

3.What are the precautions need to take before patching Security update?

  • It is always recommended to test the patch in test environment before doing the same on PROD. I hope you had already completed in QA & that should tell you about the discrepancies if any.
  • You can also work with your Database team to secure CDB backups before you install the patches and later you can restore them to the point when you took the backup should the patch installation fail.

Wednesday, May 13, 2015

Grid View Data Display on Image Button Click

Hi,

Through user control we are already displaying the data in the grid view.
Now the requirement is user should be able to see the arrow image button.
Once user clicks on the Image button, down arrow button should be displayed along with the grid view data as below

First we have written two functions to achieve this i.e.

1)ToggleRow function, it should toggle based by upon the user click on the image i.e. it should show grid view/hide.
2)Change Image function, by default it should display vertical arrow image, once user clicks on it, should display down arrow image along with grid view data
In the table, where grid view resides, we are calling them as below

Wednesday, April 22, 2015

Most Viewed Documents Web Part

Hi,

There is a document library called Sales Workshop.

Now our customer wants as web part in which top 10 documents can be scrolled which are viewed or downloaded by users.
First, have created a list with name MostViewed, added two columns with names 1)Count as type Number 2)Url as type string.
Post this, created a view TopView to display items based upon Count column in descending order.
Item Limit has been set to 10 so that to display top 10 documents
For this, console application has created to fetch the count from SharePoint logs and to insert the same into the list.
private static void InsertDataintoList()
        {
            //Change Url
            using (SPSite site = new SPSite(Constants.NucleusProdSiteUrl))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    //For QA
                    //SPList list = web.Lists[Constants.SalesWorkshopLibraryQA];
                    //For Prod
                    SPList list = web.Lists[Constants.SalesWorkshopLibraryProd];
                    SPList MostViewedList = web.Lists[Constants.MostViewedListName]; ;
                    SPAuditQuery spQuery = new SPAuditQuery(site);
                    spQuery.RestrictToList(list);
                    SPAuditEntryCollection auditCol = site.Audit.GetEntries(spQuery);
                    // Getting Audits 
                    try
                    {
                        foreach (SPAuditEntry entry in auditCol)
                        {

                            if (entry.ItemType == SPAuditItemType.Document && entry.Event == SPAuditEventType.View && (entry.EventSource ==SPAuditEventSource.ObjectModel || entry.EventSource == SPAuditEventSource.SharePoint))
                            {
                                SPListItem itemToAdd = MostViewedList.Items.Add();
                                if (((entry.DocLocation.ToString().ToLower().IndexOf("/learn/") > -1) || (entry.DocLocation.ToString().ToLower().IndexOf("/present/") > -1) || (entry.DocLocation.ToString().ToLower().IndexOf("/send/") > -1)) && !(entry.DocLocation.ToString().ToLower().IndexOf("/learn/corporate/market trigger") > -1) && !(entry.DocLocation.ToString().ToLower().IndexOf("/learn/corporate/water cooler chatter") > -1) && !(entry.DocLocation.ToString().ToLower().IndexOf(".aspx") > -1))
                                {
                                    SPQuery query = new SPQuery();
                                    query.Query = "<Where><Eq><FieldRef Name='LinkTitle'/>" +
                                            "<Value Type='Text'>" + entry.DocLocation.Substring(entry.DocLocation.LastIndexOf("/") + 1).ToString() + "</Value></Eq></Where>"
                                            + "<OrderBy><FieldRef Name='Count' Ascending='FALSE' /></OrderBy>";
                                    query.RowLimit = 5;
                                    SPListItemCollection items = MostViewedList.GetItems(query);
                                    if (items.Count == 1)
                                    {
                                        foreach (SPListItem item in items)
                                        {
                                            item["Count"] = Convert.ToInt32(item["Count"]) + 1;
                                            item.Update();

                                        }

                                    }
                                    else if (items.Count == 0)
                                    {
                                        itemToAdd["Title"] = entry.DocLocation.Substring(entry.DocLocation.LastIndexOf("/") + 1);
                                        itemToAdd["Url"] = entry.DocLocation.ToString();
                                        itemToAdd["Count"] = 1;
                                        itemToAdd.Update();

                                    }
                                }
                            }
                           

                        }
                        Console.WriteLine("All Items have been inserted into Most Viewed List");
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.ToString());
                    }                   
                   
                }
            }
        }
Now in the web part, we are just fetching the items from the list and displaying items.
We are displaying the list items in the scrolling manner through marquee tag as below
In the below cs we are just fetching the list items from list view with Hyperlink control and
Binding the hyperlink control on the panel in the user control

Of course, I could have done the console application stuff in the  web part i.e. getting data from SharePoint logs.
But as I am deleting the items, getting the consolidated count from SharePoint logs and updating the column Count.
It is taking too much to load the web part page.

That is why I have created console application to handle the same.
Created scheduler in the production server to run the console application exe daily.

Monday, April 6, 2015

Scrolling Items Not Stopping on Mouse Hover

Hi,

We had an issue within a web part i.e.

We are displaying list items through marquee tag in the web part.

In IE, once user hovers on to the list item, scrolling gets stopped and user was able to click on the file.

But in chrome/Firefox when user was hovering, scrolling on the list items was not stopping and

Due to this user was not able to click on the selected file.

Now post applying the below in the marquee tag of mouse over and mouse out it started working as expected in all the browsers.