Wednesday, April 20, 2016

SharePoint Development Models

As mentioned in my last blog about Uses of SharePoint, that SharePoint does not only rely on the features or functions it provides out of the box, but the implementation can be customized to streamline pretty much any aspect of business collaboration.

There are many ways of development in SharePoint, majorly categorized as below:

  1. Server Side Object Model : These are those solutions which are created in Visual studio and deployed on SharePoint server only. Microsoft provides Microsoft.Sharepoint.dll for its implementation.
  2. Client Side Object Model: These are the solutions which are created in either .Net or some other language like JavaScript but are not deployed on SharePoint server. These could be used in SharePoint sites or somewhere else.
    Microsoft provides two ways for this implementation:
    .Net Managed CSOM: Microsoft provides Microsoft.Sharepoint.client.dll for this. As .Net is used in this object model people often refer to it as server side code but actually it is part of client side object model as it is not deployed on the SharePoint server.
    JavaScript Object Model: Microsoft provides SP.js javascript library. SharePoint itself uses this js library. Apart from this Jquery also provides library SPservices.js for connecting to SharePoint
  3. SharePoint Designer: SharePoint Designer is software program which connects to SharePoint site and making basic changes like updating pages, developing basic workflows etc. These pages are stored in the SharePoint database like all other SharePoint pages.
  4. SharePoint APIs:These are used majorly for your remote mobile or web applications. 
    Rest APIs: This MSDN article details how to use SharePoint REST interface. SharePoint 2013 also provides support for oData in your REST queries. This article on MSDN pretty well explains how to use oData in REST requests
  5. SharePoint App Model: This is not exactly a development model like above. It was introduced in SharePoint 2013. Now we could create a separate server on domain to deploy applications. These applications could use any of the above model apart from 1st. These apps are used on SharePoint portal. SharePoint authenticates these apps using oauth. 

Uses of Microsoft Sharepoint

From more than a decade, after Microsoft launched SharePoint Services, It is adopted by over three quarters of Fortune 500 companies.

But they are not all using it for the same things. The tricky part is about explaining what sharepoint does is that it isn't anyone software program but rather a platform for   several different kinds of programs. SharePoint isn’t something you buy and install on your own desktop but rather a back-end system that ties all your employees’ PCs and mobile devices together, allowing them all to communicate and synchronize their efforts. The basic goal is to make it possible for a company with a hundred employees spread all over the region to work with the same level of agility and coordination as a company with ten people working out of a single office.

Here are some ways businesses use SharePoint to keep people on the same page.

Intranet

This is the internally facing site everyone in your company can sign in to and find news, announcements, scheduled tasks, and access to a variety of information. Dashboards can be customized by department and role, and different levels of access can be granted to make sure everyone from interns to CFOs can get the information they need about anything from employee performance to client history to the status of ongoing projects. SharePoint also provides tools for setting up employee social networking platforms and company wikis. A company’s intranet serves as a kind of meeting room and planning seminar that everyone in the company visits and attends throughout their workdays.

Extranet

SharePoint can be used to set up a site that you share with outside businesses you’re partnering with. Whether the other business is part of your supply chain or simply someone you’re contracting with for a project, you can provide them with access to all the information they may need from your company while giving them a place to upload all the information you may need about theirs.

Websites

You can use SharePoint to build and manage a publicly facing site as well. As a website Content Management System (CMS), SharePoint allows you to sign in and make changes to your pages. You can update information, add text or graphics, and create new pages.

Documents

SharePoint gives businesses a shared space to store documents so they’re not locked away on any one person’s hard drive. Documents stored on SharePoint can be accessed by anyone in the company—unless the administrator has limited access to a smaller group. This means that you won’t have to travel to multiple offices or wait for multiple emails to get all the files you need for a task. SharePoint also allows you and your coworkers to work simultaneously on a single document, saving previous versions, and tracking updates. So you avoid having to create several different versions of the document by emailing it to all the people whose input you need.

