Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.ematgine.utils.parser.html
Class transformed_html  view transformed_html download transformed_html.java

java.lang.Object
  extended byorg.ematgine.threads.ematgine_thread
      extended byorg.ematgine.utils.parser.html.transformed_html
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.lang.Runnable

public class transformed_html
extends org.ematgine.threads.ematgine_thread

This class implements the functionalities to treat the html files It has been adapted from the first perl version of the server and has BAD quality / is NOT object oriented designed... What a pity that most of the S1000 service is based on it !!! :-) Concurrent Versions System $Id: transformed_html.java,v 1.11 2002/05/22 20:10:00 MB Exp $


Field Summary
private  myurls base_url
          Defines the base url define in the document
private  boolean downloadImages
          download images or not
private  java.lang.String downloadStatus
          Description of the Field
private  int frame_number_in_file
          How many frames in this file
private  int image_number_in_file
          How many images in this file
private  java.util.GregorianCalendar launch_date
          to define the launch date of the request thread
private  java.lang.String mailto
          Defines the mail server adress
private  html_file my_html_file
          Description of the Field
private  java.util.Vector my_transformed_frame_vector
          the frames adresses in this file
private  java.util.Vector my_transformed_image_vector
          the images adresses in this file
private  java.net.HttpURLConnection myurlconnection
          Description of the Field
private  myurls requested_url
          Defines the requested url
private  boolean stop_all_processing
          Description of the Field
private  java.lang.Thread thread
          Description of the Field
private  int thread_number
          debug informations
private  int traceLevel
          enable the debug trace 0 = no trace, other = trace level
private  boolean transform_links
          Description of the Field
private  java.util.Hashtable wholeRequest
          define extra parameters for the download
 
Fields inherited from class org.ematgine.threads.ematgine_thread
internal_requests, killed, PDU_number, queues, runner, semaphores, stopped, sub_thread_name, the_thread, thread_name
 
Constructor Summary
transformed_html(java.util.Hashtable queueParams, java.util.Hashtable semaphoreParams, myurls _myurl, int the_thread_number, java.lang.String the_mailto, java.lang.String the_filename, java.util.Hashtable the_wholeRequest)
          Constructor for the transformed_html object
 
Method Summary
 void add_image_file(java.lang.String fullfilename)
          Add image files location on disk : directory and filename
private  void check_infinite_loop()
          to verify ifinite loop
private  void delete_base_tag()
          find the base tag in the file and delete it
private  void fill_buffer(int line, java.lang.String whole_line)
          Description of the Method
private  void find_all_form_anchors()
          Description of the Method
private  void find_all_frame_anchors()
          Description of the Method
private  void find_all_html_anchors()
          Description of the Method
private  void find_all_image_anchors()
          Description of the Method
private  int find_anchor_end_line(int line_number, int position_anchor_begin)
          Recherche la fin de l'ancre Renvoie la position en terme de numero de ligne Description of the Method
private  int find_anchor_end_position(int href_begin, int position_href_line)
          Recherche la fin de l'ancre Renvoie la position en terme de position dans la ligne line_number begin : position anchor begin
private  int find_anchor(int line_number, int begin, java.lang.String anchor)
          Recherche les differents types d'ancre puis retourne la position de debut de l'ancre si elle existe sur la ligne begin = a partir d'ou cherche-t-on l'ancre dans la ligne
private  java.lang.String find_base()
          find the base tag in the file and return the document base
private  int find_href_line(int line_number, int begin, java.lang.String hreference)
          Description of the Method
private  int find_href_position(int begin, java.lang.String hreference, int position_href_line)
          Description of the Method
private  int find_href_text_line(int line_href, int position_href, int length)
          Recherche la ligne ou se trouve de href_text : href_text_end presence d'un caractere different d'un caractere de fin de ligne
private  int find_href_text_position(int line_href, int position_href, int length)
          Recherche la ligne ou se trouve de href_text : href_text_end presence d'un caractere different d'un caractere de fin de ligne
private  int find_line_href_text_end(int position_href, int line_href)
          Recherche la fin de href_text : href_text_end
private  int find_position_href_text_end(int position_href, int line_href)
          Recherche la fin de href_text : href_text_end
private  int find_tag(java.lang.String tag)
          Description of the Method
 int get_frame_number_in_file()
          Description of the Method
 int get_frame_number()
          Gets the number of identified frames in html files
 transformed_image get_image_link(int number)
          Description of the Method
 int get_image_number_in_file()
          Description of the Method
 int get_image_number()
          Description of the Method
 html_file get_my_html_file()
          Description of the Method
 myurls get_requested_url()
          Description of the Method
 boolean get_stop_all_processing()
          get Stop all processing data to know if the object has interrupted is treatment itself
 transformed_frame get_transformed_frame(int nb)
          Description of the Method
 java.lang.String getdownloadStatus()
          Description of the Method
 long getFileSize()
          Gets the hTMLFileSize attribute of the transformed_html object
