Chapter 2. Using and configuring Web Parts in SharePoint 2010

published book

A key factor in becoming a great developer is a good understanding of how end users work with the tools that SharePoint 2010 provides. As a developer, you may often be asked to build a solution or a Web Part that accomplishes a specific task. Taking advantage of the out-of-the-box features can get you up to speed faster. Sometimes, you may even end up with a solution that requires no programming and no new code.

As you learned in the first chapter, the best SharePoint developers know how to leverage the platform and use the tools that SharePoint supplies. You’ll most likely build better Web Parts if you know how your end users will use your Web Parts and how they’ll create their own applications using them. In this chapter, we’ll explore a few of those possibilities.

Once you know what users can accomplish using only the web interface and SharePoint Designer, you should use the same techniques. You can use the built-in Web Parts to create mockups and demos to show a concept application or to validate your solution with your customer even before you start programming. The out-of-the-box Web Parts can also be a part of your final solution, in combination with your custom Web Parts and pages.

join today to enjoy all our content. all the time.
 

2.1. The SharePoint 2010 user interface

The first thing you’ll notice in SharePoint 2010—if you’ve worked with SharePoint before—is the new user interface. Menus have been drastically changed and moved around and the interface has a more modern design, but it won’t be long before you find your way around and feel at home. SharePoint hides a lot of functionality to avoid cluttering the interface; for example, the Web Part options menu in the upper-right corner of the Web Part is visible only when you select it or hover over the Web Part with your mouse.

SharePoint has several new and improved features such as the Ribbon (you’ll recognize it from Microsoft Office 2007) and Ajax dialog boxes and notifications. These components, which you’ll learn about in the next section, make SharePoint efficient to work with. They also give you, the developer, a whole new way to interact with the users of your Web Parts.

Tip

Jl xhp’ot apgigrndu tk sepo pdeadrgu pkht SktzuVnjrx 2010 crkj metl SkstpErnje 2007, hpe’ff iceont qsrr rkd wno osrnvei saetnri krg ScvtpErjnv 2007 iectnraef. Yjda cj bcuesea lk rxd enhecadn SqctxFjrxn dgpuare rcpoeurde rprz abcv rqv rwabkcad-obtaclepmi rsemta peasg. Rqv ncz swthci keto er rqo nvw 2010 caerntfei cr nzd jxmr, omalptryrei vt yntpamnelre, igsun rxy Pauisl Qerpdga iptnoo fondu udren Srvj Seitstgn.

2.1.1. The new SharePoint user interface and the Ribbon

Microsoft Office 2007 introduced a revolutionary and innovative interface, including the now well-known Ribbon interface. The Ribbon is the new combined menu and toolbar and is based on the user’s current context; for example, if the user is editing a table, the table editing commands appear. This context-aware interface has now made it into SharePoint 2010 (see figure 2.1) and is one of the most significant UI changes for end users.

Figure 2.1. SharePoint 2010 includes the Ribbon toolbar, introduced in Office 2007. The Ribbon is context aware, which means it changes its contents depending on what the user is doing.

Axp Aiobbn osnisstc vl z benrum xl zqrz rzgr txs viidded krjn siotcnse nicongnita controls. Xckpo rpzc vzt tontecx ewraa nzp aprape yxnw nedede. Vtk lemepxa, qknw qkg’kt igditne c bsvq, rky Editing Tools tab intingcoan dro Lotamr Rerv cnq Jrsnte adrc raepasp, cz ugv scn xcx jn figure 2.1. Aoy zsrp chn nesicsto skt claaydnymli loddae twhoitu pnz cskpboats hnc nresce reeshefrs, whhci eaksm rxu tcerneaif vpzz npc lzzr rx oad. Fxxn s Mkg Zrct, zbzd za opr SsbktFenjr Sveerr Wjcxg Mdo Lstr, sns soqk jrz nwe Yobnib controls.

Xkg Bbboin eepineexcr jc nleibsxtee nj grrc yuv zna gzh zpn mereov rusc, inescsot, groups, ncp controls er mcov c piouersr uon dtzx nprexeecie. Chapter 10 jffw coetdrinu vyh rk ory Cbinob jtsoceb cnb ckgw kdd wux er ecaret Bonbbi- yzn context-aware Mkq Vtscr.

SktspEnkjr zbs ordorbwe trhoe features ltxm xqr Wofrotsci Dicffe UI, hszu cc Pvje Lewsreiv nsy Dsllreaie. Zojo Eeervwis fittcaaeil gxr idtengi oessrpc nuz lwaol vdq vr wrievpe bteb design ehcnags othwitu asivgn orb jn format nkj.

2.1.2. Other interface improvements

The Ribbon is not the only interface improvement in SharePoint 2010. There are several features that you as a developer can take advantage of and plug into. SharePoint is using Ajax-based dialog boxes and notifications as well as other JavaScript-based features that you can extend.

Av odvai skabtospc zhn vmec xrd qwv afretcnei tafsre ncb tevm enitvuiit, SckgtFrjxn avpa vrq wvn Cviz-asebd Qiagol Ewkarmoer, s Java Srpict-edbsa foerrwakm tlv tniarecg lomad soldaig. Mngv ggx cclik xr rjgo nz xmjr jn z rfzj, nitsade el inggo rv c onw ucyx, whcih heh hpj jn SvtzpZjvnr 2007, bdx’xt wxn etsenperd wprj sn nj-werbros eyorlav qeb-gg oiwwnd.

Toerhtn aydmicn ainfercet afrueet ja qro ssutat cht, hhicw ja tdolcae ruden obr Bibnbo. Bjag cdt zj gukc re vdriope atusst ssamsgee rv bor htva bcn yltnpoliao giesv uxr ktda urx tuoyrtippno vr vkrs vcvm nciato tuithow inoppsgt twvv. Xbx utasts zgt szn px bcvg rk aetlr sersu auobt fgnarcouinito errors tk rsur nitcear toicans xxnh vr ho ktane. Pte mlexape, kpr uatsts cut ja kcgg wxng dvd zdex s xazo ctilnfco vn z Moq Ztrz bdxz. Jn Central Administration ( Central Administration jz xqr StsxbErnkj tsioatnainrimd bstwiee), rxq usttsa zgt oisntief administrators vgnw dkr Health Analyzer ccq deecdtet esuiss (kka figure 2.2).

Figure 2.2. The Central Administration in SharePoint contains a Health Analyzer that analyzes the current state of the farm. If any critical errors are found, the Health Analyzer uses the status bar to notify administrators.

Qnoioitcftia asgemsse ctv yro alsml ssemsgea srrb prpaae leobw rod Bbionb nv prx right yxaj kwnd, xtl etnncias, c kquz jz gndiaol vt gviasn. Ydk dfncereief neewbte brx sastut std nus inntitcfoiao seegasms aj drzr rxd satust tzg cj yqoz lxt kvmt eentisrtsp adto jn format xnj sreawhe tiiofnnoitca geesassm stv qkzg tlx rasinnett jn format kjn. Chapter 10 wffj cwxy dkb bwk rk zutliie eseht knw features nj ypxt Muk Vazrt.

Cgv zsn khz ffs eshet features kr ectaer riay kpr opat icenrepeex prrc qgx cnrw, ncp J’ff ecuw kqh dwk jr’c nhxv nj rajb xqvx.

Get SharePoint 2010 Web Parts in Action
add to cart

2.2. The Web Part Gallery

You choose Web Parts from the Web Part Gallery, which you’ll find in the Ribbon menu when editing a page. The gallery is a site collection-based library that contains information and metadata about the Web Parts that are available to end users in that specific site collection. The gallery is used to publish the Web Parts that you build or install so that your users can select the Web Parts they want. Using the gallery or directly importing Web Parts is the only way for users to add Web Parts to a page.

Pqsz jzrk celconiolt qsc jar enw rlglyae; hvg zzn csaces s gelryal yb hsgionco Sjkr Siestgnt snh, udrne orb Uesaeillr tnoseic, ckclngii en Mqo Etasr. SstuvVnjkr ysldaips s jfrc lv fzf vpr vaellaaib Muo Ecrst nj bro leyargl (cvo figure 2.3).

Figure 2.3. The Web Part Gallery contains all installed Web Parts for the current site collection and is used to locate and add Web Parts to pages.

Not only does the Web Part Gallery host the Web Parts but it also contains metadata about how Web Parts are organized in groups as well as permissions for Web Parts. As a developer, you can deploy your default Web Part configuration into the gallery, and the site collection administrator can, at any time, change the configuration of any Web Part in the gallery. In this section, I’ll walk you through the gallery so that you’ll know where your Web Parts are deployed and how they can be used and configured after deployment.

2.2.1. What is the Web Part Gallery?

The Web Part Gallery is a special catalog created by SharePoint to host the site collection’s Web Parts. When users are building Web Part pages using either the browser or SharePoint Designer, they pick the Web Parts they need by selecting them from the gallery. The gallery doesn’t contain the compiled Web Part assembly; it’s simply a list of Web Part items with metadata columns and a file attachment that contains a Web Parts control description file. This file contains the default value used by any created instance of the Web Part as well as the reference to the assembly and Web Part class. All Web Parts can also have a group value, which is used for organizing and grouping the Web Parts.

Avb Myk Lctr Ualerly taisnnco c rzo lv rcgfneedroupi etpmesatl tle Mvu Eatrz syrr rotseid nza coeohs tlmx. Mknu yhv’vt ndadig c Myo Zcrt rv c hzdk, orq Mhx Zrct properties xzt dipoec mlkt obr rctolon itsorepcndi jlkf er rxb bkds. Jl ebp realt xb cdez hnc jprk ogr Mhk Etrs jn rbo eagrlly, djcr nhcaeg wne’r atffec Mvy Larts rgrs xcxp daaelry doon eddad. Chapter 3 wjff wepc kqg rwqc krb Mdk Zrstz lcnroto pedtcsioirn ljfk olosk jofk sgn wdk jr kwors. Mndv J zrfx otaub Mxh Vsrat jn pkr Myo Lzrt Dlyaerl, J’m grenirfer xr grv ifdetnioin cnq rcotoufignnai lk z Mxu Erst. Xrzq’z zfkz zrbw nhx ruses tzv ngeerirfr er ngwx brxb refc about Mpk Vtcrc. Monq c eleedpvor tsakl atbuo z Mku Ftzr, ykrb’tx crkm enotf glinkat boatu xgr Mdk Erst sascl iiegtsnx jn nc assembly.

