DCSIMG
July 2010 - Posts - itaysk

July 2010 - Posts

אתמול התקיים מפגש שישי של קבוצת מפתחי SharePoint. המפגש התקיים בשיתוף עם קבוצת ה BI, ובנוכחות אורחים מצוותי הפיתוח מיקרוסופט.

לאחר הרצאת הפתיחה המשותפת שחשפה אותנו אל התהליכים של צוותי הפיתוח במיקרוסופט, אורי זהבי מחברת אופיסופט העביר הרצאה על Performance Point.

אתר המפגש, הכולל חומרים, מצגות ותמונות:
http://www.sharepoint-israel.co.il/events/SPG/SPG6

נתראה במפגש הבא,
איתי שקורי.

 IMG_20100726_185353

IMG_20100726_203503

שלום לכולם!

אנחנו שמחים להזמין אתכם לאירוע חד פעמי ומיוחד המאחד את קבוצות המשתמשים של SharePoint ושל BI.
במפגש נארח את צוות המוצר של Excel Services אשר מגיעים אלינו במיוחד מחו"ל ויקחו חלק באירוע.
המפגש יפתח בהרצאה משותפת לשתי הקבוצות, אותה יעביר ערן מגידו, מנהל המוצר של Excel Services, ובה הוא ידבר על העתיד וההתפתחות של Excel Services.
בהמשך, נתפצל ל 2 מסלולים, כאשר את ההרצאה של קבוצת SharePoint יעביר אורי זהבי מחברת אופיסופט וידבר על Performance Point.

האירוע יתקיים ב 26.7.10 בשעות 17:00-20:00.
שימו לב, שמדובר בעוד כשבוע, לכן מהרו להרשם! (ההרשמה ללא תשלום)

הרשמה ופרטים נוספים:

https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032456267&Culture=he-IL

נתראה באירוע,

איתי שקורי.

with 1 comment(s)
תגים:, ,

This is the third post of a series about SharePoint 2010 Data Services: Part 1, Part 2, Part 3 (this one).

In the previous post I talked about using SP 2010 Data Services via the browser, or passing the feed URL to some other component. This could be helpful for code-less mesh-ups, or client side programming. But there’s more to Data Services then just that, It is also a pretty good alternative to Client OM. In this post I will explore the programmability possibilities of Data Services from Visual Studio 2010.

We already know how to consume Data Services using HTTP requests. This can also be done from code, but it will require us to manually construct queries, HTTP requests, then execute them, and finally parsing the results. With Visual Studio 2010, you can consume Data Services without performing these manual operations yourself. Visual Studio can generate proxy classes for you, that provides an easy way to work with your data, as well as a type safe one.

First, from VS 2010, open the “Data” menu, and select “Add new Data Source…”. As you can see, there’s a new “SharePoint” Data Source.

datasvc_3

Select it, and you are taken to the add new service reference dialog. By the way, this is the same as adding service reference directly from the server explorer, as shown below.

datasvc_5

