Wednesday, December 12, 2012

JSONP WCF service over SSL

In .NET Framework 3.5 JSONP message encoding is not available out of the box. In this short post I will show how to configure WCF to support JSONP endpoint over SSL.

Sunday, November 18, 2012

Listing methods tagged with custom attribute

Attributes are very powerful mechanism in .NET. In this particular case, I had created custom attribute and wanted to list all methods tagged with it. Additionally my requirement was to get only methods which has been tagged with my custom attribute with specified parameter value.

Friday, September 7, 2012

Query execution time in miliseconds in SQL Server Management Studio

If you need to get query execution time in milliseconds in SQL Server Management Studio, there is a simple way to achieve this.

Friday, April 27, 2012

Getting field value for specific item version

In this blog entry I will share some findings regarding SharePoint API for items versioning in document library.

Tuesday, April 24, 2012

Extraction of term custom properties from list item field of managed metadata type

The task was to extract custom properties from managed metadata field of list item. Custom properties can be stored in name value like collection for each term, which is very handy in many cases.

Saturday, April 7, 2012

Locating list item in document library by url

If you need to find list item by url, there is easy way. You can create site based on file url. Than it is enough to run GetFile which will return SPFile object. Last thing is to get Item object from returned file object. No need to write CALM queries.

Friday, March 9, 2012

Detection of field value changes in document library

There is pretty easy way to detect change of field value in document library. You can use EventReceiver attached to your content type. ItemUpdating is a good place detects changes and performs validation if required. In my case it was required to detect that value of field has changed and additionally to synchronize value of two fields and perform some additional validation of entered values.

Thursday, March 8, 2012

Document Library and custom rendering templates

Goal was to create document library with requirement to hide fields which have 'Hidden' string in name (unfortunately I could not use ShowIn.. settings due to specific requirement from external tools integrated with SharePoint instance). My first idea was to use custom FormTemplates with custom ListFieldIterator.

Quickly, it turns out that there is a problem with registering FormTemplates for content types based on document library. SharePoint 2010 was ignoring them. The only solution I was able to find, was to disable content type inheritance. That allowed me to register my own FormTemplates.

Monday, February 27, 2012

Returning rows in random order from MS SQL Server

Have you ever needed to return rows from MS SQL Server in random order every time you execute query? Here is simple solution to achieve this.

select top 10 * from some_table order by newid();

Thursday, February 9, 2012

Sending emails from .NET to local folder

This is useful trick when you need to test email sending from your application without flooding your inbox.
It is enough to set up our mail settings in following way:

<configuration>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="SpecifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="Dir"/>
      </smtp>
     </mailSettings>
  </system.net>
</configuration>

Monday, February 6, 2012

Raven DB tutorials

Very nice series of tutorials about RavenDB by Piotr Kwapin.

  • Part 1 - Introduction and Basic Operations
  • Part 2 - Simple Querying

Definitely worth to see. Have a nice reading

Sunday, January 29, 2012

Efficient dates processing in Autonomy Connectors

It happens that data for indexing are in poor shape. Majority of problems are different formats of the same piece of information. This time I will write shortly about dates processing and how to keep them consistent. I'm going to show ImportExtractDate command and it's parameters:

Unexpected crashes of Notes Connector

It happens that Notes Connector is crashing during processing of Lotus Notes database without any specific reason. What is even worst, it usually does not leave any clues in log files. It just exists without any additional information

In my case reason for that behavior were missing fields (on some of Notes documents I was indexing). I was trying to import such field, and perform on it certain operations. This second part was resulting in crash.

Sunday, January 22, 2012

Metadata import from external sources in Autonomy connectors

My first entry will be about importing metadata from external sources when using Autonomy connectors for IDOL Server.

Sometimes, it is required to import additional metadata for indexed documents. In this article, I will describe import process based on Autonomy Lotus Notes Connector, but this procedure is applicable to other Autonomy connectors.

Wednesday, January 18, 2012

Let's begin....

Finally I have decided to start blog. I will be describing here all interesting problems ( and hopefully solutions ) which I'm fighting with during my day to day work. Let's see if this will work...