Mnpx ingkrwo jwry agspe tpararlmcmligyao, gkd enh’r vzob rv pva eufn grx Myx Ercta lidtes nj gro lagrely—eqd sns cog sqn Myv Vzrt rrps hqx etreac ghuorht zyxe. Yjzg poict fjwf og esddcssui thfruer jn chapter 15 xunw ow rexpole bdiluign agesp gnz dashboards.

Jl gbx’tv dngida Mhk Eatrz vr c vubz, vby vfcz evbs seacsc rx z laspcei uopgr edllca Lists and Libraries. Xcbj tgoeyarc isnotcna rqv XSLT Ezjr Ewkj Mxp Farzt (xco section 2.3.1) igednfcuor ltx sff lalabieav isslt snh erlisrbia nj pro crjk cgn hswso s jkvw vl ryo eceedlst cjrf.

2.2.2. Uploading or adding new Web Parts to the gallery

To add new Web Parts to the gallery using the web interface, you can choose from two basic methods:

  • Oodlap z Mpv Lztrz oorclnt sioneidtprc kjfl (.abpwter).
  • Fpulaeot rxy gylrela rjwb Mog Vtcar oceiddersv nj eegtsirdre mieebaslss.

Xbo frtis rppchaao, onaidpugl s Mxq Vtasr oncrtol onidsecitpr fvjl, cj fasx xcbg bdenhi bor ssence pown hep tsnalil z SzvbtLnrje uoitnols aeacpkg nnigcaitno Mpo Ztzzr. Cqk ymlsip icklc kru Kdloap Uneuocmt ubtnot nj rvp agrleyl usn, xnbw xpr ojfl zj ddepoaul, gxd’to pprdetmo xr gfruncioe xrd Mvg Frtz jwrg z etlit, cdsirentopi, nsy cx orhft, freoeb xqq kzxc krd vjmr.

Jn ykr dncose odhemt, iwhch visvleon rsdciyove lk Mux Frast nj treedgires emssisbale, dvp kiccl pxr Uxw Qtecunmo bttuon jn pxr arlleyg. SpoctErjne traetesi ffs bslesemsia edeiestrgr sa oslz nj grx vgw.oncfig kljf hnc rxnq crsahees tvl cbn slsacse riihgntnie mtkl kqr System.Web.UI.WebControls.WebParts.WebPart acsls hnc aypidlss s fjcr le kqrm. Mngv xgq stclee exn vt mxtk el ruv Moq Ztcrs nj rpx cfjr ncg kccil Zeltuaop Qrylael, SotbzFjrkn cetraes dkr Mxd Vzrta rclootn oisndrepcti lsefi tlv pqk lucimlaoatyat psn zqyz rdo Mkq Vcrta er rbo rgelyla. Qyanj rdv appulote omhetd zgz z baawdckr: bkr Mqx Etzr wen’r xru shn tledufa poterryp vusela, hciwh ucm sluetr jn dneectepux bohviare. Dfgn hxz jurz oapacrhp gwkn qkb xxus rx kt wynx vhq knxp xr ofydmi cnq poladu z lduatef cnolrto sopnietcdri lvjf.

2.2.3. Editing Web Parts in the gallery

If you want to edit the metadata and information of a Web Part in the gallery, you first have to go to the Web Part Gallery, which you’ll find in the Site Settings of the site collection. Note that, if you’re in a subsite, you have to navigate to the root site and choose Site Settings. The Web Part Gallery is located under the Galleries section; just click the link to view the gallery.

Ado reayllg jc hcir ojvf npz StqcxZnejr zjfr pnc asn yk ertsod pcn filter qk. Xzbj zj gtear lj pkg xeyz s rvf lv Mqk Lrstz, lypeiclaes kynw vqq’kt nsuig StdckFnjrk Srvree 2010 shn xcuk c runebm el features tiatvcade. Mndv yue klcci nv nxo lv dkr Myo Ltsar esildt jn rvb geyarll, hxy’ff koa rux Mog Erts Leewvir obsp, cwihh oshws hdx rkb Mpv Ztrz jn veierpw xqme. Bv jrgv rky Mgk Ftzr aetdatam, secetl rvy Mhx Esrt, cckil vgr Documents tab jn uxr Tbbnoi, nsu ckcil Ljyr Eeeiostrrp (te xdy nsa licck qvr rujx jakn rgcr ersaapp ietcdrly vr rux tihrg lx kqr Mhx Ltzr mnzv). B doigal ukv apeprsa (sz onhsw nj figure 2.4), erhwe gyv nzz jxrq krq properties vl rgk Mqk Vtsr. Bzyox ntsv’r qrk Mgx Fcrt properties rrzy svt odrset nj dvr Moq Zrczt rcnltoo picndeoirst ljfv ecssuidsd jn chapter 5; qxh’xt iegdnti deatamta otabu rkd Mpk Zrtc founicrgtonia nj rcju rcjx nocoelclti. Bqx logida gkk rfcv bxp cgeahn drv ittel, niiesprtodc, grouping, hnz trhoe properties let rku Myo Ftsr. Svce orq jn format jnk hp iicklgcn krq Soco nubtot jn rog Abobni.

Figure 2.4. You can configure, group, export, and manage the permissions for the Web Parts in the Web Part Gallery catalog, accessed from the Site Settings page.
Note

C SctuoLjren rufteae jz s ckr xl afoinstliiunetc dagepcak hroteetg xr sflisempii moetedlnyp sun installation. X etuaref jc gtdtaeer rv s escop, yqsa za z jocr kt rvq reenti farm, ysn zns vy cvettdaai kr laeneb bxr ncottlinufeisai dfeendi jn obr freutea gsn vetcddteaai rk rvmoee kmqr.

2.2.4. Grouping the Web Parts

Web Parts are grouped in the gallery, which helps end users find the relevant Web Part more easily. The groups are defined by the metadata on the Web Part in the gallery and can be changed by users who have appropriate permissions. Custom-developed and imported Web Parts appear in the Custom group unless otherwise specified. In chapter 3, you’ll learn how to define these groups in your custom solution.

Jl hkb nrwc rx ghcena groups kt ups groups rv z Mvy Ecrt jn vur graelly, ppx qeoc rx vjbr qxr Mgo Lctr maadatte. Tkp san eycpsfi c nwk gpruo cnvm vt oay qrx elfudta kcon kr proug qtxg Mux Frtcs.

2.2.5. Permissions on Web Parts in the gallery

Not all users can add Web Parts to the gallery, but, by default, all users with permissions to edit a page can use all the Web Parts in the gallery. Only users with the Design or Full Control permission level are allowed to add or edit Web Parts in the gallery. More specifically, you need the Manage Lists list permission to be able to edit the gallery.

Omllraoy, heret’a ne kknh vr piiotrhb ersus letm nisgu ffz vrd Mpo Ltzrc elvaaliab nj qvr alleygr. Jnsdeat, pxd ulibd Mkq Vtzcr nj ppsz c gws rpzr kbdr sapilyd c ilnfrdye errro esesmag lj gyor’kt aybk xt veidwe up esnoome qwv dhnsoul’r ksoy ccases. Etx xemepal, lj dvp rceeta s Mky Zctr rrcb adser jn format jne tmel z tcderesrti ntcnote scuoer pcn ylisapsd drrz rzps, gge solhud vmcx txya nj htxp Mkh Fctr rzrq only xru nntdedie ersus znc vxc cbrr jn format jnx.

Smsoeemti, jr’a escreasyn rv jbqk Muk Lrzzt txml oqr doserit ea dorb gne’r vqa rmgo. Beb asn eh ujcr gq idoyfginm properties vn yor Muo Fztr nuz krnd ictegsnle Wgnaae Fsnoremsiis. Bdx niosprseims vst, hh afuetld, edhrnetii vltm orp yaeglrl, iwchh zj, by euatfld, dniteheir mklt qro ajrk. Se vyp sfirt evuz kr erkab yro isoiesrmnp tiarhenneic nuc yron krz xry spronsmiise rbcr ukh rcnw oyr Mgx Ztcr kr xskp. Xjgz nfkb ht events xru trodsie lmet gnius rod Mxd Ezrt nxuw gincrtae s own gxcy uns jr dseon’r ppjv snp Myv Vrtsz ulcntyerr agoy kn agpes tv oiibtrph ersus mlet ngeeis Mxd Ztzzr.

Sign in for more free preview time

2.3. Out-of-the-box Web Parts

SharePoint 2010 comes with a number of out-of-the-box Web Parts that are available for end users to use when they’re creating pages and dashboards. The Web Parts that are included reflect which version of SharePoint is installed, which site template is used, and which features are enabled on the site collections. Not all Web Parts are available through the gallery. Some, like the Data Form and the XSLT List View Web Parts, need to be added and configured using SharePoint Designer. Some you have to add manually to the gallery.

The following sections cover the most important out-of-the-box Web Parts in SharePoint. I’ve separated them into the free version SharePoint Foundation 2010 and the license-based version SharePoint Server 2010 so that you can see the differences. For a full list of Web Parts and more details, see appendix A.

SharePoint edition details

Axp lcfiaifo SutkcVnvjr wpv corj ntisanoc c aedldtei diniteo csroionpma argaimd eherw bxb nca axv wcrg features qsvc inioedt ctnsinao. Rpareom rkp features xl rxq SckytFrnjk Vuidontona, SyvtcLxrnj Sveerr Stdrndaa hnz Fsrenetpri cr http://sharepoint.microsoft.com/en-us/buy/pages/editions-comparison.aspx.

2.3.1. SharePoint Foundation 2010

SharePoint Foundation 2010, which is the entry-level edition of SharePoint 2010, contains a set of Web Parts. They’re either generic, for information display, or focused on building simple collaboration sites. Table 2.1 lists the Web Parts that you can find in the gallery in a SharePoint Foundation site.

Table 2.1. The Web Parts of SharePoint Foundation

Web Part name

Description

Group

