All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.pics.DataBaseService

java.lang.Object
   |
   +----w3c.jigsaw.pics.DataBase
           |
           +----w3c.jigsaw.pics.DataBaseService

public class DataBaseService
extends DataBase
implements LabelServiceInterface
The internal representation of a LabelService. A LabelService is an object which should be able to deliver labels for any URL. This implementation use a fancy database, via JDBC.

For each requested labels, the DataBaseService is looked up for the appropriate URL in the database. So if you want to consult a DataBaseService, you have to call DataBaseService (Properties P, String name) where P is a Properties Object containing information about the database and name the url relative to the service. The properties file (dbs.props) must be in the LabelBureau directory.


Variable Index

 o DB_GENERIC_FIELD_P
The property key relative to the name of the field containing the generic flag.
 o DB_LABEL_FIELD_P
The property key relative to the name of the label field.
 o DB_SERVICE_FIELD_P
The property key relative to the name of the service field.
 o DB_URL_FIELD_P
The property key relative to the name of the url field.

Constructor Index

 o DataBaseService(Properties, String)

Method Index

 o addLabel(String, String, boolean, boolean)
Add a new label in the DataBaseService.
 o delLabel(String)
Delete a label in the DataBaseService.
 o dump(StringBuffer, int)
Dump this service description into the given buffer.
 o getGenericLabel(URL)
Get the most specific generic label for an URL.
 o getGenericTreeLabels(URL)
Get the generic tree labels for given URL.
 o getLabelFromUrl(String)
Get the label telative to the given url in the DataBaseService.
 o getName()
Get this service name
 o getSpecificLabel(URL)
Get the specific label for the given URL.
 o getTreeLabels(URL)
Get the tree labels for the given URL.
 o list()
Get the list of the labels in HTML format

Variables

 o DB_SERVICE_FIELD_P
 public static final String DB_SERVICE_FIELD_P
The property key relative to the name of the service field.

 o DB_URL_FIELD_P
 public static final String DB_URL_FIELD_P
The property key relative to the name of the url field.

 o DB_LABEL_FIELD_P
 public static final String DB_LABEL_FIELD_P
The property key relative to the name of the label field.

 o DB_GENERIC_FIELD_P
 public static final String DB_GENERIC_FIELD_P
The property key relative to the name of the field containing the generic flag.

Constructors

 o DataBaseService
 public DataBaseService(Properties P,
                        String name) throws UnknownServiceException

Methods

 o getName
 public String getName()
Get this service name

Returns:
A String instance, being the service name.
 o list
 public String list()
Get the list of the labels in HTML format

Returns:
A String instance, being the HTML list.
 o delLabel
 public boolean delLabel(String url)
Delete a label in the DataBaseService.

Parameters:
url - The url labelled.
Returns:
true if the label was correctly deleted.
 o addLabel
 public boolean addLabel(String url,
                         String label,
                         boolean gen,
                         boolean ov) throws MalformedURLException
Add a new label in the DataBaseService.

Parameters:
url - The url to label.
label - The label relative to the given url.
gen - Add generic label if true.
Returns:
true if the label was correctly added.
 o getLabelFromUrl
 public String getLabelFromUrl(String url)
Get the label telative to the given url in the DataBaseService.

Parameters:
url - The url.
Returns:
String The label relative to the url or ""
 o getSpecificLabel
 public LabelInterface getSpecificLabel(URL u)
Get the specific label for the given URL.

Parameters:
url - The URL whose label is searched.
 o getGenericLabel
 public LabelInterface getGenericLabel(URL u)
Get the most specific generic label for an URL.

Parameters:
url - The URL whose generic label is to be retreived.
Returns:
An object conforming to the LabelInterface, or null if none was found.
 o getTreeLabels
 public LabelInterface[] getTreeLabels(URL u)
Get the tree labels for the given URL.

Parameters:
url - The URL whose tree labels are to be retreived.
Returns:
An array of SampleLabel, each comforming to the LabelInterface.
 o getGenericTreeLabels
 public LabelInterface[] getGenericTreeLabels(URL u)
Get the generic tree labels for given URL.

Parameters:
url - The URL whose tree labels are to be retreived.
Returns:
An array of SampleLabel, each of which conforms to the LabelInterface.
 o dump
 public void dump(StringBuffer into,
                  int format)
Dump this service description into the given buffer.

Parameters:
into - The StringBuffer to dump the service to.

All Packages  Class Hierarchy  This Package  Previous  Next  Index