Monday, May 13, 2013

Updated/Changes Features in SharePoint 2013 From SharePoint 2010

This article describes the features in SharePoint 2010 Products that have been deprecated or removed from SharePoint 2013. Deprecated features are included in SharePoint 2013 for compatibility with previous product versions.
Features deprecated in SharePoint 2013 Preview
The following features and functionality have been deprecated or changed in SharePoint 2013.

Visual upgrade
The visual upgrade feature in SharePoint Server 2010 is not available in SharePoint 2013. This allowed site collection owners and site owners to update customizations to work in the new user interface. Once the database and site collection upgrade was complete, the user had the option to upgrade the user interface on a more granular level of the website.

Reasons for removing this feature:

The visual upgrade feature is replaced with a deferred site collection upgrade. The site collection upgrade process is not reversible. The deferred site collection upgrade is a more comprehensive upgrade process than visual upgrade. Visual upgrade preserved only the old master pages, CSS files, and HTML files. Deferred site collection upgrade preserves much more, including SPFeature functionality. To do the deferred site collection upgrade, major changes in the architecture were required, including the removal of visual upgrade.

Document Workspace site template

Document Workspace site template is not available.

The reasons for removing this feature is that the scenario of collaborating on a document is now provided by the Team Site site template.

Personalization Site template

Personalization Site template is not available.

Reasons for removing this feature: As per Microsoft study, the Personalization Site template was not a widely used site template.

Meeting Workspace site templates

Meeting Workspace site templates are not available. This includes the Basic Meeting Workspace, Blank Meeting Workspace, Decision Meeting Workspace, Social Meeting Workspace, and Multipage Meeting Workspace.

Reasons for removing this feature: SharePoint 2013 and Office 2013 provide other features that support meetings and collaboration. For example, you can use Lync to conduct live meetings, OneNote to take notes during meetings, and a SharePoint team site or My Site to store shared meeting notes.

Group Work site template and Group Work solution

Group Work site template is not available. This Group Work site template provides a groupware solution that teams can use to create, organize, and share information.

Reasons for removing this feature: As per Microsoft study, this Site template was not a widely used site template.

Imaging Web service

The Imaging Web service provides functionality for creating and managing picture libraries. The Imaging Web service will be removed from the next major release of SharePoint. The Imaging Web service is included and supported in SharePoint 2013.

Reasons for removing this feature: The Imaging Web service is not widely used. The only client application for the Imaging Web service, Office Picture Manager, is no longer included with SharePoint 2013.

Excel Services: We Can't edit workbooks in the browser that have external data connections.

Workbooks with external data connections that use Windows authentication cannot be refreshed in the browser. Instead, you are prompted to open the workbook in the Excel client program..
Reasons for removing this feature: This is a design limitation in SharePoint 2013.

Web Analytics in SharePoint Server 2010

Web Analytics in SharePoint Server 2010 has been discontinued and is not available in SharePoint 2013. Analytics processing for SharePoint 2013 is now a component of the Search service.

Reasons for removing this feature: A new analytics system was required for SharePoint 2013 that included improvements in scalability and performance, and that had an infrastructure that encompasses SharePoint Online.

Reports from Web Analytics for the top items in a site are carried forward. Reports that show browser traffic, top users of a site, and referring URL are not carried forward and are not used by the Analytics Processing Component in SharePoint 2013.

SharePoint Foundation 2010 deprecated search features

The following functionality has changed in SharePoint Foundation search.

Search capabilities

The search capabilities of SharePoint Foundation 2013 have changed, and are now based on the same search implementation as SharePoint Server.

Reasons for removing this feature: Alignment of basic capabilities between SharePoint Server and SharePoint Foundation.

SharePoint Server 2010 deprecated search features

The following section provides details about the deprecated search features in SharePoint Server.

Modifying the search topology using a web-based interface

SharePoint 2013 uses the web-based interface to show the current status of the topology. We can change the topology by using Windows PowerShell. SharePoint Server 2010 also included a web-based option for changing the topology.

Reasons for the change: The core search architecture of SharePoint 2013 has a more complex and flexible topology that can be changed more efficiently by using Windows PowerShell.

Replacement mode within the thesaurus

The thesaurus replacement mode is deprecated in SharePoint 2013.

In SharePoint Server 2010, you can classify entries in the thesaurus as expansions that are added to the query in addition to the original term. Likewise, you can classify entries as replacements of the original term in a query. In SharePoint 2013, thesaurus replacements are no longer supported. All entries in the thesaurus are expansions, and the original term is not removed from the query. The original query term is always evaluated when you search the index. You cannot remove synonyms or words from the index.

