Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Archive for June, 2015

OData startswith Examples

Posted by Paul on June 30, 2015

In this article we can explore OData examples for string method startswith.

startswith

This filter returns the field values starting with specified string.

Please note that the method-name is case sensitive & only lower case works.

Example

Please create the data as shown below.

image

Following is the query URL.

http://sharepoint/_api/Web/Lists/GetByTitle(‘Contacts’)/Items?$filter=startswith(Title,’Bran’)

Following is the result using Chrome browser.

image

image

Please note that we are querying against column named Title.

Another Example

Now let us try with an non-existing string.

Following is the query URL.

http://sharepoint/_api/Web/Lists/GetByTitle(‘Contacts’)/Items?$filter=startswith(Title,’ABCD’)

Following is the result using Chrome browser which shows no-results.

image

You can now play with more examples.

image

Please note that the operation name should be in lower-case.

References

https://msdn.microsoft.com/en-us/library/gg309461.aspx

Summary

In this article we have explored OData with method startswith.

Advertisements

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

OData and String Comparison Filters

Posted by Paul on June 27, 2015

In this post we can explore the String Comparison Filters of OData using SharePoint 2013 REST API.

String Comparison Filters

Following are the String Comparison Filters in OData.

startswith

This filter returns the field values starting with specified string.

Please note that the method-name is case sensitive & only lower case works.

substringof

This filter returns the field values containing specified string.

Please note that this is case sensitive & only lower case works.

length

This filter returns the values whose length is greater than specified number.

Please note that this is case sensitive & only lower case works.

replace

This is an operational method and replaces the string with given value.

tolower

To convert field values to lower case.

toupper

To convert field values to upper case.

OData stands for Open Data Protocol. OData allows Filtering & Interoperability on REST services. We combine OData along with REST methods.

So REST + OData allows gives more flexibility in querying & filtering items.

References

http://bit.ly/1gixNRv

Summary

In this post we have explored String Comparison filters of OData. In the upcoming posts we can test each of them against list items.

Posted in SharePoint, SharePoint 2013 | Leave a Comment »

OData and Numeric Comparison Filters

Posted by Paul on June 21, 2015

In this article we can explore OData using Numeric Comparison filters.

Numeric Comparison Filters

Following are the Numeric Comparison filters available with OData

lt Less Than
le Less Than or Equals To
gt Greater Than
ge Greater Than or Equals To
eq Equal To
ne Not Equal To

Data Preparation

To proceed with the example I encourage you to create a Contacts list with a column named Age of type integer. Please fill some data appropriately.

clip_image002

eq Filter

Following is the example of using Equal filter where the column Age is equal to 30.

http://server/_api/Web/Lists/GetByTitle(‘Contacts’)/Items?$filter=Age eq 30

The result was one list item as per my data.

clip_image004

clip_image006

Please note that uppercase (EQ) won’t work.

ne Filter

Following is the example of using Not Equal filter where the column Age is not equal to 30.

http://server/_api/Web/Lists/GetByTitle(‘Contacts’)/Items?$filter=Age ne 30

Obviously it returned a lot of items.

clip_image008

lt Filter

Following is the example of using Less Than filter.

http://server/_api/Web/Lists/GetByTitle(‘Contacts’)/Items?$filter=Age lt 10

As there are no items with Age less than 10, my result was empty.

clip_image010

Similarly you can play with the remaining Arithmetic operators.

References

https://msdn.microsoft.com/en-us/library/gg309461.aspx

Summary

In this article we have explored Numeric Comparison filters of OData on SharePoint 2013 REST services.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , | Leave a Comment »

OData with REST

Posted by Paul on June 19, 2015

In this post we can get introduced to OData along with REST.

REST

REST stands for Representational State Transfer. It is a stateless communication protocol using HTTP and ensuring HTTP verbs are accurately used for CRUD operations. Please see references for more information.

SharePoint 2013 supports REST services which enabled an easier & better communication from client-side. We can use REST for:

