Beispiel #1
0
include_once KT_ATOM_LIB_FOLDER . 'KT_atom_baseDoc.inc.php';
include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_server.inc.php';
include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_response.inc.php';
//Containing the response feed class allowing easy atom feed generation
include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_responseFeed.inc.php';
//Containing the response feed class allowing easy atom feed generation
include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_serviceDoc.inc.php';
//Containing the servicedoc class allowing easy ServiceDocument generation
include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_service.inc.php';
//Containing the servicedoc class allowing easy ServiceDocument generation
include_once 'KT_cmis_atom_server.services.inc.php';
/**
 * Check Realm Authentication
 */
require_once KT_ATOM_LIB_FOLDER . 'KT_atom_HTTPauth.inc.php';
if (!KT_atom_HTTPauth::isLoggedIn()) {
    KT_atom_HTTPauth::login('KnowledgeTree DMS', 'You must authenticate to enter this realm');
}
//Start the AtomPubProtocol Routing Engine
$APP = new KT_cmis_atom_server();
$queryArray = split('/', trim($_SERVER['QUERY_STRING'], '/'));
$workspace = strtolower(trim($queryArray[0]));
if ($workspace == 'servicedocument') {
    // CMIS service document setup
    $APP->initServiceDocument();
    // User defined title tag
    $APP->addWorkspaceTag('dms', 'atom:title', $APP->repositoryInfo['repositoryName']);
}
/**
 * Register Services
 *
 /**
  * Get the KT singleton instance
  *
  * @return object
  */
 public static function getKt()
 {
     if (!isset(self::$ktapi)) {
         self::$ktapi = new KTAPI();
         $active = self::$ktapi->get_active_session(session_id());
         if (PEAR::isError($active)) {
             // invoke auth code, session must be restarted
             if (!KT_atom_HTTPauth::isLoggedIn()) {
                 KT_atom_HTTPauth::login('KnowledgeTree DMS', 'You must authenticate to enter this realm');
             }
         }
     }
     return self::$ktapi;
 }