Chapter 11: Internet (Web hosting reviews) Resource Manager 383 . Then

Chapter 11: Internet Resource Manager 383 . Then an object of Resource class is created named $resourceObj. It calls getResourceInfo() with the resource ID to get the information about the selected resource and calls getKeywords() to get keywords for the resource. . Next it sets the resource information in the template. . It calls populateCategory() to generate the category list. . Finally, the showWithTheme() method is called with the output of parsing the main block to embed the message with the user theme template. modifyResource() This method updates modified resource information to the database. It works as follows: . First, this method checks whether the category is provided. If the category is not provided, then it gives an error message and returns null. . Next, the method checks whether the resource name and URL is given. If the resource name is not given, then an error message is shown and it returns null. . Then It checks the validity of a given URL. If the URL is not valid, then it shows the appropriate error message to the user ( incorrect URL given ) and returns from the method. . If a new category name is provided by the user of his own, then it checks whether the category already exists. If it doesn t exist, then it adds the new category in the CATEGORY table. . Then It creates an object of Resource class and calls the modifyResource() method with the proper parameter to resource in the RESOURCE table. If it successfully modifies the resource, then it returns the resource ID. If it fails to modify, then a message is shown that the resource is not modified. . If the resource is modified successfully, then it deletes all the previous keywords and adds new keywords in the RESOURCE_KEYWORD table. . Finally, it calls the displayWithTheme() method to show the message with the user s theme. delete() This method deletes resource information. It works as follows: . This method first checks whether any resource is selected to delete or not. If it is not given, then an error message is shown and returns null.

Leave a Reply