Weird issues
Hello again,
m_PageManager = PageManager.GetManager();
m_PageManager.Provider.SuppressSecurityChecks =
true
;
PageNode pageNode = m_PageManager.CreatePageNode();
Guid parentGuid = SiteInitializer.FrontendRootNodeId;
var parent = m_PageManager.GetPageNode(parentGuid);
m_PageManager.ChangeParent(pageNode, parent);
Telerik.Sitefinity.Security.SecurityDemandFailException: You have no permissions to create pages
at DynamicModule.ns.Wrapped_OpenAccessPageProvider_5d430d6b24b44c39beee52cad2d27e88.ChangeParent(PageNode childNode, PageNode newParent)
at Telerik.Sitefinity.Modules.Pages.PageManager.ChangeParent(PageNode childNode, PageNode newParent)
at ...
PageData pageData = m_PageManager.CreatePageData(id);
pageData.Status = ContentLifecycleStatus.Live;
Hi Lupi,
1.You can use the code below to create a group page
var pageFacade = App.WorkWith().Page().CreateNewPageGroup().SaveChanges();
SiteMapBase.Cache.Flush();
SuppressSecurityChecks
does not work when you create a page). You can gather more information at this post.Thanks for the reply.
TaxonomyManager m_TaxonomyManager = TaxonomyManager.GetManager();
HierarchicalTaxonomy m_CategoriesTaxonomy = m_TaxonomyManager.GetTaxonomies<HierarchicalTaxonomy>().Where(t => t.Name ==
"Categories"
).Single();
// This returns one of the two built-in taxonomies
HierarchicalTaxon taxon = m_TaxonomyManager.CreateTaxon<HierarchicalTaxon>();
taxon.Title =
"Some Category"
;
taxon.Name =
"Some Category"
;
m_CategoriesTaxonomy.Taxa.Add(taxon);
m_TaxonomyManager.SaveChanges();
blogPost.Organizer.AddTaxa(
"Categories"
,
new
Guid[] taxon.Id );
Hey there,
I am getting a similar error when i try to categorize News. Did you find a solution to this problem?
Hi ananf singh,
Can you please be more specific and let us know the exact error you are getting and the steps you take to experience it.
Greetings,I am trying to import content from my existing cms programmatically.
When I attempt to categorize a news item and exception is thrown. See the code below
01.
NewsItem newsItem = newManager.CreateNewsItem();
02.
newsItem.DateCreated = item.CompositionDate ?? DateTime.Now;
03.
newsItem.PublicationDate = item.CompositionDate ?? DateTime.Now;
04.
newsItem.ExpirationDate = item.DisplayUntilDate;
05.
newsItem.Title = item.ContributionTitle;
06.
newsItem.Content = item.ContributionBody;
07.
newsItem.Summary = item.Synopsis;
08.
09.
newManager.RecompileItemUrls<NewsItem>(newsItem);
10.
newManager.SaveChanges();
11.
12.
NewsItem createdNews = newManager.GetNewsItem(newsItem.Id);
13.
createdNews.Organizer.AddTaxa(
"Categories"
,
new
Guid[] idMap[item.Category.CategoryID] );
14.
newManager.SaveChanges();
[ArgumentException: The specified property 'Categories' does not exist on type 'Telerik.Sitefinity.News.Model.NewsItem'.] Telerik.Sitefinity.Taxonomies.Model.OrganizerBase.GetPropertyDescriptor(String propertyName, Type[] expectedPropertyTypes) +268 Telerik.Sitefinity.Taxonomies.Organizers.DefaultOrganizer.AddTaxa(String propertyName, Guid[] taxonIds) +268
Hello,
Try using Organizer.AddTaxa(
"Category"
, ....);
Greetings,
Ivan Dimitrov
the Telerik team
Hey Ivan,
Thanks that works! I thought I tried that and it did not work, but I must have been mistaken. Thanks for the speedy response.
From some samples found on web, this magic string is seen, other is "Department".
I am trying my best to search if there is any class documentation of this method "AddTaxa". Google has failed to locate that, siteFinity loops me back to http://docs.sitefinity.com/ and 2-3 samples where this method is used.
In general, where can one find something like MSDN or javaDoc kind of documentation?For ex. for 3.x and prior versions, see www.telerik.com/.../categories-get.html.
I need similar document for version 9.
Thanks in advance.