Reasons for the change: The feature has limited usage, and may also have unwanted side-effects for relevance.

Search Query web service
The Search Query web service is deprecated in SharePoint 2013.

In SharePoint Server 2010, the Search Query web service exposes the SharePoint Enterprise Search capabilities to client applications. This enables you to access search results from client and web applications outside the context of a SharePoint site.

Reasons for the change: The Search Query web service is deprecated because the client objects model (CSOM) and a new REST-based web service is available for developing Office-wide extensibility scenarios. The CSOM exposes the same functionality as the Search Query web service, and a larger set of functionality for stand-alone client applications.

Search RSS and search from Windows

The search RSS feature is deprecated in SharePoint 2013. The functionality for performing enterprise searches from Windows 7 depends on search RSS and this element have also been deprecated in SharePoint 2013.

The RSS link no longer appears on the results page. This link is replaced by the Search Alerts link.

Reasons for the change: Most RSS readers that are available do not support claims authentication. In SharePoint 2013, claims authentication is the default authentication model. By using claims authentication, RSS readers work while the authentication cookie is cached. However, after the cookie expires, RSS readers cannot refresh their authentication, and so they stop working.
Custom word breaker dictionaries
The format of the custom word breaker dictionaries has changed in SharePoint 2013. In SharePoint 2013, you can only create one language-independent dictionary. In SharePoint Server 2010, you can create language-specific custom dictionaries
Reasons for the change: The search processing framework for SharePoint 2013 is new, and the way the word breakers operate has changed.

Configuration of stemming in the registry

The configuration of stemming in the registry is no longer supported in SharePoint 2013. Modifying stemming entries in the registry has no effect during search. In SharePoint Server 2010, you can turn stemming on or off, or you can replace it with a third-party stemmer by changing the registry. In SharePoint 2013, you cannot use a third-party stemmer.

Reasons for the change: This feature has limited feature usage.

SharePoint Search SQL syntax

In SharePoint Server 2010, you could construct complex search queries by using SQL syntax.

Search in SharePoint 2013 supports FAST Query Language (FQL) syntax and Keyword Query Language (KQL) syntax for custom search solutions. You cannot use SQL syntax in custom search solutions.

Reasons for the change: The core search architecture has changed in SharePoint 2013, and the SQL syntax is no longer supported.

Shallow search refiners

SharePoint Server Search in Office 2010 supported shallow search refiners. FAST Search Server 2010 for SharePoint supports shallow refiners and deep refiners. In SharePoint 2013, only deep search refiners are supported.

Reasons for the change: The shallow search refiners are replaced with an improved implementation of deep search refiners.

How to secure external anonymous access to SharePoint 2010 sites

In this article I am explaining about securing anonymous access in SharePoint 2010 sites. This is a pain for most of organizations when dealing with public facing anonymous access sites. In this article I also cover how to secure _layout folders.

If you're developing an anonymously accessible SharePoint website, especially an internet-facing one, you may have noticed that you're SharePoint Forms pages are also accessible to anonymous users. For example http://SERVER/_layouts/viewlsts.aspx, _vti_bin web services etc. Typically we don't want this, so how do you prevent anonymous users from accessing these pages? The following steps will help you to do it. This feature is known as lock down feature which is by default enabled for publishing sites.

To enable this feature

  1. First remove all anonymous access from the site.
  2. Then open command prompt and go to the folder C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
  3. First check whether the feature is activated or not; you can use the command below to check it
  4. get-spfeature -site http://url
  5. If ViewFormPagesLockDown is listed, it's enabled.
  6. If not listed you have to enable it with the command below

    To activate the Activate Feature:
  7. stsadm -o activatefeature -url -filename ViewFormPagesLockDown\feature.xml

    De-Activate Feature:
  8. stsadm -o deactivatefeature -url -filename ViewFormPagesLockDown\feature.xml

Even when lockdown mode is enabled, anonymous users can still access certain SharePoint Server application URLs, such as pages in the _layouts directory and Web services that are exposed in the _vti_bin directory. So, to increase security, you should enable lockdown mode and also modify the Web.config file with the following XML element:
<add path="configuration">
<
location path="_layouts">
<
system.web>
<
authorization>
<
deny users="?" />
</
authorization>
</
system.web>
</
location>
<location path="_vti_bin">
<
system.web>
<
authorization>
<
deny users="?" />
</
authorization>
</
system.web>
</
location>
<location path="_layouts/login.aspx">
<
system.web>
<
authorization>
<
allow users="?" />
</
authorization>
</
system.web>
</
location>
<
location path="_layouts/error.aspx">
<
system.web>
<
authorization>
<
allow users="?" />
</
authorization>
</
system.web>
</
location>
<location path="_layouts/accessdenied.aspx">
<
system.web>
<
authorization>
<
allow users="?" />
</
authorization>
</
system.web>
</
location>

