Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Europass Java Standalone Application Europass Java Standalone Applicationation 1. Developer’s guide 1.1 How the code was written All the code was written under the "JDeveloper 10.1.3.3.0" tool. Other tools that used to create the database scheme are PLSQL developer (Oracle), MySQL Query Browser (MySQL), SQL Server 2000 (SQL Server). 1.2 What classes contains and what they do The application uses the following classes: ExtractAttachments.java This class extracts the attachment files from a PDF file. Class constructor public ExtractAttachments( InputStream in, File trgfile ) throws IOException; Parameters: in - the InputStream of the PDF file trgfile - the extract (XML) file path Throws: IOException Methods Details public void execute() throws Exception; Extract the attachment file Throws: Exception public void unpackFile( PdfDictionary filespec ) throws IOException; Get the attachment file Parameters: filespec Throws: IOException HibernateUtil.java This class contains all the necessary methods to connect with databases using hibernate. Methods Details public static void closeSession() throws HibernateException; Close the hibernate session Throws: HibernateException public static Session currentSession() throws HibernateException; Return the current hibernate session or open a new one. Returns: the current hibernate session Throws: HibernateException public static Session getHibSession(); Returns the hibernate session using the configuration property file. Returns: the hibernate session public static void initialize( String sqlDialect ); Initializing the hibernate configuration. Parameters: sqlDialect - the hibernate sql dialect (SQL server, MySQL, Oracle) InstoreNamingStrategy.java This class is a helpful class for hibernate configuration. Field Detail public static final NamingStrategy INSTANCE; The singleton instance Constructor Detail InstoreNamingStrategy public InstoreNamingStrategy(); Public constructor needed for SchemaExportTask SoftTool.java (main class) This class implements an application that simply stores the XML data from a file to the database. SoftToolFrame_AboutBoxPanel1.java The Help About dialog box. Constructor Detail public SoftToolFrame_AboutBoxPanel1(); Class constructor SoftToolFrame_Config.java The configuration dialog box panel. Constructor Detail SoftToolFrame_Config public SoftToolFrame_Config(); Class constructor Methods Details public String getFldDatabasename(); Returns the database name. Returns: the database name public String getFldPassword(); Returns the database password. Returns: the database password public String getFldURL(); Returns the database url. Returns: the database url public String getFldUsername(); Returns the database username. Returns: the database username public boolean getMySQL(); Returns the mySQL status. Returns: the mySQL status public boolean getOracle(); Returns the Oracle status. Returns: the Oracle status public boolean getSqlServer(); Returns the sql server status. Returns: the sql server status void mySQL_ActionPerformed( ActionEvent e ); Fires when the user select the mySQL status Parameters: e - the action event void oracle_ActionPerformed( ActionEvent e ); Fires when the user select the Oracle status Parameters: e - the action event void sqlServer_ActionPerformed( ActionEvent e ); Fires when the user select the sql server status Parameters: e - the action event SoftToolFrame_XMLViewer.java The XML viewer Constructor Detail public SoftToolFrame_XMLViewer( File selFile ); Class constructor Parameters: selFile - the file that will be shown SoftToolFrame.java This is the main frame of the application. Constructor Detail public SoftToolFrame(); Class constructor Methods Details void fileConfiguration_ActionPerformed( ActionEvent e ); Fires when the user hit the Configuration button or Configuration menu option. Parameters: e - the action event void fileExit_ActionPerformed( ActionEvent e ); Fires when the user exit the application. Parameters: e - the action event void fileOpenPDFXML_ActionPerformed( ActionEvent e ); Fires when the user hit the PDF button or PDF menu option. Parameters: e - the action event void fileOpenXML_ActionPerformed( ActionEvent e ); Fires when the user hit the XML button or XML menu option. Parameters: e - the action event void helpAbout_ActionPerformed( ActionEvent e ); Fires when the user hit the help about button or help about menu option. Parameters: e - the action event SoftToolUtil.java This class contains all the necessary methods that needing to parse the PDF/XML file. Also contains all the necessary methods to save the XML data into the user’s database. Constructor Detail public SoftToolUtil(); Methods Details public static File createTempFile() throws Exception; This method is used only to temporary save the XML file. Returns: the temporary XML file public static String getProperty( String propertyName ); This method returns the property value of the configuration file property. Parameters: propertyName - the property name of the configuration file Returns: the value of the property public static InputStream getXML( File selFile ); This method is used to extract the attachment XML file from the PDF file. Parameters: selFile - the PDF selected file Returns: the InputStream of the XML file public static String saveConfig( String fldDatabasename, String fldPassword, String fldURL, String fldUsername, boolean sqlServer, boolean mySQL, boolean oracle ); This method is used to save the properties of the configuration file. Parameters: fldDatabasename - the database name fldPassword - the database password fldURL - the database URL fldUsername - the database username sqlServer - is SQL server? mySQL - is mySQL? oracle - is Oracle? Returns: the logs of the saving public static String saveFile( File xmlFile ); This method is used when the user select a XML file to open and save the XML data to the database. Parameters: xmlFile - the xml File Returns: the logs of the saving public static String saveFile( InputStream xmlStream ); This method is used when the user select a PDF file to open and save the XML data to the database. Parameters: xmlStream - a InputStream of the xml Returns: the logs of the saving public static String saveFile( Document doc ); This method is used from the previous methods saveFile(InputStream xmlStream), saveFile(File xmlFile) to parsing the XML data and store them to the database. Parameters: doc - the Document to be parse Returns: the logs of the saving public static String savePDFXML( File selFile ); This method is used to extract the attachment XML file from the PDF file. Parameters: selFile - the PDF selected file Returns: the logs of the saving public static String trunc( String in, int len ); This method is used to truncate a string to a specific length. Parameters: in - the PDF selected file len - the PDF selected file Returns: the InputStream of the XML file 1.3 Hibernate model The application uses hibernate 3.2 to store data to database. The model uses the following objects: Xml It’s the main hibernate database object contains all xml data except driving license data, education data, language data, nationality data and work experience data. DrivingLicence This is a detail hibernate database object contains the driving license data. Education This is a detail hibernate database object contains the education data. Language This is a detail hibernate database object contains the language data. Nationality This is a detail hibernate database object contains the nationality data. WorkExperience This is a detail hibernate database object contains the work experience data.