Loading...

Saturday, August 26, 2017

How to load SharePoint Data into Azure Data Factory?

1)Get the SharePoint List Odata  Uri (.svc URI)
2)Copy data from OData source to Azure Blob
3)If SharePoint is hosted on the on-Premise install Data Management Gateways
4)Configure the Pipeline  for Data Factory as described here.

Sunday, April 2, 2017

SharePoint App with Odata External Content Type

1)Create SharePoint Provider Hosted App

2)Right Click this Project to Add External Content type using  Odata

3)Create  Secure Store Service  Target Application  (in case of FBA Authentication)  else enable RevertToSelf Authentication  mechanism  (in case of Windows Authentication).Revert To Self Authentication needs to be enabled explicitly for Business Connectivity Service Application using Powershell

4)Create New-SPODataConnectionSettings Jump For BCS using Powershell,
This will help to use Secure Store Credentials to be associated with  BCS external content type
Look at the Output of this command

5)In Visual Studio ,Select .ect (BDC model file) , select the Designer View of ECT  then Select the Properties  , and Update the  Properties  (obtained in the step  4)

To  be continued for the deployment part...

<cross-posted from here>

Sunday, November 13, 2016

What is ASP.net Core 1.0 , The Future of MVC 6? , And How to use this Architecture for SharePoint Provider Hosted Apps

SharePoint is the technology which is built on the top of the ASP.net ,  ASP.net  is  rapidly evolving day by day to accustom advanced cloud scenarios  and modern web application development.  It has been evolved from ASP.net Forms then ASP.net MVC 6   & now ASP.net  Core 1.0

If you are acquainted  with Provider Hosted App development, primarily we select MVC architecture due  to the benefits it offers

Look at this  (ASP.net Core 1.0)  advanced, powerful cross - platform technology which would help us to solve many age old troubles.

Radi has explained this in Depth , for leveraging this ASP.net 1.0   architecture for Provider Hosted App. Today, though it is only supported for Low trust  provider hosted apps,  It is going to be evolved for High trust provider hosted Apps as well.

I'll extend this post for explaining Dependency Injection MVC architecture,  provided by ASP.net core  with respect to provider hosted Apps.

Thursday, October 27, 2016

How to enable Multi-Tenant Authentication for PHA hosted in Azure?


If the applications is used across multiple tenants by partners across different companies , This could be the best way  to achieve it.This activity involves following tasks

1)Create Provider hosted App and Publish it to Azure Web App.
2)Configure Multi-Tenancy  for this Azure Web App
 

Tuesday, October 11, 2016

Console App to Login to Office 365


1) In Visual Studio,Create the Console app as follows

using (var context = new ClientContext("https://<Your Office 365 site>.sharepoint.com"))
{
    var password = new SecureString();
    foreach (var c in "<ur Office 365 Pwd")
    {
        secureString.AppendChar(c);
    }

    context.Credentials = new SharePointOnlineCredentials("login@sp.onmicrosoft.com", password);

    var web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
}

2)Make sure that you are referring correct SharePoint Client SDK dlls with respect to SharePoint Online.









Sunday, June 19, 2016

Azure & Machine Learning for SharePoint

Now if we choose the create SharePoint Content Database with SQL Azure , in addition to Cloud Benefits .. We can use this Database for further analysis with Machine Learning Algorithms & expose this Analysis as a Web service to external world...

Soon you will find the detailed post in this space....  

Monday, February 29, 2016

My First Ebook : SharePoint 2016 For EveryOne & All In One

This is my first eBook , I have published ever , I am working with Amazon team to make it more elegant & update it's contents to provide the insights for real world SharePoint development & deployment (considering all set of audience working on this technology) . To read this book in different devices you may have to adjust the font settings a little bit

Sunday, May 10, 2015

The SharePoint Search Story ...........

This is the story of the columns (list columns/site columns) in SharePoint sites.
once the columns are created and added to the list with some values and search crawler , crawls these list items  , crawl properties are generated automatically in Search schema (Search service Application-->Search Schema -->in Crawl properties.)

Then we can perform search , by mapping it to managed properties  and configuring it in Search Web parts.