How to connect to the Oracle database using Business Connectivity Services (BCS) in SharePoint 2010

Introduction:
Business Connectivity Services (BCS) is a new service introduced with SharePoint 2010 to allow SharePoint sites to connect to and manipulate external data. SharePoint 2007 had a similar facility in the form of Business Data Catalog (BDC) which made external data available within its site. However, a major problem with BDC was the difficulty in creating solutions as there was no support in the 2007 designer. Most BDC solutions were simply for accessing external data, manipulating external data sources was extremely difficult.

With SharePoint 2010, BCS ships with out-of-box features such as solutions, services, and tools which may connect to external data an easy task. Whether you want to retrieve Outlook contacts in a list offline or edit the contents of your document file or share your excel sheet online or reuse data from dynamic InfoPath forms or just update your business presentation, BCS enables deep content sharing, editing and integration in SharePoint 2010 with SharePoint Designer and Visual Studio tools. To connect to the SQL database we can use either SharePoint designer (where we can connect directly to the SQL or using WCF or through .Net Assembly) or using Visual Studio (BDC Model). In case of connecting to the Oracle database we don't have direct option in the SharePoint designer, so we can use BCS Meta Man to create an external content type.

Prerequisites:

I. A local installation of either SharePoint Foundation 2010 or SharePoint Server 2010,

ii. Oracle Client (Version: 10g),

iii. Visual Studio 2010 and

iv. BCS Meta Man.

Oracle Database:

Table Name: HR.CUSTOMERS

1.gif

Note:

In the above table CUSTOMER_ID is the Primary Key.

Creating a BCS External Content Type:

Steps Involved:

The following steps should be followed to create a BCS External Content Type using Visual Studio 2010.

v. Open Visual Studio 2010.

vi. Go to File => New => Project.

vii. Select Empty SharePoint Project under installed template category SharePoint 2010 and name it as BCSUsingOracleDatabase.

2.gif

viii. Click OK.

ix. Check "Deploy as a farm solution".

x. Click Finish.

xi. Right click the Solution Explorer and add a New Item.

xii. Select BCSMetaMan under installed template category Lightning Tools and name it as BCSMetaManForOracle.

3.gif

xiii. Click ADD.

xiv. Add System.Data.OracleClient reference to your project.

xv. Connect to the Oracle Database.

  • Go to Tools => Connect to Database.

    4.gif
  • Add Connection wizard will pop up.
  • Choose the Data Source as Oracle Database (Oracle Client).
  • Enter the Server Name, User Name and Password as shown below.

    5.gif
  • Click on Test Connection.

    6.gif

  • Click OK.
  • In the Server Explorer you can view the Oracle Database as shown below.

    7.gif



xvi. Create an External Content Type Using BCS Meta Man.

  • You will find the BCS Meta Man menu item in the menu bar.

    8.gif

  • Click on BCS Meta Man - > BCS Meta Man Data Source Explorer.
  • Click on the "Add Connection" button of the data source explorer.
  • In the Connection Dialog choose the Data Source as Oracle.
  • Enter the Database Name, User Name and Password.
  • Click Connect.

    9.gif

  • Oracle Database will be displayed with all tables.

    10.gif
  • Drag and drop the HR.CUSTOMERS table in the BCS Meta Man design surface.
  • In the Model Type wizard select .Net assembly and click OK.

    11.gif

  • Entity Creation wizard will pop up, click next.

    12.gif
  • By default CUSTOMER_ID will be selected as identifier.

    13.gif

  • Click Next.
  • Select all the methods that are available and click Generate.

    14.gif

  • BCS Meta Man will add new files to the project which contain generated C# code.

    15.gif
  • You'll also see the External Content Type on the design surface as shown below.

    16.gif


xvii. Build the Project.

xviii. Once it is build successfully, Deploy the project.

Configure Business Data Connectivity access rights:

I. Go to Central Administration -> Application Management -> Manage Service Applications.


17.gif

ii. Click on Business Data Connectivity Service.


18.gif

iii. In the top Ribbon click on Manage.

19.gif


iv. In Service Application Information check the External Content Type HR_CUSTOMERS.


20.gif

v. In the top Ribbon click the Site Object Permissions.

