Paul Liebrand's Weblog

Welcome to my blog mainly about SharePoint

Skip to: Content | Sidebar | Footer

Google Search
Custom Search

Adobe Acrobat X and SharePoint – close, but no cigar

17 May, 2011 (17:18) | SharePoint, Tools | By: Paul Liebrand

Adobe X was released at the end of last year and one of the feature points announced was “Native, seamless integration with Microsoft SharePoint”.  On the surface, everything appears to work correctly and solved one of the main issues with Adobe Acrobat with SharePoint I blogged about in the past.

Recently discovered that it is not as seamless as we would like. Adobe X does not appear to work with the following column types:

  • Date and Time
  • Person or Group
  • Lookup

If you have a date and time column on a document library and you attempt to save the PDF back to SharePoint, you will receive the following error message:

File check in failed. The server said:

“Invalid date/time value

A date/time field contains invalid data. Please check the value and try again.”

AdobeXError

Using Fiddler, I can see the SOAP request that the date field is being sent over as straight text. When using the lists web service, it requires the date to be in ISO 8601.

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
    <UpdateListItems xmlns="
http://schemas.microsoft.com/sharepoint/soap/">
        <listName>{5398FF80-036F-40DB-92D5-264D72DE43B3}</listName>
        <updates>
            <Batch OnError="Continue">
                <Method Cmd="Update" ID="1"><Field Name="Title"/>
                    <Field Name="Date">05/17/2011 05:00:00</Field>
                    <Field Name="FileRef">
http://portal.company.com/z/EditTest.pdf</Field>
                    <Field Name="ID">1</Field>
                    <Field Name="ContentTypeId">0x010100EAB6ED7FBD4A0042A6F9326944DCEE19</Field>
                    <Field Name="ContentType">Document</Field>
                </Method>
            </Batch>
        </updates>
    </UpdateListItems>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The Person or Group field just shows the value as it stored within SharePoint:

-1#;Name

The Lookup field just does not show anything.

I hope Adobe is listening and releases an update that resolves these issues.

[Update]

We received word from Adobe that the “date” issue will be resolved in a release slated for September.  The other issues will be hopefully resolved in the version after that (next year).


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

SharePoint 2010 Markup Style Bug

21 January, 2011 (07:02) | SharePoint | By: Paul Liebrand

We discovered a bug in SharePoint 2010 and the usage of the markup styles when you are editing a page.

MarkupStyles

To reproduce this issue, follow these instructions:

  • Create a new page
  • Click Markup Styles and select Heading 1
  • Type “Test 1” and press enter
  • Click Markup Styles and select Heading 2
  • Type “Test 2” and press enter
  • Click Markup Styles and select Heading 3
  • Type “Test 3” and press enter

If you did this correctly, you should see the following as the end result:

 FirstAttempt

On the surface, things may appear to be working correctly but lets take a closer look.  Click the HTML drop down and select Edit HTML Source.  You will quickly discover that the generated HTML is incorrect:

<h1 class="ms-rteElement-H1">Test 1</h1>
<h2 class="ms-rteElement-H2"><div>Test 2</div>
<h3 class="ms-rteElement-H3">Test 3&#160;</h3></h2>

Notice the H3 element is embedded within the H2 element causing the style of H3 to be different.

Go ahead and clear all the HTML and click OK. The follow the steps outlined above again but instead of pressing enter right away wait for 2-3 seconds before hitting it. You will also notice the blinking cursor will “pause” after typing. When you see it start blinking again it is safe to hit enter.

If you did this correctly, you should see the following as the end result:

SecondAttempt

You will notice that the style of “Heading 3” is different that during the first attempt.  If we examine the generated HTML, you will notice it is now correct:

<h1 class="ms-rteElement-H1">Heading 1</h1>
<h2 class="ms-rteElement-H2">Heading 2</h2>
<h3 class="ms-rteElement-H3">Heading 3&#160;</h3>

We contacted Microsoft and to cut a long story short they are not going to fix this issue.  It gets better – this problem only occurs in Internet Explorer.  Doing the same tests in Chrome will render different and more accurate results.  Also, SharePoint 2007 works as expected.

Just tell your content editors to work slower or have your IT staff roll out Chrome – thanks for another great feature!

