I tried to run the code you have supplied below but did not get the errors you specified.
Here's a detailed list of the steps I took in order to make this run and produce the dummy news items:
I created a XP.Portal.CMS class library under the SitefinityWebApp solution, added the code you posted on 2/18/2011 as ReutersDataProvider class, and added the relevant references to make everything build successfully.
I added the code you posted for creating news items as a method of the ReutersDataProvider with minor changes as follows:
List<Telerik.Sitefinity.News.Model.NewsItem> vList =
i = 0; i < 10; i++)
Telerik.Sitefinity.News.Model.NewsItem Item =
(Item.Id != Guid.Empty)
var dateValue = DateTime.UtcNow;
Item.DateCreated = dateValue;
Item.PublicationDate = dateValue;
Item.DateCreated = dateValue.AddDays(-10).AddSeconds(120);
Item.ExpirationDate = dateValue.AddDays(10).AddSeconds(120);
Item.PublicationDate = dateValue.AddSeconds(120);
"Content from item "
// news permissions inherit form the security root
var securityRoot =
var msg = Res.Get<SecurityResources>().NoSecurityRoot;
- In order to overcome the problem with setting the LString properties, you first need to add the item to the scope (see lines #14-#17).
- In order to make sure the SecurityRoot is created when I call to fetch it, I added the boolean argument set to true on line #37.
- In order to save the newly created items in the system, I added the CommitTransaction call on line #61.
Also note that I had to add the following code snippet to the ReutersDataProvider class, which was missing in your implementation.
On the Sitefinity UI under Administration -> Settings -> Advanced -> News -> Providers, I added a new provider, ReutersDataProvider, with the following fields set:
And an added parameter under it with the following fields set:
I added a new test aspx page, with a single button on it, which invokes the following code on click:
sender, EventArgs e)
NewsManager nm = NewsManager.GetManager(
Once all was saved, the application restarted, the demo page opened and the button clicked, all news items were created successfully, and I could see them on the UI under Content -> News.
Please see if you can follow that sample, and if it works for you.
If not, please provider additional information about your exact version and build of Sitefinity, the steps you took for trying to make this run, and the errors you got.
the Telerik team