Saturday 19 December 2015

Install and Configure the SharePoint 2013 Workflow Platform.

Steps to install SharePoint 2013 workflow platform type with the new workflow engine.

Let’s begin the installation and configuration-

1. Download the workflow manager from http://go.microsoft.com/fwlink/?LinkID=252092
2. Run workflowmanager.exe as admin.
3. Click on "Install" button.



4. Click "I Accept" on the Prerequisites screen.



5. When the Workflow Manager 1.0 installation process has completed. Click "Continue" on  the configuration screen.


6. You will get "Workflow Manager Configuration Wizard" after this. Choose "Configure Workflow  Manager with Default Settings (Recommended)".



7. On "New Farm Configuration" (not to be confused with SharePoint Farm), enter the SQL server  instance and the credentials as required.

8. In the "Configure Service Account" section, enter the appropriate service account to run the  Workflow Manager.

9. Check the Allow Workflow Management over HTTP on this computer (for development), but you  don’t need to do it on production.

10. In the "Certificate Generation Key" section, enter a unique key and press the right  arrow to continue.


11. In the "Summary" dialogue box, verify all information entered and click OK (tick mark). Also, you  can save it by clicking on the "Copy" link button.



12. Now the "Configuration Process" will start.

13. If all the configuration processes are right, then you will get a screen similar to the one below.

14. Verify that the following services are running:
             a. Workflow Manager Backend.
             b. Windows Fabric Host Service.
             c. Service Bus Gateway.

15. Open IIS and check if "Workflow Management Site" is working or not. We get two ports  configured as:
             a. *:12290 (https)
             b. *:12291 (http)



16. To check the proper configuration, open the following link in your browser.
             a. http://servername:12291
             b. https://servername:12290




17. All the required databases are created as given below.



18. Open "SharePoint Management Shell" and run the following command.
 

19. After successful execution of the command, a new service application will be created and  its administrator will be set by the user provided while doing workflow configuration (optional).



20. If the service application is correct, you will get the screen as given below.


21. After the successful installation of "SharePoint 2013 Workflow Manager" a new platform  called SharePoint 2013 Workflow will come.

It provides the following features, as shown below:
Now take the full advantage of the SharePoint 2013 Workflow engine.


🚀 "Happy Coding" 🚀

Swagger: Web API

Swagger is a tool that allows you to quickly and easily provide API documentation for your Web API project, and it’s free. Its official site is http://swagger.io/

Swagger is basically a framework for describing, consuming, and visualizing RESTful APIs. The nice thing about Swagger is that it really keeps the documentation system, the client, and the server code in sync always, in other words, the documentation of methods, parameters, and models is tightly integrated into the server code.

To implement "Swagger", you need to install "Swashbuckle". Swashbuckle is a combination of ApiExplorer and Swagger/swagger-ui and provides a rich discovery, documentation, and playground experience to your API consumers. Some of the features you get with Swashbuckle are:
  • Auto-generated Swagger 2.0.
  • Seamless integration of swagger-ui.
  • Reflection-based Schema generation for describing API types.
  • Extensibility hooks for customizing the generated Swagger doc.
  • Extensibility hooks for customizing the swagger-ui.
  • Out-of-the-box support for leveraging Xml comments.
  • Support for describing ApiKey, Basic Auth and OAuth2 schemes. Including UI support for the Implicit OAuth2 flow.
Add Swashbuckle using the NuGet package manager console.

You can pass the version as well, but it’s optional; by default, it will pick the latest one.


After the package is installed, you will get a new file named SwagerConfig.cs under the App_Start folder.



To check if swagger is integrated properly or not start a new debugging session (press F5) and navigate to http://localhost:[PORT_NUM]/swagger. You should see Swagger UI help pages for your APIs. Here you will see all your web API action methods.



Expand an API, and clicking the "Try it out!" button will make a call to that specific API and return results.



Enter the parameter in the textbox provided and click "Try it out!", you will get JSON data in the response body of this API. Also, you will get a Response Code and Response Headers. You can try all methods in this way, including all HttpMethod types.




Enable Swagger to use XML comments.
In Solution Explorer, right-click on the Web API project and click Properties. Click the Build tab and navigate to Output. Make sure the XML documentation file is checked. You can leave the default file path. In my case, it's bin\SwaggerDemoApi.XML



Now, add the following line to SwaggerConfig.cs. Make sure to change the file path to the path of your XML documentation file.

c.IncludeXmlComments($@"System.AppDomain.CurrentDomain.BaseDirectory}\bin\ProjectName.Api.XML");

The full SwaggerConfig.cs is given below:
GlobalConfiguration.Configuration 
                .EnableSwagger(c =>
                  {
                     c.SingleApiVersion("v1""Project Name");
                        
                     c.IncludeXmlComments($@"{System.AppDomain.CurrentDomain.BaseDirectory}\bin\ProjectName.XML");
 
                  })
                .EnableSwaggerUi();


Swagger JSON file

To get the API’s complete metadata, navigate to the URL that is in the header of the Swagger UI documentation page.



Copy the above URL and paste it into the browser, and you will get JSON data.


I hope this will help you. Do write a comment below.


🚀 "Happy Coding" 🚀

Friday 18 December 2015

CKS - Dev for Visual Studio 2015.

The CKS - Development Tools Edition is a collection of Visual Studio templates, Server Explorer extensions, and tools providing accelerated SharePoint 2010 and 2013 development. But, unfortunately, it's available only for Visual Studio 2012 and 2013 and not for Visual Studio 2015.

There is a workaround through which you can use CKS - Dev in Visual Studio 2015 as well.
The CKSDev should already be installed on the system in any Visual Studio version; otherwise, you will not get the folder required.

Follow the steps and enjoy the power of CKS - Dev.

  1. Open the window explorer and go to - \Local\Microsoft\VisualStudio\12.0\Extensions.
  2. Find the folder containing CKSDev - on my machine it was called yqxmnzzs.3tk.
  3. Copy the folder.
  4. Open the window explorer and go to - \Local\Microsoft\VisualStudio\14.0\Extensions.
  5. Paste the copied folder here.
  6. Start Visual Studio 2015 (with Office Developer Tools).
  7. Click Tools > Extensions and Updates.
  8. Find CKSDev and click "Enable". It is disabled by default..
  9. Restart Visual Studio 2015.

I hope this will help; do write your comments and suggestions.


🚀 "Happy Coding" 🚀