1. Getting site information using URL

2. Getting list information using URL

3. Getting list items using URL

An example of REST URL is:

http://server/_api/Web/Lists/GetByTitle(‘Contacts’)

But, REST have drawbacks on querying and filtering. For example, using the URL format it is difficult to filter items.

OData

OData stands for Open Data Protocol. OData allows Filtering & Interoperability on REST services. We combine OData along with REST methods.

So REST + OData allows gives more flexibility in querying & filtering items.

Selecting Columns using OData

Following OData sample specifies selection of Title column only.

http://server/_api/Web/Lists/GetByTitle(‘Contacts’)/Items?$select=Title

image

FYI: The above query without the Title selection is as following.

http://server/_api/Web/Lists/GetByTitle(‘Contacts’)/Items

image

Although REST is stateless like HTTP, the sessions are stored in client-side and transferred back and forth from web server.

References

http://www.c-sharpcorner.com/UploadFile/40e97e/rest-enable-web-services-in-sharepoint/

https://en.wikipedia.org/wiki/Open_Data_Protocol

https://msdn.microsoft.com/en-us/library/office/fp142385.aspx

Summary

In this post we have explored usage of REST with OData in SharePoint 2013.  In the upcoming posts we can explore more options in OData.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

SharePoint and Job Market 2015

Posted by Paul on June 17, 2015

The past one-year I am receiving more queries on SharePoint job market like:

  1. What is the scope of SharePoint Developer going ahead?
  2. Will SharePoint Online takes away SharePoint Administrator jobs?
  3. Are SharePoint jobs declining?
  4. What is the market range for SharePoint professionals?

I would like to answer these queries based on my research & to the broader audience.

Scope of SharePoint Developer

I cannot clearly see a trend-reversal in SharePoint Developer demands.  I agree that, Moving to SharePoint Online could have reduced lot Administrative works, But still there are Power User & Developer need. 

