Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.marlovits.addressSearch.directories
Class DirectoriesContentParser

java.lang.Object
  extended by ch.marlovits.addressSearch.directories.HtmlParser
      extended by ch.marlovits.addressSearch.directories.DirectoriesContentParser

public class DirectoriesContentParser
extends HtmlParser


Constructor Summary
DirectoriesContentParser(java.lang.String htmlText, java.lang.String name, java.lang.String geo, java.lang.String country)
           
 
Method Summary
 java.util.List<KontaktEntry> extractKontakte()
          Extrahiert Informationen aus dem retournierten Html.
static java.lang.String extractVornamen(java.lang.String firstnames, java.lang.String delimiter)
           
static java.lang.String formatPhoneNumber(java.lang.String phoneNumber, java.lang.String country)
          Format a phone number as swiss phone number, 0xx xxx xx xx
static java.lang.String formatPhoneNumber(java.lang.String phoneNumber, java.lang.String country, java.lang.String inFormat, java.lang.String outFormat)
          Format a phone number according to your needs.
static java.lang.String formatString(java.lang.String sourceString)
          reformat string correctly which came from vCard from tel.local.ch
 java.lang.String[][] getCitiesHitList()
          returns a list of possibly matching city names if the entered city could not be found
 java.lang.String getCitiesHitListMessage()
           
static java.lang.String getDocReturnCharacter(java.lang.String contents)
           
 int getNumOfEntries()
          extracts the total number of found entries
 java.lang.String getSearchInfo()
          Informationen zur Suche werden extrahiert.
 boolean hasCitiesList()
           
static KontaktEntry parseVCard(java.lang.String vCardURL, java.lang.String country)
           
static java.lang.String readContent(java.lang.String urlText, java.lang.String charSet)
          read and return the contents of a html page
 
Methods inherited from class ch.marlovits.addressSearch.directories.HtmlParser
extract, extractTo, getNextPos, getNextPos, getTail, moveTo, reset, setHtmlText, startsWith
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoriesContentParser

public DirectoriesContentParser(java.lang.String htmlText,
                                java.lang.String name,
                                java.lang.String geo,
                                java.lang.String country)
Method Detail

getSearchInfo

public java.lang.String getSearchInfo()
Informationen zur Suche werden extrahiert. Bsp:
23 Treffer für müller hans in bern


getNumOfEntries

public int getNumOfEntries()
extracts the total number of found entries

Returns:
number of found entries

hasCitiesList

public boolean hasCitiesList()

getCitiesHitListMessage

public java.lang.String getCitiesHitListMessage()

getCitiesHitList

public java.lang.String[][] getCitiesHitList()
returns a list of possibly matching city names if the entered city could not be found

Returns:
String[] the list of city-pairs, null if none found. each entry consist of following parts: city - selectable. if the entry is not selectable, then it is a category for the following entries

extractKontakte

public java.util.List<KontaktEntry> extractKontakte()
                                             throws java.io.IOException
Extrahiert Informationen aus dem retournierten Html. Anhand der
kann entschieden werden, ob es sich um eine Liste oder einen Detaileintrag (mit Telefon handelt). Detaileinträge: "adrNameDetLev0", "adrNameDetLev1", "adrNameDetLev3" Nur Detaileintrag "adrNameDetLev2" darf nicht extrahiert werden Listeinträge: "adrListLev0", "adrListLev1", "adrListLev3" Nur Listeintrag "adrListLev0Cat" darf nicht extrahiert werden

Throws:
java.io.IOException

getDocReturnCharacter

public static java.lang.String getDocReturnCharacter(java.lang.String contents)

extractVornamen

public static java.lang.String extractVornamen(java.lang.String firstnames,
                                               java.lang.String delimiter)
Parameters:
firstnames - input
delimiter - used to separate the firstnames
Returns:
the separated firstnames, delimited by <delimiter>

parseVCard

public static KontaktEntry parseVCard(java.lang.String vCardURL,
                                      java.lang.String country)

formatString

public static java.lang.String formatString(java.lang.String sourceString)
reformat string correctly which came from vCard from tel.local.ch

Parameters:
sourceString -
Returns:
the correctly formatted string

formatPhoneNumber

public static java.lang.String formatPhoneNumber(java.lang.String phoneNumber,
                                                 java.lang.String country)
Format a phone number as swiss phone number, 0xx xxx xx xx

Parameters:
phoneNumber - the phoneNumber as returned from vCard from tel.local.ch, eg. +41523439772
Returns:
the reformatted phone number. if the input is not formatted correctly, then the function returns an empty string

formatPhoneNumber

public static java.lang.String formatPhoneNumber(java.lang.String phoneNumber,
                                                 java.lang.String country,
                                                 java.lang.String inFormat,
                                                 java.lang.String outFormat)
Format a phone number according to your needs. NOT YET IMPLEMENTED

Parameters:
phoneNumber - the phoneNumber as returned from vCard from tel.local.ch, eg. +41523439772
inFormat - the format of the input
outFormat - how to format the output
Returns:
the reformatted phone number. if the input is not formatted correctly, then the function returns an empty string

readContent

public static java.lang.String readContent(java.lang.String urlText,
                                           java.lang.String charSet)
                                    throws java.io.IOException,
                                           java.net.MalformedURLException
read and return the contents of a html page

Parameters:
urlText - = the url from where the page should be read
charSet - = the character set to be used for page-encoding
Returns:
String, the contents of the page
Throws:
java.io.IOException
java.net.MalformedURLException

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis