Thursday, March 29, 2007

Publishing a browser-enabled InfoPath template

This is the first installment of a series of postings about InfoPath and workflow in SharePoint 2007.

Open InfoPath 2007 and select Design a form template. Make sure that you check the "Enable browser compatible features only". Insert a layout table and add a number of textbox controls - firstname,lastname, phone and email.

InfoPath 2007 alllows you to use Template Parts - these template parts group. Template parts group pieces of a form template into a component that can be reused across multiple form templates. Template parts are always contained within Section controls. For more info take a look at the InfoPath team blog - Template Parts 101. If you need to add a template part - select Controls in the Design Tasks - and click Add or Remove Custom Controls. Now you can either add ActiveX controls to the controls which you can use in InfoPath or a template part which you have created previously.

Next insert an optional section and insert a salary textbox. You will use the optional section for data that users are not required to enter. Double click the salary textbox - change the data type to decimal(double) and change the format to currency. Notice that you can also specify data validation rules as well as mark the field as required.

Next, I add a repeating section (since I want to use a browser-enabled form I can't use the new horizontal repeating section). Insert into this repeating a custom layout table with 2 columns and 1 row and add a drop-down listbox to display a number of functions for which the candidate can apply. Since a candidate can apply for multiple functions - these controls are added to a repeating section. Also add an extra textfield in the repeating section where the applicant can add in some extra motivation about the function where he's applying for.

Last but not least, provide the applicant with a way to add his résumé - here you can use an attachment control. When you attach a file to a form, the original file will be converted using Base64 binary encoding. This means that these attachments will not be searchable in SharePoint. You could write an event handler which takes this attachment and stores it in a separate document library. Also not that the File attachment control will warn users when they upload a file which is larger than 1MB.

Now, your InfoPath form is finished and you will need to make it available for end users to fill it in. There are actually a number of ways to publish the InfoPath form template (to a file share, webserver or as an installable MSI). In this sample I will focus on publication to SharePoint and publish the InfoPath form to a document library. Create a new SharePoint site - using the blank site template.

Also remember that since your end users won't have the InfoPath UI available when filling in a form so there needs to be an alternative. Forms Services provides an alternative using Form toolbars which will display a number of buttons. You can change which buttons are visible by selecting Tools > Form Options in the browser category.

Click File >Publish - this will open the Publishing wizard. Select Publish to a SharePoint server with or without InfoPath Forms Services. (There also is a Lab about Publishing an InfoPath 2007 Form Template to a Server Running InfoPath Forms Services ). Select to create a new document library – call it Applicants and specify in the publishing wizard to create a new column - Firstname, lastname, salary. For other publishing options take a look at InfoPath Forms Management in Windows SharePoint Services v3 . Finally click publish and close InfoPath (Remember that when you are working in a Virtual PC - you might need to stop the system event notification service - Having problems with MOSS 2007 in Virtual PC - use net stop sens )

When you navigate to the Applicants document library and click New, it will open in InfoPath when you have InfoPath installed on the client. You can however force your InfoPath form to open in the browser even when an InfoPath client is installed. Click Settings > Form Library Settings. Underneath Advanced settings you can check "Display as web page". The form which will open should look like the image below.




Working with browser-enabled InfoPath forms and workflows in MOSS 2007

Yesterday I did my session at the Dev&IT Pro Days in Gent about "Working with browser-enabled InfoPath forms and workflows in MOSS 2007". Here's the user story:

"An applicant fills in a employee application form - this form is reviewed by HR which invites the applicant for an interview. They write a report about the interview which is routed to the right group manager using a workflow created with SharePoint Designer. Afterwards a contract is signed and routed using the out of the box Collect Digital Signatures workflow."

So, in the next blog posts I will talk about the following topics:

  • Publishing a browser-enabled InfoPath template
  • Using managed code in InfoPath forms and administrator approved form templates
  • Using a SharePoint Server 2007 out of the box workflow - Collect digital signatures
  • Creating a workflow with SharePoint Designer
  • Developing a custom workflow with Visual Studio 2005

Saturday, March 24, 2007

Coding against Active Directory

I had to do some development using the User object in Active Directory last week. Here are some links which might help you as well:

Tuesday, March 20, 2007

My favourite SharePoint 2007 tools

Update: fixed the link for the form based authentication helper - thanks Tony for pointing this out ...

  • SPCAMLViewer - Uses SharePoint webservices to provide inside into the CAML used in SharePoint lists and views
  • Internet Explorer Developer Toolbar - provides a variety of tools for creating, understanding and troubleshooting web pages.
  • Fiddler HTTP Debugger - Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler is designed to be much simpler than using NetMon or Achilles, and includes a simple but powerful JScript.NET event-based scripting subsystem.
  • Upgrade toolkit for Windows SharePoint Services - Guidance and white papers to upgrade customized site or site template to WSS 3.0
  • BDC MetaMan - Tool to generate Business Data Catalog application definition files for Microsoft Office SharePoint Server.
  • MOSS 2007 utility for import/export of user profiles - allows you to populate your SharePoint Server user profile database using basic XML files as source.
  • MOSS Query Tool - Next version of the SharePoint Query Tool, designed for MOSS (SharePoint 2007). It has a similar feature set to the SharePoint Query Tool - it allows you to use a point and click interface to gather information such as search scopes and properties, type in search terms, and click a button to create both the search SQL syntax as well as the Xml document that is needed to run a query against MOSS. You can see results in plain text, structured Xml and now a dataset view. It supports FREETEXT and CONTAINS as well as wildcard searching. A very valuable tool for those trying to write custom SharePoint queries.
  • Forms Based Authentication Setup Helper for MOSS 2007 - Utility to ease the process of setting up and configuring Forms Based Authentication for MOSS 2007.
  • SharePoint Builder on CodePlex
  • SharePoint Inspector - free tool to browse your WSS 3.0 and MOSS 2007 farm. You can see objects composing its structure, get their properties by reflection, which can be very useful when you want to check if your code does what it should do.You can use also some advanced features like activate/deactivate SharePoint features, add/remove event receivers, manage your recycle bin.
  • SharePoint Features Project at GotdotNet - This project contacts the next features:
    • Presence Contact List v1.0: This is a contact list modified to show presence information as a drop-down associated with the e-mail field
    • Content Type Hierarchy Viewer v1.0 :This Feature presents the site content types in a hierarchical view. It shows the relationships between the content types, including hidden types. The Feature appears as the first link in the "Galleries" section of the Site Settings page.
    • Log Viewer v1.0 : This is a Feature for viewing the Unified Logging Service (ULS) logs through the SharePoint Central Administration site. It adds a new "Utilities" section to the "Operations" tab with a link to the ULS viewer.

Thursday, March 15, 2007

Wednesday, March 14, 2007

Creating webpartpages in SharePoint 2007 using the SharePoint object model

I have been looking for a way to dynamically create webpartpages with code in SharePoint 2007. I already knew that it was possible using the Frontpage RPCs since I posted about this about a year ago - SharePoint WebPartpages when I found an excellent posting a newsgroup from Todd Bleeker. This still works in SharePoint 2007.

You can find limited documentation for the /_vti_bin/owssvr.dll?CS=109
command using in the spcf.aspx page in the WSS SDK under "Windows SharePoint Services RPC Methods", specifically the NewWebPage Method. The parameters of this method are posted to the dll using mostly hidden form fields defined throughout the spcf.aspx page.

<Method ID="Text">
<SetList Scope="Request">GUID</SetList>
<SetVar Name="Cmd">NewWebPage</SetVar>
<SetVar Name="ID">New</SetVar>
<SetVar Name="Type">[WebPartPageBasicPage]</SetVar>
<SetVar Name="WebPartPageTemplate">[1-8<</SETVAR&GT;
<SetVar Name="Overwrite">[truefalse]&tl;/SetVar>
<SetVar Name="Title">Text</SetVar>
</Method>
 

For those of you who don't know how to use SharePoint and FrontPage RPCs take a look at these postings: SharePoint RPC - two targets for FrontPage RPCS and Want a good example of FPRPC? Try SharePad! , SharePad has been updated and SharePoint and RPCs.


What I did not know that you can actually achieve the same thing using the SharePoint object model untill I stumbled on this posting - How to programmatically create a ghosted web part page.



using (SPSite sitecollection = new SPSite("http://server"))
{
using (SPWeb site = sitecollection.OpenWeb())
{
site.AllowUnsafeUpdates = true;
SPList list = site.Lists["Pages"];
string postInformation =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<Batch>" +
"<Method>" +
"<SetList Scope=\"Request\">" + list.ID + "</SetList>" +
"<SetVar Name=\"ID\">New</SetVar>" +
"<SetVar Name=\"Cmd\">NewWebPage</SetVar>" +
"<SetVar Name=\"Type\">WebPartPage</SetVar>" +
"<SetVar Name=\"WebPartPageTemplate\">2</SetVar>" +
"<SetVar Name=\"Title\">" + sTitle + "</SetVar>" +
"<SetVar Name=\"Overwrite\">true</SetVar>" +
"</Method>" +
"</Batch>";
string processBatch = site.ProcessBatchData(postInformation);
}
}

The code above also seems to work in SharePoint Server 2007 - for more information take a look at the SPWeb.ProcessBatchData method documentation on MSDN.



Monday, March 12, 2007

SharePoint 2007 workflow - AssociateonActivation

Some of you might have seen the AssociateOnActivation element in the workflow.xml (see example below) when building a SharePoint workflow in Visual Studio 2005 with the last build of the ECM Starter Kit and might be wondering what it is good for. Here's the explanation:

The value for AssociateOnActivation value will be false for most workflows but its value is set to true for the out-of-the-box document approval and collect feedback workflows. You probably noticed that these two workflows are available for all items in a SharePoint document library, although they are not in the list of workflow associations of the document library. This is because these workflows are associated to the document content type. So if you want to make your custom workflow automatically available on any item of the Document content type, just add <AssociateOnActivation> to true.

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow
Name="Expense Report workflow"
Description="This workflow is used to approve expense reports"
Id="{9E778B0B-012F-43b9-A783-FF83C89AA736}"
CodeBesideClass="ExpenseWorkflow.Workflow1"
CodeBesideAssembly="ExpenseWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=70c99ed3a3700cf4"
TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160"
AssociationUrl="_layouts/CstWrkflIP.aspx"
InstantiationUrl="_layouts/IniWrkflIP.aspx"
ModificationUrl="_layouts/ModWrkflIP.aspx"
StatusUrl="_layouts/WrkStat.aspx">
<Categories/>
<!-- Tags to specify InfoPath forms for the workflow; delete tags for forms that you do not have -->
<MetaData>
<Task0_FormURN>urn:schemas-microsoft-com:office:infopath:ExpenseTaskForm:-myXSD-2007-02-24T15-08-38</Task0_FormURN>                                                     <AssociateOnActivation>false</AssociateOnActivation>
</MetaData>
</Workflow>
</Elements>

You should check out the upcoming SharePoint 2007 MVP book for more goodies such as this one.

 

Thursday, March 08, 2007

BIWUG about Web Content Management

This evening's BIWUG session about web content management with MOSS 2007 was really great - we first had a presentation about things learned when doing a SharePoint project. Afterwards Steven did a presenation about the Content By Query Web part - also read his articel on MSDN Belux about Customizing the Content Query Web Part XSL  which included a nice demo. I just uploaded the demofiles as well as the presentation to the BIWUG site - take a look in the Meeting Presentations document library on the BIWUG site.

Finally, Patrick did a presentation in which he presented a lot of different user scenario's  demonstrating concepts such as document convertors, form based authenticationcontent deployment jobs, variations, etc ...

 

Inge blogs ... well semiblogs

Inge - one of the other board members of BIWUG - has been blogging for Vacature Talentblog. Read more here (only in Dutch):

PS Unfortunately the Talentblog does not even have an RSS feed - so it's a kind of a semi-blogging :-) ...

Technorati tags: , ,

Wednesday, March 07, 2007

BPEL support for Workflow Foundation

We had a workgroup about BPM on the Microsoft platform last week here at Dolmen. One of the topics which came up was the use of BPEL (Business Process Execution Language) and BPMN (Business Process Modeling Notation).

So it's great to see that Microsoft will add support for BPEL in Workflow Foundation with a CTP release in march which will implement the BPEL 1.1 specification   and ). The final release will also support BPEL 2.0 and is planned for Q4 of 2007. (Sources : ITWorld and Paul Andrew's blog). 

I actually taught that BPEL support would have been availabe with the RTM version of Workflow Foundation since it was already mentionned during the beta phases. Take a look at  Introducing Microsoft Windows Workflow Foundation - an early look from august 2005 for example which stated

For developers who wish to use BPEL, Windows Workflow Foundation includes a BPEL Activity Library that implements the constructs defined by version 1.1 of the BPEL specification. Using this library, it's possible to create workflows that can be exported to BPEL, or to import a BPEL definition into Windows Workflow Foundation.

David Chappel adds some interesting information as well ...

Similarly, any imported BPEL workflows will be converted into WF's internal representation. Like BizTalk Server today, WF treats BPEL as a way to move process logic between different workflow engines, not as an executable format (and certainly not as a development language)

This is similar to the way that Biztalk uses BPEL. I think that Oracle BPEL Process manager is currently the only tool which really embraces the concept of BPEL for defining processes and workflows.

 

tags: , , , , ,

Tuesday, March 06, 2007

Enabling and disabling Outlook-SharePoint integration

This is question which I got some time ago ... is it possible to disable the Outlook integration with SharePoint? Yes, this seems to be possible - for more information take a look at Enabling and Disabling SharePoint integration in Outlook 2007

tags: , ,

BIWUG about Web Content Management in Office SharePoint Server 2007

There's another session from BIWUG (Belux Information Worker User Group - www.biwug.be ) on thursday 8th of march. Here are the different topics:

18:30 - 18:45     Welcome and Introduction

18:45 - 19:30     Tips and tricks for working with the Content Query Web Part

19:45 - 20:30     Web Content Management best practices in MOSS 2007

20:30 - 21:00     Discussion

Location: Dolmen Huizingen - (click the link  for a detailed route description)

Don't forget ot register on the BIWUG site - click Register for next event.

PS The slide decks of the previous session about workflow are available in the Meeting presentations document library onthe BIWUG site.

 

Sunday, March 04, 2007

Update SharePoint Server 2007 crawler account

Be carefull when choosing your default content access account... for more info take a look at this Knowledge base article -

http://support.microsoft.com/kb/928623

 

Search results include draft documents in SharePoint Server 2007

View products that this article applies to.

Article ID : 928623

Last Review : February 22, 2007

Revision : 1.1

SYMPTOMS

You upgrade a computer that is running Microsoft Office SharePoint Portal Server 2003 in a farm environment to Microsoft Office SharePoint Server 2007. However, when you perform a search on the SharePoint Server 2007 site, the search results include draft documents.

CAUSE

This issue occurs when the default content access account under Search Settings in SharePoint Server 2007 Shared Services Administration is configured to use the SharePoint Server farm administrator account.

RESOLUTION

To resolve this issue, change the default content access account to use an account other than the SharePoint Server farm administrator account. To do this, follow these steps:

1. Click Start, point to Administrative Tools, and then click SharePoint 3.0 Central Administration.

2. On the Central Administration page, click Shared Services Administration.

3. On the Manage this Farm's Shared Services page, click the default Shared Services Provider.

4. On the default Shared Services Provider page, click Search Settings.

5. On the Configure Search Settings page, click Default Content Access Account.

6. On the Default Content Access Account page, type an account that you want to use for the default content access account, and then click OK.

7. Repeat steps 1 to 6 on each Shared Services Provider that is created when you upgrade the SharePoint Portal Server 2003 site.