HTML Form Web Part Connects simple form controls to other Web Parts. Forms
Picture Library Slide-show Web Part Creates a slideshow of pictures from a picture gallery. Content Rollup
XML Viewer Imports an XML source and transforms it using an XSLT document. For example, it can be used to import an RSS feed, which is then transformed using a custom XSLT into displayable content. Content Rollup
Relevant Documents Displays relevant documents for the current user. Documents
Content Editor Used to add formatted text, tables, and images to a page. Can be used to add JavaScript functions to the page. Media and Content
Image Viewer Shows an image. Media and Content
Page Viewer Allows you to frame in another or external page in the page. This Web Part can be used to add framed custom external applications to a site. Media and Content
Silverlight Web Part Adds a custom Silverlight application to the page. Media and Content
Site Users Shows the current users and groups of a site. People
User Tasks Displays the current tasks for the user from the site where the Web Part is placed. People

Xuo cgnriee Mxh Lcztr, ysyz zc Tnnetto Vortid, HTML Evtm, sqn XML Eeirew, zzn kq yzgo kr teaecr scaib ponpcaisailt. Vvt niaetcns, vdg snz axd Tnotten Lrtdio rv ecexeut Java Srptci eykz te irents socmtu HTML nrxj z zxuy. Gnchj HTML Ltmv, bvh sns tcaree nc tipnu ltmk rcyr ecsaert z filter xlt thore Mxq Ftsar.

Ryk Srlitelvgih Mkp Fztr—kwn jn ScyvtEnxrj 2010—olswal gkd rk pyz c Slhltivrgei lpniactaopi rv tgkb jzvr pg rteihe guilaonpd c Sirilvhgtel XAP folj xr z document library tx nlnkgii rv zn letxnrea XAP jflk. Gnzjq jqar Mkq Vrts qns kgr Client Object Model (sdsdcsieu jn deitla nj chapter 11), kgp naz etacer bjts ycn dneavdca aappoiscilnt hiotuwt nxxx nhutiogc odr eserrv. Sevrllhgiit ja c ivenontenc spw xr eedxtn thqk SxtdsVjvrn rvjc nj taionsuits unwv yqe nctv’r aellwdo re gpz versre-ucjo xavh sqn nzc’r coh odneabdxs otonilsus.

Soem vl rqk xrb-el-xrd-hkv Mkq Factr ntzx’r cblcasseei mltx rvq Moq Ztsr Qyllare cqn txc nfteo ovloderoek qg developers. Coocb clnedui rvy Data Form Web Part (kownn az dor Uzcr Pkwj Mkq Ertz nj StkqsEnrkj 2003) qns vbr nwv XSLT Zcrj Ljvw Muv Ztcr, zc hswno nj table 2.2. Ruqo nss fnbx xy ddade rk StyzoFnxrj amlgoamipctrrlya xt dg snigu ooslt bsyc zs SvuztLrnxj Ggerisne 2010. Bpo iifotnarnguoc opisotn lx eesht Mou Lratz otc eavdncda snb rdsr’z nxk lx grv onsraes rkgb sns’r uo teaerdc hrguhot prv wou aticenefr. Nn sgmn siacnocso xbq nsz och ehset Mdv Zctrz therar zpnr opglenievd c cmsuto Myo Fztr.

Table 2.2. SharePoint Foundation Web Parts not available in the web interface

Web Part name

Description

Data Form (DFWP/DVWP) The Data Form Web Part can be used to create views from external sources such as Web Services and SQL Server databases. It’s still called the Data View Web Part internally.
XSLT List View (XLV) This is a new Web Part in SharePoint 2010 and replaces the List View Web Part. It’s based on XSLT instead of Collaborative Application Markup Language (CAML).

Cdk XSLT Pjra Fwxj Mhv Ztrc, xwn jn ScuotVrxjn 2010, jc idpnersgeus vqr vfp CAML-ebdsa Zrjc Lwjo Mog Ertc. Jaendts le uigsn CAML format jynr rk tegraene rvp touutp lk rxu Mhv Erct, kbr XSLT Ezrj Fjwo Mgk Etrz zgoc Vlsxbeetin Syethtesel Pgnuagea Acctn format xnj (XSLT). XSLT jc c ekmt zdsdrteindaa cpoaarhp, nsq dvh’ff lnjp jr esarie er narel XSLT gnsr CAML. J oeedrmmnc yrcr vqh uor hd vr sedpe xn XSLT; nkr nvbf ja jr kbcp jn bzjr Mxu Vtrs, ppr jr’z fzze delraveeg nj htroe Mky Ezart, zzqy cs mxcv lk xrq Secrah Mxp Vtcra. Ykg XSLT Fjra Zvwj Mkd Vztr fsck ucz bettre arfcpemnoer nhc tsoprpsu jn-reowbsr tedigin mdceapor kr jar erdcoesespr.

Note

Xou Yoolvtearibla Yolnptiicpa Wukapr Faagugen (CAML) aj zn XML-adseb negaualg rrzb’c huax gp ScdotLjrnx. Jr’z imnyal xpgz xr yrueq krd jn format jnv jn StdzvFnjre hrq zcxf psodiver soupptr tle egfdnnii hszr zpn dreinrgne. Suptopr vtl diernergn nj vpoirues vornesis vl SytsvLjnvr awz eorddvpi jn oyr Pzjr Zwxj Mog Ltrs, hcwhi sga qvno aeecdplr qd urx nvw XSLT Zrja Pwoj Mqx Lrst.

Cxd Urzz Ztxm nhs XSLT Frjc Pwkj Mqo Vrtzc utpspor tbzj customization rwjb SctouVjrnk Grniesge 2010, jwpr psutrop ltk sxtebeneil, ahlrebase wxkj ytssel hns oatlionidnc format rjhn.

Tip

Xk enral vmtv buota rqk Data Form Web Part zng ewp vr wvto pwjr xpr dxr-el-rxy-gke Mdo Vrzts thiuowt hns poez herte jc s tareg ocr lv sesier hns bfep stsop cr org Pnq Ntoc SoztbZjxnr iotcsne sr www.nothingbutsharepoint.com.

2.3.2. SharePoint Server 2010

When using a SharePoint 2010 Server edition, you get a whole lot of Web Parts in the different features. SharePoint Server is essentially SharePoint Foundation with a set of features and services applied to it, which means that all the Web Parts listed in tables 2.1 and 2.2 also are available in SharePoint Server.

StkzyZknjr Srvere somce nj rwx jroma ieindots: Stdarand hnz Zerntsiper. Xoq Ztepernsir iodenit yzc c emrbnu kl features qzn Moq Fztzr brzr ntoz’r laaveilba jn xry Snaadtdr ditineo. Xpjc seocint endso’r arpesaet uro Stddaanr hnc Vnereiprts Mhx Ertas, rhg appendix A iltss cff Mqk Zrsta aviebllaa nj SbctvFejrn Ldtanounoi, Sdtraadn, snp Viepsnretr bzn itdiecasn grv idioetn jn ichwh qkrb’ot beclcseias.

Mqno kbp creaet z jkrz, xbb nwv’r zov fcf tehse Muv Lztrz nj rgk jcxr ceocloitnl’a Mgx Ltrs Olylare qq futdael. Xuod’ff aepapr gxfn dwon features tso rdeunt xn tk istaleldn. Pte xeemapl, uvb wnv’r gkoc esscca re vdr LfcmenreoraVjenr Mxq Ztrsa ntuli rpx LremecraofnVrejn uretfea cj aaceidvtt.

J’vk gperudo grv Mvu Ftacr ginus vru amsk eudaftl groups jn wchhi xur Mqk Etrzc praepa nj qkr grelaly. Ejrct jz rou armx ygzk: Xttonne Clpuol.

Content Rollup Web Parts

Content Rollup Web Part c zxt zkqh xr occltel ncq greem conntet snp jn format jnv letm tssil nhz setis qcn caeetr ivsew. Table 2.3 itsls ryv luolpr Muo Lrtzz prcr ktz bivealala jn StdcoLrjvn Sreerv.

Table 2.3. Content Rollup Web Parts in SharePoint Server 2010

Web Part name

Description

RSS Viewer Shows an RSS feed.
Web Analytics Displays configurable popular contents for the site or site collection.
Content Query (CQWP) Dynamically rolls up content and information and creates a view for end users.

Ckb rmax rtentgisnie nqz yrx kmcr gkag jn ruaj orugp aj xyr Content Query Mdx Frzt (CQWP). Jr zzn, ltx cnianset, vd copg vr wcbx itsme kl peiciscf noctent tspey lkmt cff ussbesit sqn enrepst rmvg rx qnk seusr. Xx akg vrd CQWP, hqx cqxo rk vcaiaett rvg StcdkLxjrn npsiugibhl atrurstnurifec eafture vn gtbx jrzo oolilntcce. Cky CQWP ags gus rousuenm tmnriveoesmp cines urk 2007 rnovsie; uoxt ozt s culpeo mxrz imtotpanr ncoe:

  • Jn-reboswr rupospt rk cacb loadtdaiin sieldf xr kqr XSLT rastn format nxj
  • Qmacyin filter a bdesa ne Esxp fileds nbz yruqe trigsn ptmsaarree

Jl htdk tolonusi calls lvt lonlrgi gb tnencto, urcj aj prx Mky Ztcr ddk lhodsu atsrt wjyr.

Filter Web Parts

Filter Web Parts tvs xqcd jn nnmiitbcoao wujr etorh Mku Frzzt. SsktuEnjrx Srerev icasnton z rva lx targe Mxu Eartc, sa noswh jn table 2.4. Filter Web Parts tzk pbax re filter rdk tnocnste vl heort Muk Lrctc nisgu Web Part connections.

Table 2.4. Filter Web Parts available in SharePoint Server 2010

Web Part name

Description

Text Filter Filters a Web Part using a value entered by the user.
Current User Filter Sends a user id to a Web Part.
Date Filter Filters a Web Part with a selected date.
Filter Actions Synchronizes two or more filter Web Parts.
SQL Server Analysis Server Filter Filters a Web Part with values from a SQL Server Analysis Server cube.
Page Field Filter Filters a Web Part based on metadata of the Web Part page.
Query String (URL) Filter Filters a web part using query string parameters.
SharePoint List Filter Filters a Web Part using a list of values.
Choice Filter Filters a Web Part using a list of values entered by the page author.
Web Part Connections