Type in the address of the service (“http://server/site/_vti_bin/listdata.svc”), and click “Go”. I chose also to change the service namespace at this point.

datasvc_4

Finish the wizard, and you have added the data source. What you have done in this step is not connecting to the service, but discovering it, analyzing the site content, and generating proxy classes that can work against the site’s data.

Now it is time to establish a connection. First, create a new data context. This is an object named like your site’s name appended with the phrase “DataContext” (in my case it’s “ItayskDataContext”). You have now established a connection to the site. Since we are operating from the client, we need to specify credentials with which to authenticate.

ItayskDataContext service =
new ItayskDataContext(new Uri("http://dev-sp2010-01/sites/itaysk/_vti_bin/listdata.svc"));
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

Now lets get some data from the site. The beauty with Data Services, is that it lets you work with familiar tools such as object oriented approach and LINQ queries, and takes care of all the plumbing for you. Getting all items from an announcements list with the word “itay” in their title will look like this:

var res = from a in service.Announcements
where a.Title.Contains("itay")
select a;

A few things to notice here: First, we are querying an object that represents the list. This is the OO approach I was talking about (just like SPMETAL and LINQ2  SharePoint). The data context object has a property for each list in the site. Second, we are using LINQ to query the data source.

If you want to know what’s going on backstage (also useful for debugging), launch Fiddler, and we see this response\request:

datasvc_6

That’s an HTTP GET request… (remember what we said about Data Services exposed as HTTP requests?) Now, what if we wanted to add a new item to the list? We obviously need to change the HTTP verb from GET to POST, but as we said, we don’t want to deal with plumbing. This is why the data context object has special methods like “AddToAnnouncements” which accepts an “AnnouncementsItem”.

Modifying an item is as easy as obtaining an item, and changing one of it’s properties. To delete an item, call the “DeleteObject” methods of the data context, and pass the item you wish to delete. Finally just call
the “SaveChanges()” method of the data context. This will create an execute requests with the appropriate headers.

Here is how it looks in code. This piece of code:

//Create an Announcements object
AnnouncementsItem temp = new AnnouncementsItem();
temp.Title = "Hi!!";
//Add new item
service.AddToAnnouncements(temp);
service.SaveChanges();
//Modify item
temp.Title = "Bye!!";
service.UpdateObject(temp);
service.SaveChanges();
//Delete item
service.DeleteObject(temp);
service.SaveChanges();

will result in these calls:

datasvc_7

In this post we have learned how to use Data Services as a data source for your client application. Data Services are a very useful way to work with SharePoint that requires no special code on the client side, and hence fits almost every scenario.

with 4 comment(s)
תגים:,

אזור חדש ב SharePoint2010.co.il – מאגר של אתרים מבוססי SharePoint.
http://sharepoint2010.co.il/customers

המאגר כולל שם החברה, מגזר, קישור לאתר, תמונה, וגרסאת SP של האתר. אפשר להשתמש בו כדי להדגים ללקוחות את בשלותו של המוצר, לקבל רעיונות מאתרים אחרים וגם סתם כדי להתעדכן.

אני מקווה שהמאגר ישמש אתכם, כשם שהוא נוצר על סמך המלצות שלכם. המאגר ציבורי ושיתופי, אם יש אתרים שאתם רוצים שיופיעו בו, נשמח לשמוע ולהוסיף אותם.

customers_db

with 2 comment(s)
תגים:,

When you setup the providers for the IIS web site, don’t change the default providers for Membership and Roles to your SQL Membership providers. It might appear as working, but problems will arrive sooner or later.
I chose to emphasize this because some tutorials for SharePoint 2007 instructed to change the default provider. But in 2010, there’s the new Claims Based Model that has providers of it’s own, so we shouldn’t change this setting anymore.

If you use the IIS 7 console to make these changes, it should look like this:

When you go to the website, and click “.NET Users” (which is the equivalent of Membership in web.config), you should see this error message:

default_provider_1

“The feature cannot be used because the default provider is not a trusted provider.”


This message is OK because the default claims providers are trusted, and that is alright.
Click OK, and then “Set Default Provider…” link in the top right menu.
The selected option should be “i” for .NET Users, and “c” for .NET Roles. Keep it that way.

default_provider_2

default_provider_3

with 5 comment(s)
תגים:,

This is the second post of a series about SharePoint 2010 Data Services: Part 1, Part 2 (this one), Part 3.

In this post we will talk about what it takes to get started with SharePoint 2010 Data Services.

Installation

As I mentioned in the fist post, in order to use Data Services with SharePoint 2010, you have to install an update for .NET framework.

The current release is called “ADO.NET Data Services Update for .NET Framework 3.5 SP1” and is available for Windows 2008 or Windows 7 here: http://www.microsoft.com/downloads/details.aspx?familyid=79d7f6f8-d6e9-4b8c-8640-17f89452148e&displaylang=en

Download the file and install it on your SharePoint machine. The installation wizard is no more than one screen with no choices. When it’s done restart the machine.

Basic Usage

The data in SharePoint lists is now accessible under the following URL: http://ServerName/SiteName/_vti_bin/listdata.svc where “ServerName” and “SiteName” are placeholders. They are required in order to establish context for the service.

All Requests are made using regular HTTP GET. The response of a Data Services list query is always an AtomPub feed or JSON.

If you typed the service URL in the address bar of your browser you should see something like this:

DataServices_1

This is an XML response (not a feed yet) that shows all the lists that are available under the site you specified in the URL.

You can now choose a list like this: http://ServerName/SiteName/_vti_bin/listdata.svc/ListName
This will return an XML feed of all the list items in that list.

DataServices_2

You can perform other actions like list filter sorting and paging but this is beyond the scope of this article. Basically the service should respect the oData protocol, so most of the operations that are defined in oData should be implemented the same way here. (I say should because some sections in the oData specifications are not working here.. yet).

Now that you have the items that you want, you can pass them to a web part, use them in JavaScript code, manipulate the result using XPath, or anything else.

In the next post I will talk about using Data Services as a Data Source with Visual Studio 2010.

with 5 comment(s)
תגים:,

Great news everyone, I’m a SharePoint MVP! BTW, The first SharePoint MVP in Israel.

Special thank to Guy Burstein, the one and only :)

Thanks Microsoft, for the recognition. I will keep up the good work!

mvp_wide

with 9 comment(s)
תגים:,