Can anyone tell me how to add an Asset so it's available in the admin area?
I've copied core/assets/page to core/assets/redirector and edited the content in there. It's not appearing in the Asset Tree though.
Obviously it's not just a matter of dropping a new directory in core/assets and it magically being spotted and made available. I've had a hunt around looking for some sort of index of the iassets in this directory but haven't found anything. Unless…
Hmm… The table sq_asset_type contains all the assets and sub-assets. I'm betting it's not just a matter of adding a record here.
scripts/regen_system_assets_config.php sounds promising. I might just run that and see what happens. Nope. That didn't make any noticeable difference.
You need to run install/step_03.php to get it to appear.
php install/step_03.php /path/to/mysource/root
Though, I would recommend making your changes in system_root/packages/<new package name>/<assets> – that way, you won't have problems when a new version of Matrix comes out that may change the core itself.
OK, currently I'm running the following command and getting this output.
[root@nswos install]# pwd
/var/www/mysource_matrix_3-1-0-RC1/install
[root@nswos install]# php step_03.php?SYSTEM_ROOT=/var/www/mysource_matrix_3-1-0-RC1
Status: 404
Content-type: text/html
X-Powered-By: PHP/4.3.8
No input file specified.I checked doc/install.txt but couldn't spot any directions as to what the input file should be. I'm assuming it's something to do with the .xml files in the packages directory?
I'll have a hunt around the boards after posting this.
Avi, is it just a matter of dropping the asset directory (calling it redirector) which is in the package directory (calling it babel.ext) in the packages dir?
e.g. /var/www/mysource_matrix_3-1-0-RC1/packages/babel.ext/redirector
I noticed a couple of packages/*.xml.sample files. Do I need to do anything with these?
It looks like your PHP binary isn't compiled for CLI support. If you run:
# php -v
PHP 4.3.8 (cli) (built: Jul 29 2004 13:57:16)
Copyright © 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies
You should see (cli) after the PHP version. If you see (cgi), you'll need to recompile PHP with CLI support.
Alternatively, re-run the web-based installer (it'll pick up the existing installation). It runs the same process at Step 16.
bugger…
[root@nswos mysource_matrix_3-1-0-RC1]# php -v
PHP 4.3.8 (cgi) (built: Aug 11 2004 17:06:00)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend TechnologiesWill try the web-based one as suggested.
OK, got the installer to accept the package. The following is what I've figured out (I'm maintaining internal docs which this is cut and paste from)
----
packages/babelext/package_manager_babelext.inc
This contains the package_manager_babelext class which extends Package_Manager. The constructor sets the variable _full_path to dirname(FILE)
This was discovered while debugging the import of the package via errors in the web-based installer.
Query :: What else can we do in here?
packages/babelext/package.xml
This appears to be a description of the package as a whole. Nothing to do with the actual Assets the package provides.
packages/babelext/redirector/asset.xml
A description of the Asset with a list of required Assets and minimum version of those Assets.
packages/babelext/redirector/edit_interface_create.xml
Describes the interface presented when an Asset is added via the Asset Manager. ie, the page name when adding a standard page.
packages/babelext/redirector/edit_interface_screen_details.xml
Describes the full editing interface for the Asset.
packages/babelext/redirector/icon.png
Icon for the Asset Map
packages/babelext/redirector/redirector_edit_fns.inc
Code to manage Asset edits?
packages/babelext/redirector/redirector.inc
Code to do what?
packages/babelext/redirector/redirector_management.inc
his appears to be what defines the Asset itself. Not the data the Asset works with, but the actual Asset. ie, the parameters it has etc.
----
If there's any glaring mistakes in this could you please point them out?
The above structure (after much trial and error) was successfully imported during the run of the web-installer. So, I'm thinking that it's meeting a certain minimum level of functionality to get that far.
However, my new asset doesn't appear on the Add menu in the Asset Manager. Can someone point me to an example asset (preferably listing the file and function(s)) to make this happen?
[quote]packages/babelext/package_manager_babelext.inc
Query :: What else can we do in here?[/quote]
Generally nothing. If you are creating system assets (in the system management folder) to use system wide, you can set them up in here too.
[quote]packages/babelext/package.xml
This appears to be a description of the package as a whole. Nothing to do with the actual Assets the package provides.[/quote]
Yep.
[quote]packages/babelext/redirector/asset.xml
A description of the Asset with a list of required Assets and minimum version of those Assets.[/quote]
Yep.
[quote]packages/babelext/redirector/edit_interface_create.xml
Describes the interface presented when an Asset is added via the Asset Manager. ie, the page name when adding a standard page.[/quote]
Yep. The fields listed in the XML must come from other screens (such as the details screen). You are essentially providing a cut down interface for use when creating the asset. Note that this file is optional. It will be inherited from the parent asset type if not found.
[quote]packages/babelext/redirector/edit_interface_screen_details.xml
Describes the full editing interface for the Asset.[/quote]
Technically, it only describes the interface for the details screen. An asset can have as many different screens as it wants for splitting up its interface. Every asset must have a details screen though, so you'll see this file all over the place. Note that this file is optional. It will be inherited from the parent asset type if not found.
[quote]packages/babelext/redirector/icon.png
Icon for the Asset Map[/quote]
Yep. Note that this file is optional. It will be inherited from the parent asset type if not found.
[quote]packages/babelext/redirector/redirector_edit_fns.inc
Code to manage Asset edits?[/quote]
Any code that is used for editing only. Mostly just functions defined in the XML interface file for printing and processing complex interfaces. See asset_listing for an example.
[quote]packages/babelext/redirector/redirector.inc
Code to do what?[/quote]
Print the asset. The printBody() function defines what HTML will be printed in the BODY design area of the design. You can also override other functions from core/include/asset.inc to define things like what child links this asset type can have, and what custom locks it uses.
[quote]packages/babelext/redirector/redirector_management.inc
his appears to be what defines the Asset itself. Not the data the Asset works with, but the actual Asset. ie, the parameters it has etc.[/quote]
This file defines the attributes that the asset type uses to store its data. It can also include upgrade functions and a list of files that should be copied to a public data directory (check out core/assets/bodycopy/bodycopy for an eg.)
[quote]However, my new asset doesn't appear on the Add menu in the Asset Manager.[/quote]
The add menu is cached in XML. Make sure you've refreshed your asset map frame.
[quote]Can someone point me to an example asset (preferably listing the file and function(s)) to make this happen?[/quote]
Not yet. A guide is being written but its not yet done.
[quote]packages/babelext/redirector/redirector_edit_fns.inc
Any code that is used for editing only. Mostly just functions defined in the XML interface file for printing and processing complex interfaces. See asset_listing for an example.[/quote]
Hmm… Where would this be?
[root@nswos www]# pwd
/var/www
[root@nswos www]# ls
cgi-bin error html icons manual mysource_matrix_3-1-0-RC1 mysource_matrix_installer phpMyAdmin usage
[root@nswos www]# grep -r asset_listing *
[root@nswos www]# locate asset_listing
[root@nswos www]#I'm not finding it at all.
[quote][b]packages/babelext/redirector/redirector_management.inc[/b]
Print the asset. The printBody() function defines what HTML will be printed in the BODY design area of the design. You can also override other functions from core/include/asset.inc to define things like what child links this asset type can have, and what custom locks it uses.[/quote]
Hmm... Can we set header()'s at this point? Or would output have already started?
[quote]The add menu is cached in XML. Make sure you've refreshed your asset map frame.[/quote]
I had just run the installation script and logged in. Where abouts should it appear on the Add menu? How is the location in the menu determined?
Asset listing is in packages/cms/page_templates/page_asset_listing
It is not part of the core download so you have to get the patches from the downloads page of the Matrix site.
You can pass headers in printFrontend() but not printBody(). You could do something like:
function printFrontend()
{
header('blah');
parent::printFrontend();
}//end printFrontend()The location on the add menu is determined by the path you give the asset in the asset.xml file. You change the flash_menu_path attribute to create the add menu strucutre. Again, asset listing is a good example of this.
[quote]Asset listing is in packages/cms/page_templates/page_asset_listing
It is not part of the core download so you have to get the patches from the downloads page of the Matrix site.[/quote]
Ah! I've reinstalled a dozen or so times. I only ever applied the patches the first time…
Will make a note of that…
[quote]You need to run install/step_03.php to get it to appear.
php install/step_03.php /path/to/mysource/root[/quote]
Can this be called from the browser?
Running through all the extra web-installer screens to get to the package importing is a little tedious.
It appears you can do this 
http://mydomain.com/install/step_03.php?SYSTEM_ROOT=/var/www/mysource_matrix_3-1-0-RC1
This is working for me. At least it appears to be working. It’s generating the same errors I was getting on the full web-based installer…
I had to add an extra Alias;
Alias “/install” “/var/www/mysource_matrix_3-1-0-RC1/install”
If you go through the web installer again, instead of having to go through the whole install process it'll let you skip straight to the step 3 process instead of 'install'.
WooHoo! I wrote an asset 
http://nswos.opensource.nsw.gov.au/sourceforge
Yes, I know there’s a patch to do this but that wasn’t the task. The task was to just write one…