New SharePoint Web Part: What's New

UPDATED HERE!!

UPDATED: http://weblogs.asp.net/jan/archive/2004/03/11/88118.aspx

Many people have asked me how they could display new or changed items on a SharePoint site in a web part. This functionality isn't available, but since SharePoint is very extensible it's quite easy to create such a web part. So I've added a new web part to the Leadit.SharePoint.Essentials collection: WhatsNew.

    

By default items from all list on the SharePoint site are checked for new ones, but you can specify which lists you want to exclude by using the “Exclude lists” property (separate lists with the “;“ character). Most of the lists in SharePoint have a Title field, but there are a few exceptions (like Contacts and Links). So by default the What's New web part will display the value of Title field of each item, but in the “List fields” property you can specify for each list what field to display. The default value for this property is “Contacts=Last Name;Links=URL;”, this means that for the Contacts list, the Last Name property will be used, and for the Links list, the URL property. The “Items to display” property speaks for itself I think, just like the “Show date” and “Item icon URL” properties.

The code (which you can download) is pretty straight forward but my main concern was performance. If there are huge lists on the site, the performance could be pretty bad. But the SharePoint object model offers a nice solution for this; using a SPQuery object you can define your own queries that can be executed for a specific list. You can define the sort order and the number of items to fetch: perfect!
SPQuery query = new SPQuery();
query.Query = "<Query><OrderBy><FieldRef Name ='Modified' Ascending='FALSE'/></OrderBy></Query>";
query.RowLimit = (uint)this.ItemsToDisplay;

I've put this web part in the Leadit.SharePoint.Essentials library, that has three other web parts (for a more detailed description check my previous post):

  • Navigation
  • MyAlerts
  • Breadcrumbs

Downloads:

To install these web parts: copy the DLL into the BIN folder (or put it in the GAC), copy the DWP files in the WPCATALOG folder and add the following line to the SafeControls section of the Web.Config:
<SafeControl Assembly="Leadit.SharePoint.Essentials, Version=1.1.0.0, Culture=neutral, PublicKeyToken=6f708acd0ffbe583" Namespace="Leadit.SharePoint.Essentials" TypeName="*" Safe="True" />
If you have any questions, remarks, requests,... please let them know! Just drop me a line, or place a comment.