vi. Site Object Permissions wizard will pop up add the account (Group or Users) and assign the permissions.

Creating an External List in the SharePoint Site:

I. Open the SharePoint Site.

ii. Go to Site Actions => More Options.

21.gif


iii. On the Create Wizard, from the Installed Templates Select List.

iv. In the List Type select External List and click Create.


22.gif

v. Enter the Name as BCS for OracleDB and choose the External Content Type as shown below.

23.gif

vi. Click OK.

vii. External List is created successfully.

Testing:

Creating a new item:

I. Click on Add new item option in the ribbon.

ii. Enter the values as shown below.


24.gif

iii. Click OK.

iv. New item will be created in the SharePoint External List.


24.1.gif

Update in the Oracle DB:

I. Go to Oracle – OraClient10g home => Application Management => SQL Plus.

ii. Enter the User Name, Password and Host String as shown below.


25.gif

iii. Select the table to see the changes as shown below.


26.gif

iv. A new item has been added to the HR.CUSTOMERS table.

Summary:

Thus an external content type is created for oracle database using BCS Meta Man and an external list is created based on that external content type to display the Oracle data.

Friday, April 26, 2013

Working with SPUtility.js in SharePoint 2010


Let me discuss the use of SPUtility.js in SharePoint 2010 with simple examples.

Populate value for the Title field automatically 

Write the following script

Approach 1:
<script src="/Shared%20Documents/prototype.js" type="text/javascript"></script>
<script src="/Shared%20Documents/SPUtility.js" type="text/javascript"></script>
<script type="text/javascript">
Event.observe(window,'load',function(){
    SPUtility.GetSPField('Title').SetValue('Hello world!');
}); </script>

Approach 2:
<script src="/Shared%20Documents/prototype.js" type="text/javascript"></script>
<script src="/Shared%20Documents/SPUtility.js" type="text/javascript"></script>
<script type="text/javascript">
function MyCustomExecuteFunction()
{
     SPUtility.GetSPField('Title').SetValue('Hello world1!');
}
_spBodyOnLoadFunctionNames.push("MyCustomExecuteFunction");</script>

To install, you’d simply place the JavaScript above into a Content Editor Web Part on your NewForm.aspx or EditForm.aspx. Take a look at the SPUtility.js Installation page for detailed instructions.

Get the Title field value in EditForm.aspx

Approach 1:
<script src="/Shared%20Documents/prototype.js" type="text/javascript"></script>
<script src="/Shared%20Documents/SPUtility.js" type="text/javascript"></script>
<script type="text/javascript">
Event.observe(window,'load',function(){
    alert(SPUtility.GetSPField('Title').GetValue());
}); </script>

You can use approach 2 also to get the value.

Reference Links:
Installation documentation:
 
Download scripts

SPUtility.js details

Javascript PreSaveAction() in SharePoint 2010 Validation

Go to SharePoint List Defalut Edit or Newform.aspx.

Over there you have to put the HTML Form WebPart.

Inside the HTML Form Webpart you need add the following scripts tag and references.

Download js files from here  http://sputility.codeplex.com/

<script src="/Registry/JSFiles/prototype.js" type="text/javascript"></script>
<script src="/Registry/JSFiles/SPUtility.js" type="text/javascript"></script>

<script type="text/javascript">

function PreSaveAction() {
var item=SPUtility.GetSPField('Type of Report').GetValue(); // Choice filed Validation
if(item=="Informer")
{
     alert("Please select the Value");
     return false;

}
else
{
return true;
}
 }
</script>​

List Join operation in SharePoint 2007 / 2010


Approach 1


private static void FetchAllListsDataJoinUsingLinq()
{
    using (SPSite _spSite = new SPSite("<Site Url>"))
    {
        using (SPWeb web = _spSite.OpenWeb())
        {
            SPList placeList = web.GetList(web.Url + "/lists/TouristPlace");
            SPQuery ospPlaceQuery = new SPQuery();
            DataTable dtPlace = placeList.GetItems(ospPlaceQuery).GetDataTable();
            SPList cityList = web.GetList(web.Url + "/lists/City");
            SPQuery ospCityQuery = new SPQuery();
            DataTable dtCity = cityList.GetItems(ospCityQuery).GetDataTable();
            SPList countryList = web.GetList(web.Url + "/lists/Country");
            SPQuery ospCountryQuery = new SPQuery();
            DataTable dtCountry = countryList.GetItems(ospCountryQuery).GetDataTable();

            List<TouristPlaceDetails> joinData = (from place in dtPlace.AsEnumerable()
                                                    join city in dtCity.AsEnumerable() onplace.Field<string>("CityName") equals city.Field<string>("Title")
                                                    join country in dtCountry.AsEnumerable() oncity.Field<string>("Country") equals country.Field<string>("Title")
                                                    select new TouristPlaceDetails
                                                    {
                                                        Name = place.Field<string>("Title"),
                                                        History = place.Field<string>("History"),
                                                        City = place.Field<string>("CityName"),
                                                        Population = city.Field<string>("Population"),
                                                        Country = country.Field<string>("Title"),
                                                        AgentName = country.Field<string>("AgentName"),
                                                        AgentNumber = country.Field<string>("AgentNumber")
                                                    }).ToList();
        }
    }
}


