<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>Dor Rotman's Blog &#187; English Posts</title>
	<link>http://www.rotman.be/blog</link>
	<description>SharePoint, Office, and more..</description>
	<pubDate>Wed, 22 Jan 2020 14:34:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Using Javascript to Manipulate a List Form Field Title</title>
		<link>http://www.rotman.be/blog/?p=43</link>
		<comments>http://www.rotman.be/blog/?p=43#comments</comments>
		<pubDate>Fri, 12 Oct 2007 14:01:23 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<category><![CDATA[WSSv3]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=43</guid>
		<description><![CDATA[Lets say you want to change the text of a field title in a new item form, or in an edit-item form. You might want to do one of the following:





Change the field title text
Add a remark to the title
Add a link
Make the title a link
Put some javascript


 



The trick in doing this is also [...]]]></description>
			<content:encoded><![CDATA[<p>Lets say you want to change the text of a field title in a new item form, or in an edit-item form. You might want to do one of the following:</p>
<table cellspacing="0" cellpadding="0" width="100%" border="0" unselectable="on">
<tbody>
<tr>
<td valign="top">
<ul>
<li>Change the field title text
<li>Add a remark to the title
<li>Add a link
<li>Make the title a link
<li>Put some javascript</li>
</ul>
</td>
<td valign="top"><img height="155" alt="" src="http://www.rotman.be/blog/wp-content/uploads/EditingaNewFormEditFormsFieldTitle_D8E6/image.png" width="311" border="1"> </td>
</tr>
</tbody>
</table>
<p>The trick in doing this is also not breaking the Form Web Part, so new fields will appear in the form.</p>
<p>The solution is&#8230; Javascript at runtime! It&#8217;s inspired by <a href="http://blogs.msdn.com/sharepoint/archive/2007/06/21/using-javascript-to-manipulate-a-list-form-field.aspx">this post</a> for changing the default value of a field, only this time we&#8217;re talking about the title text and not the field value.</p>
<p><strong>So how to do it? </strong>Easily. Open the NewForm page with SharePoint Designer and view the HTML code. Look for the main content placeholder:</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">asp:Content</span> <span class="attr">ContentPlaceHolderId</span><span class="kwrd">=&#8221;PlaceHolderMain&#8221;</span> <span class="attr">runat</span><span class="kwrd">=&#8221;server&#8221;</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p>Paste this code inside it, before the table:</p>
<pre class="csharpcode"><span class="rem">&lt;!&#8211; Begin Field Link Code &#8211;&gt;</span>
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">type</span><span class="kwrd">=&#8221;text/javascript&#8221;</span><span class="kwrd">&gt;</span>
<span class="rem">// Add the function so it will be called on Body_OnLoad.</span>
_spBodyOnLoadFunctionNames.push(<span class="str">&#8220;AddFieldLinks&#8221;</span>);

<span class="kwrd">function</span> AddFieldLinks()
{
<span class="rem"><font color="#000000">  </font>// Call the search function with an anonymous function that will <br/>  // be executed upon finding the relevant field.</span>
  AddFieldLink(<span class="str">&#8220;Status&#8221;</span>,
   <span class="rem">// This anonymous function adds a link to the field&#8217;s title.</span>
   <span class="kwrd">function</span> (currentText)
   {
     <span class="kwrd">return</span> currentText + <span class="str">&#8220;&lt;br/&gt;&#8221;</span> + <br/>     GenerateLink(<span class="str">&#8220;policy.html&#8221;</span>, <span class="str">&#8220;&lt;u&gt;See Status Policy Document&lt;/u&gt;&#8221;</span>);
   }
   );
}

<span class="kwrd">function</span> GenerateLink(url, text)
{
   <span class="kwrd">return</span> <span class="str">&#8220;&lt;a target=\&#8221;_blank\&#8221; href=\&#8221;"</span> + url + <span class="str">&#8220;\&#8221;&gt;&#8221;</span> + text + <span class="str">&#8220;&lt;/a&gt;&#8221;</span>;
}

<span class="kwrd">function</span> AddFieldLink(fieldName, fn)
{
  <span class="rem">// Get all field titles </span>
  <span class="kwrd">var</span> tags = document.getElementsByTagName(<span class="str">&#8220;H3&#8243;</span>);

  <span class="rem">// Go through all field titles and search for the requested field.</span>
  <span class="kwrd">for</span>(<span class="kwrd">var</span> i=0; i &lt; tags.length; i++)
  {
    <span class="kwrd">if</span>((tags[i].children.length == 1) &amp;&amp; <br/>       (tags[i].className == <span class="str">&#8220;ms-standardheader&#8221;</span>) &amp;&amp;
       ((tags[i].children[0].innerText == fieldName) || <br/>        (tags[i].children[0].innerText == fieldName + <span class="str">&#8221; *&#8221;</span>)))
    {
      <span class="rem">// Found the field we need to update. Set its </span>
      tags[i].children[0].innerHTML = fn(tags[i].children[0].innerHTML);
      <span class="kwrd">break</span>;
    }
  }
}

<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
<span class="rem">&lt;!&#8211; End Field Link Code &#8211;&gt;</span></pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p>Now just edit the body of the <em>AddFieldLinks</em> function to change the title of the relevant fields. </p>
<p>It&#8217;s parameters are: </p>
<ul>
<li>The title of the field
<li>A function that returns a string for the title. <br />Notice that I used an anonymous function so you can set a different behavior for each field title - for example, one will be a link, the other would be appended some text, etc&#8230;</li>
</ul>
<p>Now just save the file, approve the unghosting, and that&#8217;s it! <img alt="Smile" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/regular_smile.gif"></p>
<p>Here&#8217;s the result - click to enlarge:<br /><img height="446" alt="click me!" src="http://www.rotman.be/blog/wp-content/uploads/EditingaNewFormEditFormsFieldTitle_D8E6/clip_image0021_thumb_thumb1_thumb1.jpg" width="490" border="0"></p>
<p>Dor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=43</wfw:commentRss>
		</item>
		<item>
		<title>SPD &#8216;Send Email&#8217; Workflow Activity HTML Message Body</title>
		<link>http://www.rotman.be/blog/?p=42</link>
		<comments>http://www.rotman.be/blog/?p=42#comments</comments>
		<pubDate>Mon, 27 Aug 2007 22:20:54 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<category><![CDATA[Office 2007]]></category>

		<category><![CDATA[WSSv3]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=42</guid>
		<description><![CDATA[Would you like to send email messages with a rich text body from your custom SharePoint Designer workflow? Well, it&#8217;s easier than you think&#8230;
Appearatnly the out of the box activity sends the message body as HTML, but the editor is not rich, thus misleading us to think we can only insert simple text. However, the [...]]]></description>
			<content:encoded><![CDATA[<p>Would you like to send email messages with a rich text body from your custom SharePoint Designer workflow? Well, it&#8217;s easier than you think&#8230;</p>
<p>Appearatnly the out of the box activity sends the message body as HTML, but the editor is not rich, thus misleading us to think we can only insert simple text. However, the solution is to simply paste HTML code into the body. And that&#8217;s it! <img alt="Open-mouthed" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/teeth_smile.gif"></p>
</p>
<p>This way you can create messages with cool content, and align the body as RTL (Right To Left) for relevant languages such as Hebrew.</p>
</p>
<p>Here&#8217;s a screenshot from SharePoint Designer in Hebrew, in which I created an RTL message:</p>
<p><img height="289" alt="image" src="http://www.rotman.be/blog/wp-content/uploads/SharePointDesignerSendEmailWorkflowActiv_1014/image.png" border="0"> </p>
<p>Tip: Check the Workflow XOML file that SPD creates before running it for the first time. (Because on the first run it will compile and workflow will become unchangable.) See the HTML string you created and run it through some HTML Decoder, to convert special characters to understandable text. Then you can make sure the HTML is OK.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=42</wfw:commentRss>
		</item>
		<item>
		<title>Stock Quote Web Part(s)</title>
		<link>http://www.rotman.be/blog/?p=40</link>
		<comments>http://www.rotman.be/blog/?p=40#comments</comments>
		<pubDate>Thu, 16 Aug 2007 16:58:33 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<category><![CDATA[MOSS]]></category>

		<category><![CDATA[WSSv3]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=40</guid>
		<description><![CDATA[


Yesterday I was asked to put a web part on an internal MS site, which displays Microsoft&#8217;s stock current value and a graph to show its changes. 
This appeared to be easy - Yahoo offers these kind of web widgets that can be embedded in a site.
However, the Yahoo widget has a big logo and [...]]]></description>
			<content:encoded><![CDATA[<table cellspacing="0" cellpadding="0" width="100%" border="0" unselectable="on">
<tbody>
<tr>
<td valign="top">Yesterday I was asked to put a web part on an internal MS site, which displays Microsoft&#8217;s stock current value and a graph to show its changes. </p>
<p>This appeared to be easy - <a href="http://finance.yahoo.com/badges/">Yahoo</a> offers these kind of web widgets that can be embedded in a site.</p>
<p>However, the Yahoo widget has a big logo and commercials, and this isn&#8217;t suitable for an internal MS site. So I needed to get the data elsewhere. </p>
<p>After some research I found a way to do this, using MS only tools:</p>
<ul>
<li>Get the stock value from <a href="http://office.microsoft.com/Research/Providers/MoneyCentral.asmx">Microsoft MoneyCentral Web Service</a> [found it <a href="http://msdn2.microsoft.com/en-us/library/bb243833.aspx">here</a>]
<li>Get the chart from <a href="http://moneycentral.msn.com/investor/charts/chartdl.aspx?symbol=MSFT">MSN Money</a></li>
</ul>
</td>
<td valign="top"><img height="395" alt="image" src="http://www.rotman.be/blog/wp-content/uploads/StockQuoteWebPart_92D5/image.png" width="315" border="0"> </td>
</tr>
</tbody>
</table>
<p>So I separated the functionality to two Web Parts: </p>
<ul>
<li>Data View Web Part (created using SharePoint Designer) - to consume the Web Service
<li>Content Editor Web Part - to run some javascript to get the chart image</li>
</ul>
<p>If you&#8217;re interested in how I created the Web Parts, keep on reading. Otherwise, skip to the end of the post to download them. </p>
<h4>1. The Stock Value Web Part</h4>
<p>That&#8217;s easy - open up SharePoint Designer, open some SharePoint page you can edit on a test site, and connect to a data source - the MoneyCentral Web Service. You&#8217;ll get the data, which you can add to your page using the Data View Web Part.</p>
<p>However, there&#8217;s a problem - the Web Service output is a string that contains a lot of XML data as a String and not as a complex XML tag. SharePoint Designer doesn&#8217;t know the schema of that XML and can&#8217;t isolate just the current value of the stock from it. So I used a couple of functions to isolate the relevant text.  (substring-before, substring-after.)</p>
<p>Then just save the page, view it in your browser, export it using the Web Part menu, and import it to wherever you want to place it. (By working on a test site and importing the Web Part, the page desination page will not be unghosted.) </p>
<h4>2. The Stock Chart Web Part</h4>
<p>This is a bit more tricky: you can take images straight from the MSN website, because the image source is a DLL that generates them on demand. You just need to send the right parameters.</p>
<p>Please notice that by using this trick, we&#8217;re actually &#8220;stealing&#8221; bandwidth and CPU from MSN&#8217;s servers. So the minimum I could do is put some nice link to MSN to give them credit..</p>
<p>I created a Javascript function that generates the URL:</p>
<pre class="csharpcode">formatChartImageSrc(symbol, fromDate, toDate, imgWidth, imgHeight)</pre>
<p><style type="text/css">.csharpcode, .csharpcode pre<br />
{<br />
	font-size: small;<br />
	color: black;<br />
	font-family: consolas, &#8220;Courier New&#8221;, courier, monospace;<br />
	background-color: #ffffff;<br />
	/*white-space: pre;*/<br />
}<br />
.csharpcode pre { margin: 0em; }<br />
.csharpcode .rem { color: #008000; }<br />
.csharpcode .kwrd { color: #0000ff; }<br />
.csharpcode .str { color: #006080; }<br />
.csharpcode .op { color: #0000c0; }<br />
.csharpcode .preproc { color: #cc6633; }<br />
.csharpcode .asp { background-color: #ffff00; }<br />
.csharpcode .html { color: #800000; }<br />
.csharpcode .attr { color: #ff0000; }<br />
.csharpcode .alt<br />
{<br />
	background-color: #f4f4f4;<br />
	width: 100%;<br />
	margin: 0em;<br />
}<br />
.csharpcode .lnum { color: #606060; }<br />
</style>
<p>
Parameters:</p>
<ul>
<li><strong>symbol:</strong> a string containing the stock symbol name, like &#8220;MSFT&#8221;.
<li><strong>fromDate:</strong> a Date object containing the date from which to display the timeline.
<li><strong>toDate:</strong> the date in which the timeline will end (usually today)
<li><strong>imgWidth, imgHeight:</strong> Dimensions of generated image.</li>
</ul>
<p>Here is a sample use of the function that outputs the URL for a 1-year view of the MSFT stock, until today. Then I get an IMG element with the ID &#8220;chart&#8221; and set it&#8217;s source to the generated URL.</p>
<pre class="csharpcode"><span class="kwrd">var</span> stockName = <span class="str">&#8220;MSFT&#8221;</span>;
<span class="kwrd">var</span> toDate = <span class="kwrd">new</span> Date();
<span class="kwrd">var</span> day = 1000*60*60*24
<span class="kwrd">var</span> fromDate = <span class="kwrd">new</span> Date(toDate - day*365);

<span class="kwrd">var</span> srcUrl = formatChartImageSrc(stockName, fromDate, toDate, 300, 300);
<span class="kwrd">var</span> chartObj = document.getElementById(<span class="str">&#8220;chart&#8221;</span>);
chartObj.src = srcUrl;
</pre>
<p>
<style type="text/css">.csharpcode, .csharpcode pre<br />
{<br />
	font-size: small;<br />
	color: black;<br />
	font-family: consolas, &#8220;Courier New&#8221;, courier, monospace;<br />
	background-color: #ffffff;<br />
	/*white-space: pre;*/<br />
}<br />
.csharpcode pre { margin: 0em; }<br />
.csharpcode .rem { color: #008000; }<br />
.csharpcode .kwrd { color: #0000ff; }<br />
.csharpcode .str { color: #006080; }<br />
.csharpcode .op { color: #0000c0; }<br />
.csharpcode .preproc { color: #cc6633; }<br />
.csharpcode .asp { background-color: #ffff00; }<br />
.csharpcode .html { color: #800000; }<br />
.csharpcode .attr { color: #ff0000; }<br />
.csharpcode .alt<br />
{<br />
	background-color: #f4f4f4;<br />
	width: 100%;<br />
	margin: 0em;<br />
}<br />
.csharpcode .lnum { color: #606060; }<br />
</style>
</p>
<p>I place this code and the &lt;img&gt; tag itself in the Content Editor Web Part, and that&#8217;s it. The image will be up to date. </p>
<h4>Download &#038; Installation</h4>
<p>Here are the links to the files:</p>
<ul>
<li><a href="http://www.rotman.be/blog/wp-content/uploads/StockQuoteWebPart_92D5/Stock_Value.webpart">Stock Value Web Part</a></li>
<li><a href="http://www.rotman.be/blog/wp-content/uploads/StockQuoteWebPart_92D5/Stock_Chart.dwp">Stock Chart Web Part</a></li>
</ul>
<p><strong>Changing the stock symbol<br /></strong>After you save the Web Parts locally, open them in a text editor. Search and replace the word <em>MSFT </em>with the stock symbol you want to display. Do this before uploading the Web Parts to your website.</p>
<p><strong>Importing the files to the site<br /></strong>To install, go to a SharePoint Site, click <em>Site Settings</em> and then <em>Edit This Page</em>. Add a Web Part to a zone, and then click the bottom link in the Add Web Part Dialog to get to the advanced mode. Now you&#8217;ll see the gallery on the side of the page. On the top of the gallery, you will see the word <em>Browse</em>. Click it and choose <em>Import</em> instead. Then pick one of the .webpart files and upload them. Drag and drop, repeat for the second file, and that&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=40</wfw:commentRss>
		</item>
		<item>
		<title>Windows Live Writer works again on this blog!</title>
		<link>http://www.rotman.be/blog/?p=35</link>
		<comments>http://www.rotman.be/blog/?p=35#comments</comments>
		<pubDate>Fri, 20 Jul 2007 18:31:54 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=35</guid>
		<description><![CDATA[1. The Problem
I was unable to write using this cool application for a while now. The reason was this annoying error: 
Invalid Server Response - The response to&#160;the blogger.getUsersBlogs method received from the weblog server was invalid.

So I did some research and found this post about changing the .htaccess file. Unfortunently it didn&#8217;t solve the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. The Problem</strong></p>
<p>I was unable to write using this cool application for a while now. The reason was this annoying error: </p>
<blockquote><p>Invalid Server Response - The response to&nbsp;the blogger.getUsersBlogs method received from the weblog server was invalid.</p>
</blockquote>
<p>So I did some research and found <a href="http://www.michael-fraser.com/?p=44">this post</a> about changing the .htaccess file. Unfortunently it didn&#8217;t solve the problem.</p>
<p>Then I installed <a href="http://www.fiddler2.com/fiddler2/">Fiddler 2</a>, the wonderful HTTP proxy application. I started Windows Live Writer again and&nbsp;let it reconnect to my blog.&nbsp;I analyzed the response from XMLRPC.PHP after receiving the error again, and found this response from the server:</p>
<blockquote><p>XML-RPC server accepts POST requests only.</p>
</blockquote>
<p>I searched for this error and got to&nbsp;<a href="http://will.hughesfamily.net.au/20070513/wordpress-xml-rpc-server-accepts-post-requests-only/">this post</a> about the problem, which was close but didn&#8217;t solve it either. However, a link from the post to <a href="http://bugs.php.net/bug.php?id=41293">the support page on the PHP bug tracker</a> showed me a different command to put in the XMLRPC.PHP file.</p>
<p>And it worked!&nbsp;Thanks <a href="http://will.hughesfamily.net.au/20070513/wordpress-xml-rpc-server-accepts-post-requests-only/">Will</a>! <img alt="Open-mouthed" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/teeth_smile.gif"></p>
<p>So now I&#8217;m writing this post using Windows Live Writer&#8230; finally!</p>
<p>P.S. Lovely link for <a href="http://codex.wordpress.org/Windows_Live_Writer_Help">troubleshooting WordPress and Windows Live Writer</a>.</p>
<p><strong></strong>&nbsp;</p>
<p><strong>2. The New Stuff</strong></p>
<p>So now I can do all sorts of nice things. First, I can embed videos - which I couldn&#8217;t using the WordPress default rich text editor. Also, I installed some add-ins for WLW:</p>
<table cellspacing="0" cellpadding="2" width="100%" border="0" unselectable="on">
<tbody>
<tr>
<td valign="top">
<p>You can see I can insert smilies such as these:</p>
<ul>
<li>MSN &nbsp;<img alt="Open-mouthed" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/teeth_smile.gif">
<li>Yahoo <img alt="Happy" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif">
<li>Custom<img alt="Banana" src="http://www.cybergifs.com/faces/banana.gif">(My favorite!)</li>
</ul>
<p>And also I&#8217;m able to insert C# code and make it look cool:</p>
<pre class="csharpcode">MyObject obj = <span class="kwrd">new</span> MyObject(<span class="str">&#8220;foo&#8221;</span>, 123);
<span class="kwrd">int</span> result = obj.DoStuff();
<span class="kwrd">return</span> result;</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
</td>
<td valign="top"><a href="http://www.rotman.be/blog/wp-content/uploads/fb0aac911e50_FE77/image.png" atomicselection="true"><img height="224" alt="image" src="http://www.rotman.be/blog/wp-content/uploads/fb0aac911e50_FE77/image_thumb.png" width="182" border="0"></a></td>
</tr>
</tbody>
</table>
<p>&nbsp;In summary - maybe now I&#8217;ll start writing more <img alt="Open-mouthed" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/teeth_smile.gif"></p>
<p>Dor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=35</wfw:commentRss>
		</item>
		<item>
		<title>Updating a list item without changing the Modified field</title>
		<link>http://www.rotman.be/blog/?p=33</link>
		<comments>http://www.rotman.be/blog/?p=33#comments</comments>
		<pubDate>Sat, 14 Jul 2007 15:56:54 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<category><![CDATA[WSSv3]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=33</guid>
		<description><![CDATA[In WSS 3.0, it is now possible to update a list item (SPListItem) without changing the contents of the Modified or Editor fields.
This wonderful method is called SPListItem.SystemUpdate (has two overloads).
This solves the annoying problem where people would see some system user account that is responsible for the last update, and the time was also [...]]]></description>
			<content:encoded><![CDATA[<p>In WSS 3.0, it is now possible to update a list item (SPListItem) without changing the contents of the Modified or Editor fields.<br />
This wonderful method is called <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.systemupdate.aspx">SPListItem.SystemUpdate</a> (has two overloads).</p>
<p>This solves the annoying problem where people would see some system user account that is responsible for the last update, and the time was also some strange time in which the system account did its actions.</p>
<p>So here&#8217;s the code sample:</p>
<p><span id="ctl00_ContentPlaceHolder1_output" /></p>
<pre class="csharpcode">SPSite site = <span class="kwrd">new</span> SPSite(<span class="str">&#8220;http://server/sites/someSite&#8221;</span>);
SPWeb web = site.OpenWeb();
SPList list = web.Lists[<span class="str">&#8220;ListNameHere&#8221;</span>];

<span class="rem">// Create new item</span>
SPListItem item = list.Items.Add();
item[<span class="str">&#8220;Title&#8221;</span>] = <span class="str">&#8220;New Item Title&#8221;</span>;
item[<span class="str">&#8220;Modified&#8221;</span>] = <span class="kwrd">new</span> DateTime(2000, 1, 1);
item[<span class="str">&#8220;Created&#8221;</span>] = <span class="kwrd">new</span> DateTime(2000, 1, 1);
item[<span class="str">&#8220;Author&#8221;</span>] = web.Users.GetByEmail(<span class="str">&#8220;author@mydomain.com&#8221;</span>);
item.SystemUpdate();

<span class="rem">// Update an item
</span><span class="rem">// (Using some item ID from a pre-populated list</span>)
SPListItem itemu = list.Items.GetItemById(2);
itemu[<span class="str">&#8220;Title&#8221;</span>] = <span class="str">&#8220;An updated item title&#8221;</span>;
itemu[<span class="str">&#8220;Author&#8221;</span>] = web.Users.GetByEmail(<span class="str">&#8220;author@mydomain.com&#8221;</span>);
itemu.SystemUpdate();</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=33</wfw:commentRss>
		</item>
		<item>
		<title>New Outlook 2007 Preview Handlers!</title>
		<link>http://www.rotman.be/blog/?p=23</link>
		<comments>http://www.rotman.be/blog/?p=23#comments</comments>
		<pubDate>Sun, 15 Apr 2007 23:13:24 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<category><![CDATA[Office 2007]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=23</guid>
		<description><![CDATA[My good friend Gil Azar has developed a very cool set of preview handlers for Outlook 2007.
Available file types for preview are: PDF, HTM, HTML, XML, ZIP, WMV, WMA, AVI, MP3, MIDI, and more.
You can find more information about the implementation and even the source code on his page. I&#8217;m already testing it on my [...]]]></description>
			<content:encoded><![CDATA[<p>My good friend Gil Azar has developed a very cool set of preview handlers for Outlook 2007.<br />
Available file types for preview are: <strong>PDF, HTM, HTML, XML, ZIP, WMV, WMA, AVI, MP3, MIDI</strong>, and more.<br />
You can find more information about the implementation and even the source code on his page. I&#8217;m already testing it on my machine and so far it works great. <a href="http://www.azarfamily.org/previewhandlersforwindowsxp">Go download it! <img src='http://www.rotman.be/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </a></p>
<p><img width="500" height="443" src="http://www.azarfamily.org-a.googlepages.com/screenshot.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=23</wfw:commentRss>
		</item>
		<item>
		<title>An interesting revelation about publishing&#8230;</title>
		<link>http://www.rotman.be/blog/?p=17</link>
		<comments>http://www.rotman.be/blog/?p=17#comments</comments>
		<pubDate>Thu, 28 Dec 2006 23:11:45 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<category><![CDATA[MOSS]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=17</guid>
		<description><![CDATA[Sites that have the publishing feature active - can&#8217;t be saved as templates. This option simply dissappears from the site administration page when the feature is turned on.
You can get to the &#8220;Save As Template&#8221; web page by appending the page&#8217;s address (&#8221;/_layouts&#8230;&#8221;) to the site&#8217;s URL, however this action is unsupported and sites restored [...]]]></description>
			<content:encoded><![CDATA[<p>Sites that have the publishing feature active - <strong>can&#8217;t be saved as templates</strong>. This option simply dissappears from the site administration page when the feature is turned on.</p>
<p>You can get to the &#8220;Save As Template&#8221; web page by appending the page&#8217;s address (&#8221;/_layouts&#8230;&#8221;) to the site&#8217;s URL, however this action is <strong>unsupported</strong> and sites restored from the saved template might be broken.</p>
<p>If you&#8217;d like to migrate a site that uses the publishing feature, use STSADM or SharePoint Designer&#8217;s import/export abilities. And if you don&#8217;t need publishing - don&#8217;t turn it on.</p>
<p>Hope this will be resolved in a hotfix&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=17</wfw:commentRss>
		</item>
		<item>
		<title>Windows SharePoint Services 3.0 Tools: Visual Studio 2005 extensions</title>
		<link>http://www.rotman.be/blog/?p=12</link>
		<comments>http://www.rotman.be/blog/?p=12#comments</comments>
		<pubDate>Tue, 07 Nov 2006 15:43:51 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<category><![CDATA[WSSv3]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=12</guid>
		<description><![CDATA[(Via Meron Fridman&#8217;s Blog)
This Community Technology Preview (CTP) of the Visual Studio 2005 Extensions for Windows SharePoint Services contains the following tools to aid developers in building SharePoint applications:
Visual Studio 2005 Project Templates

Web Part
Team Site Definition
Blank Site Definition
List Definition

Visual Studio 2005 Item Templates (items that can be added into an existing project)

Web Part
Custom Field
List Definition [...]]]></description>
			<content:encoded><![CDATA[<p>(Via <a href="http://blogs.microsoft.co.il/blogs/meronf/archive/2006/11/07/New-_2D00_-Windows-SharePoint-Services-3.0-Tools_3A00_-Visual-Studio-2005-extensions.aspx">Meron Fridman&#8217;s Blog</a>)</p>
<p>This Community Technology Preview (CTP) of the Visual Studio 2005 Extensions for Windows SharePoint Services contains the following tools to aid developers in building SharePoint applications:</p>
<p><strong>Visual Studio 2005 Project Templates</strong></p>
<ul>
<li>Web Part</li>
<li>Team Site Definition</li>
<li>Blank Site Definition</li>
<li>List Definition</li>
</ul>
<p><strong>Visual Studio 2005 Item Templates</strong> (items that can be added into an existing project)</p>
<ul>
<li>Web Part</li>
<li>Custom Field</li>
<li>List Definition (with optional Event Receiver)</li>
<li>Content Type (with optional Event Receiver)</li>
<li>Module</li>
</ul>
<p><strong>SharePoint Solution Generator</strong></p>
<ul>
<li>This stand-alone program generates a Site Definition project from an existing SharePoint site. The program enables developers to use the browser and Microsoft Office SharePoint Designer to customize the content of their sites before creating code by using Visual Studio.</li>
</ul>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=19f21e5e-b715-4f0c-b959-8c6dcbdc1057&#038;displaylang=en">Download</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=12</wfw:commentRss>
		</item>
		<item>
		<title>Changing AND/OR Behavior in FREETEXT Searches</title>
		<link>http://www.rotman.be/blog/?p=11</link>
		<comments>http://www.rotman.be/blog/?p=11#comments</comments>
		<pubDate>Tue, 07 Nov 2006 13:43:47 +0000</pubDate>
		<dc:creator>Dor</dc:creator>
		
		<category><![CDATA[English Posts]]></category>

		<category><![CDATA[MOSS]]></category>

		<guid isPermaLink="false">http://www.rotman.be/blog/?p=11</guid>
		<description><![CDATA[The default functionality of search in MOSS 2007 has changed:
From now on, all keywords in FREETEXT searches are linked with an &#8220;AND&#8221; operator between them. You will only receive results that contain all the words from the query. (The current product documentation is not up to date about this issue.)
This means that:

Searching for windows server [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The default functionality of search in MOSS 2007 has changed:</strong><br />
From now on, all keywords in FREETEXT searches are linked with an &#8220;AND&#8221; operator between them. You will only receive results that contain <u>all the words</u> from the query. (The current product documentation is not up to date about this issue.)</p>
<p>This means that:</p>
<ul>
<li>Searching for <u><em>windows server</em></u> will probably return results</li>
<li>Searching for <u><em>windows server nonexistantword</em></u> will return no results (unless you actually have a document with all of these words :)).</li>
</ul>
<p>However, it is possible to perform an &#8220;OR&#8221; search programmatically, so that any item containing one or more of the keywords will be displayed. (Of course that items with more keywords will receive higher ranks accordingly.)</p>
<ul>
<li><u>When using the Object Model:</u> Set the  <a title="http://msdn2.microsoft.com/en-us/library/microsoft.office.server.search.query.query.keywordinclusion.aspx" href="http://msdn2.microsoft.com/en-us/library/microsoft.office.server.search.query.query.keywordinclusion.aspx"><span lang="EN-US" dir="ltr" title="http://msdn2.microsoft.com/en-us/library/microsoft.office.server.search.query.query.keywordinclusion.aspx">KeywordInclusion</span></a> property to All Keywords:
<pre class="csharpcode">query.KeywordInclusion = KeywordInclusion.AnyKeyword;</pre>
</li>
<li><u>When using the Web Service:</u> Insert the <a title="http://msdn2.microsoft.com/en-us/library/ms519861.aspx" href="http://msdn2.microsoft.com/en-us/library/ms519861.aspx"><span lang="EN-US" dir="ltr" title="http://msdn2.microsoft.com/en-us/library/ms519861.aspx">ImplicitAndBehavior</span></a> element under the Query element and set its value to false:<br />
<span lang="EN-US" dir="ltr"> <!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode"><span class="kwrd"><</span><span class="html">ImplicitAndBehavior</span><span class="kwrd">></span>false<span class="kwrd"><</span><span class="kwrd">/</span><span class="html">ImplicitAndBehavior</span><span class="kwrd">></span></pre>
<p></span></li>
</ul>
<p>Hope this information was useful to you,<br />
Dor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rotman.be/blog/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
	</channel>
</rss>