63 Comments

  • Could be handy :) Nice work.

  • OK, I know this can't be very complicated but I'm having trouble getting this to work. I've copied the dll to the /bin directory at the root of my WSS server. I've tried uploading various dwp files and dropping the web part on a page, and each time I get the &quot;Web Part appears to be causing a problem&quot; message. Any ideas?

  • p.s. I added the control into web.config as well.

  • Could you provide the exact paths where the .dwp and .dll files should go? For both the GAC and BIN methods too. That'd be great.

  • I'd like to confirm the need for more information about where the GAC is; where the WPCATALOG is and where the web.config file is.



    Those of us who only use (rather than create) web parts haven't a clue about the locations of these bits - heck I can only guess that the GAC is the Global Catalog, but if so what does the A stand for?

  • I should perhaps also have said that this newest web part is something that I am sure lots of users are demanding from their WSS site administrators! I know it is something I want to have ready for them.



    The fact that it is available (as a free web part) may even push the use of WSS rather than STS 1.0 which would be a very good thing (I'm suffering from them not wanting to move).

  • One limitation with SPSv2, however, is that &quot;Portal Listings&quot; within an area are NOT classed as a list and do not have a list ID - therefore they are not picked up by tools such as this.



    I definitely recommend NOT using Portal Listings if you wish to interract with the data in any way.

  • To continue on not being able to get this to work, I've added the control to web.config, moved the .dll into /bin, uploaded the .dwp file via the browser, dropped the web parts onto pages and get a &quot;problem web part&quot; error. Additionally, I can view the following in event viewer:

    Request for the permission of type Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c failed.



    Any help/advice would be much appreciated. Thanks!

  • I just put it in the gac and everything was happy.

  • I'm using Sharepoint Services (Not Portal Server) and have installed the web parts in GAC and _WPCATALOG I've also modified web.condig as per instructions, however I can't get the breadcrumbs nor navigation to work. They are available allright, but when I drag and drop them to a page nothing happens.

    Please advice

  • First of all: really great web parts, dude!

    Second: I just want to share some experiences I made installing the web parts. I am using Windows Sharepoint Service (WSS) using virtual server configuration. In my case I had to create manually a bin directory under wwwroot and had to copy the dll in there. Also use the web config file directly in wwwroot path. After doing that I was at least able to upload (import) the dwp files. I still don't know where to put these files on the server.

  • Hi,

    I've been trying to install the webparts and I've got as far as being able to see them in sharepoint, but when i try and add them to the main page i get the error :

    &quot;A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.&quot;

    I've added the code to the web.config file, set the wss security to medium and installed it in the GAC using GACUTIL /i to try and get around this but nothing seems to work.

    Has anyone else had this problem.



    thanks in advance.

  • You MUST make sure that the assembly is known to the GAC.



    It worked for us without setting the wss security to medium. Maybe you have some typo in the web.config?

  • This is grat work Jan! I thought that at the start of the blog there might have been an &quot;essentials&quot; component to enable an administrator to easily create &quot;Alert Me&quot; for any other user(s) for particular lists... For example, we want all our new users to have an Alert for Issue Log and Tasks - it's the best way to get them to come back regularly...telling the user to create it does not work that well. Any thoughts?

  • Julian, in a few hours I'm releasing a webpart that can do this, so keep an eye on my blog!

  • Looks like some great parts, however I have just spent the last 2 hours trying to get it to work, having the same issue as everyone else. I have added it to every web.config file on my server I could find, copied the dll, etc. etc., but still get the safe error...anyone figured it out yet?



    Thanks for the help in advance

  • Am trying to set up the navigation web part but keep getting this error after I upload it and try and drag it on the page.



    A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.



    Any help would be appreciated.

  • Hi Jan,

    I was using zipped one at the top of this page under downloads. I copied the dll into the bin folder, copied the dwp file to a dwp folder as I don't have a WPCATALOG folder and added the SafeControl section to the Web.Config file.



    Is there something I am missing?

    Thx

  • Anne, can you send me an email using the contact page? Thanks!

  • Nice work Jan,

    btw are you aware of an error on SPS that says

    &quot;Access is denied: 'Leadit.SharePoint.Essentials'. &quot;




  • Tariq, there seem to be some problems with SPS (WSS is working fine). I've haven't had a chance to look into them.

  • Btw, did you use the packaged version?

  • I have the samo problem as dustin...

    Still trying

  • I finally did it!

    The proble was the version in the assembly file and web.config.



    I assigned both with 1.0.* and that didn't work.

    Then changed it to 1.0.0.0, recompiled, re-gac and it's ok!



    [Portuguese - Portugues]

    Finalmente consegui!

    As versoes no assembly file e no web.config estavam mal definidas.

    Estavam ambas com 1.0.* e deveria estar 1.0.0.0.

    Recompilei, voltei a inserir no GAC e funcionou.

  • I found that the NTFS file permissions on the DLL in the bin folder was not set properly. I made sure to check &quot;Inherit permissions from parent&quot; so that IUSR and IIS users were given proper rights.



    Hope this helps those of you with the &quot;not registered on this site as safe&quot; error.

  • To answer my previous question, I got it working despite the initial message &quot;A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe&quot; by editing the &lt;SafeControl Assembly=&quot;Leadit.SharePoint.Essentials, Version=1.1.0.0, Culture=neutral, PublicKeyToken=6f708acd0ffbe583&quot; Namespace=&quot;Leadit.SharePoint.Essentials&quot; TypeName=&quot;*&quot; Safe=&quot;True&quot; /&gt; string. The one above is correct, but on the initial page it refers to an earlier version.

    Now I have the control working it looks great.

    Regards,

    Paul

  • I see where I can exlcude certain lists, but do not know the possible parameters.



    Also, I would like to use the title of docs by default. However, people rarely fill in this info. So can someone provide a little code to use the title if it exists, otherwise use filename?



    Thanks,

    -Tom N.

  • 2 questions/requests re: the navigation web part.



    1) Many people, including me, are quite dissatisfied with the default Sharepoint navigation structure. Has anyone modified the nav web part to show all site structure from the top WSS web site down? In this way, it could be used suitably for left navigation. (Therefore, the tree would not change wherever you are in the site).



    2)Has anyone put together a collapsible tree structure for this web part, as the number of subsites may get large rather quickly.



    3) Can you include other site structure components (web parts) other than subwebs? For example, doc libraries, discussions, events, etc? I think it would make this web part an indispensible addition to/substitute for all other navigation alternatives.

  • Very nice webparts. But I have a question regarding the navigation webpart. On the main site for the whole portal (I have called it MainPortal) I have put the navigation webpart. Under the main portal, I have 2 sites, called TestSite1 and TestSite2. Under TestSite1 I have another subsite called SubTestSite1.

    On the navigation webpart that I have put on the main portal page, I get a list of a lot of things, but everything is on the same level, and the sites are not there (I have chosen 5 levels...). The closest I get is a link to &quot;sites&quot; which takes me to the sites page. And from there I can navigate to TestSite1 etc. But I was hoping to get a tree view on the main portal page which included TestSite1 with SubTestSite1 under it, TestSite2 etc...

    Have I misunderstood anything? Or am I doing something wrong??



  • Andy, are you using WSS or SPS?

  • I'm sorry, but doesn't anybody notice on the Navigation part that the indentions are waaaaaayyyyh too far - e.g. 1/2&quot; each level and it does not text wrap - where can you change this???

  • I am using WS Portal Server 2003, Windows Server 2003 w/ IIS6.0. All of the help sites I go to say to edit the c:\inetpub\wwwroot\web.config folder but I do not have that file there. Is there another location this should be, there are several when I do a search on the server so I need to know which one to edit.



    P.S. Is there a way to convert the older webparts MS has to be used in the newer versions of portal and WSS?



    Thanks!

  • I HAVE HAD LOTS OF PROBLEMS WITH THAT BLOODY SAFE ISSUE AND THOSE PEOPLE FROM MICROSOFT JUST HAVE TO MAKE OUR LIFE HARD.

    ONE TRICK IS TO CLEAR THE CACHE.
    1) STOP IIS
    2) DELETE EVERYTHING FROM C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files
    3) RESTART IIS AND TRY TO ADD YOUR WEBPART


    BARE IN MIND THAT ALSO THE XML CONFIG FILES ARE CASE SENSITIVE !!!

  • How can I make this webpart only display Approved documents not pending or rejected?

  • Hi Jan,
    I have a problem with using your Navigation web part. I created a site with several subsites and use navigation wep part for navigation among pages.

    However, when I create rights for some login for only some subsites, but not for root site, the user cannot log in and he receives error. Do you have any suggestion how to solve this issue?

    Thank you.

  • I loaded the What's New web part as I just created a portal for everyone who went on an African trip with me. I wanted everyone to have a quick place to look if someone uploaded some new pictures. The what's new WP does show that there was an update in a folder but does not give details on uploaded files. IE picture1.jpeg, movie1.avi, etc... Is it possible to get some sort of detail like that?

    Also for everyone who is having the install issue, I had the same problem. I'm not a .NET guy but I found the answer by installing the .dll into the GAC using the gacutil.exe application. Do a search on your windows directory to find the executable. then I just typed:

    gacutil.exe /i leadit.sharepoint.essentials.dll

  • addendum...

    It would also be great to get the user's name who submitted a change in the What's New WP.

  • Hi there,

    I Have installed this and am using the breadcrumbs webpart. Where can I change the size of the text it uses? Also is it possible to use the sub website description instead of the actual name? ie.....

    Top Level/Next Level Description

    But the URL would remain as the proper URL to the next level??

  • can anyoe show me some tutorial as to how to create web parts using .Net

  • Actually every thing i have done but I am not getting where this DWP file need to store , Acording to you i need to put into WPCATALOG folder but i am not getting that folder , there itself stuck ?
    please give me some idea how to solve this problem

    1. My actual problem is when i am addind the web part it is telling
    A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe

    thanks

    Dipesh

  • I am trying to install the Navigation web part but to no avail. I have follow the steps outlined above, but am still getting an error when trying to place the web part on the page. The error is:

    A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.

    Any help would be greatly appreciated. This looks like a fantastic web part and would be very useful.

    Thanks,
    Liz

  • Hi there,

    I'm wishing to install the SharePoint essentials. I tried to follow the instructions but I can't find where the WPCATALOG and GAC folders are? I'm using SharePoint Services 2003.

    Please help. Thanks.

    Vincent
    vincent.chai@ledcor.com

  • I've just installed the Web Parts and they are great ! The Breadcrumbs and Navigation items should have been in the Sharepoint Services distribution to start with, because they are essential to a meaningful implementations. I am happy you jumped in and provided them.

    For the people that have trouble installing them : I bought a book ('Sharepoint Services Inside Out') that helped me fight through this lake of mud. I think that when you want to go to this extent customizing Sharepoint Services such an investment might be a good idea.

    Thanks...!

  • Would something like this be available for MOSS 2007?

  • I can't find the web.config files in inetpub\wwwroot directory.
    What should I do?? Please advise me. Thanks for your help in advance!!!

  • The "Whats New" web part has been installed by our corporate administrators and I'm using it on my local site. How do I exclude items that are older that a certain date? The problem is that the list fills up and new items do not appear at the top nor old item drop off the bottom.

  • i want to create my own web part in a web part page
    plz help me. Reply ASAP

  • Interesting comments.. :D

  • WPCATALOG is not available in the server, do we need to create new folder, how to go about.

  • Hi

    My web part dsplays a message "There are no listings to display", when there are no lists present. How can i edit or delete this default message.

    Thanks

  • Cheapest prices online pharmacy:
    online pharmacy. [url=http://www.pharmacy-style.com/]online pharmacy[/url]. erectile dysfunction. [url=http://www.pharmacy-style.com/erectile-dysfunction.htm]erectile dysfunction[/url]. cheap viagra. [url=http://www.pharmacy-style.com/viagra.htm]cheap viagra[/url]. cheap cialis. [url=http://www.pharmacy-style.com/cialis.htm]cheap cialis[/url]. cheap levitra. [url=http://www.pharmacy-style.com/levitra.htm]cheap levitra[/url]. viagra soft tabs. [url=http://www.pharmacy-style.com/viagra-soft.htm]viagra soft tabs[/url]. cialis soft tabs. [url=http://www.pharmacy-style.com/cialis-soft.htm]cialis soft tabs[/url].

  • Lucy! Please call me,Lucy! Please call me

  • Lucy! Please call me,Lucy! Please call me

  • Hi Jan,

    We've been using your SharePoint essentials for a long time with WSS v2. Now that we are moving towards WSS v3, we cannot manage to re-install your webparts on our new WSS v3 server. When we double-click on the .msi file, nothing happens. If we try it again, Windows tells us that the package is already installed. This is confirmed when viewing the "Add/Remove Programs" feature.

    I am about to try to install them manually with the .CAB file and StsAdm.exe -addwppack...

    How do we upgrade? We have Thousand's of WSS sites using your webparts!

    Please reply at miguel.caron@snclavalin.com

    Thanx,

  • I am also upgrading to WSS v3 and have been unable to get your web parts working. Please help!

  • We have installed breadcrump 1.0.0.0
    We want to install 1.1.1.0 because we've sites with spaces in the name.
    But the new version won't install (the msi).
    We've removed all the breadcrumbs from all the sites, uninstalled 1.0.0.0, it looks removed.
    But still 1.1.1.0 won't install.
    After the dialogue blobal assambly cache options the installation stops.
    What's the problem??

  • Is there a trick to ordering the SPQuery by a date field? I don't get any errors, but it also doesn't sort it by the date field I've specified.

  • follow up to my last post...

    It doesn't seem to order by any field. I'm using the same CAML query as the example above, and can't get it to order the results by anything.

  • I've been successfully using the What's New web part for over a year. Several months ago the new postings are not appearing. How do I exclude items that are older that a certain date? The problem is that the list fills up and new items do not appear at the top nor old items drop from the bottom.

  • On the What's New list, I would like to replace the Links=URL so that the description of the URL shows instead of the URL itself.

    A URL can be pretty long and bad looking so it screws up the nice look of the what's new list. The description would a LOT nicer.

    I've tried Links=Description, Links=Desc, Links=URLDesc... every possible names, but no success.

    Please help !!! Is this possible???

  • I am trying to load balance 2 SharePoint WSS 2.0 SPS 2003 servers pointing to the same SQL database and am coming up with an issue with your LeadIt Navigation webpart.

    If its installed via server 1 on a page and then i view the page on server 2 i get an error that the webpart can not be displyaed. I delete this webpart and add it again on the page from Server 2 and its viewable. But when I go back to server 1 to view page I get the error again.

    I have confirmed that this is installed identically on both servers but cant for the life of me figure out why this is happening.

    Anyone have any ideas? One of my goals for 2007 was to get these servers load balanced by EOY.

    fyi... waiting to see if MOSS is approved as a project so I can upgrade in 2008.. cross your fingers.

  • I would like to use the filename of docs by default.


    But i dont know how..

    Can anyone help me please?
    Thanks,
    Kristin

  • Hi,

    I need the breadcrumb like this:

    pages\Admin\admins\PraivacyData.aspx

    All the above are under \sites\groupIT\Testing\

    All the above folders are created manually by me.
    But i create the page using create option.

    But when i try to import breadcrumb webpart it is showing only Home page name

    It's not showing like "pages\Admin\admins\PraivacyData.aspx"

    Please reply me.

    I am in urgent need.

    Tks.
    Hari

Comments have been disabled for this content.