コード例 #1
0
/**
* Create an asset of a specified type with associated metadata and attribute settings
*
* @param array	$asset_spec			The specification of the asset fields directly from the CSV import file
* @param string	$asset_type_code	The Matrix asset type code or the asset which is to be created
* @param object	&$parent_asset		The parent asset under which the new asset is to reside
* @param int	$schema_id			The asset ID of the Metadata Schema to associate with the new asset
* @param array	$metadata_mapping	A structure containing Supplied Field Name to Metadata Field asset ID associations
* @param array	$attribute_mapping	A structure containing Supplied Field Name to Asset Attribute Name associations
*
* @return void
* @access public
*/
function createAsset(array $asset_spec, $asset_type_code, Asset &$parent_asset, $schema_id, array $metadata_mapping, array $attribute_mapping)
{
    $attribs = array();
    echo '- Creating asset';
    $asset = new $asset_type_code();
    echo '.';
    // Set attributes
    editAttributes($asset, $asset_spec, $attribute_mapping);
    echo '.';
    // Link the new asset under the parent folder
    $link_id = createLink($parent_asset, $asset);
    echo '.';
    // Assign metadata schema and values to the asset
    editMetadata($asset, $asset_spec, $metadata_mapping, $schema_id);
    echo '.';
    // Free memory
    $GLOBALS['SQ_SYSTEM']->am->forgetAsset($asset);
    echo ' => asset ID ' . $asset->id . "\n";
    return array(reset($asset_spec) => $asset->id);
}
コード例 #2
0
ファイル: project.php プロジェクト: avilleret/Rekall
     }
 } else {
     if (isset($_GET["key"])) {
         if (isset($_GET["remove"])) {
             openProject();
             removeDocumentFromProject($_GET["key"]);
             closeProject();
         } else {
             if (isset($_GET["tcIn"]) && isset($_GET["tcOut"])) {
                 openProject();
                 editTc($_GET["key"], $_GET["tcIn"], $_GET["tcOut"]);
                 closeProject();
             } else {
                 if (isset($_GET["metadataKey"]) && isset($_GET["metadataValue"])) {
                     openProject();
                     editMetadata($_GET["key"], $_GET["metadataKey"], $_GET["metadataValue"]);
                     closeProject();
                 }
             }
         }
     } else {
         if (isset($_GET["video"])) {
             openProject();
             editProjectMeta("video", "url", $_GET["video"]);
             closeProject();
         } else {
             if (isset($_GET["remove"])) {
                 SureRemoveDir(realpath(".."), true);
             } else {
                 if (isset($_GET["downloadXML"])) {
                     $file_url = '../file/project.xml';