story is not completed yet.. it is just the beginning.. :)
 

Sunday, February 1, 2015

How OOB approval workflows work ?

For beginners it may appear complex to use existing OOB approval workflow
But if we understand entire structure of approval workflow and about how it works, it would be easier to build the complex workflow on the top of OOB structure with least customization.
here is the high level view.


also high level view of OOB workflow

Saturday, September 27, 2014

Cross-Site Collection Navigation with Content Search Webpart

1)Configure Search Service Application with sufficient  privileges (Full Control at Webapplication level) to Search crawl log account.
2)Run full crawl making sure that , there are no crawl log errors  (in crawl history in Search Service  Application).
3)Create a Search Center site collection and edit the Content Search Webpart.
4)Add Keyword property filter (Query Text) contentclass:STS_Site and Test the query.
   You may further add, filters for  Webtemplate or Url specific results.



Sunday, August 24, 2014

Branding SharePoint 2013 Master Page with NotePad++

Whenever it is thought about branding master pages,It is required  enliven dummy html to functionally working SharePoint pages.
In SP 2013 , any plain html file can be turned in to SP 2013 master page.This is so cool..
This is to keep the distance in html and SharePoint master page controls in master page
Any change made to html is synced to masterpage without actually modifying the masterpage (will write a post on this soon..)
To work with Notepad++
1)Open up the SP site in Internet Explorer and Login with required credentials other wise mapping of the network drive would not be possible
2)In server,Click on Computers Icon-->Map network drive-->provide url to SP site
   Once the drive is successfully created , you can open any files in site in any editor like notepad++/notepad/Visual studio etc
3)Under Design Manager -->Edit Master pages , upload any plain html file (initially I would suggest to create html file just having head and body tag in it)
4)You would observe that corresponding master page is automatically created, open both html and corresponding master page (but do not modify anything is master page)
Any change saved to html, will prompt you to reload the master page, (for the first time if it doesn't ask, then in notepad++-->Files-->Reload from disk)
Now your playground is ready , you could learn about how branding works in SharePoint 2013 with this.If you would like to share your leanings , please update it in comments.
Once this works fine try this with some freely available html5, css 3 templates and turn it to SP Master page in few minutes
Please comment your queries under this blog post


Tuesday, July 29, 2014

SharePoint Apps /Solutions with Odata External Content Type

These days Odata protocol  has gained popularity and importance due to its powerful feature of being platform independent or  interfacing across different  boundaries.
You might have read about different posts which speaks about the forming the External Content Type with OData Urls such as
a)SharePoint 2013: Business Connectivity Services – Consuming OData in BCS using an App External Content Type
b)How to: Use ListData.svc as a External Content Type through BCS
1)As of now Odata External content types can not be created through SharePoint  Designer 2013 and in Visual Studio 2012/2013 it is limited to SharePoint Apps Project
But there is workaround for this ,
i)Create Odata External Content Type using SharePoint Apps Project
ii)Open this project in windows explorer and search for .bdcm files ,which gives BDCMetadata.bdcm
ii)Browse to Central Administration -->Service Application --> BCS  -->Import BCS model   
 On  Import (even after setting the required permission to bdc model)you may come across  the errors saying
 The underlying connection was closed: An unexpected error occurred on a receive.
 or
LobSystem (External System) returned authentication error. Error was encountered at or just before Line:
iii)All you have to do is , Create Secure Store Target application and edit the .bdcm file to update the credentials as described in below articles

Thursday, June 19, 2014

Debugging Class Libraries with Call Stack window and Symbol store

Hey Readers!!

After a long time I thought of writing something.
Though the current versions of SP , emphasizes on using Client OM or REST API etc so that on change code compilation can be avoided.  Still in somewhere there is no option other than using the Managed Code.
In a VS solution, including bunch of projects and having complex flow to execute , seems to time sucking and that too validate just a small piece of code.
Here's the solution !! . Write a test app (may be console/web app) and add the dll reference of project needs validation.
1)In Visual Studio-->Tools--->Options-->Debugging-->Symbols-->add the path to pdb files.
2)Each time referenced Project is modified --> Copy the dlls to gac (may be using wsp builder).As when debugging starts, debugger gets the symbols from  c:\windows\assembly\gac_msil
3)If you find that you are unable to step into the referenced project , this is because , pdb files in gac_msil folder and in compiled dlls are not matching
4)When debugging starts --> Look for Call stack window while debugger step into referenced objects--> If it shows dissembly message -->right click call  stack --> get the symbols that is added in step 1 
5) If it is unable to add the symbols which means dll is not copied to gac and pdb files are not macthing in gac_msil folder

