예제 #1
0
<!DOCTYPE html>
<html lang="de">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  </head>
  <body><?php 
include dirname(__FILE__) . "/class.xmi2db.php";
include dirname(__FILE__) . "/conf/database_conf.php";
// Call the class with the root element of the xmi data
$xmi2db = new xmi2db("XMI.content");
if (isset($_REQUEST['file'])) {
    $xmi2db->setXMIFile($_REQUEST['file']);
} else {
    $xmi2db->setXMIFile("XPlanGML-xmi12-uml14.xml");
}
if (isset($_REQUEST['schema'])) {
    $xmi2db->setSchema($_REQUEST['schema']);
} else {
    $xmi2db->setSchema("xplan_eatest");
}
if (isset($_REQUEST['basepackage'])) {
    $xmi2db->setBasePackage($_REQUEST['basepackage']);
} else {
    $xmi2db->setBasePackage("XPlanGML 4.1");
}
// Set (path to) XMI file
//$xmi2db->setXMIFile("xplan_short.xml");
//$xmi2db->setXMIFile("XPlanGML-xmi12-uml14.xml");
// Set db schema
//$xmi2db->setSchema("xplan_eatest");
// Set base package
예제 #2
0
파일: xmi2db.php 프로젝트: pkorduan/xmi2db
<?php

// +----------------------------------------------------------------------+
// | xmi2db                                                               |
// | Creating SQL Queries from an xmi file                                |
// | Requirements: PHP5 with SimpleXMI Support                            |
// +----------------------------------------------------------------------+
// | Author: Christian Seip <*****@*****.**>               |
// +----------------------------------------------------------------------+
// based on http://www.phpclasses.org/package/2272-PHP-Generate-SQL-queries-to-import-data-from-XML-files.html
//Begin Start Pascoul
require_once '../lib/pascoul/pascoul.php';
include '../classes/schema.php';
include '../classes/logger.php';
include '../conf/database_conf.php';
$xmi2db = new xmi2db("XMI.content");
#Set DB connection
$schema = new Schema($xmi2db->schema, new Logger(0));
$xmi2db->setConn($schema->openConnection(PG_HOST, PG_DBNAME, PG_USER, PG_PASSWORD));
$xmi2db->start();
class xmi2db
{
    private $root_element;
    private $table;
    private $data;
    private $xmi_file;
    private $basePackage;
    private $progress;
    /**
     * Constructor
     *