Monday, November 20, 2006

Enabling PDF search on WSS v3 (beta)

Lots of troubles to enable the search functionality in WSS v3.
I found a fantastic article on Stan Spotts' blog about enabling PDF search on WSS 3.0 beta.

You must still use the Adobe iFilter for PDF's like you did in Sharepoint 2003, but you need to check some registry settings to make sure that WSS indexes your PDF documents correctly.

Click here to visit Stan Spotts' article.

Limitations
a It only indexes PDF documents after you have configurated this functionality.
a You can only search for full words

Search doesn't work ?!
I had a lot of troubles to configure the search functionality (without the PDF search).
Keep in mind to configure your Search Server first and then create your Content Database !
It seems that the order is very important in the beta version.

Wednesday, November 15, 2006

Enabling InfoPath Forms Services 2007

It is quite simple to enable InfoPath Forms Services 2007 on your Microsoft Office SharePoint Portal 2007. Follow the steps below to use browser-enabled forms:

I. Central administration

1. Go to the Central Administration

2. Click on Application Management
3. Click on Configure InfoPath Form Services under the InfoPath Forms Services section.
(http://yourserver/_admin/ipfsConfig.aspx)



4. Make sure that browser-enabled form templates are allowed
(Check all checkboxes in User Browser-Enabled Form Templates)



5. You can specify other options if necessary. Click on OK to apply the changes.
6. You can close the Central Administration Website.



II. List Configuration
I created a new Document Library on my site called 'InfoPath Forms'. This document does not open InfoPath forms in your browser directly. You must configure this list in this way:

1. Open the List which contains browser-enabled InfoPath Forms
2. Click on Settings and select Document Library Settings


3. Select Advanced Settings Under 'General Settings'
4. Configure the Browser-enabled Documents section and select 'Display as a Web page'



5. Click on OK to confirm the changes



III. Publishing InfoPath Templates
Use the Publish Wizard to deploy the form on your Sharepoint Portal Server.
Define the location, promote the fields and publish!
(In this example you must update an existing Document Library)

Use following URL structure to deploy
http://yourserver/SiteDirectory/YourSite/YourList/Forms/AllItems.aspx



IV. Testing the deployed form
Create a new document in your 'InfoPath Forms' list. The form will be automatically open in your browser.




V. Tips
aYou can manage the toolbars at the top/bottom in InfoPath 2007.
(menu Tools > Form Options > Browser > 'Show toolbar at top/bottom of form')

VI. Download this example
download the example here

Tuesday, November 14, 2006

FormErrorCollection - Errors Property


Custom validation with managed code will be improved in InfoPath 2007. Several new classes provides the possibility to generate data validation errors in code.

In InfoPath 2003 it was possible to generate errormessages (in JScript or through the .NET framework), but it wasn't possible to draw a border around the field which indicates the error.

InfoPath 2007 provides a FormErrorCollection containing FormError objects in the XmlForm as the 'Errors' property.

Methods
1. Errors.Add(XPathNavigator context, string name, string message);
It act like a Key/Value (name/message) collection and each error points to the node to which the error is associated (context).

2.
Errors.Delete(string name);
You can remove the FormError by using the Key in the Errors.Delete method.


Example

public void InternalStartup()
{
// ...
EventManager.XmlEvents["/my:myFields/my:SampleField"].Validating +=
new XmlValidatingEventHandler(SampleField_Validating);
// ...
}

//Right-click on the control > Programming > Validating Event ...
public void SampleField_Validating(object sender, XmlValidatingEventArgs e)
{
// check if the new value isn't empty
if (!String.IsNullOrEmpty(e.NewValue))
{
//current fieldvalue cannot be 'example'
if (e.NewValue.ToLower().Equals("example"))
{
//e.Site points to the node that is being changed, e.Site is always the reference to the field which you are validating at that moment
Errors.Add(e.Site, "Error_SampleField", "Invalid fieldvalue");
}
else // all other values are allowed
{
Errors.Delete("Error_SampleField");
}
}
}



Conclusion
a The FormErrorCollection is also accessible in Form Services 2007 !
a It acts like the 'real' Data Validation (at design time)
a You cannot submit the form without resolving the errors !
Microsoft InfoPath 2007 Object Model
2007 Office System: Developer Posters