How can i add the Weather Webpart in a site definition

Oct 14, 2007 at 7:55 PM
Hi all,
For start, thanks for all your components.
I search for this time to add the weather Webpart in the default.asp from ONET.XML when i use a site template.
I test this code in my ONET.XML :
...
<File Url="default.aspx" NavBarHome="True">
<View List="$Resources:Gaznat,DocumentsConsoFolder;" BaseViewID="0" WebPartZoneID="Left" WebPartOrder="1"/>
<View List="$Resources:core,listsFolder;/$Resources:core,announceFolder;" BaseViewID="0" WebPartZoneID="Left" WebPartOrder="2"/>
<View List="$Resources:core,listsFolder;/$Resources:core,calendarFolder;" BaseViewID="1" RecurrenceRowset="TRUE" WebPartZoneID="Left" WebPartOrder="3" />
<AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1"><![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>TamTam.SharePoint.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ca549c8a37d5a903</Assembly>
<TypeName>TamTam.SharePoint.WebParts.Weather</TypeName>
<Title>Coucou coucou</Title>
</WebPart>
]]></AllUsersWebPart>
....
But that don't work and i have this error after creation :
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.

Thank you for your help.
Sincerely
Romelard Fabrice MVP
Oct 15, 2007 at 6:20 PM
I find, i just paste the content of .webpart file in CDATA part :
---
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="TamTam.SharePoint.WebParts.MSNWeather" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="ChromeState" type="chromestate">Normal</property>
<property name="AllowClose" type="bool">True</property>
<property name="Width" type="string" />
<property name="AllowMinimize" type="bool">True</property>
<property name="AllowConnect" type="bool">False</property>
<property name="ChromeType" type="chrometype">Default</property>
<property name="TitleIconImageUrl" type="string" />
<property name="Description" type="string">Simple Ajax Style weather webpart that uses the MSN weather site.</property>
<property name="Hidden" type="bool">False</property>
<property name="TitleUrl" type="string" />
<property name="AllowEdit" type="bool">True</property>
<property name="Height" type="string" />
<property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
<property name="HelpUrl" type="string"></property>
<property name="Title" type="string">Weather</property>
<property name="CatalogIconImageUrl" type="string" />
<property name="Direction" type="direction">NotSet</property>
<property name="AllowZoneChange" type="bool">True</property>
<property name="AllowHide" type="bool">True</property>
<property name="HelpMode" type="helpmode">Modeless</property>
<property name="ExportMode" type="exportmode">All</property>
</properties>
</data>
</webPart>
</webParts>
----

All is ok now

Romelard Fabrice