private  long getHTMLFileSize()
          Gets the hTMLFileSize attribute of the transformed_html object
private  long getImageFileSize()
          Gets the imageFileSize attribute of the transformed_html object
 java.lang.String getImagefullfilename(int nb)
          Gets the fullfilename attribute of a transformed_image
 transformed_image getTransformed_image(int nb)
          Gets a transformed_image attribute of the transformed_html object
private  void increment_frame_number_in_file()
          Description of the Method
private  void increment_image_number_in_file()
          Description of the Method
private  void index_anchors(int line_number, java.lang.String hreference, java.lang.String anchor)
          Find the anchor at line line_number and the position in the line : hreference
 void my_join()
          to join with an analyser
 void my_start()
           
 void putOnDisk(java.lang.String directory)
          Description of the Method
 void run()
          Main processing method for the transformed_html object
private  void setdownloadStatus(java.lang.String tex)
          Sets the downloadStatus attribute of the transformed_html object
private  java.lang.String stock_frame_link(java.lang.String tex)
          This method create a new name for a frame or use a previous defined one
private  java.lang.String stock_image_link(java.lang.String tex)
          Verify if a image has already been stored if yes, it returns the transformed link if no, it creates the transformed link and return it
 void stop_all_processing()
          Stop all processing on html file
private  void test_stock_anchors()
          A unit test for JUnit
private  void test_stock_frame_anchors()
          A unit test for JUnit
private  void transfer_file_to_string_array(java.lang.String filename)
          Description of the Method
 void transfer_url_to_buffer()
          Description of the Method
 void transform_links()
          Description of the Method
 void treat_frames()
          Description of the Method
 boolean verify_file_name()
          Description of the Method
 boolean verify_frame_appearance()
          Is there any frames in this file
 
Methods inherited from class org.ematgine.threads.ematgine_thread
acquire_semaphore, actionPerformed, addWaitingPDU, attempt_semaphore, display_hashtable, displayQueuesSize, get_date_toString, get_PDU, get_several_PDU, get_sub_thread_name, get_thread_name, getWaitingPDU, increment_PDU_number, internalService_addPDURequest, internalService_getPDURequest, internalService_PDURequest_size, isAwaited, numberOfWaitingPDU, poll_PDU, print_screen, println_access_log, println_access_log, println_error_log, println_error_log, println_pdu_log, println_screen, println_screen, release_semaphore, removeWaitingPDU, send_PDU_mail_with_filenames, send_PDU_mail_with_html_files, send_PDU_mail_with_part_of_file, send_PDU_without_polling, send_PDU, send_PDU, send_PDU, send_waiting_PDU, set_priority, set_sub_thread_name, set_thread_name, sleep, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thread_number

private int thread_number
debug informations


mailto

private java.lang.String mailto
Defines the mail server adress


requested_url

private myurls requested_url
Defines the requested url


wholeRequest

private java.util.Hashtable wholeRequest
define extra parameters for the download


base_url

private myurls base_url
Defines the base url define in the document


myurlconnection

private java.net.HttpURLConnection myurlconnection
Description of the Field


image_number_in_file

private int image_number_in_file
How many images in this file


my_transformed_image_vector

private java.util.Vector my_transformed_image_vector
the images adresses in this file


frame_number_in_file

private int frame_number_in_file
How many frames in this file


my_transformed_frame_vector

private java.util.Vector my_transformed_frame_vector
the frames adresses in this file


my_html_file

private html_file my_html_file
Description of the Field


thread

private java.lang.Thread thread
Description of the Field


stop_all_processing

private boolean stop_all_processing
Description of the Field


transform_links

private boolean transform_links
Description of the Field


launch_date

private java.util.GregorianCalendar launch_date
to define the launch date of the request thread


downloadImages

private boolean downloadImages
download images or not


downloadStatus

private java.lang.String downloadStatus
Description of the Field


traceLevel

private int traceLevel
enable the debug trace 0 = no trace, other = trace level

Constructor Detail

transformed_html

public transformed_html(java.util.Hashtable queueParams,
                        java.util.Hashtable semaphoreParams,
                        myurls _myurl,
                        int the_thread_number,
                        java.lang.String the_mailto,
                        java.lang.String the_filename,
                        java.util.Hashtable the_wholeRequest)
Constructor for the transformed_html object

Method Detail

stop_all_processing

public void stop_all_processing()
Stop all processing on html file


get_stop_all_processing

public boolean get_stop_all_processing()
get Stop all processing data to know if the object has interrupted is treatment itself


my_start

public void my_start()

my_join

public void my_join()
to join with an analyser


check_infinite_loop

private void check_infinite_loop()
to verify ifinite loop


test_stock_anchors

private void test_stock_anchors()
A unit test for JUnit


test_stock_frame_anchors

private void test_stock_frame_anchors()
A unit test for JUnit


putOnDisk

public void putOnDisk(java.lang.String directory)
Description of the Method


