Black Blade Associates Logo A Black Blade Associates blog. Struggling with SharePoint? We can help.




Blog moved: This blog has moved to http://thingsthatshouldbeeasy.wordpress.com. Go there now to see the new posts.


Thursday, February 15, 2007

Populating SharePoint Picture Libraries through Site Definitions

In a SharePoint site definition, you can add files to a picture library just as you would any other document library. However, you will discover that while the files do show up in the picture library correctly, the thumbnails do not. This is because there are two hidden folders in a picture library "_t" and "_w". These folders cached thumbnails of all images in the picture library. When you upload an image through the SharePoint user interface or change an image's properties, the system will generate the appropriate cached thumbnail images for the hidden folders. However, when populating the picture library through a site definition, you must explicitly generate the thumbnail images and add them to the hidden folders.


The cached thumbnail images must take the file name of the original image file name, with an "_" in place of the ".". Also, the thumbnail must be a JPEG file. For example, if the original image is "company_logo.png", the thumbnail must be named "company_logo_png.jpg".


Here is a sample set of Module sections that illustrates the results of the above process for two files: "image1.png" and image2.gif", located in the "Resources" subdirectory of the site definiton. Their cached thumbnails are located in the "Resources\_t" and "Resources\_w" subdirectories.


<Module Name="ImagePopulation" List="109" Url="Picture Library" Path="Resources" >

<!-- These are the actual files -->

<File Url="image1.png" Type="GhostableInLibrary"/>

<File Url="image2.gif" Type="GhostableInLibrary"/>

</Module>


<Module Name="ImagePopulation_t" List="109" Url="Picture Library/_t" Path="Resources\_t" >

<!-- These are thubmnals for the files -->

<File Url="image1_png.jpg" Type="GhostableInLibrary"/>

<File Url="image2_gif.jpg" Type="GhostableInLibrary"/>

</Module>


<Module Name="ImagePopulation_w" List="109" Url="Picture Library/_w" Path="Resources\_w" >

<!-- These are thubmnals for the files -->

<File Url="image1_png.jpg" Type="GhostableInLibrary"/>

<File Url="image2_gif.jpg" Type="GhostableInLibrary"/>

</Module>


I've found that an easy way to generate the thumbnails is to open the original image in Windows Paint, do a Save As, and select JPG as the output format. This will work for a small number of images. If you want to generate thumbnails for a large number of images, you will probably want a more automated tool.


Tuesday, February 13, 2007

Configuring Exchange 2007 for Internet email

Update: Also check out this related post on dealing with certificate errors when users access Exchange from both the company's internal network as well as from the Internet:

http://thingsthatshouldbeeasy.blogspot.com/2009/02/certificate-errors-in-outlook-when.html



I had just installed and configured (at least I thought I did :) ) Exchange 2007. I sent a couple of test messages through from one internal account to another. Things seemed to be working well. But, when I tried to send a message to an external (Internet) address or receive a message, nothing happened. I did not get any obvious errors but the messages just did not get through.

It turns out that you must do some additional configuration on Exchange 2007 in order for it to allow inbound or outbound traffic from outside of its domain; that includes Internet messages. In order for Exchange 2007 to be able to send and receive Internet mail:

  1. Enter the Internet FQDN as an accepted domain
  2. Enter the Internet FQDN as an address policy ahead of the default policy for the local FQDN. This gives users two addresses: user@localFQDN and user@InternetFQDN and sets user@InternetFQDN as the default SMTP address. To test this, send an email from a user and check the user's from address. It should be user@InternetFQDN , not user@localFQDN. For example, if user jsmith in the mycompany.local domain sends the email, the from address should be jsmith@mycompany.com not jsmith@mycompany.local.
  3. Allow anonymous permissions on the default Receive connector. This allows people from the Internet to send email to the Exchange organization. If this is not done, emails from outside bounce with a message saying the sender was not authenticated. To test this, send an email from an external account, like Hotmail, to a user within the Exchange organization.
  4. Create a Send connector with the destination domain specified as "*". This allows the Exchange organization to send email to all domains. If this is not done, email sent outside the organization will be held by the server. The sending users will not receive any notice that their emails have not gone through. To test this, send an email to an external account, like Hotmail, from a user within the Exchange organization.