52
Inside WSS sample shots 2008-12-31 This is screen shots from the samples from the book Inside Microsoft Windows SharePoint Services 3.0 by Ted Pattison & Daniel Larson (ISBN 9780735623200). The idea with these screen shots is to have a picture index to the book, which also gives view of what is possible with WSS 3.0. The code samples are downloadable from http://www.microsoft.com/mspress/companion/9780735623200/ The samples has been executed on a Virtual PC Image downloadable from http://www.microsoft.com/downloads/details.aspx?FamilyID=1beeac6f-2ea1-4769-9948- 74a74bd604fa&DisplayLang=en This VPC has been updated to Visual Studio 2008. This means that the samples (which are 2005 version) will be updated during the first load (of each solution). The screen shots are from the older VPC with only Visual Studio 2005. Each heading is a folder in the samples. After the heading a short description of the purpose follows. Sometimes also an installation instruction is given if needed. Usually a install.bat file exists in the solutions. Chapter01\cs\Hello_WSS_OM P.20 Console app that uses obj model Chapter01\cs\HelloWorld P.26 A feature, that changes the name of a site and reverses it at deactivation. 1

Inside WSS sample shots

Embed Size (px)

Citation preview

Page 1: Inside WSS sample shots

Inside WSS sample shots2008-12-31

This is screen shots from the samples from the book Inside Microsoft Windows SharePoint Services 3.0 by Ted Pattison & Daniel Larson (ISBN 9780735623200).

The idea with these screen shots is to have a picture index to the book, which also gives view of what is possible with WSS 3.0.

The code samples are downloadable from http://www.microsoft.com/mspress/companion/9780735623200/

The samples has been executed on a Virtual PC Image downloadable from http://www.microsoft.com/downloads/details.aspx?FamilyID=1beeac6f-2ea1-4769-9948-74a74bd604fa&DisplayLang=enThis VPC has been updated to Visual Studio 2008. This means that the samples (which are 2005 version) will be updated during the first load (of each solution).The screen shots are from the older VPC with only Visual Studio 2005.

Each heading is a folder in the samples. After the heading a short description of the purpose follows. Sometimes also an installation instruction is given if needed. Usually a install.bat file exists in the solutions.

Chapter01\cs\Hello_WSS_OM P.20

Console app that uses obj model

Chapter01\cs\HelloWorld P.26

A feature, that changes the name of a site and reverses it at deactivation.

1

Page 2: Inside WSS sample shots

Activated feature:

Chapter02\cs\CustomApplicationPages P.50

The feature creates 7 application pages of which 6 is on the site action menu:

2

Page 3: Inside WSS sample shots

\Layouts\<FeatureName>\ApplicationPage2.aspx P.56: Use SPGridView

3

Page 4: Inside WSS sample shots

\Layouts\<FeatureName>\ApplicationPage3.aspx P.56:

\Layouts\<FeatureName>\ApplicationPage4.aspx P.58:

4

Page 5: Inside WSS sample shots

5

Page 6: Inside WSS sample shots

\Layouts\<FeatureName>\ApplicationPage5.aspx:

6

Page 7: Inside WSS sample shots

\Layouts\<FeatureName>\ApplicationPage6.aspx:

7

Page 8: Inside WSS sample shots

Chapter03\cs\CreateNewSitePage P.65

Console app that creates a site page

Chapter03\cs\CustomSitePages

A Feature that adds two menus to the top navigation bar. You must activate this feture from the SiteCollection site for it to install.

P.86

P.70

8

Page 9: Inside WSS sample shots

P.73

P.74

9

Page 10: Inside WSS sample shots

P.76

10

Page 11: Inside WSS sample shots

P.66

11

Page 12: Inside WSS sample shots

12

Page 13: Inside WSS sample shots

P.81

13

Page 14: Inside WSS sample shots

Chapter03\cs\CustomBranding P.97

A SiteCollection Feature with two demo pages reached from the Site Actions.

14

Page 15: Inside WSS sample shots

15

Page 16: Inside WSS sample shots

Move the mouse around on the page to discover what styles are in use. In this example the mouse points to the site name in the upper left corner.

16

Page 17: Inside WSS sample shots

Chapter04\cs\LitwareWebParts P.99

A SiteCollection Feature including 6 webparts.The webparts are installed locally in the webapp, which requires following:Before running install.bat correct the path to the path to your WSS sitecoll like here:

@SET BINDIR="C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin"Add to web.config:

<SafeControl Assembly="LitwareWebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=74bad7277fe0d19e" Namespace="LitwareWebParts" TypeName="*" Safe="True" /><trust level="Full" originUrl="" />

From the Site Settings on the SiteCollection the webparts can be previewed from the webpart gallery:

17

Page 18: Inside WSS sample shots

P.110

Edit a page with a webpart template and add webparts to the zones

Three different webparts:- Contact viewer: Searches site for contact lists and show their content- P.106: Hello World- P.120: User Control: Loads a user control (.ascx)

18

Page 19: Inside WSS sample shots

P.123

A verb webpart adds menu items to the edit webpart menu:

And in display mode:

P.115

Manually write feed for the RSS viewer:

19

Page 20: Inside WSS sample shots

P.126

The list feed webpart can provide feed to the RSS view webpart

The provider (feeder) reads the lists on the site, which are then fed to consumer (viewer).The RSS viewer also uses verbs.

Chapter06\cs\AnnouncementsListConsole P.179

This is a console app that uses the obj model on the announcement list. Included is search.Just a sample.

20

Page 21: Inside WSS sample shots

Chapter06\cs\LitwareFieldTypes

This addin is not a feature, but deployed in - \TEMPLATE\XML\fldtypes_Litware.xml- \TEMPLATE\CONTROLTEMPLATES\CompanySizeFieldControl.ascx- LitwareFieldTypes.dll (in GAC)

P.194

It contains custom types (CompanySize) that can be added to lists and doclibsWhen adding it to a list it looks like this:

21

Page 22: Inside WSS sample shots

When creating a list item you see

When displaying the list you see

Chapter06\cs\LitwareTypes

This is a sitecoll feature that extends the company size field to a Site Column (a <Field> element). This again enables the column to be added to a Content Type.Also it enables the data type to be searchable in a whole site collection.

22

Page 23: Inside WSS sample shots

P.186/195

Three Site Columns are installed

Also two Content Types are installed

23

Page 24: Inside WSS sample shots

The Content types contains: (First the “Individual”)

24

Page 25: Inside WSS sample shots

And the “Company”

Going back to the list from last solution one can now add all the Site Columns and the Content Types to the list (although it might look messy).

But first Content Types must be enabled on the list

25

Page 26: Inside WSS sample shots

Now you can add both Content Types and Site Columns

26

Page 27: Inside WSS sample shots

It makes no sense to add the Company Size one more time, unless you want to use it as a sub company size, even though it has been expanded to a Site Column. The original field is also a Site Column now.So let’s add Content Types. Both can be added at the same time

27

Page 28: Inside WSS sample shots

OK, the Content Types would not reuse the Company Size field. This was because it was added as a column for this web only and not a Site Column. Unfortunately you cannot see on a column if it is added as Site Column or just a field. But you know that if it is in a Content Type, then it must be a Site Column.

After a little fiddling the field only Company Size was removed

28

Page 29: Inside WSS sample shots

Now the list can have added three different types of items with the columns seen above

29

Page 30: Inside WSS sample shots

A new Company

30

Page 31: Inside WSS sample shots

The feature installed also two preloaded lists. 1) Venders (uses only Company Content Types)

and 2) Customers (uses both Company and Individual Content Types)

Chapter06\cs\ContentTypesConsole

This is a console app that uses obj model to add Content types to lists and populate them with items and views. Just a sample.

31

Page 32: Inside WSS sample shots

Chapter07\cs\DocumentManager P.220

A feature containing 4 app pages, 4 doclibs and 2 normal lists.

32

Page 33: Inside WSS sample shots

The 1st app page

P.222

The 2nd app page

33

Page 34: Inside WSS sample shots

P.227

Menu for the 3rd app page

The 3rd app page

34

Page 35: Inside WSS sample shots

P.243

The 4th app page

Chapter07\cs\Leadsheets P.229

An Infopath sample. There is no .sln file.The Infopath file .xsn is renamed to cab and extracted to \SourceFiles\The dataset sourcefiles are then driven through XSD.exe to create the class in \SchemaGeneratedClass\More code is in the book (p. 232) where the class is used in an ItemAdded() event to read the added InfoPath file and write the content to another list.

Chapter07\cs\HelloDocx P.237

A Console app that creates a .docx on the fly…

Chapter07\cs\HelloDocxfromASPNET P.240

