Weird issues

Posted by Community Admin on 05-Aug-2018 21:58

Weird issues

All Replies

Posted by Community Admin on 21-Aug-2010 00:00

Hello again,


I'm having very weird issues when creating and publishing pages.

First of all - what do I need to specify in order to make a page a "Group page"? I haven't found any property that might be doing that.

Second, the biggest issue - I have a web service that creates pages. When I execute the services from within VS.NET 2010 and feed it with the needed parameters, the page creating method is executed normally. Now, per your documentation I have these lines 

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);

When I call the service from a standalone application I get the following exception, at the line with  m_PageManager.ChangeParent(pageNode, parent),even though I have turned off the security checks.

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 ...

This happens only when calling the service from a standalone application, when I call it to test it from within VS.NET it works.

And finally some weird behaviour - I have this code

PageData pageData = m_PageManager.CreatePageData(id);
pageData.Status = ContentLifecycleStatus.Live;

but the page shows as unpublished in the admin, unless I set pageData.Visible = true;

Any help would be much appreciated.

Regards

Posted by Community Admin on 23-Aug-2010 00:00

Hi Lupi,

1.You can use the code below to create a group page

var pageFacade = App.WorkWith().Page().CreateNewPageGroup().SaveChanges();
SiteMapBase.Cache.Flush();

2. You cannot create a page using an anonymous user. You have to be authenticated ( SuppressSecurityChecks does not work when you create  a page). You can gather more information at this post.

3. Use PublishPageDraft method of PageManager to publish the page. You can use ContentLifecycleStatus.Live to filter the pages  that are in scheduled state.

Let me know if there are further questions.


All the best,
Ivan Dimitrov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 23-Aug-2010 00:00

Thanks for the reply.


I still have problems creating pages though. If I understood correctly from the other forum thread - currently there is no reasonable way to create a page from an anonymous WCF service, because there is no way to authenticate as a valid user (i.e. Administrator) through the WCF service. So the user that creates content from the WCF services will always be Anonymous (for now).

The only option left is to grant the Anonymous user rights to create/modify/view pages. I tried to find the settings in the admin from this screenshot

http://www.sitefinity.com/ClientsFiles/211749_40perm.png

but I can't find where I can modify the settings for page creation. I have Global Permissions, News, Blogs, Events, Classification of content, Libraries, Forms, Feeds & Notifications, Generic Content but no Pages section. Any guidelines or where to change these settings?

Also, I would like to ask about the Themes in 4.0. Is there some API to register themes (that is to add additional entries in the Theme dropdown list, that is displayed when creating pages)? Currenty there are two entries - "-- no theme --" and "Basic". Where do I have to copy the theme files and is there some specific format of the files/folders that I need to follow? I see there is one theme at ~/App_Data/Sitefinity/WebsiteTemplates/DefaultTemplate/App_Themes and it follows some sort of folder organization.

And one last thing :) - when I try to add a category taxonomy to a content (Blog) with the following code:

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 );

I get the following exception

"The specified property 'Categories' does not exist on type 'Telerik.Sitefinity.Blogs.Model.BlogPost'."

Adding FlatTaxons (tags) works fine.

Best regards,
Lupi

Posted by Community Admin on 24-Aug-2010 00:00

Hey there,


I found where I can set the permissions for creating/modifying/etc. the pages, it's in the Pages section but I need to have at least one page, otherwise the link to "Permissions for all pages" won't show up.

I also found the info I needed about the Themes in the designer's manual PDF.

Regards,
Lupi

Posted by Community Admin on 15-Feb-2011 00:00

I am getting a similar error when i try to categorize News. Did you find a solution to this problem?

Posted by Community Admin on 16-Feb-2011 00:00

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,
Liubomir
the Telerik team

Posted by Community Admin on 16-Feb-2011 00:00

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();

The exception "The specified property 'Categories' does not exist on type 'Telerik.Sitefinity.News.Model.NewsItem'." is thrown on line 13. Also see some of the stack trace below

[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

Posted by Community Admin on 17-Feb-2011 00:00

Hello,

Try using Organizer.AddTaxa("Category", ....);

Greetings,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 17-Feb-2011 00:00

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.

Posted by Community Admin on 26-Aug-2016 00:00

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.

This thread is closed