SharePoint is like a bumble bee – technically it shouldn’t be able to fly but some how it does…


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

SharePoint 2010 Toolbar Missing in Asset Picker

12 January, 2011 (08:49) | SharePoint | By: Paul Liebrand

If you have used SharePoint 2007 and have moved to SharePoint 2010 you might have noticed that the toolbar is missing from the top of the asset picker. The user experience is horrible due to the fact that this toolbar is missing. A user needs to upload the image to the appropriate library first before they decide to edit the content. Way too many steps!

It has been confirmed by Microsoft that this is a bug and it will be fixed in Service Pack 1.  They have not provided a definitive release date for SP1 but estimated it to be around 2nd quarter.

2007

2007asset

2010

 2010asset


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Programmatically Accessing Message Classification in Exchange 2007 in a Custom Transport Agent

15 September, 2010 (09:48) | .NET, Exchange, Office, Outlook | By: Paul Liebrand

Microsoft introduced the notion of Message Classification (http://technet.microsoft.com/en-us/library/aa998599(EXCHG.80).aspx) in Exchange 2007 and Outlook 2007. This allowed an organization to classify email and then generate transport rules that routed or manipulated those messages based on that classification.

Out of the box, Microsoft provides a list of actions (http://technet.microsoft.com/en-us/library/aa998315(EXCHG.80).aspx) that can be performed in a transport rule. One of the supported actions is prepend the subject with string. Unfortunately, prepending the subject line has some unfortunately side effects. For example, it will screw the sorting within Outlook of someone sorts by subject line.

Due to issues like that, I wanted to append the subject line instead and there was no out of the box way to do this.

That’s were building a Custom Transport Agent comes in. The process of building an actual custom transport agent is pretty trivial. There is already tons of information on the Internet about that specific topic. I would recommend starting here http://msexchangeteam.com/archive/2006/12/04/431755.aspx if you are new to that process.

The problem I had was there was no documented way of accessing the Message Classifications. After reviewing all the SDKs and searching endless on the Internet I kept coming up short. I worked with Microsoft and we finally arrived a solution.

The key to the whole process is asking the X-MS-Exchange-Organization-Classification header. The following code snippet is an example of how to retrieve it:

void ClassificationAgent_OnSubmittedMessage
    (SubmittedMessageEventSource source, QueuedMessageEventArgs e)
{

    var item = e.MailItem;

    try
    {
        var headers = item.Message.MimeDocument.RootPart.Headers;

        // This is the key to retrieving
        //the Message Classification value selected by the user
        var headerList = headers.FindAll("X-MS-Exchange-Organization-Classification");

        foreach (var header in headerList)
        {
            string classification = string.Empty;
            if (_classifications.TryGetValue(new Guid(header.Value), out classification))
            {
                // Perform whatever action you what
                // with the selected Message Classification
            }
        }

    }
    catch (Exception ex)
    {
        EventLog.WriteEntry("Classification Agent", ex.Message, EventLogEntryType.Error);
    }
}

 

You can download the Visual Studio 2010 solution sample (Liebrand.Exchange.Sample) I created from here: http://cid-06457d244696ab3c.office.live.com/browse.aspx/Code%20Samples

If you have ever wanted to access the Message Classification via a custom transport agent and could never figure out how to do it hopefully you will find this useful.


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Photography

24 July, 2010 (21:26) | Personal, Photography | By: Paul Liebrand

I decided to create another blog that is dedicated to one of my hobbies – photography. Over the next few weeks I’ll be uploading some highlights from over the last few years that I have been doing it. Some of the photos I have upload so far include my adventures at some SharePoint conferences (featuring Steve Ballmer, Tom Rizzo, and Huey Lewis and the News), my first wedding, some 4th July fireworks shots and many more.

Collage

Please take a moment to check it out and feel free to leave a comment. Check back often as I add more.

http://photography.paulliebrand.com

Thanks!


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Simple Pattern / Solution for Cross-thread operation not valid

16 July, 2010 (10:54) | .NET | By: Paul Liebrand

If you have ever done any threaded programming in .NET WinForms you have more than likely run into the following error message at some point:

Cross-thread operation not valid 

InvalidOperationException was unhandled

Cross-thread operation not valid: Control ‘’ accessed from a thread other than the thread it was created on.

This exception is normally displayed while running in DEBUG mode. In release mode, everything appears to run as expected but at some point you will definitely run into a thread deadlock issue.

The following code represents a pattern I would use to get around this problem and I insured all the calls that would touch the UI from a different thread followed it:

 
private void button2_Click(object sender, EventArgs e)
{

    ThreadPool.QueueUserWorkItem(notUsed =>
    {
        for (int i = 0; i < 100; i++)
        {
            UpdateStatus(string.Format("Loading record {0} of 100", i, 100));
        }
    });
}

private void UpdateStatus(string message)
{
    if (InvokeRequired)
    {

        BeginInvoke((MethodInvoker)delegate() { UpdateStatus(message); });
        return;
    }

    textBox1.Text = message;
}

Although this pattern works it is not as elegant and can be further refined and simplified. To accomplish this I created an extension method for the Form as such:

    public static class FormExtensions
    {
        public static void HandleCrossThreadUI(this Form form, MethodInvoker code)
        {
            if (form.InvokeRequired)
            {
                form.BeginInvoke(code);
                return;
            }

            code.Invoke();
        }
    }

By modifying the original code above to make use of the extension I can simply the code a little further:

private void button2_Click(object sender, EventArgs e)
{

    ThreadPool.QueueUserWorkItem(notUsed =>
    {
        for (int i = 0; i < 100; i++)
        {
            UpdateStatus(string.Format("Loading record {0} of 100", i, 100));
        }
    });
}

private void UpdateStatus(string message)
{
    this.HandleCrossThreadUI(() => { textBox1.Text = message; });
}

This may not look like much but when you start adding more and more code, it becomes a lot easier to read.

Hopefully you find this a little useful.


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Project Server 2007 “Error: ActiveX component can’t create object” when building Cube

16 June, 2010 (09:23) | Project Server 2007 | By: Paul Liebrand

We recently received the following error message when we attempted to build the cube within Project Server 2007:

Failed to build the OLAP cubes. Error: Analysis Services session failed with the following error: Failed to connect to the Analysis Services server <server>. Error: ActiveX component can’t create object

TechNet has an article (http://technet.microsoft.com/en-us/library/cc197608(office.12).aspx) on this specific error message that basically says you need to make sure you have the SQL Server 2005 Analysis Services components installed on the Project Server application server.

  • Microsoft SQL Server Native Client (sqlncli.msi)
  • Microsoft SQL Server 2005 Management Objects Collection (sqlserver2005_xmo.msi)
  • Microsoft SQL Server 2005 Backwards Compatibility Components (SQLServer2005_BC.msi)

Strange thing was we already had these components installed.

After troubleshooting the issue we determined that the DBAs installed a newer cumulative update on the SQL Server but the components where never updated in the Project Server 2007 environment.

Grabbing the updated components from the matching CU and upgrading those on the Project Server 2007 environment resolved the issue.

Just wanted to share in case anyone else runs into this specific scenario.


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Document is locked for editing – Part 2

12 April, 2010 (11:02) | Office, SharePoint | By: Paul Liebrand

In 2008 I made a post about the infamous “locked for editing” message many people experience while using Office with documents stored in SharePoint. This post addressed the issue that can occur outside the normal “locking” mechanism Office and SharePoint.

I recently had a problem where I attempted to edit an Excel spreadsheet and I was presented by the following message:

File in Use

Being a good SharePoint citizen, I waited about 20 minutes to give SharePoint the chance to unlock this file. Even using the Notify feature of Excel, I never received a notification saying it was available. I decided to follow the steps outlined in my other post on this topic. So I navigated to the Content.MSO directory, cleared it out so it was empty and tried to open the file again via SharePoint. To my surprise, I received the same message.

I was 100% sure that nobody else had this file open so I began investigating further. I ran a filemon on my computer as I was opening the file and saw it was attempting to read and write a file located under C:\Documents and Settings\<user>\Local Settings\Temporary Internet Files\6WBGVSLW\UKYNMWF7\Offline\e

I navigated to this folder and saw this:

4-12-2010 10-51-34 AM

I deleted all the content in this folder and attempted to open my document again and sure enough it opened successfully. This was the first time in the many years I have worked with SharePoint that I ran into this location.

I went to another computer and saw that the folder name after “Temporary Internet Files” was different. If I deleted this folder and opened the document again, the exact same name was created.

After some more research I found a registry key that is used to identify this location:

4-12-2010 10-55-56 AM

HLCU\Software\Microsoft\MSDAIPP\CacheFolderId

This value will identify the location on your computer since it will be different for everyone. The offline folder appears to be a special hidden folder so you might have to key it in manually once you have reached that destination.

For more information on what MSDAIPP (Microsoft Data Access Internet Publishing Provider) is, check out this Wikipedia article.

There still seems to be no idea what causes this problem to happen. Maybe it’s network error or a bug in one of the products – who knows! Regardless, this is just another location you might need to check to release the “locked by another user” error that so many people seem to get.

Hopefully this helps.


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Devon and Christina – Almansor Court, Alhambra

5 April, 2010 (19:13) | Personal, Photography | By: Paul Liebrand

Wedding1

Devon and Christina’s wedding was the very first wedding I have ever been hired to shoot. As an aspiring photographer I was extremely nervous but they had the confidence in me to pull it off. Without a doubt, this was the most stressful photo shoot I have ever done but I think it all came together at the end. I still have much to learn both around my camera and shooting weddings in general.

Wedding2

Wedding3

Wedding4

Wedding5

We were able shoot Devon and Christina this close without them seeing each other before the wedding. It was amazing!

Wedding9

Wedding6

Wedding7

Wedding8

Congratulations to both of you and thank you again for this opportunity. I’ll never forget it.

Wedding10

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Project Server 2007 and SQL Server 2008 Analysis Services Issues

3 March, 2010 (09:42) | Project Server 2007, SharePoint | By: Paul Liebrand

I ran into an issue attempting to get Project Sever 2007 working with SQL Sever 2008 Analysis Services and thought I would create a post about it in case other people are experiencing the same issue.

The first thing to note is the article on TechNet are written as if everything is installed on the same server; that is not the case in my environment. High level overview of my environment:

  • SharePoint Farm
  • Distributed SQL Server 2005 (stores SharePoint DBs and Project Server 2007 DBs)
  • Distributed SQL Server 2008 Analysis Services (for Project Server 2007 cube)

The second thing to note is that the instructions for using SQL Server 2008 Analysis Services specifically call out installing the following components from the Feature Pack for Microsoft SQL 2005 – December 2008 (in this order):

  • SQL Native Client
  • Microsoft SQL Server 2005 Management Objects Collection
  • Microsoft SQL Server 2005 Backward Compatibility Components

Following these instructions to a tee I received the following error message when attempt to build my cube:

Failed to build the OLAP cubes. Error: Analysis Services session failed with the following error: Failed to connect to the Analysis Services server <<SAS Server>>. Error: Cannot connect to the repository. Analysis server: <<SAS Server>> Error: Provider cannot be found. It may not be properly installed.

According to the troubleshooting guide at the bottom of the article this means I do not have the right version of the client installed. Very baffling – I installed everything straight from the links provided in the article.

Next I decided to create the cube against a SQL Server 2005 Analysis Service to see if I had any different results.

Upon creating the cube, I received the following error message:

Analysis Services session failed with the following error: Failed to connect to the Analysis Services server <<SAS Server>>. Error: Cannot connect to the repository. Analysis server: <<SAS Server>> Error: SQL Network Interfaces: Error getting enabled protocols list from registry [xFFFFFFFF].

I did a little searching with the help of a co-worker and I was able to resolve both these issues.

Solutions

1. Error: Provider cannot be found. It may not be properly installed.

This issue was resolved by installing the SQL 2008 Native Client on the Project Server 2007 server. Yes, the SQL 2005 Native Client, 2005 Management Objects Collection, and 2005 Backwards Compatibility Components are still needed.

2. SQL Network Interfaces: Error getting enabled protocols list from registry [xFFFFFFFF]

This issue was resolved by making the following registry change on the Project Server 2007 server.

Locate the following registry key:

HKLM\Software\Microsoft\MSSQLServer\Client\SNI9.0

And for the ProtocolOrder entry should be set to:

tcp
np
sm

Reference: http://serverfault.com/questions/53915/sql-server-2005-error-getting-enabled-protocols-list-from-registry-xffffffff

I hope this helps anyone else that struggled with this.


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit