Wednesday, May 6, 2009

Integration between Moodle and MOSS - Part 3

Part 3: Install the Moodle Integration Solution

Welcome in part 3 of the article. In part 1, I have provided an introduction to the Moodle-MOSS integration. In part 2, I explained the installation and configuration of Moodle. And in this part, I would describe the installation and configuration of the different software packages building the Moodle web parts.

The next parts would be: Part 4: Zoom on the Moodle web parts Part 5: Extension Thoughts

A. Overview

This section describes the steps needed for installing the Moodle Integration Solution (MIS). MIS will enable you to access core Moodle data from within your MOSS portal.

MIS consists of several web parts, a web service and a data access layer. The data access layer is responsible for connecting the web service with the underlying database used for storing the Moodle data. The web service provides a SOAP interface accessed by the web parts to retrieve data out of the Moodle system. Furthermore, the web service relies on a Common Internet File System (CIFS)/Server Message Block (SMB) connection for document exchange between the MOSS and Moodle systems.

The installation process starts with some prerequisites, then we proceed to the installation of the MIS package and finally we should perform some smoke tests to make sure that all configurations have been performed correctly.

B. Downloads

  1. Browse http://dev.mysql.com/downloads/connector/odbc/5.1.html
  2. Download the Windows MSI Installer of the MySQL ODBC Connector. And save it to a local directory.
  3. Browse http://www.codeplex.com/Moodle2003WP/Release/ProjectReleases.aspx?ReleaseId=3986
  4. Click the Moodle SharePoint Install to download the Installer.zip file.

C. Prerequisistes

  1. Install and configure MOSS on a different machine (moss-machine) than Moodle (moodle-machine). MOSS should use Active Directory for authentication. For a step-by-step guide, please refer to How to install SharePoint Server 2007 on a single machine in the References section.
  2. Share the following folder on the Moodle machine (moodle-machine): C:\Moodle1.8\server\moodledata. It should be accessible from the MOSS machine for Everyone with Read/Write access.
  3. Allow remote access to the MySQL database as follows:
    1. On the Moodle machine, open the Command Prompt window and follow these commands.
    2. Browse to the folder containing mysql.exe:
    3. Try to connect to the DB using the host machine name:
    4. Connect to the DB using the localhost:
    5. Allow the root to access the DB remotely from any host:
    6. Close the connection:
    7. Try to connect to the DB again using the host machine name:
    8. Close the connection:

D. Installation of MySQL ODBC Connector

Note

- The MySQL ODBC connector is used to access the Moodle database. In a production system, it is recommend to use the MySQL .NET connector instead of the ODBC connector since there are known issues with the MySQL ODBC driver on Windows.

- We tried to use the MySQL 5.1 .NET connector, but the web service failed to work. The web service was checking for Mysql.data.dll version 1.0.8.0, which is not the same version of the dll installed by the.NET connector.

- We haven’t investigated further in this issue and simply used the ODBC connector for the sake of getting the integrated system up and running as a Proof-Of-Concept.

  1. On the MOSS machine, double-click mysql-connector-odbc-5.1.5-win32.msi, in order to start the installation of the MySQL ODBC Connetor.
  1. A Welcome screen is displayed. Click Next to continue.

clip_image002

  1. On the Setup type page, select Typical and click Next.

clip_image004

  1. A summary page gets displayed. Click the Install button, in order to start the installation.

clip_image006

  1. A final page indicates that the wizard has completed. Click the Finish button to exit the installation.

clip_image008

  1. Browse Start > Administrative Tools > Data Sources (ODBC).
  2. On the User DSN tab, click the Add button.
  3. Select MySQL ODBC 5.1 Driver and click the Finish button.
  4. Fill the connection data and click the Test button:
    • Data Source Name: Moodle System
    • Server: moodle-machine
    • Port: 3306
    • User: root
    • Password: Password1

clip_image010

E. Installation of MIS

Note

Based on the Moodle database, you should choose the corresponding installer from the downloaded Installer.zip.

  1. Connect to the MOSS machine.
  2. Unpack Moodle SPS Installation Full ODBC.zip from Installer.zip.
  3. Execute Moodle SPS Installation Full ODBC.msi file.
  4. You will be greeted by a Welcome screen. Click the Next button.