Hope this could save the time for people struggling to debug class libraries

Saturday, November 30, 2013

How to: Convert an HTML file into a master page in SharePoint 2013?

How to: Convert an HTML file into a master page in SharePoint 2013?
This seems to be easier way to convert  design html file to master page.
 I think , this is introduced to integrate html elements like header, footer, main contents into respective SharePoint elements like different content placeholder ids , SharePoint controls etc  in html file itself , so that this file is editable in any Non-SharePoint html editors . This is great. but for beginners this may be a little tricky.
I would suggest , rather than converting entire html file into master page , one should  start with startermaster.html.
To do so
1)Download startermaster.html from Master Page gallery.Open startermaster.html in browser and inspect header and footer elements in Developer tools
2)Now copy html elements like topnavigation div , logo div , search div etc from original html  file to
  startermaster.html (also rename this file to suitable name) at appropriate place.
3) This startermaster.html  is now ready for converting to master page .In this way , the html validation errors also can be avoided .Now embed SharePoint snippets at appropriate place.


Thursday, October 31, 2013

SharePoint hosted app to enable Geolocation column

GeoLocation field is newly introduced column type in SharePoint 2013 .You will not see any field of type GeoLocation by  by default but It needs to be enabled with program. This is quite useful to
save the Geographic info in SharePoint List.

1)Create a SharePoint hosted app and open up the Start page , here before executing actual CSOM
   following  few lines , get the context of hostweb url , app Web url and loads the sp.js

<script type="text/javascript">
    var hostweburl;
 var appweburl;
var web;
var list;
var context;
    // Load the required SharePoint libraries.
    $(document).ready(function () {

        // Get the URI decoded URLs.
        hostweburl =
            decodeURIComponent(
                getQueryStringParameter("SPHostUrl")
        );
  
  appweburl =
            decodeURIComponent(
                getQueryStringParameter("SPAppWebUrl")
        );

        // The js files are in a URL in the form:
        // web_url/_layouts/15/resource_file
        var scriptbase = hostweburl + "/_layouts/15/";

        // Load the js files and continue to
        // the execOperation function.
        $.getScript(scriptbase + "SP.Runtime.js",
            function () {
                $.getScript(scriptbase + "SP.js", execOperation);
            }
        );
    });

2)Now with the help of CSOM ,create SP list with GeoLocation column added to it.

   // Function to execute basic operations.
    function execOperation() {

       
    //context = new SP.ClientContext(hostweburl);
    
 context = new SP.ClientContext(appweburl); 
 var appContextSite = new SP.AppContextSite(context, hostweburl);
   // this.web=context.get_web();
   this.web= appContextSite.get_web();   
     // Continue your program flow here.
  context.load(this.web);

var listCreationInfo = new SP.ListCreationInformation();
listCreationInfo.set_title('CustomList');
listCreationInfo.set_templateType(SP.ListTemplateType.genericList);

this.web.get_lists().add(listCreationInfo);
this.list = this.web.get_lists().getByTitle('CustomList');


var fldCollection = this.list.get_fields();
alert(fldCollection);

var geoField = context.castTo(
fldCollection.addFieldAsXml('<Field Type="Geolocation" DisplayName="GeoLocation" Name="GeoLocation" />',
true,
SP.AddFieldOptions.addToDefaultContentType),
SP.FieldGeolocation);
geoField.set_title("Geo Location");
geoField.update();
alert(geoField);

context.executeQueryAsync(
 genericSuccess,
 genericFail
);

}

function genericSuccess(sender, args) {
    alert('success');
}
    