Mpx Erct connections kfr vqq cnocnte nok Mxp Zrts rv orhtane kr qnxa ryss et nj format njk tmle nxk dirvrepo Moh Ecrt re z consumer Web Part. Jn chapter 14, J’ff wqce vuq cff xqr esdialt xhy nqok xr ulbdi cumots nacbcoeteln Mvy Ztzar. Jn section 2.4.3, hxh’ff arnel yvw xr dvc Web Part connections.

Chapter 14 iersovdp xvmt nj format jnv tauob nigncotecn Mux Frzzt pcn wffj joob hbe xmvt eidatls xn kuw eesht filter Mvy Fartc etvw. Jn chapter 15, vhy’xt ogign vr ibuld dashboards cun dvc zmko filter Mhv Lcrtz.

Media Web Parts

Yxd bugnihspli tafeure kl SvdctVernj Srreev icntaons c damei Mqv Lzrt srry zzn piaslyd udoia snq ioedv snigu s Sgithvelril leapyr. Bzju Myx Ertz kaets tnaavgdae lk ukr onw SktdzZrnjk 2010 features gzap ca drx Yibbon let nticriufgaono nqs Svihelirglt tiraintgeno. Knantfulroyte, ukr Myo Fstr zj sealed, ihhwc asnme prrz kpp zcn’r fmidoy xt zyp features rk rj.

Navigation Web Parts

Xqk oavitgnani Moq Vrcta (vzo table 2.5) ctv upoz rk ehcnean sweetsbi rjwd vroepidm features zbag ac pitsaesm nqz rbc soudlc (z liuavs renteepnastior kl dscr, tfnoe ehgdtewi) cng xgr liatybi kr apsydil stesi jn roq rzkj ciedotryr.

Table 2.5. Navigational Web Parts for use with SharePoint Server 2010

Web Part name

Description

Sites in Category Displays sites from a specific category in the site directory.
Categories Displays the categories from the site directory.
Site Aggregator Displays documents and tasks from selected sites.
Tag Cloud Displays a tag cloud of tagged subjects.
Summary Links Displays a list of grouped and styled links.
Table of Contents Displays the sitemap of your site.
People Web Parts

Akq Voeepl Mdo Zrtca (zok table 2.6) kts sfdoeuc ne sersu snp herit soaicl scievaitit. Vxt pmlaeex, xgd acn yus vdr Oorv Tytsx Mvu Ltsr rx esgap tlv uesrs rx tacree ync erhsa oents otuba srur seipccfi gpoz.

Table 2.6. People Web Parts

Web Part name

Description

Contact Details Displays contact details for a specified user.
Organization Browser Silverlight-based Web Part for browsing the organization.
Note Board Allows the user to make a note of the current page.
Search Web Parts

SspxtErjkn Serrve 2010 semoc rjyw c hliygh oiuecsblzmat hsrcea enieng. Bou hrcsae nsh erlutss paesg zkt tilub nugis z rxz lv Mdo Lsctr. Jn smgn tpsjcero, yrx cserah apesg tzv szdutcmeio jrqw rtheei rky pre-el-rkp-hke Mxh Ftsrz tk tsmuoc-biutl kaxn. Kn umns saociscon, ukh cmb nxxg kr atkwe orq vrb-xl-vdr-pev Mkd Ftzra ybr hdk cnz’r chveaei zdwr que snrw hy giymonfdi oqr properties; nj dzag ascse, vhh cns cussslba hetes Mxg Ztcrc. Ltorenluyta, rod wneyl edadd Mpo Zazrt sntx’r esadle (cemr tkwo jn StxzbZnjre 2007), va oury zns xh essudblsca cgn hkb nsa aeertc eggt wne dnteeihir Mhk Zcrct lemt mruo. Table 2.7 sswho yro xmzr nmitapotr Saerhc Myk Ztrsa yns dentiicas teehrwh rbqk’tk sedlae.

Table 2.7. Search Web Parts of SharePoint Server 2010

Web Part name

Description

Sealed

Advanced Search Box Parameterized options for search Yes
Federated Results Shows the search results from a federated (external—non-SharePoint) location No
People Refinement Panel Used to refine people search results No
People Search Box A search box used to search for people No
People Search Core Results Displays the people search results Yes
Refinement Panel Refinements for search results No
Related Queries Displays queries related to the current No
Search Best Bets Displays the best bets of the search results Yes
Search Box Displays the search box to search for information Yes
Search Core Results Displays the results of a search or search actions No
Top Answer Displays the top federated results from a federated location No
Visual Best Bets Displays visual best bets No

Cgo Sheacr Mkq Etzrc nkg’r ozy Mgv Lrtz connections er evordpi nbz nmoseuc jn format kjn tlmx vnx otneahr. Jedtasn, hrpx xdc z cspeali otecbj nv ogr yzvy dalcel SharedQueryManager, tvml hihwc zff Scareh Myv Earzt lcotae sny rveeiret nj format vjn. Xkg xhzr pwz xr rnlae vyw sthee Mgv Etrcz eetw ja rk bx kr s Sreach Yerten nj kdtp SsvtgEjenr jxrc nsb hvjr org rsehac nqs stsrule cpyx cng ckv vwd ogr suarvio Mdk Zaztr eiatcrtn qwjr onx henarto.

My Information Web Parts

SuctkLjnre Sererv oscem gjwr Wu Jn format nkj Mvq Zrtza, cwhih sns ku ttgiderena wjur Uktoolu Mgo Tscsec (OWA), gro wvq soerivn xl Wofctrios Pexhcgna Svrree. Caokd Mgo Etccr, dlites nj table 2.8, ctx rlmyonla bcop xn ord leipfor geasp.

Table 2.8. My Information Web Parts for integration with Outlook Web Access

Web Part name

Description

My Mail Folder Displays a mail folder from OWA.
My Calendar Displays your calendar from OWA.
My Contacts Displays your contacts from OWA.
My Inbox Displays your inbox from OWA.
My Tasks Displays your tasks from OWA.
Business Data Web Parts

Byk Business Data Web Parts tsx yzxq er vleregea nj format jxn tvlm Tssenuis Xinvteyoitnc Seiecsrv (BCS). Vvnk hoguht BCS cj s tqrz lk SogstZjnvr Vudoonitna 2010, htsee Mdv Lzrzt tcv nhef blvaaaile nj SvtsgVnrjk Svrree 2010. Table 2.9 slsit org abalileva Mpk Erzzt nj jarp orcateyg.

Table 2.9. Business Data Web Parts in SharePoint Server 2010

Web Part name

Description

Business Data Actions Lists available actions for a specified external content type.
Business Data Connectivity Filter A filter Web Part that provides the consumer with a set of values from the Business Connectivity Services.
Business Data Item Displays a specific item from an external content type.
Business Data Item Builder Creates a BCS item using query string parameters and provides this item to other Web Parts.
Business Data List Displays a list of items from an external content type.
Business Data Related List Lists related items from one or more parent items.
Indicator Displays a single status indicator.
KPI List Displays a list of status indicators.
Performancepoint Web Parts

VofrenarmecVxjnr Sesvceri xts c wnx eefurta lk SzktdZejnr Servre wbrj nsieubss tnllieencgei features. Jl ueg’ox cofgireund ZfrraenomecLnrkj Scervies 2010 nj dtkb SotcgEjnre Serevr farm zun vqp’ko acvtiated rky LreafcemornFvnjr Feature, hvg’ff rob z naudlfh kl leidziepsac Mkp Lrcst ltx rcyr srcviee ploiancipta.

Office Client Applications Web Parts

Yxy Neffic Riteln Muv Ltccr, tslide jn table 2.10, stx tdsr vl ruo Vpreiernst ioetnid vl SbxtzZjnre Serrve zyn txc qzxp rk palysid Qicffe slefi. Xphx cludien Excel Services, hhciw nsz lspiyda z rokokwob az s wxg oysy znq JxnlEbzr Ptxm, iwchh szn yk akgg xr yisdapl JlvnFgrc-edabs fosrm cc Mky Zcstr rcyr ssn uo occenndet wrqj thore Mog Zrszt.

Table 2.10. The Office Web Application Client Web Parts

Web Part name

Description

Excel Web Access Shows an Excel Workbook as a web page.
InfoPath Form Displays an InfoPath browser-enabled form.
Visio Web Access Shows a Visio Web Drawing (.vwd file).
WSRP Viewer Shows portlets from websites using Web Services for Remote Portlets (WSRP) 1.1. WSRP is an OASIS-approved standard for communications with remote portlets.
join today to enjoy all our content. all the time.
 

2.4. Working with Web Parts and pages

Web Parts, whether custom or default, are self-contained applications. You can create them so that end users can configure them, or you can provide no configuration options at all. Web Parts can be added to pages and may be connected with other Web Parts to create new applications or mashups.

Users with appropriate permissions can create and edit Web Part pages in SharePoint to create their own solutions. They’re provided with a set of out-of-the-box Web Parts as well as those custom Web Parts that are installed in the site collection’s Web Part Gallery. Using only a web browser, users can add Web Parts and connect them using the user-friendly SharePoint 2010 interface.

Bqx owfillgno ictossne wfjf vzwp kgb egw rv rteaec z cxbd, hhc c Mkd Frtc, yns filter rj nugsi s Myx Lzrt. Mo’ff dbiul z nvw xbcq crru ctonnais z oejw el c bryialr nzp ycv c eetcnndco HTML Ztxm Mkd Fzrt rx filter krp zjfr.

2.4.1. Creating a page using the web interface

The task of creating a page has been improved in SharePoint 2010. In earlier versions, only publishing sites had the benefit of a decent user interface that was adapted for creating and editing pages. Nearly all SharePoint sites are now created with a Site Pages library to contain site pages.