clip_image012

  1. On the License Agreement page, select I Agree and click the Next button.

clip_image014

  1. On the Web Service installation details page, leave the default values and click the Next button.

clip_image016

  1. On the Database Connection Information page, specify the following parameters:
    • ODBC Driver Name: MySQL ODBC 5.1 Driver
    • Database Server Address: moodle-machine
    • Database Server Port: 3306

clip_image018

  1. On the Moodle Database Information page, specify the following parameters:
    • Moodle Database Name: Moodle
    • Database User: root
    • Database Password: Password1
    • Moodle Table Prefix: mdl_

clip_image020

  1. On the Network Information page, specify the following parameters:

clip_image022

  1. At this point the installer has enough information to perform the installation, click the Next button.

clip_image024

  1. A command console window will show the progress of the installation. When it finishes, it will ask you to Press Any Key To Continue.
  1. Press Enter and you would see the final page confirming that the Installation is complete. Click the Close button.

clip_image026

  1. Open Start > Administrative Tools > Internet Information Services (IIS) Manager.
  1. In the tree, browse Web Sites > WebServiceMoodleSPS. Click Permissions.

clip_image028

  1. Click the Add button, write Everyone and click OK.

clip_image030

  1. Select Full Control and click the OK button.

clip_image032

  1. In the tree, browse Web Sites > WebServiceMoodleSPS. Click Properties.

clip_image033

  1. On the ASP.NET tab, select 2.0.50727 for the ASP .NET version then click OK.

clip_image035

  1. Check that the Web Service is running properly by clicking on the WebServiceMoodleSPS node. Then right-click the MoodleWebService.asmx file and finally click Browse.

clip_image037

  1. Click the Execute link and check that a test has run successfully.

clip_image039

F. Version Summary

This section summarizes the versions of the different software packages:

  • MySQL ODBC Connector: 5.1
  • Moodle Integration Solution: 1.5

G. Smoke Tests

  1. Login to MOSS as a site collection administrator.
  2. Create a new subsite for adding the Moodle web parts.
  3. Browse Site Actions > Edit Page.
  4. Click the Add a Web Part button.
  5. Scroll down till you reach the Moodle web parts.

clip_image041

  1. Select the web parts that you wish to add to the page and click the Add button.
  2. Click the Exit Edit Mode at the top right corner of the page and view the web parts that you have just added.

clip_image043

H. Troubleshooting

The Moodle web parts display an error about an Unhandled Exception

When you browse the MOSS page hosting the Moodle web parts, the web parts display an error message about an unhandled exception.

There are several sources for this error. This section contains a list of checks that might be helpful for identifying the source of the problem:

  1. Modify the properties of any of the web parts throwing the exception. Under the Miscellaneous node, select Show Debug info. Click OK. Check the displayed debug info. This might give you a hint about the problem.
  2. Check that the Moodle system is running properly by logging to it.
  3. Check that the MySQL database is configured for remote access. (See section “C. Prerequisistes”)
  4. Check that MySQL ODBC connector is working properly. (See section “D. Installation of MySQL ODBC Connector”)
  5. Check that the Web Service is configured correctly and is running properly. (See section “E. Installation of MIS”)

I. References

How to install SharePoint Server 2007 on a single machine http://blogs.msdn.com/martinkearn/archive/2007/03/28/how-to-install-sharepoint-server-2007-on-a-single-machine.aspx

MySQL downloads http://dev.mysql.com/downloads/

SharePoint Web Parts for Moodle http://www.codeplex.com/Moodle2003WP

SharePoint-Moodle Unified (MSU) Project http://msu.codeplex.com/

SharePoint Moodle Web Parts http://www.sharepointblogs.com/ajp/archive/2009/02/16/sharepoint-moodle-web-parts.aspx

Thursday, April 16, 2009

Integration between Moodle and MOSS - Part 2

Part 2: Install Moodle

Welcome in part 2 of the article. In part1, I have provided an introduction to the Moodle-MOSS integration. In this part, I would explain the installation and configuration of Moodle.

The next parts would be:
Part 3: Install the Moodle Integration Solution
Part 4: Zoom on the Moodle web parts
Part 5: Extension Thoughts

