Hey guys,
I've got a system asset loading into MSM without any errors but it's not appearing in the System Management folder in the asset manager.
I think I know where this might not be working for me… In the example file you sent (package_manager_yourpackage.inc) there is the following function;
function &createYourSystemAsset() { // we get the system management folder asset that we will use as the parent for our new system asset $system_management_folder = &$GLOBALS['SQ_SYSTEM']->am->getAsset($GLOBALS['SQ_SYSTEM_ASSETS']['system_management_folder']); // create a new system asset $GLOBALS['SQ_SYSTEM']->am->includeAsset('your_system_asset'); $your_system_asset = new Search_Manager(); $your_system_asset_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'exclusive' => 1); if (!$your_system_asset->create($your_system_asset_link)) trigger_error('Your System Asset NOT CREATED', E_USER_ERROR); pre_echo('Your System Asset Asset Id : '.$your_system_asset->id); $GLOBALS['SQ_SYSTEM_ASSETS']['your_system_asset'] = $your_system_asset->id; return $your_system_asset; }
In my version of this file I've made a few changes that seemed obvious but I'm wondering if the are now. Every occurance of [i]your_system_asset[/i] has been replaced with [i]doc_importer[/i] so, for example [i]$your_system_asset_link[/i] became [i]$doc_importer_link[/i]
I don't see how this could have prevented things working and suspect it would be needed in order to get a package with several system assets to load them all in.
I've also done the same thing with the function name renaming it based on the type_code.
i.e. asset.xml has this; <type_code>doc_importer</type_code> and I've named the function createDocImporter().
I'm pretty sure I've either missed something or something was not covered in the examples that were sent. I'm thinking that createDocImporter() need to be called somewhere or something in there isn't quite right.
The following is the actual function I'm using.;
function &createDocImporter() { // we get the system management folder asset that we will use as the parent for our new system asset $system_management_folder = &$GLOBALS['SQ_SYSTEM']->am->getAsset($GLOBALS['SQ_SYSTEM_ASSETS']['system_management_folder']); // create a new system asset $GLOBALS['SQ_SYSTEM']->am->includeAsset('doc_importer'); $doc_importer = new Doc_Importer(); $doc_importer_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'exclusive' => 1); if (!$doc_importer->create($doc_importer_link)) trigger_error('Document Importer Asset NOT CREATED', E_USER_ERROR); pre_echo('Doc Importer Asset Id : '.$doc_importer->id); $GLOBALS['SQ_SYSTEM_ASSETS']['doc_importer'] = $doc_importer->id; return $doc_importer; }</pre><br />
Any thoughts on this one?
Cheers,
Gold