Again, moving to the cloud emphasized the importance of Client-side coding in SharePoint.  The following skills are in increasing-demands for a SharePoint Developer:

  1. Client Side Object Model using CSOM (JSOM, REST, OData)
  2. HTML 5
  3. Non-App Solutions using CSOM
  4. SharePoint Hosted Apps (JSOM/REST)
  5. Provider Hosted Apps (Power Programming using C#)

image

This also means, the Server Object Model style is slowly dying.  So if you are serious with your Server Object Model skills & C#, I would recommend you to move towards PHA or App-Development/CSOM.

Source: dice.com

Not enough Supplies

The current market in 2015 shows that, there are not enough Skilled SharePoint developers, especially in the Hot Skills above.  If you are a SharePoint-PHA developer with good practice on PHA server configuration, app deployment, I am telling you – You could demand the highest-salary in the SharePoint segment.

So SharePoint Developer market is short of supplies.

About Administrators

As I said, although SharePoint Online is taking away lot of Administrator jobs, the migration is slower.

  • There are lof of customers still using SharePoint 2010. So the Administrator job should be safe for next few years too.
  • Not all customers can go Online.  Friction of data-security stops them from going Online.
  • SharePoint Online frees up some areas of work like Server Configuration, Farm Configuration, Scaling, Database Tuning etc.
  • SharePoint Online still requires Administration & Power User activities.  There is PowerShell version for SharePoint Online too.
  • Social Computing, Office Graphs are forecasted high-growth arenas.
  • Hybrid environment is gaining speed which provides the right advantage-mix of SharePoint On-Premise and Online versions.  Good to have this.

For Administrators, I would recommend the bullet points of SharePoint Online, Yammer/Social Collaboration, Exchange Online, Lync Online, SharePoint Online Management Shell in their Resume.

image

How much you can get in USA?

Now, let us talk about the Money! Of course, money is a key-factor in career.

My research says that, following are the hottest SharePoint required areas in US.

  1. Washington DC
  2. New York / New Jersey
  3. Silicon Valley

The pay rate goes like below for a 10 year experienced developer, with at least 5 year SharePoint experience.

  1. 100-120k USD in the lower range
  2. 120-170k USD in the higher range

How much you can get in India?

The hottest cities for SharePoint jobs are:

  1. Bangalore
  2. Chennai
  3. Mumbai

My friends over India says about the following market rates.

  1. 8-12 Lakhs INR in the lower range
  2. 12-18 Lakhs INR in the higher range

Source: www.naukri.com

Good News

The good news is that SharePoint is still growing, whether On-Premise or Online versions.

Also, There are lot of migrations happening from Non-SharePoint systems to SharePoint.  The Migration tool sellers also enjoying the show.

Note

If any of my research data changes, I can update you through the blog subscription.  You are encouraged to subscribe through email.

Posted in SharePoint | Tagged: , , | Leave a Comment »

More REST Examples

Posted by Paul on June 15, 2015

In this article we can explore more REST and examples.

Get a List by Title

We can get List information using the Title of the list. Make sure you have a list named Contacts.

URL: http://server/_api/Web/Lists/GetByTitle(‘Contacts’)

image

Please note that REST API is provided using the context _api.

Using chrome browser I received the following output.

image

Although IE 11 hesitated to show the output, giving an error message.

image

But in IE too, we can view the output using View Source option.

image

image

By default XML format result is provided by SharePoint REST services. In programmatic way, we can format these results to JSON format.

Getting List Items

We can try getting the list items using REST.

URL: http://sharepoint/_api/Web/Lists/GetByTitle(‘Contacts’)/Items

Using chrome browser I was able to view the following results.

image

However In IE the result summary was shown.

image

image

Please note that REST is trending as a replacement for JSOM in SharePoint world. REST provides much easier, less-coded ways of working with client-side object model.

References

https://msdn.microsoft.com/EN-US/library/office/jj164022.aspx

Summary

In this article we have explored few REST examples using browser URL box.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , | Leave a Comment »

Enable Like on List Items

Posted by Paul on June 10, 2015

In this article we can see how to enable Like on List items.

Like

Like is a Micro blogging feature of SharePoint 2013. Although it is disabled for list items by default, we can enable it through list settings.

image

Create List

To start with, create a new list & add few items into it as shown below.

image

Now go to the list settings. You will see the Rating settings as shown below.

image

Choose the following options there.

image

Save changes and come back to the list. You should see the Like link now.

Testing Like

You can click on the Like link to test it.

image

Now the Like link converts to unlike while also displaying the Total Like count.

image

Now the Like link converts to unlike while also displaying the Total Like count.

This demonstrates the usage of Rating Settings to enable like item for a list item.

image

We can use the Like functionality to enable user-voting on multiple choices.

References

https://technet.microsoft.com/en-us/library/jj219700.aspx

Summary

In this article we have seen how to enable Like button for list items.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , | Leave a Comment »

Starting with REST

Posted by Paul on June 7, 2015

In this article we can have a start with REST API.

REST

SharePoint 2013 introduced REST API which allows alternative & easier usage than CSOM/JSOM. The simplicity of REST is that we can use browser address bar to invoke the API.

Testing REST

Test the following URL in your browser.

http://server/_api/web/lists

If you are using Internet Explorer, you will get the following output.

image

Towards the right hand side you can see there are 19 lists being returned. To view the XML output, you can choose the View Source option.

image

Please note that the result is returned in XML format. In programming scenarios, we can use XML or JSON notations to get the results & parse them.

References

https://msdn.microsoft.com/en-us/library/office/fp142380.aspx

https://msdn.microsoft.com/en-us/library/office/dn531433.aspx

Summary

In this post we have explored how to start with REST API using a browser.

Posted in SharePoint, SharePoint 2013 | Leave a Comment »

SharePoint 2013 Solution – Online/On-Premise

Posted by Paul on June 5, 2015

I was answering few Solution Queries on SharePoint 2013 with options of Online/On-Premise.  Following are the various Solution Parameters we need to consider while deciding Online/On-Premise

Public Access

Check your users.  If they require Internet access, then Online would be a good choice.

Data Security

Again, going with Online exposes your secured data to the cloud or external-staff access.  If your data restricts moving to O365, you can think about On-Premise with public hosting.

Scalability

Online version provides automatic scalability.  This will save you enough $$ especially during peak time server accumulation, skill hiring etc.

For On-Premises, Scalability has to be achieved based on the following parameters.

  • Number of Users 
  • Concurrent Users

Usually the Concurrent Users amount to 5-10% of the Number of Users.  You can use Visual Studio Load Testing to test again your hardware configuration.

Extranet

Check whether your clients/vendors need access to the site.  In that case additional software needs to be installed.  Although, Online version provides much flexibility here.

Personal Device Security

If your employees need to access the SharePoint site from their personal device, following options are available. 

If it is Online, not much configuration is required.

If it is On-Premise & Intranet, we can use Micro VPN, Citrix XenMobile etc.

Employee Login

For Online version, not much configuration is required.

For On-Premise version, Claims based Authentication would be recommended.

Zone

Zones allows separate web application configuration with different authentication settings.  We can configure zones for Internet, Intranet etc.

Development Model

For both the versions (Online & On-Premise) Microsoft does not recommend Server Object Model.  App Model / Provider-Hosted Application / SharePoint-Hosted Application are the preferred choice.

For C# apps, use CSOM.

For JS apps, use REST.

Hardware

Hardware needs to be taken care for On-Premise edition.  SSDs have become cheaper and now the preferred choices for SharePoint folks as well.  The following facts can optimize performance as per my observation:

  1. Create separate databases for transactions & logging
  2. Keep Search & Indexing server as a separate machine
  3. Use appropriate RAID configuration for SharePoint servers

Multiple Locations

For Online version, Microsoft automatically supports Edge servers.

For On-Premise version, we need to take care of configuring servers in the farm closer to user’s country/geo-location.

References

Best Practices for SharePoint SQL Server https://technet.microsoft.com/en-us/library/hh292622.aspx

Posted in SharePoint, SharePoint 2013 | Leave a Comment »

Timer Jobs are Old Trend!

Posted by Paul on June 3, 2015

In this post I would like to inform on a slow trend change in SharePoint Development. Yes! We are moving code from server-side to client-side. As part of this Timer Jobs are not recommended for new SharePoint solutions.

Timer Jobs

Including the past versions of SharePoint, Timer Job provided a scheduled way of executing jobs using server-side code. I too enjoyed it! Timer Jobs were the default way of any SharePoint scheduled job requirement.

Why moving from Timer Jobs?

As Microsoft is in a mission to remove server-side custom code, Timer Job too got a hit. Since, Timer Jobs reside in the server-side; it is not appreciated as good practice for new SharePoint solutions.

What are the Alternatives?

Following are the alternatives:

1. Create Custom CSOM Console Application

2. Schedule through:

a. Windows Scheduler

b. Custom Schedulers

Microsoft is in a Mission!

As we know, Microsoft is in a Mission to remove server-side code. The introduction of CSOM and availability of almost all server-side API in CSOM accelerates this mission. All the top-clients of Microsoft who use SharePoint, have a clear idea on this part.

As part of the mission, following are the key points:

1. Server-side code gets converted to Client-side

2. Power Programming requirements are satisfied through PHA (Provider Hosted Apps)

3. Timer Jobs are not advised for new projects

What to do with new solutions?

For new code, do not use Timer Jobs. Train your resources in CSOM and other required aspects. In future, this can help if the solution is migrated to O365 as well.

What to do with existing code?

For existing code, I would say continue in the same manner.
image

I am not forecasting any deprecation of Timer Job in future. This is just best-practice information.

Summary

In this post we have explored a major trend change in SharePoint Development of moving away from Server-side code to Client-side code.

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »