Merging changes from 6.6.4

Added new definition features to wobjects and assets.
This commit is contained in:
JT Smith 2005-07-21 01:17:05 +00:00
parent 3805ebed23
commit c4b3e4092d
43 changed files with 457 additions and 717 deletions

View file

@ -60,6 +60,7 @@ sub definition {
my $class = shift;
my $definition = shift;
push(@{$definition}, {
assetName=>WebGUI::International::get('file',"Asset_File"),
tableName=>'FileAsset',
className=>'WebGUI::Asset::File',
properties=>{
@ -163,19 +164,6 @@ sub getIcon {
}
#-------------------------------------------------------------------
=head2 getName
Returns the displayable name of this asset.
=cut
sub getName {
return WebGUI::International::get('file',"Asset_File");
}
#-------------------------------------------------------------------
sub getStorageLocation {
my $self = shift;
@ -212,7 +200,6 @@ sub processPropertiesFromFormPost {
$data{url} = $self->getParent->get('url').'/'.$filename unless ($session{form}{url});
$self->update(\%data);
$self->setSize($storage->getFileSize($filename));
$storage->setPrivileges($self->get("ownerUserId"), $self->get("groupIdView"), $self->get("groupIdEdit"));
$self->{_storageLocation} = $storage;
} else {
$storage->delete;
@ -239,6 +226,27 @@ sub purge {
}
#-------------------------------------------------------------------
=head2 update
We overload the update method from WebGUI::Asset in order to handle file system privileges.
=cut
sub update {
my $self = shift;
my %before = (
owner => $self->get("ownerUserId"),
view => $self->get("groupIdView"),
edit => $self->get("groupIdEdit")
);
$self->SUPER::update(@_);
if ($self->get("ownerUserId") ne $before{owner} || $self->get("groupIdEdit") ne $before{edit} || $self->get("groupIdView") ne $before{view}) {
$self->getStorageLocation->setPrivileges($self->get("ownerUserId"),$self->get("groupIdView"),$self->get("groupIdEdit"));
}
}
#-------------------------------------------------------------------
sub view {
my $self = shift;