A. Overview
This section describes the steps needed for installing Moodle using the Complete install packages for Windows. This package allows Moodle to be installed, along with the prerequisites that include a web server (Apache), database (MySQL) and scripting language (PHP).

It is important to note that this package is designed for new installations on a standalone computer. For a production environment it is a good practice to perform a manual installation. The reference section contains links to the corresponding installation guides.

Concerning the Moodle version to be used, we have chosen Moodle 1.8, because according to the documentation of the Moodle Integration Solution…
1- MIS works with Moodle 1.7 or 1.8
2- Upcoming releases might also be working with MIS but this can’t be guaranteed.
3- Older versions of Moodle are not supported.

After completing the Moodle installation, we need to configure the LDAP authentication and finally perform some smoke tests to make sure that all configurations have been performed correctly.

 

B. Downloads

  1. Browse http://download.moodle.org/windows/
  2. Click the Download link beside Moodle 1.8.8+.
  3. Save the file MoodleWindowsInstaller-latest-18.zip to a local directory.

 

C. Moodle Installation

  1. Create a folder for hosting the Moodle application. (e.g. called C:\Moodle1.8)
  2. Unpack the content of MoodleWindowsInstaller-latest-18.zip to C:\Moodle1.8.

Note

  • The extract process will create three files ("Start Moodle", "Stop Moodle", and "README") and a subfolder called "server".
  • Do NOT rename the "server" subfolder.
  • There will also be a folder under this server subfolder, called \moodle which holds the Moodle program.
  1. Stop the IIS Admin service (since Apache usually conflicts with IIS).
  2. Start the webserver using C:\Moodle1.8\Start Moodle.exe.

Note

  • If Moodle doesn’t start properly and display the message APACHE and MYSQL are running..., please refer to the Troubleshooting section for tips.
  • Once the Start Moodle.exe program is open, don't close the window for stopping it. Instead, use Stop Moodle.exe for that purpose.
  1. Start your web browser and type http://localhost. The initial install page will be displayed.
  2. Choose your preferred language (English) and click the Next button.

clip_image002

  1. A diagnostic report is displayed. If all the checks give a PASS, then you can click the Next button to continue. Otherwise, you should address some issues.

clip_image004

  1. Specify the Moodle paths, then click the Next button:
    1. Web Address: http://moodle-machine (Assuming that moodle-machine is the name of the machine hosting Moodle)
    2. Data Directory: C:\Moodle1.8\server/moodledata

image

Note

For the sake of better maintenance, it is recommended to use machine names instead of IP addresses during the installation and configuration of Moodle. For instance, when changing the IP of the host machine.

  1. Specify the database configurations, then click the Next button:
    1. Database: moodle
    2. Password: Password1
    3. Tables prefix: mdl_

clip_image008

  1. The install process checks the server it installs and finally displays the server environment screen. If all the checks give an OK, then you can click the Next button to continue. Otherwise, you should address some issues.

clip_image010

  1. On the Download language pack confirmation screen, click the Next button to continue.

clip_image012

  1. A message is displayed confirming the successful configuration of config.php. Click the Continue button to proceed.

clip_image014

  1. The Moodle copyright / license notices are displayed. Click the “Yes” button to continue.

clip_image016

  1. The current release information is shown. Check the unattended operations box. This will automatically advance through many screens. Click the Continue button to proceed.

clip_image018

  1. This process stops with the Admin user profile settings, which need to be filled out. Fill out the required fields and click on the Update profile button to continue.

clip_image020

  1. The next screen is the Front Page settings page. Each field contains a short description explaining what it is used for. Fill the settings as you wish and click on the Save changes button. Note that these settings can be updated later.

clip_image022

  1. This finishes the installation of Moodle. Type http://moodle-machine in your browser and Moodle will open.

clip_image024

D. Version Summary

This section summarizes the versions of the different software included in the Complete install packages for Windows:

  • Moodle Windows Installer: 2008050400
    • Xampp Lite: 1.7.0
    • Apache 2: 2.11
    • PHP: 5.2.8
    • MySQL: 5.1.30
    • Moodle 1.8.8+ (Build: 20090325) (2007021580).

 

