Web site development - 390 Part II: Developing Intranet Solutions showTopRankingResource() This
390 Part II: Developing Intranet Solutions showTopRankingResource() This method is used to display the top-ranked resources. It works as follows: . A template object is created named $menuTemplate. To load, the template file named $IRM_SEARCH_RESULT_TEMPLATE (configurable via irm.conf) is passed to the method. . Next it registers the session variables SESSION_SEARCH_LIST and SESSION_PAGE_SIZE to store the search output and number of resources that needs to be shown each page, respectively. . Then it creates a Resource class object named $resourceObj and calls the getTopRankingList() method with the defined variable TOPRANKING (which is configurable in the irm.conf) to get the top-ranking resource. . It creates a User class object named $userObj and calls getUserInfo() method to get the name of the user who added the resource. . It sets the result and parses the main block. Then it calls the showWithTheme() method to embed the output with the user s theme template. showMostVisitedResource() This method is used to display the most visited resources. It works as follows: . A template object is created named $menuTemplate. To load, the template file named $IRM_SEARCH_RESULT_TEMPLATE (configurable via irm.conf) is passed to the method. . Next it registers the session variables SESSION_SEARCH_LIST and SESSION_PAGE_SIZE to store the search output and number of resources to be shown in each page, respectively. . Then It creates an object of Resource class named $resourceObj and calls the getMostVisitedResource() method with a arameter called MOSTVISITED, which specifies the number of the most visited resource to be shown (configurable in the irm.conf). . It calls the getResourceInfo() method to get information for each resource and stores in the session variable SESSION_SEARCH_LIST and displays the search result. . Finally the showWithTheme() method is called with the output of parsing the main block to embed with the user s theme template. showWithTheme() This method is use to show the user s theme template. It works as follows: