While Parsing Yioop Pages, all links related to internal pages need to be extracted and stored in database.
yashi2016-05-14 11:08
Before parse method present in WikiParser.php is called to parse mediawiki document into equivalent HTML, we need to use the regular expressions indicating the presence of a link to fetch all internal links present in wiki pages and store them in table named GROUP_PAGE_LINK.
Steps to reproduce:
1. Call method setPageName in GroupModel.php.
2. There exists no method call to fetch links and so no entries are made to the table GROUP_PAGE_LINK for storing parent and child page ID.
Additional information:
1. Now, a method fetchLinks is added to WikiParser.php which gets all the links present in the page provided to it as an argument.
2. This method is called before parsing is done in setPageName in GroupModel.php.
3. On getting the links, we get the parent page ID and all child pages ID.
4. Thereafter, entries are stored in the database, removing duplicates.
yashi2016-05-14 11:25
Hello Professor,
I have added the patch for your approval. Please review it and let me know if any changes need to be done.
Regards,
Yashi
administrator2016-05-14 11:45
Hey Yashi,
Thanks for the patch. I am testing it out now. For future patch makes sure not to change the WORK_DIRECTORY in the Config.php file. Use a LocalConfig.php file to avoid this.
Best,
Chris
yashi2016-05-14 11:50
Hello Professor,
I didn't make any change to the Config.php file. I am not sure why it said some changes have been made to this file.
Regards,
Yashi
administrator2016-05-19 11:10
Hi Yashi,
Your patch above have been applied. Thanks for your hard work!
One issue I am a little worried about is what happens when we link to a wiki page that doesn't exist yet? I am probably going to add an auxiliary table to handle links that might need to be added later. I will mention here when I've done that.
Till then, hold off on working on deliverable 4.
Before parse method present in WikiParser.php is called to parse mediawiki document into equivalent HTML, we need to use the regular expressions indicating the presence of a link to fetch all internal links present in wiki pages and store them in table named GROUP_PAGE_LINK.
Steps to reproduce: 1. Call method setPageName in GroupModel.php. 2. There exists no method call to fetch links and so no entries are made to the table GROUP_PAGE_LINK for storing parent and child page ID.
Additional information: 1. Now, a method fetchLinks is added to WikiParser.php which gets all the links present in the page provided to it as an argument. 2. This method is called before parsing is done in setPageName in GroupModel.php. 3. On getting the links, we get the parent page ID and all child pages ID. 4. Thereafter, entries are stored in the database, removing duplicates.
Hello Professor, I have added the patch for your approval. Please review it and let me know if any changes need to be done.
Regards, Yashi
Hey Yashi,
Thanks for the patch. I am testing it out now. For future patch makes sure not to change the WORK_DIRECTORY in the Config.php file. Use a LocalConfig.php file to avoid this.
Best, Chris
Hello Professor, I didn't make any change to the Config.php file. I am not sure why it said some changes have been made to this file.
Regards, Yashi
Hi Yashi,
Your patch above have been applied. Thanks for your hard work! One issue I am a little worried about is what happens when we link to a wiki page that doesn't exist yet? I am probably going to add an auxiliary table to handle links that might need to be added later. I will mention here when I've done that. Till then, hold off on working on deliverable 4.
Best, Chris
Sure professor. Thank you so much :)
Regards, Yashi
Fixed before e4ba8ed
Attachments:
YashiKamnoj.patch