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.

    Friday, June 26, 2015

    Master Page and Page Layouts not available in SharePoint Designer Left Navigation (Object's Panel)

    If you could open the site in SharePoint Designer but "Master Pages" and "Page Layouts" option is not available in Left Navigation(also called Object's Panel), there could be multiple reasons for that.

    Lets troubleshoot this :

    First thing to check: Permissions:
    You need at least Designer rights on the site to do this. Click here to learn how to to check permissions in SharePoint and learn more about SharePoint permissions.

    Second Thing to check : Publishing Feature:
    Page Layout specifically are available in Publishing sites only. Which means that publishing feature should be activated on the site.
    How to check Feature
    From site setting , go to Site Features. Look for Publishing feature and activate if not activated already.

    Third Thing to check Designer setting in Site Collection Settings :
    SharePoint designer options could be made available or unavailable at site collection level if enabled from web application. Click here to check options.


    Forth thing to check Designer settings in Central Admin:
    SharePoint Designer is enabled at Web application level through Central Admin and there are options to enable partial designer options only.

    Please make sure that "Enable Customizing Master Page and Page Layouts" is enabled for your web application.

    Click here to know about SharePoint Designer Settings in Central Admin.

    How to check permissions for SharePoint or AD user

    This article implies to SharePoint 2010, SharePoint 2013 and SharePoint 2016. This option is not available in SharePoint 2007.


    • To check permissions for a particular user, group (both SharePoint and AD group) click Site Permissions from Site Settings.
    • Click Check Permissions from Ribbon.
    • Enter name/ Email / ID and click Check permissions.

    I will show all permissions user have. If a user is given access through multiple groups there will be multiple entries.

    Same way We could check permissions for lists/libraries of even a single item 


    Sunday, May 31, 2015

    Whats's New in SharePoint 2016

    While we are still waiting MS SharePoint 2016, which will be released somewhere around May 2016, Microsoft has revealed some teasers. 

    After watching the 1 and half hour video, below are the take homes:


    • Microsoft is Building SharePoint 2016 and next releases considering SharePoint 2013 as baseline.
    • Size of the database per site collection will be increased from 250 GB to TB's (exact figure will release late). This will surely going to help in Migrations.
    • List threshold is going to be from 5000 to somewhere around 10000.
    • Number of Site Collections per web applications would be increased to 1.5 lac.
    • For Migration from 2010 or 2007, we will have migrate to 2013 first.
    • Yammer will totally integrated in SharePoint 2016.
    • Specific roles could be assigned to servers in code, while installing.
    • Microsoft is moving from 999 up-time to 9999 up-time.



    I will keep updating this when i will have more information.

    Saturday, April 11, 2015

    Migration from MOSS 2007 to Sharepoint Azure

    Although there is lots of documentation already available on this i want to list the steps to migrate from MOSS 2007 to SharePoint Azure in simple language.

    Now before we start, lets list some points to consider:

    • We can not directly Migrate from MOSS 2007 to SharePoint azure. We will have first migrate to SP 2010.
    • We will have to convert AD users to ADFS as explained here.
    • It is always a good practice to cleanup the SharePoint Database before we mount it on Azure Site.

    Steps to Migrate

    Step 1 : Make MOSS 2007 DB read only

    • On the MOSS 2007’s database server, click Start, point to All Programs, Microsoft SQL Server, and then click SQL Server Management Studio.
    • Traverse to Databases node by expanding the tree
    • Right-click the name of the database that you want to set to read-only, and then click Properties.
    • In the Properties dialog box, click the Options tab.
    • Under State, select the Database Read-only to True, and then click OK
    Step 2 : Take MOSS 2007 DB Backup

    • Traverse to Databases node by expanding the tree.
    • Right-click the database you want to back up, point to Tasks, and then click Backup Database
    • In the SQL Server Backup dialog box, specify a name for the backup, select Back-up type – Full, select a destination, and then Click OK to start the backup process.
    Step 3 : Restore this Backup on 2010 DB Sever.
    Step 4 : Create a Web application on SharePoint 2010.
    Step 5 : Remove the data base of new created web application and mount the restored DB.
    • This could be done using UI or power-shell. This is listed by Microsoft here.
    Step 6 : Now we will test DB for any missing features and if we need to install any custom components on the on Azure.
    Test-SPContentDatabase -Name <DatabaseName> -WebApplication <URL>
    This URL explains thoroughly the report generated by Test command .

    Step 7 : Based on the report generated in above step we will have to take appropriate actions.
    Majorly there would be following things:
    • Missing features : Use the power-shell to remove the missing features(or orphaned features)
    • Install any third party components.
    Step 8 : Once cleanup is done take DB back up of 2010 site.
    Step 9 : Restore backup on Azure DB sever.
    Step 10 :  Create a Web application on SharePoint 2013.
    Step 11 : Remove the data base of new created web application and mount the restored DB.
    Step 12 : Now that our Site is ready we will have to convert the Users.
    Follow this link to understand how to convert.
    Step 13 : Deferred Site Collection Upgrade
    This is a replacement of Visual upgrade feature available in 2010. Its pretty simple and can be done using below mentioned power-shell command.
    Get-SPSite -ContentDatabase WSS_Content -Limit All | Upgrade-SPSite –VersionUpgrade