Friday, May 11, 2007

Frustations with Infopath and MOSS

I've been very busy the last few months with building Infopath forms that are published to a MOSS server and during this period I came accross some pretty annoying things. And ofcourse I want to share my frustations with you in the hope you don't get these frustations as well (or just to let you know you are not the only one ;)

1. Content Types

Be very aware of the functionality of ContentTypes, as soon as you publish your infopath form with custom code in it, it becomes a contenttype. This is not ideal if you are not sure which fields you wanted to promote as columns in Sharepoint.  You could end up with a contenttype with several columns you never use. Or even worse, new fields are not added (c.q. promoted) to the existing contenttype, so you cannot use them in your custom workflow.

2. Deletion of the feature elements by MOSS

Every once in a while I am deploying a new version of a form, using the central administration page to upload the form, I receive the following error:

Failed to find the XML file at location '12\Template\Features\FT-01-15c4e6f3-1f3b-d12c-fcac-6cf906ce99b6\Feature.xml'

What happens is that Sharepoint is trying to upgrade the form. During this upgrade a new subfolder is created in the "FT-xxx" folder where the last version is stored. And what I think is happening is that the new version of the solution file is not stored in a main folder so Sharepoint cannot update the feature.xml and elements.xml and therefore deletes them.
To solve this problem, you just copy the feature.xml and elements.xml from another form template and modify these accordingly to the 'corrupt' form template.

3. The form has been closed

This one I do not yet understand, sometimes if successfully published a new version of my form template and want to to view/open the form and then without any error I'm confronted with 'the form has been closed' message. My solution to this is just republish the same form and waste another 5mins and then it works..

 

Don't get me wrong btw, it is a great feature and I will continue to use to build relatively easy forms with it. I just had to write off my frustations :)

Thursday, May 10, 2007

William Baer's database management concepts for large and growing content databases

As I pointed out last month in this post Sharepoint and databases that knowledge and experience in SQL Server 200x is getting more and more important, William Baer published an article about Database Management Concepts for Large and Growing Content Databases which goes really into detail what a best practice could be if you have a large and fast growing content database and want to manage the load (remember in 2003 that STSADM backup locks tables and therefore sites were unreachable during the backup process?). Not only does he describe how you should implement this, he also points out the benefits if you implement this :)

Tuesday, May 08, 2007

Ontolica Wildcard Search Released!!

From Liam :

Great news!! The *FREE* yes *FREE* wildcard search is now available here: http://www.ontolica.com/Download.aspx

Once installed it adds two new site templates: Ontolica Search Center and Ontolica Search Center with Publishing

They are all enabled as a feature!! Very nice. Very cool little features as well. The refine by Site, Author and File Type is great!! Also the instant reload of the reslts when selecting "All", "Documents Only" and "List Items Only" is a great touch...!! Go get it and try it for your self.

 

Bloody great news eh? :)

Friday, May 04, 2007

This form was customized not working with attachment

Update 31-03-2009

Folks, another update.. it’s fixed!! Get the hotfix for SharePoint Designer here KB960311 and make sure that your SharePoint environment is patched with the infrastructure updates.

Update 09-07-2007

Folks, the solution given below does not work! Also there is no fix for it yet, please look in the following forum http://forums.microsoft.com/TechNet/showpost.aspx?postid=1826359&siteid=17 for more details. I am very sorry if you found this blogpost via Google hoping you get an answer.. :(

Well until recently I did not know how to fix this (and I wasn't the only one if you check out this forum post on TechNet and these comments on a post of Jan Tielens's blog) until I received an alert from the forum that there was a new post with the solution. And here is the solution :

This is the code you need for attachments to work:

<SharePoint:AttachmentUpload ControlMode="Edit" runat="server"
ID="fileupload{$Pos}">
</SharePoint:AttachmentUpload>
<SharePoint:AttachmentsField ControlMode="Edit"
FieldName="Attachments" runat="server" Visible="true">
</SharePoint:AttachmentsField>

This will display the input field and the buttons as well as what you're trying to upload.

1) First make sure your field and test case works (Edit form) without the attachments.

2) What I did was put the attachments in a separate xsl template:

<xsl:template name="attachments">
<xsl:param name="Pos" />
  <tr><td>
    <SharePoint:AttachmentUpload ControlMode="Edit" runat="server"
ID="fileupload{$Pos}">
    </SharePoint:AttachmentUpload>
    <SharePoint:AttachmentsField ControlMode="Edit"
FieldName="Attachments" runat="server" Visible="true">
    </SharePoint:AttachmentsField>
  </td></tr>
</xsl:template>

3) and then I changed the dvt_1 template:

<xsl:template name="dvt_1">
  <xsl:variable name="dvt_StyleName">ListForm</xsl:variable>
  <xsl:variable name="Rows"
select="/dsQueryResponse/Rows/Row"/>
  <table border="0" width="100%" id="part1{$noop}">
    <xsl:call-template name="dvt_1.body">
      <xsl:with-param name="Rows" select="$Rows"/>
    </xsl:call-template>
  </table>
  <table border="0" width="100%">
    <xsl:call-template name="attachments">
      <xsl:with-param name="Pos" select="concat('_',
position())" />
    </xsl:call-template>
  </table>
</xsl:template>

A few things that are important to remember:

The JavaScript in SharePoint will look for  the object with id part1 in the final HTML and hide the object (display:hidden css style) and the object id partAttachment and display that object. The partAttachment object (span) is automatically generated when you introduce the SharePoint:AttachmentUpload code. The part1 id however, you need to introduce yourself.

Now, if you don't want that anything hides, just put in an empty element somewhere with the id part1{$noop}, otherwise, just use my example for the dvt_1 template (it's neater).

The $noop is to fool SharePoint Designer since it will introduce {generate-id()} after the id if you don't specify anything there (to guarantee unique identifiers or something, I don't know) and thus it would fail the javascript since it can't find id=part1, but there will be a part1KLV532.

You can specify the noop parameter to be empty in the beginning of your xsl stylesheet:

<xsl:param name=noop></xsl:param>

Evi

So thanks Evi! :)

Tuesday, May 01, 2007

Site Delete Capture Feature by MS

A feature that is created by Joel Oleson and William Baer that does the following :

The Microsoft IT Site Delete Capture feature 1.0 is a shared component library (DLL); by registering the Microsoft IT Site Delete Capture feature 1.0 shared component library in the Global assembly cache, SharePoint Products and Technologies administrators can intercept both site/web delete requests and archive the site/web to a resource local to the web front-end computer or UNC path before the site/web is removed the configuration and content databases. The Microsoft IT Site Delete Capture feature 1.0 also exposes functionality allowing SharePoint Products and Technologies administrators to send e-mail notification to the end-user indicating the site has been archived and deleted, additionally any failure in the event receiver will generate an e-mail message to the end-user indicating that the site/web has not been deleted. The message format, text, and language are stored in a flexible, culture-independent extensible markup language configuration file to support any localization requirement.

Very handy! You can download the tool from Codeplex