Approach 2
private static void JoinMultipleListsUsingLinqSharePoint2010()
        {
            LearnDataContext joinDataContext = new LearnDataContext("<Site Url>");
            List<TouristPlaceDetails> joinData = (from place in joinDataContext.TouristPlace.ToList()
                                                  join city in joinDataContext.City on place.CityNameequals city
                                                  join country in joinDataContext.Country on city.Countryequals country
                                                  select new TouristPlaceDetails
                                                  {
                                                      Name = place.Title,
                                                      History = place.History,
                                                      City = place.CityName.Title,
                                                      Population = city.Population,
                                                      Country = country.Title,
                                                      AgentName = country.AgentName,
                                                      AgentNumber = country.AgentNumber
                                                  }
                           ).ToList();

        }

Approach 3

private static void JoinMultipleListsUsingJoinsProperty()
{
    using (SPSite _spSite = new SPSite("<Site Url"))
    {
        using (SPWeb web = _spSite.OpenWeb())
        {
            SPList reportList = web.GetList(web.Url + "/lists/TouristPlace");
            SPQuery ospQuery = new SPQuery();
            ospQuery.Joins = @"<Join Type='LEFT' ListAlias='City'>
                                        <Eq>
                                            <FieldRef Name='CityName' RefType='Id' />
                                            <FieldRef List='City' Name='ID' /> 
                                        </Eq>
                                    </Join>
                                    <Join Type='LEFT' ListAlias='Country'>
                                        <Eq>
                                            <FieldRef List='City' Name='Country' RefType='Id' />
                                            <FieldRef List='Country' Name='ID' /> 
                                        </Eq>
                                    </Join>";
            ospQuery.ProjectedFields = @"<Field
                                            Name='Population'
                                            Type='Lookup'
                                            List='City'
                                            ShowField='Population'/>
                                            <Field
                                            Name='Country'
                                            Type='Lookup'
                                            List='Country'
                                            ShowField='Title'/>
                                            <Field
                                            Name='AgentName'
                                            Type='Lookup'
                                            List='Country'
                                            ShowField='AgentName'/>
                                            <Field
                                            Name='AgentNumber'
                                            Type='Lookup'
                                            List='Country'
                                            ShowField='AgentNumber'/>";
            ospQuery.ViewFields = @"<FieldRef Name='Title'/>
                                        <FieldRef Name='History'/>
                                        <FieldRef Name='CityName'/>
                                        <FieldRef Name='Population'/>
                                        <FieldRef Name='Country'/>
                                        <FieldRef Name='AgentName'/>
                                        <FieldRef Name='AgentNumber'/>";
            SPListItemCollection dtResult = reportList.GetItems(ospQuery);
            List<TouristPlaceDetails> joinResult = new List<TouristPlaceDetails>();

            for (int i = 0; i < dtResult.Count; i++)
            {
                joinResult.Add(new TouristPlaceDetails
                                    {
                                        Name = Convert.ToString(dtResult[i]["Title"]),
                                        History = Convert.ToString(dtResult[i]["History"]),
                                        City = Convert.ToString(dtResult[i]["CityName"]),
                                        Population = Convert.ToString(dtResult[i]["Population"]),
                                        Country = Convert.ToString(dtResult[i]["Country"]),
                                        AgentName = Convert.ToString(dtResult[i]["AgentName"]),
                                        AgentNumber = Convert.ToString(dtResult[i]["AgentNumber"])
                                    }
                                );
            }
        }
    }
}


 Set Joins property in SPQuery in the below mentioned format:

<Join Type='LEFT' ListAlias='customers'>
          <Eq>
                <FieldRef List='<Child List Name (Optional)>' Name='<Lookup Column Name>' RefType='Id' />
                <FieldRef List='<Parent List Name>' Name='ID' />
          </Eq>
 </Join>