E. LDAP Configuration

This section contains the steps needed for configuring the LDAP authentication for Moodle.

PHP LDAP module
  1. Browse http://moodle-machine/admin/phpinfo.php and login as admin.
  2. Search for ldap and make sure that the LDAP Support is enabled.
  3. If not, you can refer to the following page for installing and enabling the PHP LDAP module: http://docs.moodle.org/en/Active_Directory
Active Directory configurations
  1. Connect to the Active Directory server.
  2. Browse Start > Administrative Tools > Active Directory Users and Computers.
  3. Under Users, create a new user for the binding to LDAP with the following data:
    1. First Name: LDAP
    2. Last name: User
    3. Full Name: ldapuser
    4. User logon name: ldapuser
    5. Password: Password
    6. Password Never Expires
  4. Create a new organizational unit to hold all the Moodle users:
    • In the console tree, right-click on domain node.
    • Point to New, and then click Organizational Unit.
    • Type moodleusers as the name of the organizational unit.
    • Add some users to this organizational unit.
  5. Create a new group containing the Teachers:
    • Right-click on the moodleusers node.
    • Point to New, and then click Group.
    • Type Teachers as the group name and click OK.
    • Add a subset of the moodle users to this group.
Getting the DNs for Contexts and Creators

For a proper binding to the LDAP, any object is identified by a so-called Distinguished Name (DN).

In this section, you should specify the DN values for the objects created in the previous section:

  • The LDAP User.
  • The moodleusers organizational unit.
  • The Teachers security group.

Note

The LDAP Browser is a very nice tool for browsing and analyzing LDAP directories easily and effectively.

You can download the LDAP browser from the following URL: http://www.ldapadministrator.com/download.htm

When you try to install the software, it asks you to install the MS Core XML services first, if they are not already installed.

You can download the MS Core XML Services from the following URL: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=993c0bcf-3bcf-4009-be21-27e85e1857b1

Moodle configurations
  1. Login to Moodle as admin.
  2. From the Site Administration box, browse Users > Authentication.
  3. In the table that appears, enable the LDAP Server option by clicking on the closed eye to make it open.
  4. Click on the corresponding Settings link.
  5. Fill the proper values for the LDAP server settings parameters. The following table should help.

Field name

Remarks

Value

LDAP Server Settings

Host URL

Some people have trouble connecting with the “ldap://server-URL” syntax, especially on MS Windows servers. In this case, one can use “server-URL” only.

moss-machine

Version

Unless you are using a really old LDAP server, version 3 is the one you should choose.

3

LDAP Encoding

Specify encoding used by LDAP server. Most probably utf-8.

utf-8

Bind settings

Hide passwords

 

Yes

Distinguished Name

This is the distinguished name of the bind user defined above.

CN=ldapuser, CN=Users, DC=mydomain, DC=com

Password

This is the password of the bind user.

Password1

User lookup settings

User type

 

MS ActiveDirectory

Contexts

The DN of the container where all Moodle users are found.

OU=moodleusers, DC=mydomain, DC=com

Search subcontexts

 

No

Dereference aliases

 

No

User attribute

 

sAMAccountName

Member attribute

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Member attribute uses dn

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Object class

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Force change password

Force change password

 

No

Use standard Change Password Page

 

No

Password Format

 

Plain text

Password change URL

   

LDAP password expiration settings

Expiration

 

No

Expiration warning

 

10

Expiration attribute

   

Grace logins

 

No

Grace login attribute

   

Enable user creation

Create users externally

 

No

Context for new users

   

Course creator

Creators

The DN of the Teachers group.

CN=Teachers, OU=moodleusers, DC=mydomain, DC=com

Cron synchronization script

Removed ext user

 

Keep internal

Data Mapping

First name

 

givenName

Surname

 

sn

Email address

 

mail

Phone 1

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Phone 2

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Institution

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Department

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Address

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

City/town

 

l

Country

 

c

Description

 

description

ID Number

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Language

This parameter is optional. So unless you need something special, you don't need to fill this in.

 

Import Users

Run the import users script located under \server\moodle\auth\ldap\auth_ldap_sync_users.php

  1. Open the Command Prompt window
  2. Type in the following command:

C:\Moodle1.8\server\php\php.exe -f C:\Moodle1.8\server\moodle\auth\ldap\auth_ldap_sync_users.php

  1. The result should look similar to this:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Moodle1.8\server\php\ext\php_pdf.dll' - The specified module could not be found.
in Unknown on line 0
Configuring temp table
Creating temp table mdl_extuser
Connecting to ldap...
+ 4 users
Got 4 records from LDAP
No updates to be done
User entries to add: 4
Inserted user moodle.student1 id 3
Inserted user moodle.student2 id 4
Inserted user moodle.teacher1 id 5
Inserted user moodle.teacher2 id 6

F. Smoke Tests

  1. Login to Moodle using the admin user and check that the Active Directory users have been imported successfully.
  2. Create some courses.
  3. Assign teachers and students to the different courses.
  4. From the Site Administration block, browse on Front Page > Front Page Settings.
  5. Check the parameter Include a topic section and click the Save changes button.
  6. On the Front Page, click on the Turn editing on button.
  7. You should see a small edit link appear on the left side of the middle column.
  8. Click the edit link and type a welcome message.
  9. Add the Latest News and Online Users blocks.
  10. Add some topics to the Latest News block.
  11. Click the Turn editing off button.

G. Troubleshooting

Error in binding to port 80

When running Start Moodle.exe, you might get an error message that port 80 is already in use and finally the application shuts down.

Perform the following checks:

  1. Is Apache already running?
    1. => No action is needed!
  2. Is the IIS Admin service running?
    1. => Stop it.
  3. Is Skype running?
    1. => Exit Skype or change the port settings in Skype as follows
    2. Browse Tools > Options.
    3. Click the Connection tab.
    4. Uncheck the option: Use port 80 and 443 for incoming connections.
    5. Click Save.
  4. Check for another application which may be using port 80 as follows:
    1. Open the Command Prompt window
    2. Type in the following command: netstat -o -n -a | findstr 0.0:80
    3. The result should look similar to this:

TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 870

    1. The last column is the process ID (or PID)
    2. Open the Task Manager
    3. Go to Processes tab and browse View > Select Columns….
    4. In the Select Process Page Columns dialog, select the checkbox for PID (Process Identifier), and click OK.
    5. Match the PID number returned from the netstat command to identify the application running on port 80

Run Moodle on a port other than port 80

If you need to let Apache listen on another port than 80, you should perform the following steps:

  • Open the file httpd.conf under C:\Moodle1.8\server\apache\conf and change the port from 80 to 8080.
  • Change line 53 as follows: Listen 8080
  • Change line 169 as follows: ServerName localhost:8080

The application does not start

The msvcr71.dll library file is required, in order to run Xampp.
Check if it exists under the following path: C:\Windows\system32.
If you don’t find it, then you should download it and place it in C:\Moodle1.8\server\apache\bin.

 

H. References

Download Standard Moodle Packages
http://download.moodle.org/

Installing Moodle
http://docs.moodle.org/en/Installing_Moodle

Windows installation
http://docs.moodle.org/en/Windows_installation

Complete install packages for Windows
http://docs.moodle.org/en/Complete_install_packages_for_Windows

Installation FAQ
http://docs.moodle.org/en/Installation_FAQ

Installation problems forum
http://moodle.org/mod/forum/view.php?id=28

LDAP authentication
http://docs.moodle.org/en/LDAP_authentication

Active Directory
http://docs.moodle.org/en/Active_Directory

LDAP Properties for CSVDE and VBScript
http://www.computerperformance.co.uk/Logon/LDAP_attributes_active_directory.htm

LDAP Namespace Structure
http://www.informit.com/articles/article.aspx?p=101405&seqNum=7

Front Page Customization in Moodle
http://www.packtpub.com/article/front-page-customization-in-moodle

Integration between Moodle and MOSS - Part 1

Part 1: Introduction to Moodle-MOSS integration

My team has recently integrated Moodle and MOSS using the Moodle web parts hosted on Codeplex. I think this integration would play a key role when developing SharePoint portals for schools and universities.

