IntroductionWelcome| 00:03 | Hi! I am Simon Allardice, and welcome to
SharePoint Designer 2010: Creating
| | 00:08 | Data-Driven Web Pages.
| | 00:09 | SharePoint has become a huge part of
many organizations, but most of them still
| | 00:14 | have a lot of data and
it's not all in SharePoint.
| | 00:17 | It's in other databases, other
systems, and it's going to stay there.
| | 00:21 | In this course, I'll take you through
how to get to that data and get it into
| | 00:25 | your SharePoint web pages, so you can
view it, analyze it, format it, use it,
| | 00:30 | even edit it using the
regular SharePoint web interface.
| | 00:34 | I'll then talk about how to connect
to external systems, databases, web
| | 00:38 | services, XML files.
| | 00:40 | We'll explore something called BCS, a
new feature in SharePoint 2010, designed
| | 00:45 | to make your life easier when doing this.
| | 00:47 | And we'll see how to format pages and
web parts and apply your own formatting
| | 00:51 | rules to highlight and display data
the way that's most useful for you.
| | 00:56 | And we'll finish by creating custom
forms to allow you to create and edit
| | 01:00 | information in external systems.
| | 01:02 | So let's get started.
| | Collapse this transcript |
| What you should know| 00:00 | To get the most out of this course, I
need you to know about SharePoint, about
| | 00:04 | web sites, and about databases.
| | 00:06 | This course is not an
introduction to SharePoint.
| | 00:09 | I expect you know your way
around SharePoint 2010 already.
| | 00:13 | You know how to work with SharePoint
sites, with lists and document libraries.
| | 00:17 | You can work with web parts, work with
the ribbon on a SharePoint 2010 site, and
| | 00:22 | you know how SharePoint works with Office.
| | 00:24 | If that's not the case, take a look
at our other courses on lynda.com, like
| | 00:28 | SharePoint 2010 Getting Started or
SharePoint 2010 Essential Training.
| | 00:32 | Now, if you have web development
experience and know some HTML and CSS,
| | 00:37 | that's very useful.
| | 00:38 | Most of what we'll do in this course
doesn't even need that, but for some of the
| | 00:42 | advanced features it will come in handy.
| | 00:44 | And we're going to talk to databases
here. So whether that's Access, or SQL
| | 00:49 | Server, FileMaker, or Oracle, I
don't need you to be an expert, but you
| | 00:54 | should be good with core database concepts,
the idea of tables of data in rows and columns.
| | 01:01 | Now what don't you need?
| | 01:02 | Well, you don't need programming experience.
| | 01:04 | I don't need you to write code.
| | 01:05 | We won't be writing any code in
this course. We won't need to.
| | 01:09 | It's one of the great
abilities about this platform;
| | 01:11 | you can do amazing things without programming.
| | 01:13 | And I don't need you to know
SharePoint Designer 2010 already.
| | 01:17 | If you do, that's great; we will
be using it. But I'll cover what you
| | 01:20 | need to know about it.
| | 01:21 | Now what we're going to do here in
this course is very specific to the 2010
| | 01:27 | version of SharePoint.
| | 01:28 | If you're only working with
SharePoint 2007, you'll probably find the
| | 01:32 | differences are too significant to be practical.
| | 01:36 | And if you want to get hands-on,
you're going to need access to an installed
| | 01:39 | SharePoint 2010 infrastructure.
| | 01:42 | As much as possible, I'm going to cover
things that exist in all versions of SharePoint:
| | 01:46 | SharePoint Foundation, SharePoint
Server, and SharePoint Server Enterprise.
| | 01:50 | When that's not the case, I'll point it out.
| | 01:53 | And as you'll know, SharePoint is a
platform that's installed and configured
| | 01:57 | differently from company to company.
| | 01:59 | So as we go through this, your
experience will almost certainly look a little
| | 02:02 | different from mine based on your
license agreement, the permissions you have
| | 02:06 | in your organization, and the SharePoint
features your system administrator may
| | 02:10 | have enabled or disabled, but the core
of what we're going to explore should be
| | 02:14 | very similar.
| | Collapse this transcript |
|
|
1. Getting StartedSharePoint Designer 2010 overview| 00:00 | If you've used SharePoint for any
length of time at all, you'll know there is a
| | 00:04 | lot you can do with it
just using a web browser.
| | 00:07 | If you have the right permissions, you
can create new pages; you can edit or add
| | 00:11 | new lists or libraries; you can even
create new sites directly from the browser.
| | 00:16 | And the pages themselves, I can shift
into the Edit mode and just directly change
| | 00:21 | the content of the page.
| | 00:23 | I can grab images or web
parts and move them around.
| | 00:28 | I can use the ribbon to do a lot of
very powerful formatting options completely
| | 00:33 | within the browser, or even tell it
just to forget any changes that I made.
| | 00:39 | But you can't do everything through the
browser, and the things that we want to
| | 00:43 | do in this course is going to
require SharePoint Designer 2010.
| | 00:47 | Now, while SharePoint 2010 itself is
installed on a shared server, SharePoint
| | 00:52 | Designer 2010 is an application
that's installed on your own machine.
| | 00:57 | It's a free application that you
run on your own desktop or laptop like
| | 01:01 | installing Word or Photoshop.
| | 01:03 | And once it's installed, instead of
opening a SharePoint site in a web browser,
| | 01:07 | you can also open that same site in
SharePoint Designer, and do more with it.
| | 01:11 | Now, SharePoint Designer 2010 is often
a bit weird when you first approach it,
| | 01:16 | because it's really three programs
squeezed into one, and people who use it for
| | 01:21 | three very big but very different reasons.
| | 01:24 | One, they use it to change the
visual appearance of a SharePoint site:
| | 01:28 | fonts, colors, layout.
| | 01:30 | It's not what we're doing here.
| | 01:32 | Two, they use it to create and edit
workflows, define business processes, sets
| | 01:37 | of rules and task to be automated--
again, not what we're doing here.
| | 01:41 | Well, three, you can affect the
structure of a SharePoint site,
| | 01:45 | not the presentation, not the colors,
not the fonts, but what the site is made
| | 01:50 | of, creating lists and libraries, add
and editing web pages, connecting to data
| | 01:55 | sources, making the SharePoint site
talk to the outside world, and that's what
| | 01:59 | we're using it for here--
| | 02:01 | using SharePoint Designer to do
customization of SharePoint that simply cannot
| | 02:05 | be done in the browser.
| | 02:08 | So if you haven't already installed it,
now is the time to find and download it
| | 02:12 | from the Microsoft Office site.
| | 02:13 | Just search for the phrase
'SharePoint Designer 2010'.
| | 02:17 | You'll find both 32-bit and
64-bit versions available for download.
| | 02:23 | There is no difference in features,
but you should download the version that
| | 02:28 | matches your installed
version of Microsoft Office.
| | 02:31 | If you have Microsoft Office 2010
installed, you can open up say Word, for
| | 02:36 | example, go to the File section of the
Ribbon and click on Help, and you'll find
| | 02:44 | this Version here that will
tell you if it's 32-bit or 64-bit.
| | 02:48 | Mine is 32, so the 32-bit version is
the one that I need to install.
| | 02:54 | SharePoint Designer 2010 is not
backwards compatible and it won't work with
| | 02:58 | SharePoint 2007 on your server.
| | 03:01 | Now, if you still have to work with
multiple versions of SharePoint, you can have
| | 03:04 | multiple versions of SharePoint
Designer installed, which is fine.
| | 03:08 | SharePoint Designer 2010 does not
override SharePoint Designer 2007.
| | 03:11 | I still come across people who want
to avoid using SharePoint Designer in
| | 03:16 | preference to using a programming
environment like Visual Studio or another web
| | 03:20 | development tool like Dreamweaver.
| | 03:22 | And yes, you can do some level of
customization using those tools, but not what
| | 03:27 | we are trying to do here, and you'd
be making life very hard for yourself.
| | 03:31 | There are things you can do in
SharePoint Designer in seconds that would take
| | 03:35 | hours to do any other way.
| | 03:38 | SharePoint Designer is a program that's
built to understand SharePoint, and it's
| | 03:42 | the simplest way to do many of these
tasks, and certainly the couple of hours
| | 03:45 | you'll spend learning
will be more than worth it.
| | Collapse this transcript |
| Opening sites with SharePoint Designer 2010| 00:00 | So I have a SharePoint
site open in my browser here.
| | 00:03 | This is just a regular SharePoint 2010
team site from my own SharePoint server.
| | 00:08 | And if I click on the Site
Actions menu, I can see I have a lot of
| | 00:12 | different options available.
| | 00:13 | The reason I have all these is because
I am a site collection administrator of
| | 00:18 | this site collection, and that's a
good permission level to have when working
| | 00:21 | with data-driven pages.
| | 00:23 | SharePoint, of course, cares deeply
about permissions, both in the browser and in
| | 00:28 | SharePoint Designer.
| | 00:29 | Now, we get to any SharePoint Site by
having the URL--the address of that
| | 00:34 | site--and that will be the same for SharePoint
Designer, so we need the address of the site.
| | 00:38 | But as you know, individual
SharePoint site URLs can get pretty long,
| | 00:41 | so the simplest way to find a short
address of the current site without all the
| | 00:45 | extra library and page URLs is just
hover of the top-level breadcrumb here and I
| | 00:50 | can see that down on the lower-left
part of my status bar that the address is
| | 00:55 | ldcsharepoint.com--which is my
SharePoint Server--/sites/team.
| | 01:01 | You might have a shorter or longer address.
| | 01:03 | I'm going to just copy that as a shortcut,
and I have two options basically to open this site.
| | 01:09 | If I'm already in the site in the
web browser, I could just go to my Site
| | 01:14 | Actions menu and select the option
that says Edit in SharePoint Designer.
| | 01:18 | If I wasn't in the browser and I just
wanted to do it directly, I go and find
| | 01:22 | SharePoint Designer, which
I have installed over here.
| | 01:25 | I'll find it under the SharePoint section,
| | 01:27 | although to make it quicker to get to, I'm
going to right-click and pin it to my Start menu.
| | 01:33 | So I'll open it up.
| | 01:34 | Now unlike before, in this 2010
version of SharePoint Designer, we no longer
| | 01:39 | have options to make regular
web sites or individual pages.
| | 01:43 | From now on, the unit that we
work with is a SharePoint site.
| | 01:47 | On the right-hand side, I can even see
options to create new blank SharePoint
| | 01:51 | sites or new team sites, but most of the
time we'll be working with an existing one.
| | 01:56 | So I'm going to click the button that
says Open Site and paste in the address
| | 01:59 | that I copied and click Open.
| | 02:04 | After I've connected to the site
once, it will save it as a bookmark in
| | 02:08 | SharePoint Designer.
| | 02:09 | And SharePoint Designer will take a
few seconds to talk to SharePoint to get
| | 02:12 | information about the site.
| | 02:15 | And if you need to provide a username
and password when you're viewing the site
| | 02:18 | in the browser, you'll probably need
to do so in SharePoint Designer, too.
| | 02:22 | So I'm now connected to that SharePoint site.
| | 02:26 | And here's an important concept: having
SharePoint Designer does not magically
| | 02:30 | give you any permissions
you didn't already have.
| | 02:32 | If you couldn't access the site in a web
browser, you won't be able to access it
| | 02:36 | in SharePoint Designer.
| | 02:37 | If you can't make changes to it in
the web browser because you don't have
| | 02:41 | the right permissions, you won't
suddenly have permissions when using
| | 02:44 | SharePoint Designer.
| | 02:46 | Now of course, if you don't have the
right permissions, it will be obvious.
| | 02:49 | So if you need to have them elevated,
contact whoever gave you access to that
| | 02:53 | site in the first place.
| | 02:54 | So we're looking here at the
SharePoint Designer 2010 home screen.
| | 02:59 | Now if you've used SharePoint
Designer 2007, you'll see that while this
| | 03:03 | might have the same name,
| | 03:04 | it's a very different application.
| | 03:06 | In the past, SharePoint Designer would
pretend that your SharePoint site was a
| | 03:11 | regular web site and open up
with a list of folders and files,
| | 03:15 | but now with SharePoint 2010, this
feels like a SharePoint-focused program, not
| | 03:20 | a web design application.
| | 03:21 | So it doesn't show you some
fake representation of your site;
| | 03:25 | it tells you what this site is made of.
| | 03:27 | The main section over here is this
navigation section, and it's really showing
| | 03:32 | you the building blocks here,
| | 03:34 | the lists and libraries in this site, the
workflows in this site, the content types.
| | 03:40 | Notice that as I click around, the
ribbon at the top of the screen is changing.
| | 03:44 | If I select Lists and Libraries, I
have option to create custom lists and new
| | 03:49 | SharePoint lists or document libraries.
| | 03:51 | If I select the Workflows option, we get,
not surprisingly, ways of creating new
| | 03:55 | list workflows and reusable workflows.
| | 03:58 | And I'll see that on throughout
the other options that I'm selecting.
| | 04:02 | Now, clicking the icon at the top,
which for me says LDC Team, that's just
| | 04:06 | the name of the site,
| | 04:08 | the title of the site.
| | 04:10 | And that takes us to the top-level
information and settings of the site.
| | 04:14 | We can even here add
subsites or add users and groups.
| | 04:18 | Now some of these options will
actually take us back to the browser.
| | 04:21 | If I click the Administration Web Page
for example, it's going to open up to
| | 04:25 | the same page I'd get if I had selected Site
Actions, Site Settings using the web browser.
| | 04:31 | Same thing with the Recycle Bin option;
| | 04:33 | it will just take us to the
Recycle Bin page in the browser tool.
| | 04:37 | And there is quite a bit of overlap
between SharePoint Designer and the browser;
| | 04:41 | you can do many things in both places.
| | 04:43 | I tend to stay in the browser for
things I can do in the browser and just use
| | 04:47 | SharePoint Designer for the deeper
tasks, but that's completely up to you.
| | 04:50 | Now if you are coming from SharePoint
Designer 2007, the closest thing to what
| | 04:55 | you're used to is probably
the All Files section here.
| | 05:00 | Selecting that will give me
a top-down folder-style view.
| | 05:05 | We'll use this from time to time, but I don't
really use it unless there's no other option.
| | 05:09 | It's much friendlier going through
the more specific options above it.
| | 05:14 | So we will get deeper into SharePoint
Designer as we go, but we're now connected
| | 05:18 | to a SharePoint site, and this is
what we're going to use to create our
| | 05:22 | data-driven web pages going forward.
| | Collapse this transcript |
| Creating new pages| 00:01 | So how do we make new web
pages in SharePoint Designer?
| | 00:04 | Well, there's a question.
| | 00:05 | Like many things in SharePoint, it depends.
| | 00:09 | And the way to understand that is to
first think about how we make new pages
| | 00:13 | just using the web browser.
| | 00:15 | Take a classic SharePoint team site.
| | 00:17 | If I was in the browser and I used
the Site Actions menu and said that I
| | 00:21 | wanted to create a new page, notice
that it says, "This page will be created in
| | 00:26 | the Site Pages library."
| | 00:28 | Now the Site Pages library is the
default location for new pages in most
| | 00:33 | SharePoint 2010 sites,
| | 00:35 | and this is actually the location
we'll be primarily using in this course.
| | 00:39 | I'm going to cancel out of this
because I'll see that in my site here I do
| | 00:43 | actually have a link to a Site Pages library.
| | 00:46 | This is what's called a Wiki Page library;
| | 00:49 | it's a new kind of library for SharePoint 2010.
| | 00:50 | But don't get too worried about the name;
| | 00:53 | you don't have to be making a wiki here.
| | 00:55 | It's really nothing special.
| | 00:56 | It's a regular SharePoint
library; it's a container;
| | 00:59 | it's a location for new pages to go so
they just don't end up all over the place.
| | 01:05 | And because this is the default location
for new pages, if I have this site open
| | 01:09 | in SharePoint Designer, I can see
that I actually have a shortcut to it.
| | 01:13 | Site Pages is showing up on the left-
hand side as one of the site objects,
| | 01:18 | which is showing me the same two pages
that I could see if I was looking at it
| | 01:21 | through the browser.
| | 01:22 | And when I am in this Site Pages
location, the ribbon has changed, and up here
| | 01:27 | I have a couple of buttons here.
| | 01:29 | I have Web Part Page and Page;
| | 01:31 | both would allow me to make new web pages.
| | 01:34 | But most of the time, in
fact, almost all of the time,
| | 01:36 | I'll be using the Web Part Page option.
| | 01:40 | If I click this one, I'll get a
dropdown box, which is giving me a choice of
| | 01:43 | predefined layouts, different columns.
| | 01:46 | The most simplest one is the first,
Full Page, Vertical, but we have other
| | 01:50 | classic SharePoint layouts, such as the Left
Column and the Body and the Header, and so on.
| | 01:56 | Most of the time, we'll be using the
larger one to give us most flexibility to
| | 02:00 | create our data-driven pages here.
| | 02:03 | So I choose the first one and it's
going to ask me to give it a name.
| | 02:06 | It starts out with Untitled_1.aspx;
| | 02:09 | you can call it anything you want.
| | 02:11 | I'm going to call it SimpleExample.aspx.
| | 02:15 | The .aspx is important.
| | 02:18 | That's telling SharePoint that this
is an ASP.NET page, and that's the
| | 02:22 | technology that SharePoint is built on.
| | 02:26 | So we rename that, and I'm
going to open it and edit it.
| | 02:29 | And it's really two stages here.
| | 02:31 | If I single-click it once, what it'll
do is it will take us to the classic
| | 02:35 | SharePoint Designer Information page
here, where you can do things like change
| | 02:39 | the title, see who it was created by,
and down towards the bottom, we have a link
| | 02:43 | to edit this file, and we
open up the page in Edit mode.
| | 02:48 | Now I can see that I
don't have a blank page here.
| | 02:51 | In fact, I have the Site Actions entry
and LDC Team, which is the name or the
| | 02:56 | title of this team site.
| | 02:58 | And that's because choosing any of the
Web Part Page options still gives us an
| | 03:02 | overall look and feel from the
default master page for the site,
| | 03:07 | and the master page is what describes the
overall look and feel of a SharePoint Site--
| | 03:12 | the fact that it's got navigation
along the top, the color scheme, and so on.
| | 03:16 | That's not directly editable here,
which is why I'm getting a No Entry sign as
| | 03:20 | I mouse around. There's only small places that
I can actually click in to add my own content.
| | 03:26 | As this course isn't a branding course,
we won't be messing with master pages here,
| | 03:30 | so I'll just be accepting
what's given to me every time;
| | 03:33 | we'll be playing around with the
content that we can affect and we can edit.
| | 03:37 | I'm going to go back to the Site
Pages entry here by clicking it again.
| | 03:43 | Now what that seems to have done is
make our Edit Page go away, but if you look
| | 03:47 | at the top of the main section here,
we have a Tab-based environment,
| | 03:51 | so I can actually flick between the
page that I'm editing and the Site
| | 03:55 | Pages Library view.
| | 03:58 | When I'm in this, I can see that the
other options under here are a page, which
| | 04:02 | gives me HTML or ASPX, but these are
pretty much if you want to completely write
| | 04:07 | them from scratch yourself. We don't;
| | 04:10 | we're trying to get SharePoint to do as
much as possible for us and just build
| | 04:14 | on top of that, so we
won't really be using these.
| | 04:17 | Most of our pages will be created as
Web Part Pages in the Site Pages Library,
| | 04:23 | but there is another thing
that you might often see.
| | 04:26 | If I go back to my browser and this time
I'm going to go and look at a Portal Site here.
| | 04:31 | Now this site has a feature turned
on called the Publishing feature.
| | 04:35 | And if your site has that, what
you'll find is when you create a new page
| | 04:40 | that the default location for this is not the
Site Pages library anymore, but the Pages library.
| | 04:46 | Now this sounds like a small
distinction, but it really isn't.
| | 04:49 | This library, the Pages library, is
much less useful for us because this
| | 04:53 | location is tightly controlled for enforcing
a very formal publishing layout on the page.
| | 04:59 | And typically, if we make a page this
way, we won't be allowed to edit these
| | 05:03 | pages in SharePoint Designer.
| | 05:04 | Let me show you what I mean.
| | 05:05 | So if I select this site and I'm going
to come to my Site Actions menu and say
| | 05:10 | Edit in SharePoint Designer,
and that's actually opening up another copy of
| | 05:15 | SharePoint Designer
connected to this Portal site.
| | 05:19 | If I look down here on my taskbar, I
can see I actually have two copies of
| | 05:22 | SharePoint Designer open, one
to each different site here.
| | 05:26 | So do pay attention to that because
it's an easy mistake to make to suddenly
| | 05:30 | change the title of the wrong site.
| | 05:31 | But in this new site, if I were to look
at my All Files layout, because I have
| | 05:37 | that feature enabled, I have a whole
lot more stuff going on, including that
| | 05:42 | Pages library that was mentioned.
| | 05:44 | Now the reason I'm showing you this is that
sometimes you might run across it by accident.
| | 05:48 | You'll jump in to a library and
you'll see a page like an ASPX page and you
| | 05:53 | think, okay, I'll take a look
at this one and I'll edit it,
| | 05:56 | and you'll get this message that this page
cannot be edited in SharePoint Designer.
| | 06:00 | And this is basically saying. "I'm sorry!
| | 06:02 | There's already a very
formalized look and feel to this page.
| | 06:05 | I'm not going to let you do that."
| | 06:07 | So that's why we are going to be
making almost all of our pages in the Site
| | 06:12 | Pages library, which is the typical
SharePoint 2010 place to put them.
| | 06:17 | Now you do have a third option.
| | 06:19 | And particularly those of you who are
used to SharePoint Designer 2007, you
| | 06:23 | might jump in to say the All Files
view of your site and just right-click and
| | 06:30 | say I want to make a new
HTML or ASPX or CSS page here.
| | 06:34 | And you can do that,
but it's a very uncontrolled way.
| | 06:38 | So I recommend putting your stuff in
the Site Pages library, and that's what
| | 06:42 | we'll be doing going forward.
| | 06:45 | Now what if you don't have a Site Pages
library, and that is actually possible.
| | 06:49 | Let's say you started off with a
blank site or perhaps a site that was
| | 06:53 | upgraded from SharePoint 2007, so I'm looking
at a new site here which is completely blank.
| | 06:58 | And if I look in my Library
section, I have no Site Pages Library.
| | 07:02 | Well, what do I do here?
| | 07:03 | We can get this by making sure that a
particular feature is turned on for our site.
| | 07:09 | I'm going to go into the settings for
this site, and look at the Manage site
| | 07:14 | features area, because what's
happening here is that in most SharePoint 2010
| | 07:19 | sites, they have a feature turned
on called the Wiki Page Home Page.
| | 07:23 | If you read that, it says this site
feature will create a wiki page and set it
| | 07:27 | as your site's homepage.
| | 07:28 | This means create the Site Pages
library and point the homepage of this site
| | 07:33 | to a page in there.
| | 07:34 | I'm going to activate that here,
and what that actually means is when I go to
| | 07:38 | the homepage of this blank site, what
was blank a few minutes ago, I can see up
| | 07:42 | here in the URL that I have a Site
Pages library and I'm looking at the
| | 07:47 | homepage at the root of it.
| | Collapse this transcript |
| Working with existing lists and libraries| 00:00 | This course is all about making data-driven
web pages in SharePoint. But let's face it,
| | 00:06 | one of the benefits of SharePoint is
that we often don't think about web
| | 00:09 | pages all that much.
| | 00:10 | What I mean by that is if I say that I
want a contacts list on a web site, I
| | 00:16 | simply create that list.
| | 00:18 | I go into the Site Actions menu, I
create the new list, I select one of the
| | 00:22 | templates, or I define my
own, and I give it a name.
| | 00:25 | SharePoint will take care of generating
the web page to display that list, the
| | 00:30 | web page to add an entry, the web page to edit it,
| | 00:33 | as well as taking care of all that
information in its own database, and it will
| | 00:36 | do that automatically.
| | 00:38 | And that's because SharePoint is already
focused on creating web pages that show
| | 00:43 | data, and that can help us a lot.
| | 00:45 | Now, we have this key phrase when we're
working with data in SharePoint and in
| | 00:49 | SharePoint Designer,
the idea off a data source.
| | 00:52 | And all that really means is exactly
that, a source of data, a location of
| | 00:56 | data. That data could be
tiny, that data could be huge.
| | 00:59 | It could be from an Oracle Database,
SQL Server, Access, a web service, an
| | 01:04 | XML file. It could be on a same server, could
be on a server on the other side of the world.
| | 01:09 | It's all just data sources.
| | 01:11 | Now here's the thing.
| | 01:12 | The SharePoint lists and libraries
that all our sites are made of are
| | 01:17 | automatically considered to be
data sources in SharePoint Designer.
| | 01:21 | In fact, if I select the Lists and
Libraries option here, I can see my list.
| | 01:25 | I can my libraries.
| | 01:27 | If I click the option that says
Data Sources, it looks pretty much
| | 01:31 | identical because all those lists and
libraries are already data sources in
| | 01:36 | SharePoint Designer.
| | 01:37 | What this means is we can use the
existing SharePoint lists to experiment with
| | 01:41 | creating custom pages and playing
around with formatting in web parts without
| | 01:46 | having to worry about database
connections and authentication and credentials
| | 01:49 | and all that stuff until we're ready.
| | 01:51 | So working with the existing lists and
libraries in SharePoint is a great way to
| | 01:54 | get started with this, so let's do it.
| | 01:57 | What I'm going to do is make a page
here and tell it to show some data from the
| | 02:00 | existing SharePoint list.
| | 02:01 | So I'm going to jump to the Site Pages
section and tell it to create a new Web Part Page.
| | 02:07 | I'm going to select the simplest
option again, just the single column.
| | 02:13 | I'll give this a name of SimpleData.aspx.
| | 02:16 | Again, be careful that you do give it
the .aspx suffix--that's essential.
| | 02:21 | Single-click it.
| | 02:22 | We jump through to the Settings page;
| | 02:24 | this is where I might change the
file name later, if I needed to.
| | 02:29 | I'm ignoring everything else here;
| | 02:30 | it's just simply telling me that it's
using the same permissions as the parent
| | 02:33 | of the site, which is fine.
I'm going to select the Edit file link.
| | 02:37 | And like many web design tools, you have
different ways to edit these web pages.
| | 02:44 | Down towards the bottom in
SharePoint Designer here, I'll see this
| | 02:48 | Design, Split, Code button.
| | 02:51 | This gives you the choice of the Design
mode, which is the kind of the what you see
| | 02:55 | is what you get view.
| | 02:56 | You can switch to Code view and
actually manually start to edit the tags
| | 03:01 | that this page is made off. Or you can do a
Split view which is a little bit in between.
| | 03:08 | Now, if I were doing a branding course
and really focused on customizing the
| | 03:12 | HTML, we might spend a lot of time in Code view.
| | 03:15 | But to be honest, I'm going to prefer
to spend as much time as possible in
| | 03:18 | Design view in this course.
| | 03:20 | Even if you're super-comfortable
working with HTML, you'll find that it's much
| | 03:24 | easier to work with the
SharePoint-specific parts using the Design mode.
| | 03:28 | Again, as I mess around,
I get this No Entry sign.
| | 03:31 | That's because most of what we see
here is coming from the master page, which
| | 03:35 | describes the general look and feel of the site.
| | 03:37 | And with this Web Part Page, there's
really only two areas that I can edit.
| | 03:44 | There's an area up here in the top part of the
page, and then there's this main section here;
| | 03:49 | this is the one I'm really interested in.
| | 03:52 | This is the main placeholder for my content.
| | 03:55 | This is the container that's
just waiting for me to fill it out.
| | 03:58 | I can click in and I could start typing
anything that I wanted here, but that's
| | 04:05 | not really what I'm wanting to do here.
| | 04:07 | Now, if you don't want to get confused
with the rest of the master page, one of
| | 04:11 | the things you can do with this main
section selected is over here on the right,
| | 04:17 | you have the little arrow glyph, and one
of my options here is Zoom to Contents.
| | 04:22 | What this allows us to do is just
focus on that specific container that we're
| | 04:27 | filling, without seeing any of
the extra navigational stuff.
| | 04:30 | I don't really need to do
that right now, but that's fine.
| | 04:33 | Zoom to Contents is just simply a toggle, so
I'm going to click Zoom Out and go back out here.
| | 04:38 | It doesn't change what you're allowed to do;
| | 04:40 | it just changed what it looks like,
Of course, I don't want a page with
| | 04:43 | fixed static content.
| | 04:45 | I don't want to type anything manually in here.
| | 04:47 | I want to show some dynamic data.
| | 04:49 | So, I'm clicking in the section and then
up on the ribbon, I'm going to click the
| | 04:54 | section that says Insert and we're
switching to this Insert part of the ribbon.
| | 04:58 | I can insert some classic things like
a table and a picture, but it's over in
| | 05:02 | this section that's more tempting.
| | 05:04 | Now I might rush ahead and see
Data Source and think, ahh,
| | 05:08 | that's what I want, but no,
| | 05:09 | this isn't it right now.
| | 05:11 | I'm more interested in this
section, the Data Views and Forms area.
| | 05:16 | These are the pieces that show data.
| | 05:18 | I can mouse over each of these to
see a little bit more information.
| | 05:21 | The Display Item Form inserts a form that
displays the data for a single item, okay.
| | 05:27 | And we've got a New Item
Form and an Edit Item Form.
| | 05:30 | But really, this one here is the one
that should be flashing in twice the
| | 05:35 | size of the others;
| | 05:36 | this is the most important one here,
the button that says Data View,
| | 05:41 | inserting a view that
displays data from a data source.
| | 05:45 | Remember that our SharePoint lists and
libraries are already defined as data sources.
| | 05:50 | We don't need to describe
anything more about them.
| | 05:53 | So when I click this, it's actually
saying okay, where's the data coming from?
| | 05:56 | It's showing me the lists and
the libraries that it knows about.
| | 06:00 | I do have an option for More Data
Sources, but we'll see that later.
| | 06:04 | Now I've added a few tasks to my Task list
on this site, so I'm going to pick that one.
| | 06:09 | And what we're doing here is
SharePoint Designer is adding a web part, a
| | 06:14 | reusable, customizable, self-
contained, intelligent chunk of content
| | 06:20 | that, in this case, is talking to the
database that stores the Task list for this site.
| | 06:25 | And it's actually reading that
data right now from the Task list.
| | 06:29 | Now the web part that we've just added
has the rather long-winded name of the
| | 06:34 | XsltListViewWebPart, and you can see
that, or least at the start of it, on the
| | 06:39 | handle of the web part
here, XsltListViewWebPart.
| | 06:42 | This is a new web part in SharePoint 2010.
| | 06:45 | In SharePoint 2007, there was
something called the data view web part, which
| | 06:48 | was similar, and that still exists,
but it's been replaced by this
| | 06:52 | XsltListViewWebPart, which is a lot better and
a lot more customizable, as we'll see shortly.
| | 06:58 | Now what I'm going to do is just save this page.
| | 07:00 | I'm going to jump up to the floppy
disk icon at the top here and click Save.
| | 07:05 | And then I'd like to actually
preview this in the browser and take a look
| | 07:09 | and see if it works.
| | 07:10 | In fact, the shortcut here is
just hitting the F12 button.
| | 07:14 | And I can see that this is already working.
| | 07:15 | It looks like classic SharePoint.
| | 07:17 | I can actually see these options here,
| | 07:19 | I get the dropdown arrow.
| | 07:21 | In fact, it looks kind of like the
page I might expect to see when I'm
| | 07:25 | looking at this list.
| | 07:26 | I don't have the Quick Launch bar on
the left, but that's just the default way
| | 07:29 | that site pages are created.
| | 07:32 | And we're getting all this extra stuff,
all the navigation, the search box, the
| | 07:36 | title, the Site Actions menu, provided
by the master page, which is why I'm not
| | 07:40 | going to touch that.
| | 07:42 | Closing that down, I'm going
back into SharePoint Designer.
| | 07:44 | Now it's easy to think of web parts as
kind of small and insignificant, kind of
| | 07:49 | boring, kind of fixed, but make no mistake.
| | 07:51 | This XsltListViewWebPart is
deeper than most, if not all of them.
| | 07:56 | It's not some restricted feature;
| | 07:58 | in fact, this is the same web part
that you've been using, whether you knew it
| | 08:02 | or not, on almost every standard list and
library page in every SharePoint 2010 site.
| | 08:07 | And as we'll see, it's a lot more
powerful than most people think it is.
| | Collapse this transcript |
| Editing Data View Web Parts| 00:00 | So I'm going to take this
standard XsltListViewWebPart and do some
| | 00:04 | customization of it.
| | 00:06 | When you're editing a page in
SharePoint Designer, like in most web-editing
| | 00:10 | tools, it's very sensitive to what
you have selected in the document and
| | 00:14 | where your cursor is.
| | 00:15 | And if I want to customize the web
part that's down here, I want to make sure
| | 00:19 | that my cursor is not
positioned in some other section.
| | 00:22 | Now if you've done any web page
editing, you might be used to using an
| | 00:27 | environment with a Properties pane
or Properties panel, and we have one here
| | 00:31 | in SharePoint Designer.
| | 00:32 | If I go to the View section of the
ribbon, I can open it up by selecting the
| | 00:36 | Task Panes section, which is basically
all the properties panels that can show
| | 00:40 | up on the right-hand side,
and I'll select Tag Properties.
| | 00:44 | Right now, I am showing
Data Source Details as well.
| | 00:47 | I'm going to close that
because we don't need it right now.
| | 00:50 | So this is the view you'd often see in
a lot of web-editing environments and
| | 00:54 | as you click around, what you see here is
going to change based on what you have selected.
| | 01:00 | If I want the properties for the web
part as a whole, I make sure to grab the
| | 01:04 | handle at the top of the
web part and just select that.
| | 01:07 | But for we want to do, this
Properties panel is not all that helpful.
| | 01:13 | Now if you're someone who likes
your right-click options, you might try
| | 01:16 | right-clicking the ListViewWebPart,
and you'll see that there is a
| | 01:18 | Properties option there.
| | 01:19 | That just opens up the tag
properties that we're already looking at.
| | 01:23 | We've also got an option called Web Part
Properties, and clicking that will open
| | 01:27 | up a window by itself.
| | 01:29 | Now these are the same properties
| | 01:30 | you can edit going through the browser,
simple things like the title of it and
| | 01:36 | what the Chrome State is.
| | 01:38 | And that's not what we want here
either, in fact; neither of these are the
| | 01:41 | changes that I want to make.
| | 01:43 | Now when you're editing the
XsltListViewWebPart, you start up here on the ribbon.
| | 01:50 | When I have this web part selected, I
get a new section on the ribbon called
| | 01:53 | the List View tools.
| | 01:55 | That section would disappear if I was
clicked somewhere else. Making sure that
| | 01:59 | I'm in the web part itself, I get it.
| | 02:01 | Now I'm not going to go
through every single option here--
| | 02:04 | I do invite you to explore them--but I'm
going to cover some of the most common.
| | 02:08 | It's broken up into four sections.
| | 02:10 | The Options part, the first part, is the
most common initial settings, and I'll
| | 02:15 | come back to that in a second.
| | 02:17 | If I click through to the Design option, this
lets me change some examples on presentation.
| | 02:22 | So what is the layout?
| | 02:23 | If I am looking at multiple rows of data,
which I am, can I change that layout
| | 02:28 | by clicking one of these buttons to
give me say an alternate row style or
| | 02:32 | shifting into a different look or
shifting into multiple, almost index cards.
| | 02:38 | So those are few sections there.
| | 02:40 | We'll see later how we might define our own.
| | 02:43 | I'm going to switch back to the
default view, which is the far-left one.
| | 02:47 | Jumping into view the Web Part section
of the ribbon, these are actually very
| | 02:51 | similar to the Web Part Properties.
| | 02:53 | There are things like the title and the
Chrome State, so I'm going to leave that alone.
| | 02:57 | And on to the fourth one, we also get a
Table option, because this is giving us
| | 03:02 | tabular data, so it's being presented
in an HTML table of rows and columns.
| | 03:08 | Again, very, very sensitive to where you
have it selected in that web part itself.
| | 03:14 | So you'll see a lot of the table
options will gray out if you're not selected
| | 03:19 | in the right place.
| | 03:21 | I'm going to jump back to the first section
and make a couple of changes to this web part.
| | 03:25 | I'm going to click the button that says
Add/Remove Columns because right now I
| | 03:31 | don't need to see attachments, or I
don't need to know what type this is.
| | 03:34 | So I'm going to click that, and it's
telling me that these are the Displayed
| | 03:38 | Fields right now in the web part.
| | 03:39 | I'm going to select Attachments and Remove it.
| | 03:42 | I'll also select Predecessors and Type.
| | 03:46 | Click OK and it will redraw
the web part with my changes.
| | 03:52 | If I wanted to, I could click the
Filter button and define some information
| | 03:56 | about the items I'd like to exclude or include.
| | 04:00 | I can also click the Sort & Group button,
choose to order these in a particular
| | 04:04 | way, or perhaps I'm going to select
Status and click the button to show the group
| | 04:10 | header and group these tasks together
by the status that they are assigned to.
| | 04:15 | And SharePoint is smart enough to
generate the interface around that.
| | 04:19 | Now, these last couple of options are
quite similar to options you have when
| | 04:23 | defining a view in SharePoint using the browser,
| | 04:26 | but we do have more options.
| | 04:28 | For one, what I can do is add this
button here and apply conditional
| | 04:33 | formatting, the ability to change the
style, the look of a cell or a row based
| | 04:40 | on some conditions, some rules.
| | 04:44 | So let's say I wanted to highlight a
row when it was considered an overdue task
| | 04:50 | that hadn't been started.
| | 04:51 | What I can do, and I'm
just going to do very quickly.
| | 04:53 | We're going to get into conditional
formatting later on in the course, but to
| | 04:56 | give you an idea of what it can do, I'm
going to select somewhere in this row.
| | 05:01 | It doesn't really matter which row you select.
| | 05:03 | You just have to select a row or column
to tell SharePoint yes, I'm wanting to
| | 05:07 | edit a row or column.
| | 05:09 | And it says, what do I want to do?
| | 05:10 | I'm going to select to format the
row, and it's asking me for the rules.
| | 05:14 | What are the rules I want to describe?
| | 05:16 | It knows what data is available, so
I'll say that I'm interested in when the
| | 05:22 | Status is equal to Not
Started. It's not enough.
| | 05:27 | I want to also add a clause to say when
the Due Date is Less Than, and we've an
| | 05:34 | option here for Current Date, which is
fine, and after that, I'm going to click
| | 05:38 | the button to say Set Style.
| | 05:40 | So those are my rules, those are my
conditions, and if they're true, then what?
| | 05:44 | Well, I could change the font.
| | 05:46 | I can change the border.
| | 05:47 | I can change the block style.
| | 05:48 | These are all CSS styles.
| | 05:50 | I'm going to do something fairly simple,
which is just change the background color.
| | 05:54 | So selecting the Background category,
I can choose from the colors up here.
| | 05:58 | If I don't like the ones being shown,
I can click the More Colors button and
| | 06:02 | come down, and let's say let's
choose that one. That will do the trick.
| | 06:07 | It's little ugly, but I just want to
prove a point. S o we'll click OK, and it
| | 06:12 | doesn't immediately seem
to be showing something.
| | 06:14 | I'll occasionally get this.
| | 06:15 | Over here, we've got the
Conditional Formatting panel here
| | 06:18 | that's actually saying,
we want to apply the style.
| | 06:21 | We've got the preview of the style.
| | 06:22 | When the State Equals "Not Started" and Due
Date Less Than, double quotes. I might have hit something there,
| | 06:27 | so I am going to edit this
condition, click the little dropdown here,
| | 06:32 | click Edit Condition, and yes, Due Date
was meant to be Less Than Current Date,
| | 06:36 | so I'll try and reselect that
and click OK, and then there we go.
| | 06:39 | Now what's happening here is it's
highlighting a few too many things for me,
| | 06:44 | because it's highlighting not only
the one that has a due date of less than
| | 06:48 | today, but it's also highlighting the
ones that don't have any due date at all.
| | 06:51 | Now later on the course, we'll get
through how to start creating multiple levels
| | 06:56 | of conditions so we could exclude those.
| | 06:58 | But you should be able to get kind of
an idea of what you can do through this.
| | 07:02 | So I'm going to save this page again by
clicking the floppy disk icon, and then
| | 07:05 | I'm going to preview it.
| | 07:07 | Again, I could do that either from
the Home menu--I have got an option here
| | 07:11 | called Preview in Browser--or if I'm in the
page itself, I can just hit F12 and open that up.
| | 07:19 | We've got the Grouping options that we
described by grouping by status, and I
| | 07:24 | can collapse or expand these if I want to.
| | 07:27 | And I also have the rather ugly
conditional formatting going on here.
| | 07:31 | I'm just scraping the surface here.
| | 07:33 | We'll get into much more significant
customization later, but it should give you
| | 07:37 | a taste of how we can get started with it.
| | 07:39 | Now of course, if you're thinking that
you wouldn't go to this trouble to create
| | 07:42 | a page just to show items that can
already be seen in an existing SharePoint
| | 07:47 | list, well you're completely right.
| | 07:49 | But it's a great way to go through this
process of creating pages, of adding the
| | 07:54 | web part, or customizing the web part,
without throwing database connections into
| | 07:58 | the mix, but we'll do that in a moment.
| | Collapse this transcript |
|
|
2. Managing Data SourcesExternal data sources| 00:01 | So let's get into why we're here.
| | 00:02 | We want to connect to some external
data, data that is sitting outside of the
| | 00:06 | current SharePoint site.
| | 00:08 | Now, you are ready to get going, but I
need us to slow down for a second and
| | 00:10 | think about what we're doing, because
there are two very important questions to
| | 00:14 | ask before we jump in. One,
why are we doing it? And two,
| | 00:17 | where is your data?
| | 00:19 | And when I ask why are you doing this,
I mean what's the reason in each case?
| | 00:24 | Is it all a one-off, ad hoc need?
| | 00:26 | Say you just need a single web page on
a single SharePoint site to connect to
| | 00:31 | some orders database and
show a list of recent orders.
| | 00:34 | Now this would take the
shortest time to do, but it is a one-off.
| | 00:38 | It would be created and customized on
a single page, and it's not a reusable
| | 00:42 | solution, though this is often fine.
But another scenario might be that you want
| | 00:47 | to define a connection to an external
data source because you want something
| | 00:51 | that behaves more like a regular
SharePoint list. You want to show it in
| | 00:55 | multiple pages, in multiple web
parts, even in multiple sites.
| | 00:59 | You want to reuse that data
across different lists and libraries.
| | 01:02 | You might even want that data
searchable in SharePoint, and we can do this too.
| | 01:07 | It is more flexible, but it's
also more complex to set up.
| | 01:12 | Now, in this course, we're going to do
both, but you want to be specific when
| | 01:16 | you're choosing your method, and think
about what you need in each business case.
| | 01:21 | So then there is question
two, where is your data?
| | 01:24 | And the simplest answer here would be,
your data is in a database somewhere.
| | 01:28 | But it could be from a web service,
or it could be from an XML file.
| | 01:33 | These are the external sources that
SharePoint can deal with, and we'll
| | 01:36 | cover them one by one.
| | 01:38 | Regardless, your main problem is always
going to be security. It won't be about
| | 01:44 | getting the data onto your page or
customizing it to show what you want;
| | 01:48 | it's being allowed to get to that
data in the first place, because most data
| | 01:52 | sources, except for the most casual, are
going to need some kind of credentials.
| | 01:57 | Let me show you what I mean by
talking about connecting to a database.
| | 02:02 | Scenario number one:
| | 02:03 | Forget about SharePoint for a second.
Imagine that we log on to our PC in the
| | 02:07 | morning, and we open up an installed
application on our desktop machine.
| | 02:12 | It's going to connect to a
database on a remote server.
| | 02:16 | The database is going to ask who we are,
and we will supply some credentials, either
| | 02:21 | by typing in a user name and password or
by automatically using the same user ID
| | 02:26 | and password that we
logged on to that machine with.
| | 02:28 | The database checks them
and says, "Okay you're Simon.
| | 02:31 | I know you. Come on in. Fine."
| | 02:34 | Now, we want that same data,
but we want it on a SharePoint web page.
| | 02:38 | It doesn't sound like a big problem,
but the thing is, it's not us talking to
| | 02:42 | the database anymore.
| | 02:43 | What we're going to do is we'll open up
a browser on our PC, and we will request
| | 02:48 | a page from a SharePoint server,
and we'll pass SharePoint our credentials.
| | 02:53 | Now, SharePoint says, "Hang on. Before I send
this page to you, I meant to fill it with
| | 02:57 | data from the database," and it connects
to the database, but the credentials its
| | 03:02 | passing is not our identity anymore;
| | 03:05 | it's the SharePoint Server identity.
And if the database doesn't have the
| | 03:09 | knowledge of the SharePoint server
it's going to refuse the connection.
| | 03:13 | Now sure, this is a fixable problem,
and we actually have a few ways of dealing
| | 03:18 | with this, but they are all more about
your own organization's rules than they
| | 03:22 | are about SharePoint. One,
| | 03:25 | what we could do is we could add a
specific account in the database just for the
| | 03:29 | SharePoint server, and we'll tell
SharePoint to always use those credentials,
| | 03:34 | and that's a nice easy fix.
| | 03:35 | It can be done very quickly,
but it has its own problems,
| | 03:39 | because now everyone viewing that page
in SharePoint is effectively using the
| | 03:43 | same account to connect to the database.
Well, that's not a problem by itself, but
| | 03:48 | if you require auditing and logging,
you're not going to know which individuals
| | 03:52 | were viewing or changing that data. Option two,
| | 03:56 | we can do what's called
pass-through authentication.
| | 03:59 | When we log on to SharePoint, we're
telling SharePoint to take our credentials
| | 04:03 | and pass them right through to the
database to connect to that external system.
| | 04:08 | This sounds like a great solution,
but it's difficult to do, and the problem has
| | 04:13 | nothing to do with SharePoint.
| | 04:14 | It's that machines in general aren't
allowed to just grab identities and pass
| | 04:18 | them around because this would lead
to all sorts of security problems.
| | 04:22 | And a third issue is that sometimes
we use different sets of credentials to
| | 04:27 | access different databases, or a external
line of business systems, and we have
| | 04:32 | multiple sets of credentials for each
individual, and throwing this into the mix
| | 04:36 | is going to further complicate things.
| | 04:38 | Now as we'll see, SharePoint can deal
with all of these situations, but you have
| | 04:45 | to have a pretty good idea of what the
rules of your external system are before
| | 04:48 | you start to connect to it.
| | Collapse this transcript |
| Reading data from an XML file| 00:00 | Our first external data source is the simplest.
| | 00:03 | It's probably the one you'll use least,
but it is a useful one to know, and
| | 00:07 | that's using an XML file as your data source.
| | 00:10 | The most common reason here is that some
external system you have exports an XML file as output,
| | 00:15 | and because XML isn't all that
friendly to read for human beings, you want to
| | 00:20 | show that on a SharePoint web page.
| | 00:23 | So I have an XML file here that I've
uploaded to my Shared Documents folder,
| | 00:28 | which is one of the easiest
ways to let SharePoint get to that.
| | 00:31 | I'm going to use this one.
| | 00:33 | Let's define this as a data source.
| | 00:35 | I'm going to open up SharePoint
Designer and connect to that current team site.
| | 00:40 | Once we've connected, I'll jump to the
Data Sources section in the Navigation
| | 00:44 | pane, and that will update to show me
the kind of data sources I can describe
| | 00:49 | here. I'm going to select XML
File Connection, and it asks for the
| | 00:53 | location of this XML file.
| | 00:55 | Now, you might be tempted to say paste
in the address of something in your My
| | 00:59 | Documents folder, or anywhere on your
C drive, but that's not going to work
| | 01:03 | because the location needs to be
accessible by the SharePoint server.
| | 01:07 | So the easiest way is to just put that
XML file inside SharePoint, but you can
| | 01:12 | use a network share too.
| | 01:14 | I'm going to click the Browse button,
and it's going to open by default to the
| | 01:18 | root of my SharePoint site, where I can
see folders that represent my document
| | 01:22 | libraries and lists and so on.
| | 01:24 | I'm going to jump into the Shared
Documents folder and select books.xml. So it
| | 01:34 | stores the location.
| | 01:36 | If I was connecting to a separate
machine, there is a Login tab where I can
| | 01:40 | provide different
credentials for authentication.
| | 01:43 | I'm not going to do that here, and we'll
talk much more about credentials later.
| | 01:48 | And click OK. The data source is created
in the Data Source section underneath my
| | 01:53 | existing lists and libraries.
| | 01:55 | So I'm going to jump over to my Site
Pages section on the Navigation pane and
| | 02:00 | create a new web part page, selecting
once again just the simple Full Page entry.
| | 02:06 | I'll call this one xmlExamples.aspx,
| | 02:11 | single-click to see the Information page,
and then select the Edit File button
| | 02:15 | to jump into Edit mode.
| | 02:17 | I'm going to switch
completely into Design view here.
| | 02:20 | Now if you don't have this pane open
on the right-hand side, this is the Data
| | 02:25 | Source Details pane, which you can get
from selecting the View section on the
| | 02:30 | ribbon and selecting the Task Panes > Data
Source Details. That can just toggle on and off.
| | 02:36 | I don't find it the most reliable panel
in the world; sometimes it gets a little
| | 02:40 | bit out of date with what it should be showing.
| | 02:43 | Right now, it's looking okay
because we haven't got anything to see.
| | 02:46 | So I'm going to jump over to my Insert
section here, jump to Data View, and I'm
| | 02:52 | going to scroll down, find my XML
file books entry, and select that.
| | 02:56 | Now, you'll sometimes have this happen
where you're trying to insert a data view
| | 03:01 | and you get nothing; nothing seems to happen.
| | 03:04 | In fact, that's what's happening to me right now.
| | 03:05 | Well, there is an alternate way we can
go around this, which is, I can manually
| | 03:10 | say well, first let me just
enter the data source itself.
| | 03:13 | So I'm going to jump over here and
select the books data source and then
| | 03:18 | immediately go back and try that
one again, and that seemed to refresh it
| | 03:24 | correctly and actually dump it in there.
| | 03:26 | We can even see that the data
source details entry has updated as well.
| | 03:30 | This allows you to browse through the
different rows of the data that you are connected to.
| | 03:35 | And if I hadn't already got a web
part over here, I could select the fields
| | 03:40 | that I wanted and just Ctrl+Select to select
multiple and drag them across into the window.
| | 03:45 | That would work just fine as well.
| | 03:47 | So I'm going to save that,
and I want to test this page.
| | 03:51 | Again, either if you go to the Home
section of the Ribbon and select to Preview
| | 03:55 | in Browser, or with anywhere in the
page selected, I can just hit F12 to open it
| | 04:00 | up and see that yes indeed, it does seem
to be rendering out some details for us.
| | 04:08 | Making that XML a bit more readable, I
can still go back in here and with the
| | 04:14 | web part selected, I do have options that
I can remove columns. For example, if I
| | 04:19 | don't want to see the ID,
I can take care of that.
| | 04:22 | And I can even turn on the
ability to do inline editing.
| | 04:27 | I have the choice here you to Show
Edit Item Links, and Insert Item Links,
| | 04:30 | and Delete Item Links.
| | 04:32 | Let's just select Edit for right now.
| | 04:35 | Click to save this one, and
I'll test it again by hitting F12.
| | 04:38 | It's not the most elegant interface in
the world, but we can hit the Edit link
| | 04:44 | beside one of these entries and it jumps
into this Edit mode here, where we could
| | 04:50 | change one of the titles and come back
over to the left where I have the Save
| | 04:55 | link and save that right back.
| | 04:57 | And that is actually changing the XML
file in our Shared Documents library.
| | 05:03 | It's far more likely that you're just
wanting to actually show that data, so I
| | 05:07 | can go back and untoggle that
Edit Item Links and save it again.
| | 05:12 | Now, it's actually using a
different web part this time.
| | 05:16 | If you look, it's not the
XSLTListViewWebPart anymore; it's
| | 05:20 | the DataFormwebPart.
| | 05:22 | It's not as quite as powerful as the
XSLTListViewWebPart we used previously,
| | 05:27 | but it will do fine here, and most of
the options that we've explored so far we
| | 05:31 | can do just the same, things like
working with the general design layout and the
| | 05:36 | title of the web part and paging
options and editing options and so on.
| | Collapse this transcript |
| Reading data from an external database| 00:00 | Next up, probably the most common
external data source, working with a database.
| | 00:05 | So I've opened my site in SharePoint Designer.
| | 00:08 | I'm going to jump across to the Data
Sources section and up on the ribbon, going
| | 00:13 | to click to create a new database connection.
| | 00:16 | The only button it's offering me is
one to configure the database connection,
| | 00:20 | so we'll pick that.
| | 00:21 | And what it's first going to ask for is the
name of the server and the name of the provider.
| | 00:26 | And what does this mean? Well, the provider is
describing what kind of data we're talking to.
| | 00:31 | And by default, it's selecting the .NET
Framework Data Provider for SQL Server,
| | 00:36 | but in the dropdown is one for OLE DB;
| | 00:39 | you may see more if your system
administrator has installed different ones.
| | 00:45 | I do want to talk to SQL Server, so I'm
going to select the specific provider here.
| | 00:50 | But if I'd selected OLE DB, that's
more of a generic data provider that could
| | 00:55 | connect to Access, Sybase, MySQL.
| | 00:58 | There are many, many databases
that will accept an OLE DB connection.
| | 01:03 | And you can get more specific ones,
like Oracle-specific data providers, but
| | 01:07 | that's not something we can do from
the SharePoint Designer side of things.
| | 01:12 | So in my case, I have a SQL Server
machine on the network that's called
| | 01:15 | dbserver, so I'm going to
use that as the server name.
| | 01:19 | And remember, this must be a name that
works from the SharePoint server; whether
| | 01:23 | it works on your machine is irrelevant.
| | 01:25 | So if you've got say a local database,
like one created in Access, you're first
| | 01:30 | going to have to move it to a network
location, so the SharePoint server can get to it.
| | 01:35 | So how are we going to connect?
| | 01:36 | Well, the default option is going to
say Save this username and password in
| | 01:41 | the data connection.
| | 01:42 | I'm certainly not going to put in my
own username and password here, because
| | 01:46 | this will be saved as part of this page,
and it could be obtained by anyone who
| | 01:51 | can get to it in SharePoint Designer.
| | 01:54 | What I'm going to do is put in a
username and password that I've had set up
| | 01:59 | in the database specifically for connecting
with SharePoint, and it's called SP_DatabaseAccess.
| | 02:08 | This one I've had set up with read and
write access to several databases, but I
| | 02:13 | could set up an account and
just restrict it to be read-only.
| | 02:15 | It's something to talk your
database administrator about.
| | 02:19 | But what you'll see in a moment is when
I click the Next button, it will prompt
| | 02:23 | me and say, I'm going to save these details in
the page itself, just letting you know that.
| | 02:30 | My alternative is here, and I've got
an option here that says Use Single
| | 02:34 | Sign-On authentication,
| | 02:35 | but that shouldn't even be here, as
single sign-on doesn't exist in this
| | 02:39 | version of SharePoint.
| | 02:40 | It was replaced by something called
the Secure Store Service, which I'll go
| | 02:44 | through in the section on
business connectivity services.
| | 02:47 | And you can also import a manual
connection string if you need to.
| | 02:52 | But I'm going to leave this one with my new
account that I've had set up. Click Next.
| | 02:56 | It will give me the prompt.
| | 02:57 | This will be saved as clear
text in the data connection.
| | 03:00 | Other authors of this web
site can access the information.
| | 03:03 | Now what it means by this is not
everybody who can view the SharePoint page will
| | 03:08 | see that connectivity
information; no, they won't.
| | 03:11 | But if you are an editor and you can
actually open the site in SharePoint
| | 03:15 | Designer and edit this page that we're
creating, well, they could see it then.
| | 03:20 | So I'm going to click OK and give it a section.
| | 03:24 | It's actually thinking about it.
| | 03:25 | It's connecting to the server
right now, which is why I've got the
| | 03:28 | little turning disk here.
| | 03:30 | And it retrieves the list of databases,
tables, and views that I can get to.
| | 03:37 | Now here I've got installed the
classic AdventureWorks and even the
| | 03:41 | old-school Northwind and pubs
databases from Microsoft, just to give me
| | 03:45 | something to play around with.
| | 03:46 | So I'm going to select from
Northwind, because that's a simple one.
| | 03:52 | It comes back with the tables and views if
I have them, and I'll come down to say
| | 03:56 | Products, and click Finish.
| | 04:00 | By default, it's going to be retrieving
everything, but we do have a button here
| | 04:04 | to select to only bring back certain
fields, so I could select some of these
| | 04:09 | options if I didn't need them, and remove them.
| | 04:12 | This table is not very big, so I don't
have to worry about it, but as a general
| | 04:15 | rule, you want to retrieve the minimum possible.
| | 04:19 | We also have buttons here
for filtering and sorting;
| | 04:22 | I'm not going to do that here.
| | 04:23 | I could actually do that
later on the page if I wanted to.
| | 04:26 | Bear in mind what we're doing
here is describing the data source;
| | 04:30 | we haven't gone to the page yet.
| | 04:33 | I'm just going to click OK.
| | 04:35 | And we now see that we have the
database connections for products on Northwind.
| | 04:40 | Okay, jump across to site pages
and create a new web part page.
| | 04:44 | I think you know where I'm going with this one.
| | 04:46 | I am going to select the
full-page version, and I'll call this the
| | 04:49 | dbExample.aspx. Jump into
that one. Click to Edit the file.
| | 04:58 | I want to be in Design mode here.
| | 05:00 | And if you noticed, in an earlier
movie, I had said that occasionally
| | 05:05 | you'll find the Data Source panel over here
isn't quite refreshing to show what it should be.
| | 05:11 | This is the showing the old XML data
source here, which is kind of irrelevant;
| | 05:15 | it shouldn't be doing that.
| | 05:17 | One of the ways you can make it refresh
itself is go over to the View section of
| | 05:21 | the ribbon and just turn it off and
turn it back on again, and you'll typically
| | 05:26 | find it will refresh and show empty,
which is what I'd expect right now.
| | 05:31 | Again, clicking in the PlaceHolderMain,
I'm going to go up to the Insert section
| | 05:36 | on the ribbon, come down to Data view,
and let's see if it's good with inserting
| | 05:40 | my database connection here.
| | 05:43 | Thinks about it for a second, and there we go!
| | 05:45 | We have the web part being inserted.
| | 05:49 | We have the data source details over here.
| | 05:52 | I have the ability to change the
settings of this web part, change the design
| | 05:57 | layout, change the table
styles of any of the cells or rows.
| | 06:01 | I'm actually going to leave it as is.
| | 06:04 | I am going to come along and turn on
from the Options part of the ribbon,
| | 06:08 | the Edit Item Links. I'm going to just save this page
and hit F12 to open it up in the browser.
| | 06:17 | I can see that I can start to move through it.
| | 06:21 | I can come over to, let's go to the
Start of the page and click edit on one
| | 06:26 | of these links, change the description here,
"Chef Anton's Great Gumbo Mix," and hit Save.
| | 06:32 | And that is writing back
to that external database.
| | 06:35 | It's not importing this.
| | 06:37 | This data does not exist inside SharePoint.
| | 06:39 | It's making that connection to
the Northwind database right now.
| | 06:43 | And because my connectivity information
allows me to write back to the database,
| | 06:47 | I can do that here, too.
| | 06:49 | Now this, of course, is a little
bland right now, and the power of the
| | 06:53 | database, of course, is that these
tables that we're looking at here are often
| | 06:57 | related to each other,
| | 06:59 | connected to each other.
| | 07:00 | And we can connect the data here in
SharePoint, both on single pages and
| | 07:05 | across multiple pages,
| | 07:06 | but before we do that, we need to cover
another couple of data sources and talk
| | 07:10 | a little bit more about credentials.
| | Collapse this transcript |
| Reading data from a SOAP-based web service| 00:00 | So, another option for external
data is to get it from a web service.
| | 00:05 | A web service is just a location on the web.
| | 00:07 | It has a URL, just like a web page.
| | 00:10 | In a sense, it's an address on the
web designed to be read by machines,
| | 00:14 | rather than human beings,
| | 00:15 | and so SharePoint can reach out to
another location on the web and grab data
| | 00:19 | from it, rather than
grabbing a formatted web page.
| | 00:22 | There are two kinds of web service
connections you can make in SharePoint: a SOAP
| | 00:27 | Service and a REST Service,
which also allows RSS feeds.
| | 00:31 | These days REST web services tend to be
more popular, but I'm not going to get
| | 00:35 | into exploring the underlying technology
here, for the same reason I wouldn't be
| | 00:39 | debating different databases.
| | 00:41 | If you have to connect one,
you have to connect to one.
| | 00:43 | It will be apparent
whether it's SOAP- or REST-based.
| | 00:47 | And the few occasions where I have the
choice of SOAP and REST, I'll pick REST
| | 00:51 | because they are usually more
straightforward. But let's do the SOAP Service one too.
| | 00:55 | If I click this, the most important
thing it's asking for here is the address of
| | 01:00 | what's called a web services
description language, or WSDL, or WSDL file.
| | 01:06 | And what does that mean?
| | 01:07 | Well, I do actually have the address of one.
| | 01:09 | I'm going to go over to a regular web
browser and paste it in, and we're going to
| | 01:14 | the WSDL file for a weather forecast web service.
| | 01:19 | And this is a file that you really
don't want to have to read yourself.
| | 01:22 | It's basically not designed for human beings.
| | 01:25 | It's a very descriptive piece of
information about what this web service does,
| | 01:31 | and it's designed for machines.
| | 01:33 | So taking that address and feeding
that into this Data Source Properties of
| | 01:38 | SharePoint, we can paste in the WSDL file
and click this button that says Connect Now.
| | 01:45 | SharePoint reads that file, and it's
perfectly happy to read it, and it's actually
| | 01:51 | getting some information
about what that web service does.
| | 01:54 | It says that there is actually two
Operations here: GetWeatherByZipCode and
| | 01:58 | GetWeatherByPlaceName.
| | 02:01 | If we want ZipCode, then down here
I have to provide a ZipCode parameter.
| | 02:06 | If I want to do PlaceName,
I provide a PlaceName.
| | 02:09 | I'm going to do ZipCode,
| | 02:11 | so it says here is the parameter of ZipCode.
| | 02:13 | I will give it my ZIP code right now.
| | 02:16 | I'm just double-clicking to give it a
parameter and I'm going to do 85253.
| | 02:20 | There is a box here that says,
"The value of this parameter could be set via a
| | 02:24 | Web Part connection."
| | 02:26 | We haven't talked about connecting web
parts here, but what it really means is
| | 02:29 | we could use other data inside
SharePoint web parts to feed a value into this
| | 02:36 | web service that could be useful. But I
don't have other data right now, so I'm
| | 02:40 | just going to leave this as is.
| | 02:42 | Now, the same way that some web pages
are freely readable and others require you
| | 02:47 | to log on is the same with web services.
| | 02:49 | And if you need to authenticate, you
can provide different information on the
| | 02:54 | Login tab of the Data Source Properties window.
| | 02:57 | It's very common for web services to
require credentials, but once again, this is
| | 03:01 | really down to the
requirements of your external data source.
| | 03:04 | It doesn't really have
anything to do with SharePoint.
| | 03:06 | So I'm going to click OK, and I
now have this SOAP service there.
| | 03:11 | And I could tell, it was a SOAP service,
because the address that I had included
| | 03:16 | WSDL, which is a giveaway that
it's a SOAP service connection.
| | 03:20 | I'm going to jump to my site pages and
create a new web part page and I'm going
| | 03:25 | to use the classic full page here.
| | 03:27 | I'll call this one soapExample.aspx,
and I think you're probably good with
| | 03:34 | where I'm going here.
| | 03:35 | I'm going to jump in and edit this file.
| | 03:38 | Once again, I'm seeing some data source
details they're little out of date over
| | 03:41 | here. Let me just turn that pane on and off.
| | 03:44 | It doesn't want me to do that.
Click back in. For some reason it's gotten a little
| | 03:52 | confused on my Task panes, but no big deal.
| | 03:55 | We'll reset the workspace layout and
then open it up, but we have no data,
| | 04:02 | so over to the Insert tab, and over
to Data view, scroll down to find my
| | 04:08 | WeatherForecast SOAP service, and click that.
| | 04:11 | It thinks about it for a second, reads
some information, and now we're getting back
| | 04:16 | the results of that web service call.
| | 04:18 | I don't even know where this
machine is physically located, but we're
| | 04:22 | reading data from it.
| | 04:25 | I can save this and just test it
just to prove that this is working in the
| | 04:30 | SharePoint context. And yes, it is, so
we're getting the WeatherForecast here with
| | 04:35 | maximum and minimum temperatures.
| | 04:37 | And this section here that says
WeatherImage that's giving me a path to a JPEG file,
| | 04:43 | well it's now really all that useful
to see it like this, but no big deal.
| | 04:48 | I can jump across and change that.
| | 04:51 | Really what we want is the ability
to format anything in this column
| | 04:56 | differently from the others.
| | 04:57 | I'm going to click inside the cell here.
| | 05:00 | On occasion, it's a bit difficult to grab
hold of, but as I mouse around, I get a
| | 05:04 | little glyph on the right-hand
side that allows me to expand it.
| | 05:10 | And when I do, it says well the
data field it's bringing back is
| | 05:13 | the WeatherImage field.
| | 05:14 | Do I want to format this as text,
or rich text, or a hyperlink?
| | 05:17 | No, I actually want it as a picture.
| | 05:19 | It gives me a little warning,
"Are you sure? Do you want to do this?"
| | 05:23 | Yes, I'm sure, and that path is
now being formatted as an image.
| | 05:29 | I could go ahead and change the column headings
| | 05:32 | if I wanted to, or even remove them
entirely, apply some other formatting to these rows.
| | 05:37 | I'm just going to leave it as
is, hit Save, and F12 to test it,
| | 05:42 | and there we go--external data
are being drawn from a web service.
| | Collapse this transcript |
| Reading data from a REST-based web service| 00:00 | Creating a data source that is based
on a REST web service is very similar to
| | 00:06 | creating one based on a SOAP service,
| | 00:07 | but it's actually simpler than a SOAP service.
| | 00:10 | If I mouse over this button in the Data
Sources section, I'll see that I can use
| | 00:15 | this to create a connection to
a REST web service or RSS feed.
| | 00:19 | In fact, I am going to use an RSS feed here.
| | 00:21 | Selecting that, I don't
even need to give it a WSDL file.
| | 00:25 | It's more straightforward than that
when you are doing REST web services.
| | 00:29 | I am actually going to paste in the URL
of a RSS feed I have, which is the feed
| | 00:34 | for the lynda.com blog.
| | 00:36 | This one will be easy to go
through a few examples with.
| | 00:38 | It doesn't need any parameters to be
passed into it like the whether SOAP
| | 00:43 | web service needed.
| | 00:44 | And we don't need to provide any login
information because it's freely available.
| | 00:48 | So I'm just going to click OK.
| | 00:51 | We now have a REST-based web service.
| | 00:53 | We are going to do something a little
different with the page that's using this.
| | 00:57 | So I am going to go into my Site
Pages library and create a Web Part page.
| | 01:02 | I'll call this one RestExample.aspx.
| | 01:08 | Single-click to go into it and
then click to edit that file.
| | 01:13 | And yes, if you're jumping ahead of me,
you might also think we can go up to the
| | 01:16 | Insert tab and insert the data
view based on this web service,
| | 01:20 | and we can; it's just not
going to be all that useful.
| | 01:24 | So I'll find this RSS feed and insert it.
| | 01:28 | It's reading it correctly, but this
does not look like the kind of information
| | 01:33 | that I want to show as the
information from a blog feed.
| | 01:38 | It just seems to be the address of the feed
itself and another link to somewhere else.
| | 01:43 | And that's because the web part that
we're using here has kind of made its best
| | 01:47 | guess about the data it should be
displaying, and it's gotten it wrong.
| | 01:51 | You see, if I used the Data Source
Details panel over on the right-hand side--
| | 01:56 | and again, if it's not open, you can
find it from the Task panes section of the
| | 02:01 | View part of the ribbon--
| | 02:04 | we can kind of browse through some of that
information. And it looks like at the top level
| | 02:09 | we've got things like the title of the
blog, and we've got some links to where
| | 02:14 | that blog is located,
| | 02:16 | but the information we're interested in
is a bit further down, nested inside of it.
| | 02:20 | In fact, as I start to come down, I see
that I've got a folder here called item.
| | 02:26 | Really, it's just representing a
collection of items, and I'm looking at 1 out of number 10.
| | 02:31 | I can use the little arrows on the right-
hand side to actually navigate through them.
| | 02:36 | And as I'm doing that, it certainly looks like
this is the blog information that I am after.
| | 02:41 | We've got titles and
links and publication dates.
| | 02:45 | So what I am going to do
is jump back to the page.
| | 02:47 | I am going to select this web part
by clicking anywhere in it and then
| | 02:51 | grabbing the handle of it.
| | 02:52 | I am just going to delete it
because it didn't do what I wanted.
| | 02:56 | What I want is really to have the title,
and then I'm going to Ctrl+Click and
| | 03:02 | select link and perhaps
publication date, creator, and category.
| | 03:07 | I don't want comments.
| | 03:08 | Then I am going to grab these and
drag them all over into that placeholder,
| | 03:15 | let go, and we get a different version
of that web part, formatted with more of
| | 03:22 | the information that we're looking for.
| | 03:24 | Now, this is closer to what I want.
| | 03:25 | It's not quite there yet,
but it's getting there.
| | 03:29 | I can see, for example, that I am
getting the title; that looks good.
| | 03:31 | I got the link. Not so much.
| | 03:34 | I don't really want to be
displaying an HTTP address.
| | 03:37 | I want somebody to be able to
click the link and go there.
| | 03:41 | Right now, this is just being displayed as text.
| | 03:44 | So with my cursor somewhere inside
the web part, I'm going to jump up to the
| | 03:48 | Add/Remove columns and decide that no,
I really don't need to display link.
| | 03:52 | I might want to use it,
but I don't need to display it.
| | 03:56 | I am going to click OK and return.
| | 03:58 | Okay, so we are getting closer here.
| | 04:01 | What I'd like is for any of the titles
to also be a link to the blog post that
| | 04:06 | they're representing.
| | 04:07 | And we can do this.
| | 04:09 | Title is currently displaying as text,
but if I mouse over--and it doesn't
| | 04:12 | matter which one I've got selected,
| | 04:14 | any of the titles will do--
| | 04:16 | it recognizes that these are just
repeating pieces of the same piece of information.
| | 04:22 | So I mouse over the text till
I get that little pop-up here.
| | 04:25 | I'm going to tell it that yes, I want to show
title, but I don't want to format it as text;
| | 04:30 | I want it to be formatted as a hyperlink.
| | 04:33 | And when I do this, it's first going to
give me the warning that yes, this data
| | 04:36 | is coming from somewhere else.
Do you still want to do this? Yes I do.
| | 04:40 | And it gives me this Edit Hyperlink window.
| | 04:42 | It doesn't look all that friendly right now.
Really the two things that you should
| | 04:45 | be interested in is the very top part
that says Text to display, and the very
| | 04:50 | bottom, that says Address.
| | 04:52 | Now, right now it's going to show title and
try and link to title. I don't want that.
| | 04:56 | I want it to show the title
and the address is the link.
| | 04:59 | Now, if you notice, beside both of these
places, we've got this little function button.
| | 05:05 | We've got one at the bottom.
We've got one at the top.
| | 05:07 | I'm pretty much going to ignore the
whole middle section, because I don't want
| | 05:11 | to link to something specific.
| | 05:13 | I want to link to something that's dynamic,
something that can change from day to day.
| | 05:18 | So I'm going to come down here and
say the address should be--I am going to
| | 05:22 | grab this little function and it allows me
to browse all the fields in my data source.
| | 05:27 | What I'm interested in is link, and I
want to be careful which one, because it's
| | 05:31 | not the link of the feed,
| | 05:32 | it's the link of the individual items.
| | 05:35 | I am going to select that and click OK.
| | 05:38 | Now, what it has actually done is
it's inserted it in both places here.
| | 05:43 | I have got text to display as link and
title, and the address is link and title.
| | 05:47 | That's not what I want,
| | 05:48 | so I am just going to
manually edit this right now.
| | 05:51 | I'll just hit Delete up
here. I don't want that.
| | 05:55 | I want the text to display to be--
I am just going to write it--title and the
| | 06:01 | address to be link. Click OK.
| | 06:05 | Can't quite tell if it's
working yet, so let's save this.
| | 06:09 | Open it up in the browser.
| | 06:10 | And while the formatting may not yet
be what I'm looking for, it's getting
| | 06:15 | closer. And if I click this link,
we do successfully jump across to the
| | 06:20 | lynda.com blog and to that particular entry.
| | 06:24 | I could of course go through this
little deeper, particularly by jumping to the
| | 06:28 | table section. We could start to merge
cells and combine things together and
| | 06:32 | give things different styles.
| | 06:34 | We are going to get to that a little later.
| | 06:35 | And this gives you a taste of how we
can start to use REST-based web service as
| | 06:40 | a source of data in SharePoint Designer.
| | Collapse this transcript |
|
|
3. Business Connectivity ServicesIntroduction to Business Connectivity Services| 00:00 | Next up, I want to talk a bit about
BCS, or Business Connectivity Services,
| | 00:06 | in SharePoint 2010. So, what is this?
| | 00:09 | Well, the quick six-word summary is it
something that can make SharePoint talk
| | 00:14 | to external systems. Okay, like what?
| | 00:17 | Well, most commonly and easiest to
understand, a separate database. But it could
| | 00:21 | be a database, it could be a web service,
and it could be another application.
| | 00:25 | Now the question that might be
running through your mind here is, haven't we
| | 00:28 | just been doing this?
| | 00:30 | Well, yes, kind of.
| | 00:32 | This is another way to do it.
| | 00:34 | If your remember that what we've been
focusing on, very much the single-page
| | 00:39 | model, defining a data source and
inserting it onto a page, but using the much more
| | 00:45 | powerful BCS allows us to really
make that data part of our site,
| | 00:50 | use it on multiple pages, use it in
other lists and libraries, get it into
| | 00:54 | Office applications, even include it
in search results within SharePoint.
| | 00:59 | These days whenever I have to do
anything with SharePoint and external data, BCS
| | 01:04 | is my primary choice.
| | 01:06 | Now, I do go through the regular data
sources first when I'm teaching this,
| | 01:10 | because BCS does take a little more time
to set up in SharePoint Designer than a
| | 01:14 | regular data source, but it's
worth it, as I'll demonstrate.
| | 01:18 | Now if you're coming from SharePoint
2007, you might have heard, or even used, a
| | 01:23 | feature called BDC, or Business Data Catalog.
| | 01:27 | Now, it was also designed to do this,
to be a connectivity story between
| | 01:32 | SharePoint and external data, but for
those have you encountered BDC, here is
| | 01:36 | the core differences.
| | 01:37 | Now BDC in 2007 was read-only and BCS is the
CRUD, or create, read, update, and delete.
| | 01:45 | We've got full read/write
support in this version.
| | 01:49 | BDC, you had to write a lot and a
lot of XML to get this thing to work,
| | 01:55 | whereas BCS in 2010, most of it can
be done through the user interface of
| | 02:00 | SharePoint Designer.
| | 02:02 | And in SharePoint 2007, BDC was only
available if you had paid for the very
| | 02:07 | expensive server enterprise license,
whereas we have BCS features even in
| | 02:12 | SharePoint Foundation, the free
version of SharePoint, this time around.
| | 02:16 | But the biggest practical difference
between the two is that BDC in SharePoint
| | 02:21 | 2007 was just awful.
| | 02:23 | It wasn't actually difficult, but it was mind
numbingly tedious, unfriendly, and unpleasant.
| | 02:28 | It was like doing your taxes while having a
root canal at the same time, and BCS isn't.
| | 02:34 | Doing the exact same thing, describing
connections to external data, is actually
| | 02:38 | quite pleasant in SharePoint 2010.
| | 02:41 | And I think a lot of people from
SharePoint 2007 kind of avoided BCS because
| | 02:46 | they think it's the next version of BDC,
and it's much more pleasant these days.
| | 02:50 | It really is night and day.
| | 02:51 | However, there is kind of an issue we
are trying to learn it, because like much
| | 02:56 | of SharePoint, trying to understand
Business Connectivity Services, or BCS, as if
| | 03:00 | it's one coherent feature, well, that's
just going to give you a headache, because
| | 03:04 | it's really a bunch of little pieces
all wrapped up and given this name BCS.
| | 03:10 | There are pieces for Office,
pieces for SharePoint Foundation,
| | 03:13 | SharePoint Enterprise.
| | 03:15 | Now, one of the issues with first
learning BCS is there is the bunch of jargon
| | 03:20 | to it, and it's difficult to tell which of
these things are important and which aren't.
| | 03:24 | Well, let me make it a lot easier for you.
| | 03:27 | There is basically one key concept
that we need to understand to get started
| | 03:33 | with BCS, and that's something
called an external content type.
| | 03:37 | This is the most important thing in
BCS, the single most important piece.
| | 03:44 | An external content type is a
representation, a description of that external
| | 03:51 | object, that product, or customer, or
order, that thing that exists in your
| | 03:55 | external system that you
want to bring into SharePoint.
| | 03:59 | Content types of course are things
that we define inside SharePoint to
| | 04:03 | describe the stuff we have inside SharePoint,
like documents and images and lists and items.
| | 04:10 | Well, an external content type is the
same idea; we're just describing that piece
| | 04:15 | which sits outside of our system.
But everything we do in BCS is based on this
| | 04:21 | idea of an external content type.
| | 04:23 | This is step one, so let's see how to make one.
| | Collapse this transcript |
| Creating external content types| 00:00 | So I have my site open in SharePoint
Designer, and looking through the site objects,
| | 00:05 | I can see that I have the regular content types.
| | 00:07 | These are of course a very important
concept in SharePoint, the definitions
| | 00:11 | of the things that exist inside SharePoint,
like pages and documents, forms and pictures.
| | 00:17 | But we are dealing with external content types.
| | 00:21 | We are trying to have a definition of
something that resides outside of SharePoint.
| | 00:27 | And by clicking this, it will take
a little look and say, well, you have no
| | 00:30 | external content types.
| | 00:32 | That's to be expected.
| | 00:33 | I am going to define one now.
| | 00:34 | So I will click the button on the
ribbon to create a new external content type,
| | 00:39 | and we get this kind of informational page here.
| | 00:42 | This seems like there is a lot to it,
but really, most of this is not that important.
| | 00:46 | We have the ability to
single-click here to give this a name.
| | 00:50 | What I'm going to do is define an
external content type that's a separate database.
| | 00:55 | This could be a connection to a database,
it could be to web service, it could
| | 00:59 | be to a .NET program, so it could be
an actual line-of-business application.
| | 01:06 | What I want to do is talk to a database
called Pubs, and I am going to get some
| | 01:09 | information about book titles, so I will
call this Book Titles. And clicking down
| | 01:15 | a little further, it's just going
to copy that to the display name.
| | 01:18 | I am ignoring the other stuff here.
| | 01:21 | The only thing I am going to mention is
this dropdown called Office Item Type.
| | 01:25 | So this is the great thing
with external content types.
| | 01:29 | If you are trying to define a
connection to some external data that actually
| | 01:34 | maps to something you typically see in
Outlook, say an appointment or a contact--
| | 01:39 | maybe you got a contact management
system that you're connecting to--
| | 01:43 | you can choose to tell SharePoint, hey,
this piece of data is like a regular
| | 01:48 | Office contact, or like an office
appointment or a task, and it will then support
| | 01:53 | the ability to edit that using Outlook.
You could go into Outlook and use the
| | 01:58 | Contact part of the Outlook
to edit that external data.
| | 02:01 | Now for me, I'm interested in a list of
books, so this, I am just going to select
| | 02:05 | the default, which is Generic List.
| | 02:08 | The most important part of this page is
this link here. Beside the term External System,
| | 02:14 | we have Click here to discover
external data sources and define operations.
| | 02:20 | This is the part that we have to do.
| | 02:21 | It kicks us to the another page, which
again looks complex, but there's really
| | 02:26 | not much going on her. The only
option that I have is to add a connection
| | 02:30 | because nothing exists otherwise.
| | 02:33 | So, I will click that button.
| | 02:35 | It's going to ask, what kind of
data am I supposed to talk to?
| | 02:39 | We have the first one, which is .NET
Type, and the last one, which is WCF Service.
| | 02:44 | These would be meaningful to .NET
developers because you can talk to WCF web
| | 02:48 | service or an assembly written in .NET.
| | 02:51 | But the classic example
here is the SQL Server item.
| | 02:55 | So I am going to select that and click OK.
| | 02:58 | It says great, you want to connect
to SQL Server, well, what SQL Server?
| | 03:03 | We need to give it the name of the
database sever, which for me is DB server, and
| | 03:07 | the name of the database on that
server, which for me is going to be pubs, the
| | 03:12 | other classic, old-school
Microsoft sample database.
| | 03:16 | Now below this, we have the important stuff,
the authentication options, and what it
| | 03:21 | has here is Connect with User's
Identity. And this is a great one if you can get
| | 03:27 | it to work. The issue is if your
SharePoint server and the database you are trying
| | 03:32 | to connect to exist on separate machines.
| | 03:35 | You may run into problems there because
it can't just pass your identity around.
| | 03:40 | That's something you need to talk
to your systems administrators about
| | 03:43 | because if you have a full system
that's set up with the authentication
| | 03:46 | scheme of Kerberos, you may be able to get it
to work, but if you don't, then it's unlikely.
| | 03:52 | I'm going to use another option.
In fact, I am going to talk about this one a
| | 03:56 | little later on, but I am going to
use this third option to Connect with
| | 04:01 | Impersonated Custom
Identity. What does that mean?
| | 04:05 | Well, imagine that this system that I
am trying to talk to actually requires
| | 04:09 | different credentials than the ones
that I'm currently logged on with, which is
| | 04:14 | pretty common thing to have.
| | 04:15 | Well, SharePoint now supports the idea
of being able to connect my currently
| | 04:21 | logged on identity with a custom
identity and even store that information for us.
| | 04:26 | I am going to talk much
more about that in a moment,
| | 04:28 | but let it be said that right now we're
going to be using something called the
| | 04:31 | Secure Store service.
| | 04:33 | Now, I've already defined this in the background.
| | 04:35 | It has to be done in
SharePoint central administration,
| | 04:38 | so it's a systems-administrator-
level task to just set this up.
| | 04:42 | But I have something define called
pubsDB, which is actually going to take care
| | 04:46 | of storing all my credentials. I click OK.
| | 04:50 | What it's going to do is talk to that
store and say well, I was looking for you,
| | 04:54 | but I didn't see any information about you,
| | 04:56 | so how do you connect? And what I'm
doing here is I'm giving it the different
| | 05:01 | credentials that I use when I'm
connecting to the database, which for me is
| | 05:05 | pubs_simon and my password there.
And this could be the same whether it was a SQL
| | 05:11 | server, whether it was a separate
application; it's the idea of different
| | 05:15 | credentials for different systems. I click OK.
| | 05:20 | It thinks about it for a second, uses
that data to connect, and then we have
| | 05:25 | that pubs appear in our Data Source Explorer.
| | 05:28 | I can expand that. I can see tables, I
can see views if I have any, and even
| | 05:34 | routines, like store procedures.
| | 05:36 | This is a simple database,
so I'm interested in titles.
| | 05:40 | Now, I could expand this.
| | 05:42 | The thing that I am doing
here is we are not done.
| | 05:45 | What we have to do is start describing what
about this data source are we are interested in.
| | 05:50 | Are we interested in authors or employee?
Are we interested in everything, or is
| | 05:55 | it just filtered information?
| | 05:57 | Well, I'm interested in titles.
| | 06:00 | And if I notice, even with this selected,
it's actually still telling me over
| | 06:04 | here, you cannot save this external content
type without defining at least one operation.
| | 06:09 | It's saying yes, you have described that
there is some data you are interested in,
| | 06:12 | but I don't know about that
data you're interested in.
| | 06:15 | So it says the external content type must
have a Read Item and a Read List Operation.
| | 06:21 | Okay, well, we can give it far more than that.
| | 06:23 | If I come over to my Titles table
and I right-click it, I get the ability to
| | 06:28 | create a new Read Item operation,
and you Read List operation. It says I need
| | 06:33 | those two, but I have also got the
ability to have a Create operation update and
| | 06:37 | Delete. Or at the top, the easy way out,
Create all operations. I am just going to click that.
| | 06:43 | What it does is read the information
and then actually pop up a wizard that's
| | 06:49 | going to step me through what
it's done, what it's guessed for me.
| | 06:54 | So there's been no errors and warnings.
| | 06:55 | If there was errors, that
would pop up down at the bottom.
| | 06:57 | If I click Next, it says, okay I was
going to bring back this information and I
| | 07:02 | could step through it. And it's telling me a
little bit about how it's mapping the information.
| | 07:07 | Did it make a good guess?
| | 07:10 | It's the right kind of information. Dates
are dates and numbers are numbers, and so on.
| | 07:14 | I am leaving all of this as is.
| | 07:17 | This is something that you might need
to change if it's not working properly.
| | 07:21 | Often it's something that might require you
to have a little bit of communication
| | 07:25 | with your database administrator, or at least
some developer that's familiar with the system.
| | 07:30 | If I click Next, it's asking me
to add my own filter Parameters.
| | 07:35 | I have a warning down here that says,
"It's strongly recommended to add a filter
| | 07:39 | of Type Limit," for this,
| | 07:41 | because without it, it may
result in large result sets.
| | 07:44 | What that really is saying is,
you don't have any filters on.
| | 07:47 | You might be retrieving 30,000,
40,000, 50,000 records at a time, or at
| | 07:52 | least trying to do that.
| | 07:54 | Well, I know that this database isn't all
that big, so I'm not going to put a filter on it.
| | 07:58 | I am just going to click Finish.
| | 08:00 | And I can see over here,
it's not complaining any more.
| | 08:04 | It's actually saying, yes, you do have
Create, Read, Update, Delete and Read List
| | 08:08 | operations defined for
this external content type.
| | 08:12 | If I look up on the tab, I can still
see that little asterisk after the term.
| | 08:16 | Book Titles. That's our clue that this
has not been saved yet, so I'm going to
| | 08:20 | save it. And it says, "The changes to
the content type are being saved to the
| | 08:26 | business data connectivity metadata store,"
| | 08:28 | a very complex phrase that basically
means it's being saved up into SharePoint.
| | 08:35 | So we now have our first external content type.
| | 08:37 | If I click here, I can
see that it's listed here.
| | 08:40 | Now we haven't done anything with this
content type, but that's coming up next.
| | Collapse this transcript |
| Creating external lists| 00:00 | So we have an external
content type defined, but so what?
| | 00:04 | Well, in all our dealings so far with
external data, we have then created a web
| | 00:09 | page and used that data source
to fuel a web part on that page.
| | 00:13 | That's not what I'm going to do here;
| | 00:14 | it's a different kind of tactic.
| | 00:16 | This is much more of a true integration piece.
| | 00:19 | We have defined this connection to, in
this case, the titles table on a book's database.
| | 00:26 | What we can do now is create a
SharePoint list based on this external content
| | 00:32 | type, and I'll automatically have the page
to view that list, the page to add an
| | 00:36 | item, the page to delete an item, a
page to edit an item, generated for us.
| | 00:41 | I can do that from SharePoint Designer.
| | 00:43 | If I'm in the External Content Type
section, there is an option up here called
| | 00:46 | Create Lists and Form.
| | 00:48 | I don't have to do it here.
| | 00:49 | I can in fact open up the web site
that that external content type is defined
| | 00:55 | on, and I can create it from
within the SharePoint site itself.
| | 00:58 | If I do that, it's like
creating any other kind of list.
| | 01:01 | I go to my site Actions and
come down to More Options.
| | 01:08 | I could also get this through the View
All Site Content link. And we have all the
| | 01:13 | typical built-in SharePoint blank sites
and calendars and contacts and different
| | 01:18 | web databases. We are interested in
filtering down to list here, and this is the
| | 01:24 | one I'm interested in, the External
List type. And if you see the preview here,
| | 01:29 | it says, "Creates an external list to
view the data and an External Content Type."
| | 01:34 | This is very important.
We are not importing the data.
| | 01:38 | Anytime we see it, we're seeing fresh data
being drawn from that external source of data.
| | 01:44 | So I'm creating this
external list. I'll hit Create.
| | 01:48 | It's going to ask me to give it a name.
It doesn't matter what I call it, but I'll
| | 01:53 | call it Titles on Pubs.
| | 01:56 | Give it a description if I want to.
| | 01:58 | I'll say yes, display it on the Quick
Launch bar, and then it's going to ask for
| | 02:02 | what is the external content type.
| | 02:05 | We have two icons here. One will check
if whatever I write exists, but the one
| | 02:09 | I'm interested in here is the second
one to select the external content type.
| | 02:14 | It's going to show me the list, and
this is the only one it knows about.
| | 02:17 | It says the external data source is pubs
| | 02:19 | and the content type is Book
Titles. That looks correct.
| | 02:22 | We could have 50 of them. You never know.
| | 02:24 | I then click Create.
| | 02:28 | We jump in, and it looks like a
SharePoint list, but notice one I'm getting here.
| | 02:33 | I have this link here that says Click
here to authenticate, and that's because
| | 02:38 | I'm using the Secure Store Service.
| | 02:42 | What's actually happening here is that
it is detecting that this is the first
| | 02:45 | time I'm viewing this list through the
SharePoint site and it's demanding that I
| | 02:51 | sign in, that I provide my own
credentials for this external data.
| | 02:55 | It will then save them.
| | 02:57 | So I'm going to click here.
| | 02:58 | Now, because I have my server set up
and it doesn't have https turned on,
| | 03:03 | it's giving me a warning here that
this is not encrypted, so information
| | 03:06 | will be sent in clear text. That's fine.
| | 03:08 | That's okay. I am all internal here.
| | 03:11 | So I'm going to provide my connection
information for when I'm viewing this
| | 03:15 | within a SharePoint site, which is
pubs_simon. It's a completely
| | 03:20 | different account than the one that
I'm logged in to right now. Click OK.
| | 03:28 | It thinks about it, connects,
brings back all the information.
| | 03:34 | We can even mouse over.
| | 03:36 | We have the ability to Edit these items.
That will generate the page to edit it.
| | 03:42 | We have the title You Can Combat Computer
Stress to You Can't Combat Computer Stress.
| | 03:47 | There we go. Hit Save.
| | 03:48 | And we are writing back to the database
because my permissions allow me to do that.
| | 03:54 | I can come out to the top of the columns.
| | 03:55 | I can click the column headers to
order them up or down and all the
| | 04:00 | usual SharePoint stuff.
| | 04:01 | It really is behaving like a SharePoint list.
| | 04:06 | I can work with all the normal settings.
| | 04:08 | I can modify the view.
| | 04:09 | I can extract columns. I can filter.
| | 04:11 | I can group. But this data is fresh
and being drawn from the database as
| | 04:15 | we were looking at it.
| | 04:16 | Now you might think that the whole
problem of having to sign in is going to get
| | 04:22 | a little old if we have to do
that all the time, but we don't.
| | 04:25 | I'm just closing those down.
| | 04:26 | I'm going to reopen it just to prove that point.
| | 04:28 | If I go back to the site, whether
this was an hour later or the next day,
| | 04:32 | the next time I go and look at that,
it's not asking me to authenticate
| | 04:36 | because it's already save my
credentials in the secure database and the
| | 04:40 | Secure Store Service.
| | 04:41 | If I signed on as somebody else, it
would be asking me the first time that I
| | 04:46 | logged on to be providing that information.
| | 04:50 | This is how we create an
external list in SharePoint based on an
| | 04:55 | external content type.
| | Collapse this transcript |
| Introduction to the Secure Store Service| 00:01 | So a feature that I used in my example of
an external content type, and it's often
| | 00:05 | used together with BCS, is
something called a Secure Store Service.
| | 00:09 | This replaces something known as single
sign-on that existed in SharePoint 2007.
| | 00:14 | What this Secure Store Service allows us
to do is handle credentials very securely.
| | 00:18 | We don't have to store a username and
password in the page for anyone to see.
| | 00:24 | Now this must be set up by your
system administrator, because it's going to
| | 00:28 | create an encrypted database that lets
SharePoint securely store multiple sets
| | 00:33 | of credentials for external systems.
| | 00:36 | After it's set up the system
administrator defines what are called applications.
| | 00:40 | Now, applications sound complex,
but they are actually really, really simple.
| | 00:44 | They're basically just a name and a
list of what needs to be stored, usually
| | 00:49 | just a username and password.
| | 00:52 | So, an application is defined for each
separate database or line-of-business
| | 00:57 | system or web service or
whatever it is you need to connect to.
| | 01:01 | No connectivity information is provided,
simply given a name. Like say I'm
| | 01:06 | creating an application called
salesforce that should store a username and a
| | 01:10 | password, or I'm creating an
application called pubsDB that needs to store a
| | 01:15 | username and password.
| | 01:17 | They can be stored per individual, or they
can be stored on the group level as well.
| | 01:22 | Individual is more common.
| | 01:25 | The situation is that you now have the
Secure Store Service and its database as
| | 01:30 | part of this whole picture, between you
and your PC, the SharePoint server, the
| | 01:35 | external system, and this
new Secure Store Service.
| | 01:38 | So let's say Bob opens up the browser on his
PC and makes a request for a SharePoint page.
| | 01:46 | The page is using an external content
type, and if it's been defined with the
| | 01:50 | Secure Store Service, SharePoint will
automatically make a request to that
| | 01:55 | database and say hey, do I
have credentials for Bob?
| | 01:59 | If no credentials are found, what
then happens is this login page is
| | 02:04 | automatically generated and sent back to
the browser, sent back to Bob. Bob then
| | 02:09 | provides his credentials.
| | 02:11 | Those go back through, pass through
SharePoint, and are stored in the Secure Store
| | 02:16 | Service, then retrieved for that
SharePoint page, and we use those permissions to
| | 02:20 | connect to the external system.
| | 02:23 | Next time around, whether it's a day or
an hour later or a week later, Bob opens
| | 02:27 | his browser, makes a request to
SharePoint, SharePoint looks to the Secure Store
| | 02:32 | Service, says yes, we still do have
those credentials for Bob, securely
| | 02:37 | retrieves them, and uses those to
connect to the external system.
| | 02:41 | And all you really need to do to
have this work is just turn this on.
| | 02:46 | You don't have to create a login page;
| | 02:48 | it will be generated automatically.
| | 02:50 | If you saw in my example of using the
external list, the first time I tried to
| | 02:55 | view it, it asked me to provide that
authentication, the username and password.
| | 02:59 | For requests after that, it was fine.
| | 03:02 | It just let me through.
| | 03:02 | Now if your system administrator
hasn't ever set up the Secure Store Service,
| | 03:08 | that we'll need to get done.
| | 03:09 | It doesn't take very long.
| | 03:10 | Most of the heavy lifting is done
internally in SharePoint. And after that,
| | 03:15 | each new application that represents
each external system can be added in
| | 03:19 | minutes, and in SharePoint Designer,
all you need to do when you're creating
| | 03:24 | external content types is know the name
of the application in the Secure Store
| | 03:28 | Service, and SharePoint will do everything else.
| | Collapse this transcript |
|
|
4. Data-Driven PagesUnderstanding data-driven web pages| 00:00 | So let's recap. We define a source of external
data by creating a data source or an
| | 00:06 | external content type.
| | 00:07 | Now this isn't a coin-toss decision.
| | 00:09 | A lot of the time you'll have no choice;
| | 00:11 | you're going to be
constrained by what it is you have.
| | 00:14 | So with a data source, we can use
that to connect to SQL Server, or Oracle, or an
| | 00:19 | OLE-DB-compliant database, a REST or
SOAP web service, an XML file, and the
| | 00:25 | built-in SharePoint lists and
libraries are of course data sources.
| | 00:28 | When we're working with external content
types, we have the choice of SQL Server,
| | 00:33 | a .NET type, or a WCF web service.
| | 00:36 | Now, I am not covering the last two in
this course because they tend to be more
| | 00:40 | complex and really unique to your
environment, but everything we do here
| | 00:44 | applies to those as well.
| | 00:45 | So if you have SQL Server, you could
choose either, and if you do have a choice,
| | 00:50 | I recommend the external content type.
| | 00:53 | It is more up to date.
| | 00:54 | It's more powerful. So, then what?
| | 00:57 | Well, we want to be able to interact
with that data that we've defined, so with
| | 01:01 | data sources, your next step is to
typically create web pages that use those data
| | 01:06 | sources. I've been creating them in
the Site Pages library. And with external
| | 01:11 | content types, the classic next move is
to create an external list based on that
| | 01:16 | external content type.
| | 01:17 | And because an external list is a list,
it is automatically considered a data
| | 01:23 | source in SharePoint, like all
the other lists in SharePoint.
| | 01:26 | But one thing that's different
here is that creating an external list
| | 01:31 | automatically generates some web pages.
You'll get at least one to view or read
| | 01:37 | the list, and you'll get one to view or
read a single item. But if you specify
| | 01:43 | the external content type as allowing
inserts and updates, you'll also get a web
| | 01:47 | page to add or insert an
item and one to edit an item.
| | 01:52 | Now, SharePoint refers to
these pages as views and forms.
| | 01:57 | And essentially, they're just pages with web
parts on that show either a view or a form,
| | 02:02 | but what's the difference between the two?
| | 02:04 | A view is something that looks at the list as a
whole, and a form is oriented to a single item.
| | 02:10 | Now technically, there could
be a bit of a crossover here.
| | 02:14 | A view could show one item, either
because we only have one item in the list or
| | 02:19 | we're filtering the view to only show one.
| | 02:22 | But a view is oriented to the list as a whole;
| | 02:24 | a form is oriented to a single item.
| | 02:27 | So how so I know this is what's
going on with my external list?
| | 02:31 | Well, let's take a look.
| | 02:33 | I have my site open in SharePoint
Designer, and what I'm going to do is go to my
| | 02:38 | List and Libraries area, which is
where I am going to find my external list.
| | 02:42 | You will find those in
your List and Library section.
| | 02:45 | This I've already created
based on an external content type.
| | 02:48 | And if I single-click this to see the
informational page about it, what I can
| | 02:53 | see over here is I have one view
defined called Book Titles Read List and three
| | 02:58 | Forms: DispForm, EditForm, and NewForm.
| | 03:01 | That's displaying a single item, editing
a single item, and creating a single item.
| | 03:07 | These are all pages and they are all
considered independently editable and customizable.
| | 03:12 | I could just click say the
View page and open that one up.
| | 03:16 | It takes a second to read
all the information about it.
| | 03:20 | But yes, I'm looking at a page in
SharePoint that I can even see by selecting in
| | 03:24 | there as using the XSLTListViewWebPart.
| | 03:28 | If I close that one down--I
don't need to save any changes here.
| | 03:31 | I am going back into that External List.
| | 03:34 | I'm now going to open up say the NewForm.aspx.
| | 03:38 | And this is a form web part.
| | 03:42 | If I select in here, it's saying
it's an XSLTListFormWebPart as opposed
| | 03:47 | to ListViewWebPart.
| | 03:49 | So this is what happens
when you have an external list,
| | 03:54 | but this is what happens with all
lists and libraries in SharePoint, not just
| | 03:58 | external lists, but all the
standard SharePoint ones.
| | 04:00 | If I click back to my Lists and
Libraries and look at a standard SharePoint list,
| | 04:04 | like Announcements, that's also what I get here.
| | 04:07 | I get one page to represent the All
Items view, and three forms to represent
| | 04:12 | individual items there.
| | 04:14 | As you'll know, if you browsed through
SharePoint for any length of time is
| | 04:17 | are some lists that you work with
have just one single view, whereas others
| | 04:22 | have multiple views, particularly the task list
is a good example of a built-in SharePoint list,
| | 04:28 | that if I click this dropdown arrow in
the Browse part of the ribbon, I'll see
| | 04:33 | multiple views: All Task, My Task, Due
Today, Active Task, By Assigned To, By My
| | 04:38 | Groups. Well, these are also consider
customizable pages in SharePoint Designer.
| | 04:43 | If I jump back in here, jump into my
List and Libraries and into the tasks list,
| | 04:49 | I will see pages that represent
every single one of those views.
| | 04:52 | A lot of these can be edited in the
web browser, but you can do even more
| | 04:57 | significant editing using SharePoint Designer.
| | 05:00 | But as you can see, when you're
working with these external lists, what
| | 05:03 | SharePoint is trying to do is
present them to you exactly the same as a
| | 05:08 | regular list in SharePoint, as
similar as possible, and create you these
| | 05:12 | different web pages.
| | 05:13 | Now if you are working with data sources,
well, then the pages don't get created
| | 05:20 | automatically for your REST or SOAP
services or your database connections here.
| | 05:25 | And we've made several View pages so
far in our Site Pages section, but I can
| | 05:30 | also make a Form page that
works with an individual item.
| | 05:33 | If I create a new web part page, again
just picking the Full Page Vertical
| | 05:37 | here, I am going to create one based on
the database connection I already have,
| | 05:40 | so I'll call it dbAddItem.aspx. Edit that one.
| | 05:49 | And whereas so far we have been
clicking in this placeholder and coming up to
| | 05:54 | the Insert tab and choosing a Data view,
| | 05:56 | what I could just do in
here is choose a New Item Form.
| | 06:00 | I'll base that on my database
connection of products on Northwind.
| | 06:04 | It thinks about it for a second and
gives me a form to insert a single item.
| | 06:10 | This is of course customizable.
| | 06:12 | We'll get into that in a moment, but this
is the general procedure for doing this.
| | 06:15 | And as we'll see, what we can also do
when we're creating our own pages, or
| | 06:19 | customizing pages, is have ones that
show multiple sources of data at the same
| | 06:24 | time, or views and forms together, to
show say master and detail sections.
| | Collapse this transcript |
| Working with Data View and Data Form Web Parts| 00:01 | Here's the thing that
can puzzle people at first:
| | 00:03 | you'll find that there are multiple
web parts available in SharePoint to
| | 00:06 | represent views and forms.
| | 00:08 | There is the ListViewWebPart, the XSLTListViewWebPart,
| | 00:12 | the DataViewWebPart, and sometimes there appears
to be very little rhyme or reason to
| | 00:17 | which one is used where.
| | 00:20 | If I create a new page in SharePoint
Designer, I'll just do the standard Web Part page.
| | 00:24 | I'll just call this one webparts.aspx.
| | 00:27 | I'm just using this as a demo here,
and go into Edit mode on this one.
| | 00:32 | I'm going to click into the placeholder
for content here, and I'll insert a data
| | 00:38 | view from the ribbon that's meant to
represent say one of the built-in SharePoint
| | 00:43 | list, like the task list. And I can see
that by selecting that option, I got the
| | 00:48 | XSLTListViewWebPart.
| | 00:50 | Well, let's say that was an accident.
| | 00:52 | I didn't mean to do that.
| | 00:53 | So I'll close that and say No,
I don't want to save changes.
| | 00:56 | Let me go back in and edit that one
again, and this time around I'll click
| | 01:01 | Insert, but I will insert
say the SOAP service here.
| | 01:05 | Well, this time I use the same button to
insert it from the ribbon, but I have a
| | 01:10 | data form web part being
shown here, which seems little odd.
| | 01:14 | I don't have the XSLTListViewWebPart
anymore. And while we usually associate
| | 01:18 | the term 'form' with a single item,
this does seem to be showing me what I
| | 01:22 | consider a view, which is
multiple items at the same time.
| | 01:25 | See, the thing is, SharePoint Designer
is picking the web part to use based on
| | 01:30 | where you're data is coming from.
| | 01:32 | If your data source is a built-in
SharePoint list or library or an external list
| | 01:37 | from an external content type,
when you add a view, you'll get the
| | 01:41 | XSLTListViewWebPart.
| | 01:43 | This is the most recent web
part, new in SharePoint 2010.
| | 01:47 | If it's from a data source, something
like a web service data source or an XML
| | 01:51 | file data source or a database data
source and you add a view, you'll get the
| | 01:56 | older data form web part. And notice
this is a form web part showing a view, not
| | 02:01 | a view web part, which is kind of annoying.
| | 02:03 | There actually is a data view web part,
but it's not used in this version of
| | 02:08 | SharePoint, unless you've upgraded
pages from an older version, like SharePoint
| | 02:12 | 2007, and there are other situations.
| | 02:15 | We have talked about
views, but what about forms?
| | 02:17 | Well, if you add a form for an
external list, you'll get the
| | 02:21 | XSLTListFormWebPart. But if you add a
form for a built-in SharePoint list,
| | 02:26 | you'll get the ListFormWebPart, no XSLT.
| | 02:30 | Now, this could get confusing, in fact,
really confusing, if we had to remember
| | 02:35 | which one to use where,
but here's the good thing:
| | 02:38 | it's not really up to us.
| | 02:40 | The web part that's used will be
decided by SharePoint based on our data
| | 02:45 | source; we just have to deal with the results.
| | 02:48 | So whether we seem to be editing
XSLTListView or data form web parts, you'll
| | 02:52 | see many of the same options in SharePoint
Designer are exactly the same on the ribbon.
| | 02:57 | Now, you will find that some of these
web parts, when viewed in the browser, do
| | 03:02 | have a browser support, full ribbon support.
| | 03:04 | A classic example would be
say let's look at the task list.
| | 03:09 | This is actually using the
XSLTListViewWebPart, and I can see that I have list tools.
| | 03:14 | I have full ribbon support here to
create a view and modify the view; all that
| | 03:19 | stuff that's actually built in.
| | 03:21 | If I look at something that's a bit
more old school, for example jumping into
| | 03:25 | my Site Pages library and looking at my
XML example, I will not see that level
| | 03:31 | of support on the ribbon.
| | 03:32 | There is not a lot I can do or
customize about this view from the page itself.
| | 03:38 | About the only thing I can do, if I don't
like this untitled_1, is I can jump to
| | 03:42 | the page ribbon, and I can edit the
title bar properties, which will give me the
| | 03:47 | web part editing page over here on the
right, and I'll just say XML Books File.
| | 03:56 | That's about the most I can do there, switch
back to browse mode and see that new title.
| | 04:02 | But all of these can be
edited in SharePoint Designer.
| | 04:06 | If I open up that XML page in
SharePoint Designer, I'll see a lot more options,
| | 04:11 | when it refreshes the page, about
editing that up here on the ribbon.
| | 04:15 | Now as you start to create a few more
of these pages, you will naturally start
| | 04:22 | to recognize when and
where each ones are being used.
| | 04:26 | But if you make the assumption that
you're doing all your changes in SharePoint
| | 04:29 | Designer, you won't really have to
worry about the level of browser support.
| | Collapse this transcript |
| Filtering, sorting, and grouping data| 00:00 | We can easily change options on our web
parts to present a better view of our data.
| | 00:06 | Now, we can do that on any of the pages
we create in the Site Pages library, or
| | 00:10 | we can do it on our external lists.
| | 00:13 | I'm going to jump into my external list
here and customize the main view page.
| | 00:20 | This is the one that I have defined
with an external content type going to
| | 00:23 | the pubs database, but customizing these web
parts would be the same wherever you had it.
| | 00:28 | So I'm going to make sure to be
clicked somewhere in the web part.
| | 00:32 | I like grabbing the handle of the web
part itself, and the important stuff is
| | 00:36 | up here on the ribbon.
| | 00:38 | I'm in the first part,
which is the option section.
| | 00:40 | I'm first going to click on Filter.
| | 00:42 | Let's say I think that we're bringing
back a few too many books here and what
| | 00:46 | I'd like to do is bring
back the computer-related ones.
| | 00:49 | Well, I can see that there might be
some in there related to computers, so I'm
| | 00:54 | going to say that I'm interested in filtering
where the title--I don't want to say equals.
| | 01:00 | I want to say, what do I have? We've got contains.
| | 01:03 | Let's say it contains the word computer.
| | 01:07 | Now this is case-insensitive, so
it would be computer or computers.
| | 01:13 | I can see down here on my page
| | 01:15 | I have got Computers with an uppercase C
and a plural, but this would work just fine.
| | 01:19 | Now, I could filter just on that.
| | 01:21 | If I click OK, it will even update
the data view while I'm in this design
| | 01:25 | mode, and I could see we have got
Cooking with Computers, You Can't Combat
| | 01:29 | Computer Stress, Straight
Talk About Computers, et cetera.
| | 01:31 | I'm actually going to edit
that and add in a couple more.
| | 01:35 | So I'm going back to the ribbon, click
Filter, and where it says Click here to
| | 01:39 | add a new clause, I'm going to do that.
| | 01:42 | What I'm going to do is say it
could also contain the word database.
| | 01:48 | Now if I do that, what I want to make
very sure is that up here on the first
| | 01:54 | clause, the first condition,
I change this to an Or.
| | 01:58 | So it's saying where the title
contains a word computer or the title
| | 02:01 | contains word database,
| | 02:02 | let's see what's happening now.
| | 02:05 | Busy Executives Database Guide, Cooking
with Computers. We're looking good.
| | 02:08 | In fact, I'm going to do one more quick
one to also include the idea that the
| | 02:13 | notes field might contain those words too.
| | 02:18 | So, as you can see, we can actually
very quickly build out fairly large sets
| | 02:23 | of clauses here, and I've accidentally
clicked on the last one and added an extra clause.
| | 02:30 | I don't need that, so I'll just highlight
that and hit the delete key. There we go.
| | 02:36 | We can ignore the very last And or Or
because it doesn't mean anything; it's only
| | 02:41 | these first three that I'm interested in.
| | 02:43 | So I click OK and it updates the data view
to take those filter conditions into account.
| | 02:50 | While I'm doing this, of course, I can
save and test at anytime. The little clue
| | 02:55 | that I haven't saved is the asterisk
after the file name up here on the tab.
| | 02:59 | So I can either hit Ctrl+S or I can
hit the floppy disk icon at the top-left,
| | 03:04 | and once that's done, I can hit F12
to open it up in the browser. And we're
| | 03:10 | seeing all the books right now that
contain the word 'computer' in either the
| | 03:13 | title or the notes or the Word database.
| | 03:18 | It still looks a little messy,
| | 03:19 | so I'm going to tidy this up even further.
| | 03:21 | Back into SharePoint Designer.
| | 03:23 | I'm going to jump up into
the Sort and Group button here.
| | 03:28 | Now by default this is actually
sorting by title ID ascending, which is what
| | 03:33 | the yellow triangle means here.
| | 03:35 | You can click the radio button here to
change that, or you can just double-click
| | 03:38 | the sort order and that would flip it
up and down from ascending to descending.
| | 03:42 | Let's say I don't find that all that
useful. What I might be interested in is to
| | 03:47 | sort by price ascending.
| | 03:49 | So I'm going to actually click title ID
and remove that, and this does exactly
| | 03:54 | what you think it does. We are filtering.
| | 03:58 | We're also sorting by price.
| | 04:00 | We have a couple of books here that
don't have a price, so they are being
| | 04:04 | considered very early on in that sort sequence.
| | 04:08 | But I can also see by scanning this
information that I seem to have a type
| | 04:12 | column here, which is like a category.
Some books are business. Some are like psychology.
| | 04:16 | Here is another business one.
| | 04:18 | And what I want to do is
group those ones together.
| | 04:21 | So I'm going to go back and click
on these Sort and Group and to group,
| | 04:25 | you first need to sort.
| | 04:27 | So I'm going to find type over here on
the left, which is one of the available
| | 04:31 | fields, add it to the sort order.
But with it selected, I'm going to click this
| | 04:36 | button here to say Show group header.
| | 04:39 | I can choose to either have this
expanded or collapsed by default. I'm just
| | 04:42 | going to leave it expanded.
| | 04:44 | We click that, we click OK, and now
SharePoint will take care of grouping these
| | 04:48 | into their individual types.
| | 04:50 | We're also sorting by price ascending.
Now, there is not an awful lot going on here.
| | 04:56 | So what I'm going to do here, just to
give us a bit more to look at, I'm going
| | 04:59 | to go back to my filter section and
just remove the filters, highlighting this
| | 05:03 | left column here to select each row,
click and delete, click and delete, click
| | 05:07 | and delete. Click OK. Just to
give us a little more to deal with,
| | 05:12 | I'm going to save this page and hit
F12 to open that up in the browser.
| | 05:16 | Of course, this data is being drawn
instantly from that completely separate
| | 05:22 | database on a separate server,
but SharePoint is generating the interface for me.
| | 05:27 | I can actually click the little Minus
button to collapse and expand these groups.
| | 05:31 | We're sorting by the groups. Then we were
sorting by price ascending within the groups.
| | 05:36 | Sure, there's some more I could
change about this page if I'm grouping them
| | 05:39 | together into the categories, like
psychology here, I really don't need to also
| | 05:44 | be showing the psychology column.
But it's always a good idea to have your data
| | 05:48 | filtered and sorted and grouped
correctly first, so that we have the structure
| | 05:53 | of the data correct before we
start to work with the presentation of it.
| | Collapse this transcript |
| Connecting web parts| 00:00 | So, up to this point, we've been creating
pages with single web parts on them, but
| | 00:05 | we can add multiple web parts to those pages.
| | 00:08 | Let me show you why we might,
just with a simple example.
| | 00:11 | I'm going to make a new Web
Part page in my Site Pages library.
| | 00:14 | I'll just call this one multiple.aspx, jump in
to edit this, and click into the placeholder.
| | 00:26 | Now as ever, I'm going to jump up to
my Insert section of the ribbon and come
| | 00:33 | across to Data View.
| | 00:35 | Now, it really doesn't matter with what
I'm trying to describe here, whether the
| | 00:38 | data is coming from a built-in
SharePoint list or library, from a database,
| | 00:43 | data source, from an external list, from
external content type, or from anywhere else.
| | 00:48 | It's going to work pretty much the same way.
| | 00:50 | I'm going to select my database
connection that I have here. It thinks about it for
| | 00:55 | a second and then inserts this classic
Data View here, choosing the data form
| | 01:00 | web part, but it's a view of
multiple pieces of information.
| | 01:03 | Well, let's say that wasn't what I wanted.
| | 01:06 | Let's say I was really interested
in just showing the titles right now.
| | 01:10 | I'm going to select that web part and delete it.
| | 01:14 | But because I'd added it, I do have my
Data Source Details pane hanging over
| | 01:18 | here on the right-hand side.
| | 01:20 | If you couldn't see that, you can get
it from the View section in the menu
| | 01:23 | in your task panes.
| | 01:24 | But what I'm going to do is select
just ProductName, making sure that my
| | 01:30 | cursor is selected in my placeholder,
and then say Insert Selected Field as
| | 01:35 | Multiple Item View.
| | 01:37 | And we just get now the
ProductName, just that title.
| | 01:43 | It's still a web part.
| | 01:44 | It's using the data form web part here
in fact. Because this is almost certainly
| | 01:48 | considered untitled, I'm going to jump
up to the Web Part section and give this
| | 01:53 | web part a name, which is Product List.
| | 01:57 | But what I'd like to do is have a
different area on the same page that shows all
| | 02:02 | the information about the product.
| | 02:04 | The way I'm going to do this is by
looking at the web part when it's selected,
| | 02:08 | I'm going to click underneath it
just to select somewhere in there that's
| | 02:12 | outside of the web part itself.
| | 02:14 | Again, I want to make doubly sure that
I've done that. So yes, with the whole
| | 02:17 | web part selected, I can see the blue area
denotes where it begins and where it ends.
| | 02:22 | I want to have my cursor clicking outside of it.
| | 02:25 | I'm going to come over to the
same Data Source Details and select, in fact
| | 02:29 | I'm going to Ctrl+Select on every field here.
| | 02:35 | And from the button this time around,
I'm going to choose to insert this as a
| | 02:39 | Single Item View, not Multiple Item View.
| | 02:43 | What this does is insert another web
part on the same page, but this one has got
| | 02:47 | a different perspective
| | 02:48 | of the information. It's showing me all
details about one product instead of just
| | 02:53 | the product name of all of them.
| | 02:55 | Once again, this web part probably
doesn't have a name, so with it selected, I'm
| | 02:59 | going to jump up to the web part
section of the ribbon and say that this is
| | 03:04 | Product Information.
| | 03:05 | I'm going to hit Save, and then I'm
going to hit F12 to test this in the browser.
| | 03:14 | Okay, it could do with a bit of updating.
| | 03:16 | I've got a few too many
blank lines between the two here.
| | 03:19 | But I see I have got the full product
list, and then I've got individual product
| | 03:22 | information, but there's no
connection between the two right now.
| | 03:26 | That's what I need to create next,
and that's what this is all about here.
| | 03:31 | I'm going to delete, click in the blank
area between them, and just delete a couple
| | 03:34 | of lines there to not have so many spaces.
| | 03:37 | And what I'm going to do is
select the first web part.
| | 03:42 | It doesn't actually matter which one I
select because I want to connect the two,
| | 03:46 | and I can drive them either way.
| | 03:48 | I can go from the top to the
bottom or from the bottom to the top.
| | 03:52 | With that top one selected, I'm going
to come up to this button of the ribbon
| | 03:55 | that says Add Connection.
| | 03:58 | It takes a look at the web part and
says okay, I'm presuming that what you want
| | 04:02 | to do is send some data to another web part,
| | 04:06 | and that is what I want to do.
| | 04:07 | My other options are to get some data from
somewhere else, but that's not relevant here.
| | 04:12 | Yes, I'd like to send a
row of data. Well, who to?
| | 04:15 | I click Next, and it says, well,
your source web part is Product List.
| | 04:19 | That's good. Where's the web
part you want to connect to?
| | 04:22 | Is it on this page, or is it on a different page?
| | 04:25 | Well, it's on this page, so I'll click Next.
| | 04:28 | It's saying that the only other web
part I can find is untitled, and that's
| | 04:31 | I think because I didn't save my new
title change to that web part, but that's fine;
| | 04:36 | it'll work correctly anyway.
| | 04:38 | And it's saying, what do we want
to do with the second web part?
| | 04:40 | Do we want to filter based on some
values we've been sent? And that's
| | 04:44 | exactly what I want to do.
| | 04:45 | So bear in mind I'm not changing anything.
| | 04:47 | I'm really just clicking
Next through all of this.
| | 04:50 | I click Next again.
| | 04:51 | But this is the screen that I do need
to change because it's asking me, how do
| | 04:55 | these two web parts connect?
| | 04:57 | It's recognizing that there's all these
different fields in the second web part,
| | 05:01 | and it's not understanding
exactly how to hook them up.
| | 05:03 | Well, really the important thing is this.
ProductID in the second web part is the
| | 05:09 | key for that product table,
| | 05:11 | so I should hook this up with
ProductID in the first web part.
| | 05:16 | So making sure those match, and if you
need it to match on multiple columns, you
| | 05:20 | could do that, too, but I'm okay with one.
| | 05:23 | I click Next, and now it asks,
well, how do you select a product?
| | 05:27 | So in the first web part, do you
want me to create a hyperlink on the
| | 05:31 | ProductName, which is
currently just un-clickable text?
| | 05:34 | And yes, this sounds good,
| | 05:35 | so I'm going to do that.
| | 05:36 | I'm just going to leave the rest of
it blank, click Next, and click Finish.
| | 05:40 | Now selecting that second web part,
I'm going to make sure this one actually
| | 05:45 | has a title here. That was meant to be
Product Information, but it seemed to
| | 05:48 | have lost it last time. All right!
| | 05:56 | I'm now going to save this.
| | 05:59 | I'm going to hit F12 to
open it up in the browser.
| | 06:01 | What I can see just by looking at is
we have the Product List at the top and
| | 06:06 | Product Information below.
| | 06:07 | I'm going to pick say a random one here,
Northwoods Cranberry Sauce, and I see
| | 06:12 | that it immediately updates the
Product Information web part with all the
| | 06:16 | details about that product. We can jump ahead.
| | 06:18 | We can do multiple ones here.
| | 06:20 | I can page several levels down in the
product, go to Sasquatch Ale, and indeed
| | 06:26 | get the Sasquatch Ale information.
| | 06:29 | Sure, it's not the most interesting
page in the world, and it could do with a bit
| | 06:34 | of cleaning up, and in fact, it would
probably be a good idea to shrink down this
| | 06:38 | web part and put the other one up there
beside it, but this will work just fine.
| | 06:42 | The point that we're trying to get here
is how to connect two web parts together.
| | 06:46 | Now, when the web parts are created on a
page, you can often hook them up in the
| | 06:50 | browser too, but I typically find it's
more useful to define them internally
| | 06:56 | on the unique page itself, and you'll find
that from the Add Connection button here.
| | 07:01 | What I also see here is that we have
the Manage Connections button is active
| | 07:05 | because SharePoint Designer is
recognizing there are active web part connections
| | 07:09 | defined on this page.
| | 07:12 | And while these two web parts are
really showing the same data, just different
| | 07:16 | views of them, we can use the same
concept to connect between different data on
| | 07:21 | web services and databases, link
between master and detail tables, and show a
| | 07:27 | lot of different
information with the same principles.
| | Collapse this transcript |
| Creating master/detail pages| 00:00 | Creating web pages with web parts that
connect to multiple data sources is also easy.
| | 00:07 | I'm going to create a new Web
Part page in my Site Pages library.
| | 00:10 | This time around, I'm going to select one
which actually has multiple levels to it,
| | 00:14 | so I'll select this third one
here, and I'll call this masterDetail.
| | 00:20 | I'm going to make this
connect to different data sources.
| | 00:25 | Now what I have gone ahead and
done is in my Data Sources section
| | 00:29 | I've created a couple of new database
connections to other tables on Northwind.
| | 00:33 | These were created exactly the
same as my connection to products was.
| | 00:38 | So I'm not even messing with
external content types here.
| | 00:41 | So back into Site Pages,
| | 00:43 | I'll edit that masterDetail, and we've
actually got three sections to it here.
| | 00:53 | Now, occasionally, these can be a bit
difficult to grab when you're in SharePoint,
| | 00:57 | particularly the small ones,
| | 00:58 | so I'm just actually just going to
insert a few letters in each one to make sure
| | 01:03 | that I keep track of where they are.
| | 01:07 | In the first section, what I'm going to
go ahead and do is jump up to my Insert
| | 01:12 | tab and insert a data
view for Orders on Northwind.
| | 01:22 | That's a little bit too much information here.
| | 01:24 | I don't really need a
RequiredDate, nor do I need EmployeeID,
| | 01:28 | so with that highlighted, I'll
jump in and remove those columns.
| | 01:33 | EmployeeID is gone, and
RequiredDate is gone and click OK.
| | 01:39 | Then I'll come down and in the second
section here, I'll just hit the Enter key
| | 01:44 | to give myself some space, and
I'll insert another data view.
| | 01:49 | This time around, it will be Order Details.
| | 01:51 | Now there is no connection between the two
right now as far as SharePoint is concerned.
| | 01:54 | We will make that ourselves in just a
minute. And then over here, I'm going to do
| | 02:00 | the third one, which is inserting a data
view for Products on Northwind, the one
| | 02:05 | we have already used quite a few times.
| | 02:08 | And this one, I don't need quite so
many pieces of information either,
| | 02:12 | so with that web part highlighted, I'll
jump into Add/Remove Columns and get rid
| | 02:16 | of Quantity and Category
and SupplierID and click OK.
| | 02:21 | At this point, I could even get rid
of the extra letters that I'd added to
| | 02:25 | keep placeholders there.
| | 02:28 | So I have three web parts showing up.
| | 02:30 | Now what I need to do is
go ahead and connect them.
| | 02:33 | Before I do, I'm just going to hit Save,
just in case we run into any problems here.
| | 02:38 | So what I want to do is connect from the
orders information to the order details
| | 02:43 | information, and then from order
details, which has a ProductID, I want to
| | 02:46 | connect to products.
| | 02:47 | So we will start from the top.
| | 02:51 | Selecting orders, I'll click Add Connection.
| | 02:53 | It's going to ask, do you want
to send a row of data? Yes, I do.
| | 02:57 | I want to send that order ID down to order
details and get all the details for this order.
| | 03:02 | So, we jump ahead.
| | 03:03 | We click Next. Yes, I am connecting
to a web part on this page. Next again.
| | 03:07 | That's even taken a guess. Is it order details?
| | 03:10 | Yes, it is, and yes, I want to get
filter values from, I click Next once more.
| | 03:14 | This is where I have to describe the
connection between the two, and what we
| | 03:18 | want is that OrderID on the top web part is
connecting to OrderID on the lower web part.
| | 03:24 | So let's find OrderID here and make sure
that it maps to OrderID on the top one.
| | 03:31 | You would have all sorts of weird and
interesting results if you mapped up the different
| | 03:36 | columns--definitely not what you want.
| | 03:39 | Here it's asking how do we select the
item in the top web part? And yes, creating
| | 03:43 | a hyperlink on OrderID will be just fine.
| | 03:46 | I'm going to also check this, which
allows us to highlight the column to indicate
| | 03:51 | which row is selected.
| | 03:52 | So I'm saying I'd like to highlight the OrderID.
| | 03:56 | It doesn't automatically do that,
even though it will create a link.
| | 04:00 | So click Next and Finish, and it even
kind of shows you the highlighted, or
| | 04:05 | in-bold, version there.
| | 04:06 | Now if you notice, the OrderID itself is
actually just equivalent of text, 10248.
| | 04:12 | It's actually trying to be a little bit
too helpful here and formatting this for me.
| | 04:16 | I don't really want it formatted as a number.
| | 04:18 | So if I mouse over this, I'm
going to get this little pop-up.
| | 04:21 | It says, do I want this to format
as a number? No, I don't.
| | 04:24 | I'd like to just format it
as text, no commas involved.
| | 04:29 | When you're editing on the data form
web part, which is what I'm doing here,
| | 04:33 | you'll actually find this is much
easier to edit than the more powerful
| | 04:37 | XSLTViewWebPart.
| | 04:39 | So if you're looking at an XSLTViewWebPart,
you probably won't find that
| | 04:42 | quite as easy to change from a number to text.
| | 04:45 | Well, I'm going to go ahead and create
the second connection, which is going to
| | 04:50 | be from order details to the products web part.
| | 04:55 | So with that one highlighted, I'm also
actually going to format its product ID
| | 04:59 | here, which shouldn't be a number;
| | 05:01 | it should just be text.
| | 05:03 | Highlight the web part. Jump to Add Connection.
| | 05:06 | Yes, we want to send a row of data, and yes,
we're connecting to a web part on this page.
| | 05:12 | It's taken a guess that we want to go to
orders, but no, we want to go downstream.
| | 05:16 | We want to go to products web parts and yes,
we want to, say get filter values from.
| | 05:21 | Click Next again.
| | 05:22 | This is where we have to match up the two.
| | 05:24 | Well, I should have a
ProductID in both web parts here.
| | 05:28 | So here's product ID on the products
web part, and I want to map this to Product
| | 05:33 | ID here and click Next again.
| | 05:37 | It says, do we want to create a
hyperlink on OrderID? No, we don't;
| | 05:40 | we want the ability to select a product
and find the information about that product.
| | 05:45 | So I'll say no. Let's do it on
ProductID. And I will indicate that current
| | 05:49 | selection by highlighting ProductID.
| | 05:52 | Now, if this is not quite clear right now,
it should be much more obvious when I
| | 05:55 | go ahead and do this in just a second.
| | 05:58 | So I'm going to finish,
| | 06:00 | I'm going to save, and then I'm
going to hit F12 and open this up.
| | 06:07 | So we have orders on Northwind.
| | 06:09 | By default, the first row
of everything is hooked up,
| | 06:12 | so Order 10248 is being highlighted
right now, which tells me that Order 10248
| | 06:18 | had three products in it,
| | 06:19 | 1142 and 72, and with 11
highlighted, that was Queso Cabrelas.
| | 06:25 | If I jump ahead to say the order 10253,
I can see that was made up of three
| | 06:30 | order details, which was 31, 39, and 49.
And if I wanted to know what product 49
| | 06:35 | was, I just select that and find that it
was Maxilaku, or whatever the devil that is.
| | 06:42 | So very easy to hook up all these web parts,
| | 06:45 | no code involved. It just allows us to do
it all through SharePoint Designer.
| | 06:50 | And you could use exactly the same model to
connect between data sources that were
| | 06:55 | databases and web services.
| | 06:57 | As long as they're old validly connect
to each other, they would work just fine.
| | Collapse this transcript |
|
|
5. Displaying Richer DataConditional formatting| 00:00 | Very early on in the course, I did a
brief demo of conditional formatting, and
| | 00:05 | I'm going to get a little deeper into that now.
| | 00:08 | The idea behind it is that we have a
lot of data that we end up looking at, and
| | 00:13 | unless we want to go piece by piece
through all the values, it's sometimes easy
| | 00:17 | to miss things that should be
important, so it allows us to create rules to
| | 00:22 | announce, or highlight, certain pieces of
information so they make themselves more obvious.
| | 00:27 | So I'm going to jump into SharePoint Designer.
| | 00:30 | I'm going to do this on just a
very straightforward external list.
| | 00:34 | I've removed all formatting,
grouping, all that kind of thing, from it.
| | 00:39 | It is an external list, so I'm going
to jump to my Lists and Libraries and to
| | 00:42 | find the page that represents it,
| | 00:44 | I'll jump into that external
list and into the main view.
| | 00:48 | But what I'm about to explain works
on pretty much any web part that you're
| | 00:53 | going to be using in a view, whether
that's from an external content type or
| | 00:57 | from an XML-based data source
or a SOAP service or anything.
| | 01:02 | So with this web part selected, what I
want to do, let's say in this first case,
| | 01:07 | is find this column here which is ytd_
sales, and perhaps I want to highlight any
| | 01:14 | value that is more than 5,000.
| | 01:16 | Now if I'm wanting to highlight an
individual cell, then what I'm doing is
| | 01:21 | highlighting, or formatting, a column.
| | 01:24 | So I click somewhere in the column,
which is ytd_sales, I come up to my
| | 01:28 | Conditional Formatting entry, and
I say I want to Format the Column.
| | 01:33 | Now, this doesn't mean it
will format the entire column.
| | 01:36 | It will only format one cell, one
particular intersection of a row and a
| | 01:40 | column, when this condition is true.
| | 01:43 | So anytime we're doing conditional
formatting, there's two pieces to it:
| | 01:47 | the condition and the style.
| | 01:49 | So, what are the rules?
| | 01:50 | In this case, what's the condition?
| | 01:51 | Well, I want to say where
ytd_sales not equals, but is greater than,
| | 01:59 | I'm typing in 5,000.
| | 02:02 | I could add more conditions after this,
just like you can do filters as well, but
| | 02:07 | I'm going to leave that. And then I
click the button to say Set Style.
| | 02:11 | You do get a lot of options here.
| | 02:13 | There's font options and
background options, Border and Box,
| | 02:16 | all the usual things you'd expect from
CSS, though I will warn you, don't expect
| | 02:21 | that you can do all of
these in conditional formatting.
| | 02:23 | You'll find that many of them will be
overwritten by the default SharePoint
| | 02:28 | Style, so stick with the
things that are a bit more obvious.
| | 02:31 | A classic one is either changing the
font or changing the background color.
| | 02:36 | In this case, I am going to
change the background color.
| | 02:38 | We do have a dropdown here that
pops up some commonly used ones.
| | 02:43 | I could pick that green. That will
work fine, and I'm just going to click OK.
| | 02:48 | Up here, I'm going to save this file and
then just hit F12 to view it in the browser.
| | 02:55 | And suddenly the good sales here are
announcing themselves; they're way more obvious.
| | 03:01 | Okay, well that's a start.
| | 03:03 | Let's take on to the next level.
| | 03:05 | Let's do the counterpart of this.
| | 03:08 | I'm also going to format
where sales are doing badly.
| | 03:12 | So again, that will be a format
option which we'll apply somewhere in the
| | 03:16 | ytd_sales column, so I'll make sure to
be clicked in the column somewhere, and
| | 03:21 | I'm looking for a value less than 500.
| | 03:23 | Now, I don't have to find
one in SharePoint Designer.
| | 03:26 | I just need to click in one of the
values and then apply a conditional
| | 03:31 | formatting rule, which is to format the column.
| | 03:34 | Once again, we're checking the value of
ytd_sales, and I'm now interested in less than 500.
| | 03:40 | I can go ahead and click Set
Style, and in this case, I'll give it
| | 03:45 | a background color.
| | 03:48 | Well, that's a little bit too red here,
so I can type a hex value, or I can
| | 03:52 | click the color box here
which opens the More Colors panel.
| | 03:56 | I can even jump to the Custom Level
and make this one a little lighter.
| | 04:01 | Click OK, click OK, and OK.
| | 04:05 | Save this one, and F12 to preview it in
the browser, and not surprisingly, these
| | 04:12 | are announcing themselves.
They're a bit more obvious now.
| | 04:16 | But sometimes we might want to
have a different kind of behavior.
| | 04:19 | Let's say this particular entry here,
which is in the UNDECIDED category and has
| | 04:24 | no information there.
| | 04:25 | Well, perhaps I want to
highlight the entire row here.
| | 04:29 | Well, I can do that, too,
and it's done in a very similar fashion.
| | 04:33 | Again, making sure that I click back in here.
| | 04:35 | Again, I don't need to find that actual row.
| | 04:38 | It doesn't matter, and in fact, when
you're formatting a row, you just need to be
| | 04:42 | clicked anywhere, pretty much, in the web part.
| | 04:44 | So I'm going to come up to Conditional
Formatting, tell it to format the row, and
| | 04:50 | then describe the condition, which for
me is if the type is Equal to UNDECIDED.
| | 04:56 | Now this is case-insensitive, although
for my own purposes, I'm going to put it
| | 05:01 | all in uppercase because that's the way
it's written, and this is definitely an
| | 05:05 | Equals, not a Greater Than or a Less Than.
| | 05:07 | Now you might have seen the Advanced
button down at the bottom, and this is
| | 05:11 | really if you're into writing XPath
and XSLT rules, you can actually define a
| | 05:15 | lot more complex conditions.
| | 05:17 | Most of the time you don't need them
because the basic Equals, Contains, Less
| | 05:23 | Than, Greater Than will do just fine.
| | 05:25 | So, we'll jump on to Set Style.
| | 05:28 | I'm going to show a couple of things here.
| | 05:29 | I'm going to set the font and
I'll change the Font Style to Italic.
| | 05:35 | I'll set a background color
of let's do a pale gray here.
| | 05:40 | And I'll also set a border;
| | 05:43 | in fact, I'm going to pick
a fairly ugly border here.
| | 05:45 | Let's do a dashed border
style and a thick border width.
| | 05:50 | That looks very ugly.
| | 05:54 | We click OK. I'm going to click Save
over here, and F12 to open this up.
| | 06:00 | I'm doing that for a point, that my
formatting options here are working
| | 06:05 | correctly with this. And in italics, I've
got my background color, but the border
| | 06:09 | has been completely ignored in this fashion.
| | 06:12 | It's basically being overwritten by
something else that SharePoint is doing.
| | 06:15 | So not all of your styles will work.
And I find it really common that people
| | 06:20 | sometimes think it's their conditions
that aren't working properly when it's
| | 06:23 | actually their syles that aren't being applied.
| | 06:26 | So if you really want to check that
something is working, try changing the font
| | 06:30 | to italic or try changing the
background color before you worry whether it's a
| | 06:34 | background image or a border or a box
style that's not being applied properly.
| | 06:39 | If you want to edit and tweak your
conditions and say I go back into this page
| | 06:44 | and I don't know how to change them,
bear mind that in Conditional Formatting,
| | 06:48 | you'll find this option to Show the Task
Pane, and that will make this area over
| | 06:53 | here on the right pop up.
| | 06:55 | Each of these can be changed, although
they are in two different pieces, so if I
| | 06:59 | click one of them, you'll find that both
| | 07:01 | there's the Edit condition
and there's the Modify style.
| | 07:05 | So if I'm happy with the condition, I
can just go straight into Modify style
| | 07:09 | and I might as well get rid of that
border style and just set it back to
| | 07:15 | whatever it was before.
| | 07:17 | Click OK and Save.
| | Collapse this transcript |
| Hiding and showing conditional content| 00:01 | Another thing you can do with conditional
formatting is hiding and showing content.
| | 00:05 | Now, if you've clicked around a
little bit and you been playing with
| | 00:08 | conditional formatting, you may have
tried that dropdown box and found that Show
| | 00:12 | Content and Hide Content were grayed out.
| | 00:16 | That's because you actually have to have
something selected before they will show up.
| | 00:21 | So what does this do? Well, let's say for example
I want to point out when this royalty value is 20 or
| | 00:27 | above, but I don't want
to set a background color.
| | 00:30 | I would like to inject some extra text
or perhaps an icon, some kind of image.
| | 00:36 | I don't want to hide and show the royalty
value itself, at least not for my needs here.
| | 00:40 | So what I am going to do first is,
clicking in this column, I'm going to give
| | 00:44 | myself another column here, because it
likes to hide and show columns at a time.
| | 00:49 | So with this column selected, I am
jumping to my Table section of the ribbon.
| | 00:53 | I'm going to say Split Cells.
| | 00:55 | I'll tell it to split into columns.
| | 00:57 | What I'll see is I now have a
new column popping up there.
| | 01:02 | Another option that I could have done
there was insert a column to the right,
| | 01:06 | although those tend to be very small
and difficult to grab. I prefer this one.
| | 01:10 | So I am going to enter in say
three exclamation marks here.
| | 01:15 | I could also insert say an image that
I've got uploaded into SharePoint in my
| | 01:21 | site assets library,
| | 01:22 | but this will do for me.
| | 01:24 | Selecting that text, I am
just going to format it.
| | 01:27 | For ease of use, I am just going to
make it bold over here on the Home section
| | 01:31 | of the ribbon and make it red
and take the font up a little bit.
| | 01:36 | So I want these three exclamation points
to appear when the royalty is 20 or above.
| | 01:42 | So I am going to select that.
| | 01:44 | With them selected, on my Options
section of the ribbon, I should find that Show
| | 01:49 | and Hide Content are both available--
| | 01:51 | now, whatever way makes sense to you,
whether you want to apply the rules to
| | 01:55 | hide the content or do you want to apply
rules for when this content should be shown.
| | 01:59 | Let's say I'll do for showing the content.
| | 02:02 | I am going to say royalty is
greater than or equal to 20. Click OK.
| | 02:11 | And even in my preview, I can see that
it's disappeared there for the values of 10.
| | 02:16 | So I am going to hit Save and just test
this. Make sure that it works in the browser.
| | 02:24 | It seems to be working okay.
| | 02:25 | It's a little ugly, but it'll do the trick.
| | 02:27 | A very common thing that people do with
this is use it to display images because
| | 02:32 | instead of text here, I could have
just gone to my Insert tab and inserted a
| | 02:37 | picture and then chosen to hide
or show the picture for indicators.
| | 02:41 | So you can have the traffic lights or
bar graphs or exclamation mark icons;
| | 02:45 | it's up to you.
| | Collapse this transcript |
| Using formulas | 00:00 | So we've pulled a lot of data from a
lot of different sources, from XML files
| | 00:05 | and web services and from databases, both
as data sources and external content types.
| | 00:10 | And you've probably noticed quite a few
columns like this one, the price column
| | 00:14 | here, which isn't all that friendly to read.
| | 00:18 | It's bringing back 11.9500 when we'd
probably prefer to see $11.95.
| | 00:26 | And that's simply because this
data is being stored internally in the
| | 00:30 | database in this fashion, without
the dollar sign and with four positions
| | 00:34 | after the decimal point.
| | 00:35 | Now to apply formatting in this kind
of circumstance is one of the cases where
| | 00:41 | it really does make a difference
what kind of web part you have.
| | 00:45 | We have talked about the
XSLTListViewWebPart as being the most up to date,
| | 00:50 | the most modern view web
part in SharePoint 2010,
| | 00:52 | but this is actually not the
friendliest one when it comes to applying
| | 00:56 | formatting options like this.
| | 00:58 | In fact, if I switch over to an
older-style web part, if I look it in XML data
| | 01:03 | source here that's using the data form web part,
| | 01:06 | I have got a Price column over here, and
this is very, very easy to format as currency.
| | 01:12 | I simply select the value or mouse over
it till I see the extension glyph here,
| | 01:17 | click that, and I get this option to format
it as currency or a label or as a textbox.
| | 01:23 | I am going to format as currency.
| | 01:25 | It asks me a few questions
about what I want to do here.
| | 01:28 | I am just going to leave all the defaults.
| | 01:30 | I click OK, and I'm pretty
much done. I can save this.
| | 01:34 | I can test that.
| | 01:35 | I can even see here that we've got
the dollar sign in front of the number.
| | 01:40 | So it will be reasonable to expect that
in a more up-to-date web part like this
| | 01:44 | one I could do the same thing.
| | 01:46 | But no, that's not the case.
| | 01:48 | If I hover over price here and click
that little button, the only options I get
| | 01:53 | here are to Show List Item
Menu and Show Link To Item.
| | 01:58 | What's that all about?
| | 01:59 | Well, both of these check boxes are
simply about what happens when you view
| | 02:04 | this in the browser.
| | 02:05 | Let me show you what I mean.
| | 02:07 | If we see this first column here, this
title ID, if I use that same button, it
| | 02:12 | does have both of them checked.
| | 02:14 | And what it actually means is that when
I'm viewing this page, this title ID is
| | 02:20 | both a link to the individual item--close that--
| | 02:24 | and it's also the dropdown menu for
the different pieces of that item.
| | 02:30 | So that's not going to be relevant for us.
| | 02:32 | When we are working with price, we
don't want either of these things going on.
| | 02:37 | So I might select it and I might look
around the different parts of the menu,
| | 02:41 | see if there's any obvious ways to format
that is currency, and there really isn't.
| | 02:46 | In fact, when you're working with the
XSLTListViewWebPart, we have no choice
| | 02:51 | but to unfortunately use XSLT.
| | 02:54 | Now that's great if it's something
that's already part of your skill set; if
| | 02:57 | it's not, you may find it a
little intimidating to begin with.
| | 03:00 | So I am going to highlight this value, so
I get this XSL:value-of, and go up here
| | 03:06 | to the ribbon were I've got Formula.
| | 03:08 | Now there are a lot of options I
get here, but they're not the most
| | 03:12 | straightforward ones in the world.
| | 03:14 | These are all using
formulas that can be used in XSLT.
| | 03:18 | And for most people,
they are not that intuitive.
| | 03:21 | I can jump between different functions.
| | 03:23 | I can see that I have
average and max and min and random.
| | 03:27 | I have a group of
functions for working with text.
| | 03:30 | I have other functions for
working with date and time.
| | 03:33 | But most of them aren't
all that straightforward.
| | 03:36 | In fact, what we're looking at right
now up at the top is what's called
| | 03:39 | the XPath Expression.
| | 03:41 | And this rather unfriendly looking
piece of code is what's responsible for
| | 03:44 | getting the current value of the current column.
| | 03:48 | I need to keep that so I
can actually get the value,
| | 03:51 | but what I'm going to do is surround it
here with one of the functions from the
| | 03:56 | Math/Number area, which is format number.
| | 03:59 | Format number is a function that takes
a couple of arguments, so it's going to
| | 04:04 | open up with an opening parenthesis.
| | 04:07 | And the first thing I am going to pass
in is whatever the value would have been
| | 04:11 | anyway, then a comma,
and then I'm passing in a string
| | 04:15 | that's representing the way
that it should be formatted.
| | 04:20 | So I am going to use a dollar sign,
| | 04:22 | and then I am going to paste in a
few of the hash marks here that might
| | 04:26 | represent a large number.
| | 04:29 | The idea of the hash mark is, if
there is a number here, it will show up; if
| | 04:33 | there isn't, it won't even show up as a space.
| | 04:35 | That might sound a little odd, but
it makes sure that we are not getting a
| | 04:38 | lot of leading zeros.
| | 04:42 | And then a zero represents any number,
and if there is nothing there, it will
| | 04:47 | actually render out as a zero.
| | 04:49 | And I did say this wouldn't be the most
straightforward thing if you've never touched XPath or XSLT before.
| | 04:54 | But if I click OK, then we have
this back here in price, is formatting
| | 05:01 | correctly as currency.
| | 05:04 | We could do the same thing with
advance, again highlighting this value.
| | 05:08 | Moving up to Formula,
| | 05:10 | I'll see exactly the same thing here.
| | 05:12 | I could have actually copied and pasted
the exact same formula that I had before,
| | 05:23 | but I'll just write it in
again here and click OK.
| | 05:29 | And here I see the advance
being formatted correctly this way.
| | 05:32 | Now the reason I used zeroes at the end
instead of the hash marks is for this kind of case
| | 05:39 | where if there wasn't actually a value
here or a value of zero, this is the way
| | 05:43 | I would like to see it written out, rather
than just a dollar sign and a decimal point.
| | 05:48 | Creating formulas in XSLT is extremely
powerful and will allow you to do pretty
| | 05:55 | much anything you can think of.
| | 05:56 | But there's certainly a
fairly steep learning curve to it.
| | Collapse this transcript |
| Getting started with custom XSLT/XPath| 00:00 | Much of SharePoint behind the scenes
is using XSLT or eXtensible Stylesheet
| | 00:05 | Language Transformation.
| | 00:08 | This is an XML-based language, and
along with something called XPath, it allows
| | 00:12 | you to describe transformations to
data, from something as simple as take this
| | 00:17 | unformatted number and format it as
currency, or format it as currency and color it
| | 00:23 | green and make it italic, to complex
conditions describing not just a single
| | 00:27 | field, but the complete structure of
entire pages, including thousands of lines
| | 00:31 | of HTML and JavaScript.
| | 00:33 | Now, I am not going to try and teach
you XSLT in this course in the same way I
| | 00:38 | wouldn't try and teach you SQL
or HTML or ASP.NET in this course.
| | 00:42 | If you're interested in learning more
about it, you can find both XSLT and XPath
| | 00:47 | in the lynda.com XML Essential Training course.
| | 00:51 | But here's the thing, regardless of
if you want to dive into it, you've
| | 00:54 | been doing it already.
| | 00:55 | You are already using XSLT in SharePoint.
| | 00:59 | On the pages where I have been
setting up conditional formatting to color
| | 01:03 | backgrounds or hide and show content,
well these are actually doing XSLT rules.
| | 01:09 | If I switch into the Code view of this
page and start to look through it, what I
| | 01:14 | will see are these blocks of tags.
This is XSLT. And for example on line 240 here,
| | 01:21 | this is the XSLT to test that if the
value of ytd_sales is greater than 5,000--
| | 01:29 | then I am going to drag it a little to
the right here--the background color is
| | 01:33 | going to be set to this color.
| | 01:35 | Now, if you're a web developer and good
with HTML, you might be tempted to jump
| | 01:39 | in and experiment with changing this
code, and that's a great attitude, but
| | 01:42 | here's something to be aware of.
| | 01:44 | In HTML, if you forget to close a tag
properly, or are a little sloppy with your
| | 01:49 | code, things just still likely to work, because
HTML is a very forgiving language. XSLT is not.
| | 01:57 | Small typos can have an immediate impact
that will stop your page from working at all.
| | 02:02 | So if you do choose to dive into it,
I would suggest that you go to the
| | 02:07 | library that your pages are in--say you
are playing around with site pages--and
| | 02:11 | you make sure that the settings of
the library are set to create a version
| | 02:15 | each time to edit an item.
| | 02:17 | You can do this either in
SharePoint Designer or through the browser.
| | 02:21 | You can then always revert to a
previous version if things go wrong.
| | 02:26 | Now, if you are an XSLT enthusiast or
expert already, then you can go to town
| | 02:32 | editing the templates that SharePoint
gives you. And yes, any change that I
| | 02:36 | make to an XSLTListViewWebPart by
applying conditional formatting or hiding
| | 02:42 | and showing content is going to enter
some XSLT in the background in the code
| | 02:47 | that I can edit myself.
| | 02:48 | But that's not always it, and it's not
always obvious how to get started with XSLT.
| | 02:54 | So really, here is the four
options for experimenting with this.
| | 02:58 | Option number one is you stay in Design
mode and you do everything through there.
| | 03:03 | You use the ribbon to affect the
changes that you are going to do.
| | 03:08 | Option two is for individual pieces.
You start to work with the Formula section
| | 03:13 | of the ribbon and this is a controlled
way of applying some XSLT options with
| | 03:19 | less danger of breaking the code.
| | 03:23 | Now, option three would be, what if
you want to jump into the actual behind-
| | 03:27 | the-scenes code itself?
| | 03:28 | You want to switch to Code view and
you want to stop playing around in here.
| | 03:32 | So let me jump across to site
pages and create a brand-new page.
| | 03:37 | I am going to call it XSLT example.
| | 03:43 | The reason I am doing this is just to
put on this page an out-of-the-box
| | 03:48 | XSLTListViewWebPart with no customization,
no conditional formatting, nothing done.
| | 03:54 | Now, it doesn't really matter when I
insert this, what I am inserting it from.
| | 03:59 | Do bear in mind that the
XSLTListViewWebPart is going to be the one that's
| | 04:03 | chosen for either included SharePoint
lists and libraries or for external lists.
| | 04:10 | If I was using database connections,
they'd be using the data form web part which
| | 04:15 | does itself use XSLT, but not as much.
| | 04:19 | So let me click that
external list, Titles on Pubs.
| | 04:23 | It thinks about it.
| | 04:24 | It inserts the web part. Okay, great. So what?
| | 04:27 | If I switch to Code view here, what I will see
is the entire page has about 108 lines of tags.
| | 04:36 | If you're an HTML person, you think well,
that's not really a lot. In fact, you'd
| | 04:39 | start to look at some of this and think,
"I could probably play around with this.
| | 04:42 | I could probably edit this."
| | 04:44 | In fact, the stuff that's actually
highlighted in yellow you're going to leave
| | 04:47 | completely alone anyway because that's
nothing to do with what we want to edit.
| | 04:52 | So the question is, how does
100 lines of HTML create this?
| | 04:56 | Well, it really doesn't.
| | 04:58 | Here's what's happening.
| | 04:59 | There's much more to it going on than this.
| | 05:01 | You see, because this is a completely
uncustomized XSLTListViewWebPart,
| | 05:06 | SharePoint is just going behind the
scenes and using a much bigger default XSLT
| | 05:12 | file to handle most of the processing,
but I can choose to customize it piece by piece.
| | 05:18 | So let's say I wanted to
customize a particular item.
| | 05:21 | I am going to highlight say this pub_id here.
| | 05:25 | Well, the best way to get started is I
go to the Design section of the ribbon.
| | 05:29 | Now, bear with me here. What I am
going to do is not change one of these, but
| | 05:33 | over here I have a dropdown action
that allows me to Customize XSLT, and I have
| | 05:39 | two choices here: Customize
Entire View or Customize Item.
| | 05:44 | Now, let's say we start small,
so I click Customize Item.
| | 05:48 | It doesn't make any obvious change
to the Design view, but I am going to
| | 05:53 | switch to the Code view.
| | 05:54 | If you remember my code had about 108
lines in it. Well, now it has about 142,
| | 06:01 | because what it's done is it's inserted
the part of the template that deals with
| | 06:07 | just this particular item, just this
particular piece. And if you do have a bit
| | 06:12 | of familiarity with XSLT, this is how
you might get started here, and how you
| | 06:16 | might start to experiment. But it
can get a little deeper than this.
| | 06:20 | Let's say for example if I switch back
into Design view and this is where I go
| | 06:24 | to select the option to customize XSLT
and tell SharePoint yes, I want to do it,
| | 06:30 | another option that we have is
to customize the entire view.
| | 06:34 | Now, what this is effectively doing is
copying all of the behind-the-scenes XSLT
| | 06:39 | that's being used by this
web part so we can edit all of it.
| | 06:42 | It might sound like a good place to get
started, but to be warned. I am clicking
| | 06:46 | that button, and you see absolutely no
difference in the Design view of the
| | 06:50 | page. But if I go and switch back to
the Code view, I now find I have 4,200
| | 06:57 | lines of code here instead of the 108
I had a few minutes ago, and this is
| | 07:03 | absolutely full of XSLT and XPath
and HTML that's actually processing
| | 07:10 | everything that's going on here.
| | 07:11 | There's even a bunch of JavaScript in there, too.
| | 07:14 | Now, what if I did that by accident?
| | 07:16 | What if I am thinking well, I really
don't want 4,200 lines of code here?
| | 07:20 | I can switch back to the Design mode,
highlight that web part, make sure I've
| | 07:24 | grabbed it, and then in the ribbon, I am
going to go to Design. But instead of
| | 07:30 | clicking Customize XSLT, I will say
Revert XSLT, and because I didn't make any
| | 07:35 | changes, I am going to revert the entire view.
| | 07:39 | Do be careful if you've done anything
like conditional formatting because all of
| | 07:43 | that would be ripped out if you revert the view.
| | 07:46 | I click Yes. Again, no change visibly
here, but if I go back to the code,
| | 07:52 | we're back to the minimum amount of XSLT and
my 108 lines of content instead of the 4,200.
| | 08:00 | So that's really the
journey of going through this.
| | 08:03 | You are going to start by doing
everything in Design mode, and there's a lot of
| | 08:07 | stuff you can do there.
| | 08:08 | We then jump into starting with formulas.
| | 08:11 | We can then jump into customizing the
XSLT for items and then jumping into
| | 08:16 | customizing the XSLT for entire views.
| | 08:19 | Now, XSLT is the way that you do very
deep customization inside SharePoint, but
| | 08:24 | it can be fragile, and the
learning curve is deep for beginners.
| | 08:28 | So if you are new to this, I would
suggest first getting really good at the
| | 08:31 | options you will find in SharePoint
Designer first, and only then jump into
| | 08:34 | formulas and custom templates.
| | Collapse this transcript |
|
|
6. Creating Custom FormsCreating custom forms for lists and external lists| 00:00 | Up to this point, we've mainly been
focusing on displaying data from an external
| | 00:05 | source, whether that's an XML file,
a database data source, multiple data
| | 00:10 | sources together, or an external content type.
| | 00:13 | Well, now, it comes time to talk about
getting it from SharePoint back into an
| | 00:18 | external source of data.
| | 00:20 | However, a word of warning before we
begin: many external systems will not be
| | 00:24 | friendly to the idea of you using
SharePoint pages to create or edit data.
| | 00:29 | Often those existing applications do
auditing and logging of any changes to the data.
| | 00:34 | You can't just reach into
the database and change it.
| | 00:37 | There may be too many dependencies and
relationships as well to allow you to
| | 00:41 | just create a new item
and have it magically work.
| | 00:44 | But once again, we're actually in a
situation where it's more about the demands
| | 00:49 | of your external system
than it is about SharePoint.
| | 00:53 | But to get back into this, we have to
get back to talking about views and forms.
| | 00:57 | Now just to recap, if I pick a regular
SharePoint list or library--I am picking
| | 01:02 | the task list here--we will get at
least one page to show a view of the list,
| | 01:07 | and then we will get three form pages:
one that can display a single item, a
| | 01:14 | different page that will allow me to
edit the item, and yet another page that
| | 01:20 | would allow me to create a new item.
| | 01:22 | Now the way I am going through this
in the browser, these are popping up as
| | 01:27 | modal windows with a dark background,
but they are considered separate pages
| | 01:31 | and can be edited independently.
| | 01:33 | In fact, you can get to
them even in the browser.
| | 01:36 | If I go to the List section of the
ribbon on any list, library, or external list,
| | 01:42 | I will find a Customize List section here
which has a button called Modify Form Web Parts.
| | 01:47 | You may find it larger or smaller,
depending on how wide your browser is.
| | 01:53 | This would let you drill down into
the Default New Item Form or the Default
| | 01:58 | Display Form or the Default Edit Form.
And if you click one of those, then in the
| | 02:02 | browser you can do a little bit of
basic editing. It won't let you change these
| | 02:07 | fields, but it would let you rename
the web part or say add a new content web
| | 02:12 | part to put some explanatory text in here.
| | 02:14 | Now, I am going to click Stop Editing
here because there's really not much I
| | 02:18 | can do through the browser,
although it is accessible there.
| | 02:23 | And if I switch over to SharePoint
Designer, what I can do is drill down into
| | 02:27 | that list and libraries and see
the equivalent from this perspective.
| | 02:31 | I was looking at the task library in
the browser, and I'll look at the task list
| | 02:34 | here, where I will see several
view pages and three form pages.
| | 02:40 | I see several view pages because the
task list has several views by default,
| | 02:45 | but we are interested in
the three form pages here:
| | 02:49 | NewForm, EditForm, DispForm, to create a
new item, edit an item, or display an item.
| | 02:54 | Now, what you will find is this is
exactly the same for external lists too.
| | 03:01 | If I jump to my external list that I
have defined on an external content type,
| | 03:05 | I have my one view page which we've been focused
on up till now, and I have my three form pages.
| | 03:12 | However, if I define my external
content type only with Read and Read List
| | 03:17 | operations, SharePoint would be smart
enough not to generate a new NewForm.aspx
| | 03:22 | or an EditForm.aspx.
| | 03:25 | But I can't do further
editing through SharePoint Designer.
| | 03:28 | I am going to open the NewForm.aspx
here, and I can see that we're back to the
| | 03:34 | idea of having a web part--
| | 03:36 | in this case, it's the XSLTListFormWebPart.
| | 03:39 | But just selecting and looking up on
the ribbon, I can immediately see that I
| | 03:43 | have nowhere near the amount of options
that I have when I am looking at a view
| | 03:48 | perspective of multiple
entries at the same time.
| | 03:52 | And essentially, right now I cannot even click in
a particular section the way I can with a view.
| | 03:58 | I would be limited to clicking
underneath it and perhaps just adding some
| | 04:03 | explanatory text here.
| | 04:06 | This web part really is a fairly big
uncustomizable chunk. Even the options up
| | 04:11 | here on the ribbon are standard web
part options, just like the title, and
| | 04:16 | whether I allow this to be minimized or closed.
| | 04:20 | So I can't even add a little bit of text
beside the title or the type or the pub_id.
| | 04:26 | However, I can replace this web part
with something that looks identical but is
| | 04:30 | more customizable, and here's how you do it.
| | 04:32 | So I am going to grab the web part and
hit Delete and then go up to my Insert
| | 04:37 | section, but instead of adding a data
view that we've been doing quite a lot, I
| | 04:41 | am going to come to the new item form.
| | 04:46 | Now, it won't actually show me my
external list right now. That's okay.
| | 04:48 | I am going to come down to Custom List
Form and just select that one, and here,
| | 04:53 | I get a choice of more data sources.
And again, all external lists are
| | 04:57 | considered data sources, and this is what
I am looking for is Titles on Pubs, and
| | 05:02 | yes, we want to create a
new item form, and click OK.
| | 05:06 | Now that didn't appear to do very much
different. This looks identical to the
| | 05:11 | one I had a few seconds ago, but this
time around I can actually jump into it.
| | 05:16 | I can start to say add some extra
text beside the title or the type that
| | 05:21 | explains what the choices are.
| | 05:23 | However, if you are concerned about
customizing this web part and you're worried
| | 05:27 | about messing things up,
well here's what you can do.
| | 05:30 | I am going to revert back to what we
have before. In fact, because I have made
| | 05:33 | some changes and I haven't saved them,
all I am going to do is come out of this
| | 05:36 | page and say I don't want to save my changes.
| | 05:39 | To allow me to experiment, I am
going to create another entry page.
| | 05:45 | So I have gone back into my Lists and
Libraries section and into this external
| | 05:48 | list page, and down here in the Form
section, I am going to make a new form.
| | 05:53 | I will call it NewForm2.aspx;
it is a new item form.
| | 05:59 | I will leave this box unchecked to set
as the default form for the selected type.
| | 06:04 | So we'll still be using the old one.
| | 06:06 | I can just edit this and experiment with
it and play around with it for a while.
| | 06:11 | So NewForm2.aspx is there.
| | 06:13 | Now if I open that one, the way the web
part has been added to this page is it
| | 06:18 | is immediately editable.
| | 06:21 | So I can actually click in and start to
type some extra text or move things around.
| | 06:25 | For example, I know that with pubdate
at the end here, this actually has a
| | 06:29 | default value in the database,
| | 06:31 | so perhaps I don't want to have an entry here.
| | 06:34 | I am actually going to delete that,
and then I am going to hit Save and F12 to
| | 06:42 | open it up in the browser.
| | 06:43 | Now, SharePoint is going to do its
best to recognize required fields in an
| | 06:48 | external content type and display them
as such, which is why these three first
| | 06:53 | fields are marked with a red asterisk,
which means they are required. But I
| | 06:58 | could start typing things here for
say the title_id and the title and the
| | 07:03 | type, even making my best guess as to what
those means. But say we come down to pub_id.
| | 07:08 | Now, this is the publisher ID, and
this is really just a link to a different
| | 07:14 | table of data in the database.
| | 07:16 | Now, I can see that I am not getting an
automatic dropdown box or some kind of
| | 07:21 | lookup table here for references to
another source of information, because after
| | 07:26 | all, SharePoint right now
doesn't know about that relationship.
| | 07:30 | That relationship might be defined in
the database, but the only thing we ever
| | 07:33 | told SharePoint about was this titles table.
| | 07:37 | Now, we can tell SharePoint about a
relationship, as we'll see in a minute, and we
| | 07:42 | can have a much better-generated form.
| | 07:45 | But we could experiment with this form
for a while. When we were done with it,
| | 07:50 | and we finished with it, and we wanted
to make this one the default, we would go
| | 07:54 | back to our main page for this list or
library and then just select that form.
| | 07:59 | And I am actually clicking the row here,
not clicking the name itself, which
| | 08:03 | would jump into that, just highlighting
it, and then I can move up here on the
| | 08:07 | ribbon and say Set as Default, and that
would be the default form for a new item.
| | 08:13 | But after a while, you will
unfortunately find out that this particular web part
| | 08:17 | to display a single item is not really
all that friendly to being customized
| | 08:22 | that much, and if you want to go deeper,
InfoPath will be your best choice, and
| | 08:27 | we'll explore that in a few minutes.
| | Collapse this transcript |
| Creating custom forms for data sources| 00:00 | Unfortunately, when it comes to
working with data sources, such as XML files,
| | 00:06 | SOAP services, RSS, or REST services,
you're more limited to the forms you can
| | 00:11 | create and customize.
| | 00:13 | You are pretty much stuck with the
standard New Item, Edit Item, and Display
| | 00:16 | Item Forms, rather than groovy InfoPath content.
| | 00:20 | To do this, you're going to simply
create a new page in your Site Pages library.
| | 00:25 | Let's say I'll create one here
and call this northwindEntry.aspx.
| | 00:33 | I am going to make this an Add Item
Form for the Northwind products table.
| | 00:39 | I jump into it and click Edit.
Nothing is automatic about this.
| | 00:42 | This page has not been automatically
generated, but clicking here in the
| | 00:46 | placeholder, I can then jump up here to
the Insert tab and I have my choices of
| | 00:51 | New Item Form, Edit Item
Form, and Display Item Form.
| | 00:55 | I am picking New Item here.
| | 00:57 | I'll come down to Products on Northwind.
| | 01:01 | This is a regular database data
source connection rather than an
| | 01:05 | external content type.
| | 01:06 | Now, it's taken a guess here and
it's not added all of those fields.
| | 01:11 | It's just added these first five.
| | 01:15 | If I wanted something different, I
would delete this data form web part, then
| | 01:19 | come over to my Data Source details,
select the fields I was interested in
| | 01:24 | adding, and then choose to
insert them as a new item form.
| | 01:28 | I don't need to do that right now.
| | 01:30 | This one is fine for me.
| | 01:31 | In fact, I know that product ID is
generated automatically when a new item is
| | 01:37 | added to this table,
| | 01:38 | so I am actually just going to select
this row and delete it because we don't
| | 01:42 | need to be attempting to enter in a product ID.
| | 01:46 | I could then save this and just hit
F12 to open it up, and very bland as it is,
| | 01:53 | we could add some new
information here about a new product.
| | 01:56 | Let's say I know that there is a
SupplierID 1 and a CategoryID of 1, and let's
| | 02:02 | say this comes in quantity per unit of 12.
| | 02:05 | I hit Save, and it will be
writing back to the Northwind database.
| | 02:09 | As you can see, this is a fairly bland
interface and unfortunately, there aren't
| | 02:14 | a lot of customization
options here for data sources.
| | 02:17 | And unless you want to get into the
XSLT, most of what you can do here is
| | 02:21 | limited to informational text. Even the
fact that I can highlight this web part
| | 02:26 | and see a bunch of options up here
doesn't really make much sense during
| | 02:32 | sorting and grouping and filtering or
even conditional formatting when it's just
| | 02:36 | a single-item entry at a time.
| | Collapse this transcript |
| Creating associations in Business Connectivity Services| 00:00 | Very often the external data that
you're working with has a dependency on
| | 00:04 | something else, a relationship to
something else on that external system.
| | 00:09 | For example, I am viewing some
information here about titles.
| | 00:12 | This is coming from an external content
type, and I see that I have a pub_id column.
| | 00:18 | This is really just a reference, a relationship
to a publisher's table on that same database.
| | 00:26 | This isn't all that important when
we're just reading some of this data, but
| | 00:30 | when we're inserting
information, it's doubly important.
| | 00:33 | We really need to understand
more about what this means.
| | 00:37 | If I'm entering a new item here, I need
to know what pub_id to put. And if I get
| | 00:44 | this wrong, the database won't even
let me insert it, based on the internal
| | 00:48 | rules of the database.
| | 00:49 | Now, while that relationship might be
defined in the database itself, we haven't
| | 00:55 | told SharePoint about it, and SharePoint
will not automatically understand that
| | 00:58 | relationship until we tell it to.
| | 01:00 | So here's how we do this.
| | 01:01 | I am going to jump over here to my
External Content Types, which is where I have
| | 01:06 | my connection to the Titles table defined.
| | 01:10 | Well, the relationship in the
database is between the Titles table and
| | 01:14 | the Publishers table,
| | 01:15 | so what I'm going to do is add
another external content type here.
| | 01:19 | This one will be called Publishers.
| | 01:21 | I am leaving everything else as I left
it when we first defined our first BCS
| | 01:28 | external content type, and now I am
going to click the link for external system.
| | 01:33 | Because I've defined a connection to
that database, it already exists here.
| | 01:38 | I can see the pubs database
in my Data Source Explorer.
| | 01:42 | What I am going to do is expand Tables,
and I know that what I'm interested is
| | 01:46 | here, this Publishers section.
| | 01:49 | I could right-click and choose to
create all operations for reading,
| | 01:54 | writing, updating, deleting.
| | 01:57 | Let's say I know that I just
want to use this as a lookup,
| | 02:00 | so I am going to create the two most
basic operations that we always need, which
| | 02:05 | is Read Item and Read List. And if you
forget that, it will even tell you over
| | 02:10 | here that you can't save that content
type without Read Item and Read List.
| | 02:14 | I am just going to click
next through the Read Item.
| | 02:18 | I have a fairly simple database here, so
I am not paying too much more attention
| | 02:23 | to that. And then I'm going to right-
click and say Read List Operation.
| | 02:28 | This means if I made an external List
based on this external content type, I
| | 02:33 | would not automatically have the pages
generated to add or edit anything on it.
| | 02:38 | I am going to click Finish,
and then I'll hit Save.
| | 02:43 | I now have two external content
types defined, but there's still no
| | 02:48 | relationship between the two.
| | 02:50 | Well, what that's called in BCS is an
association, and the way that I create it
| | 02:55 | is go into the child, if
you think about it this way.
| | 02:58 | I'm going into the Titles section,
where we could have many titles for one
| | 03:04 | publisher. And although this has
already been defined with all the operations
| | 03:09 | for it, I need to switch into the
Operations Design view up here on the ribbon,
| | 03:15 | and what I'm going to do is say, I am
going from titles to publishers, so I am
| | 03:19 | going to right-click
Publishers and create a new association.
| | 03:24 | I am getting a warning down here that I
must select a related external content
| | 03:30 | type to associate with the current
external content type. Okay, fine.
| | 03:33 | I have got the button called Browse up
here, which tells me I am currently in
| | 03:37 | the Book Titles content type, and the
one I want to connect to is of course,
| | 03:40 | Publishers. Click OK.
| | 03:43 | I check here that they're trying to match up
on pub_id, which is what I want them to do.
| | 03:47 | So I am going to click Next, and it's
asking, what will be defined as input
| | 03:52 | to the association?
| | 03:54 | And the warning saying select the data
source element that represents pub_id.
| | 03:58 | Well, it is pub_id, so I'd check
the box to say Map to Identifier.
| | 04:02 | I am just going to ignore this warning right
now because I know this one works just fine.
| | 04:06 | I don't need to do any filtering.
And then it's asking, what gets returned
| | 04:11 | from this association?
| | 04:12 | If I have a pub_id, do I need
all the other bits of information?
| | 04:16 | And I'm going to say yes. Really, I don't.
| | 04:18 | I could uncheck city, state,
and country, and just say if I have pub_id, I am
| | 04:22 | really just interested in the name,
but I will leave that all as is.
| | 04:26 | The only thing I do need to select is
say the pub_id is the important one here.
| | 04:29 | So I am checking that Map to
Identifier box, and click Finish.
| | 04:35 | Then that defines me the association.
| | 04:38 | I am going to click the Save button
here to save it back into SharePoint, and
| | 04:41 | it's the equivalent all creating a
relationship in a database, but we're
| | 04:45 | creating an association in
business connectivity services.
| | 04:49 | Now, the question is, so what?
| | 04:53 | Well, here's the difference.
| | 04:55 | I am going to go back
into the browser right now.
| | 04:58 | I'm going to show you what I
would have gotten a minute ago.
| | 05:02 | I'm using this external list, Titles on
Pubs, which was created a while ago, and
| | 05:08 | if I go to the List tools and I say
I want to make a new item, I get this
| | 05:13 | standard entry with that issue with
pub_id, that we better know exactly what
| | 05:18 | digits to type in here, even
if they are not obvious. Okay.
| | 05:22 | So what I'm going to do is go
back into SharePoint Designer.
| | 05:26 | I'm going to jump into that
external list, and I'm going to delete it.
| | 05:30 | Now, I am not deleting the external
content type, what I'm deleting is the list
| | 05:34 | based on the content type.
| | 05:36 | That doesn't delete any data;
| | 05:38 | it's just the List Pages themselves.
| | 05:41 | Now, if I had customization,
conditional formatting on my views, I would lose
| | 05:45 | all of it right now.
| | 05:47 | But I know that anything I did I
can get back in just a few minutes.
| | 05:50 | So I am going to re-create that
external list from Book Titles and give it
| | 05:55 | exactly the same name, but because now
this list was defined with an association
| | 06:03 | to another content type, we're going
to get something slightly different.
| | 06:06 | If I jump back into the web
site--and I'll just refresh this--
| | 06:12 | it looks exactly the same.
| | 06:13 | I have the List Titles on pubs because I
gave it the same name, and this looks identical.
| | 06:18 | But now I am going to come
to Items and click New Item.
| | 06:22 | It looks similar till we get to pub_id,
which is missing from here. But down in
| | 06:28 | this section, we see Publishers,
and I have the link automatically being
| | 06:33 | generated based on the association.
| | 06:36 | So I could create a title ID of
AB1234, Some new book, Type is Business,
| | 06:44 | Price is 12.99 let's say.
| | 06:46 | I'll leave the rest as is.
| | 06:48 | I could even select the Publication Date,
the 6th of April, and then I have an
| | 06:53 | external item picker.
| | 06:55 | What it allows me to do is click this
Select External Items box and it pops
| | 07:00 | up looking for all my publishers. In this case I
want Ramona Publishers, which is 1756. Click OK.
| | 07:08 | It then copies that ID back into my
Titles section and I can click Save, and
| | 07:15 | I've added that new title
linking to that pub_id correctly.
| | 07:18 | So yes, it did require me to blow away
and recreate my external list to get
| | 07:23 | that new page happening automatically,
but this is a great reason to really
| | 07:27 | consider your sources of external data
and figure out all the external content
| | 07:31 | types required before you start
creating your lists and customizing your pages.
| | Collapse this transcript |
| Creating custom forms with InfoPath 2010| 00:00 | When working with SharePoint lists
or libraries--and that includes external
| | 00:04 | lists from external content types--we
have the option of replacing our default
| | 00:09 | HTML-based forms with
InfoPath-based forms, which gives you a much more
| | 00:13 | customizable entry and display screen.
| | 00:16 | We will still be using web pages;
| | 00:17 | we're just embedding some InfoPath inside them.
| | 00:20 | And one thing a lot of people are worried
about is, what does that mean for our end user?
| | 00:25 | Well, really nothing.
| | 00:25 | The end user does not need InfoPath
installed on their machine to use those
| | 00:31 | pages, but you will need
InfoPath 2010 to edit them.
| | 00:34 | So, here's how you do it.
| | 00:36 | I am going to start off by
showing an example with one of the
| | 00:39 | built-in SharePoint lists.
| | 00:41 | I will pick say the Announcements list,
and we will see here the classic one
| | 00:46 | view and three entry forms.
| | 00:48 | Well, up on the ribbon here, I have got
a Design Forms in InfoPath button, which
| | 00:53 | always gives me a dropdown
with typically one option.
| | 00:56 | I need to click that one option for
Announcement here. And then what's it's
| | 01:00 | doing is it's opening up InfoPath and
converting that web-based form into an InfoPath form.
| | 01:07 | It starts off by looking fairly similar
to the web-based version, but the point
| | 01:12 | of InfoPath is we can go to town on this.
| | 01:14 | We can do a lot more to it.
| | 01:16 | We can start affecting the page design;
| | 01:18 | there is a bunch of page layout templates
and themes that we can apply quite quickly.
| | 01:24 | We can insert richer tables than we
have the option of doing in SharePoint
| | 01:28 | Designer quite a lot of the time.
| | 01:29 | And we can apply rules to that content.
| | 01:33 | Now, I am not going to change this
one because I am going to do this on an
| | 01:37 | external list in just a moment.
| | 01:39 | But the most important button that you
have after you are done editing this
| | 01:44 | in InfoPath is the Quick Publish button
that's up on the top-left of the InfoPath 2010.
| | 01:51 | This essentially takes it from your
desktop back up into SharePoint and says,
| | 01:55 | okay, open the SharePoint list in
the browser and now we are back to the
| | 01:59 | Announcements list. But if I want to
add a new announcement, I've still got the
| | 02:02 | modal window, but I can kind of
tell that it's not HTML anymore.
| | 02:06 | It's this InfoPath mode internally.
| | 02:16 | And we have exactly the same model if
we are working with an external list.
| | 02:20 | So I am going to click back on my
List and Libraries, find my external list,
| | 02:23 | which is Titles on Pubs, and then come
up and click the Design Forms in InfoPath
| | 02:29 | button selecting Item,
which is the only option here.
| | 02:33 | It thinks about it for a second.
| | 02:35 | This is a bit more complex data, so it
might take a few more moments to read all
| | 02:39 | the data from the server, and
then it opens up that form in InfoPath.
| | 02:45 | We can decide to come in and say give
it a title, select that, use the elements
| | 02:53 | of the ribbon to change the style.
| | 02:56 | I could add obviously
some informational text here,
| | 02:59 | but the title_id should be in the
format two letters and four numbers.
| | 03:07 | Select that text and just use the
ribbon to make it a little smaller.
| | 03:14 | Come down, title looks okay, and we hit type.
| | 03:17 | Now type is the category of the book,
as this particular database is defined,
| | 03:22 | things like business, psychology,
popular computing, and so on.
| | 03:26 | So I can type that in directly,
but it would be nice if we had say a
| | 03:29 | dropdown list here.
| | 03:31 | So what I'm going to do is right-click
the Type field and select to change the
| | 03:36 | control to--well, I have Drop-Down
List Box, but I am going to pick Combo Box.
| | 03:40 | A combo box is a control.
| | 03:42 | It's quite difficult to implement on
the web, but it works just fine here.
| | 03:46 | It allows me to have a bunch of values
to select from and still have the option
| | 03:50 | to type my own value if
I don't like any of them.
| | 03:53 | Well, with that selected, I
need to give it a few values.
| | 03:57 | I can either select it and come up to
my control tools on the ribbon, or I can
| | 04:01 | double-click it which would
take me to the same place.
| | 04:04 | Then I have an Edit Choices button.
| | 04:06 | Now while this combo box does give me
the options of entering choices manually,
| | 04:11 | and then I have this very tempting
Get choices from an external data source,
| | 04:15 | I will let you know that when you are
creating InfoPath forms for external
| | 04:18 | content types, it's not very fond of
external data sources and really will do
| | 04:23 | its best to not let you have that.
| | 04:25 | So I am just going enter a
few choices manually here.
| | 04:28 | First one will be Business.
| | 04:33 | I will click Add again.
| | 04:36 | Psychology, and then
another one was Popular_Comp.
| | 04:42 | I'll leave it at that because of
course a manual value can be typed.
| | 04:49 | I come down to pub_id, and I can tell that
I have the pickers here for external data.
| | 04:55 | That's because I have described the
association between this external content
| | 05:00 | type and the publisher's external content type.
| | 05:03 | So we are good here.
| | 05:04 | Coming down to price, well let's
show an example of the equivalent of
| | 05:08 | conditional formatting here,
which can be done even on the way in.
| | 05:12 | I am going to select Price and
come up to the Add Rules section.
| | 05:16 | I get several rules to choose from,
if This Field Changes, if it's Between
| | 05:20 | certain values, if it's Greater Than, Less Than.
| | 05:22 | Well, let's say if this price is Less Than a
certain amount, I want to format it as Good.
| | 05:28 | So first I choose what I want to do,
and then it says okay, what is the rule?
| | 05:33 | I will say price if less than 20.
| | 05:35 | Click OK and then jump down to advance and
let's say we will do the flip side of this rule.
| | 05:40 | If advance is greater than, we want
to make it Bad, and let's say if it's
| | 05:44 | greater than 20,000. Now, these rules
will be applied as we're typing.
| | 05:49 | If we type into price and hit Tab out of
it, we will actually get the rule applied.
| | 05:54 | You can have multiple rules on the same
field, so you could have price showing
| | 05:58 | up in green or neutral or
red. Same with advance.
| | 06:02 | I am just applying one to each.
| | 06:03 | Coming down to notes here,
| | 06:05 | well, I would like that to be a bit more room,
| | 06:06 | so I am just going to drag the cell of
the table beneath it and drag it a little
| | 06:11 | wider--very easy to do this in InfoPath.
| | 06:15 | And then come down to pubdate.
| | 06:17 | Let's say I know that putdate is
actually going to have a default value when
| | 06:20 | it's inserted into the database, so I am just
going to strip that right out and hit Delete.
| | 06:24 | I am sure I could play around a little more.
| | 06:28 | I could start to work with
themes and other designs and so on.
| | 06:33 | But I am going to leave it at that
and click my Quick Publish button.
| | 06:39 | Now what might happen here is it
might ask me to save. Yes, it does.
| | 06:43 | This from template must be
saved before it can be published.
| | 06:45 | And this is actually giving me the
option of saving it to my own Documents
| | 06:49 | library, so I have my own copy here.
| | 06:51 | I will call it bookTitle.xsn.
| | 06:55 | However, that's just saving me a local
copy so it can then persist and push it
| | 06:59 | back up into SharePoint, which is what
it's doing now, and it's telling me that my
| | 07:03 | form template was published successfully.
| | 07:06 | I'll open that up in the browser, and we
have this nice InfoPath from Book Title,
| | 07:11 | title_id should be in format xx0000.
| | 07:14 | I start typing and now
unfortunately, I have a problem here.
| | 07:18 | Now, this is quite common.
| | 07:19 | See, InfoPath will often make the guess
that the ID, the identifier of a database,
| | 07:25 | will be automatically generated
so it should be Read-Only and that's
| | 07:28 | what's happening here.
| | 07:29 | Let me just close down my
browser. Close those tabs.
| | 07:32 | Go back in because I still have it
opened in InfoPath, and if I select that field,
| | 07:37 | I guess it will be, yes indeed,
clicking on control tools, tell me that it's
| | 07:41 | selected as Read-Only.
| | 07:42 | I just need to turn that check box off
and open it up in the browser, and now
| | 07:48 | let's give it a title_id of AA5432.
| | 07:52 | Title is Data Driven SharePoint.
| | 07:56 | You can even have spelling and auto
correction on your fields from an InfoPath form.
| | 08:02 | As I mouse over, this is saying the
type cannot be blank, but if I drop down,
| | 08:06 | I've got the ability to
select the Popular_Comp type.
| | 08:10 | If I don't remember what the publisher
ID is, which is unlikely, I can click
| | 08:13 | this button here, which is going to read the
association, bring back the list of publishers.
| | 08:18 | I will say this one was Five
Lakes Publishing in Chicago.
| | 08:21 | We will give it a price of 14.99.
| | 08:25 | As soon as I tab out of this, the rule
is applied, and it says yes, that's good.
| | 08:29 | Advance was 24,000.
| | 08:31 | The rule is also applied
and says yes, that's bad.
| | 08:34 | It's not preventing me from saving this.
| | 08:37 | It's just highlighting
those values to point them out.
| | 08:40 | If you want to apply a rule or a
condition that would prevent you from filling
| | 08:44 | out this form, you can do that, too, in InfoPath.
| | 08:46 | I will say royalty is 10.
| | 08:48 | I will leave ytd_sales, and
notes is new SharePoint 2010 book.
| | 08:53 | And once I'm done, I'll
come up here and click Save.
| | 08:58 | It sends the data to the server, and it's now saved.
| | 09:01 | If I go back to my site, and look at
Titles on Pubs, I should see that information--
| | 09:06 | there we go--actually entered in there
as Data Driven SharePoint.
| | 09:12 | Now as you might imagine, the better
you get at InfoPath, the more customized
| | 09:17 | you can make these forms.
| | 09:18 | You can have conditional sections.
| | 09:20 | You can have multiple rules combining together.
| | 09:23 | But even here, it's been a very simple
matter to quickly create a more useful
| | 09:28 | format than the default one.
| | 09:31 | Now unfortunately, this is only an
option for built-in SharePoint lists and
| | 09:34 | external lists based on external
content types, and is not available for a data
| | 09:38 | source like XML or SOAP-Based
connections. But if you have those external
| | 09:43 | content types, it's a great way
of improving the user experience.
| | Collapse this transcript |
|
|
ConclusionResources| 00:00 | In the past couple of hours, we have
gone through a great deal of information.
| | 00:04 | We have gone through data sources,
working with external content types, and
| | 00:07 | business connectivity services, gone
through multiple complex web parts,
| | 00:12 | external lists, the Secure Store Service,
custom-entry forms, and InfoPath, and
| | 00:17 | there are many areas that you
could run with this technology.
| | 00:20 | You won't need it all, or at least all at
the same time, but you should now be in
| | 00:23 | a position where you can identify what
it is that's going to give you the most
| | 00:28 | benefit in the short term, and run with that.
| | 00:31 | Now, bear in mind that the Help system
in SharePoint Designer, which you can get
| | 00:35 | just by hitting F1 at anytime, can be
a great reminder of some of this stuff,
| | 00:40 | particularly when it comes to things
like the differences between what the
| | 00:44 | different view and form
web parts can and can't do.
| | 00:47 | Now, while as you've seen,
experimenting with deep customization in SharePoint
| | 00:52 | is going to have you playing around
with some XSLT behind the scenes, it's not
| | 00:57 | always the easiest thing to do because there
aren't a lot of great resources about this.
| | 01:02 | But one place to bear in mind, if you
are getting into it, is the SharePoint
| | 01:06 | 2010 Designer forums.
| | 01:08 | These can be a little tricky to find
sometimes, but you can search for that.
| | 01:12 | What you don't want to search for
is the phrase 'SharePoint forums'.
| | 01:15 | You want to make sure that you're
searching for 'SharePoint 2010 Designer forums'.
| | 01:22 | Even then, the first link that you
will find is quite likely to be the
| | 01:25 | Pre-SharePoint 2010 one of them.
| | 01:27 | But there is a forum on
msdn.microsoft.com about using SharePoint Designer,
| | 01:32 | InfoPath, and other customization, and
there are some often some really good
| | 01:37 | tips and tricks to be found here.
| | 01:38 | Now, if you're working with the Secure
Store Service when you're working with
| | 01:43 | your content types, really step one
there is to talk to your sysadmin and make
| | 01:48 | sure that that has been set up if
you're interested in creating secure sets of
| | 01:52 | credentials for each of
your external content types.
| | 01:55 | But otherwise, my best
suggestion is really simply to experiment.
| | 02:00 | Experiment with the other web parts,
experiment with creating multiple pages,
| | 02:04 | and connecting web parts together, and
trying to connect different data sources
| | 02:08 | together. And play around with the
different formatting options in SharePoint
| | 02:12 | Designer that you will find.
| | 02:13 | There is a lot that can be done through
this without having to dive into XSLT first.
| | 02:18 | But good luck with your
data-driven pages in SharePoint.
| | Collapse this transcript |
|
|