get_image_link

public transformed_image get_image_link(int number)
Description of the Method


get_transformed_frame

public transformed_frame get_transformed_frame(int nb)
Description of the Method


get_my_html_file

public html_file get_my_html_file()
Description of the Method


getFileSize

public long getFileSize()
Gets the hTMLFileSize attribute of the transformed_html object


getHTMLFileSize

private long getHTMLFileSize()
Gets the hTMLFileSize attribute of the transformed_html object


getImageFileSize

private long getImageFileSize()
Gets the imageFileSize attribute of the transformed_html object


get_image_number

public int get_image_number()
Description of the Method


get_image_number_in_file

public int get_image_number_in_file()
Description of the Method


getImagefullfilename

public java.lang.String getImagefullfilename(int nb)
Gets the fullfilename attribute of a transformed_image


getTransformed_image

public transformed_image getTransformed_image(int nb)
Gets a transformed_image attribute of the transformed_html object


get_frame_number

public int get_frame_number()
Gets the number of identified frames in html files


get_frame_number_in_file

public int get_frame_number_in_file()
Description of the Method


get_requested_url

public myurls get_requested_url()
Description of the Method


increment_image_number_in_file

private void increment_image_number_in_file()
Description of the Method


increment_frame_number_in_file

private void increment_frame_number_in_file()
Description of the Method


verify_frame_appearance

public boolean verify_frame_appearance()
Is there any frames in this file


treat_frames

public void treat_frames()
Description of the Method


add_image_file

public void add_image_file(java.lang.String fullfilename)
Add image files location on disk : directory and filename


find_all_frame_anchors

private void find_all_frame_anchors()
Description of the Method


transform_links

public void transform_links()
Description of the Method


fill_buffer

private void fill_buffer(int line,
                         java.lang.String whole_line)
Description of the Method


verify_file_name

public boolean verify_file_name()
Description of the Method


transfer_file_to_string_array

private void transfer_file_to_string_array(java.lang.String filename)
Description of the Method


find_all_image_anchors

private void find_all_image_anchors()
Description of the Method


find_all_html_anchors

private void find_all_html_anchors()
Description of the Method


find_all_form_anchors

private void find_all_form_anchors()
Description of the Method


find_tag

private int find_tag(java.lang.String tag)
Description of the Method


stock_image_link

private java.lang.String stock_image_link(java.lang.String tex)
Verify if a image has already been stored if yes, it returns the transformed link if no, it creates the transformed link and return it


stock_frame_link

private java.lang.String stock_frame_link(java.lang.String tex)
This method create a new name for a frame or use a previous defined one


index_anchors

private void index_anchors(int line_number,
                           java.lang.String hreference,
                           java.lang.String anchor)
Find the anchor at line line_number and the position in the line : hreference


find_href_text_line

private int find_href_text_line(int line_href,
                                int position_href,
                                int length)
Recherche la ligne ou se trouve de href_text : href_text_end presence d'un caractere different d'un caractere de fin de ligne


find_href_text_position

private int find_href_text_position(int line_href,
                                    int position_href,
                                    int length)
Recherche la ligne ou se trouve de href_text : href_text_end presence d'un caractere different d'un caractere de fin de ligne


find_line_href_text_end

private int find_line_href_text_end(int position_href,
                                    int line_href)
Recherche la fin de href_text : href_text_end


find_position_href_text_end

private int find_position_href_text_end(int position_href,
                                        int line_href)
Recherche la fin de href_text : href_text_end


find_anchor

private int find_anchor(int line_number,
                        int begin,
                        java.lang.String anchor)
Recherche les differents types d'ancre puis retourne la position de debut de l'ancre si elle existe sur la ligne begin = a partir d'ou cherche-t-on l'ancre dans la ligne


find_href_position

private int find_href_position(int begin,
                               java.lang.String hreference,
                               int position_href_line)
Description of the Method


find_href_line

private int find_href_line(int line_number,
                           int begin,
                           java.lang.String hreference)
Description of the Method


find_anchor_end_position

private int find_anchor_end_position(int href_begin,
                                     int position_href_line)
Recherche la fin de l'ancre Renvoie la position en terme de position dans la ligne line_number begin : position anchor begin


find_anchor_end_line

private int find_anchor_end_line(int line_number,
                                 int position_anchor_begin)
Recherche la fin de l'ancre Renvoie la position en terme de numero de ligne Description of the Method


transfer_url_to_buffer

public void transfer_url_to_buffer()
Description of the Method


setdownloadStatus

private void setdownloadStatus(java.lang.String tex)
Sets the downloadStatus attribute of the transformed_html object


getdownloadStatus

public java.lang.String getdownloadStatus()
Description of the Method


delete_base_tag

private void delete_base_tag()
find the base tag in the file and delete it


find_base

private java.lang.String find_base()
find the base tag in the file and return the document base


run

public void run()
Main processing method for the transformed_html object