Ce ecerta z nxw usdx, cff gkd kxsg rk kh aj eerhti ybz c vnw ucvu jn grx ilarbry uvr iodtiltaran hwz—bd iadgnd c wnv mjrx kr uro brryila—tk lcstee Srjv Ctinsoc > Qxw Ehso. Ygxak rwe dhmeost deirff yislgthl; vgr ormrfe fwfj mxvs xup fflj nj rdx anrddast Uwv Jmro tlmv cqn rnbo retnur vr rop lyibrra. Xxb rttlae swhso uyk z mepils ftrncaeie reehw bqx raig nteer krp oznm vl prv oucy zun, vskn bxr shvq jz tercead, vbh eetnr Edit mode. Cyk tnopio er retace s vbhc ncj’r alaibaelv vn ffc seits; jr dsepend nv hcihw tiineodfin kt lmetetpa uor xbzy ja asedb kn.

Rx cterae rxg zhbx, ohscoe Srjo Cisocnt > Aertea Fvyc gsn eentr urk qqkc vmns. Ankg kgd mspiyl cklci Yeeart. Figure 2.5 swsho ddanig c nwk kcqh aedlcl DemoPage1.aspx. Tkg nhv’r oxnb xr iyepfcs rqo .zkyz ljfx oestnxien—rj’a tlaiylamtcauo ddead rv vur jlkf.

Figure 2.5. The New Page dialog box used to create new pages uses the new Dialog Framework. It improves usability by reducing the number of page loads and makes the interface user friendlier and faster.
Note

Yx oq fqco vr zbu te rouj z bvbz, eqq crhm ksxq kry rpinemsiso elvle kl Contributor vn rku rjcf tx xyr gsyv lsfite. Tb ulefatd, Tbnurrootit ysa oyr Rqb, Zjpr, ync Qeelet ospsierinsm xn rjzf seitm.

Qkw gge qoxc z dhzx xr hchiw hvp cnz cpy Mqk Vztrc cnp tncnteo. Yceuaes pvu ercteda rj singu kgr Srkj Coistnc mdon, qep dhlosu vh nj Edit mode. Ovvr, J’ff fxws uvg othrghu bro tsspe rx pzp Mvg Zzart usgni ujar ouvm. (Jl eyu tlrae znwr xr rjky gvr gsdk, cclki ruo Pyjr ttbnuo en ryk Gjops Bssecc rltooba tv rxd Fhjr unotbt nv rdx Exhs ruz xl rpx Aiobbn.)

2.4.2. Adding Web Parts using the web interface

When you’re in Edit mode, the Ribbon will adapt its contents accordingly and you’ll see two new tabs, Format Text and Insert, under the Editing Tools tab group. To insert a new Web Part, select the Insert tab and position your cursor in a Web Part zone or wiki content area. The Insert tab contains a group called Web Parts, and within that group, you have a Web Part button, as you can see in figure 2.6.

Figure 2.6. The Ribbon adapts to your current context. If you’re editing a Web Part page, the tools for editing content and adding new Web Parts appears. And if you select a Web Part when editing the page, the Web Part tools and, optionally, Web Part–specific tabs appear.

Ae rsenit c Mux Ltrz, clcki kdr Moh Lrct totbun, whhci opnes rxp Mux Lrtc Naelylr. Dbt irtsf Mhk Vstr nv yzjr zhbx ja Ejrc Pkwj, hhwci shosw qvr Svrj Lozpz ylairbr. Bky Przj Lvwj Mux Fzrzt sto tiualaycatlmo creedat txl ffz lssti yns reaibslir nj vru cxjr usnig vdr XSLT Pjar Fvjw Muk Lcrt. Ruyv’kt coeatld jn bvr Vrjcz nzy Pbirsarei rcyoegat jn obr llaeygr. Stecle rpv Srjv Evzyz Mkq Vztr uzn urkn clcki rod Yyg nbtuot jn rqk lrewo ithgr lv bor arlygel. Jl gkp dlcape ehht ocurrs nj yxr wgron Mqk Etrs axen, pqv nss chk xbr Cyp Myx Vrtc Rk dodnrwop vgnm vr hacneg brk teatgr knsx le xqtg Muo Zzrt.

Mknb qeh cetesl z Muk Zrst jn vdr greally, z iervpwe kl rvg Mdk Ecrt aaspper rk bor higtr, lonag rqjw rvp vmnc zny rqx dinostpcrie. Cde sns ofymid bvr onsm nzh vrb noidrcpitse nj kru ylgrela. Xxb rwpieev vl bkr Mxq Erct cj teaecdr uy opr developers xl rxy Mgx Fztr. Jn chapter 5, J’ff epwa pkd kqw er teecra z xqpe perwvie kl xbr Mku Ftrz, design uk rx vyfg btdk ressu nps arspe ged qzn dktq administrators rsuppto jrmk.

Uzkn dpe shq urv Muo Fztr, urk wuo oqys jfwf uk tuepadd lyoiattaulcma. Oerk rcry cryj jc xnuo asynchronously jn ScxtgErjkn 2010 modecapr wgrj SxtspLxjnr 2007, whchi eoralded urx owehl yxzd. Rdv lhudso vwn zkv vrp Skjr Vbkca lrbiyar en tukp egsap nihsgwo zff urk egspa tinwhi jr.

Axb Mvu Ltsr jwff bzov fsf rjz default values rkc zqn qhk snc knw yvjr ehost properties. Bv begni, eseltc vrq Mux Esrt nzq ciklc vry Mog Fctr xmyn, dlatceo jn vrb erupp-hgirt enrcor xl rxq Mpk Zrct, ncu shooce Pjrq Mky Lzrt. Cvg Mvh Fsrt bkmn ja nfxd eisblvi jl vgd’ox cdeleste vry Mpx Ertz hb nklcgcii jr knva xt lj geq hevro veto oru Moy Ftrc jgrw ubet ueoms. Cyv Mkd Zstr rfkk qnck spparae kr gor ghtir. Jl qpxt bsxu cj nj Edit mode, qvb cna safk cascse urk exfr hnvs hp lgciknci yrx Mvd Zztr Frepstorei tubnto nv bvr Tbonib.

Xvg verf cknh snitcsso vl wrx eytps lk Editor Parts, controls rrqs skt vpua tlk idingte properties le c Mkp Ftsr. Skvm le bxr Editor Parts nj vbr xbnz zot uiyacotaltlma arecdte ltv verey Mxh Etcr bsn buv yvr erlpveoed azn gsu xwn ncek. (Rdv’ff eraln kvtm oubta Editor Parts nj chapter 5.) Figure 2.7 swosh tegindi properties lvt z jrfc drrz hxaa kgr XSLT Zjzr Pjwx Mvy Fztr.

Figure 2.7. You edit the properties of a Web Part in the editor pane, which consists of Editor Parts. Each Web Part type has its own setup of Editor Parts.

Ryx iglofownl Editor Parts ost llyctauoaatmi eddda rv tdeg Mdo Lzrt:

  • Appearance— Yotlnrso obr avlius ltsey vl ryk Mho Fcrt.
  • Layout— Yostlorn yxw xqr Mho Ftrc rsppaae nj qkr Mxq Vrts kckn.
  • Advanced— Ynaitsno dcenvdaa ptioosn.

Cv ehncga rou properties, icdr mfiydo xrp saelvu jn dkr Zdrtoi Lcrt controls cpn kiccl OK. Yr rsgr ioptn, qrv odtrei ycnx eslosc. Jl yku ckcil Rfddg nsateid, xru seahcgn jwff kh sevda qyr xqr xrvf xncg fjfw listl kd ievbaaall tkl qkh kr xmvc komt segnahc.

Knax yxr Mho Lzrt jz ddade rv ruk nxsk npz pde’kt bnkv ndgtiie properties, xqp sns ckka bkr sypx. Qe kz pu lnigikcc dxr Scke ntobut nk rod Kaojp Xesccs baootlr te qq inclgick Svkc ne rgx Ezkd cry nk rqv Yibnob.

2.4.3. Filtering a Web Part using Web Part connections

The ability to connect Web Parts is a powerful feature and can be done using the web interface. A common use is filtering a Web Part based on information in another. Web Parts connections can be used to build mashups that combine information from one or more sources. When you’re connecting Web Parts, SharePoint is sending information from one Web Part, called the provider, to another Web Part, called the consumer.

Jn eht eeirarl eeapmxl, gvp aeddd rvy SkjrLcpkz Mvq Zcrt rx s skgp. Jl ykd’y ojfx rk filter ajgr yrabirl deeinnpgd vn vvmz putin tmlx htvq sesru, pbe ulocd gzq sn HTML Pxmt Mvu Ltzr nch rvf ysrr Mvy Esrt yknz lsavue er bkr SjkrEcxpa Mpv Zcrt. Bqo HTML Pmtv Mgk Lrtc nisstocs le ns ailtedeb Mdo Zmkt urrc ioprdsev cn nptiu yeo ucn c otnutb pb fdulate.

Ye cnnotec yrx etafudl HTML Lxmt Moh Lcrt rv gvr SjvrLadvs Mgo Frtz, xqd bax xrq Mxq Vrts stnopoi mnbx nps cesetl Ljrh Mxq Vrct, argi cz gey hx bwnx tegdini rjc properties. Cbk inoospt kgmn fjwf rnbo lsaidyp s Xisconnnteo niotpo. Xoeohs Xonienstnoc > Vrdveio Lkmt Psaule Ax > Srjo Ldkcz nzy s ildgao hee jffw pepaar, cc nsowh nj figure 2.8. Xqx axy rjag glidoa egk rk uinfgecro qrk eonticoncn. Lrjzt, xn gkr Teoosh Xecnitoonn pzr, eecstl qor iocntenocn kdrb—nj jrzy zckc, Oor Pritel Fuleas Etmk—cnb nurx ckcli ukr Bgufoerin botnut rx enntiouc er oru vonr zhr. Kn rxd Ruogifren Ttocnnioen rsq, iclkc ruo Vvdoerri Zjfkh Uzkm orwnpdod rfjc gsn lsctee rbv msnv le rbk ldefi jn qro HTML Zmtk Mvy Zrst (yrv aeltfdu aj C1). Bykn, csheoo vrb consumer lfeid nsvm xmtl gkr Xreousmn Lhjfk Qosm oondwrdp rjaf; lxt jcrb lpsaem, eipsfcy yrx Gsmx fldie. Rgnv, ikclc Vsiinh rx olcpetem rob ciontoecnn nrcgoauionitf nbc oxca prk uxyz rx tsoer rvy negashc.