function genericFail(sender, args) {
    alert('Request failed. ' + args.get_message() + 
        '\n' + args.get_stackTrace());
}

    // Function to retrieve a query string value.
    // For production purposes you may want to use
    // a library to handle the query string.
    function getQueryStringParameter(paramToRetrieve) {
        var params =
            document.URL.split("?")[1].split("&");
        var strParams = "";
        for (var i = 0; i < params.length; i = i + 1) {
            var singleParam = params[i].split("=");
            if (singleParam[0] == paramToRetrieve)
                return singleParam[1];
        }
    }
</script>

3)Once this app is deployed successfully then you will see , List with name Custom List with  Geolocation locumn added to it in host site

Wednesday, September 18, 2013

Most Valuable SharePoint Community


Diagnosing Display Template : Classical Overview Of Configuring Item Templates for Search WebParts

 To know more about what is Control Display Template and Item Display Template , Read this post.
 To diagnose  query values in Display template (In search webparts) , Item_Diagnostic item template is  available OOB. 
 To Configure this Item Template in Search Results WebPart's Toolpane,proceed as follows

 1)Navigate to Master Page gallery-->Display Templates-->Content Webparts -->Item_Diagnostic.html
    and Edit the properties to to check Search Result Webpart as Target control Type
 

 2)Now Edit the Search Page and Search Result WebPart to Select this Item template


 3)I found that in office 365 site this gives following error,but this can be corrected.
    To do so,Download Item_Diagnostic.html,Open with editor 
    search for this code line
    var pictureMarkup = Srch.ContentBySearch.getPictureMarkup(pictureURL, 100, 100, ctx.CurrentItem,    "cbs- picture3LinesImg", line1, pictureId);
and replace it by 
 var pictureMarkup =' ';
 Now rename the file , and upload it in display templates folder and set Target Control Type as Search Result

Display Error: The display template had an error. You can correct it
 by fixing the template or by changing the display template used in either the 
Web Part properties or Result Types.


Cannot call method 'getPictureMarkup' of 
undefined (CoreRender: ~sitecollection/_catalogs/masterpage/Display Templates
/Content Web Parts/Item_Diagnostic.js)
But  this should work in SharePoint 2013
anyways this post is to provide classical overview of Configuring Item Template for Search WebParts
All Item Template for Refinement Search WebPart will be found in Filter folder Under Display Templates folder in MasterPage gallery

Monday, September 9, 2013

Composed Look In SharePoint 2013: Templatization Of Look and Feel

I think idea behind introducing  Composed Look  is ,
a)Preparing look and feel in form of template
b)Modifying the look and feel on the fly.
1)Take a look at following Image, which helps to change the background image of the Master Page, on the fly.

2)Once Composed look is created , Under Site settings -->Look and feel -->Change the Look -->Select recently created look and apply . Here is my site with change of background Image :)
 For more insight about .spcolor and .spfont files , see this post and this one

Thursday, September 5, 2013

Display Templates Bit By Bit

In SharePoint 2013 and Office 365, Content search Webpart and Search result Webpart respectively ,can be use to get the aggregated Contents based on conditions
Display Templates consists of 2 Templates
1) Control template
   a)  To show multiple groups Group template can be configured.
   b)  To show contents without groups Content Template can be configured directly
2)Item Template
Above contents are based on my understanding. If you want to modify this post please write into comments


Sunday, August 25, 2013

Security Trimming for Managed Navigation in SharePoint 2013

Managed Navigation is the new concept which is introduced in SP 2013. Manged terms can be used for Navigating to Pages but it has  few limitations .
one of the limitation is, there is no OOB way to apply security trimming. But Interestingly I found one :)
So , try as follows
1)In Pages Library, Edit Page property to update the Managed metadata column ( Wiki Category can be used  for the same purpose

2)Once the Page is tagged with specific Metadata , Open  up the  Hidden Taxonomy List and break the permission for this List (here you have to make sure that , the Page and Managed Term has same unique permissions)
So Navigate to siteurl/Lists/TaxonomyHiddenList/AllItems.aspx  and find  for the metadata term , for which the page was tagged for
3)Hit 'Shared With' --> 'Advanced Setting'  and provide unique permission to this term , so that this term will be visible to only particular group or user.