Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Thursday, May 11, 2017

Performance issues and solutions for list and libraries in SharePoint

In this blog we are going to see the root cause for performance issues faced in SharePoint List and Libraries. Main reason for the performance issue is, lack of planning and not following the best practices.

Here I have listed down few things that may be the reason for causing performance issues.

· Lack of proper planning in creation of SharePoint List and Library.
· Views with proper grouping and filter not implemented.
· Absence of archival process for old documents or list items, makes the list or library to grow day by day and that will result in performance issue if not maintained properly.
· No cleanup activities on List or Library to remove unwanted items.

How to improve the performance of List or Library?

· Enabling indexing and implementing proper filters and grouping in views.
· Using proper folder structure to organize the contents.
· Based on the usage and type of content you can plan for Document center site if the contents are more related to documents repository.
· Implement proper retention policies by setting expiry date for documents created.
· Cleanup lists and libraries periodically.
· Storing high volume of media and other documents to OneDrive or secondary storage and have those links stored in a list.
· Now in SharePoint 2016 there are lot of new features for Document libraries have been introduced. Have mentioned few of them below:   
      a. Durable links (no more bad links, even if you move the files from one directory to another, Still the users will be able to make use of the old links to the document). Note: it works only for Microsoft office documents and PDFs.
      b. Now we can use OneDrive for business to store files and can be shared with other users.
      c. Large file support: Now supports uploading and downloading files larger than 2,047 MB.
      d. Special characters are allowed in filenames.
      e. Threshold limit has been increased above 5000 and auto indexing is in place.

Wednesday, May 10, 2017

Dynamic HTML Table or Grid from JSON using JQuery in SharePoint

In this blog we are going to see how the HTML table can be created dynamically and populating the values from the return JSON value by calling Web API using JQuery.

Step 1

Edit the SharePoint WebPart page as shown below.










Click the link Add WebPart







Select Insert WebPart from the top ribbon.









Select the "Media and Content" category and find "Script Editor" from the top ribbon.


Step 2

After adding the "Script Editor" WebPart.











Click on the "EDIT SNIPPET" to type in the codes and click "Insert" to see how the codes are reflected in the page.
 
 

Below sample code can be used to fetch data from any WebAPI and to get the Return JSON for the creation of dynamic table.

Note: Please take care of the yellow highlighted parts. Those are all sample variables, it has to be changed according to your JSON response object.

Code
  <!DOCTYPE html> 
       <html> 
       <head> 
       <title>News Updates</title> 
       <style> 
       .thNews
       background-color: #  
       color: white
       } 
       .thNews, .tdNews
       borderx solid #444
       padding: 15px
       text-align: left
       } 
       </style> 
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> 
       </head> 
       <body> 
       <script type="text/javascript"> 
       $(function() { 
       var params = { 
       "Key": "<Parameter value"
       // Request parameters 
       }; 
       // provide the Web Api url (must) and include the Params (parameters) if it is required. 
       $.ajax({ 
       url: "<Web API URL>" + $.param(params), 
       type: "GET"
       contentType: "application/json; charset=utf-8"
       dataType: "json"
       cache: false
       }) 
       .done(function(data) { 
       //alert("success"); 
       var trHTML = ''
       $.each(data.News, function (i, item) { 
       if (data.News[i].State != null){ 
       trHTML += '<tr class="trNews"><td class="tdNews">' + data.News[i].State + '</td><td class="tdNews">' + data.News[i].Header + '</td><td class="tdNews">' + data.News[i].NewsDesc + '</td></tr>'
       } 
       }); 
       $('#divIncidents').append(trHTML);//To add the table row to table 
       }) 
       .fail(function() { 
       $('#divErr').append("error");// To display the error in div 
       }); 
       }); 
       </script> 
       <div><strong><span>News Updates</span></strong> 
       <table id="divIncidents"> 
       <tr class="trNews"> 
       <th class="thNews">State</th> 
       <th class="thNews">Header</th> 
       <th class="thNews">News Description</th> 
       </tr> 
       </table> 
       </div> 
       <div id="divErr"></div> 
       </body> 
 </html> 

Final Output
 

Saturday, May 6, 2017

Customize the SharePoint OOB RSS Viewer WebPart

In SharePoint we have Out-Of-the-Box (OOB) RSS Viewer web part to display the content retrieved from the Really Simple Syndication (RSS) feeds from various sources. But if you want to change the way it is displayed in the RSS Viewer then we can make use of the XSL editor or file to modify it.
The below example shows how to change the view of the content in RSS Viewer using XSL template.
Step 1
Adding RSS Viewer to the SharePoint page.








Click on add WebPart
  





Select WebPart from the top ribbon








Step 2
Add "RSS Viewer" WebPart as shown below.




Step 3
To configure RSS Viewer WebPart click the "Open the tool pane" link
 





Provide the RSS Feed link and specify other parameters in the tool pane displayed on the right side. Finally click ok to finish the setup. Below seen example is the default view.



Step 4
To customize the display format using XSL template please follow the below things.
  
Click on the "XSL Editor" in the "Tool pane", copy and paste the below code in the editor to change the display styles.
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <xsl:stylesheet version="1.0"  
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  
  4. <xsl:output method="html"/>  
  5. <xsl:template match="/">  
  6. <xsl:apply-templates select="/rss/channel/item"/>  
  7. </xsl:template>  
  8. <xsl:template match="item">  
  9. <strong><span style="color: green; font-size: 12pt"><xsl:value-of select="title"/> </span></strong><br/>  
  10. <span style="color: grey; font-size: 8pt"><xsl:value-of select="pubDate"/></span>  
  11. <p>  
  12. <xsl:value-of disable-output-escaping="yes" select="description"/>  
  13. </p>  
  14. </xsl:template>  
  15. </xsl:stylesheet>  
Most of the RSS feeds will have the properties like Title, Description and Published Date. So the above XSL template can be modified according to your needs.
Final output


Augmented Reality and Virtual Reality

Here is the quick overview of Augmented Reality and Virtual Reality, also have explained how it is being used today and how it can chan...