Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.marlovits.firstnames
Class MarlovitsFirstnameImporter

java.lang.Object
  extended by ch.elexis.util.ImporterPage
      extended by ch.marlovits.firstnames.MarlovitsFirstnameImporter

public class MarlovitsFirstnameImporter
extends ImporterPage

class for importing data into the table ch_marlovits_firstnames inside the importer dialog.

Author:
Harald Marlovits

Nested Class Summary
 class MarlovitsFirstnameImporter.HtmlParser
           
 
Nested classes/interfaces inherited from class ch.elexis.util.ImporterPage
ImporterPage.DBBasedImporter, ImporterPage.DirectoryBasedImporter, ImporterPage.FileBasedImporter, ImporterPage.ImporterJob, ImporterPage.ODBCBasedImporter
 
Field Summary
 
Fields inherited from class ch.elexis.util.ImporterPage
results
 
Constructor Summary
MarlovitsFirstnameImporter()
           
 
Method Summary
 void collect()
          collect data from dialog since when calling doImport the dialog has already been disposed of.
static int countLines(java.io.File file)
          return the number of lines in a file
 Composite createPage(Composite parent)
          Die Dialogseite erstellen, um ggf. eine Datenquelle auszuwählen oder weitere Erläuterungen zu geben.
 IStatus doImport(IProgressMonitor monitor)
          import data from online-databases or from a file. removes duplicates at the end of the proc
 java.lang.String getDescription()
          Eine längere Beschreibung für den Message-Bereich des Dialogs
static IProgressMonitor getSubMonitor(IProgressMonitor pMonitor, int pMainTaskTicks)
           
 java.lang.String getTitle()
          Ein Titel, der auf der Titelzeile des Importers erscheint
static java.lang.String readContent(java.lang.String urlText)
          return the contents of a html page, use default encoding
static java.lang.String readContent(java.lang.String urlText, java.lang.String charSet)
          return the contents of a html page
 boolean removeDuplicates(IProgressMonitor monitor)
          remove duplicates in imported entries from the db: calc unisex genders or delete duplicates
 
Methods inherited from class ch.elexis.util.ImporterPage
run, setInitializationData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarlovitsFirstnameImporter

public MarlovitsFirstnameImporter()
Method Detail

getTitle

public java.lang.String getTitle()
Description copied from class: ImporterPage
Ein Titel, der auf der Titelzeile des Importers erscheint

Specified by:
getTitle in class ImporterPage

getDescription

public java.lang.String getDescription()
Description copied from class: ImporterPage
Eine längere Beschreibung für den Message-Bereich des Dialogs

Specified by:
getDescription in class ImporterPage

createPage

public Composite createPage(Composite parent)
Description copied from class: ImporterPage
Die Dialogseite erstellen, um ggf. eine Datenquelle auszuwählen oder weitere Erläuterungen zu geben.

Specified by:
createPage in class ImporterPage
Parameters:
parent - Achtung: Hat schon ein GridlLayout, darf nicht geändert werden.

collect

public void collect()
collect data from dialog since when calling doImport the dialog has already been disposed of. Also do the error messages here because calling SWTHelper.alert and similar methods does not work inside doImport. I'm forcing cancelling the dialog by forcing an exception...

Overrides:
collect in class ImporterPage

doImport

public IStatus doImport(IProgressMonitor monitor)
                 throws java.lang.Exception
import data from online-databases or from a file. removes duplicates at the end of the proc

Specified by:
doImport in class ImporterPage
Throws:
java.lang.Exception

removeDuplicates

public boolean removeDuplicates(IProgressMonitor monitor)
remove duplicates in imported entries from the db: calc unisex genders or delete duplicates

Returns:
true if the process has been cancelled by the user

readContent

public static java.lang.String readContent(java.lang.String urlText)
                                    throws java.io.IOException,
                                           java.net.MalformedURLException
return the contents of a html page, use default encoding

Parameters:
urlText - = the url from where the page should be read
Returns:
String, the contents of the page
Throws:
java.io.IOException
java.net.MalformedURLException

readContent

public static java.lang.String readContent(java.lang.String urlText,
                                           java.lang.String charSet)
                                    throws java.io.IOException,
                                           java.net.MalformedURLException
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

countLines

public static int countLines(java.io.File file)
                      throws java.io.IOException
return the number of lines in a file

Parameters:
file -
Returns:
Throws:
java.io.IOException

getSubMonitor

public static IProgressMonitor getSubMonitor(IProgressMonitor pMonitor,
                                             int pMainTaskTicks)

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis