Monday, August 27, 2007

Send Link By Email - Broken URL

For a few weeks, we are facing a problem when trying to send a link to a document from the document library (This occurs only for documents with a non English file name).
Clicking on the "Send To-> Send Link By Email" opens the new message window, but with a broken URL to the document.



Last night I cleared some time for this issue. After searching the MOSS javascripts I found the solution !!!
Within the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1037 Directory (1037 is for the Hebrew version) there is a js file named CORE.JS, inside is located the AddSendSubMenu function, this function generate the "Send" sub-menu that appear when clicking on a list item.

In order to solve the broken URL problem, find this line:
fileUrl=escapeProperly(httpRootWithSlash.substr(0, slashLoc))+currentItemUrl;

And replace it with this line:
fileUrl=escapeProperly(httpRootWithSlash.substr(0, slashLoc))+currentItemEscapedFileUrl;


Save the file, and now after clicking the "Send Link By Email" .....


I hope this solution will be of use for you....

Sunday, August 26, 2007

SharePoint Server 2007 SDK including the new BDC Definition Editor

Microsoft just announced the update for SharePoint Server 2007 SDK: Software Development Kit

the highlight for this update is the new Business Data Catalog Definition Editor.

Here are few of the SDK features, new samples and tool are in bold:

· Business Data Catalog Samples and Utilities

o Microsoft Business Data Catalog Definition Editor

o Sample Pluggable SSO Provider

o WSHelloWorld Web Service

o WSOrders Web Service

o Excel Services User Defined Function Sample

o WSOrders Custom Proxy Sample

o Amazon Web Service Sample

o AdventureWorks Metadata Samples

o SAP Sample

· Document Management and Content Processing Samples

o Comment Scrub Document Converter

o Term Replacement Document Inspector

· Search Samples

o Sample Protocol Handler

o Custom Content Source

· Records Management and Policy Samples

o De-Duplication Router

o Document Integrity Verifier

o Records Center Web Service Console Application

o Search, Collect, and Hold Tool

o Sample Custom Barcode Generator

o IRM Document Protector

· Workflow Samples

o Custom Workflow Report Query Generator

o Custom Workflow Report XLSX Injector

o Visual Studio Workflow Templates

o Enterprise Content Management Workflow Activities

o List Item Activities

o Hello World Sequential Workflow

o State Based Approval Workflow

o Modification Workflow

o Replication and Contact Selector Workflow

o Intersystem Purchase Order

o Confidential Approval Workflow

o Group Approval Workflow

o Approval Workflow Sample

o Multi-Stage Workflow

o Server-side Collect Signatures Workflow

Friday, August 10, 2007

CAML Builder

I just bumped into a fine CAML Builder tool from the U2U site.
http://www.u2u.info/SharePoint/U2U%20Community%20Tools/U2U%20CAML%20Query%20Builder%202007%20RTM.zip

I used it and it's grate !!!

Have a nice weekend,
Liron

Wednesday, August 8, 2007

MOSS List Event Receiver Register application

We developed an ItemEventReceiver to do somthing whenever a list item is added to a list.

In order to register this ItemEventReceiver to a list I created a WinForm application that should run on the MOSS and should register the ItemEventReceiver assembly to the list.

The application has the abbility to add the ItemEventReceiver assembly to any of the list item's available Event Types.

This is a quite simple application:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Microsoft.SharePoint;

namespace MOSSListEventRegister

