mapping between the tables "mp_pages" and "mp_friendlyurls"

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/8/2007 7:49:04 AM
Gravatar
Total Posts 11

mapping between the tables "mp_pages" and "mp_friendlyurls"

Hi,

       I am trying to find out the mapping or the connection between the tables "mp_pages" and "mp_friendlyurls". But I am not able to find out if the mapping is done on url (in mp_pages)= friendlyUrl (in mp_friendlyurls) or not because i can see multiple entries for the single friendlyUrl as well as single RealUrl in both the tables those are mentioned.

       I need to fetch the data from database which will give me the PageName (mp_pages) & concerned RealURL & urlID(mp_friendlyurls).

       Please suggest.

       Please tell me how are we fetching the data to populate the left navigation manu as it redirects one particular page to one particular friendly url only so i suppose that logic can also be used to do this.

Tell me if I am not clear enough.

Thanks & Regards

Gayatri

5/8/2007 8:15:56 AM
Gravatar
Total Posts 18439

Re: mapping between the tables "mp_pages" and "mp_friendlyurls"

For pages in the menu, the RealUrl is always Default.aspx?pageid=x where x is the id of the page from mp_Sites. No matter what the friendly url is we are always rewriting the url to the RealUrl, so the browser shows the friendly url but the page served is always the real url page.

There "should not" be rows in the mp_FriendlyUrls table with duplicate friendly url unless they have different site ids. This is not enforced by a unique contraint so I suppose its possble somehow that could happen. In that case the first one it finds will be the RealUrl used for the request. In other words it looks it up by the FriendlyUrl and uses the first match it finds.

I would be careful what you do in your custom code in accessing these tables as they may change in the future. Specifically, I plan in the future to add pageid to the mp_FriendlyUrls table and I also plan to change to using Guids for ids instead of integers. I will be leaving the integer id columns there to try and avoid backward compatibility issues but the core of mojoPortal will be using the new guids to look things up instead of the integers after this change is complete. I'm not sure how soon I will be doing that but the reason to use Guids instead of integers is to make it easier to combine data from different mojo sites into one. When using integers you get clashes because both sites have the same ids but with guids they are always unique so there is no clash when combining users or content from multiple mojo sites into one.

So the risk you run in writing code against these tables is that you will have problems upgrading in the future and may need to revisit that code.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.