tag:blogger.com,1999:blog-17514702559261456082024-03-13T03:27:33.500-07:00In Moss We Trust - Sharepoint BlogThis blog is dedicated to Microsoft Sharepoint and .NET Technologies.In Moss We Trusthttp://www.blogger.com/profile/15308310922423409273noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-1751470255926145608.post-27535163950183645302009-08-01T12:29:00.000-07:002009-08-01T12:56:34.944-07:00Operation is not valid due to the current state of the objectI writed a post about this error (<a href="http://mosswat.blogspot.com/2009/02/operation-is-not-valid-due-to-current.html">http://mosswat.blogspot.com/2009/02/operation-is-not-valid-due-to-current.html</a>)<br /><br />There is another cause to this error: using the "update" method in the "RunWithElevatePrivilege" scope, like this:<br /><br />SPSecurity.RunWithElevatedPrivileges(delegate{ <br />using (SPSite site = new SPSite("<a href="http://mysiteurl/">http://mySiteUrl</a>"))<br />{<br /> using (SPWeb web = site.OpenWeb()) <br /> { <br /> SPListItem listItem = web.GetListItem("<a href="http://myitemurl/">http://myItemUrl</a>");<br /> //do item modifications.... <br /> <span style="color:#cc0000;">listItem.Update();</span><br /> }<br />} <br /><br />});<br /><br />To resolve this issue, call the "update" method out of the "RunWithElevatedPrivileges" scope, like this;<br /><br />SPSite site = null;<br />SPWeb web = null;<br />try<br />{<br /> SPSecurity.RunWithElevatedPrivileges(delegate{<br /> site = new SPSite("<a href="http://mysiteurl/">http://mySiteUrl</a>");<br /> web = site.OpenWeb();<br /> });<br />SPListItem listItem = web.GetListItem("<a href="http://myitemurl/">http://myItemUrl</a>");<br /> //do item modifications.... <br /><span style="color:#cc0000;">listItem.Update(); </span><br /> }<br />finally<br />{ <br /> if (site != null)<br /> site.Dispose(); <br /> if (web != null) <br /> web.Dispose();<br />}Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-68060727608728311492009-07-22T13:48:00.000-07:002009-07-23T07:12:08.218-07:00Active Directory: How to get all related groups by userHi<div><br /></div><div>I know this is not a Moss post and i know that in Moss we trust, but it is a nice code to have.</div><div><br /></div><div>Recently i needed to get all related AD groups per user, so if a user A is in group B and group B is in group C, i will get a collection like so { B,C } for A.</div><div><br /></div><div>To do so i used the following code:</div><div><br /></div><div><div><span class="Apple-style-span" style="color:#999999;"><br /></span></div><div><span class="Apple-style-span" style="color:#999999;">/// ldapPath - Ldap://...</span></div><div></div><div><span class="Apple-style-span" style="color:#999999;">/// distinguishedName - The user location (CN=AAA, OU=BBB,OU=CCC,DC=DDD )</span></div><div><span class="Apple-style-span" style="color:#999999;">///resultField - The property field value (DisplyName, Mail)</span></div></div><div><div><span class="Apple-style-span" style="color:#3333FF;">public static void</span> GetAllRelatedGroupsByEntry(<span class="Apple-style-span" style="color:#3333FF;">string </span>ldapPath, <span class="Apple-style-span" style="color:#3333FF;">string </span>distinguishedName,</div><div> <span class="Apple-style-span" style="color:#3333FF;">ref </span>List<<span class="Apple-style-span" style="color:#3333FF;">string</span>> groups, <span class="Apple-style-span" style="color:#3333FF;">string </span>resultField)</div><div> {</div><div> <span class="Apple-style-span" style="color:#00CCCC;">SearchResultCollection </span>results = <span class="Apple-style-span" style="color:#3366FF;">null</span>;</div><div><br /></div><div> <span class="Apple-style-span" style="color:#3333FF;">using </span>(<span class="Apple-style-span" style="color:#00CCCC;">DirectoryEntry </span>entry = <span class="Apple-style-span" style="color:#3333FF;">new </span><span class="Apple-style-span" style="color:#33CCFF;">DirectoryEntry</span>(ldapPath))</div><div> {</div><div><br /></div><div> using (<span class="Apple-style-span" style="color:#33CCFF;">DirectorySearcher </span>search = <span class="Apple-style-span" style="color:#3333FF;">new </span><span class="Apple-style-span" style="color:#33CCFF;">DirectorySearcher</span>(entry))</div><div> {</div><div><br /></div><div> search.Filter = <span class="Apple-style-span" style="color:#CC0000;">"(&(objectClass=Group)(objectCategory=Group)(member="</span> + distinguishedName + <span class="Apple-style-span" style="color:#FF0000;">"))"</span>;</div><div><br /></div><div> results = search.FindAll();</div><div><br /></div><div> <span class="Apple-style-span" style="color:#3333FF;">if </span>(results != <span class="Apple-style-span" style="color:#3333FF;">null</span>)</div><div> {</div><div> <span class="Apple-style-span" style="color:#3333FF;">foreach </span>(<span class="Apple-style-span" style="color:#00CCCC;">SearchResult </span>result in results)</div><div> {</div><div> <span class="Apple-style-span" style="color:#3333FF;">for </span>(<span class="Apple-style-span" style="color:#3333FF;">int </span>i = 0; i <><div> {</div><div> groups.Add(result.Properties[resultField][i].ToString());</div><div> GetAllRelatedGroupsByEntry(ldapPath,</div><div> result.Properties[<span class="Apple-style-span" style="color:#CC0000;">"DistinguishedName"</span>][i].ToString(),</div><div> <span class="Apple-style-span" style="color:#3333FF;">ref </span>groups, resultField);</div><div> }</div><div> }</div><div> }</div><div> }</div><div> }</div><div> }</div><div><br /></div></div></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-50519352774486043412009-07-12T06:36:00.000-07:002009-07-12T06:57:25.815-07:00How to add Sharepoint Workflow Activities to Toolbox<span class="Apple-style-span" style="font-size: medium;">Hi</span><div><span class="Apple-style-span" style="font-size: medium;"><br /></span></div><div><span class="Apple-style-span" style="font-size: medium;">There are more workflow activities that you can use beside the one that are already in, for example </span><b><span class="Apple-style-span" style="font-size: medium;">"Create Task".</span></b></div><div><b><span class="Apple-style-span" style="font-size: medium;"><br /></span></b></div><div><span class="Apple-style-span" style="font-size: medium;">To add them to the toolbox you need to open visual studio and on the Toolbox section:</span></div><div><br /></div><div><span class="Apple-style-span" style="font-family: Calibri; "><span class="Apple-style-span" style="font-size: medium;">1.</span></span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-family:Calibri;"><span class="Apple-style-span" style="font-size: medium;">Create new tab by right click and select "Add Tab".</span></span></div><div><span class="Apple-style-span" style="font-family:Calibri;"><span class="Apple-style-span" style="font-family:Georgia;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEIlcz3yyDncy_XJuhREErWQqT3JY89UcAtpJcNUifqMX8aI7f3Ywy_Kpw39sAz7gaVEtIm_5HSkwvYUPZBar1vYUwEfktZOjRyWFNIhiXzLAL9vsQi8ss5sc98chyphenhyphenEqwD8E5TwIFMcCk/s1600-h/1.PNG"><span class="Apple-style-span" style="font-size: medium;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEIlcz3yyDncy_XJuhREErWQqT3JY89UcAtpJcNUifqMX8aI7f3Ywy_Kpw39sAz7gaVEtIm_5HSkwvYUPZBar1vYUwEfktZOjRyWFNIhiXzLAL9vsQi8ss5sc98chyphenhyphenEqwD8E5TwIFMcCk/s200/1.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5357569922665637746" style="cursor: pointer; width: 92px; height: 200px; " /></span></a></span></span></div><div><span class="Apple-style-span" style="font-family:Calibri;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:Calibri;"><span class="Apple-style-span" style="font-size: medium;">2. Under the new tab press right click and select "Choose Items…" (It will take a while to open).</span></span></div><div><span class="Apple-style-span" style="font-family:Calibri;"><span class="Apple-style-span" style="font-family:Georgia;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNAYs-5VrCSiuzzEEjog31YOYvvgcMhajrMia85_j7yw4BHCWNyp2HybjrWppPRq-8MLSkVbNNItbz6yVDQUj5nDcRWMYP0QKf7wzEv4kThK-0M3mkraOtR0Ue6PWOV4cW2wMz5qO_2as/s1600-h/2.PNG"><span class="Apple-style-span" style="font-size: medium;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNAYs-5VrCSiuzzEEjog31YOYvvgcMhajrMia85_j7yw4BHCWNyp2HybjrWppPRq-8MLSkVbNNItbz6yVDQUj5nDcRWMYP0QKf7wzEv4kThK-0M3mkraOtR0Ue6PWOV4cW2wMz5qO_2as/s200/2.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5357570071492929618" style="cursor: pointer; width: 155px; height: 200px; " /></span></a></span></span></div><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span class="Apple-style-span" style="font-size: medium;"> </span><div><span class="Apple-style-span" style="font-size: medium;"><br /></span></div><span class="Apple-style-span" style="font-size: medium;">3. </span><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span class="Apple-style-span" style="font-size: medium;">Then select <i><b>microsoft.sharepoint.WorkflowActions.dll</b></i>, it is usually under <i>C:\Program Files\Common </i></span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-size: medium;"><i> </i></span></span><span class="Apple-style-span" style="font-size: medium;"><i>Files\Microsoft Shared\web server extensions\12\ISAPI</i></span></span></span><div><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span class="Apple-style-span" style="font-family: Georgia; "><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKt0StBTnVpNEJ008A6KctVnfByuS59D4UR2nDeQExmfVkuWi5dG2N3XhG4-OfExRpnx8h1P4dgjkS8uFrILgWT-PY31bLbWdhAlUieS9urMfSpyJm_8PJ_BTupKYyEPfv9n9KsBr3qPU/s1600-h/3.PNG"><span class="Apple-style-span" style="font-size: medium;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKt0StBTnVpNEJ008A6KctVnfByuS59D4UR2nDeQExmfVkuWi5dG2N3XhG4-OfExRpnx8h1P4dgjkS8uFrILgWT-PY31bLbWdhAlUieS9urMfSpyJm_8PJ_BTupKYyEPfv9n9KsBr3qPU/s200/3.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5357570751790542290" style="cursor: pointer; width: 200px; height: 110px; " /></span></a></span></span></span></div><div><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span class="Apple-style-span" style="font-size: medium;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKt0StBTnVpNEJ008A6KctVnfByuS59D4UR2nDeQExmfVkuWi5dG2N3XhG4-OfExRpnx8h1P4dgjkS8uFrILgWT-PY31bLbWdhAlUieS9urMfSpyJm_8PJ_BTupKYyEPfv9n9KsBr3qPU/s1600-h/3.PNG"></a></span><span class="Apple-style-span" style="font-family:Georgia;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></span></span><div><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span class="Apple-style-span" style="font-size: medium;">4. P</span><span class="Apple-style-span" style="font-size: medium;">ress <i>OK</i>.</span></span></span><div><span class="Apple-style-span" style="font-family:Calibri;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span style="font-family:"Calibri","sans-serif"; mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font: minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi- mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:HEfont-family:Arial;"><span style="font-family:Calibri;"><span><span style="font:7.0pt "Times New Roman""><span class="Apple-style-span" style="font-family:Calibri;"><span class="Apple-style-span" style="font-size: medium;">5. </span></span></span></span></span><span class="Apple-style-span" style="font-size: medium;">Now you will have the following activities:</span></span></span></div><div><span><span class="Apple-style-span" style="font-size: medium;"><span></span></span></span><span class="Apple-style-span" style="font-family:Calibri;"><span class="Apple-style-span" style="font-family:Georgia;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsHRppvij-r15th5SagBw6H1H48M5XGUHQmdvgkFMjbMObe3Uui_IPl19qU1epYbEP-UKbhXwAK7G2CsLouKR3zZSmO54pIw8zzPdA49WleXRtFSjjYc-3oTTWl14jul5tT6BZqC5LEAQ/s1600-h/5.PNG"><span class="Apple-style-span" style="font-size: medium;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsHRppvij-r15th5SagBw6H1H48M5XGUHQmdvgkFMjbMObe3Uui_IPl19qU1epYbEP-UKbhXwAK7G2CsLouKR3zZSmO54pIw8zzPdA49WleXRtFSjjYc-3oTTWl14jul5tT6BZqC5LEAQ/s200/5.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5357570618480830722" style="cursor: pointer; width: 122px; height: 200px; " /></span></a></span><span class="Apple-style-span" style="font-size: medium;"><br /></span></span><div><br /></div></div></div></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-40535010012765044522009-07-06T02:47:00.000-07:002009-07-06T06:51:27.677-07:00SPWeb.RoleDefinitions.GetByType(SPRoleType.None)<span class="Apple-style-span" style="font-size: small;">Hi all</span><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;">Recently i tried to copy permission from one item to another (see </span><span class="Apple-style-span" style="letter-spacing: -1px; "><a href="http://mosswat.blogspot.com/2009/02/how-to-copy-permissions-between-site.html"><span class="Apple-style-span" style="color:#3333FF;"><span class="Apple-style-span" style="font-size: small;">How To Copy Permissions Between Site Collections</span></span></a><span class="Apple-style-span" style="font-size: small;">) , and had a problem with role definition types that were </span><b><span class="Apple-style-span" style="font-size: small;">None</span></b><span class="Apple-style-span" style="font-size: small;">.<br />The problem occured when i tried to copy </span><b><span class="Apple-style-span" style="font-size: small;">Restricted Read</span></b><span class="Apple-style-span" style="font-size: small;"> role agginment</span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="letter-spacing: normal; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-weight: bold; letter-spacing: -1px; "><span class="Apple-style-span" style="color:#000000;"><span class="Apple-style-span" style="font-weight: normal; "><span class="Apple-style-span" style="letter-spacing: normal; color: rgb(0, 0, 153); -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; letter-spacing: -1px; "><span class="Apple-style-span" style="color:#000000;"><span class="Apple-style-span" style="font-size: small;">.</span></span></span></span></span></span></span></span></span></span></div><div><span class="Apple-style-span" style="letter-spacing: -1px;"><span class="Apple-style-span" style="font-size: small;"><br /></span></span></div><div><span class="Apple-style-span" style="letter-spacing: -1px;"><span class="Apple-style-span" style="font-size: small;">So to solve it I used this code:</span></span></div><div><span class="Apple-style-span" style="letter-spacing: -1px;"><span class="Apple-style-span" style="font-size: small;"><br /></span></span></div><div><span class="Apple-style-span" style="letter-spacing: -1px;"><div><span class="Apple-style-span" style="font-size: small;">if (roleDefinition.Type != SPRoleType.None)</span></div><div><span class="Apple-style-span" style="font-size: small;">{</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-size: small;"> </span></span><span class="Apple-style-span" style="font-size: small;">definition = web.RoleDefinitions.GetByType(roleDefinition.Type);</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-size: small;"> </span></span><span class="Apple-style-span" style="font-size: small;">roleAssignment.RoleDefinitionBindings.Add(definition);</span></div><div><span class="Apple-style-span" style="font-size: small;">}</span></div><div><span class="Apple-style-span" style="font-size: small;">else</span></div><div><span class="Apple-style-span" style="font-size: small;">{</span></div><div> <span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-size: small;"> </span></span><span class="Apple-style-span" style="font-size: small;">definition = web.RoleDefinitions.GetById(roleDefinition.Id);</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-size: small;"> </span></span><span class="Apple-style-span" style="font-size: small;">roleAssignment.RoleDefinitionBindings.Add(definition);</span></div><div><span class="Apple-style-span" style="font-size: small;">}</span></div><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;">Instead of geting the code by role definition </span><i><span class="Apple-style-span" style="font-size: small;">type </span></i><span class="Apple-style-span" style="font-size: small;">i got it by it's </span><i><span class="Apple-style-span" style="font-size: small;">Id</span></i><span class="Apple-style-span" style="font-size: small;">.</span></div></span></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-60912216291902204992009-05-06T23:58:00.000-07:002009-05-06T02:14:22.811-07:00How to create your own local pathHi<div><br /></div><div>In <span class="blsp-spelling-error" id="SPELLING_ERROR_0">lots</span> of MOSS development we are using custom <span class="blsp-spelling-error" id="SPELLING_ERROR_2"><span class="blsp-spelling-error" id="SPELLING_ERROR_0">aspx</span></span>/html or just office templates and we need to save them in the local server file system. We can use the layouts folder (/_layouts/...) or create our own path.</div><div><br /></div><div>To do so create a feature.<span class="blsp-spelling-error" id="SPELLING_ERROR_3"><span class="blsp-spelling-error" id="SPELLING_ERROR_1">xml</span></span> and element.<span class="blsp-spelling-error" id="SPELLING_ERROR_4"><span class="blsp-spelling-error" id="SPELLING_ERROR_2">xml</span></span>, in the element file add the Module tab, in the <span class="blsp-spelling-error" id="SPELLING_ERROR_5"><span class="blsp-spelling-error" id="SPELLING_ERROR_3">SetupPath</span></span> <span class="blsp-spelling-corrected" id="SPELLING_ERROR_6">attribute</span> write the file system folder path (like <span class="blsp-spelling-error" id="SPELLING_ERROR_7"><span class="blsp-spelling-error" id="SPELLING_ERROR_4">FEATRUES</span></span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_8"><span class="blsp-spelling-error" id="SPELLING_ERROR_5">mosswat</span></span>), and in the <span class="blsp-spelling-error" id="SPELLING_ERROR_9"><span class="blsp-spelling-error" id="SPELLING_ERROR_6">Url</span></span> <span class="blsp-spelling-corrected" id="SPELLING_ERROR_10">attribute</span> write the new <span class="blsp-spelling-error" id="SPELLING_ERROR_11"><span class="blsp-spelling-error" id="SPELLING_ERROR_7">url</span></span> (like _<span class="blsp-spelling-error" id="SPELLING_ERROR_12"><span class="blsp-spelling-error" id="SPELLING_ERROR_8">mosswat</span></span>/templates).</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9EiTkI-Qe7DTJ8WE8jNtpOf14C6jNHOU2vefoB-xJJWLkHPg34xzNxUO6z1CHbcMrfviGZM5_z68AzEI-2pzzDhDm4nu9YRxvF9IFwHZsuWu0e1jvskOufFD0zd_Lw4O-kQefCpAlfz4/s1600-h/module.PNG" style=""><span class="Apple-style-span" style="text-decoration: none;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9EiTkI-Qe7DTJ8WE8jNtpOf14C6jNHOU2vefoB-xJJWLkHPg34xzNxUO6z1CHbcMrfviGZM5_z68AzEI-2pzzDhDm4nu9YRxvF9IFwHZsuWu0e1jvskOufFD0zd_Lw4O-kQefCpAlfz4/s400/module.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5319257639543020466" style="cursor: pointer; width: 400px; height: 67px; " /></span></a></span><br /></span></div><div><br /></div><div>Run the <span class="blsp-spelling-error" id="SPELLING_ERROR_13"><span class="blsp-spelling-error" id="SPELLING_ERROR_9">stsadm</span></span> <span class="blsp-spelling-corrected" id="SPELLING_ERROR_14">segment.</span></div><div><br /></div><div>Now enter in the explorer the following: <span class="Apple-style-span" style="color: rgb(51, 51, 255);">http://WebApp/sites/SiteCollection/_mosswat/templates/filename.docx</span></div><div><br /></div><div><span class="Apple-style-span" style="text-decoration: underline;"><br /></span></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-80303240971442069942009-05-05T12:00:00.000-07:002009-05-06T02:19:10.692-07:00MOSS & AJAX (Framework 3.5)Hi,<div><br /></div><div>More and more sites are using AJAX and it is not only "nice to have" feature but a mandatory one.</div><div><br /></div><div>We can also use AJAX in MOSS and there is a lot of example how to on the Internet, but before we start we have to add some elements in <a href="http://www.telerik.com/help/aspnet-ajax/moss-install-aspnet-ajax-35.html">MOSS web.config</a>.</div><div><br /></div><div>A few posts ago Michael wrote on how to <a href="http://mosswat.blogspot.com/2009/03/update-moss-webconfig-v2.html">update web config</a>, so i added the XML file in <a href="http://www.savefile.com/projects/808763417">here</a> so u can copy it to <span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="color: rgb(0, 102, 0);">C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\config</span></span> and run the <span class="Apple-style-span" style="font-style: italic;">s<span class="Apple-style-span" style="">tsadm commend</span></span></div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(204, 0, 0);"><span class="Apple-style-span" style=""><span class="Apple-style-span" style="font-weight: bold;">Warnings</span><span class="Apple-style-span" style="font-weight: bold;">:</span></span></span></div><div><ol><li>Before u run it backup your web.config and your DB and do not delete the element by your self only with the remove file.<br /></li><li><span class="Apple-style-span" style="font-style: italic; ">Don't copy the remove and the add together to the Config directory only the one you want to run.</span></li><li><span class="Apple-style-span" style="font-style: italic; ">Very important don't change the guid before you are doing remove!!!</span><span class="Apple-style-span" style="color: rgb(204, 0, 0); font-style: italic;"> </span></li></ol></div><div><span class="Apple-style-span" style="color: rgb(204, 0, 0); font-style: italic;"><br /></span></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-35083337701768808022009-03-11T10:34:00.000-07:002009-03-11T10:35:43.838-07:00MOSS Search PDF 64-bit using IFilter 9<p><br /><span style="font-family:arial;"><strong><u>Install the PDF Ifilter 9 for 64-bit</u></strong></span></p><ol><li><span style="font-family:arial;">Download and extract the contents of "</span><a href="http://download.adobe.com/pub/adobe/acrobat/win/9.x/PDFiFilter64installer.zip"><span style="font-family:arial;">PDFiFilter64installer.zip</span></a><span style="font-family:arial;">" to your local drive. </span></li><li><span style="font-family:arial;">Double click "PDFFilter64installer.msi" to launch the installer. </span></li><li><span style="font-family:arial;">Follow the instructions in the installer wizard to complete the installation. </span></li><li><span style="font-family:arial;">After installing the PDF iFilter, it is recommended that you set your system PATH environment variable to the "bin" folder of the "Ifilter" installation. For example, from the "Control Panel\System\Advanced\Environment Variables" tab, append to PATH "C:\Program Files\Adobe\Adobe PDF iFilter 9 for 64-bit platforms\bin\" and then restart the computer.</span></li><li><span style="font-family:arial;">Follow the </span><a href="http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf"><span style="font-family:arial;">Sharepoint IFilter Configuration Guide</span></a><span style="font-family:arial;"> </span><span style="font-family:arial;"><br /></span></li></ol><p><span style="font-family:arial;"><strong><u>Add the PDF extension to Search File Types</u></strong></span></p><ol><li><span style="font-family:arial;">SharePoint Server Search Administration page by adding ‘pdf’ to list of File Types in Search Administration->File Types</li></ol><u><strong></strong></u></span><p><span style="font-family:arial;"><u><strong>Add the PDF File Icon to MOSS</strong></u></span></p><span style="font-family:arial;"><u><strong><ol><li></strong></u>Download the icon for pdf file from </span><a href="http://www.adobe.com/images/pdficon_small.gif"><span style="font-family:arial;">http://www.adobe.com/images/pdficon_small.gif</span></a><span style="font-family:arial;"> , save it to <moss>\TEMPLATE\IMAGES directory and name it pdficon_small.gif.</span></li><li><span style="font-family:arial;">Open the docicon.xml file from .<moss>\template\xml .</span></li><li><span style="font-family:arial;">Add a new Mapping element to the ByExtension element.<mapping value="pdficon_small.gif" key="pdf"></span></li><li><span style="font-family:arial;">Save the docicon.xml file.</span></li><li><span style="font-family:arial;">Restart IIS using iisreset command line.</span></li></ol><span style="font-family:arial;"><p><br /><strong><u>Restart all SharePoint services as well as IIS. </u></strong></p><ol><li>Run these command-lines:<br />“net stop osearch”. Wait for success message.<br />“net start osearch”. Wait for success message. </li><li>Restart IIS using iisreset command line and wait for success message. </li></ol><p></p><p><u><strong>Re-Crawl</strong></u></p><p>Make sure that you Full Crawl !!!</p><p><u></u></p><p><u><em><strong></strong></em></u></p><p><u><em><strong>*** Troubleshooting ***</strong></em></u></p><p><em>Important step that will solve this error message "The filtering process could not process this item. This might be because you do not have the latest file filter for this type of item. Install the corresponding filter and retry your crawl."</em></p><p><em>Make sure to change the </em><a href="file://hkey_local_machine/SOFTWARE/Microsoft/Office"><em>\\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office</em></a><em> Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf to the GUID {E8978DA6-047F-4E3D-9C78-CDBE46041603}. The original value was {4C904448-74A9-11D0-AF6E-00C04FD8DC02}. (thanks to <a href="http://sharepointsolutions.blogspot.com/2009/01/installing-adobes-64-bit-pdf-ifilter-9.html">Russell Wright </a>for that one)</em></p><p><em></em></p></span><p><u><span style="font-family:arial;"></span></u></p><p><u><span style="font-family:arial;">URLs:</span></u></p><p><a href="http://download.adobe.com/pub/adobe/acrobat/win/9.x/PDFiFilter64installer.zip"><span style="font-family:arial;">http://download.adobe.com/pub/adobe/acrobat/win/9.x/PDFiFilter64installer.zip</span></a><br /><a href="http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025"><span style="font-family:arial;">http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025</span></a><br /><a href="http://support.microsoft.com/default.aspx/kb/832809"><span style="font-family:arial;">http://support.microsoft.com/default.aspx/kb/832809</span></a><br /><a href="http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf"><span style="font-family:arial;">http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf</span></a><br /><a href="http://www.adobe.com/images/pdficon_small.gif"><span style="font-family:arial;">http://www.adobe.com/images/pdficon_small.gif</span></a><span style="font-family:arial;"><br /></span><a href="http://sharepointsolutions.blogspot.com/2009/01/installing-adobes-64-bit-pdf-ifilter-9.html">http://sharepointsolutions.blogspot.com/2009/01/installing-adobes-64-bit-pdf-ifilter-9.html</a></p><p><span style="font-family:arial;"></span></p><p><span style="font-family:arial;"></span></p>Liron Leybovichhttp://www.blogger.com/profile/00183176081710984245noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-64408854210712141242009-03-11T03:07:00.000-07:002009-03-11T04:39:56.735-07:00How to easy add Dll to the gacHi,<div><br /></div><div>If you want to add dll to the gac with a simple right click, follow theses steps:<br /><br />1. Foreach .NET version paste the apropriate script in a new file<br />2. Save it with ".reg" extension<br />3. Double click on each file to add the entry in the registery.<br /><br /><strong>.Net 1.1</strong><br /><br />Windows Registry Editor Version 5.00<br />[HKEY_CLASSES_ROOT\dllfile\shell\gacutil\command]@="c:\\windows\\Microsoft.NET\\Framework\\v1.1.4322\\gacutil.exe /i \"%1\""<br /><br /><strong>.Net 2.0</strong><br /><strong></strong><br />Windows Registry Editor Version 5.00<br />[HKEY_CLASSES_ROOT\dllfile\shell\gacutil\command]@="C:\\Program Files\\Microsoft Visual Studio 8\\SDK\\V2.0\\Bin\\gacutil.exe /i \"%1\""<br /><br /><br />Thanks to Elad R...<br /></div><div><br /></div><div>See also:<a href="http://dotnetsharepointtips.blogspot.com/2009/03/how-to-easy-add-dll-to-gac.html"> http://dotnetsharepointtips.blogspot.com/2009/03/how-to-easy-add-dll-to-gac.html</a></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-70342692715691844672009-03-10T05:15:00.000-07:002009-03-16T01:39:39.039-07:00New Release Content Type List BinderHi all,<div><br /></div><div>We have done it again... :)</div><div><br /></div><div>Content Type List Binder is a new application that help us bind between lists and content types.</div><div><br /></div><div>How to:</div><div><br /></div><div>1. Enter the site collection url and press the <span class="Apple-style-span" style="font-weight: bold;">load data</span> button.</div><div>2. Select the lists you want (or need) and the relavent content type.</div><div>3. Press on bind (check the <span class="Apple-style-span" style="font-weight: bold;">insert content type </span>radio button to add and <span class="Apple-style-span" style="font-weight: bold;">remove content type</span> to remove).</div><div><br /></div><div>You can <a href="http://www.savefile.com/files/2042833">Download Here</a> (If you are like me and use Chrome it will save the file as .htm, so just change the suffix to .msi).</div><div><br /></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-5897982706998520962009-03-07T10:16:00.000-08:002009-03-13T05:24:43.211-07:00SPQuery syntax<div><span class="Apple-style-span" style="COLOR: rgb(102,204,204)">SPQuery </span>is the best way to write queries on MOSS.</div><div>MOSS is using CAML to get data in the best and quickest way from sites,lists and folder. using <span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPQuery </span>is in most cases the "best practice" way to find information in MOSS and also used in Sharepoint web services.<br /><div><div>We have gather a few impotent information about <span class="Apple-style-span" style="COLOR: rgb(102,204,204)">SPQuery</span> syntax,<br /><br /><div><br /></div><div><span class="Apple-style-span"><span class="Apple-style-span"><span class="Apple-style-span" style="font-size:large;"><span class="Apple-style-span" style="FONT-STYLE: italic"><span class="Apple-style-span" style="TEXT-DECORATION: underline"><span class="Apple-style-span" style="FONT-WEIGHT: bold"><span class="Apple-style-span" style="COLOR: rgb(51,102,255)">Properties:</span></span></span></span></span></span></span></div><div><ul><li><span class="Apple-style-span" style="COLOR: rgb(0,204,204)"><span class="Apple-style-span">SPQuery</span></span><span class="Apple-style-span">.Query:</span><br /></li></ul></div><br /><div style="TEXT-ALIGN: center"><span class="Apple-style-span" style="font-size:48;"><span class="Apple-style-span" style="font-size:16;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCtSPBzo6xutOxyaK38cSpzsEtLwHrK31V45WBIoGqdd18r8T57DWPgBBh4HhyYi0b3E-NaO3QKwHaPDIVkA2vxypaYunowRXO423AqfKezXsDBfawLidDqrCuHnCe-I9a2Xal-KHUO_Q/s1600-h/where.PNG"><span class="Apple-style-span" style="TEXT-DECORATION: none"><img id="BLOGGER_PHOTO_ID_5311597978841764562" style="WIDTH: 400px; CURSOR: pointer; HEIGHT: 74px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCtSPBzo6xutOxyaK38cSpzsEtLwHrK31V45WBIoGqdd18r8T57DWPgBBh4HhyYi0b3E-NaO3QKwHaPDIVkA2vxypaYunowRXO423AqfKezXsDBfawLidDqrCuHnCe-I9a2Xal-KHUO_Q/s400/where.PNG" border="0" /></span></a></span><br /></span></div><div><div><ul><span class="Apple-style-span" style="color: rgb(0, 0, 238);"><br /></span><br /><li><span class="Apple-style-span" style="COLOR: rgb(0,204,204)"><span class="Apple-style-span">SPQuery</span></span><span class="Apple-style-span"><span class="Apple-style-span">.RowLimit: An int that indicate the row limit.</span></span></li></ul></div></div><br /><div style="TEXT-ALIGN: center"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsGM7gKCx_WutjwZLR8WzQEWR2vieEDg7nOdLbYTD3qtU5vm7FSAYSWjBnky8MNgHEuYGcVol7lMU-Z1Vt8h4dosRaOV02yBBnj4QI8k_kV0OZcwfjwSTPaBOo4yTAY7x2-XJ7WSaY934/s1600-h/rowlimit.PNG"><span class="Apple-style-span" style="COLOR: rgb(51,51,255)"><span class="Apple-style-span" style="TEXT-DECORATION: none"><img id="BLOGGER_PHOTO_ID_5311598594912575394" style="WIDTH: 256px; CURSOR: pointer; HEIGHT: 33px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsGM7gKCx_WutjwZLR8WzQEWR2vieEDg7nOdLbYTD3qtU5vm7FSAYSWjBnky8MNgHEuYGcVol7lMU-Z1Vt8h4dosRaOV02yBBnj4QI8k_kV0OZcwfjwSTPaBOo4yTAY7x2-XJ7WSaY934/s400/rowlimit.PNG" border="0" /></span></span></a><br /></div><div><ul><br /><li><span class="Apple-style-span" style="COLOR: rgb(0,204,204)">SPQuery</span>.Folder: Get a <span class="Apple-style-span" style="COLOR: rgb(102,204,204)">SPFolder </span><span class="Apple-style-span">object</span><span class="Apple-style-span">.</span><span class="Apple-style-span" style="COLOR: rgb(102,204,204)"> <br /><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">This is the best way to get items that are in folder.</span></span></li></ul></div><div><ul><li><span class="Apple-style-span" style="COLOR: rgb(0,204,204)">SPQuery</span>.ViewField: The same is a "SELECT" sentence.</li></ul></div><div><br /></div><div style="TEXT-ALIGN: center"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVzszKlif4yZDDe6rNqr091SA3YQ_QXF2y-YGnmcpZ7M_sgDt2btn6iqshYUCuVEM5lRhApvCPY-nly-VqpA5moTeKoo1uJyp0PX5iAVfY1HHLFdr8PV6ID-T2Re6_Kxvnj1apgcH36nk/s1600-h/fieldref.PNG"><span class="Apple-style-span" style="TEXT-DECORATION: none"><span class="Apple-style-span" style="COLOR: rgb(51,51,255)"><img id="BLOGGER_PHOTO_ID_5311599183791546866" style="WIDTH: 326px; CURSOR: pointer; HEIGHT: 40px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVzszKlif4yZDDe6rNqr091SA3YQ_QXF2y-YGnmcpZ7M_sgDt2btn6iqshYUCuVEM5lRhApvCPY-nly-VqpA5moTeKoo1uJyp0PX5iAVfY1HHLFdr8PV6ID-T2Re6_Kxvnj1apgcH36nk/s400/fieldref.PNG" border="0" /></span></span></a><br /></div><div><br /></div><div><br /></div><br /><div><span class="Apple-style-span"><span class="Apple-style-span" style="FONT-STYLE: italic"><span class="Apple-style-span" style="font-size:large;"><span class="Apple-style-span" style="TEXT-DECORATION: underline"><span class="Apple-style-span" style="FONT-WEIGHT: bold"><span class="Apple-style-span" style="COLOR: rgb(51,102,255)">Operators:</span></span></span></span></span></span><span class="Apple-style-span" style="FONT-STYLE: italic"><span class="Apple-style-span" style="font-size:large;"><span class="Apple-style-span" style="TEXT-DECORATION: underline"><span class="Apple-style-span" style="FONT-WEIGHT: bold"><span class="Apple-style-span" style="COLOR: rgb(51,102,255)"><br /></span></span></span></span></span></div><div><span class="Apple-style-span" style="COLOR: rgb(51,51,255); FONT-STYLE: italic"><br /></span></div><div><span class="Apple-style-span" style="FONT-STYLE: italic">Eq </span>= equal to<br /></div><div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">Neq </span>= not equal to </div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">BeginsWith </span>= begins with </div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">Contains </span>= contains </div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">Lt </span>= less than </div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">Leq </span>= less than or equal to </div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">Gt </span>= greater than </div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">Geq </span>= greater than or equal to </div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">IsNull </span>= is null </div><br /><div><span class="Apple-style-span" style="FONT-STYLE: italic">IsNotNull </span>= is not null </div><div><br /></div><div><br /></div><br /><div><span class="Apple-style-span" style="TEXT-DECORATION: underline"><span class="Apple-style-span" style="FONT-STYLE: italic"><span class="Apple-style-span" style="COLOR: rgb(51,51,255)"><span class="Apple-style-span" style="FONT-WEIGHT: bold">AND & OR CONDITIONS</span></span></span></span></div><br /><div>Using and & or is very similar to using regular parentheses, between each to operation we need to add AND or OR for example:<br /></div><div><br /></div><div><ul><li><span class="Apple-style-span" style="COLOR: rgb(0,0,153)">AND:</span></li></ul></div><div style="TEXT-ALIGN: center"><span class="Apple-style-span" style="COLOR: rgb(51,51,255)"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMvMtbnRQH_iAT_5vm2gLkvuJZSBJHw69jMlhcLR9SL1zlr86axlM_EBdpuvvUf_BHGaWwqxLFZDVVZhB2OM1eLbydQ4l942RbsW5srb5r4D56-2FZkdx3EYr5ozegJqrgDyMgIPvci4s/s1600-h/and.PNG"><span class="Apple-style-span" style="TEXT-DECORATION: none"><img id="BLOGGER_PHOTO_ID_5311600514991502610" style="WIDTH: 400px; CURSOR: pointer; HEIGHT: 103px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMvMtbnRQH_iAT_5vm2gLkvuJZSBJHw69jMlhcLR9SL1zlr86axlM_EBdpuvvUf_BHGaWwqxLFZDVVZhB2OM1eLbydQ4l942RbsW5srb5r4D56-2FZkdx3EYr5ozegJqrgDyMgIPvci4s/s400/and.PNG" border="0" /></span></a></span><br /></div><br /><div style="TEXT-ALIGN: left">We are using AND between 2 operators and add another tab when we add a new operator.</div><div style="TEXT-ALIGN: left"><br /></div><div style="TEXT-ALIGN: left"><ul><li><span class="Apple-style-span" style="COLOR: rgb(51,51,255)">OR:</span></li></ul></div><div style="TEXT-ALIGN: center"><span class="Apple-style-span" style="COLOR: rgb(51,51,255)"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1oqazjgKQQKVmRLWXU8lNtJs4CiXYBJE0Ioqd5j3YPBjERab1j9IxMdAtHotEzo3EC3ZdqtKGy4drHqFWPxOEiP9ACDWdIrcrhws6gvuSPQI3EZ6eMyZn5vYh3txAjHjy_wMmsLO1ohE/s1600-h/OR.PNG"><span class="Apple-style-span" style="TEXT-DECORATION: none"><span class="Apple-style-span" style="COLOR: rgb(51,51,255)"><img id="BLOGGER_PHOTO_ID_5311601154724988242" style="WIDTH: 400px; CURSOR: pointer; HEIGHT: 103px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1oqazjgKQQKVmRLWXU8lNtJs4CiXYBJE0Ioqd5j3YPBjERab1j9IxMdAtHotEzo3EC3ZdqtKGy4drHqFWPxOEiP9ACDWdIrcrhws6gvuSPQI3EZ6eMyZn5vYh3txAjHjy_wMmsLO1ohE/s400/OR.PNG" border="0" /></span></span></a><br /></span></div><br /><div style="TEXT-ALIGN: left">The same as AND.</div><div style="TEXT-ALIGN: center"><br /></div><div style="TEXT-ALIGN: left"><ul><li><span class="Apple-style-span" style="COLOR: rgb(51,51,255)">AND & OR:</span></li></ul></div><div style="TEXT-ALIGN: center"><span class="Apple-style-span" style="COLOR: rgb(51,51,255)"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6ugyB9AfA7AQIl_B4mrpz1MP8Mc8tPykbpBQYcxx2c0JKqUIqNuDeTPA01W5bNpxNfBUv6NYLZ5jxZlh8CLrzU6rjUbf1ldHguJnGXPWFzcxWQnkMTMsqHrEHa7ziGpA8EJ2gdLAn0Vo/s1600-h/ORAND.PNG"><span class="Apple-style-span" style="TEXT-DECORATION: none"><span class="Apple-style-span" style="COLOR: rgb(51,51,255)"><img id="BLOGGER_PHOTO_ID_5311601786605716962" style="WIDTH: 400px; CURSOR: pointer; HEIGHT: 188px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6ugyB9AfA7AQIl_B4mrpz1MP8Mc8tPykbpBQYcxx2c0JKqUIqNuDeTPA01W5bNpxNfBUv6NYLZ5jxZlh8CLrzU6rjUbf1ldHguJnGXPWFzcxWQnkMTMsqHrEHa7ziGpA8EJ2gdLAn0Vo/s400/ORAND.PNG" border="0" /></span></span></a><br /></span></div><br /><div style="TEXT-ALIGN: left">With AND & OR we are creating brackets, we create each one of the conditions and wrap them with AND/OR.</div><br /><div style="TEXT-ALIGN: left"> </div><br /><div style="TEXT-ALIGN: left"><strong>How to write CAML queries ?<br /></strong></div><br /><div style="TEXT-ALIGN: left">A very useful tool allow you to build yours CAML queries: <strong>U2U Caml Query Builder.</strong></div><br /><div style="TEXT-ALIGN: left">You can download it at :<strong> </strong><a href="http://www.u2u.be/res/Tools/CamlQueryBuilder.aspx">http://www.u2u.be/res/Tools/CamlQueryBuilder.aspx</a></div><br /><div style="TEXT-ALIGN: left"> </div><br /><div style="TEXT-ALIGN: left"><strong>Performance consideration:<br /></strong><br />If your farm is well indexed, retiewing datas using SPquey in the best method to improve performance. See also our post about <a href="http://mosswat.blogspot.com/2009/02/working-with-large-lists-in-office.html">working with large list in Sharepoint</a></div><div style="TEXT-ALIGN: left"> </div></div></div></div></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com3tag:blogger.com,1999:blog-1751470255926145608.post-73128720311357020902009-03-05T11:22:00.000-08:002009-03-05T11:50:51.760-08:00Template List IDAdministrator tasks list : 1200<br />Announcements list : 104<br />Blog Categories list : 303<br />Blog Comments list : 302<br />Blog Posts list : 301<br />Contacts list : 105<br />Custom grid for a list : 120<br />Custom Workflow Process : 118<br />Data Connection library : 130<br />Data sources : 110<br />Discussion board : 108<br />Document library : 101<br />Events list : 106<br />Gantt Tasks list : 150<br />Generic list : 100<br />Issue tracking : 1100<br />Links list : 103<br />List template gallery : 114<br />Master pages gallery : 116<br />Meeting Agenda list : 201<br />Meeting Attendees list : 202<br />Meeting Decisions list : 204<br />Meeting Objectives list : 207<br />Meeting Series list : 200<br />Meeting text box : 210<br />Meeting Things To Bring list : 211<br />Meeting Workspace Pages list : 212<br />No-Code Workflows : 117<br />Personal document library : 2002<br />Picture library : 109<br />Portal Sites list : 300<br />Private document library : 2003<br />Site template gallery : 111<br />Survey : 102<br />Tasks list : 107<br />User Information list : 112<br />Web Part gallery : 113<br />Wiki Page library : 119<br />Workflow History : 140<br />XML Form library : 115<br /><br />Reference : <a href="http://simeonlobo.wordpress.com/2008/02/27/sharepoint-list-template-ids/">http://simeonlobo.wordpress.com/2008/02/27/sharepoint-list-template-ids/</a>Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-52704521737489501192009-03-05T10:36:00.000-08:002009-03-05T11:16:06.662-08:00Content Type ID<p><span style="font-size:85%;"><strong>Content Types ID<br /></strong><br />Item<br />0×01<br />Create a new list item<br /><br /><br />Reusable HTML<br />0×01002CF74A4DAE39480396EEA7A4BA2BE5FB<br />Reusable HTML<br /><br />Reusable Text<br />0×01004D5A79BAFA4A4576B79C56FF3D0D662D<br /><br />Page Output Cache<br />0×010087D89D279834C94E98E5E1B4A913C67E<br />Page Output Cache is a system content type template created by the Publishing Resources feature to define cache profiles.<br /><br />Document<br />0×0101<br />Create a new document.</span></p><p><span style="font-size:85%;">System Page Layout<br />0×01010007FF3E057FA8AB4AA42FCB67B453FFC1<br />System Page Layout is a system content type template created by the Publishing Resources feature, and it cannot be modified. To add columns to page layouts in the page layouts gallery and master page gallery, update the Page Layout content type template.<br /><br />Page Layout<br />0×01010007FF3E057FA8AB4AA42FCB67B453FFC100E214EEE741181F4E9F7ACC43278EE811<br />Page Layout is a system content type template created by the Publishing Resources feature. All page layouts will have the column templates from Page Layout added.<br /><br />System Master Page<br />0×0101000F1C8B9E0EB4BE489F09807B2C53288F<br />System Master Page is a system content type template created by the Publishing Resources feature, and it cannot be modified. To add columns to master pages in the page layouts gallery and master page gallery, update the Master Page content type template.<br /><br />Publishing Master Page<br />0×0101000F1C8B9E0EB4BE489F09807B2C53288F0054AD6EF48B9F7B45A142F8173F171BD1<br />Master Page is a system content type template created by the Publishing Resources feature. All master pages will have the column templates from Master Page added.<br /><br />Office Data Connection File<br />0×010100629D00608F814DD6AC8A86903AEE72AA<br /><br />Universal Data Connection File<br />0×010100B4CBD48E029A4AD8B62CB0E41868F2B0<br />Provide a standard place for applications, such as Microsoft Office InfoPath, to store data connection information.<br /><br />System Page<br />0×010100C568DB52D9D0A14D9B2FDCC96666E9F2<br />System Page is a system content type template created by the Publishing Resources feature, and it cannot be modified. To add columns to the Pages library, update the Page content type template.<br /><br />Page<br />0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39<br />Page is a system content type template created by the Publishing Resources feature. The column templates from Page will be added to all Pages libraries created by the Publishing feature.<br /><br />Article Page<br />0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44DArticle Page is a system content type template created by the Publishing Resources feature. It is the associated content type template for the default page layouts used to create article pages in sites that have the Publishing feature enabled.<br /><br />Welcome Page<br />0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4<br />Welcome Page is a system content type template created by the Publishing Resources feature. It is the associated content type template for the default page layout used to create welcome pages in sites that have the Publishing feature enabled.<br /><br />Redirect Page<br />0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900FD0E870BA06948879DBD5F9813CD8799Redirect Page is a system content type template created by the Publishing Resources feature. It is the associated content type template for the redirect page layout<br /><br />Form<br />0×010101<br />Fill out this form.<br /><br />Picture<br />0×010102<br />Upload an image or a photograph.<br />Unknown Document Type0×010104Allows users to upload documents of any content type to a library. Unknown documents will be treated as their original content type in client applications.<br /><br />Master Page<br />0×010105<br />Create a new master page.<br /><br />User Workflow Document<br />0×010107<br />Items for use in user defined workflows.<br /><br />Wiki Page<br />0×010108<br />Create a new wiki page.<br /><br />Basic Page<br />0×010109<br />Create a new basic page.<br /><br />Web Part Page<br />0×01010901<br />Create a new Web Part page.<br /><br />Link to a Document<br />0×01010A<br />Create a link to a document in a different location.<br /><br />Dublin Core Columns<br />0×01010B<br />The Dublin Core metadata element set.<br /><br />Event<br />0×0102<br />Create a new meeting, deadline or other event.<br /><br />Issue<br />0×0103<br />Track an issue or problem.<br /><br />Announcement<br />0×0104<br />Create a new news item, status or other short piece of information.<br /><br />Link<br />0×0105<br />Create a new link to a Web page or other resource.<br /><br />Contact<br />0×0106<br />Store information about a business or personal contact.<br /><br />Message<br />0×0107<br />Create a new message.<br /><br />Task<br />0×0108<br />Track a work item that you or your team needs to complete.<br /><br />Workflow Task<br />0×010801<br />A work item created by a workflow that you or your team needs to complete.<br /><br />Office SharePoint Server Workflow Task<br />0×01080100C9C9515DE4E24001905074F980F93160<br />A work item created by a workflow that you or your team needs to complete.<br /><br />Administrative Task<br />0×010802<br />An administrative work item that an administrator needs to complete.<br /><br />Workflow History<br />0×0109<br />The history of a workflow.<br /><br />Person<br />0×010A<br /><br />SharePointGroup<br />0×010B<br /><br />DomainGroup<br />0×010C<br /><br />Post<br />0×0110<br />Create a new blog post.<br /><br />Comment<br />0×0111<br />Create a new blog comment.<br /><br />Far East Contact<br />0×0116<br />Store information about a business or personal contact.<br /><br />Folder<br />0×0120<br />Create a new folder.<br /><br />RootOfList<br />0×012001<br /><br />Discussion<br />0×012002<br />Create a new discussion topic.<br /><br />Reference: </span><a href="http://claytonj.wordpress.com/category/office-12/moss-2007/"><span style="font-size:85%;">http://claytonj.wordpress.com/category/office-12/moss-2007/</span></a></p>Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-83830291979086406022009-03-05T00:46:00.001-08:002009-03-05T00:48:09.622-08:00WebService "Service Unavailable" error messageWhen changing the application pool user it is important to add the user to the IIS_WPG group.<br /><br />Yesterday, we so this error message and found the solution <a href="http://support.microsoft.com/kb/823552">here</a> which says that the reason for this kind of error message may be because one of the following occurs:<br /><ol><li>The application pool is not running. </li><li>The application pool account uses an incorrect password. </li><li>The application pool account is not a member of both the IIS_WPG group and the STS_WPG group on the server.</li></ol><p>In our case it was the third one, after adding the application pool user to the IIS_WPG group the WebService run like a magic.....</p><p>Liron</p>Liron Leybovichhttp://www.blogger.com/profile/00183176081710984245noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-34121727326944550592009-03-04T01:07:00.000-08:002009-03-04T01:22:01.562-08:00Off Topic: MOSS S.W.A.T Merchandise :-)(LOL)<br /><br />We've just printed out few MOSS S.W.A.T T-Shirts for our team.....<br /><br /><table border="0"><tbody><tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOfcD4Z1FhdGAcskpq7ksw1FgxyEnU3MCkU9j7DOHc73h4nVVxcLZabu8knxtymH3Q2EMUPAhr0w5FDiBrRvaAiWVHEmMadCsMehTFAeUvY3Yb52a47oxKvqytV2o5bpgWMunYPP4MnT4/s1600-h/MOSS_SWAT_TShirt_FRONT.jpg"><img id="BLOGGER_PHOTO_ID_5309258909023968370" style="WIDTH: 197px; CURSOR: hand; HEIGHT: 209px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOfcD4Z1FhdGAcskpq7ksw1FgxyEnU3MCkU9j7DOHc73h4nVVxcLZabu8knxtymH3Q2EMUPAhr0w5FDiBrRvaAiWVHEmMadCsMehTFAeUvY3Yb52a47oxKvqytV2o5bpgWMunYPP4MnT4/s320/MOSS_SWAT_TShirt_FRONT.jpg" border="0" /></a></td><br /><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBl7eczvdrpA5QltcG628m1Rxc1TWUVIhsD717EzWismP_-r0uJw-6cjDNJ6VsIGMLP_D3VzFttpUQk_9ctsk5C24dxGcNcNX58WDW88JGxdtH2uLPrLVDZtU0S9B23dTv7nji8bNinDk/s1600-h/MOSS_SWAT_TShirt_BACK.jpg"><img id="BLOGGER_PHOTO_ID_5309257942219433042" style="WIDTH: 192px; CURSOR: hand; HEIGHT: 208px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBl7eczvdrpA5QltcG628m1Rxc1TWUVIhsD717EzWismP_-r0uJw-6cjDNJ6VsIGMLP_D3VzFttpUQk_9ctsk5C24dxGcNcNX58WDW88JGxdtH2uLPrLVDZtU0S9B23dTv7nji8bNinDk/s320/MOSS_SWAT_TShirt_BACK.jpg" border="0" /></a></td><br /></tr><br /><br /></tbody></table><br />If you are interested to be the owner of this T-Shirt please let us know<br /><br />LironLiron Leybovichhttp://www.blogger.com/profile/00183176081710984245noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-35032602030255589432009-03-01T08:47:00.000-08:002009-03-01T08:58:45.384-08:00Update Moss Web.Config V2The last week we spoke about another way to update sharepoint web.config by using custom xml.<br />I readed an excellent post of <a href="http://www.sharepointofview.fr/gat/archive/2008/05/09/modifier-tous-les-web-config-de-vos-applications-sans-code-1.aspx">Gaetan Bouveret</a> that give interesting details:<br /><br />Specifically, he explains that we can add an "id" attribut to each node to prevent adding sames nodes twice<br /><br />Samples :<br /><br />To add a node like add appsetting:<br /><br /><pre class="alt"><add path=<span class="str">"configuration"</span> id=<span class="str">"{72DB2C92-8BC1-4767-A12C-94B67D46D0CF}"</span>></pre><br /><pre> <appSettings /></pre><br /><pre class="alt"> </add></pre><br /><br />To update a node :<br /><br /><pre class="alt"><update path=<span class="str">"configuration/system.web"</span>></pre><br /><pre> <siteMap defaultProvider=<span class="str">"CurrentNavSiteMapProvider"</span> enabled=<span class="str">"true"</span>/></pre><br /><pre class="alt"></update></pre><br /><br /><br />To delete node :<br /><br /><p> <remove path=<span class="str">"configuration/SharePoint/RuntimeFilter"</span> <br />id=<span class="str">"{0582988F-9C26-4990-8672-0099F4567B03}"</span> /></p><br /><br />Note: The "id" attribut is very important to prevent adding same nodes twice.Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-22234977657712321712009-02-28T09:00:00.000-08:002009-03-01T02:12:38.799-08:00How To Copy Permissions Between Site CollectionsHi again,<div><br /></div><div>One of the more challenging issues in MOSS is permissions, specially if we need to move them between site collections.</div><div><br /></div><div>To add permissions to item\folder\list\site we add <span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPRoleAssignment </span>that contains <span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPUser </span>(as <span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPPincipal</span>), and <span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPRoleDefinition </span>that contain the the BasePermissions or the Types (reader/contributor...).</div><div><br /></div><div>Each role is have diffrent parameters in each site collection, for example my user can be in one site collection <span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="color: rgb(255, 102, 0);">1;#elad</span></span> and in the other can be<span class="Apple-style-span" style="color: rgb(255, 102, 0);"> </span><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="color: rgb(255, 102, 0);">5;#elad</span></span>, the same user but a diffrent id. the same is for definition, contributor for example have the same base permissions in every site collection but have a differnt ID.</div><div><br /></div><div>So what to do... ?</div><div><br /></div><div>It is eazy, </div><div>1. Create a new instant of your role user like this:</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 153, 0);">// role is the role assignment from the old site collection.</span></div><div><span class="Apple-style-span" style="color: rgb(102, 204, 204);">SPUser </span>user = role.Member as <span class="Apple-style-span" style="color: rgb(102, 204, 204);">SPUser</span>;<br /></div><div><br /></div><div>2. Than create a new role assinment</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 153, 0);">// web is the site in the new site collection</span></div><div><span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPRoleAssignment </span>roleAssignment = new <span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPRoleAssignment</span>(<br /></div><div> web.EnsureUser(user.LoginName) as <span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPPrincipal</span>); </div><div><br /></div><div>Why EnsureUser ? </div><div>The EnsureUser method will chack if the user exist in the corrent site and if not will create him as Limited Access permission. (10x to Michael Assouline that show me this method).</div><div><br /></div><div>than add the role definitions to the new role assignment,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span><br /></div><div><div>foreach (<span class="Apple-style-span" style="color: rgb(0, 204, 204);">SPRoleDefinition </span>roleDefinition <span class="Apple-style-span" style="color: rgb(51, 51, 255);">in </span>role.RoleDefinitionBindings)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-style-span" style="color: rgb(0, 153, 0); ">// we cann't add Limited Access</span><br /></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if (roleDefinition.Type != SPRoleType.Guest)</div><div> {</div></div><div><span class="Apple-tab-span" style="white-space:pre"> </span> definition = web.RoleDefinitions.GetByType(roleDefinition.Type);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> roleAssignment.RoleDefinitionBindings.Add(definition);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div>}</div><div><br /></div><div>3. And now just add the new role to the item,</div><div><br /></div><div>item.RoleAssignments.Add(roleAssignment); <br /></div><div><br /></div><div><br /></div></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com1tag:blogger.com,1999:blog-1751470255926145608.post-88638452864030891682009-02-27T00:37:00.001-08:002009-02-27T00:42:13.068-08:00Server and Site Architecture: Object Model<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8cQ-iWLHiThHORH8zQljEF9pFmELOPSb2PvzcamiVodWvjEFP1Dm889-BePaCJ1PXwRZeNtZarKP8Zy7mLXWzn-VTQZvK4jVndtbI5o6So-3IcUBJOpBsxlIWBgtbVBJY2UJNfTetYnU/s1600-h/map.gif"><img id="BLOGGER_PHOTO_ID_5307394226766549954" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 320px; CURSOR: hand; HEIGHT: 293px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8cQ-iWLHiThHORH8zQljEF9pFmELOPSb2PvzcamiVodWvjEFP1Dm889-BePaCJ1PXwRZeNtZarKP8Zy7mLXWzn-VTQZvK4jVndtbI5o6So-3IcUBJOpBsxlIWBgtbVBJY2UJNfTetYnU/s320/map.gif" border="0" /></a><br /><div>An interesting article about Server and Site Architecture Object Model<br /></div><br /><div></div><br /><div><br /><br /> </div><div> </div><div> </div><div> </div><div> </div><div> </div><div> </div><div> </div><div> </div><div> </div><div> </div><div><br /> </div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div><a href="http://msdn.microsoft.com/en-us/library/ms473633.aspx">http://msdn.microsoft.com/en-us/library/ms473633.aspx</a></div><br /><div></div>Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-83678744204716689152009-02-25T13:32:00.000-08:002009-02-26T00:35:29.659-08:00Update Moss Web.Config<strong>1. Programatically using Sharepoint API</strong><br /><br />We can use <strong>SPWebConfigModification</strong> object like this:<br /><br /><em><strong>This code update CustomErrors value</strong></em><br /><br /><span style="font-size:85%;">// Get an instance of my local web application<br />SPWebApplication webApp = new SPSite("http://localhost").WebApplication;<br />// Create my new modification to set the mode attibute to "Off".<br />// Example: <customerrors mode="Off"><br />SPWebConfigModification modification = new SPWebConfigModification("mode", "system.web/customErrors");<br />modification.Owner = "SimpleSampleUniqueOwnerValue"; </span><br /><span style="font-size:85%;">modification.Sequence = 0; modification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureAttribute; </span><br /><span style="font-size:85%;">modification.Value = "Off"; </span><br /><span style="font-size:85%;">// Add my new web.config modification. </span><br /><span style="font-size:85%;">webApp.WebConfigModifications.Add(modification); </span><br /><span style="font-size:85%;">// Save web.config changes.</span><br /><span style="font-size:85%;">webApp.Farm.Services.GetValue<spwebservice>().ApplyWebConfigModifications(); </span><br /><span style="font-size:85%;">// Serialize the web application state and propagate changes across the farm.</span><br /><span style="font-size:85%;">webApp.Update(); </span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;"></span><br /><em><strong>This code Add safe control entry to the web.config :</strong></em><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">SPWebService myService = SPWebService.ContentService;<br />SPWebConfigModification myModification = new SPWebConfigModification();<br />myModification.Path = "configuration/SharePoint/SafeControls";<br />myModification.Name = "SafeControl[@Assembly='MyCustomAssembly'][@Namespace='MyCustomNamespace'][@TypeName='*'][@Safe='True']";<br />myModification.Sequence = 0;<br />myModification.Owner = WebConfigModificationFeatureReceiver.OwnerId;<br />myModification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;<br />myModification.Value = "<safecontrol safe="'True'" typename="'*'" namespace="'MyCustomNamespace'" assembly="'MyCustomAssembly'">";<br />myService.WebConfigModifications.Add(myModification);myService.Update(); myService.ApplyWebConfigModifications();</span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">References :<br /><a href="http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32">http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32</a><br /><a href="http://blogs.devhorizon.com/reza/?p=459">http://blogs.devhorizon.com/reza/?p=459</a><br /><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebconfigmodification.aspx">http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebconfigmodification.aspx</a></span><br /><span style="font-size:85%;"></span><br /><br /><strong>2. Deploying custom XML File in the Sharepoint CONFIG folder ( C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG</strong><br /><br /><span style="font-size:85%;">Steps to perform it:</span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">1. Write an xml file called webconfig.[myname].xml<br /><br /></span><span style="font-size:85%;">2. Add yours web.config sections into "actions" node:<br /><br /><p><?xml version=”1.0″ encoding=”utf-8″ ?><br /><br /><actions><br /><br /><add path=”configuration/appSettings”><br /><br /><add key=”MyFilePath” value=”C:\temp\path\” /><br /><br /></add><br /><br /><add path=”configuration”><br /><br /><connectionStrings /><br /><br /></add><br /><br /><add path=”configuration/connectionStrings”><br /><br /><remove name=”MySqlServerConnection” /><br /><br /><add name=”MySqlServerConnection” connectionString=”server=[server];database=<br /><br />db];Integrated Security=SSIP;” providerName=”System.Data.SqlClient” /><br /><br /></add><br /><br /></actions></p><br /><br /></span><br /><span style="font-size:85%;">3. Copy your xml file into C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG folder<br /></span><br /><span style="font-size:85%;">When you'll create a new web application or extend web application the web.config will be updated with yours sections by merging them into the web.config.</span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">If you want to immediately apply the changes you have to run : stsadm –o copyappbincontent</span><br /><span style="font-size:85%;"></span><br />Reference: <a href="http://claytonj.wordpress.com/2008/03/19/custom-webconfig-settings-in-sharepoint/"><span style="font-size:85%;">http://claytonj.wordpress.com/2008/03/19/custom-webconfig-settings-in-sharepoint/</span></a><span style="font-size:85%;"><br /></span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;"><span style="font-size:100%;">3. See also</span> : <a href="http://blog.thekid.me.uk/archive/2007/03/24/web-config-modification-manager-for-sharepoint.aspx">http://blog.thekid.me.uk/archive/2007/03/24/web-config-modification-manager-for-sharepoint.aspx</a></span><br /><span style="font-size:85%;"><br /><br /><br /></span><span style="font-size:85%;"></span><span style="font-size:85%;"></span><span style="font-size:85%;"></span>Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-58167731486271444442009-02-22T05:51:00.000-08:002009-02-22T07:18:51.699-08:00Document library internal fields<span class="Apple-style-span" style="font-size: small;">Recently i was needed to use OpenXml in Moss (hopefully i will write on this soon), one of the issue i needed to handle was the fact that it will only work of office 2007 files and not on pdf/office 2003/txt files and more.</span><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;">After a short google seach i found all the relevant suffix (</span><a href="http://msdn.microsoft.com/en-us/library/aa338205.aspx"><span class="Apple-style-span" style="font-size: small;">http://msdn.microsoft.com/en-us/library/aa338205.aspx</span></a><span class="Apple-style-span" style="font-size: small;"> , </span><a href="http://office.microsoft.com/en-us/word/HA100069351033.aspx"><span class="Apple-style-span" style="font-size: small;">http://office.microsoft.com/en-us/word/HA100069351033.aspx</span></a><span class="Apple-style-span" style="font-size: small;">), so all i needed is the file suffix. However, i was very </span><span class="Apple-style-span" style=" "><span class="Apple-style-span" style="font-size: small;">surprised </span></span><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-size: small;">to </span></span><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-size: small;">find out that non of the SPFile properties or the SPListItem properties contains the document suffix (the last one make sense).</span></span></div><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-size: small;">Then i remembered that sharepoint document library (as so list) have </span><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">hidden/frombase/readonly</span></span><span class="Apple-style-span" style="font-size: small;"> fields that contains all kind of parameters, like:</span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-size: small;"><br /></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">BaseName </span></span><span class="Apple-style-span" style="font-size: small;">- D</span><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">ocument prefix.</span></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">FileLeafRef </span></span><span class="Apple-style-span" style="font-size: small;">- P</span><span class="Apple-style-span" style="font-style: italic; "><span class="Apple-style-span" style="font-style: normal; "><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">refix.Suffix.</span></span></span></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">EncodedAbsUrl </span></span><span class="Apple-style-span" style="font-size: small;">-</span><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;"> Full document url.</span></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">DocIcon </span></span><span class="Apple-style-span" style="font-size: small;">- D</span><span class="Apple-style-span" style="font-style: italic; "><span class="Apple-style-span" style="font-style: normal; "><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">ocument suffix.</span></span></span></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">Author </span></span><span class="Apple-style-span" style="font-size: small;">- C</span><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">reated by.</span></span><span class="Apple-style-span" style="font-size: small;"><br /></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">Editor </span></span><span class="Apple-style-span" style="font-size: small;">- M</span><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">odified by.</span></span><span class="Apple-style-span" style="font-size: small;"><br /></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">FileDirRef </span></span><span class="Apple-style-span" style="font-size: small;">- D</span><span class="Apple-style-span" style="font-style: italic; "><span class="Apple-style-span" style="font-style: normal; "><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">irectory id and directory name (seperated </span><span class="Apple-style-span" style=" font-style: normal; "><span class="Apple-style-span" style=" font-style: italic; "><span class="Apple-style-span" style="font-size: small;">by ;#).</span></span></span></span></span></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">ContentTypeId </span></span><span class="Apple-style-span" style="font-size: small;">- C</span><span class="Apple-style-span" style="font-style: italic; "><span class="Apple-style-span" style="font-style: normal; "><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">ontent type id.</span></span></span></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">FileSizeDisplay </span></span><span class="Apple-style-span" style="font-size: small;">- F</span><span class="Apple-style-span" style="font-style: italic; "><span class="Apple-style-span" style="font-style: normal; "><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">ile size.</span></span></span></span></span></div><div><span class="Apple-style-span" style=" ;"><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size: small;">GUID </span></span><span class="Apple-style-span" style="font-size: small;">- F</span><span class="Apple-style-span" style="font-style: italic; "><span class="Apple-style-span" style="font-style: normal; "><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">ile </span></span><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-size: small;">guid</span></span><span class="Apple-style-span" style="font-size: small;">.</span></span></span></span></div><div><span class="Apple-style-span" style="font-size: small;"><br /></span></div><div><span class="Apple-style-span" style="font-size: small;">So i used the DocIcon field to get the suffix and to check if the document support OpenXml.</span></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-87512571412822261262009-02-22T05:01:00.000-08:002009-03-01T02:08:47.967-08:00Not enough details in error messageWe all have got the famous error message "An unexpected error has occurred", or a message that was to short like "The file is not exist".<br /><br />In most cases it will be very helpful if we know more details, specially when getting "An unexpected error has occurred" then doesn't help us at all.<br /><br />So to get more details open the web.config, find the root <span style="font-weight:bold;">configuration\SharePoint\SafeMode</span> and change the attribute <span class="Apple-style-span" style="font-weight: bold;">CallStack</span> from <span class="Apple-style-span" style="font-style: italic;">false </span>to <span class="Apple-style-span" style="font-style: italic;">true</span>. Then find <span class="Apple-style-span" style="font-weight: bold;">configuration\system.web\customErrors </span>and change the attribute <span class="Apple-style-span" style="font-weight: bold;">mode </span>from <span class="Apple-style-span" style="font-style: italic;">on </span>to <span class="Apple-style-span" style="font-style: italic;">off</span>.<div><br /></div><div>Now you will get more details to pinpoint your exception.<br /><div><br /></div><div>See also:<a href="http://littletalk.wordpress.com/2008/09/30/more-details-about-an-unexpected-error-has-occurred-in-wss-v3/"> http://littletalk.wordpress.com/2008/09/30/more-details-about-an-unexpected-error-has-occurred-in-wss-v3/</a></div></div>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-87505742049481302162009-02-21T12:00:00.000-08:002009-02-21T13:02:32.383-08:00Operation is not valid due to the current state of the object<span style="font-family:arial;">It's one of the common errors that we get when we developp with sharepoint object model.<br /><br />To resolve this error you can check :<br /><br /><strong>1. Application Pool Identity</strong></span><br /><span style="font-family:arial;"></span><br /><span style="font-family:arial;">When you use sharepoint object model from WEB SERVICE , you have to check that the identity of it application pool has the required rights to call the MOSS methods. In particular, the right to open site(SPite site = new SPsite).<br /></span><br /><span style="font-family:arial;"><strong>2. Disposing of yours Sharepoint Objects</strong><br /><br />Check that you have correctly disposed yours Sharepoint Objects.<br />(see </span><a href="http://msdn2.microsoft.com/en-us/library/aa973248.aspx"><span style="font-family:arial;">Best Practices: Using Disposable Windows SharePoint Services Objects</span></a><span style="font-family:arial;"> )</span><br /><span style="font-family:Arial;"></span><br /><span style="font-family:arial;">Specifically, if you writed code like this:</span><br /><span style="font-family:arial;font-size:85%;">using (SPSite site = new SPSite(SPContext.Current.Site))<br />{<br />using (SPWeb web = site.OpenWeb(site.OpenWeb()))<br />{<br />string ItemID = web.Lists["myListName"].Items[0]["myItemID"].ToString();<br />}<br />}</span><br /><span style="font-family:arial;"></span><br /><span style="font-family:arial;">It's preferable to modify this code by:</span><br /><span style="font-family:arial;font-size:85%;">try<br />{<br />SPWeb webContext = null;<br />SPSecurity.RunWithElevatedPrivileges(delegate()<br />{<br />using (SPSite site = new SPSite(webContext.Site.ID))<br />{<br />using (SPWeb web = site.OpenWeb(webContext.ID))<br />{<br />string ItemID = web.Lists["myListName"].Items[0]["myItemID"].ToString();<br />}<br />}<br />});<br />}<br />catch (Exception ex)<br />{<br />}<br />finally<br />{<br />if (webContext != null)<br />webContext.Dispose();<br />}</span>Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-68794524044841440432009-02-18T10:29:00.000-08:002009-02-18T11:52:23.607-08:00How to add an PDF icon to MOSS document libraries<span style="font-family:arial;">To specify the .gif file that you want to use for the icon that represents PDF documents in yours Document librairies, follows theses steps:<br /></span><span style="font-family:arial;"><br />1. Copy the .gif file that you want to use for the icon to the following folder on the server:<br />Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Template\Images</span><br /><br /><span style="font-family:arial;">2. Edit the Docicon.xml file (located on \Program Files\Common Files\Microsoft Shared\Web server extensions\60\Template\Xml or \Program Files\Common Files\Microsoft Shared\Web server extensions\12\Template\Xml ) and add the following line in the < ByExtension > section </span><br /><br /><span style="font-family:arial;">< key="pdf" value="MyPicture.gif"> </span><br /><span style="font-family:arial;">*replace "MyPicture.gif" by the name of your picture<br /></span><span style="font-family:arial;"><br />3. IISRESET</span><br /><span style="font-family:Arial;"></span><br /><span style="font-family:Arial;">Reference : <a href="http://support.microsoft.com/kb/837849">http://support.microsoft.com/kb/837849</a></span>Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-21183218792667795542009-02-16T09:46:00.000-08:002009-02-16T10:00:48.186-08:00CreatePage doesn't workA strange behaviour we recently bumped into was that the "CreatePage" action redirect a user to the "Access Denide" page eventhough this user is a member of the site contributors.<br /><br />In order to solve this situation follow these steps:<br /><br />1. Go to Site Actions -> Site Settings ->Modify all site settings<br />2. Go to Galleries -> Master pages and page layouts<br />3. From the list toolbar, select Settings -> Document library settings<br />4. Select permissions for this document library<br />5. Add 'Restricted Read' access to the required groupsUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-55688973677302351602009-02-16T03:58:00.000-08:002009-02-16T04:39:54.902-08:00How to add SharePoint aspx template to a document library?<p style="font-size:12px; font-family:Tahoma"><br />SharePoint allows us to upload to a document library an aspx and html custom pages and view them as SharePoint page.<br />However, when we tried to upload a custom page with SharePoint master page (like~/_layouts/application.master) or code it didn't worked, and we got a "Configuration Error" page.<br /><br /></p><p style="font-size:12px; font-family:Tahoma">The solution:<br /></p><p style="font-size:12px; font-family:Tahoma"><br />1. Add the following to the custom page:<br /></p><p style="font-size:12px; font-family:Tahoma"><span class="Apple-style-span" style="font-weight: bold;"><%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"<br />Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,<br />PublicKeyToken=71e9bce111e9429c" %><br /><br /><%@ Register Tagprefix="WebPartPages"<br />Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint,<br />Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><br /><br /><%@<br />Register Tagprefix="OSRVWC" Namespace="Microsoft.Office.Server.WebControls"<br />Assembly="Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral,<br />PublicKeyToken=71e9bce111e9429c" %><br /><br /><%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls"<br />Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral,<br />PublicKeyToken=71e9bce111e9429c" %><br /><br /><%@ Register Tagprefix="SEARCHWC"<br />Namespace="Microsoft.Office.Server.Search.WebControls" Assembly="Microsoft.Office.Server.Search,<br />Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><br /><br /><%@<br />Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls"<br />Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral,<br />PublicKeyToken=71e9bce111e9429c" %></span><o:p></o:p></p><p></p><p style="font-size:12px; font-family:Tahoma"><br />2. Then open the web.config and replace the tab <span><PageParserPath/> </span> with the following path:</pageparserpath></p><p style="font-size:12px; font-family:Tahoma"><span><span class="Apple-style-span" style="font-weight: bold;"><PageParserPath<br />VirtualPath="/sites/*" IncludeSubFolders="true" CompilationMode="Always"<br />AllowServerSideScript="true" /></span></span></p><p style="font-size:12px; font-family:Tahoma"><br />See also : <a style="font-size:12px" href="http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=242">http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=242</a><br /></p><br /><p></p>Elad Gutmanhttp://www.blogger.com/profile/07870649278230960051noreply@blogger.com0tag:blogger.com,1999:blog-1751470255926145608.post-16483487084321376162009-02-15T15:22:00.000-08:002009-02-18T10:48:16.657-08:00Working with large lists in Office SharePoint Server 2007Microsoft published a very interresting white paper about working with large lists in moss:<br /><a href="http://technet.microsoft.com/en-us/library/cc262813.aspx">http://technet.microsoft.com/en-us/library/cc262813.aspx</a><br />This white paper compare performance of differents methods that are used when working with SPList:<br /><ul><li>SPList with For/Each </li><li>SPList with SPQuery </li><li>SPList with DataTable</li><li>SPListItems with DataTable </li><li>Lists Web service</li></ul><strong>The results show that using SPQuery with indexed columns are recommended to improve performance of retriewing datas from large Sharepoint List.</strong>Michael Assoulinehttp://www.blogger.com/profile/16748056476257373477noreply@blogger.com0