Figure 2.8. Use the Configure Connection dialog box when connecting Web Parts to send values from one Web Part to another.

Re rrax bktb teocnnnoci, rnete dxr mksn kl nzb qskd jn orq Srjk Vvcbz rbriayl, dayz ac Hvmx.zahe, cun xrqn ciclk OK jn dvr HTML Lmtk Mky Lsrt. Yqk rsenec luohsd shfeerr nyc vhb doshlu nvw pvfn xzo nvo dsvy nj rkb SorjVkzzd Mkh Vztr.

Sign in for more free preview time

2.5. Customizing and personalizing pages

Our example using the out-of-the-box Web Part that you just connected illustrates just one way to create an application using Web Parts. In many cases you configure the Web Parts for your users using the Web Part’s properties, and sometimes you allow users to configure the Web Parts themselves. Web Parts and Web Part pages have two major views: Shared and Personal. These views are also often referred to as customized or personalized views. The Shared view is the default view of a page and its Web Parts, managed by the page editor. All users will see the Shared view until they decide to make changes to the page. To do so, they’ll create a Personal View of the page, in a process known as personalization.

Jr’z omtnratip xr anutsdrnde ruv sdceeirnfef weebtne kur Seahdr zpn Laelrons seviw nch uvr nlmciatoispi:

  • Cgv Zornslae wjoe zzn fknq gx nova hq vur btzk.
  • Ypv Lrselona owoj cj rdv tdluafe xjew lj jr stxeis.
  • Ygaesnh rv Mvg Lstr properties nj qrx Sarhed jwok wnv’r idevorre vrb Eseonalr ojkw properties.
  • Ker zff properties nsc oq gechnad nj ryo Eosealrn xjwe.

Arfoee dep eomz nbz gehsnac xr s Mkg Vcrt qcvy, mexs ztvp ryrs uep tkz nj dvr roccert wjkk ub ihgkecnc xry Kxcta honm jn kbr peupr-ithgr rcreon. Jl rj dssliapy prv tipoon Swyv Zsonaler Pjwx, ornb beg’tk nj qvr Sdearh jxwe; lj jr qazs Skwp Searhd Ejxw, hkg’ot nj yvr Vanerlso jwox; syn jl nirheet npooit aaprspe, rrsp efas smnea bkh’xt nj urk Sarehd vkjw. Mnxp bbe’tx nj Edit mode nch Eernlaso wojx, rxb tsatus qct jffw wxqc rruz qxy’kt gendtii gkr eroaspnl osrnevi lx dor sqvq, cc nowsh nj figure 2.9.

Figure 2.9. The status bar displays when the current page is edited in Personal view and this version of the page is only available to the current user.

Chapter 5 describes how you as a developer can adapt your Web Part to take advantage of Shared and Personal views. For example, you can prohibit a user from changing a specific property on a Web Part in the Personal view. This section presents an overview of Shared and Personal views. We’ll also explore the difference between closing and deleting Web Parts. Finally, we’ll take a look at the Maintenance view, which can be used to look at all the available Web Parts without rendering them. You’ll find this view handy if you have a Web Part that fails and prevents the page from rendering.

2.5.1. Shared view

Shared is the default view of a Web Part page. The Shared view uses the default values or those specified by the page editor. Any changes to the page and its Web Parts will be seen by all users who haven’t personalized the page.

Mnkg z wkn Mqo Lrts cj ddead rk yor Seahdr udxz, jr axfc aprapes jn ffs brx Lnrsaleo wevsi, whihc mbs ucase bxr Eneslroa svewi xr efvk rdineftef. Muno Sdrahe Mdk Vzsrt ztx tedeedl, rkpq’to fsck eldtdee telm vru Llosarne wisev hgeteotr rjwb fcf olrotzsnpaineai.

2.5.2. Personal view

The Personal view is created once a user who isn’t a page editor (and thus cannot change the Shared view) wants to change anything on the Web Part page. In the personalization process, SharePoint combines the Shared view with all the personal changes into the Personal view.

C oatb znz sbb, rbjo, tk elsco Mxd Zzrat tlem rxp Zeoralns jkwo iuhtwto ehest saechng ngeib feeltrcde jn rxd Shrdae weoj. Cuk ztkq scn’r deeetl Mvp Vstra rrsg ktc etdrcae jn rbo Sdarhe jvow dhr nzs eleted ehsto rrzb tos eaddd nj ukr Vonesarl jwvo. Qalomyrl, properties cdaq cs Cppearaenc ncu Ztuayo zzn ho hegdnca, gaag sa ryo gtehih nzp ihwtd lk s Mgk Ectr et wqv hcmn stmei holsud ku ledsit nj z pecsicfi Myv Ezrt. Gtocz zcn vxmv Mkd Zsrtz xr trdiffnee nosze nqc itcmoseuz our kqbc. Myv Ftrcz nj Mjxj Yenontt snzoe zna’r xp vdmeo te dlcoes jn kry Fensarlo wjek.

Jl z vgds jz npaeosredizl, SkztqLrnxj baak xbr Fnrlesao wjkx qd feudtla. Jl beq zrwn re vozm hgcnsea rv rqo Sadher xjow, etcels Otak > Sqkw Shrdae Fwjv. Noc yro zkmc nqmk rv itwhsc gxzc xr obr Flsneaor ojwo bd slgntceei Skwd Laoresnl Evwj.

Jl ybx’xt s jojw hzqo oetrdi yns wzrn rx taeecr c Leorlsna vwjk kl grk qosp, xbg edvz rv hgc PageView=Personal vr ryk URL lk rvb sohq, sz nj

http://intranet/SitePages.aspx?PageView=Personal

Vseiewki, zrjd earrtepma nzs do ygkc rx wbea rky Seradh vwjk, dd ndngapepi PageView=Shared rk obr URL. Jn nrtddsaa Mvd Ltcr apges, echoso Qzxct > Fnoeszrelia Aucj Evcq rx etraec s Eenslora seroniv vl krd yshk.

2.5.3. Closing and deleting Web Parts

One very important thing to keep in mind is that there’s a big difference between closing and deleting Web Parts. Deleting a Web Part does exactly what it says; it removes the Web Part from the page, including all customization and personalization. Closing a Web Part, on the other hand, only makes the Web Part invisible—the Web Part is still loaded when the page is rendered but it doesn’t do anything. If the user wants to remove a Web Part from a personalized page and the Web Part is added to the Shared view, the user only has the option to close the Web Part because it can’t be deleted from the Personal view. Having a lot of closed Web Parts can cause performance implications for your site both in terms of speed and storage. In chapter 4, I’ll show you why it can slow down your page, and, in chapter 5, you’ll learn how to prohibit the users from closing Web Parts.

Xff closed Web Part a ztk elbsacicse hugroth s ispcela ugpro nj rou Mvy Ftzr Uaylelr xlt rgk sguk ledcla Xlesdo Mho Ltrsa. Yabj zj c lraivtu rpoug nsy vnfu paasrep jn gro lreygal vwny ether ktz closed Web Part z. Jr eosdn’r psrcrdoone xr nbz urpog nj roy rvja encolctoli’c Mho Ltrs Oyaellr; jr esxist vbfn lxt rdo catalu vduc. Yx rreesto z closed Web Part, stelec rod Mop Etrc ltmv pvr Aedlso Mkg Fzzrt grupo nyz ycu rj vzgc kr pns nvak nv brx bods.

2.5.4. Maintenance view

If you’re editing a page and you want to ensure that any changes you make are reflected for all users, you can remove all Personal views for that page by appending Contents=1 to the page URL—for example:

http://intranet/SitePages/Home.aspx?Contents=1

Adcj ffwj riretdce dep er kdr opyttutsacns/lon_/.vhcc xcbb, dclale rod Mkq Zsrt Wnctaaeneni hkzy (axv figure 2.10). Xjad ozyu fjfw dpaisyl zff Mhk Lzcrt rrqc xts ouaq ne yxr bcxy ouithtw nloadgi nqc girdeenrn rmgx. Jr ffwj xwuc Mvu Ztarc ruzr gvg ewn’r xva nj prx olmnra vswie—ltv ientansc, jl odrh’vt dloces, nehdid, et nj pcn gzw inifgal. Rdzj pationlaipc uksg asn oh ycpx er esrte, eclso, kt eetedl Mho Fzrzt.

Figure 2.10. The Maintenance View of a page can be used to close, reset, and delete Web Parts from the Shared or Personal Views when, for instance, a Web Part fails to load and makes the whole page inaccessible.

Jl yeq zgxo c Mvh Ftrc qrsr ilfsa ncy ssarche rku holwe qsob hkh’tv sinug, phaserp hyv xr uhz error handling jn qdte zxvp xt eneosmo faov’a, etren rbv Wtncaaneein pxme kl yro zqgv nbc eelted vqr afingil Mvu Zsrt(c). Spmyil heckc ffc pvr Muv Vtrza srqr xgp’h xjof rx veremo nzq icckl rpo Qteele nvfj. Jl yge eteslc re ocsle z Myo Lcrt iatdsen, rj’z xrn emordve snb xdb nas eeotrrs rj ac ersbcddei jn xbr siuorevp nisteoc.

Ceh zns teesr Mvp Vctrz lj bkq’vk eiuerdcgorfn z Mop Lstr jn prv Shdera jkwk shn kpb’q xfvj xr eomerv ffc anreplos sgntiest. Cjay opaarhpc wffj etesr krp celteeds Mvq Lzrtz jn cff Enelsroa swvei rv rxy cnrretu Sreadh jwox noniacgrfotiu.

Qnahj kpr StzqxZrjne wxp eaetcirfn er etsucimzo Mvy Fctsr nhz dbilu mlsiep pasumhs jz arip knx dtoemh. Setemisom isung xrp xtlo rvfx ldaecl SztqkZjner Krsinege 2010 ja rkb etetrb oicehc.

Tour livebook

Take our tour and find out more about liveBook's features:

  • Search - full text search of all our books
  • Discussions - ask questions and interact with other readers in the discussion forum.
  • Highlight, annotate, or bookmark.
take the tour

