November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
The xml provider is for creating pages structured in an xml file. (Given in the filePath attribute above) If you are trying to connect to a database, just configure your EPiServerDB connectionstring in the file connectionstrings.config
Set up the Data Source to your db server name and your initial catalog to match your database name.
If you are actually trying to store your data in an xml file with the xml page provider, you can read more about the provider here:
http://world.episerver.com/Articles/Items/Introducing-Page-Providers/
Hey,
Thanks for the reply.I am storing my data in an xml file with the xml Page provider.I am following the same thing but my page is not displaying the xml content . In which location I have to add provider code in my web.config.I have placed it in between the </episerver.baseLibrary> tag.
</classFactories><pageProvider><providers>add name="XmlPageProvider" type="CodeSamples.XmlPageProvider, XmlPageProvider" entryPoint="75" capabilities="Create,Edit,Delete,Move,Copy" filePath="~\externalpages.xml"/></providers></pageProvider></episerver.baseLibrary>
and page provider node in the site's page tree is a page of start type.
You should not have it inside the episerver.baselibrary tag. Take it out of web.config and put it inside the <episerver> tag in your episerver.config file.
Hey,
Thanks for the reply.I just have put the code inside the episerver.config, but its giving reeor message:
Cannot create an instance of type CodeSamples.XmlPageProvider, XmlPageProvider
The type attribute requires a full namespace. Check what namespace you have and replace "CodeSamples.XmlPageProvider, XmlPageProvider" with your namespace
There's a similar question answered here:
http://stackoverflow.com/questions/502755/episerver-cms-5-r2-custom-page-provider-refuses-to-load
Are you still using the configuration from your first post? If so, have you downloaded the externalPages.xml file and placed it in your site's root folder?
The code crashes on a line where it is trying to retrieve the physical path of the xml file.
Hey,
thanks for the reply
I got following error in my page.
!EPiServer.Core.InvalidPropertyValueException was unhandled by user code
Message="\"05/20/2010 09:04:00\" is not a valid value for \"EPiServer.Core.PropertyDate\"."
Source="EPiServer"
InnerException: System.FormatException
Answer before you changed your previous post:
I'm confused, is HttpContext.Current null???
Try this:
- set a breakpoint at line 55 in XmlPageProvider.cs
- go to the Immediate Window, type configParams["filePath"] and press enter. What do you get?
- same, but type HttpContext.Current.ToString() What do you get?
- if the previous doesn't fail, do you get anything when you type (copy/paste) HttpContext.Current.Server.MapPath("externalpages.xml") ?
Hi,
Thanks for the reply.......!
1) I have added breakPoint in line 55 in XmlPageProvider.
2) configParams["filePath"] is showing "~/externalPages.xml"
3) HttpContext.Current.ToString() displays : object.ToString is a Method which is not valid in given context.
4) After typing HTTPContext.Current.Server.MapPath("externalPages.xml") result is Http Context.Xurrent is null.
I tries this previously and didnt got any solution so I changes my this line No 55 to following one ie:
_filePath = AppDomain.CurrentDomain.BaseDirectory + @"/externalPages.xml"; and now I am getting filePath.
Hi,
Thanks for the reply.......!
1) I have added breakPoint in line 55 in XmlPageProvider.
2) configParams["filePath"] is showing "~/externalPages.xml"
3) HttpContext.Current.ToString() displays : object.ToString is a Method which is not valid in given context.
4) After typing HTTPContext.Current.Server.MapPath("externalPages.xml") result is Http Context.Xurrent is null.
I tries this previously and didnt got any solution so I changes my this line No 55 to following one ie:
_filePath = AppDomain.CurrentDomain.BaseDirectory + @"/externalPages.xml"; and now I am getting filePath.
Ok. Regarding the InvalidPropertyValueException you get now, this might be related to localization. The date format in the XML file is mm/dd/yyyy hh:mm:ss Not sure about dateformats in India, but try to change the dates in the XML to match your date format.
Hi,
Hey..........Yeh! My page is now displaying the xml content .
Thank you so much for the replies.:)
Now the only thing I want to know is that in XMLPageProvider I got XmlPageProvider.CS and complete solution that I just added as a reference in my project. Is the customPageproviders is also same .How do I get the databaseProvider.CS,Or I have to create it on my own.
Thanks
Bharti
Do you mean a custom database provider? When you install EPiServer, the default storage option is database.
Hey,
Yes my mean is Custom DatabaseProvider.like in the following link:
http://world.episerver.com/Templates/Forum/Pages/Thread.aspx?id=43613&epslanguage=en&pageIndex=2
but the NorthwindProductProvider.CS and the Northwind.dbml.Is this a class or what .
Sorry..........:)
http://guides.episerver.com/smartass/players/guideplayer/GuidePlayer.jsp?Guide=http://guides.episerver.com/smartass/media/20081113/37/Guide.xml
Sorry..........:)
http://guides.episerver.com/smartass/players/guideplayer/GuidePlayer.jsp?Guide=http://guides.episerver.com/smartass/media/20081113/37/Guide.xml
Check out Allans blog posts:
http://labs.episerver.com/en/Blogs/Allan/Dates/112230/8/Building-your-own-Page-Provider-Northwind/
http://labs.episerver.com/en/Blogs/Allan/Dates/112230/11/Guide-Northwind-Page-Provider/
http://labs.episerver.com/en/Blogs/Allan/Dates/2009/4/Revisited-Northwind-Page-Provider/
Hi,
I am bit new to the Episerver World ,I want to connect external database to the piserver.
I m trying to do it with the XmlPage Providors. For that I have created a new page in the page hierarchy(Type normal) and then add refrence to dll (xmlPageProvider.dll) and also add xml file and the code in my web.config ie
<pageProvider>providers>add name="XmlPageProvider" type="CodeSamples.XmlPageProvider, XmlPageProvider" entryPoint="75" capabilities="Create,Edit,Delete,Move,Copy" filePath="~\externalpages.xml"/>providers>pageProvider>
but my page is not showing up anything it displays only the name of the page.