Showing posts with label Training Center of IT. Show all posts
Showing posts with label Training Center of IT. Show all posts

Friday, 27 January 2017

Business Workflows in SharePoint

1: Content Management explained in this Blog (Content Management).

How its 3 Tier Architecture?
Business workflow is main pillar of SharePoint to automate operations of your Business. As we know 3 tier have Presentation tier, Business Logic tier and Database tier. Business logic mean Logic as per your business for this Microsoft introduced Business workflows in SharePoint.

Lest discus another functionality of SharePoint.

2: Business Workflows?
Lets break this word between workflows and Business workflows.


  • What is Workflow?

Workflow is an automatic process which trigger after specific condition. For example company with 5000 employees have attendance machine after month end during payroll process it gets attendance from machine and calculate salary of each employee if you have to do it manually how much time you need? allot of man power requires to do this and you can't give salary on same day.

 For this purpose you just have to configure workflow for first time by applying different checks. I explained a very simple workflow for your understanding but you can handle complex scenarios using workflows in SharePoint Like Procurement etc.


  • Business Workflows:

Now combine these words Business Workflows. In workflow explanation we have created a generic workflow will work for all companies.

Now Business workflow, automation according to your business. Like your company deduct 2% of your salary if you get late and 4% if you get off without leave but if you have non avail leaves automatically minus from leaves, not % deduction from your salary.

Advantages Of SharePoint Workflows:

  • You don't need to write code for workflows, SharePoint (Nintex workflow) gives you graphical representation to automate your business.
  • If you have to write code you needs month to do this but using Workflow you can automate process in day. 
3rd Functionality is Best thing of SharePoint 2013 You will love it.

Thanks for your time. Your suggestions and queries will be highly appreciated. Thanks.

Tuesday, 24 January 2017

What you should know before Development of SharePoint?

Although Architecture for SharePoint to access list or file of Document Library define in this image:

but in code you have to access first site then Open web.
Get SharePoint List Using C# code:
In this tutorial we will learn how to get Document Library files by traversing SharePoint Architecture.
SharePoint Architecture to access any list:
SecurityPrevillages-> Site(ByProvidingURL) ->Web -> List (like DocumentLaibrary) -> Get Files under Document Library

Steps:
1: Create Console Application using C# etc then add this library "using Microsoft.SharePoint".
2: Get the path of site which library files you want access in your code like (string baseUrl = "http://sp2013:81/sites/sis/";)
3:  Security Check if you are running this utility on same server where SharePoint is deployed. Get Security check by adding this line SPSecurity.RunWithElevatedPrivileges(delegate() {  //YourCOde });
4: Then Get site where you want some changes or want to get something from existing applications like Document Library.
5: Get all uploaded documents on document library by passing library name as a parameter in   SPDocumentLibrary lib = (SPDocumentLibrary)web.Lists[LaibraryName];
6: using Lib.RootFolder to get all files existing in this folder.
This is Generic Function written in C# to access all documents from a specific Library:
public static bool getAllDocuments(String LaibraryName)
{
Console.WriteLine("getAllDocuments debug, START");
bool isOK = false;
string baseUrl = "http://sp2013:81/sites/sis/";
try
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(baseUrl))
{
using (SPWeb web = site.OpenWeb())
{
SPDocumentLibrary lib = (SPDocumentLibrary)web.Lists[LaibraryName]; //Get All documents with name
//SPDocumentLibrary lib = (SPDocumentLibrary)web.Lists["Client Incoming Correspondence"]; //Get All documents with name

IEnumerable<SPFile> allFiles = ExploreFolder(lib.RootFolder);
foreach (SPFile file in allFiles)
{
Console.WriteLine("getAllDocuments debug, File Name : " + file.GetType());
string filename = file.Name;
Console.WriteLine("getAllDocuments debug, File CharSetName : " + file.CharSetName);
Console.WriteLine("getAllDocuments debug, File SourceLeafName : " + file.Title);
string strFileExtension = new FileInfo(file.Name).Extension;
string strFileUrl = file.Url;
Console.WriteLine("strFileUrl : " + strFileUrl);

}

}
}
});
}
catch (Exception e)
{
Console.WriteLine("getAllDocuments debug, " + e.Message);
isOK = true;
}
Console.WriteLine("getAllDocuments debug, END");
return isOK;
}
By using this approach you can access any list. Thanks for reading this blog if you need any help feel free to comment here. Thanks