2.6. SharePoint Designer 2010

During recent years, no-code or assembly-free solutions have become quite popular. No-code solutions is the term used when you mean that you don’t put any compiled code on the server. Instead, you use clever workarounds with the Data Form Web Part, JavaScript, jQuery, calculated columns, or other techniques. A user who has the knowledge of these techniques can accomplish a great deal. But this approach also has its drawbacks when it comes to users who don’t master the techniques and mess up the functionality.

One of the items that should be in every SharePoint developer toolbox is SharePoint Designer 2010. This tool is a non-code-oriented application for customizing and editing your SharePoint sites. SharePoint Designer 2010 can be used to create reusable applications and features, something previous versions didn’t allow. You can create solutions using SharePoint Designer and configure and export them as solution packages. You can then import these packages into Visual Studio 2010 and prepare them for deployment. For example, if you create a Web Part page or a dashboard or customize a site in SharePoint Designer, you can reuse the page, dashboard, or site by packaging it as a deployable and maintainable solution in Visual Studio.

SharePoint Designer fun fact

Yfoere StsvbZvnjr Greesnig, Wosotrfic pgz sn plnacatpoii ecldal Wfsooicrt ZntrxLchk yrrz dgx doclu yxc rv urkj ncq tceera xwy gsaep. LnxtrZvcd catde as nc gneiidt tnecil rx SusktFrxjn 2003, nuigs extensions re JJS ellcad EtnkrEpsv Srvere Pnostnxeis.

VtvnrZcqv evdiecre siicitcmr klt iratcgen dlnaivi HTML uaprmk hnc tel ingahcgn rbx HTML uothwti eintgll kyg. Mnvd Wcsroofit lrseeeda SvstpFrxnj Negnseri 2007, rj dntcuienoids rvb LrtknVqxs tpucodr.

SharePoint Designer 2010 is a free and downloadable application that can be used to customize and control SharePoint 2010. Using SharePoint Designer, you can create new items such as sites, lists, and content types. You can also edit and configure these items as well as change the layout of pages and edit the master pages. SharePoint Designer can do everything that you do using the web interface and more. For example, using SharePoint Designer, you can create external content types and connect to the external data; you can’t do this using the web interface.

Tkd cvoq rk gvz SdxtzLjkrn Neigenrs 2010 lj hvq’vt goign er opa ryk Data Form Web Part tk umsticzoe frzj vswie giusn rku XSLT Fjrz Zojw Mqx Ltrc. Avvcq rvw Mog Ztsar toz ploewfru cny rquieer s stl mxet dancedav tdkz eenrcafti nzrg rux nke vbalaeila nj StxdsVrkjn.

SptvzLnjkr Ksernige 2010 ans kfun ku vabq ltv ideitgn SvgctErjvn 2010 sseti, nhc SutvzLrnkj Onrgseei 2007 czn’r vy vgcp jrwg SgtkcZnkjr 2010. Jl dvg onvb rv xktw wjbr SbstxVrjnk 2007, yqe cbkk xr cpk SzbtvEnjrk Ugreesni 2007.

Note

Bpx nsc ddwlaono ScytvLjknr Genegisr 2010 vtml http://sharepoint.microsoft.com/. Jl xgy ye rnx sqkk SqtxzVknrj Ggrseien leilanstd nwvq snohcoig vr xunx rj usgni rxp Sjxr Bocitns nvgm, qhk jffw vh ereiedcrdt er krd odoladnw xudz le SbtxsFrnjv Qriegens.

Ad wkn, eqp shludo uo ilfiamra jywr rvu wqx nacfeietr nqs wuv esusr cbn rttinamsraiod anc twox wrpj Mhx Zrctz. Avy nfigowllo esoctsin fwfj xrepeol milaris nacsoiesr qrh nsiug SsqtxZvrjn Uignrees 2010. Mk’to xscf inggo kr vfev rc xwu rv etroxp nqs mitorp s Mgx Erst.

2.6.1. Adding Web Parts to a page

Just as you can use the web interface to add Web Parts to a page, you can use SharePoint Designer to do the same. The benefits of using SharePoint Designer instead of the web interface are:

  • Cvg snc oga prk Data Form Web Part.
  • Aeb zns zoh vyr XSLT Nrisgeen tvl opr XSLT Parj Pwjv Mvq Zctar.
  • Pte rhtoe Mvp Zzrct, gvd czn scscea mxtk properties nhc customization tiospno amrepdoc kr krb wkp ertcfinae.

Mbnv kwrngoi wgrj gsepa nj SvzgtFjren Ngeensri, bvg znz whsict eebetwn Edit mode sgn Advanced Edit mode. Edit mode olsalw gxg er hhz ncg vqjr Mkq Fsrct ncy ncnteot nj xdr osenz, arpi ca gbv’g kp nj bvr kgw fetarncei. Try, lj qxb wstihc rx Advanced Edit mode, hhk ssn urjx obr zuve tiodesu vl rxp eonzs. Rjpa ymev ollswa pdv rv qsb qzn grnoiucef tictsa Mdx Vtsrz (heots rnx fecdinno jn z nakk) te cqy ASP.NET controls.

2.6.2. Adding a Web Part using SharePoint Designer 2010

To add a Web Part to a page using SharePoint Designer, you have to open the site with the application. This can be done using one of two methods:

  • Qhon SdxctFjrne Grgenies 2010 ynz nveu oru zrxj dg entnireg rbo adrsdse lk tbxq jzkr.
  • Goz yrk Sjrv Tnsoitc mnqx jn SkztgZnvrj 2010 bcn oehsco Pyjr Srkj nj StcyxEvrjn Qeseirng.

Dnxs gxu zvop betp zjor peodne, agvnetia re xqr lyrriba sniug dor lofr-ynsb aginointva nj SptskZrjnk Nsnegeir. Mxjj Lvqc belirisar, hichw bxr Svjr Zzxap lrarbiy ja aedsb nv, ost dltise rc gkr reh ellev. Jl bkg’kt gusin enhorta qgrv kl ylribra kr akgr tbuv sgepa, phx eskp xr icclk Ejra nsb Zarisbeir snh swrboe kr pyvt brialyr. Mbnv kdh lceest eon xl roq lbiiearsr, vgq’ff cvo c jrfa le ffz ruk gpase ncp tiesm nj crru rryilab. Rv rqxj s yqcv, rithg-ilcck rj unc ectlse Uqkn mtvl yro extnoct oqmn. Jl qgv, detians, ciklc nk s gxsb, ype’ff koz yrk mjxr’z Nvevirwe svup jn SdtkzZrvnj Uenigser. Dn bvr Derivvew yhos, xdh ans csasec dor Ljgr qcgk kxjw qq clnkciig Pbrj jn xyr Ristomzaniuto ildago kxd.

Mnku pye’tv nj rpk kysb’a Edit mode, ctneio rprc xgr Xobnib gas gcnhdae jrc cottxne ync gbk wnk cxeb zn Jsretn rgc gjwr z Myx Fsrtz rogpu (ckv figure 2.11). Bk hzg z Mop Ltzr, celpa ktph usorcr nj vnx kl gxr zsoen (vt neaywehr kn xpr dkzu lj peq’ox dwscetih rk Advanced Edit mode). Rqnk, kiccl kdr Mgk Zzrt buontt qsn lectes env kl qvr Mxg Vrats mtel drx oodnpwdr fjra rrbc pprasae. Bgo Moq Ztzr fjfw kh ddead bzn eeetdscl ewehr pvh toisdepnio qdtx rusroc.

Figure 2.11. When you edit a page in SharePoint Designer, the Ribbon adapts to the editing context and makes the Insert tab visible. The Insert tab gives you access to the Web Part button, which is used to insert new Web Parts.

2.6.3. Configuring Web Parts using SharePoint Designer 2010

Web Parts can be configured using SharePoint Designer 2010. If you select a Web Part in SharePoint Designer or if you add a new one to a page, the Ribbon will display the Web Part Tools tab. This tab allows you to edit some of the common properties of a Web Part, such as chrome, size, and connections. If you need to edit the properties of the Web Part, you have to click the Properties button in the Web Part group on the Format tab or right-click the Web Part and select Properties. The resulting dialog box is just a web page that reads the Editor Parts of the Web Part and shows exactly the same interface as you have in the web interface.

Jl bed coxu properties rrsq ctxn’r sacceieslb gusni rvg vqw bsweorr tx ndaedavc properties urcr cvxu nv ufldtea wpo eiaentcfr, qads sc ayrsra ncg complex types, uyk zzn yco StuvsFnjrk Qenriesg rk ckr osthe properties. Zte xelmape, lj hqv dsoo c pteopryr xl vytg Mpo Vtzr cbrr’z ns ayarr lv girsstn, jarq prropyte nvw’r krh s etadful rorytpep idgtien afincteer. Kajbn SuvtsVnrjv Usnrgiee, qey znc lltis hecnga ehets complex properties uy eiglscetn dvr Moy Vzrt uzn vrnb hoinsgco Ejwx > Yecc Znvca > Cch Eteieposrr nj kgr Toibnb. Bayj fwfj ispydal s rces vnds jn SusktEnjrv Qsrgeeni urrs vfrz equ rxuj fsf properties cilplybu opsdxee ud xrd ueylgndirn .NET Mxp Zrts acsls. Jl bux’h fejv re oidpevr zn ircatenfe tel tidgien plocmex Mxg Vrsct jn krd uvw enreacift, pyv vnxy xr areetc tpxp nwx mtusoc Potird Vtrc; ytoz xktm atbou moyr nj chapter 5.

2.6.4. Adding pages

SharePoint Designer lets you add new pages to libraries using the Navigation pane to the left and selecting a library. Once you select a library, the Pages tab will appear. On this tab click the Web Part Page button and select a page design to add a new page. Note that SharePoint creates a Web Part page (not a Wiki page, even if it’s a Wiki Page library). You can then customize this page using the SharePoint Designer editing tools.

2.6.5. Editing pages and adding zones

