<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>MOSS 2007</title>
        <link>http://geekswithblogs.net/CalinTatar/category/10170.aspx</link>
        <description>MOSS 2007</description>
        <language>en-US</language>
        <copyright>CalinTatar</copyright>
        <managingEditor>tatar_calin@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Automatically add Sharepoint subfolders when adding a new Folder Content Type</title>
            <link>http://geekswithblogs.net/CalinTatar/archive/2009/06/07/automatically-add-sharepoint-subfolders-when-adding-a-new-folder-content.aspx</link>
            <description>&lt;p&gt;&lt;font size="2"&gt;Last week I was asked on one of my CodeProject article, about how to implement a Sharepoint feature that will automatically add subfolders to a parent folder in a document library.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;To add subfolders when a new Folder(or derived Content Type from Folder) was created, we have to write a feature, that will handle the &lt;strong&gt;ItemAdded&lt;/strong&gt; event. When this event gets fired, we can get the current folder item and add subfolders to it.&lt;br /&gt;
&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;The following feature adds subfolders( the ones from folders array) when a new Project Folder is created.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="505" alt="SubFoldersCreatorFeature" width="900" src="/images/geekswithblogs_net/CalinTatar/SubFoldersFeaature/SubFoldersCreatorFeature.png" /&gt;&lt;/p&gt;
&lt;p&gt;Basically, what the above method is doing is:&lt;/p&gt;
&lt;p&gt;- we get the current document library that we are working on.&lt;/p&gt;
&lt;p&gt;- test if the current Item is derived from our Content Type; with this we can restrict the feature to work only on some of the folder content types&lt;/p&gt;
&lt;p&gt;- by getting the url of the current folder, we can add a new folder on the current &lt;strong&gt;SPDocumentLibrary&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Calin Tatar&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132664"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132664" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/CalinTatar/aggbug/132664.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>CalinTatar</dc:creator>
            <guid>http://geekswithblogs.net/CalinTatar/archive/2009/06/07/automatically-add-sharepoint-subfolders-when-adding-a-new-folder-content.aspx</guid>
            <pubDate>Sun, 07 Jun 2009 16:48:06 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/CalinTatar/comments/132664.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/CalinTatar/archive/2009/06/07/automatically-add-sharepoint-subfolders-when-adding-a-new-folder-content.aspx#feedback</comments>
            <slash:comments>16</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/CalinTatar/comments/commentRss/132664.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>