Collaboration

It’s easy for everyone to stay up-to-date and coordinate their efforts on projects when you’re talking about a dozen or so people working out of the same office building. SharePoint is designed to extend this ease of interaction beyond small groups in single locations. You can sign in to SharePoint from any desktop or mobile device, and you can use it to have constant access to information on project statuses, client histories, the locations and schedules of coworkers, and anything else related to the project.

Business Intelligence

The comprehensive access SharePoint provides to your business's data also makes it possible to find countless ways to use all that information to make better decisions. SharePoint makes it easy to search through all your company’s files, but beyond that it can help you discover larger patterns. And it can display trends over time or relationships between different inputs with intuitively graspable graphs and charts. Once you’ve decided on a new course of action, SharePoint can also be instrumental in getting everyone company-wide onboard with its implementation.

What makes SharePoint such a powerful tool, though, is that it doesn’t simply rely on all the features and functions it provides out-of-the-box. SharePoint implementations can be customized to streamline pretty much any aspect of business collaboration you can think of. If you have questions about specific uses or capabilities, feel free to post them in the comments section

Thursday, February 18, 2016

Make all SharePoint Surveys truly anonymous real quick

If you have worked withe surveys, you must be knowing survey provide an option "Show user names in survey results", to make survey anonymous, If not you could refer this. Now the problem with this is anyone with rights to edit list settings could change this setting and all users would be visible. 

There is no suggested approach to do this there are lots of options available. One very nice article is available on this msdn blog. Mostly suggested changing the name using event receiver or workflows. But none of these serve my purpose, as i needed to make all the surveys on the farm anonymous including the new ones. Also with hundreds of surveys across the farm, these workflows or event receivers could hamper performance.


So, i did a small trick to make sure no one to change the list setting and rest SharePoint could handle automatically.


I made some tweaking in the application page witch impacted all my surveys. We could also do the same for a particular site.


We will have to make changes in two application pages, available in layouts folder of 15 hive. Combined these changes will give an effect to of no in survey setting.



  1. ListGeneralSettings.aspx : This page opens when we click "ListName, Description, Navigation in site settings.
  2. New.aspx : This page opens when we create a new survey list. Page URL is same for both popup and advanced options page.
ListGeneralSettings:
Search for "Survey Settings" and make radio button with id "RADShowUserYes" hidden by adding attribute visible:false. This will hide the yes option in List settings.

New.aspx: We will make two changes in this file.
  1. To make sure user can not select yes on advanced options screen. To do this find the below ts tag and comment it.
    <td class="ms-authoringcontrols" nowrap="nowrap"><input id="onetidShowUserNamesNo" type="radio" value="on"  name="showUsernames" title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,lstsetng_showusernamesyes_title%>' EncodeMethod='HtmlEncode'/>" /><label for="onetidShowUserNamesYes"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,lstsetng_showusernamesyes_label%>" EncodeMethod='HtmlEncode'/></label></td>
  2. By pass the Basic creation popup and navigate to advanced screen because by default SharePoint consider it yes. To do this:
    Find the below code in the file:
if (this.IsDialogMode){
    %><a class="ms-textSmall" href="javascript:;" onclick="NavigateToFullPage()"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,lstsetng_advancedoptions_text%>" EncodeMethod='HtmlEncode'/></a><%}

    and another if condition inside this if. Final code should look like this:

    if (this.IsDialogMode)
    {
    if (HttpContext.Current.Request.Url.AbsoluteUri.Contains("ListTemplate=102"))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "NavigateToFullPage()", true);
            }else { 
    %>
    <a class="ms-textSmall" href="javascript:;" onclick="NavigateToFullPage()"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,lstsetng_advancedoptions_text%>" EncodeMethod='HtmlEncode'/></a>
    <%
            }}

    If you have any existing survey lists, you could use powershell to to change their list setting.