In this article, I provide a step-by-step guide for installing and configuring the different software packages. The article is divided into four parts:
Part 1: Introduction to Moodle-MOSS integration
Part 2: Install Moodle
Part 3: Install the Moodle Integration Solution
Part 4: Zoom on the Moodle web parts
Part 5: Extension Thoughts

A. What is Moodle?
Moodle is a free and open source e-learning software platform, also known as a Course Management System (CMS), Learning Management System (LMS), or Virtual Learning Environment (VLE). Moodle is designed to help educators create effective online learning sites.

For more details about Moodle, see also...
About Moodle
http://docs.moodle.org/en/About_Moodle

Moodle on Wikipedia
http://docs.moodle.org/en/About_Moodle

Teacher documentation
http://docs.moodle.org/en/Teacher_documentation

Administrator documentation
http://docs.moodle.org/en/Administrator_documentation

Developer documentation
http://docs.moodle.org/en/Development:Developer_documentation

Moodle FAQ
http://docs.moodle.org/en/Category:FAQ

Moodle Tutorials
http://www.moodletutorials.org/

B. Why to integrate Moodle and MOSS?
Simply, to make use of the best of two worlds...

  • Moodle is a powerful education system.
  • MOSS is a powerful portal framework.
  • Mix them together and you have a powerful Education Portal.

C. How to integrate Moodle and MOSS?
This section illustrates the architecture for implementing the solution.

The first diagram represents the technology mapping needed for fulfilling the application servers required to build up the system.

image

The second diagram shows the physical architecture of the solution. For simplicity, we have used two servers: one playing the roles of the Domain Controller and MOSS system and the second playing the role of the Moodle system.

image

Monday, April 13, 2009

Content Editor WP: Add a video to a MOSS site

A. Introduction Today, I would like to present a great role of the Content Editor Web Part, namely I would use it to embed a video on a MOSS site. For this article, I am going to use a very interesting video that I have just watched on TED.

B. Get a video from TED 1. Browse http://www.ted.com/. 2. Search for a video that you would like to share with your colleagues on MOSS. I have chosen Nathan Wolfe: A jungle search for the next pandemic virus. 3. Browse the video and click the Share button.

image 4. Click the Copy button beside the Embed this video field.

image 5. Save the copied text to any temporary text file.

C. Add the video on the MOSS site 1. Browse the MOSS site on which you would like to share the video. 2. Click Site Actions > Edit Page.

image3. Click Add a Web Part, scroll down till you find the Content Editor web part, select it and click the Add button.

image4. Click the Open the tool pane link.

image5. Click the Source Editor button.

image6. Paste the Embedding Code, which you have saved earlier on in a temporary text file. And click the Save button. 7. Unfold the Appearance node and write a descriptive title for the Content Editor Web Part.

image

8. Click the OK button to save the configurations of the Content Editor web part. 9. Click the Exit Edit Mode button on the upper right corner of the page. 10. Now all your colleagues can watch the video whenever they visit this page.

image

D. References Add a YouTube Video to SharePoint 2007 by Lee Reed http://www.endusersharepoint.com/?p=1284

Sunday, March 8, 2009

MOSS Administration: How do you find out what version/edition of SharePoint you are running?

A. Introduction I have encountered a problem, where I needed to check the versions of SharePoint and content databases we were running and also which edition of features set (standard or enterprise) was enabled on the farm. After some googling and also support from my colleagues, I found a bunch of very useful articles and tips that I would like to share. B. How do you find out what edition of SharePoint features you are running?
  1. Browse the SharePoint Central Administration.
  2. Click the Operations tab.
  3. Under the Upgrade and Migration section, click Enable enterprise features.
  4. Once you open this window you will find 2 radio buttons.If enterprise is enabled, you will find it selected and the radio buttons control is dimmed. This is because you cannot downgrade to standard. If standard is enabled, you will find it selected and you can choose enterprise. This upgrade would require a license key.
C. How do you find out the version of SharePoint you are running?
  1. Open Control Panel -> Add and Remove Programs.
  2. Select Microsoft Office SharePoint Server 2007.
  3. Click the link Click here for support.
