Project: search.cgi cs149 - PERL programming Submitted by: Sheshagiri Pai Instructor and Guide: Professor Jon Degallier Date: 05/22/2006.

Slides:



Advertisements
Similar presentations
CourseWhere Guide for Instructors. To view, print and update Attendance and Grades Log on to CourseWhere using your ID and password Link to CourseWhere:
Advertisements

CGI Programming Part 2. Input Tags Many different ways of getting data from the user. The tag is used most often. has a type attribute –Specifies the.
Overseas Library Catalog – Request Item Overseas Library Catalog Request loaned item.
More CGI Programming Multiple Submits Cookies ing File Uploading.
Form Basics CS Web Data  Most interesting web pages revolve around data  examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes  can.
Employee Self Service Portal Instructions
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
MyiLibrary® ‘Search & View’ Website Training June 8, 2010.
CS 1704 Introduction to Data Structures and Software Engineering.
Inti Online Login Page (Lecturer/Student/Administrator View)
Web forms in PHP Forms Recap  Way of allowing user interaction  Allows users to input data that can then be processed by a program / stored in a back-end.
Lecture 6 – Form processing (Part 1) SFDV3011 – Advanced Web Development 1.
Recruitment Office Procedures Job Posting Requests Creating a Search Committee –Adding Search Committee MembersAdding Search Committee Members –Designating.
How to Apply for a Position at Prince George’s Community College Updated 07/13/
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Register Online Helpdesk By: Linda Leow. Axis Home Page Click on the Support link Go to Axis Home Page.
Online Shopping JavaScript project for CS 175 JavaScript for Web Development, Spring 2009 By Sita Akella.
Global Learning System v2.0. What is the GLS Global Learning System (GLS) A robust learning management system designed to delivery and organize online.
Part 1 – PubMed Interface, Display options, Saving, Printing, and ing results. Instructions This part of the course is a PowerPoint demonstration.
CSC350: Learning Management Systems COMSATS Institute of Information Technology (Virtual Campus)
1 Basic Perl CGI Programming. 2 Issues How and when your program is invoked. Generating Response –HTTP Headers –HTML (or whatever document type you want)
ITCS373: Internet Technology Lecture 5: More HTML.
OneView Service Center Help
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
To access our web services, go to……. Click on Customer Login.
The link to the Custom Point Login is:
Perl CGI What is "CGI"? Common Gateway Interface A means of running an executable program via the Web. Perl have a *very* nice interface to create CGI.
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
CourseWhere Guide for Instructors. To View, Print and Update Attendance and Grades Log on to CourseWhere using your ID and password Link to CourseWhere:
Instructor User Student User Course Registration Form (#8) Grade report (#14)Class list (#13) Grade Entry Form (#10)
SATERN for Supervisors Updated: December Session Objectives At the end of the session, participants will be able to:  Describe SATERN  Log in.
RiPfA Forum Presentation. Functions Creating a new post by To: Subject: ‘your desired subject’ Message:
PaymentNet: Cardholders Procurement Services Laurie Krauel.
Web Center Training ©2003 Optimum Technology, Inc.
ITM © Port, Kazman1 ITM 352 More on Forms Processing.
HTLM Forms CS3505. Form Handling in Browser html User Files out form WEbBROWSErWEbBROWSEr User read response submit Get URL?input html Get file html script.
INTRODUCTORY GUIDE TO SURPLUS LINE INFORMATION PORTAL 2.0 (SLIP) CALIFORNIA’S ELECTRONIC FILING SYSTEM THE SURPLUS LINE ASSOCIATION OF CALIFORNIA Quick.
1 Sacramento City College- Jo-Ann Foley D2L Orientation.
At the Workforce Development and Continuing Education Student Menu select Register for Noncredit course(s) under Registration.
Department of Electrical and Computer Engineering Introduction to Perl By Hector M Lugo-Cordero August 26, 2008.
Learning to use the Interactive Online Classroom Classroom Activities.
SANSUEB SOFTWARE PRESENTS SkyTextMsg – Online Texting for your Business.
PubMed/How to Search, Display, Download & (module 4.1)
 2001 Prentice Hall, Inc. All rights reserved. Chapter 7 - Introduction to Common Gateway Interface (CGI) Outline 7.1Introduction 7.2A Simple HTTP Transaction.
Final Project Creating an interfaces to manipulate tables Professor. Jon Degallier Professor. Jon Degallier Student Name: Mahfuz Talukder Ohlone College.
2004/051 >> Supply Chain Solutions That Deliver Users.
 Here you will learn how to access  The Library Catalog and search for a book  Your Library and Textbook account.
PubMed/How to Search, Display, Download & (module 4.1)
HTML forms. Form elements  Forms consist of  Descriptions (explanation, instructions)  Places to enter information  free form (enter text)  check.
Students’ Registration for the MultiMedia Festival Students’ Registration for the MultiMedia Festival A Project on Perl Submitted by: Jayati Das Guided.
Chapter 16 Web Pages And CGI Scripts Department of Biomedical Informatics University of Pittsburgh School of Medicine
Final Project CS 149 (Perl Programming) Alex Shen.
Complete Ordering System for Promotional Literature and Samples Quick Reference and Training Guide.
: Information Retrieval อาจารย์ ธีภากรณ์ นฤมาณนลิณี
RemoteXs User Guide for accessing e-resources India Institute of Technology Jodhpur Library For more details and any query please contact us Phone: (91.
S ERVLETS Form Data 19-Mar-16. F ORM P ROCESSING You must have come across many situations when you need to pass some information from your browser to.
ANGEL Penn State’s Course Management System Created by PSY Office of C&IS.
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
A little PHP. Enter the simple HTML code seen below.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Chapter 7 - Introduction to Common Gateway Interface (CGI)
At the Workforce Development and Continuing Education Student Menu select Register for Noncredit course(s) under Registration.
System Navigation and Test Launch
Process of cst-registration
Rr Donnelley Custom point.
Instructions for WesleyWeb
To check your Pay Advice, select your point of entry from the Main Menu page of Owl Link. If you are a faculty member, select “Faculty”. If you are an.
Presentation transcript:

Project: search.cgi cs149 - PERL programming Submitted by: Sheshagiri Pai Instructor and Guide: Professor Jon Degallier Date: 05/22/2006

Executive Summary Fetch strings according to search criteria From the messages in the message board Display the search results Link the search results to the messages by message id

Setup Place search.cgi file in the student home directory by ftp chmode the file to 755 Login as user tt2 with password ********* Go to discussion board Click on the Search menu item This should bring up The “SEARCH” page.

Search page description Search Criteria: Any - any word present in the message All the words - in no particular order All the words - in order Expression - using AND or OR Search input - text box for the words to be searched Exact Match - if checked, else search is case-insensitive Search button - for carrying out the search and displaying the results

Query string params When search menu item is clicked, the search.cgi page is invoked with the following parameters: querystring: class=26930&&admin_id=jond&admin_name=Jon%20Degallier&b oard_name=26930&board_code=jond26930&name=Sheshagiri%20 ne

Main Algorithm if (!param('search_data')) { &create_form(); } else { &print_search_before_result(); &get_n_prepare_data(); foreach { &get_messages($topic); foreach { &separate_thread($message_file); foreach $message { if(&find_match()) { &process_found_message(); &print_search_result(); } } } } &print_search_after_result(); }

Search Form

Search Form - contd..

Search Results

Search Results - Linked Message

Create Form The parameters from the query string are gathered and passed as hidden parameters Also passed are the parameters for ‘search text’ and ‘exact match checkbox’ $userid = param('userid'); $board_code = param('board_code'); $admin_id = param('admin_id'); $class = param('class'); $board_name = param('board_name'); $topic_name = param('topic_name'); $name = param('name'); $group = param('group'); $ = param(' '); $admin_name = param('admin_name'); $admin_ = param('admin_ ');

Create Form - contd.. SEARCH Enter the string to search in the message boards Any All NO order All IN order Expression Search String: Exact Match:

Highlights : Existing methods get_n_prepare_data() open( INPUT, "<../../teachers/jond/boards/$board_name/topics.dat") or die("could not open boards/$board_name/topics.dat\n = = ; separate_thread() if($message_file =~ /\d$/) { open(INPUT, " = ; close INPUT; } # split the message by 'message_id::' to into a 'thread' array $thread = split(/message_id:: /, $thread);

Find Match sub find_match() { $menu_item = param('option'); # Take action based on the user's choice if ($menu_item == 1) { return &search_any(); } elsif ($menu_item == 2) { return &search_all_no_order(); } elsif ($menu_item == 3) { return &search_all_in_order(); } elsif ($menu_item == 4) { return &search_with_expression(); } else { print ” You have to select a criteria\n "; exit; }

Find Match - search_any() sub search_any() { #print "Search Any\n"; # method 1: find any of the terms in one message # loop through search array and search message content $search = = split(" ", { if($match eq "on") { if($message =~ m/\b$_\b/) { $search = 1; last; } } else { if($message =~ m/\b$_\b/i) { $search = 1; last; } return $search; }

Find Match - search_all_no_order() sub search_all_no_order() { #print "Search All in No order\n"; # method 2: find all the terms in one message $search = = split(" ", { if($match eq "on") { $search = 1; } else { $search = 0; last; } else { if($message =~ m/\b$_\b/i) { $search = 1; } else { $search = 0; last; } return $search; }

Find Match - search_all_in_order() sub search_all_in_order() { #print "Search All in order\n"; # method 3: find all the terms in order $search = 0; $search_all_order = if($match eq "on") { if($message =~ m/\b$search_all_order\b/) { $search = 1; } else { $search = 0; } else { if($message =~ m/\b$search_all_order\b/i) { $search = 1; } else { $search = 0; } return $search; }

Find Match - search_with_expression() Show in actual code

Process Found Message sub process_found_message() { # grab writer's name, message id, date, and subject # concatenate the above in one string separated by pipes(|) # push string to $found string $message = &trim($message); #print($message); $message_id_only = substr $message, 0, index($message, 'date_time::'); $message_id = "message_id:: "."$message_id_only"; #print("$message_id\n"); my $subject = substr $message, index($message, 'subject:: '), index($message, 'attach:: ')-index($message, 'subject:: '); #print("$subject\n"); $found = "$message_id"."|"."$date_time"."|"."$from"."|"."$subject"; #print(" $found "); }

Print Search Result sub print_search_result() { #foreach { # build a table of all found messages with links #containing all cgi variables in a string $userid_new = substr($userid, 0, -1); $name_new = substr($name, 0, -1); $ _new = substr($ , 0, -1); $admin_id_new = substr($admin_id, 0, -1); $admin_name_new = substr($admin_name, 0, -1); $board_name_new = substr($board_name, 0, -1); $board_code_new = substr($board_code, 0, -1); $group_new = substr($group, 0, -1); $message_id_only =~ s/^\s+//; #print($message_id_only);

Print Search Result - contd.. print(" <a href=\"new_message.cgi?userid=$userid_new&name=$name& =$ _new&". "admin_id=$admin_id_new&admin_name=$admin_name_new&board_name= $board_name_new&board_code=$board_code_new&". "group=$group_new&topic_name=$topic_path&message_id=$message_id_on ly\" target = \"_blank\">$found "); #} #end loop of found array }

Thanks Q & A