<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-24293551</atom:id><lastBuildDate>Wed, 19 Mar 2014 07:55:15 +0000</lastBuildDate><category>CodeProject</category><category>SharePoint</category><category>ASP.NET</category><category>DotNetNuke</category><category>PowerShell</category><category>.Net Interoperability</category><category>XML</category><category>XSLT</category><title>Adel Refaat</title><description>Adel Refaat Kamel&#39;s Blog</description><link>http://adelkamel.blogspot.com/</link><managingEditor>noreply@blogger.com (Adel Refaat)</managingEditor><generator>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24293551.post-8396665897490533812</guid><pubDate>Tue, 09 Jul 2013 21:19:00 +0000</pubDate><atom:updated>2013-07-13T21:06:02.477+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CodeProject</category><category domain="http://www.blogger.com/atom/ns#">PowerShell</category><category domain="http://www.blogger.com/atom/ns#">SharePoint</category><title>How to change the SharePoint web application physical IIS physical path</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;&quot; imageanchor=&quot;1&quot; style=&quot;clear:right; float:right; margin-left:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; width=&quot;100&quot; src=&quot;http://1.bp.blogspot.com/-J9gZ9EYjubM/Udx-MfTnTZI/AAAAAAAACBA/h6yo53tVLlQ/s1600/images.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Recently, I needed to change the physical path of an already existing SPWebApplication. &lt;br/&gt;This feature is not available from the Central Administration user interface. Of course the first option will be using SharePoint Management Shell. &lt;br/&gt;&lt;br/&gt;Here are the steps to do that: &lt;br/&gt;&lt;br/&gt;&lt;pre class=&quot;brush:c#; gutter: false;toolbar: false; ruler: true;&quot;&gt;&lt;br /&gt; # Get the SPWebApplication using its url or id&lt;br /&gt; $app = Get-SPWebApplication http://servername:port&lt;br /&gt;&lt;br /&gt; # Display the currently set iis physical path&lt;br /&gt; $app.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default].Path.ToString()&lt;br /&gt;&lt;br /&gt; # Create a directory info object with the new required path&lt;br /&gt; $newPathDirectoryInfo = New-Object -TypeName System.IO.DirectoryInfo -Argument List &quot;F:\WebApplications\80&quot;&lt;br /&gt;&lt;br /&gt; # Assign the new directory info to the application iis settings&lt;br /&gt; $app.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default].Path = $newPathDirectoryInfo&lt;br /&gt;&lt;br /&gt; # Update the application&lt;br /&gt; $app.Update()&lt;br /&gt;&lt;/pre&gt;</description><link>http://adelkamel.blogspot.com/2013/07/how-to-change-sharepoint-web.html</link><author>noreply@blogger.com (Adel Refaat)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-J9gZ9EYjubM/Udx-MfTnTZI/AAAAAAAACBA/h6yo53tVLlQ/s72-c/images.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24293551.post-4479452648664790166</guid><pubDate>Wed, 02 Jan 2013 17:59:00 +0000</pubDate><atom:updated>2013-01-06T08:29:37.722+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CodeProject</category><category domain="http://www.blogger.com/atom/ns#">PowerShell</category><category domain="http://www.blogger.com/atom/ns#">SharePoint</category><title>Converting multiple SharePoint 2010 projects to SharePoint 2013</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;&quot; imageanchor=&quot;1&quot; style=&quot;clear:right; float:right; margin-left:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; width=&quot;100&quot; src=&quot;http://4.bp.blogspot.com/-e_8eutz9Vks/UOSj9PmVNrI/AAAAAAAABEM/sjtfsVJcTHM/s200/SP2013.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Converting/ migrating SharePoint 2010 projects to SharePoint 2013 involves changing TargetOfficeVersion to be 15.0, and changing TargetFrameworkVersion to be v4.0 or v4.5 in the Visual Studio csproj file. &lt;br/&gt;&lt;br/&gt;When you have multiple SharePoint 2010 projects in your solution, it will not be an easy task! &lt;br/&gt;&lt;br/&gt;The following PowerShell script is my trial to simplify converting multiple projects, hope it will help. &lt;br/&gt;Just change the value of the $path variable to be your solution path (the folder containing your SharePoint projects). &lt;br/&gt;&lt;br/&gt;&lt;pre class=&quot;brush:c#; gutter: false;toolbar: false; ruler: true;&quot;&gt;&lt;br /&gt;# Path containing SharePoint 2010 projects &lt;br /&gt;$path = &amp;quot;&amp;lt;Your Solution Folder Path&amp;gt;&amp;quot;&lt;br /&gt;&lt;br /&gt;cd $path&lt;br /&gt;$files = get-childitem -recurse -filter *.csproj&lt;br /&gt;&lt;br /&gt;foreach ($file in $files)&lt;br /&gt;{&lt;br /&gt;    &quot;Filename: {0}&quot; -f $($file.Name)&lt;br /&gt;    $proj = [xml](Get-Content $file.FullName)&lt;br /&gt;&lt;br /&gt;    $ns = new-object Xml.XmlNamespaceManager $proj.NameTable&lt;br /&gt;    $ns.AddNamespace(&amp;quot;dns&amp;quot;, &amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;)&lt;br /&gt;    $projectTypeGuids = $proj.SelectSingleNode(&quot;//dns:Project/dns:PropertyGroup/dns:ProjectTypeGuids&quot;, $ns)&lt;br /&gt; &lt;br /&gt; # Check to see if the project type is SharePoint &lt;br /&gt; if ($projectTypeGuids.&quot;#text&quot; -like &amp;quot;*BB1F664B-9266-4fd6-B973-E1E44974B511*&amp;quot;)&lt;br /&gt; {&lt;br /&gt;  $targetOfficeVersion = $proj.SelectSingleNode(&quot;//dns:Project/dns:PropertyGroup/dns:TargetOfficeVersion&quot;, $ns)&lt;br /&gt;  if($targetOfficeVersion -eq $null)&lt;br /&gt;  {&lt;br /&gt;   # Create TargetOfficeVersion element if not exist&lt;br /&gt;   $targetOfficeVersion = $proj.CreateElement(&amp;quot;TargetOfficeVersion&amp;quot;)&lt;br /&gt;   $targetOfficeVersion = $proj.SelectSingleNode(&quot;//dns:Project/dns:PropertyGroup&quot;, $ns).AppendChild($targetOfficeVersion)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  # Change target office version&lt;br /&gt;  $targetOfficeVersion.InnerText = &quot;15.0&quot;&lt;br /&gt;&lt;br /&gt;  # Change target framework version&lt;br /&gt;  $targetFrameworkVersion = $proj.SelectSingleNode(&quot;//dns:Project/dns:PropertyGroup/dns:TargetFrameworkVersion&quot;, $ns)&lt;br /&gt;  $targetFrameworkVersion.InnerText = &quot;v4.5&quot;&lt;br /&gt;&lt;br /&gt;      # Remove empty namespaces&lt;br /&gt;  $proj = [xml] $proj.OuterXml.Replace(&quot; xmlns=`&quot;`&quot;&quot;, &quot;&quot;)&lt;br /&gt;  $proj.Save($file.FullName)&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description><link>http://adelkamel.blogspot.com/2013/01/converting-sharepoint-2010-projects-to.html</link><author>noreply@blogger.com (Adel Refaat)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-e_8eutz9Vks/UOSj9PmVNrI/AAAAAAAABEM/sjtfsVJcTHM/s72-c/SP2013.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24293551.post-2991060061583242065</guid><pubDate>Sat, 22 Dec 2012 11:11:00 +0000</pubDate><atom:updated>2013-01-02T23:10:07.571+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CodeProject</category><category domain="http://www.blogger.com/atom/ns#">SharePoint</category><title>Ghost un-ghosted SharePoint 2010 files</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;&quot; imageanchor=&quot;1&quot; style=&quot;clear:right; float:right; margin-left:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; width=&quot;150&quot; src=&quot;http://2.bp.blogspot.com/-JvYrfAwHetU/UOSfnZB2JJI/AAAAAAAABDY/qvoCKeES1VY/s200/ghost.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Recently, I faced some performance problems in a big customized SharePoint solution. One of the reasons was that some of the page layouts and master pages are un-ghosted by SharePoint designer users, and some other page layouts were created directly in the SharePoint designer without having a feature to deploy them. &lt;br /&gt;&lt;br /&gt;I had to fix that up by re-ghosting the customized pages and create a ghosted version for the files that have been created inside the SharePoint designer without a deployment feature. &lt;br /&gt;&lt;br /&gt;Assessing the current situation I have the following cases: &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Case 1&lt;/b&gt; Some pages had been deployed using SharePoint features, but after that were edited in SharePoint designer. So, they are now customized (un-ghosted) SharePoint Designer displays the icon &lt;img border=&quot;0&quot; height=&quot;19&quot; src=&quot;http://3.bp.blogspot.com/-4M88NT15IVE/UOShvhvCppI/AAAAAAAABD0/xfZFks-oW4E/s200/iIcon.png&quot; width=&quot;20&quot; /&gt; beside these files. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Case 2&lt;/b&gt; Some pages had been deployed using SharePoint features, but after that they were replaced in SharePoint designer by uploading another file with the same name and overwriting the existing one. So, they are now customized (un-ghosted) SharePoint Designer doesn&#39;t display anything to show that these file are customized. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Case 3&lt;/b&gt; Some pages had been created directly by importing files to the SharePoint designer using import option, which means they have never been ghosted before. Again, SharePoint Designer doesn&#39;t display anything to show that these file are customized. (Actually, they are not customized because they have never been ghosted before) but I need to make them ghosted. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://spghostfilesmanager.codeplex.com&quot; imageanchor=&quot;1&quot; style=&quot;clear:right; float:right; margin-left:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;141&quot; width=&quot;200&quot; src=&quot;http://2.bp.blogspot.com/-D9bJpx7zbGI/UNWULpWIggI/AAAAAAAABA8/0HNBEm1jxQo/s200/SPGhostFilesManager.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;  So, I created a Windows application small tool, &lt;a href=&quot;http://spghostfilesmanager.codeplex.com/&quot;&gt;SPGhostFilesManager&lt;/a&gt;, to help doing the job. &lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;First&lt;/b&gt;, I want to know what are the customized files (the three types above)&lt;/div&gt;&lt;div&gt;&lt;b&gt;Second&lt;/b&gt;, I have to revert the un-ghosted files that already have ghosted files deployed, but after updating the ghosted files by the customized files content.&lt;/div&gt;&lt;div&gt;&lt;b&gt;Third&lt;/b&gt;, I have to create ghosted files for the files created directly in the SharePoint designer and re-ghost those files to keep everything working as is while having all the files ghosted.&lt;/div&gt;&lt;br /&gt;Here are the steps I followed to handle each of the above cases: &lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;div&gt;&lt;b&gt;For Case 1: &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;For Case 2: &lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Using &lt;a href=&quot;http://spghostfilesmanager.codeplex.com/&quot;&gt;SPGhostFilesManager&lt;/a&gt;, Save each file content to the disk using the &quot;Save&quot; button.&lt;/li&gt;&lt;li&gt;Back to the SharePoint feature in Visual Studio update the content of the original deployable files.&lt;/li&gt;&lt;li&gt;Redeploy the feature containing the files to have the ghosted files updated.&lt;/li&gt;&lt;li&gt;Using &lt;a href=&quot;http://spghostfilesmanager.codeplex.com/&quot;&gt;SPGhostFilesManager&lt;/a&gt;, Click &quot;Revert&quot; button beside each file to revert it back to the ghosted file.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;For Case 3:&lt;/b&gt; (These are the files with Status &lt;b&gt;None&lt;/b&gt; on the &lt;a href=&quot;http://spghostfilesmanager.codeplex.com/&quot;&gt;SPGhostFilesManager&lt;/a&gt; view)&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Using &lt;a href=&quot;http://spghostfilesmanager.codeplex.com/&quot;&gt;SPGhostFilesManager&lt;/a&gt;, Save each file content to the disk using the &quot;Save&quot; button.&lt;/li&gt;&lt;li&gt;Create a SharePoint feature (or use an existing one) to deploy these files as ghosted versions but you have to choose other names for the files to be able to link the old un-ghosted files to these new ghosted files.&lt;/li&gt;&lt;li&gt;Deploy the created feature to get your ghosted files in the SharePoint environment.&lt;/li&gt;&lt;li&gt;Using &lt;a href=&quot;http://spghostfilesmanager.codeplex.com/&quot;&gt;SPGhostFilesManager&lt;/a&gt;, Click &quot;Ghost&quot; button beside each file to ghost it to the corresponding one you deployed using the feature.&lt;/li&gt;&lt;/ul&gt;</description><link>http://adelkamel.blogspot.com/2012/12/ghost-un-ghosted-sharepoint-2010-files.html</link><author>noreply@blogger.com (Adel Refaat)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-JvYrfAwHetU/UOSfnZB2JJI/AAAAAAAABDY/qvoCKeES1VY/s72-c/ghost.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24293551.post-5775067041916503919</guid><pubDate>Thu, 10 Nov 2011 17:30:00 +0000</pubDate><atom:updated>2013-01-02T23:51:22.239+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">CodeProject</category><category domain="http://www.blogger.com/atom/ns#">SharePoint</category><title>Paginating SharePoint List Items</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;&quot; imageanchor=&quot;1&quot; style=&quot;clear:right; float:right; margin-left:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;94&quot; width=&quot;200&quot; src=&quot;http://1.bp.blogspot.com/-uv-oXPNxcDQ/UOSrq_LPbdI/AAAAAAAABEs/hX5eB7LI2fQ/s200/pagination2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Paginating SharePoint list items is not a straight forward task. You have to do some plumbing to make it work. especially, if you have sorting and filtering applied to the query you want to get your items with. &lt;br /&gt;&lt;br /&gt;This is my trial to make the task easier:&lt;br /&gt;&lt;b&gt;SPPagedListItemsRetriever&lt;/b&gt; is a class that we need to instantiate by specifying the SPList we need to work with, and SPQuery we will execute.&lt;br /&gt;&lt;pre class=&quot;brush:c#; gutter: false;toolbar: false; ruler: true;&quot;&gt;SPPagedListItemsRetriever pagedItemsRetriever = new SPPagedListItemsRetriever(list, query);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then, we have 2 public methods: &lt;br /&gt;&lt;pre class=&quot;brush:c#; gutter: false;toolbar: false; ruler: true;&quot;&gt;public SPListItem[] GetItems(int? startIndex, int? maxRowsCount); &lt;br /&gt;public int GetTotalItemsCount();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;The drawback of the used technique in this implementation, is that it always get the items from the beginning! So, if you are asking to get the items starting from item 200 and with page size 10, It will get the first 199 items and throw them away, then begin getting the required items from 200 to 210.  &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Here is the complete post of the code: &lt;br /&gt;&lt;pre class=&quot;brush: c#; gutter: false;toolbar: false; ruler: true;&quot;&gt;&lt;br /&gt;/// &amp;lt;summary&amp;gt; &lt;br /&gt;/// Retrieves paginated items of SPList with the specified SPQuery. &lt;br /&gt;/// &amp;lt;/summary&amp;gt; &lt;br /&gt;public class SPPagedListItemsRetriever&lt;br /&gt;{ &lt;br /&gt;  private SPQuery _query;&lt;br /&gt;  private SPList _list;&lt;br /&gt;  private const int MaxRowLimit = 2000;&lt;br /&gt;  private static SPListItemCollectionPosition _emptySPListItemCollectionPosition = new SPListItemCollectionPosition(string.Empty); &lt;br /&gt;&lt;br /&gt;  /// &amp;lt;summary&amp;gt;&lt;br /&gt;  /// Constructs a new instance of SPPagedListItemsRetriever &lt;br /&gt;  /// &amp;lt;/summary&amp;gt; &lt;br /&gt;  /// &amp;lt;param name=&amp;quot;list&amp;quot; /&amp;gt;The list to get the items from&lt;br /&gt;  /// &amp;lt;param name=&amp;quot;query&amp;quot; /&amp;gt;The query by which the items should be retrieved&lt;br /&gt;  public SPPagedListItemsRetriever(SPList list, SPQuery query) &lt;br /&gt;  { &lt;br /&gt;    _list = list; &lt;br /&gt;    _query = query;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  /// &amp;lt;summary&amp;gt; &lt;br /&gt;  /// Get the items of the list with the specified query begining from a specified startIndex and with maxRowsCount (PageSize) &lt;br /&gt;  /// &amp;lt;/summary&amp;gt; &lt;br /&gt;  /// &amp;lt;param name=&amp;quot;startIndex&amp;quot; /&amp;gt; &lt;br /&gt;  /// &amp;lt;param name=&amp;quot;maxRowsCount&amp;quot; /&amp;gt; &lt;br /&gt;  /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;  public SPListItem[] GetItems(int? startIndex, int? maxRowsCount)&lt;br /&gt;  {&lt;br /&gt;    SPListItemCollectionPosition listItemCollectionPosition = null; &lt;br /&gt;    uint actualStartIndex = startIndex.HasValue ? (uint)startIndex.Value : 0;&lt;br /&gt;    //If we need items beginning from a specific index (greater that 0, the first one) &lt;br /&gt;    //Create a dummy query to begin getting the items from the first one (0) till we reach the specified startIndex &lt;br /&gt;    if (actualStartIndex &amp;gt; 0)&lt;br /&gt;    {&lt;br /&gt;      SPQuery dummyQuery = new SPQuery();&lt;br /&gt;      //Change the ViewFields returned from this dummy query to minimal, actually we dont need these items so selelct the ID only to minimize the view fields&lt;br /&gt;      dummyQuery.ViewFields = &amp;quot;&amp;lt;fieldref name=&amp;apos;ID&amp;apos;&amp;gt;&amp;quot;; &lt;br /&gt;      dummyQuery.Query = _query.Query;&lt;br /&gt;      &lt;br /&gt;      if (null != _query.Folder)&lt;br /&gt;        dummyQuery.Folder = _query.Folder; &lt;br /&gt;      &lt;br /&gt;      int gotDummyItems = 0;&lt;br /&gt;      do&lt;br /&gt;      { &lt;br /&gt;        //Minimize the number of items not to exceed the recommended 2000 MaxRowLimit for SPQuery&lt;br /&gt;        dummyQuery.RowLimit = Math.Min((uint)(actualStartIndex - gotDummyItems), MaxRowLimit); &lt;br /&gt;        if (null == listItemCollectionPosition)&lt;br /&gt;          listItemCollectionPosition = _emptySPListItemCollectionPosition;&lt;br /&gt;        &lt;br /&gt;        dummyQuery.ListItemCollectionPosition = listItemCollectionPosition;&lt;br /&gt;        SPListItemCollection items = _list.GetItems(dummyQuery); gotDummyItems += items.Count; &lt;br /&gt;        listItemCollectionPosition = items.ListItemCollectionPosition;&lt;br /&gt;      }&lt;br /&gt;      while (gotDummyItems &amp;lt; actualStartIndex &amp;amp;&amp;amp; listItemCollectionPosition != null);&lt;br /&gt;    } &lt;br /&gt;    &lt;br /&gt;    //Now we will get the actual items we need &lt;br /&gt;    SPQuery query = new SPQuery();&lt;br /&gt;    query.Query = _query.Query;&lt;br /&gt;    if (null != _query.Folder)&lt;br /&gt;      query.Folder = _query.Folder;&lt;br /&gt;    query.ViewFields = _query.ViewFields;&lt;br /&gt;    List&amp;lt;splistitem&amp;gt; returnedItemsList = new List&amp;lt;splistitem&amp;gt;();&lt;br /&gt;    uint actualMaxRowCount = maxRowsCount.HasValue ? (uint)maxRowsCount.Value : (uint)_list.ItemCount; &lt;br /&gt;&lt;br /&gt;    do&lt;br /&gt;    { &lt;br /&gt;      //Minimize the number of items not to exceed the recommended 2000 MaxRowLimit for SPQuery&lt;br /&gt;      query.RowLimit = Math.Min(actualMaxRowCount, MaxRowLimit); &lt;br /&gt;      if (null == listItemCollectionPosition)&lt;br /&gt;        listItemCollectionPosition = _emptySPListItemCollectionPosition;&lt;br /&gt;      query.ListItemCollectionPosition = listItemCollectionPosition;&lt;br /&gt;      SPListItemCollection listItems = _list.GetItems(query);&lt;br /&gt;      returnedItemsList.AddRange(listItems.Cast&amp;lt;splistitem&amp;gt;().Select(i=&amp;gt;i));&lt;br /&gt;      listItemCollectionPosition = listItems.ListItemCollectionPosition;&lt;br /&gt;    }&lt;br /&gt;    while(returnedItemsList.Count &amp;lt; actualMaxRowCount &amp;amp;&amp;amp; listItemCollectionPosition != null); &lt;br /&gt;     &lt;br /&gt;    return returnedItemsList.ToArray();&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  /// &amp;lt;summary&amp;gt;&lt;br /&gt;  /// Gets the total items count using the specified query&lt;br /&gt;  /// &amp;lt;/summary&amp;gt;&lt;br /&gt;  /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;  public int GetTotalItemsCount()&lt;br /&gt;  {&lt;br /&gt;    SPQuery query = new SPQuery();&lt;br /&gt;    //Change the ViewFields returned from this dummy query to minimal, actually we dont need these items so selelct the ID only to minimize the view fields&lt;br /&gt;    query.ViewFields = &amp;quot;&amp;lt;fieldref name=&amp;apos;ID&amp;apos;&amp;gt;&amp;quot;;&lt;br /&gt;    query.Query = _query.Query;&lt;br /&gt;    SPFolder folder = _query.Folder;&lt;br /&gt;    if (null != folder)&lt;br /&gt;      query.Folder = folder;&lt;br /&gt;    return _list.GetItems(query).Count; &lt;br /&gt;  } &lt;br /&gt;} &lt;br /&gt;&lt;/pre&gt;</description><link>http://adelkamel.blogspot.com/2011/11/paging-sharepoint-list-items.html</link><author>noreply@blogger.com (Adel Refaat)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-uv-oXPNxcDQ/UOSrq_LPbdI/AAAAAAAABEs/hX5eB7LI2fQ/s72-c/pagination2.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24293551.post-1127710219578257223</guid><pubDate>Sun, 06 Nov 2011 15:00:00 +0000</pubDate><atom:updated>2011-11-07T11:07:53.084+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CodeProject</category><category domain="http://www.blogger.com/atom/ns#">XML</category><category domain="http://www.blogger.com/atom/ns#">XSLT</category><title>Grouping XML elements using XSLT version 1.0</title><description>Suppose you have an XML like:&lt;br /&gt;&lt;pre class=&quot;brush: xml; gutter: false;toolbar: false; ruler: true;&quot;&gt;&lt;br /&gt;&amp;lt;Rows&amp;gt;&lt;br /&gt;  &amp;lt;Row Category=&quot;Sweet&quot; Value=&quot;Chocolate&quot;/&amp;gt;&lt;br /&gt;  &amp;lt;Row Category=&quot;Salty&quot; Value=&quot;Potato Chips&quot;/&amp;gt;&lt;br /&gt;  &amp;lt;Row Category=&quot;Salty&quot; Value=&quot;Pop Corn&quot;/&amp;gt;&lt;br /&gt;  &amp;lt;Row Category=&quot;Sour&quot; Value=&quot;Lemon&quot;/&amp;gt;&lt;br /&gt;  &amp;lt;Row Category=&quot;Sweet&quot; Value=&quot;Biscuits&quot;/&amp;gt;&lt;br /&gt;  &amp;lt;Row Category=&quot;Salty&quot; Value=&quot;Fries&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/Rows&amp;gt;&lt;/pre&gt;&lt;br /&gt;And you want to have these rows grouped by the &#39;Category&#39; attribute like:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Salty&lt;/b&gt;&lt;br /&gt;&lt;hr /&gt;Fries&lt;br /&gt;Pop Corn&lt;br /&gt;Potato Chips&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sour&lt;/b&gt;&lt;br /&gt;&lt;hr /&gt;Lemon&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sweet&lt;/b&gt;&lt;br /&gt;&lt;hr /&gt;Biscuits&lt;br /&gt;Chocolate&lt;br /&gt;&lt;br /&gt;You can use &lt;a href=&quot;http://en.wikipedia.org/wiki/Muenchian_grouping&quot;&gt;Muenchian grouping&lt;/a&gt; just like the following:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml; gutter: false;toolbar: false; ruler: true;&quot;&gt;&lt;br /&gt;&amp;lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; exclude-result-prefixes=&quot;msxsl&quot;&amp;gt;&lt;br /&gt;  &amp;lt;!-- First, define a key that uses our element or attribute we need to group by. In our case it&#39;s the Category attribute. --&amp;gt;&lt;br /&gt;  &amp;lt;xsl:key name=&quot;food-by-Category&quot; match=&quot;Row&quot; use=&quot;@Category&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template match=&quot;Rows&quot;&amp;gt;&lt;br /&gt;  &amp;lt;!-- Now, we need to iterate on the Categories, This can be done by iterating on the first XML Row item for each Category. We will do that by create a node set for the current Row item (.) and the first item in the Key of the Current item  Category. Then we check the count to see is it 1 or 2.. If 1, So we&#39;ve the same item in the node set; We have a new Category.--&amp;gt;&lt;br /&gt;    &amp;lt;xsl:for-each select=&quot;Row[count(. | key(&#39;food-by-Category&#39;, @Category)[1]) = 1]&quot;&amp;gt;&lt;br /&gt;      &amp;lt;!-- Sort by the Category --&amp;gt;&lt;br /&gt;      &amp;lt;xsl:sort select=&quot;@Category&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;xsl:value-of select=&quot;@Category&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;hr /&amp;gt;&lt;br /&gt;      &amp;lt;!-- Now loop on the items of this Category, We get them from the Key we defined --&amp;gt;&lt;br /&gt;      &amp;lt;xsl:for-each select=&quot;key(&#39;food-by-Category&#39;, @Category)&quot;&amp;gt;&lt;br /&gt;        &amp;lt;!-- Sort by the item Value --&amp;gt;&lt;br /&gt;        &amp;lt;xsl:sort select=&quot;@Value&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:value-of select=&quot;@Value&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;br/&amp;gt;      &amp;lt;/xsl:for-each&amp;gt;&lt;br /&gt;      &amp;lt;br/&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:for-each&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;/pre&gt;</description><link>http://adelkamel.blogspot.com/2011/11/grouping-xml-elements-using-xslt.html</link><author>noreply@blogger.com (Adel Refaat)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24293551.post-6668558145679549292</guid><pubDate>Wed, 23 Feb 2011 09:44:00 +0000</pubDate><atom:updated>2011-11-11T11:54:07.307+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">DotNetNuke</category><title>DotNetNuke Resources keys</title><description>In DotnetNuke Localization support, every resource key (in &lt;b&gt;APP_LocalResources&lt;/b&gt; or &lt;b&gt;APP_GlobalResources&lt;/b&gt;) should end with an extension.  &lt;br/&gt;&lt;b&gt;resourceName.Text&lt;/b&gt; – Represents a string used for a common purpose&lt;br/&gt;&lt;b&gt;resourceName.Help&lt;/b&gt; – Used mostly in conjuncture with the DNN:Label control, which supplies a help icon () and tooltip.&lt;br/&gt;&lt;b&gt;resourceName.Tooltip&lt;/b&gt; – Used for a control’s Tooltip property.&lt;br/&gt;&lt;b&gt;resourceName.Action&lt;/b&gt; – Used to represent the Title property of a ModuleAction item shown in an actions menu.&lt;br/&gt;&lt;b&gt;resourceName.Confirm&lt;/b&gt; – Text that is displayed in a JavaScript’s confirmation dialog (such as a dialog to confirm deleting a module).&lt;br/&gt;&lt;b&gt;resourceName.Error&lt;/b&gt; – Text that is displayed as an error message. This might be for a label or, more commonly, for one of the ASP.NET validation controls.&lt;br/&gt;&lt;b&gt;resourceName.Detail&lt;/b&gt; – Text that gives more detail about an error message.&lt;br/&gt;&lt;br/&gt; If we add a resource key in a resx file of the &lt;b&gt;APP_LocalResources&lt;/b&gt; or &lt;b&gt;APP_GlobalResources&lt;/b&gt; and didn’t give it an extension (like one of the above or any other one), we cannot get its value back by the DNN Localization logic of the:&lt;br/&gt;&lt;pre  class=&quot;brush: xml; gutter: false;toolbar: false; ruler: true;&quot;&gt;&lt;br /&gt;DotNetNuke.Services.Localization.Localization.GetString(key, this.LocalResourceFile);&lt;br /&gt;&lt;/pre&gt;Or:&lt;br/&gt;&lt;pre  class=&quot;brush: xml; gutter: false;toolbar: false; ruler: true;&quot;&gt;&lt;br /&gt;DotNetNuke.Services.Localization.Localization.GetString(key, &amp;lt;global resource file name&amp;gt;);&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;Further, if we call the &lt;b&gt;Localization.GetString&lt;/b&gt; function with a key without an extension, it will assume that we are asking about the one with the extension &lt;b&gt;&quot;.Text&quot;&lt;/b&gt;.&lt;br/&gt;So the call of &lt;b&gt;Localization.GetString(&quot;SomeKey&quot;, LocalResourceFile)&lt;/b&gt; is equivalent to  &lt;b&gt;Localization.GetString(&quot;SomeKey.Text&quot;, LocalResourceFile)&lt;/b&gt;!</description><link>http://adelkamel.blogspot.com/2011/11/dotnetnuke-resources-keys.html</link><author>noreply@blogger.com (Adel Refaat)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24293551.post-1185322026280692016</guid><pubDate>Sun, 13 Feb 2011 09:32:00 +0000</pubDate><atom:updated>2011-11-11T11:54:29.231+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">DotNetNuke</category><title>Localization support in DotNetNuke</title><description>In general, DNN disables the ASP.NET localization (the resources files) by disabling the build providers of the extensions (.resx and .resources) in the web.config. &lt;pre class=&quot;brush: xml; gutter: false;toolbar: false; ruler: true;&quot;&gt;&lt;br /&gt;&amp;lt;buildProviders&amp;gt;&lt;br /&gt;  &amp;lt;remove extension=&quot;.resx&quot;/&amp;gt;&lt;br /&gt;  &amp;lt;remove extension=&quot;.resources&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/buildProviders&amp;gt;&lt;br /&gt;&lt;/pre&gt;So the calls of &lt;b&gt;HttpContext.GetGlobalResourceObject()&lt;/b&gt; and &lt;b&gt;HttpContext.GetLocalResourceObject()&lt;/b&gt; will always return null!   If we need to support localization in DNN solutions, we have to use the DNN localization class (&lt;b&gt;DotNetNuke.Services.Localization.Localization&lt;/b&gt;) to do so.</description><link>http://adelkamel.blogspot.com/2011/02/localization-support-in-dotnetnuke.html</link><author>noreply@blogger.com (Adel Refaat)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24293551.post-6886850198594560219</guid><pubDate>Sun, 29 Mar 2009 05:09:00 +0000</pubDate><atom:updated>2011-11-07T02:47:01.702+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net Interoperability</category><category domain="http://www.blogger.com/atom/ns#">CodeProject</category><title>DllImport 32bit dlls in .net assemblies throws BadImage exception on 64bit OS</title><description>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  font-weight: bold; font-family:&#39;Courier New&#39;;font-size:13px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;When you compile your .Net &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;executable&lt;/span&gt; with &quot;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_1&quot;&gt;AnyCPU&lt;/span&gt;&quot; platform, it will select the &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_2&quot;&gt;CLR&lt;/span&gt; at &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_3&quot;&gt;runtime&lt;/span&gt; depending on the currently running platform.&lt;div&gt;Which means that your application will run as a 64-bit application on x64 machine and as 32-bit application on x86 machine.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On x64 machines if you use any &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_4&quot;&gt;DllImport&lt;/span&gt; in your .Net executable to load a 32-bit native &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_5&quot;&gt;dll&lt;/span&gt;, while you compile your executable with &quot;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_6&quot;&gt;AnyCPU&lt;/span&gt;&quot; platform, it will crash at &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_7&quot;&gt;runtime&lt;/span&gt; because no 64-bit application can run 32-bit &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_8&quot;&gt;dll&lt;/span&gt;.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So if you want to load a 32-bit native &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_9&quot;&gt;dll&lt;/span&gt; with &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_10&quot;&gt;DllImport&lt;/span&gt; in a .Net executable you have to compile this .Net executable for &quot;x86&quot; platform to make this executable run under the WOW64 as a 32-bit application this will make it capable to load native 32-bit &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_11&quot;&gt;dlls&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://adelkamel.blogspot.com/2009/03/dllimport-32bit-dlls-in-net-assemblies.html</link><author>noreply@blogger.com (Adel Refaat)</author><thr:total>0</thr:total></item></channel></rss>