Showing posts with label MOSS. Show all posts
Showing posts with label MOSS. Show all posts

Tuesday, January 19, 2010

How to update ShowInFileDlg programmatically


At some point in your SharePoint development life time you will probably need to update the ShowInFileDlg attribute of a Site Column.

If you will try to do that by a feature and update the XML with new Field's attributes values, the changes will only take effect on new instances, and will not effect on exsisting ContentTypes or Lists that use these Site Columns.

Programmatically updating the Site Column and the Content Type, the changes will be deployed to the children as well.

Here is a generic method for updating any attribute of the Field element and forcing the changes to the Content Type and its children:

public void UpdateFieldAttribute(string siteCollectionURL, string siteColumnName, string contentTypeName, string fieldAttributeName, string fieldAttributeValue)
{
SPSite site = null;
SPWeb web = null;
try
{
using (site = new SPSite(siteCollectionURL))
{
using (web = site.OpenWeb())
{

SPField siteColumn = site.RootWeb.Fields.GetField(siteColumnName);
XmlDocument fieldSchemaXml = new XmlDocument();
fieldSchemaXml.LoadXml(siteColumn.SchemaXml);
XmlNode fieldXmlNode = fieldSchemaXml.SelectSingleNode("Field");
XmlAttribute attr = fieldXmlNode.Attributes[fieldAttributeName];
attr.InnerText = fieldAttributeValue; ;

siteColumn.SchemaXml = fieldXmlNode.OuterXml;
siteColumn.Update(true);

SPContentType contentType = site.RootWeb.ContentTypes[contentTypeName];

contentType.Update(true, false); //Updating the content type is important or the changes will not be reflected
}
}
}
finally
{
if (web != null)
web.Dispose();
if (site != null)
site.Dispose();
}
}

Wednesday, March 11, 2009

MOSS Search PDF 64-bit using IFilter 9


Install the PDF Ifilter 9 for 64-bit

  1. Download and extract the contents of "PDFiFilter64installer.zip" to your local drive.
  2. Double click "PDFFilter64installer.msi" to launch the installer.
  3. Follow the instructions in the installer wizard to complete the installation.
  4. After installing the PDF iFilter, it is recommended that you set your system PATH environment variable to the "bin" folder of the "Ifilter" installation. For example, from the "Control Panel\System\Advanced\Environment Variables" tab, append to PATH "C:\Program Files\Adobe\Adobe PDF iFilter 9 for 64-bit platforms\bin\" and then restart the computer.
  5. Follow the Sharepoint IFilter Configuration Guide

Add the PDF extension to Search File Types

  1. SharePoint Server Search Administration page by adding ‘pdf’ to list of File Types in Search Administration->File Types

Add the PDF File Icon to MOSS

  1. Download the icon for pdf file from http://www.adobe.com/images/pdficon_small.gif , save it to \TEMPLATE\IMAGES directory and name it pdficon_small.gif.
  2. Open the docicon.xml file from .\template\xml .
  3. Add a new Mapping element to the ByExtension element.
  4. Save the docicon.xml file.
  5. Restart IIS using iisreset command line.


Restart all SharePoint services as well as IIS.

  1. Run these command-lines:
    “net stop osearch”. Wait for success message.
    “net start osearch”. Wait for success message.
  2. Restart IIS using iisreset command line and wait for success message.

Re-Crawl

Make sure that you Full Crawl !!!

*** Troubleshooting ***

Important step that will solve this error message "The filtering process could not process this item. This might be because you do not have the latest file filter for this type of item. Install the corresponding filter and retry your crawl."

Make sure to change the \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf to the GUID {E8978DA6-047F-4E3D-9C78-CDBE46041603}. The original value was {4C904448-74A9-11D0-AF6E-00C04FD8DC02}. (thanks to Russell Wright for that one)

URLs:

http://download.adobe.com/pub/adobe/acrobat/win/9.x/PDFiFilter64installer.zip
http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025
http://support.microsoft.com/default.aspx/kb/832809
http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf
http://www.adobe.com/images/pdficon_small.gif
http://sharepointsolutions.blogspot.com/2009/01/installing-adobes-64-bit-pdf-ifilter-9.html

Thursday, March 5, 2009

WebService "Service Unavailable" error message

When changing the application pool user it is important to add the user to the IIS_WPG group.

Yesterday, we so this error message and found the solution here which says that the reason for this kind of error message may be because one of the following occurs:
  1. The application pool is not running.
  2. The application pool account uses an incorrect password.
  3. The application pool account is not a member of both the IIS_WPG group and the STS_WPG group on the server.

In our case it was the third one, after adding the application pool user to the IIS_WPG group the WebService run like a magic.....

Wednesday, January 16, 2008

MOSS Search for emails and attachments context

Some of our customers requested to have the ability to search context within email messages and within its attachments.

Searching the web for a solution came with results that indicate that a third-party development is needed to achieve this ability...
Then I found Gavin Adams post and Tom Vandaele post that wrote that the ability to deep search within msg files is a MOSS out-of-the-box option that need to be configure.

Followed their instructions I tried to search context in a docx file attachment with in a msg file that was uploaded to a document library. I succeed to get the msg file by searching its context , but failed to get results related to the email's attachments.

After some tests of my own, I figure out that the registry should look like that:
  1. Make sure that this key exists in the MOSS registry
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.msg
  2. Add these keys and values to the .msg
    “Extension”=”msg”
    “FileTypeBucket”=dword:00000001
    “MimeTypes”=”application/msoutlook”


The MimeTypes application/msoutlook is the one I use to gain the deep search ability (couldn't do it using the MimeTypes = application/vnd.ms-outlook)


A note to those of you using hebrew documents, I checked it and it's working for hebrew attachments as well.

Lirliron

Sunday, January 13, 2008

File size limitation

Hi all,

Lately I faced a problem when tried to upload a huge size file and got an Oversize limitation error message,
searching the SharePoint administration came out with nothing.

I found the solution within the STSADM.EXE:

stsadm -o setproperty -propertyname max-file-post-size -propertyvalue 120 -url http://myportalserver/

The propertyvalue represent a numerical value, in megabytes (MB).

Make sure to set the site size limitation as well.

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;

}

}

}

}

}