Author Archive
Posted on November 9, 2009 - by Rouslan Grabar
Доклад по PerformancePoint Server 2007 на сайте TechDays.ru
В докладе рассматриваются проблемы технологической организации управления эффективностью бизнеса в современных компаниях, и подробно демонстрируется их решение с помощью Microsoft PerformancePoint, как инструмента для построения цифровых панелей индикаторов.
http://www.techdays.ru/videos/1507.html
Posted on October 19, 2009 - by Rouslan Grabar
How to allow only Folder items to be created in the List root folder
Sometimes you need to prohibit creation of list items in the root folder of the list. For example, you invented some pretty looking, folder-based, issue cataloguing system, but end users create issues in list’s root folder no matter how hard you beg them not to.
Below you will find the code that looks into HttpContext for a “RootFolder” and “Type” parameters and makes use of SPItemEventProperties.Cancel property.
public class IssueItemEventReceiver : SPItemEventReceiver
{
private HttpContext _current;
public IssueItemEventReceiver()
{
_current = HttpContext.Current;
}
public override void ItemAdding(SPItemEventProperties properties)
{
using (SPSite site = new SPSite(properties.SiteId))
{
using (SPWeb web = site.OpenWeb(properties.RelativeWebUrl))
{
SPList list = web.Lists["Issues"];
string rootRelUrl = string.Format("{0}/{1}",
properties.RelativeWebUrl,
list.RootFolder);
bool isFolder = (_current.Request.Params["Type"] != null
&& _current.Request.Params["Type"] == "1");
bool isInRoot = (_current.Request.Params["RootFolder"] == rootRelUrl);
properties.Cancel = !(isFolder && isInRoot);
//// here you can redirect to your very own page in _layouts folder
//if (properties.Cancel)
//{
// SPUtility.Redirect("myFeatureFolderInLayoutsFolder/MyCustomErrorPage.aspx",
// SPRedirectFlags.RelativeToLayoutsPage | SPRedirectFlags.Trusted,
// _current);
//}
}
}
}
}
Posted on October 9, 2009 - by Rouslan Grabar
Move list item into a subfolder in the same list
Someone asked how to copy the list item into a subfolder on the same list. The code the guy provided that used SPListItem.CopyTo(url) did not work for him and was yelling the following:
Invalid URI: The format of the URI could not be determined.
The reason was the fact the guy used destination item property Url. This property is a relative Url, but the CopyTo method requires absolute URL.
Another caveat is that even if used properly, the method was throwing the following exception message:
Source item cannot be found. Verify that the item exist and that you have permission to read it.
Considering the fact that we are moving item the way to overcome this is to use this approach – please see the Powershell snippet below:
#this is p o w e r s h e l l code
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
#returns the SPSite at the specified URL
function getSPSite ([String]$webUrl=$(throw 'Parameter -webUrl is missing!'))
{
return New-Object Microsoft.SharePoint.SPSite("$webUrl");
}
$site = getSPSite($url) as [Microsoft.SharePoint.SPSite];
[Microsoft.SharePoint.SPWeb]$web = $site.OpenWeb("/website");
[Microsoft.SharePoint.SPList]$list = $web.Lists["listname"];
[Microsoft.SharePoint.SPListItem]$srcItem = $list.GetItemById(1);
[Microsoft.SharePoint.SPListItem]$destItem = $list.GetItemById(2);
[String]$srcUrl = $web.Url + "/" +$srcItem.Url;
#here we construct the destination URL for the item
[String]$destUrl = $web.Url + "/" +$destItem.Url + "/" + $srcItem.ID + "_.000";
[Microsoft.SharePoint.SPFile]$srcFile = $web.GetFile($srcUrl);
$srcFile.MoveTo($destUrl);
Posted on July 13, 2009 - by Rouslan Grabar
Краткий обзор возможностей SharePoint 2010 для конечных пользователей
В этой статье я привожу вольный перевод информации доступной на английском языке в разделе “Обзор” на сайте SharePoint 2010
Новый пользовательский интерфейс
Ribbon, знакомый пользователям Office 2007 приходит в Sharepoint 2010. Без того близкий Офису, Шарепоинт стал еще на шаг ближе. Ribbon такойже настраиваемый и констекстно-зависимый, каким мы его привыкли видеть в Офисе. Противникам такой инновации можно не беспокоиться – возможность использовать старый интерфейс остается. Взаимодействие с элементами становится асинхронным (think AJAX :) ), при необходимости запроса информации от пользователя, Sharepoint запросит ее через модальное окно, затемнив фоновое окно (think jQuery plugins :) )
(more…)
Posted on May 19, 2009 - by Rouslan Grabar
Get Free Typemock licenses – ASP.NET bundle launch
Unit Testing ASP.NET? ASP.NET unit testing has never been this easy.
Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle – and for the launch will be giving out FREE licensesto bloggers and their readers.
The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both Typemock Isolator, a unit test tool and Ivonna, the Isolator add-on for ASP.NET unit testing, for a bargain price.
Typemock Isolator is a leading .NET unit testing tool (C# and VB.NET) for many ‘hard to test’ technologies such as SharePoint, ASP.NET,MVC, WCF, WPF, Silverlight and more. Note that for unit testing Silverlight there is an open source Isolator add-on called SilverUnit.
The first 60 bloggers who will blog this text in their blog and tell us about it, will get a Free Isolator ASP.NET Bundle license (Typemock Isolator + Ivonna). If you post this in an ASP.NET dedicated blog, you’ll get a license automatically (even if more than 60 submit) during the first week of this announcement.
Also 8 bloggers will get an additional 2 licenses (each) to give away to their readers / friends.
Go ahead, click the following link for more information on how to get your free license.

