Chris Pollett > Students > Pinapala

    Print View

    [Bio]

    [Blog]

    [CS 297 Proposal]

    [Deliverable 1]

       [Madcap Flare Configuration]

       [Madcap Flare Demo]

       [AdobeRobohelp Configuration]

       [Adobe Robohelp Demo 1]

       [Adobe Robohelp Demo 2]

       [CSH_Presentation_1_PDF]

       [CSH_Presentation_2_PDF]

    [Research on Wiki systems]

    [Deliverable 3 :A Basic Wiki editor]

    [Deliverable 4: Feature set for CSH Wiki]

    [CS297 Report - PDF]

    [CS 298 Proposal]

    [Deliverable 1: Design Document]

    [Deliverable 2: UI mocks for Help panes]

       [Left Aligned]

       [Mobile]

       [Right Aligned]

    [Deliverable 3: Help Display From web service & Wiki Parser]

       [Wiki Parser]

       [Help Display & WebService sample]

    [Deliverable 4: Integrating CSH into Yioop.]

    [CS298 Presentation - PDF]

    [CS298 Report - PDF]

    [Graduation Pic with Dr.Pollett]

                          

























Context-Sensitive Wiki Help for Yioop

Integrate Database schema and entries into New/Existing installations.

    In this deliverable, I will throw some light on how the Context sensitive help will be integrated into Yioop seamlessly.

    Yioop's Context sensitive help pages are just wiki pages in the Group Named "Help". The goal for making context sensitive help work on upgrade or New install is to make sure that a Group names "Help" exists. the Group ID for the "Help" group is constant and is assigned a value '3'.

    The Help group with concerned wiki help articles is created using database content insertion. Yioop is shipped with a "default.db" database, which consists of bootstrap Database content. We will include all the "Help" group content as a part of default.db.
      For new installations, The "Help" group is created with a HELP_GROUP_ID read from config.php. Below is the code used for creating the Help group.
      //Create a Group for Wiki HELP.
      $sql = "INSERT INTO GROUPS VALUES(" . HELP_GROUP_ID . ",'Help','" .
          $creation_time . "','" . ROOT_ID . "',
          '" . PUBLIC_BROWSE_REQUEST_JOIN . "', '" . GROUP_READ_WIKI .
          "', " . UP_DOWN_VOTING_GROUP . ", " . FOREVER . ")";
      $db->execute($sql);
      $now = time();
      $db->execute("INSERT INTO USER_GROUP VALUES (" . ROOT_ID . ", " .
          HELP_GROUP_ID . ", " . ACTIVE_STATUS . ", $now)");
      $db->execute("INSERT INTO USER_GROUP VALUES (" . PUBLIC_USER_ID . ", " .
          HELP_GROUP_ID . ", " . ACTIVE_STATUS . ", $now)");
      

      Now, once the Help group is created, the next step is to pull the wiki help articles from default.db and insert them into target database. Below code is used to perform the same :

      function getWikiHelpPages()
      {
          $help_pages = array();
          require_once(BASE_DIR . "/models/datasources/sqlite3_manager.php");
          $default_dbm = new Sqlite3Manager();
          $default_dbm->connect("", "", "", BASE_DIR . "/data/default_help.db");
          if(!$default_dbm) {
              return false;
          }
          $group_model = new GroupModel(DB_NAME, true);
          $group_model->db = $default_dbm;
          $page_list = $group_model->getPageList(HELP_GROUP_ID, "en-US", '', 0, 200);
          foreach($page_list[1] as $page) {
              if(isset($page['TITLE'])) {
                  $page_info = $group_model->getPageInfoByName(
                      HELP_GROUP_ID, $page['TITLE'], "en-US", "api");
                  $page_content = str_replace("&", "&", $page_info['PAGE']);
                  $page_content = html_entity_decode($page_content, ENT_QUOTES,
                      "UTF-8");
                  $help_pages[$page['TITLE']] = $page_content;
              }
          }
          return $help_pages;
      }
      
      //Insert Help pages
      $help_pages = getWikiHelpPages();
      foreach($help_pages as $page_name => $page_content) {
          $page_content = str_replace("&", "&", $page_content);
          $page_content = @htmlentities($page_content, ENT_QUOTES, "UTF-8");
          $group_model->setPageName(ROOT_ID, HELP_GROUP_ID, $page_name,
              $page_content, "en-US", "Creating Default Pages",
              "$page_name Help Page Created!", "Discuss the page in this thread!");
      }
      
      Existing installations :

      The procedure for creating the"Help" group content for existing installations is the same as the procedure used above for New installations. However there is one check done before the help articles are inserted. As the HELP_GROUP_ID is constant , we should make sure that the HELP_GROUP_ID defined in config.php is not taken, If taken we will move the existing group at group_id = HELP_GROUP_ID to the end of the groups. Then we can insert a new "Help" group. 

      Below are the queries used for moving the group, if the group has already taken group_id = HELP_GROUP_ID.
      update GROUPS Set GROUP_ID = MAX_GROUP_ID
      
       where GROUP_ID= 3;
      
      update GROUP_ITEM Set GROUP_ID = MAX_GROUP_ID
      
       where GROUP_ID= 3;
      
      update GROUP_PAGE Set GROUP_ID = MAX_GROUP_ID
      
       where GROUP_ID= 3;
      
      update GROUP_PAGE_HISTORY Set GROUP_ID = MAX_GROUP_ID
      
       where GROUP_ID= 3;
      
      update USER_GROUP Set GROUP_ID = MAX_GROUP_ID
      
       where GROUP_ID= 3;
      
      update GROUPS Set GROUP_ID = MAX_GROUP_ID
      
       where GROUP_ID= 3;