Note: This alrticle also contains the steps of checking the SharePoint version you are running against the database. D. Useful Links The following links contain mappings between SharePoint Versions and the coresponding Public Releases. Various posts on my daily findings with SharePoint 2003 and SharePoint 2007 How to find the level of SharePoint you are running SharePoint 2007 Versions

Wednesday, January 14, 2009

MOSS Configuration: How to view the real exception behind the displayed custom error page?

A. Overview For a SharePoint developer, the error message An unexpected error occurred is useless! A developer needs to get details about the error that has occurred, at least the exception's call stack. When installing MOSS, the default configuration is that the Call Stack is deactivated and the custom error pages are turned on. This is completely correct, because this is how you would wish to have it on your production system. Now comes the question: How should I -as a developer- change the default configuration on my development environment? B. Configure your development environment 1. Open the web.config file Path: C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config 2. Turn on the call stack - Search for safemode element. - Change CallStack="false" to CallStack="true". 3. Turn off the custom error pages - Search for customerrors element. - Change mode="On" to mode="Off". 4. Enable debugging and batch compilation - Search for compilation element. - Change batch="false" debug="false" to batch="true" debug="true". C. Test your configuration - Browse the page that has previously thrown the "An unexpected error occurred" message. - You should now see the yellow ASP.NET page with the true exception and underlying call stack.

Friday, January 2, 2009

SPD Workflow: How to create a formatted body for the Send Email task?

A. Overview

The Send Email is a very popular action for SPD workflow developers. Unfortunately, the Editor of the e-mail body doesn't contain any formatting tools. That's a lot of luxury to ask for. But as the need arises, I have written this article to provide the steps for creating formatted e-mail bodies in the Send Email action.

I have taken the idea and some of the content of this article from an Office Online video tutorial with the title Watch this: Design a document review workflow solution.


B. Design the HTML needed in the body

1. Open Microsoft Office SharePoint Designer 2007.
2. Click File > New > HTML, in order to create a new HTML page.
3. A new panel opens. In the bottom left corner of this panel, make sure that the Split View is selected, as shown in the following figure.


IMPORTANT NOTE:
There are two considerations when you use HTML in workflows:

Consideration 1:
Workflow e-mails do not support class-based styles. All the formatting must be done using inline styles.
The following configuration steps should be performed:
- Click the Style Application icon on the bottom bar.
- Make sure that Style Application is set to Manual and the Target Rule is set to New Inline Style.


Consideration 2:
Any white space will affect how the designed HTML will be displayed. Therefore, it is recommended to remove it.
This can be done easily by performing these steps:
- Click Tools > Optimize HTML.
- In the Remove Whitespace section, select HTML all whitespace.


- Click OK. You can see that all the whitespace has been removed from the HTML code in the Code Pane.

To get the formatted text again, you should follow these steps:
- Select the text in the Code Pane and right-click it.
- Click Reformat HTML.


Now let's continue designing our HTML for the e-mail body.
5. Delete the default text in the Code Pane.
6. Copy and Paste the following text as an example in the Code Pane.



7. Click anywhere in the Design Pane, in order to see how your mail body would look like.
8. Perform the changes you wish.
9. Now remove the whitespace as explained in the previous Note section.
10. Copy your HTML code to a text file and save it, in order to be used later in the workflow.


C. Create the workflow

1. Click File > Open Site.
2. Enter the URL of the site containing an announcement list, on which we shall perform our test.
3. Now click File > New > Workflow.
4. On the Define your new workflow page, enter the following data:
  • Name: FormattingMails
  • Attachment List: Announcements
  • Start Options: Automatically start this workflow when a new item is created
5. Click Next, in order to start designing the workflow steps.
6. Enter Send formatted Mail Body as the Step Name.
7. In the Actions section, select the action Send an Email.
8. Click the this message link.
9. Fill the To and Subject fields with appropriate values.
10. Paste the HTML code which was designed in section B into the Body area.
11. Repalce the fields marked by [*****LOOKUP******] with the correct values using the Lookup wizard.


12. Click OK to close the message builder.
13. Click Finish to save and publish the workflow.


D. Test the solution

1. Browse the site containing the annoucenemnts list to which the workflow was attached.
2. Open the Annoucements list.
3. Create a new entry.
4. Check the body of the sent e-mail notification.