Same as above, but now from ASP.NET…

35

Page 36: Inside WSS sample shots

Chapter07\cs\PackageViewer P.245

A full functional utility to browse .docx files or other OpenXml files. Here it is the \LitwareLetterTemplate\ LetterTemplate.docx

Chapter07\cs\LitwareLetterTemplate P.250

Like the Leadsheet proj. A sample .docx that can be deserialized using a class made with XSD.exe

36

Page 37: Inside WSS sample shots

Chapter08\cs\HelloWorkflow P.266

This is a sitecoll feature with a workflow.Before building it, a hardcoded line with the userid of yourself must be corrected: string UserAccountName = @"SPVM\administrator";After activating the feature, enable the WF (create a WF association) on a list or doclib (List Settings – Workflow settings):

P.268

Manually start a WF on an item:

37

Page 38: Inside WSS sample shots

P.269

Select a WF to start on the item:

Now the WF is running – click on the “In Progress” link to go to the status page.

38

Page 39: Inside WSS sample shots

P.269

Select a task to edit

Edit the task – Click Edit Item

39

Page 40: Inside WSS sample shots

Set status Complete and supply a message

Now the WF status page shows WF completed

40

Page 41: Inside WSS sample shots

P.274

The WF design view looks like this:

There are green triggers, blue actions and white historylog entries.

41

Page 42: Inside WSS sample shots

Chapter08\cs\LitwareWorkflows P.291: Custom Input Forms

This is a sitecoll feature with a workflow and a contenttype.Before building it, a hardcoded line with the userid of yourself must be corrected.In \Resources\LitwareApprovalWorkflowData.xml change userid: <Approver>SPVM\administrator</Approver>Compared to the last WF then two actions has been added: EnableWFModification and CompleteTask

42

Page 43: Inside WSS sample shots

P.294

After attaching a new workflow for a list like in the previous feature using /_layouts/AddWrkfl.aspx then this feature has yet a WF association form:

P.299

Now instanciate a Litware Approval WF

43

Page 44: Inside WSS sample shots

P.300

Also here you get an extra WF initiation form, where you can make changes

The WF is now running:

44

Page 45: Inside WSS sample shots

P.302

Compared to the Hello WF then now there is the option to modify the WF. And the task title has been renamed.

If you first go to the task list you will also see the previous task. Notice that the old task is 0% complete. There was no code to set it to 100%, when the task was set complete!

45

Page 46: Inside WSS sample shots

P.307

Enter the task. Here you get a custom task edit form, where you only have to press Approve to complete the task. Try to reject…

The Reject action does the same as the Approve action.And this WF automatically sets both Status, %complete and Outcome properties. Nice. The old WF did not set the Outcome property. It is the extra WF activity CompleteTask that carries that outcome info back to the task from the WF.

46

Page 47: Inside WSS sample shots

On the WF status page you can see the comment from the approver

47

Page 48: Inside WSS sample shots

Chapter09\cs\HelloSiteDef P.321

This is plain none code files that are copied using xcopy to the 12Hive containing a new site definition.

48

Page 49: Inside WSS sample shots

When created the site supplies 3 pages with a content webpart and an image webpart.The three pages has been created from the same taemplate. It is only the webpart configuration that is different. That happens in the ONET.XML

Chapter09\cs\SolutionsDeployment P.366

This solution uses:- Site pages from chapter 3- Branding from chapter 3- Webparts from chapter 4- Types from chapter 6- Localized .resx files from chapter 9- Solution package from chapter 9

Chapter09\cs\WebConfigModificationConsole P.344

This is a console app that can add or remove lines from web.config. Just a sample. Nothing visual. The change has no practical effect for the web app. The path to the web app must be corrected.

49

Page 50: Inside WSS sample shots

Chapter10\cs\LitwareSecurity

This is a sitecoll feature that contains 5 webparts in the group “Litware Security Web Parts” using a solution package for deployment.To deploy: Run DeploySolutionPackage.cmd.After that it is found in SPCentralAdmin:

After activating the feature following webparts are added:

50

Page 51: Inside WSS sample shots

When added to a page the webparts displays:- P.368: Elevated Privileges- Evidence- P.355: Security- P.375: User Account

51

Page 52: Inside WSS sample shots

P.369

The visitorTracker webpart is nonvisible on the page. Instead it creates a list on the site called visitors and adds items to it whenever someone enters the page.

The End

52