change AssetHelpers to have short IDs instead of class names

This will make better code reuse: The Asset Manager will instead
call the AssetHelper with the id of "cut" or "copy" to get the
correct operation.
This commit is contained in:
Doug Bell 2011-02-25 15:44:06 -06:00
parent f249070c50
commit b9e879b7aa
22 changed files with 156 additions and 115 deletions

View file

@ -656,10 +656,13 @@ sub www_processAssetHelper {
my ( $form ) = $session->quick(qw{ form });
my $assetId = $form->get('assetId');
my $class = $form->get('className');
WebGUI::Pluggable::load( $class );
my $helperId = $form->get('helperId');
my $asset = WebGUI::Asset->newById( $session, $assetId );
return JSON->new->encode( $class->process( $asset ) );
my $class = $asset->getHelpers->{ $helperId }->{ className };
WebGUI::Pluggable::load( $class );
my $helper = $class->new( id => $helperId, session => $self->session );
return JSON->new->encode( $helper->process( $asset ) );
}
#----------------------------------------------------------------------