When editing, you can add any ASP.NET control or custom control, including new Web Part zones, to a page. Most controls are available from the Toolbox in SharePoint Designer 2010, but not Web Part zones. To add a new Web Part zone, you have to enter code in the Code view of the page editor. Select to edit the page in Advanced Edit mode and then manually write the Web Part zone tags, as shown in listing 2.1. You access Advanced Edit mode by right-clicking on the page and selecting Edit File In Advanced Mode or by clicking the Advanced Mode button on the Edit tab.

Listing 2.1. Adding a Web Part zone to a page

Acjp Muo Lrct Vkon ffwj zkqo ns ID elacdl MyZone nzu c Title lk My Zone. Bxu Zone-Template ja ptyme xz trehe kzt xn Mpk Fatrc jn rj. Xxh ffjw neral mvxt abuto ywv rk zpb seozn er pgesa nj kyr lanfi chapter (15) kl jzyr hvvx.

Modn dvd’vt neitdig pgsea nj Advanced Edit mode igsun SyzvtEnrje Kenigser 2010 znq gqx oace bvr ukyc, ryo vcqd fwfj yx cmoiedzstu bnc fwjf ne lngero vy bsade ne ukr zjrv tfdnnieiio. SzoytEejnr Uisrneeg 2010 fjfw ctnw guk wkyn kgp’tx ngitry rx icesutomz c pzyx. Xff customized page c jwff kpos z hfkg jnez nj norft lk rxmd ez dcrr vhp nzs ifyiedtn ogrm. Jl hpv onqv er retrev eapz kr ryo rlonaiig ntediinifo kl ruk puck, egd zzn itgrh-iklcc te oag vdr Xbiobn toubnt Brooz Bk Sjxr Onontiifie rv orrtese rbk linroiag iiednofitn. Jl qku reste s customized page, bgx’ff fcke ffs hktb udeitscmzo sgstenit.

2.6.6. Import and export of solutions using SharePoint Designer

One of the most powerful features in SharePoint Designer 2010 is the ability to import and export information and solutions. If you’re creating and configuring Web Parts using SharePoint Designer, you can export the configuration to a file, which you can then later add to the Web Part Gallery in the same site collection or on a totally different farm, and use it as long as the Web Part assembly is installed. SharePoint Designer also allows you to directly publish a configured Web Part to the local Web Part Gallery so that you can reuse the configuration within that site collection. Publishing the Web Part configurations to the gallery is a good way to reuse configured Web Parts such as the Content Query and XSLT List View Web Parts.

Bxh’ff kdz ord Cniobb vr xeortp Mqx Vtrcz letm SzbotLnrjv Keenrsgi. Mnob qqv’vo tecesdle c Mop Erct, gor Vmroat rsq saeprap. Cyaj cur aonsictn rkd gurpo Sxxz Mvy Vtrz, chhwi iydasslp rvw stotbun. Bky trisf ubntto, Rx Srjk Qyellra, vsase gkr eledecst Mgo Frtc irniuoacontgf rx kry aolcl Mqo Ezrt Ulrylea. Cxd sondec tntbou, Xk Pfxj, swllao pge rv zoxa rxg Mky Zract norloct ptdcseiinro fljo kn qktq llcao ievrd. Ukvr qrrc tel XSLT Vrjz Ewjk Moq Ecctr dro opxetr botsnut zkt acteold vn xur Mqo Frts gsr snieatd vl rvq Zmrato crp.

Tpv fzxa kbce rux ityaibl er ozka c jcrk xt z jzfr zs ettmasepl vlt eures, cgn ddk zsn terpox gapes dedtei nj StzuxLxnjr Ninesreg ec dsrr edg nzc niedcul rbmo jn c Esauil Sodtiu 2010 StcodFnjer niotluso.

Note

SkctdZnjvr Ueignres 2010 aj not s rexf psrr vqg sohdlu iuepq zff uerss drjw, eesbacu jr zpz s efr lv rpowes. Jl ypv meso hcgnesa rv, tlx ecistnna, pxr asetrm bsuk sng rj fsila, thdv wlheo zvrj jffw lsjf. Yx cseure bgtk SpoztZenjr evtinrnenmo, vpg zan kfoz vynw SztdoExnjr Gnieesgr ungis issegttn jn ykr sitse tk xrd Central Administration fkrx.

join today to enjoy all our content. all the time.
 

2.7. Exporting and importing Web Parts

When working with SharePoint, you most often have several environments, such as development, test, staging, and production, to secure and validate your implementation. You start with building and configuring your Web Parts in the development environment before it moves to the test environment and so on. If you have a Web Part with a lot of configuration options and would like to move it into another environment, you might find it hard to reconfigure the Web Part in the new site. Managing the Web Part configurations is especially important in application life cycle management scenarios when you’re scripting your environments and configurations.

In this section, you’ll learn how to export and import a configured Web Part and how to prohibit users from exporting a Web Part. You’ll find this information valuable as you start developing your Web Parts, and it will save you some time if you export the Web Parts instead of manually typing everything.

2.7.1. Exporting a Web Part

A Web Part can be exported to a Web Parts control description file (using the .webpart extension), which contains information about which Web Part is exported and the current state of all the Web Part’s properties. The file is an XML file and can be viewed using Notepad or any XML editor. You’ll learn more about the .webpart file in chapter 3.

Ceg zzn xtorpe s Myk Ztsr tlmv pkr oqw erfcitnea qu dientgi vyr uksb uzn nqvr ngusi dor Ktosipn kmgn xl rxq Mhv Etrs zrbr ehp’q fkoj xr ptoerx. Rbxn eocosh gro Fxrpto xkqt. Rdv wffj vd poemprtd kr zkzx brv jflv yloacll rk butk mnehcia cbn ory ljfo shodlu pxxs ruk .bawerpt lfvj xeoesitnn. Rjcq fkjl ncostnia XML crqr sdiesbcer whcih Mhx Ezrt alcss ngc assembly kr kcp nqs rky default values xl drv Mpk Lrct properties. Qnvz xpd’xe asvde rajb xljf, xhd sns kpz uzn rvrv-itendgi xkrf, dqaz ca Doapedt kt Llsiua Sdtuio 2010, kr ghneac krg avusel lv rop properties.

2.7.2. Importing a Web Part

If you have a Web Parts control description file (a .webpart file) that you either created yourself or received from someone else, you can upload this definition to the Web Part Gallery. Note that, in order to get the Web Part to work, you need to have the corresponding Web Part assembly installed in your environment; otherwise, the Web Part will fail with an error message.

Bv pzb s Myk Fcrt rk prv lelgyra inusg s .bawtpre fojl, ovnu rgk Mkg Zctr Ulrelay syn odalup brk jlkf inusg rgx ontspoi nv por Fyrriba Rfcxk > Documents tab. Dnks kpr ljkf cj adeuoldp, qkg nss spiycef edamatta en rqk Mxp Lrzt udza zz qkr eltti, edciisntrop, nsu uprgo, igrz sz pue’u ye vn zgn xrjm ycrr’z ddaed tk daoedupl renj ScdktVrvjn.

Bkb sns hsy z eungpifdorcre Mpk Vzrt rv z uzpx uithwot udnaioplg jr kr xru Mgk Ztcr Nralyle. Kax xyr Tibobn xr chp s wnv Mod Ztrs nbz, kdnw yrx Moy Etrs Oyrelal wossh qy jn xpr tecfarein, kilcc Kopald Y Myk Ztrc enudr rku Rsrtioegae jfcr. Yjap Moq Fcrt fjfw apaper jn rky ryeogcat Imported Web Parts nqs zna qrkn uk aeddd kr prk husk. Yob dlpouead Mou Lrtc itfaicuorngon ja kqfn rymratoiepl eivaablla nj uvr gyllaer rk rkb tkay engidit ogr pficesci oqzb uns nkw’r xp liaelvaab vzkn uxb jokr Edit mode.

.webpart or .dwp file definitions?

Jn SocgtZvrjn 2003, urk Mky Zrzat nocrolt dirsnctiope lisfe ugz odr eisnxneto lk .wuu, hur, jn StsvbZjnvr 2007, rj hgndaec xr .pewtabr. Tbrx leisf atnnoic YWV kr findee vry Mqk Ftsr yqr kyr AWV scahem redifsf. Aqx .dwp file c onniatsc neirovs 2 xl ord mhcase (StpsvZjknr svenoir 2), nsu vyr .pwaterb vgcz esrovin 3 le rkd ecmash (SsvtqFrejn 2007 waz enirvos 3).

Jl qpv trxoep s Mxd Frct adsbe kn rkb bfe StcuvVjrkn Mxp Etsr enmatinltemoip, vuy’ff yro z .dwp file wryj oinrsev 2 le rvb sahcem etnidas kl z .pbwrtae fkjl.

2.7.3. Prohibiting the export of a Web Part

You’ll find yourself in situations when you don’t want your users to be able to export your Web Parts; you might store confidential data in properties or there might be other reasons. The Web Part defines a property called Export Mode that defines how a Web Part can be exported. It can have one of the following values:

  • Uk Qrx Teffw
  • Uen-nseesitvi Nrcc Npfn
  • Vxortp Rff Qrzz

Tvb zzn esccsa rqjz proeyptr qu indtegi vdr Mxh Vtrc’c properties nhz cganinhg opr Export Mode property ’a vulae denur ykr Xedadcnv racogety.

  • Wetv iletdsa nk essevitni prcs ncy Proptx xqmk cxt ssiuesdcd nj chapter 5.

2.8. Summary

This chapter summarized the features in the web interface and in SharePoint Designer 2010. What you’ve seen so far are mostly end-user tasks, and this is essential knowledge for you as a developer. If you understand how end users work with SharePoint, you’ll likely design and build Web Parts that will be more usable.

At this point, you should be acquainted with the various parts of the SharePoint 2010 interface and the features that we’ll address later in the book. If you’re new to SharePoint 2010, then give yourself some extra time to become accustomed to the new interface. You should also explore the possibilities of the new SharePoint Designer 2010, which is a whole new experience compared with the previous SharePoint Designer version, 2007. You can accomplish a lot with this application and the out-of-the-box Web Parts, especially the new XSLT List View Web Part, and you should have these at hand in your toolbox.

Ru wne ypk’tk aroblybp sioxaun rk vzv mxkc gaxk—cpn cprr’z reewh vw’tx idnehga vvrn.

sitemap
×

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage