<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tips and Tricks Archives - Blog IT</title>
	<atom:link href="https://blogit.create.pt/category/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogit.create.pt/category/tips-and-tricks/</link>
	<description>Create IT blogger community</description>
	<lastBuildDate>Wed, 15 Mar 2023 12:52:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Performing broker migrations on your Kafka consumers</title>
		<link>https://blogit.create.pt/joaorafael/2023/03/15/kafka-consumer-broker-migration-aws-msk/</link>
					<comments>https://blogit.create.pt/joaorafael/2023/03/15/kafka-consumer-broker-migration-aws-msk/#respond</comments>
		
		<dc:creator><![CDATA[João Rafael]]></dc:creator>
		<pubDate>Wed, 15 Mar 2023 12:44:45 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[Kafka]]></category>
		<category><![CDATA[migrations]]></category>
		<category><![CDATA[MSK]]></category>
		<category><![CDATA[Streaming]]></category>
		<guid isPermaLink="false">https://blogit.create.pt/?p=12805</guid>

					<description><![CDATA[<p>When using Kafka for communication between systems, you may find yourself having to change your consumer configuration. This may happen due to the publisher changing topic, or a new message broker being created and a company-wide mandate that everyone switch until a set date. Doing this sort of migration isn&#8217;t very complicated, but any errors [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/joaorafael/2023/03/15/kafka-consumer-broker-migration-aws-msk/">Performing broker migrations on your Kafka consumers</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>When using Kafka for communication between systems, you may find yourself having to change your consumer configuration. This may happen due to the publisher changing topic, or a new message broker being created and a company-wide mandate that everyone switch until a set date. Doing this sort of migration isn&#8217;t very complicated, but any errors may prove to be costly. If we re-consume a new topic from the beginning, for example, we may accidentally fill up our database, for example. We want to start consuming the new topic at around the same time we stopped consuming the old one (with a buffer of a few minutes preferably, just to be safe).</p>



<p>The first step here is to ensure that your consumer code is idempotent, but that’s something that you should always ensure &#8211; just imagine that you have to re-consume a couple of messages, in that case lacking idempotency may result in your system getting strange data and bugs.</p>



<h2 class="wp-block-heading">Setting up Kafka on your machine</h2>



<p><em>(Feel free to skip this section if you have everything set up.)</em></p>



<p>Kafka releases aren’t included in most package managers, except for Homebrew in Mac systems. They should be available, however, in the <a href="https://kafka.apache.org/downloads" target="_blank" rel="noreferrer noopener">official download page</a>. For Unix systems (Mac, Linux, WSL, *BSD), simply get one of the binary downloads and extract it wherever you prefer. Then, make sure to add the bin folder to your $PATH, so that you can use these scripts in any folder. In my case, I put the extracted archive in $HOME/.local/share/kafka, so I edit my .zshrc (or .bashrc in a plainer Linux/WSL system) and add:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
export PATH=$HOME/.local/share/kafka/bin:$PATH
</pre></div>


<p><br>Now we can use the official kafka scripts in any directory. That is, unless we have some form of authentication. We can add additional configs to a file somewhere, and include that file in our commands. Let’s put a file called <code>dev.cfg</code> in <code>$HOME/.config/kafka/</code> (the exact directory doesn’t matter, but .config is the appropriate directory for configs), and write the following on it:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-512
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required \
    username=&quot;me&quot; \
    password=&quot;noneofyourbusiness&quot;;
</pre></div>


<p>This is just an example, your broker&#8217;s security config may vary. After doing this, just add to any of the Kafka commands you use:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
--command-config $HOME/.config/kafka/dev.cfg
</pre></div>


<h2 class="wp-block-heading">Checking consumer offsets</h2>



<p>Before migrating topics, it&#8217;s best if we make sure that the old topic consumer is totally up-to-date. We can use this command to check the consumption lag:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
kafka-consumer-groups.sh \
	--bootstrap-server=&#039;&lt;your broker endpoints, separated by commas&gt;&#039; \
	--describe \
	--group=&#039;&lt;your consumer group&gt;&#039;

</pre></div>


<p>This should yield something like the output below:</p>



<pre class="wp-block-code"><code>TOPIC      PARTITION   NEWEST_OFFSET   OLDEST_OFFSET     CONSUMER_OFFSET     LEAD         LAG
your-topic 0           30000000        0                 30000000            30000000     0
your-topic 1           23900000        0                 23900000            23900000     0

CLIENT_HOST      CLIENT_ID         TOPIC          ASSIGNED_PARTITIONS
/128.0.0.0       your-consumer     your-topic     0
/128.0.0.1     	 your-consumer     your-topic     1</code></pre>



<p>From this we can see that there is zero lag, since the newest offset is equal to the consumer offset on both partitions. We can also see that our consumers are still running (they&#8217;re the clients with ID &#8220;your-consumer&#8221;).</p>



<h2 class="wp-block-heading">Performing the Kafka consumer migration</h2>



<p>Before switching topics or brokers, we should first create a consumer group for the new configuration. This will allow us to change the offsets <em>before</em> beginning the message consumption proper. The easiest way to do this is to use <a href="https://github.com/edenhill/kcat"><code>kcat</code></a>, a simple command-line tool that allows us to consume and produce Kafka messages. To create a consumer group, you must consume messages, so it&#8217;s a matter of setting up <code>kcat</code> (check the install guide on the kcat repo) and consuming a few messages from the new topic:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
kcat \
	-C \
	-b &#039;&lt;your brokers&gt;&#039; \
	-t new-topic \
	-G new-consumer-group

# If you have authentication, just add: 

	-X security.protocol=SASL_SSL \
	-X sasl.mechanisms=SCRAM-SHA-512 \
	-X sasl.username=&quot;me&quot; \
	-X sasl.password=&quot;noneofyourbusiness&quot;

</pre></div>


<p>Just run this for a second, check that messages come out, and then run the describe command for the new group:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
kafka-consumer-groups.sh \
	--bootstrap-server=&#039;new-broker&#039; \
	--describe \
	--group=&#039;new-group&#039;


TOPIC     PARTITION   NEWEST_OFFSET   OLDEST_OFFSET     CONSUMER_OFFSET     LEAD         LAG
new-topic 0           12387000        0                 12                  12           12386988
new-topic 1           12360000        0                 38                  38           12359962

CLIENT_HOST      CLIENT_ID         TOPIC          ASSIGNED_PARTITIONS
</pre></div>


<p>We have huge lag here, but that&#8217;s fine, as we&#8217;re going to reset the offsets anyway. Stop the workers consuming from the older topic by whatever means you can and note down the time at which they stopped. We will now reset the consumer group offset for this new group. Just a note: in this case, we don&#8217;t have any consumers connected to this group, but if we did we&#8217;d also have to turn them off. You <strong>cannot</strong> reset a consumer group offset if there are clients connected to it.</p>



<p>To reset the offsets, just run the following command (here we&#8217;ll assume that we stopped the previous consumers at 10:00 of March 15th, 2023, and subtract ten minutes just to be safe):</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
kafka-consumer-groups.sh \
	--bootstrap-server=&#039;new-brokers&#039; \
	--group=&#039;new-group&#039; \
	--topic=&#039;new-topic&#039; \
	--reset-offsets \
	--to-datetime 2023-03-15T09:50:00.000 \
	--dry-run
</pre></div>


<p>Running this dry run will not make any changes, It will only show you the new offsets for the consumer group, e.g.:</p>



<pre class="wp-block-code"><code>TOPIC     PARTITION   NEWEST_OFFSET   OLDEST_OFFSET     CONSUMER_OFFSET     LEAD         LAG
new-topic 0           12387000        0                 12386998            12386988     2
new-topic 1           12360000        0                 12369951            12369951     49

CLIENT_HOST      CLIENT_ID         TOPIC          ASSIGNED_PARTITIONS</code></pre>



<p>If nothing looks strange to you, go ahead, substitute <code>--dry-run</code> with <code>--execute</code> and run the command. Afterwards, deploy the new consumer configuration, turn on the worker, and let it run.</p>
<p>The post <a href="https://blogit.create.pt/joaorafael/2023/03/15/kafka-consumer-broker-migration-aws-msk/">Performing broker migrations on your Kafka consumers</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/joaorafael/2023/03/15/kafka-consumer-broker-migration-aws-msk/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The 8+ Day Week with Podcasts &#8211; Hidden Parallelizable Time</title>
		<link>https://blogit.create.pt/pedropalhoto/2020/11/09/the-8-day-week-with-podcasts-hidden-parallelizable-time/</link>
					<comments>https://blogit.create.pt/pedropalhoto/2020/11/09/the-8-day-week-with-podcasts-hidden-parallelizable-time/#respond</comments>
		
		<dc:creator><![CDATA[Pedro Palhoto]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 10:38:30 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[audiobooks]]></category>
		<category><![CDATA[parallelizable time]]></category>
		<category><![CDATA[podcasts]]></category>
		<category><![CDATA[timeshifting]]></category>
		<guid isPermaLink="false">https://blogit.create.pt/?p=12121</guid>

					<description><![CDATA[<p>If you can listen to talk/news radio programs or make phone calls, and at the same time do something else, such as driving, house chores, exercising or routine shopping, then, you can gradually build up to get a full extra day (or more) in your week out of this ability. Podcasts are an easy picking towards taking advantage of your parallelizable time.</p>
<p>The post <a href="https://blogit.create.pt/pedropalhoto/2020/11/09/the-8-day-week-with-podcasts-hidden-parallelizable-time/">The 8+ Day Week with Podcasts &#8211; Hidden Parallelizable Time</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Your seven-day week is totally filled to the brim. You wish you could have another day to focus on getting ahead by learning about new topics, keeping up with what&#8217;s going on in your industry or just relaxing.</p>



<p>If you can listen to talk/news radio programs or make phone calls, <strong>and</strong> at the same time do something else, such as driving, house chores, exercising or routine shopping, then, you can gradually build up to get a full extra day (or more) in your week out of this ability. Podcasts are an easy picking towards taking advantage of your parallelizable time.</p>



<h2 class="wp-block-heading">Basics: What are Podcasts and how do you get them?</h2>



<p>Podcasts are (mostly) free downloadable audio shows in a myriad of languages which you can subscribe and listen to. If there is a topic you are interested in, there most likely is one or more podcasts shows on that topic.<br><br>A common way (as of this writing) to keep up with podcasts is to have a podcatcher app on your smartphone, which keeps track of subscribed show feeds, which in turn contain the individual episodes. The podcatcher app will playback the episodes as well, by either streaming them, or downloading to the phone&#8217;s memory first. Each episode corresponds to an audio file (usually in MP3 format) and its size can vary from a few megabytes to several hundreds.<br><br>For iOS, you can easily start with the <a href="https://apps.apple.com/us/app/apple-podcasts/id525463029">Apple Podcasts app</a>. For Android, I recommend the <a rel="noreferrer noopener" href="https://play.google.com/store/apps/details?id=com.bambuna.podcastaddict" target="_blank">Podcast Addict app</a>. Some other non-podcast focused apps, such as <a rel="noreferrer noopener" href="https://open.spotify.com/genre/podcasts-page" target="_blank">Spotify</a>, also have podcast listening functionality. Try different podcatchers until you have found one that suits you. After you have installed your podcatcher app:<br>  1. Browse through the directory of shows or use the search feature.<br>  2. Subscribe to shows of your interest.<br>  3. Start listening!</p>



<h2 class="wp-block-heading">Level Up: Accelerating content and adjusting topics to your daily energy focus shifts</h2>



<p>Once you have gotten the hang of using your chosen podcatcher app and in which contexts of your day you can effectively parallelize listening to your catalog of shows, there are a few boosts you can get without much effort.<br><br>For starters, most podcatcher apps nowadays can time shift (accelerate) content, keeping the pitch correct. For instance, if a podcast episode at the regular 1.0x speed takes 20 minutes to listen to, accelerating it to 2.0x will reduce the time to listen to it in half. This way you can consume two shows in same amount of time you&#8217;d only consume one. Remain on guard not to go greedy on this feature, as some podcast hosts and guests might speak in an unfamiliar accent or the content may be too complex to gulp down at such high speeds. Adjust accordingly.<br><br>Another simple adjustment, which can take several iterations to master, is choosing <strong>when</strong> and <strong>where</strong> to listen to each show. The purpose is to effectively retain and enhance the usefulness of the content you are listening to by aligning moods and contexts. This will vary significantly amongst individuals, considering their subscriptions catalog, how their days look and what is the desired outcome of the overall daily/weekly listening experience.<br><br>To give an example, I usually start my workdays off with inspirational content, changing to work-related content an hour or so before starting work. Then, after work, I switch to leisure/hobby content, making sure to savor those at 1.0x. When I&#8217;m engaged in more cognitively demanding tasks, I switch to listening to music in the background (sometimes in podcast form too).<br><br>Each podcatcher app has different ways to shift the kinds of content you are listening to. Either by adjusting a manual playlist, using categories/channels or some other feature which can go by another name. Explore your podcatcher app to find out how.</p>



<h2 class="wp-block-heading">Beyond Podcasts: Audiobooks, online classes, conferences, video-to-audio, etc.</h2>



<p>There are other sources of parallelizable content which you can consume that are not available in podcast form. Usually they require other non-podcatcher apps to play them back, may require purchasing (most Audiobooks), manual download, transcoding (for the more technically inclined) and other means to get access to them. My recommendation is to remain on the lookout and integrate them into your routine as you see fit.<br><br>Make the most out of your 8<sup>th</sup> day in the week, and most importantly, be sure to enjoy it!<br></p>
<p>The post <a href="https://blogit.create.pt/pedropalhoto/2020/11/09/the-8-day-week-with-podcasts-hidden-parallelizable-time/">The 8+ Day Week with Podcasts &#8211; Hidden Parallelizable Time</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/pedropalhoto/2020/11/09/the-8-day-week-with-podcasts-hidden-parallelizable-time/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>FAST Search Tip #1: Enabling Stemming in PowerShell</title>
		<link>https://blogit.create.pt/andrevala/2012/04/25/fast-search-tip-1-enabling-stemming-in-powershell/</link>
					<comments>https://blogit.create.pt/andrevala/2012/04/25/fast-search-tip-1-enabling-stemming-in-powershell/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Wed, 25 Apr 2012 07:15:31 +0000</pubDate>
				<category><![CDATA[FAST Search]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=201</guid>

					<description><![CDATA[<p>Recently, I’ve been working with FAST Search for SharePoint 2010 and, although it’s a great search platform with pretty impressive features, I believe there are still too many manual installation and configurations steps, and too many of those features are only accessible through PowerShell. Don’t get me wrong, PowerShell is great and, by far, the [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2012/04/25/fast-search-tip-1-enabling-stemming-in-powershell/">FAST Search Tip #1: Enabling Stemming in PowerShell</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently, I’ve been working with <strong>FAST Search for SharePoint 2010</strong> and, although it’s a great search platform with pretty impressive features, I believe there are still too many manual installation and configurations steps, and too many of those features are only accessible through PowerShell. Don’t get me wrong, PowerShell is great and, by far, the best way to deploy your solution to the client’s environment, but a little more graphical UI wouldn’t hurt.</p>
<p>According to FAST Search’s <a href="http://technet.microsoft.com/en-us/library/ff393811.aspx" target="_blank">TechNet documentation</a>, you can use the <strong>Set-FASTSearchMetadataManagedProperty</strong> cmdlet to configure the main settings of a managed property. Among other things, you can enable stemming for a specific managed property. Here’s how it’s done:</p>
<p><code>$title = Get-FASTSearchMetadataManagedProperty –Name title      <br />Set-FASTSearchMetadataManagedProperty –ManagedProperty $title –StemmingEnabled $true</code></p>
<p>The problem is that this doesn’t work. The <strong>StemmingEnabled</strong> argument is actually ignored by the cmdlet so, we need to use a different approach. This is the right way:</p>
<p><code>$title = Get-FASTSearchMetadataManagedProperty –Name title      <br />$title.StemmingEnabled = 1       <br />$title.update()</code></p>
<p>Although Microsoft is yet to update TechNet’s documentation, it has published a support article in its knowledge base (<a href="http://support.microsoft.com/kb/2468430" target="_blank">KB2468430</a>) which describes this very solution. </p>
<p>The post <a href="https://blogit.create.pt/andrevala/2012/04/25/fast-search-tip-1-enabling-stemming-in-powershell/">FAST Search Tip #1: Enabling Stemming in PowerShell</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2012/04/25/fast-search-tip-1-enabling-stemming-in-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #27: Choice Columns and DataSheet Views</title>
		<link>https://blogit.create.pt/andrevala/2011/10/30/sharepoint-tip-27-choice-columns-and-datasheet-views/</link>
					<comments>https://blogit.create.pt/andrevala/2011/10/30/sharepoint-tip-27-choice-columns-and-datasheet-views/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sun, 30 Oct 2011 17:09:19 +0000</pubDate>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=221</guid>

					<description><![CDATA[<p>Using features to create Choice site columns is pretty straightforward (check this post for additional information). See below a sample feature element for that purpose. &#60;Field &#160;&#160;&#160; ID=&#34;{538c71e4-8650-4ce7-b021-920effa66346}&#34; &#160;&#160;&#160; Type=&#34;Choice&#34; &#160;&#160;&#160; Name=&#34;Publishing_x0020_Status&#34; &#160;&#160;&#160; StaticName=&#34;Publishing_x0020_Status&#34; &#160;&#160;&#160; DisplayName=&#34;Publishing Status&#34; &#160;&#160;&#160; Required=&#34;FALSE&#34;&#160; &#160;&#160;&#160; Format=&#34;Dropdown&#34; &#160;&#160;&#160; FillInChoice=&#34;FALSE&#34; &#160;&#160;&#160; Group=&#34;Custom Columns&#34;&#62; &#160;&#160;&#160; &#60;Default&#62;Not Published&#60;/Default&#62; &#160;&#160;&#160; &#60;CHOICES&#62; &#160;&#160;&#160;&#160;&#160;&#160; &#60;CHOICE&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Not [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2011/10/30/sharepoint-tip-27-choice-columns-and-datasheet-views/">SharePoint Tip #27: Choice Columns and DataSheet Views</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Using features to create <strong>Choice</strong> site columns is pretty straightforward (check <a href="http://blogit.create.pt/blogs/andrevala/archive/2008/03/26/SharePoint-2007-Deployment_3A00_-Site-Column-Features.aspx" target="_blank">this post</a> for additional information). See below a sample feature element for that purpose.</p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&lt;</font></font></span><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#a31515">Field </font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#a31515"><font style="font-size: 10pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#ff0000">ID</font></span><span style="font-family:;color:" lang="EN"><font color="#0000ff">=</font></span></font><span style="font-family:" lang="EN"><font style="font-size: 10pt">&quot;<span style="color:"><font color="#0000ff">{538c71e4-8650-4ce7-b021-920effa66346}</font></span>&quot;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Type</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Choice</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Name</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Publishing_x0020_Status</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">StaticName</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Publishing_x0020_Status</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">DisplayName</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Publishing Status</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Required</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">FALSE</font></span>&quot;&#160; </font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Format</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Dropdown</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">FillInChoice</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">FALSE</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Group</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Custom Columns</font></span>&quot;</font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">Default</font></span><span style="font-family:;color:" lang="EN"><font color="#0000ff">&gt;</font></span></font><span style="font-family:" lang="EN"><font style="font-size: 10pt">Not Published<span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">Default</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICES</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><span style="font-family:" lang="EN"><font style="font-size: 10pt">Not Published</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;/</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><span style="font-family:" lang="EN"><font style="font-size: 10pt">Pending</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">CHOICE</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><span style="font-family:" lang="EN"><font style="font-size: 10pt">Published</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">CHOICE</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><span style="font-family:" lang="EN"><font style="font-size: 10pt">Error</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">CHOICE</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160; &lt;/</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICES</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&lt;/</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">Field</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p>Although the XML is well formed and all the attributes and values are correct, this field definition has a problem. If you create a site column using this definition, here is what happens:</p>
<ul>
<li>If you check the site column configuration in SharePoint, everything will look fine</li>
<li>If you add this site column to a list (either through a content type, or directly) and you edit an item using the default list forms, everything will work as expected.</li>
<li>If you try to edit the list items using a <strong>DataSheet View</strong>, you won’t be able to select any value from this choice field and SharePoint will always throw a validation error.</li>
</ul>
<p>The problem here are the invisible characters (spaces, newlines and tabs) between the <span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span> and <span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt"><span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">CHOICE</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span> tags and their inner values. Apparently, when using list forms these characters are trimmed from the valid choices, but when using the datasheet view they are not, causing a strange behavior when editing an item in that view.</p>
<p>The correct definition for this field would be:</p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&lt;</font></font></span><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#a31515">Field </font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#a31515"><font style="font-size: 10pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#ff0000">ID</font></span><span style="font-family:;color:" lang="EN"><font color="#0000ff">=</font></span></font><span style="font-family:" lang="EN"><font style="font-size: 10pt">&quot;<span style="color:"><font color="#0000ff">{538c71e4-8650-4ce7-b021-920effa66346}</font></span>&quot;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Type</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Choice</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Name</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Publishing_x0020_Status</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">StaticName</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Publishing_x0020_Status</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">DisplayName</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Publishing Status</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Required</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">FALSE</font></span>&quot;&#160; </font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Format</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Dropdown</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">FillInChoice</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">FALSE</font></span>&quot;</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt">&#160;&#160;&#160; <span style="color:"><font color="#ff0000">Group</font></span><span style="color:"><font color="#0000ff">=</font></span>&quot;<span style="color:"><font color="#0000ff">Custom Columns</font></span>&quot;</font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">Default</font></span><span style="font-family:;color:" lang="EN"><font color="#0000ff">&gt;</font></span></font><span style="font-family:" lang="EN"><font style="font-size: 10pt">Not Published<span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">Default</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICES</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font><font face="Courier New"><span style="font-family:" lang="EN"><font style="font-size: 10pt">Not Published</font></span></font><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&lt;/</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font><font face="Courier New"><span style="font-family:" lang="EN"><font style="font-size: 10pt">Pending</font></span></font><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt"><span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">CHOICE</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font><font face="Courier New"><span style="font-family:" lang="EN"><font style="font-size: 10pt">Published</font></span></font><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt"><span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">CHOICE</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160; &lt;</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICE</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font><font face="Courier New"><span style="font-family:" lang="EN"><font style="font-size: 10pt">Error</font></span></font><span style="font-family:" lang="EN"><font face="Courier New"><font style="font-size: 10pt"><span style="color:"><font color="#0000ff">&lt;/</font></span><span style="color:"><font color="#a31515">CHOICE</font></span></font><span style="color:"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&#160;&#160;&#160; &lt;/</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">CHOICES</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Courier New"><span style="font-family:;color:" lang="EN"><font color="#0000ff"><font style="font-size: 10pt">&lt;/</font></font></span><font style="font-size: 10pt"><span style="font-family:;color:" lang="EN"><font color="#a31515">Field</font></span></font><span style="font-family:;color:" lang="EN"><font style="font-size: 10pt" color="#0000ff">&gt;</font></span></font></p>
<p>The post <a href="https://blogit.create.pt/andrevala/2011/10/30/sharepoint-tip-27-choice-columns-and-datasheet-views/">SharePoint Tip #27: Choice Columns and DataSheet Views</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2011/10/30/sharepoint-tip-27-choice-columns-and-datasheet-views/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #26: Comments in Content Type Definition</title>
		<link>https://blogit.create.pt/andrevala/2011/08/06/sharepoint-tip-26-comments-in-content-type-definition/</link>
					<comments>https://blogit.create.pt/andrevala/2011/08/06/sharepoint-tip-26-comments-in-content-type-definition/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 06 Aug 2011 16:33:56 +0000</pubDate>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=241</guid>

					<description><![CDATA[<p>There is an issue with SharePoint 2010’s CAML parser that causes SharePoint to ignore fields in a Content Type definition. When defining a Content Type feature element, avoid placing comments inside the &#60;fieldrefs&#62; element as that will cause SharePoint to create the Content Type disregarding all the fields, even though the XML is well formed. [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2011/08/06/sharepoint-tip-26-comments-in-content-type-definition/">SharePoint Tip #26: Comments in Content Type Definition</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>There is an issue with SharePoint 2010’s CAML parser that causes SharePoint to ignore fields in a Content Type definition. When defining a Content Type feature element, avoid placing comments inside the <code>&lt;fieldrefs&gt;</code> element as that will cause SharePoint to create the Content Type disregarding all the fields, even though the XML is well formed.</p>
<p><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;      <br />&lt;Elements xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&gt;       <br />&#160; &lt;ContentType       <br />&#160;&#160;&#160; ID=&quot;0x0100C5647A362F236548B218C15302286758&quot;       <br />&#160;&#160;&#160; Name=&quot;MyCT&quot;       <br />&#160;&#160;&#160; Description=&quot;Simple Custom Content Type&quot;&#160; <br />&#160;&#160;&#160; Inherits=&quot;TRUE&quot;       <br />&#160;&#160;&#160; Overwrite=&quot;TRUE&quot;       <br />&#160;&#160;&#160; Version=&quot;0&quot;&gt;       <br />&#160;&#160;&#160; &lt;Folder TargetName=”_cts/MyCT” /&gt;       <br />&#160;&#160;&#160; <strong>&lt;FieldRefs&gt;</strong>       <br />&#160;&#160;&#160;&#160;&#160; &lt;FieldRef ID=&quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}&quot; Name=&quot;Title&quot; /&gt;       </p>
<p>&#160;&#160;&#160;&#160;&#160; <strong><font color="#ff0000">&lt;!-- This is a comment –-&gt;</font></strong>&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160; &lt;FieldRef ID=&quot;{b402db15-ee44-4ec4-89e3-23e10a8fc64c}&quot; Name=&quot;My_x0200_Field&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160; &lt;FieldRef ID=&quot;{538c71e4-8650-4ce7-b021-920effa66346}&quot; Name=&quot;Status&quot; /&gt;       <br />&#160;&#160;&#160; <strong>&lt;/FieldRefs&gt;</strong>       <br />&#160; &lt;/ContentType&gt;       <br />&lt;/Elements&gt; </code></p>
<p>The Content Type feature element above will cause the Content Type to be created with only the Title field, which is inherited from the parent Content Type. All the fields referenced in this Content Type definition will be ignored.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2011/08/06/sharepoint-tip-26-comments-in-content-type-definition/">SharePoint Tip #26: Comments in Content Type Definition</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2011/08/06/sharepoint-tip-26-comments-in-content-type-definition/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tips #25: Beware of User Profile Import</title>
		<link>https://blogit.create.pt/andrevala/2009/01/31/sharepoint-tips-25-beware-of-user-profile-import/</link>
					<comments>https://blogit.create.pt/andrevala/2009/01/31/sharepoint-tips-25-beware-of-user-profile-import/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 31 Jan 2009 12:02:55 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=721</guid>

					<description><![CDATA[<p>Among SharePoint 2007’s User Profile features, one of the most useful is the Profile Import. This feature allows you to import existing user accounts from Active Directory, an LDAP server or the Business Data Catalog, to the User Profile Store. Even better, it allows you to map the User Profile properties to user account properties [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/01/31/sharepoint-tips-25-beware-of-user-profile-import/">SharePoint Tips #25: Beware of User Profile Import</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Among SharePoint 2007’s User Profile features, one of the most useful is the <strong>Profile Import</strong>. This feature allows you to import existing user accounts from Active Directory, an LDAP server or the Business Data Catalog, to the User Profile Store. Even better, it allows you to map the User Profile properties to user account properties (from Active Directory, for instance) so that they’re automatically imported. Additionally, you can schedule regular imports so that SharePoint’s User Profile is kept in sync with Active Directory’s user account.</p>
<p>Needless to say, this can save you a lot of time, especially if you already have a large base of users with a few populated properties on Active Directory. This is, however, a one way process, that is, only from the Directory to SharePoint, never the other way around.</p>
<p>One question you might be asking is: <em>what if I update a User Profile on SharePoint, putting new data on a mapped property and then a Profile Import occurs?</em></p>
<p>The answer to this is not straightforward, because it depends on your answer to one or two questions.</p>
<p><strong>Question 1: </strong>In Active Directory (or LDAP server), does the mapped property have a value?</p>
<blockquote>
<p>If so, then the value in SharePoint’s User Profile property will get overwritten by the one in the directory’s user account property. No need to check Question 2.</p>
</blockquote>
<blockquote>
<p>If not, then check Question 2.</p>
</blockquote>
<p><strong>Question 2:</strong> Did you update the User Profile using SharePoint’s UI, or using the API?</p>
<blockquote>
<p>If you used the SharePoint’s UI then the User Profile property will retain the value, since the mapped property in the directory service has no value to replace it.</p>
<p>If you used the API, the Profile Import will clear the value of the mapped property on SharePoint’s User Profile. I cannot explain why this difference exists, but I have seen it happen.</p>
</blockquote>
<p><strong>Conclusion:</strong> If you are updating User Profile properties by using SharePoint’ API, make sure you remove their mappings (to directory services’ properties) to prevent you from losing data when the Profile Import executes.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/01/31/sharepoint-tips-25-beware-of-user-profile-import/">SharePoint Tips #25: Beware of User Profile Import</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2009/01/31/sharepoint-tips-25-beware-of-user-profile-import/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #24: Changing a Web Site&#8217;s Navigation Settings</title>
		<link>https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/</link>
					<comments>https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 06 Dec 2008 16:30:55 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=761</guid>

					<description><![CDATA[<p>Changing a web site&#8217;s navigation settings is pretty easy using the SharePoint user interface. You just click the Site Actions button, select the Site Settings option, and click on Navigation. But how do you do it programmatically? Most navigation options on a SharePoint web site are manipulated through the SPWeb object&#8217;s property bag. Set the [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/">SharePoint Tip #24: Changing a Web Site&#8217;s Navigation Settings</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Changing a web site&#8217;s navigation settings is pretty easy using the SharePoint user interface. You just click the Site Actions button, select the Site Settings option, and click on Navigation. But how do you do it programmatically?</p>
<p>Most navigation options on a SharePoint web site are manipulated through the <strong><code>SPWeb</code></strong> object&#8217;s property bag. Set the following properties to configure a web site&#8217;s navigation settings:</p>
<ul>
<li><strong><code>__IncludeSubSitesInNavigation</code></strong>: Set this property to <strong><code>True</code></strong> to show the subsites of the current site on the global and current navigation menus. Set it to <strong><code>False</code></strong> to hide the subsites. </li>
<li><strong><code>__IncludePagesInNavigation</code></strong>: Set this property to <strong><code>True</code></strong> to show the pages on the global and current navigation menus. Set it to <strong><code>False</code></strong> to hide the pages. </li>
<li><strong><code>__InheritCurrentNavigation</code></strong>: Set this property to <strong><code>True</code></strong> to display the same navigations items as the parent site in the current navigation menu. Set it to <strong><code>False</code></strong> to display only items from the current site and subsites. </li>
<li><strong><code>__NavigationShowSiblings</code></strong>: Set this property to <strong><code>True</code></strong> to display the navigation items below the current site and the current site&#8217;s siblings, in the current navigation menu. </li>
<li><strong><code>__NavigationOrderingMethod</code></strong>: Set this property to one of the following values:
<ul>
<li><strong><code>0</code></strong>: Sort the navigation items automatically </li>
<li><strong><code>1</code></strong>: Sort the subsites manually but the pages automatically </li>
<li><strong><code>2</code></strong>: Sort the navigation items manually </li>
</ul>
</li>
<li><strong><code>__NavigationAutomaticSortingMethod</code></strong>: When using automatic ordering, set this property to one of the following values:
<ul>
<li><strong><code>0</code></strong>: Sort by Title </li>
<li><strong><code>1</code></strong>: Sort by Created Date </li>
<li><strong><code>2</code></strong>: Sort by Last Modified Date </li>
</ul>
</li>
<li><strong><code>__NavigationSortAscending</code></strong>: When using automatic ordering, set this property to <strong><code>True</code></strong> if the automatic sorting of the navigation items should be done in ascending order. Set it to <strong><code>False</code></strong> to use descending order. </li>
</ul>
<p><strong>Note:</strong> there are two underscore characters (<code>_</code>) in each property name.</p>
<p><strong>Example      <br /></strong>In the example below, I&#8217;m setting the navigation options to:</p>
<ul>
<li>Show only the current site&#8217;s navigation items in the global navigation </li>
<li>Show the current site&#8217;s sub sites in the global navigation </li>
<li>Don&#8217;t show the pages in the global navigation </li>
<li>Show only the current site&#8217;s navigation items in the current navigation </li>
<li>Don&#8217;t show the current site&#8217;s siblings in the current navigation </li>
<li>Sort the navigation items manually </li>
</ul>
<blockquote>
<pre class="code"><span style="color: green">// break inheritance of global navigation
</span>web.Navigation.UseShared = <span style="color: blue">false</span>;

<span style="color: green">// show subwebs but don't show pages in global navigation
</span>web.AllProperties[<span style="color: #a31515">&quot;__IncludeSubSitesInNavigation&quot;</span>] = <span style="color: #a31515">&quot;True&quot;</span>;
web.AllProperties[<span style="color: #a31515">&quot;__IncludePagesInNavigation&quot;</span>] = <span style="color: #a31515">&quot;False&quot;</span>;

<span style="color: green">// show only current site's navigation items in current navigation
</span>web.AllProperties[<span style="color: #a31515">&quot;__InheritCurrentNavigation&quot;</span>] = <span style="color: #a31515">&quot;False&quot;</span>;
web.AllProperties[<span style="color: #a31515">&quot;__NavigationOrderingMethod&quot;</span>] = <span style="color: #a31515">&quot;2&quot;</span>;
web.AllProperties[<span style="color: #a31515">&quot;__NavigationShowSiblings&quot;</span>] = <span style="color: #a31515">&quot;False&quot;</span>;
web.Update();</pre>
</blockquote>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/">SharePoint Tip #24: Changing a Web Site&#8217;s Navigation Settings</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #23: Creating a Personal Site</title>
		<link>https://blogit.create.pt/andrevala/2008/10/18/sharepoint-tip-23-creating-a-personal-site/</link>
					<comments>https://blogit.create.pt/andrevala/2008/10/18/sharepoint-tip-23-creating-a-personal-site/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 18 Oct 2008 12:25:00 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=781</guid>

					<description><![CDATA[<p>The User Profile is the central concept behind the personalization features of SharePoint (MOSS only). In addition to the User Profile, each user can have a My Site. A My Site is composed of: A Profile Page that shows the user profile data, according to the user viewing it and the privacy options of each [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/10/18/sharepoint-tip-23-creating-a-personal-site/">SharePoint Tip #23: Creating a Personal Site</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The <strong>User Profile</strong> is the central concept behind the personalization features of SharePoint (MOSS only). In addition to the User Profile, each user can have a <strong>My Site</strong>. A My Site is composed of:</p>
<ul>
<li>A <strong>Profile Page</strong> that shows the user profile data, according to the user viewing it and the privacy options of each profile field. You can find that page (<code>Person.aspx</code>) in the root web site of the My Site host site collection (e.g <code>http://mysites/Person.aspx?accountname=domain\username</code>). </li>
<li>A <strong>Personal Site</strong> which is a site collection where you can show personal and public information and documents. </li>
</ul>
<p>The Personal Site is automatically provisioned for you when you try to access your My Site (using the My Site link or clicking your username). However, you might want to create it programmatically for one or more users, before they even try to access it. See below an example of how to do it.</p>
<pre class="code"><span style="color: green">// open a site collection
</span><span style="color: blue">using </span>(<span style="color: #2b91af">SPSite </span>site = <span style="color: blue">new </span><span style="color: #2b91af">SPSite</span>(<span style="color: #a31515">&quot;http://myportal&quot;</span>))
{
    <span style="color: green">// get the server context
    </span><span style="color: #2b91af">ServerContext </span>context = <span style="color: #2b91af">ServerContext</span>.GetContext(site);

    <span style="color: green">// create the profile manager object
    </span><span style="color: #2b91af">UserProfileManager </span>profileManager = <span style="color: blue">new </span><span style="color: #2b91af">UserProfileManager</span>(context);

    <span style="color: green">// get the user profile
    </span><span style="color: #2b91af">UserProfile </span>profile = profileManager.GetUserProfile(<span style="color: #a31515">&quot;domain\\username&quot;</span>);

    <span style="color: green">// create the user&#039;s personal site
    </span><strong>profile.CreatePersonalSite();</strong>
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>The really important line of code here is the last one. There rest was already explained in one of my previous posts (<a href="/blogs/andrevala/archive/2008/10/14/WSS-Tip-_2300_20_3A00_-Get-User-Profile.aspx" target="_blank">WSS Tip #20: Get User Profile</a>).</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/10/18/sharepoint-tip-23-creating-a-personal-site/">SharePoint Tip #23: Creating a Personal Site</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2008/10/18/sharepoint-tip-23-creating-a-personal-site/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #22: Create a User Profile</title>
		<link>https://blogit.create.pt/andrevala/2008/10/16/sharepoint-tip-22-create-a-user-profile/</link>
					<comments>https://blogit.create.pt/andrevala/2008/10/16/sharepoint-tip-22-create-a-user-profile/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Thu, 16 Oct 2008 05:41:00 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=801</guid>

					<description><![CDATA[<p>The best way to create SharePoint User Profiles is to import them from somewhere (Active Directory for instance). This is specially true if you want to create a lot of them at once. However, if you really want to do it manually, one at a time, you can. Just do it like in the snippet [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/10/16/sharepoint-tip-22-create-a-user-profile/">SharePoint Tip #22: Create a User Profile</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The best way to create SharePoint User Profiles is to import them from somewhere (Active Directory for instance). This is specially true if you want to create a lot of them at once. However, if you really want to do it manually, one at a time, you can. Just do it like in the snippet below.</p>
<pre class="code"><span style="color: green">// open a site collection
</span><span style="color: blue">using </span>(<span style="color: #2b91af">SPSite </span>site = <span style="color: blue">new </span><span style="color: #2b91af">SPSite</span>(<span style="color: #a31515">&quot;http://myportal&quot;</span>))
{
    <span style="color: green">// get the server context
    </span><span style="color: #2b91af">ServerContext </span>context = <span style="color: #2b91af">ServerContext</span>.GetContext(site);

    <span style="color: green">// create the profile manager object
    </span><span style="color: #2b91af">UserProfileManager </span>upm = <span style="color: blue">new </span><span style="color: #2b91af">UserProfileManager</span>(context);

    <span style="color: green">// create the user profile
    </span><span style="color: #2b91af">UserProfile </span>profile = upm.CreateUserProfile(<span style="color: #a31515">&quot;domain\\username&quot;</span>);
}</pre>
<p>Just like getting a User Profile from the User Profile Store, to create one you need a <strong>UserProfileManager</strong> object. After that, you just need to call the <strong>CreateUserProfile</strong> method and pass it the user account name (including the domain).</p>
<p><strong>Attention:</strong> User Profiles are a MOSS only feature. You cannot use them with WSS.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/10/16/sharepoint-tip-22-create-a-user-profile/">SharePoint Tip #22: Create a User Profile</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2008/10/16/sharepoint-tip-22-create-a-user-profile/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #21: Importing User Profiles</title>
		<link>https://blogit.create.pt/andrevala/2008/10/15/sharepoint-tip-21-importing-user-profiles/</link>
					<comments>https://blogit.create.pt/andrevala/2008/10/15/sharepoint-tip-21-importing-user-profiles/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Wed, 15 Oct 2008 04:04:00 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=821</guid>

					<description><![CDATA[<p>One of the best things of SharePoint&#039;s User Profiles, is that the profile data can be imported from several data sources (Active Directory or other LDAP directories, Databases and web services). It gets even better since you can schedule these imports to be performed automatically every given period of time. But what if you want [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/10/15/sharepoint-tip-21-importing-user-profiles/">SharePoint Tip #21: Importing User Profiles</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>One of the best things of SharePoint&#039;s User Profiles, is that the profile data can be imported from several data sources (Active Directory or other LDAP directories, Databases and web services). It gets even better since you can schedule these imports to be performed automatically every given period of time.</p>
<p>But what if you want to start a profile import programmatically, without having to wait for the next scheduled import? Well, that can be done using the following code snippet.</p>
<pre class="code"><span style="color: green">// open a site collection
</span><span style="color: blue">using </span>(<span style="color: #2b91af">SPSite </span>site = <span style="color: blue">new </span><span style="color: #2b91af">SPSite</span>(<span style="color: #a31515">&quot;http://myportal&quot;</span>))
{
    <span style="color: green">// get the server context
    </span><span style="color: #2b91af">ServerContext </span>context = <span style="color: #2b91af">ServerContext</span>.GetContext(site);

    <span style="color: green">// create the profile configuration manager object
    </span><span style="color: #2b91af">UserProfileConfigManager </span>upcm = <span style="color: blue">new </span><span style="color: #2b91af">UserProfileConfigManager</span>(context);

    <span style="color: green">// check if there is already an import in progress
    </span><span style="color: blue">if </span>(!upcm.IsImportInProgress())
    {
        <span style="color: green">// if not, start a new one
        // pass &quot;true&quot; as a parameter, if the import is incremental
        // pass &quot;false&quot; as a parameter, if you want a full import
        </span>upcm.StartImport(<span style="color: blue">true</span>);
    }
}</pre>
<p>The profile import process is managed using the <strong>UserProfileConfigManager</strong> object, which can be created using a <strong>ServerContext</strong> object. Before starting an import, using the <strong>StartImport</strong> method, you should always check if there is already an import in progress (using the <strong>IsImportInProgress</strong> method).</p>
<p>The <strong>StartImport</strong> method accepts a single boolean parameter which specifies if you want an incremental import (<strong>true</strong>) or a full import (<strong>false</strong>).</p>
<p>If necessary, you can build a while cycle to wait for the import to be over, testing the <strong>IsImportInProgress</strong> return value, until it returns <strong>false</strong>.</p>
<p><strong>Attention:</strong> User Profiles are a MOSS only feature. You cannot use them with WSS.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/10/15/sharepoint-tip-21-importing-user-profiles/">SharePoint Tip #21: Importing User Profiles</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2008/10/15/sharepoint-tip-21-importing-user-profiles/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