{

public partial class MOSSListEventRegisterForm : Form

{

public MOSSListEventRegisterForm()

{

InitializeComponent();

}

private void MOSSListEventRegisterForm_Load(object sender, EventArgs e)

{

//Fill EventReceiverTypeCheckedListBox

EventReceiverTypeCheckedListBox.Items.Add("ItemAdded");

EventReceiverTypeCheckedListBox.Items.Add("ItemAdding");

EventReceiverTypeCheckedListBox.Items.Add("ItemAttachmentAdded");

EventReceiverTypeCheckedListBox.Items.Add("ItemAttachmentAdding");

EventReceiverTypeCheckedListBox.Items.Add("ItemAttachmentDeleted");

EventReceiverTypeCheckedListBox.Items.Add("ItemAttachmentDeleting");

EventReceiverTypeCheckedListBox.Items.Add("ItemCheckedIn");

EventReceiverTypeCheckedListBox.Items.Add("ItemCheckedOut");

EventReceiverTypeCheckedListBox.Items.Add("ItemCheckingIn");

EventReceiverTypeCheckedListBox.Items.Add("ItemCheckingOut");

EventReceiverTypeCheckedListBox.Items.Add("ItemDeleted");

EventReceiverTypeCheckedListBox.Items.Add("ItemDeleting");

EventReceiverTypeCheckedListBox.Items.Add("ItemUpdated");

EventReceiverTypeCheckedListBox.Items.Add("ItemUpdating");

}

private void RegisterButton_Click(object sender, EventArgs e)

{

SPSite site = null;

SPWeb web = null;

SPList myList = null;

try

{

site = new SPSite(SiteURLTextBox.Text);

web = site.OpenWeb();

myList = web.Lists[ListsNameComboBox.SelectedText];

for (int i = 0; i < EventReceiverTypeCheckedListBox.Items.Count; i++)

{

switch (EventReceiverTypeCheckedListBox.Items.ToString())

{

case "ItemAdded":

myList.EventReceivers.Add(SPEventReceiverType.ItemAdded, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemAdding":

myList.EventReceivers.Add(SPEventReceiverType.ItemAdding, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemAttachmentAdded":

myList.EventReceivers.Add(SPEventReceiverType.ItemAttachmentAdded, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemAttachmentAdding":

myList.EventReceivers.Add(SPEventReceiverType.ItemAttachmentAdding, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemAttachmentDeleted":

myList.EventReceivers.Add(SPEventReceiverType.ItemAttachmentDeleted, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemAttachmentDeleting":

myList.EventReceivers.Add(SPEventReceiverType.ItemAttachmentDeleting, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemCheckedIn":

myList.EventReceivers.Add(SPEventReceiverType.ItemCheckedIn, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemCheckedOut":

myList.EventReceivers.Add(SPEventReceiverType.ItemCheckedOut, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemCheckingIn":

myList.EventReceivers.Add(SPEventReceiverType.ItemCheckingIn, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemCheckingOut":

myList.EventReceivers.Add(SPEventReceiverType.ItemCheckingOut, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemDeleted":

myList.EventReceivers.Add(SPEventReceiverType.ItemDeleted, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemDeleting":

myList.EventReceivers.Add(SPEventReceiverType.ItemDeleting, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemUpdated":

myList.EventReceivers.Add(SPEventReceiverType.ItemUpdated, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

case "ItemUpdating":

myList.EventReceivers.Add(SPEventReceiverType.ItemUpdating, AssemblyNameTextBox.Text, ClassNameTextBox.Text);

break;

}

}

}

catch (Exception ex)

{

MessageBox.Show(ex.Message);

}

finally

{

if (site != null)

{

site.Close();

site = null;

}

if (web != null)

{

web.Close();

web = null;

}

}

}

private void GetListsButton_Click(object sender, EventArgs e)

{

SPSite site = null;

SPWeb web = null;

SPList myList = null;

try

{

ListsNameComboBox.Items.Clear();

site = new SPSite(SiteURLTextBox.Text);

web = site.OpenWeb();

foreach (SPList lst in web.Lists)

{

if (!lst.Hidden )

ListsNameComboBox.Items.Add(lst.Title);

}

}

catch (Exception ex)

{

MessageBox.Show(ex.Message);

}

finally

{

if (site != null)

{

site.Close();

site = null;

}

if (web != null)

{

web.Close();

web = null;

}

}

}

}

}