diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 9033ae39f..bfe4c1b62 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -5,6 +5,9 @@ - Added ability to edit comments. Entirely changed how comments work in prep for turning it into a mixin. - fixed: Child assets not indicated by plus sign in uncommited tags + - Added WebGUI::Asset::File::GalleryFile as a subclass for all files to be + used inside the Gallery. + - Changed WebGUI::Asset::File::Image::Photo to subclass GalleryFile 7.5.4 - fixed: unable to remove calendar feeds in IE6 diff --git a/docs/upgrades/packages-7.5.5/root_import_gallery-templates.wgpkg b/docs/upgrades/packages-7.5.5/root_import_gallery-templates.wgpkg index 7771d9a96..84f692c8f 100644 Binary files a/docs/upgrades/packages-7.5.5/root_import_gallery-templates.wgpkg and b/docs/upgrades/packages-7.5.5/root_import_gallery-templates.wgpkg differ diff --git a/docs/upgrades/upgrade_7.5.4-7.5.5.pl b/docs/upgrades/upgrade_7.5.4-7.5.5.pl index cda1ef914..61b9e44a1 100644 --- a/docs/upgrades/upgrade_7.5.4-7.5.5.pl +++ b/docs/upgrades/upgrade_7.5.4-7.5.5.pl @@ -25,6 +25,7 @@ my $session = start(); # this line required # upgrade functions go here addGalleryEditCommentTemplate( $session ); addGalleryRichEditAlbum( $session ); +migrateToGalleryFile( $session ); finish($session); # this line required @@ -58,6 +59,29 @@ sub addGalleryRichEditAlbum { $session->db->write( q{ ALTER TABLE Gallery ADD COLUMN richEditIdAlbum VARCHAR(22) BINARY } ); + $session->db->write( q{ + ALTER TABLE Gallery ADD COLUMN richEditIdFile VARCHAR(22) BINARY + } ); + + print "DONE!\n" unless $quiet; +} + +#---------------------------------------------------------------------------- +# Move File::Image::Photos to File::GalleryFile::Photos +sub migrateToGalleryFile { + my $session = shift; + print "\tMigrating Image::Photos to GalleryFile::Photos (this may take time)..." unless $quiet; + + # Change WebGUI::Asset::File::Image::Photo to WebGUI::Asset::File::GalleryFile::Photo + $session->db->write( q{ + UPDATE asset SET className='WebGUI::Asset::File::GalleryFile::Photo' WHERE + className='WebGUI::Asset::File::Image::Photo' + }); + + # Delete Photos from ImageAsset table + $session->db->write( + "DELETE FROM ImageAsset WHERE assetId IN ( SELECT assetId FROM Photo )" + ); print "DONE!\n" unless $quiet; } diff --git a/lib/WebGUI/Asset/File/GalleryFile.pm b/lib/WebGUI/Asset/File/GalleryFile.pm new file mode 100644 index 000000000..52449c897 --- /dev/null +++ b/lib/WebGUI/Asset/File/GalleryFile.pm @@ -0,0 +1,142 @@ +package WebGUI::Asset::File::GalleryFile; + +=head1 LEGAL + + ------------------------------------------------------------------- + WebGUI is Copyright 2001-2008 Plain Black Corporation. + ------------------------------------------------------------------- + Please read the legal notices (docs/legal.txt) and the license + (docs/license.txt) that came with this distribution before using + this software. + ------------------------------------------------------------------- + http://www.plainblack.com info@plainblack.com + ------------------------------------------------------------------- + +=cut + +use strict; +use base 'WebGUI::Asset::File'; + + + +=head1 NAME + +WebGUI::Asset::File::GalleryFile - Superclass to create files for the Gallery + +=head1 SYNOPSIS + + +=head1 DESCRIPTION + +=head1 METHODS + +These methods are available from this class + +=cut + +#---------------------------------------------------------------------------- + +=head2 getThumbnailUrl ( ) + +Gets the URL to the thumbnail for this GalleryFile. This should probably be +overridded by your child class. + +=cut + +sub getThumbnailUrl { + my $self = shift; + +} + +#---------------------------------------------------------------------------- + +=head2 getTemplateVars ( ) + +Gets the template vars for this GalleryFile. You should probably extend this +method. + +=cut + +sub getTemplateVars { + my $self = shift; + my $var = $self->get; + + $var->{ fileUrl } = $self->getFileUrl; + $var->{ thumbnailUrl } = $self->getThumbnailUrl; + + return $var; +} + +#---------------------------------------------------------------------------- + +=head2 processStyle ( html ) + +Returns the HTML from the Gallery's style. + +=cut + +sub processStyle { + my $self = shift; + return $self->getGallery->processStyle( @_ ); +} + +#---------------------------------------------------------------------------- + +=head2 www_demote + +Override the default demote page to send the user back to the GalleryAlbum +edit screen. + +=cut + +sub www_demote { + my $self = shift; + + return $self->session->privilege->insufficient unless $self->canEdit; + + $self->demote; + + return $self->session->asset( $self->getParent )->www_edit; +} + +#---------------------------------------------------------------------------- + +=head2 www_promote + +Override the default promote page to send the user back to the GalleryAlbum +edit screen. + +=cut + +sub www_promote { + my $self = shift; + + return $self->session->privilege->insufficient unless $self->canEdit; + + $self->promote; + + return $self->session->asset( $self->getParent )->www_edit; +} + +#---------------------------------------------------------------------------- + +=head2 www_view ( ) + +Show the default view, with content chunking. + +=cut + +sub www_view { + my $self = shift; + $self->session->http->setLastModified($self->getContentLastModified); + $self->session->http->sendHeader; + $self->prepareView; + my $style = $self->processStyle("~~~"); + my ($head, $foot) = split("~~~",$style); + $self->session->output->print($head, 1); + $self->session->output->print($self->view); + $self->session->output->print($foot, 1); + return "chunked"; +} + +1; # Who knew the truth would be so obvious? diff --git a/lib/WebGUI/Asset/File/Image/Photo.pm b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm similarity index 94% rename from lib/WebGUI/Asset/File/Image/Photo.pm rename to lib/WebGUI/Asset/File/GalleryFile/Photo.pm index 586fbae21..0fab64b66 100644 --- a/lib/WebGUI/Asset/File/Image/Photo.pm +++ b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm @@ -1,4 +1,4 @@ -package WebGUI::Asset::File::Image::Photo; +package WebGUI::Asset::File::GalleryFile::Photo; =head1 LEGAL @@ -15,7 +15,7 @@ package WebGUI::Asset::File::Image::Photo; =cut use strict; -use base 'WebGUI::Asset::File::Image'; +use base 'WebGUI::Asset::File::GalleryFile'; use Carp qw( carp croak ); use Image::ExifTool qw( :Public ); @@ -26,18 +26,19 @@ use Tie::IxHash; use WebGUI::DateTime; use WebGUI::Friends; use WebGUI::Utility; +use WebGUI::Storage::Image; =head1 NAME -WebGUI::Asset::File::Image::Photo +WebGUI::Asset::File::GalleryFile::Photo =head1 DESCRIPTION =head1 SYNOPSIS -use WebGUI::Asset::File::Image::Photo +use WebGUI::Asset::File::GalleryFile::Photo =head1 DIAGNOSTICS @@ -101,7 +102,7 @@ sub definition { autoGenerateForms => 0, icon => 'photo.gif', tableName => 'Photo', - className => 'WebGUI::Asset::File::Image::Photo', + className => 'WebGUI::Asset::File::GalleryFile::Photo', i18n => 'Asset_Photo', properties => \%properties, }; @@ -196,13 +197,18 @@ sub applyConstraints { my $gallery = $self->getGallery; # Update the asset's size and make a thumbnail - $self->SUPER::applyConstraints({ - maxImageSize => $self->getGallery->get("imageViewSize"), - thumbnailSize => $self->getGallery->get("imageThumbnailSize"), - }); - - $self->makeResolutions(); - $self->updateExifDataFromFile(); + my $maxImageSize = $self->getGallery->get("imageViewSize") + || $self->session->setting->get("maxImageSize"); + my $thumbnailSize = $self->getGallery->get("imageThumbnailSize") + || $self->session->setting->get("thumbnailSize"); + my $parameters = $self->get("parameters"); + my $storage = $self->getStorageLocation; + my $file = $self->get("filename"); + $storage->adjustMaxImageSize($file); + $self->generateThumbnail; + $self->setSize; + $self->makeResolutions; + $self->updateExifDataFromFile; } #---------------------------------------------------------------------------- @@ -311,6 +317,23 @@ sub deleteComment { ); } +#------------------------------------------------------------------- + +=head2 generateThumbnail ( ) + +Generates a thumbnail for this image. + +=cut + +sub generateThumbnail { + my $self = shift; + $self->getStorageLocation->generateThumbnail( + $self->get("filename"), + $self->getGallery->get("imageThumbnailSize"), + ); + return; +} + #---------------------------------------------------------------------------- =head2 getAutoCommitWorkflowId ( ) @@ -453,6 +476,19 @@ sub getResolutions { #---------------------------------------------------------------------------- +=head2 getStorageClass ( ) + +Get the WebGUI::Storage subclass name for this file. This file uses the +Image class. + +=cut + +sub getStorageClass { + return 'WebGUI::Storage::Image'; +} + +#---------------------------------------------------------------------------- + =head2 getTemplateVars ( ) Get a hash reference of template variables shared by all views of this asset. @@ -462,7 +498,7 @@ Get a hash reference of template variables shared by all views of this asset. sub getTemplateVars { my $self = shift; my $session = $self->session; - my $var = $self->get; + my $var = $self->SUPER::getTemplateVars; my $owner = WebGUI::User->new( $session, $self->get("ownerUserId") ); # Fix 'undef' vars since HTML::Template does inheritence on them @@ -487,9 +523,6 @@ sub getTemplateVars { = $self->getGallery->getUrl('func=listFilesForUser;userId=' . $self->get("ownerUserId")); $var->{ url_promote } = $self->getUrl('func=promote'); - $var->{ fileUrl } = $self->getFileUrl; - $var->{ thumbnailUrl } = $self->getThumbnailUrl; - ### Download resolutions for my $resolution ( $self->getResolutions ) { push @{ $var->{ resolutions_loop } }, { @@ -512,6 +545,21 @@ sub getTemplateVars { #---------------------------------------------------------------------------- +=head2 getThumbnailUrl ( ) + +Get the URL to the thumbnail for this Photo. + +=cut + +sub getThumbnailUrl { + my $self = shift; + return $self->getStorageLocation->getThumbnailUrl( + $self->get("filename") + ); +} + +#---------------------------------------------------------------------------- + =head2 i18n ( [ session ] ) Get a WebGUI::International object for this class. @@ -704,19 +752,6 @@ sub processPropertiesFromFormPost { #---------------------------------------------------------------------------- -=head2 processStyle ( html ) - -Returns the HTML from the Gallery's style. - -=cut - -sub processStyle { - my $self = shift; - return $self->getGallery->processStyle( @_ ); -} - -#---------------------------------------------------------------------------- - =head2 purge ( ) Purge the asset. Remove all comments on the photo. @@ -771,6 +806,20 @@ sub setComment { #---------------------------------------------------------------------------- +=head2 setFile ( filename ) + +Extend the superclass setFile to automatically generate thumbnails. + +=cut + +sub setFile { + my $self = shift; + $self->SUPER::setFile(@_); + $self->generateThumbnail; +} + +#---------------------------------------------------------------------------- + =head2 updateExifDataFromFile ( ) Gets the EXIF data from the uploaded image and store it in the database. @@ -917,25 +966,6 @@ sub www_deleteConfirm { #---------------------------------------------------------------------------- -=head2 www_demote - -Override the default demote page to send the user back to the GalleryAlbum -edit screen. - -=cut - -sub www_demote { - my $self = shift; - - return $self->session->privilege->insufficient unless $self->canEdit; - - $self->demote; - - return $self->session->asset( $self->getParent )->www_edit; -} - -#---------------------------------------------------------------------------- - =head2 www_download Download the Photo with the specified resolution. If no resolution specified, @@ -1211,25 +1241,6 @@ sub www_makeShortcutSave { #---------------------------------------------------------------------------- -=head2 www_promote - -Override the default promote page to send the user back to the GalleryAlbum -edit screen. - -=cut - -sub www_promote { - my $self = shift; - - return $self->session->privilege->insufficient unless $self->canEdit; - - $self->promote; - - return $self->session->asset( $self->getParent )->www_edit; -} - -#---------------------------------------------------------------------------- - =head2 www_showConfirmation ( ) Shows the confirmation message after adding / editing a gallery album. @@ -1266,15 +1277,7 @@ sub www_view { # Add to views $self->update({ views => $self->get('views') + 1 }); - $self->session->http->setLastModified($self->getContentLastModified); - $self->session->http->sendHeader; - $self->prepareView; - my $style = $self->processStyle("~~~"); - my ($head, $foot) = split("~~~",$style); - $self->session->output->print($head, 1); - $self->session->output->print($self->view); - $self->session->output->print($foot, 1); - return "chunked"; + return $self->SUPER::www_view; } 1; diff --git a/lib/WebGUI/Asset/Wobject/Gallery.pm b/lib/WebGUI/Asset/Wobject/Gallery.pm index bd162c98a..08ac3d984 100644 --- a/lib/WebGUI/Asset/Wobject/Gallery.pm +++ b/lib/WebGUI/Asset/Wobject/Gallery.pm @@ -125,6 +125,13 @@ sub definition { label => $i18n->get("richEditIdAlbum label"), hoverHelp => $i18n->get("richEditIdAlbum description"), }, + richEditIdFile => { + tab => "properties", + fieldType => "selectRichEditor", + defaultValue => "PBrichedit000000000002", # Forum Rich editor + label => $i18n->get("richEditIdFile label"), + hoverHelp => $i18n->get("richEditIdFile description"), + }, richEditIdComment => { tab => "properties", fieldType => "selectRichEditor", @@ -323,6 +330,34 @@ sub definition { #---------------------------------------------------------------------------- +=head2 addChild ( properties, [...] ) + +Add a child to this asset. See C for more info. + +Overridden to ensure that only GalleryAlbums are added to Galleries. + +=cut + +sub addChild { + my $self = shift; + my $properties = shift; + my $albumClass = "WebGUI::Asset::Wobject::GalleryAlbum"; + + # Load the class + WebGUI::Pluggable::load( $properties->{className} ); + + if ( !$properties->{className}->isa( $albumClass ) ) { + $self->session->errorHandler->security( + "add a ".$properties->{className}." to a ".$self->get("className") + ); + return undef; + } + + return $self->SUPER::addChild( $properties, @_ ); +} + +#---------------------------------------------------------------------------- + =head2 appendTemplateVarsSearchForm ( var ) Appends the template vars for the search form to the hash reference C. @@ -372,9 +407,9 @@ sub appendTemplateVarsSearchForm { # Search classes tie my %searchClassOptions, 'Tie::IxHash', ( - 'WebGUI::Asset::File::Image::Photo' => $i18n->get("search class photo"), - 'WebGUI::Asset::Wobject::GalleryAlbum' => $i18n->get("search class galleryalbum"), - '' => $i18n->get("search class any"), + 'WebGUI::Asset::File::GalleryFile::Photo' => $i18n->get("search class photo"), + 'WebGUI::Asset::Wobject::GalleryAlbum' => $i18n->get("search class galleryalbum"), + '' => $i18n->get("search class any"), ); $var->{ searchForm_className } = WebGUI::Form::radioList( $session, { @@ -580,7 +615,7 @@ sub getAssetClassForFile { # Checks for Photo assets if ( $filepath =~ /\.(jpe?g|gif|png)$/i ) { - return "WebGUI::Asset::File::Image::Photo"; + return "WebGUI::Asset::File::GalleryFile::Photo"; } # No class found @@ -931,7 +966,7 @@ sub www_search { my $joinClass = [ 'WebGUI::Asset::Wobject::GalleryAlbum', - 'WebGUI::Asset::File::Image::Photo', + 'WebGUI::Asset::File::GalleryFile::Photo', ]; if ( $form->get("className") ) { $joinClass = [ $form->get('className') ]; diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index b4781de61..81847bc6d 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -146,6 +146,34 @@ sub addArchive { #---------------------------------------------------------------------------- +=head2 addChild ( properties [, ... ] ) + +Add a child to this GalleryAlbum. See C for more info. + +Override to ensure only appropriate classes get added to GalleryAlbums. + +=cut + +sub addChild { + my $self = shift; + my $properties = shift; + my $fileClass = 'WebGUI::Asset::File::GalleryFile'; + + # Load the class + WebGUI::Pluggable::load( $properties->{className} ); + + if ( !$properties->{className}->isa( $fileClass ) ) { + $self->session->errorHandler->security( + "add a ".$properties->{className}." to a ".$self->get("className") + ); + return undef; + } + + return $self->SUPER::addChild( $properties, @_ ); +} + +#---------------------------------------------------------------------------- + =head2 appendTemplateVarsFileLoop ( vars, assetIds ) Append template vars for a file loop for the specified assetIds. C is @@ -381,7 +409,7 @@ sub getTemplateVars { # Friendly URLs $var->{ url } = $self->getUrl; $var->{ url_addArchive } = $self->getUrl('func=addArchive'); - $var->{ url_addPhoto } = $self->getUrl("func=add;class=WebGUI::Asset::File::Image::Photo"); + $var->{ url_addPhoto } = $self->getUrl("func=add;class=WebGUI::Asset::File::GalleryFile::Photo"); $var->{ url_addNoClass } = $self->getUrl("func=add"); $var->{ url_delete } = $self->getUrl("func=delete"); $var->{ url_edit } = $self->getUrl("func=edit"); diff --git a/lib/WebGUI/i18n/English/Asset_Gallery.pm b/lib/WebGUI/i18n/English/Asset_Gallery.pm index 15130d8ad..c9701d7b4 100644 --- a/lib/WebGUI/i18n/English/Asset_Gallery.pm +++ b/lib/WebGUI/i18n/English/Asset_Gallery.pm @@ -87,6 +87,16 @@ our $I18N = { lastUpdated => 0, context => 'Asset property description', }, + "richEditIdFile label" => { + message => "Rich Editor for Files", + lastUpdated => 0, + context => 'Asset property label', + }, + "richEditIdFile description" => { + message => "The Rich Text Editor to use for Files", + lastUpdated => 0, + context => 'Asset property description', + }, "richEditIdFileComment label" => { message => "Rich Editor for Comments", lastUpdated => 0, diff --git a/lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm b/lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm index 8578ccc16..6f7aa0bd1 100644 --- a/lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm +++ b/lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm @@ -79,7 +79,7 @@ our $I18N = { }, 'help thumbnails body' => { - message => 'These variables are available from the slideshow view of the Album', + message => 'These variables are available from the thumbnails view of the Album', lastUpdated => 0, }, diff --git a/t/Asset/File/Image/Photo/00base.t b/t/Asset/File/GalleryFile/Photo/00base.t similarity index 89% rename from t/Asset/File/Image/Photo/00base.t rename to t/Asset/File/GalleryFile/Photo/00base.t index 3cb164d53..2a69c6ce5 100644 --- a/t/Asset/File/Image/Photo/00base.t +++ b/t/Asset/File/GalleryFile/Photo/00base.t @@ -54,13 +54,13 @@ plan tests => 5; #---------------------------------------------------------------------------- # Test module compiles okay # plan tests => 1 -use_ok("WebGUI::Asset::File::Image::Photo"); +use_ok("WebGUI::Asset::File::GalleryFile::Photo"); #---------------------------------------------------------------------------- # Test creating a photo $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, @@ -71,12 +71,12 @@ $photo $versionTag->commit; is( - blessed $photo, "WebGUI::Asset::File::Image::Photo", - "Photo is a WebGUI::Asset::File::Image::Photo object", + blessed $photo, "WebGUI::Asset::File::GalleryFile::Photo", + "Photo is a WebGUI::Asset::File::GalleryFile::Photo object", ); isa_ok( - $photo, "WebGUI::Asset::File::Image", + $photo, "WebGUI::Asset::File::GalleryFile", ); diff --git a/t/Asset/File/Image/Photo/comment.t b/t/Asset/File/GalleryFile/Photo/comment.t similarity index 97% rename from t/Asset/File/Image/Photo/comment.t rename to t/Asset/File/GalleryFile/Photo/comment.t index 5254711ae..25401a8d2 100644 --- a/t/Asset/File/Image/Photo/comment.t +++ b/t/Asset/File/GalleryFile/Photo/comment.t @@ -20,7 +20,7 @@ use WebGUI::Session; use Test::More; use Test::Deep; use Scalar::Util qw( blessed ); -use WebGUI::Asset::File::Image::Photo; +use WebGUI::Asset::File::GalleryFile::Photo; #---------------------------------------------------------------------------- # Init @@ -43,7 +43,7 @@ my $album }, @addArguments ); my $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, @addArguments ); $versionTags[-1]->commit; @@ -195,7 +195,7 @@ TODO: { my $html; $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, @addArguments ); # Permissions diff --git a/t/Asset/File/Image/Photo/download.t b/t/Asset/File/GalleryFile/Photo/download.t similarity index 94% rename from t/Asset/File/Image/Photo/download.t rename to t/Asset/File/GalleryFile/Photo/download.t index 464c4ee70..b69c03058 100644 --- a/t/Asset/File/Image/Photo/download.t +++ b/t/Asset/File/GalleryFile/Photo/download.t @@ -19,7 +19,7 @@ use Scalar::Util qw( blessed ); use WebGUI::Test; use WebGUI::Session; use Test::More; -use WebGUI::Asset::File::Image::Photo; +use WebGUI::Asset::File::GalleryFile::Photo; #---------------------------------------------------------------------------- # Init @@ -47,7 +47,7 @@ my $album }); my $photo = $gallery->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, diff --git a/t/Asset/File/Image/Photo/editSave.t b/t/Asset/File/GalleryFile/Photo/editSave.t similarity index 93% rename from t/Asset/File/Image/Photo/editSave.t rename to t/Asset/File/GalleryFile/Photo/editSave.t index 560d10bad..33613743c 100644 --- a/t/Asset/File/Image/Photo/editSave.t +++ b/t/Asset/File/GalleryFile/Photo/editSave.t @@ -20,7 +20,7 @@ use WebGUI::Test; use WebGUI::Session; use Test::More; use WebGUI::Test::Maker::HTML; -use WebGUI::Asset::File::Image::Photo; +use WebGUI::Asset::File::GalleryFile::Photo; #---------------------------------------------------------------------------- # Init @@ -49,7 +49,7 @@ my $album }); my $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, @@ -91,7 +91,7 @@ $maker->prepare({ method => "www_editSave", formParams => { assetId => "new", - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, test_regex => [ qr/You must select a file/, @@ -107,7 +107,7 @@ $maker->prepare({ method => "www_editSave", formParams => { assetId => "new", - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, test_regex => [ qr/awaiting approval and commit/, diff --git a/t/Asset/File/Image/Photo/exif.t b/t/Asset/File/GalleryFile/Photo/exif.t similarity index 97% rename from t/Asset/File/Image/Photo/exif.t rename to t/Asset/File/GalleryFile/Photo/exif.t index 36b669590..51e8938d7 100644 --- a/t/Asset/File/Image/Photo/exif.t +++ b/t/Asset/File/GalleryFile/Photo/exif.t @@ -41,7 +41,7 @@ my $album ); my $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, { skipAutoCommitWorkflows => 1 }, diff --git a/t/Asset/File/Image/Photo/makeResolutions.t b/t/Asset/File/GalleryFile/Photo/makeResolutions.t similarity index 95% rename from t/Asset/File/Image/Photo/makeResolutions.t rename to t/Asset/File/GalleryFile/Photo/makeResolutions.t index 5d83cd334..76a8c8c34 100644 --- a/t/Asset/File/Image/Photo/makeResolutions.t +++ b/t/Asset/File/GalleryFile/Photo/makeResolutions.t @@ -29,7 +29,7 @@ BEGIN { $graphicsClass = 'Graphics::Magick'; } } -use WebGUI::Asset::File::Image::Photo; +use WebGUI::Asset::File::GalleryFile::Photo; #---------------------------------------------------------------------------- # Init @@ -63,7 +63,7 @@ plan tests => 13; # makeResolutions gets default resolutions from a parent Photo Gallery asset $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, @@ -110,7 +110,7 @@ $album }); $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, @@ -148,7 +148,7 @@ TODO: { push @versionTags, WebGUI::VersionTag->getWorking($session); $photo = $node->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, @@ -185,7 +185,7 @@ TODO: { push @versionTags, WebGUI::VersionTag->getWorking($session); $photo = $node->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, diff --git a/t/Asset/File/Image/Photo/makeShortcut.t b/t/Asset/File/GalleryFile/Photo/makeShortcut.t similarity index 97% rename from t/Asset/File/Image/Photo/makeShortcut.t rename to t/Asset/File/GalleryFile/Photo/makeShortcut.t index e84d9aa1e..6f283294d 100644 --- a/t/Asset/File/Image/Photo/makeShortcut.t +++ b/t/Asset/File/GalleryFile/Photo/makeShortcut.t @@ -20,7 +20,7 @@ use WebGUI::Test; use WebGUI::Session; use Test::More; use WebGUI::Test::Maker::HTML; -use WebGUI::Asset::File::Image::Photo; +use WebGUI::Asset::File::GalleryFile::Photo; #---------------------------------------------------------------------------- # Init @@ -35,7 +35,7 @@ my $otherParent }); my $photo = $node->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", userDefined1 => "ORIGINAL", }, undef, diff --git a/t/Asset/File/Image/Photo/permissions.t b/t/Asset/File/GalleryFile/Photo/permissions.t similarity index 98% rename from t/Asset/File/Image/Photo/permissions.t rename to t/Asset/File/GalleryFile/Photo/permissions.t index d1530ee5f..f4ed2129e 100644 --- a/t/Asset/File/Image/Photo/permissions.t +++ b/t/Asset/File/GalleryFile/Photo/permissions.t @@ -63,7 +63,7 @@ my $album my $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", friendsOnly => 0, }, undef, diff --git a/t/Asset/File/Image/Photo/setFile.t b/t/Asset/File/GalleryFile/Photo/setFile.t similarity index 95% rename from t/Asset/File/Image/Photo/setFile.t rename to t/Asset/File/GalleryFile/Photo/setFile.t index 26c9f1dd3..30156d45a 100644 --- a/t/Asset/File/Image/Photo/setFile.t +++ b/t/Asset/File/GalleryFile/Photo/setFile.t @@ -19,7 +19,7 @@ use WebGUI::Test; use WebGUI::Session; use Test::More; use Test::Deep; -use WebGUI::Asset::File::Image::Photo; +use WebGUI::Asset::File::GalleryFile::Photo; #---------------------------------------------------------------------------- # Init @@ -43,7 +43,7 @@ my $album }); my $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, diff --git a/t/Asset/File/Image/Photo/view.t b/t/Asset/File/GalleryFile/Photo/view.t similarity index 94% rename from t/Asset/File/Image/Photo/view.t rename to t/Asset/File/GalleryFile/Photo/view.t index fae1ddac6..53b97959c 100644 --- a/t/Asset/File/Image/Photo/view.t +++ b/t/Asset/File/GalleryFile/Photo/view.t @@ -19,7 +19,7 @@ use WebGUI::Test; use WebGUI::Session; use Test::More; use WebGUI::Test::Maker::HTML; -use WebGUI::Asset::File::Image::Photo; +use WebGUI::Asset::File::GalleryFile::Photo; #---------------------------------------------------------------------------- # Init @@ -43,7 +43,7 @@ my $album }); my $photo = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", }, undef, undef, diff --git a/t/Asset/Wobject/GalleryAlbum/rss.t b/t/Asset/Wobject/GalleryAlbum/rss.t index 63a6fb81f..10523b6b7 100644 --- a/t/Asset/Wobject/GalleryAlbum/rss.t +++ b/t/Asset/Wobject/GalleryAlbum/rss.t @@ -51,7 +51,7 @@ my @photos; for my $i ( 0 .. 5 ) { $photos[ $i ] = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", filename => "$i.jpg", }, undef, diff --git a/t/Asset/Wobject/GalleryAlbum/slideshow.t b/t/Asset/Wobject/GalleryAlbum/slideshow.t index 76d5fec48..f8aa0657e 100644 --- a/t/Asset/Wobject/GalleryAlbum/slideshow.t +++ b/t/Asset/Wobject/GalleryAlbum/slideshow.t @@ -51,7 +51,7 @@ my @photos; for my $i ( 0 .. 5 ) { $photos[ $i ] = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", filename => "$i.jpg", }, undef, diff --git a/t/Asset/Wobject/GalleryAlbum/thumbnails.t b/t/Asset/Wobject/GalleryAlbum/thumbnails.t index e8e211430..0034897c0 100644 --- a/t/Asset/Wobject/GalleryAlbum/thumbnails.t +++ b/t/Asset/Wobject/GalleryAlbum/thumbnails.t @@ -51,7 +51,7 @@ my @photos; for my $i ( 0 .. 5 ) { $photos[ $i ] = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", filename => "$i.jpg", }, undef, diff --git a/t/Asset/Wobject/GalleryAlbum/view.t b/t/Asset/Wobject/GalleryAlbum/view.t index 543383d69..69123241a 100644 --- a/t/Asset/Wobject/GalleryAlbum/view.t +++ b/t/Asset/Wobject/GalleryAlbum/view.t @@ -52,7 +52,7 @@ my @photos; for my $i ( 0 .. 5 ) { $photos[ $i ] = $album->addChild({ - className => "WebGUI::Asset::File::Image::Photo", + className => "WebGUI::Asset::File::GalleryFile::Photo", filename => "$i.jpg", }, undef, @@ -87,7 +87,7 @@ cmp_deeply( $album->getTemplateVars, superhashof( { %{$album->get}, url => $albu my $expected = { "url_addPhoto" => all( - re( qr/class=WebGUI::Asset::File::Image::Photo/ ), + re( qr/class=WebGUI::Asset::File::GalleryFile::Photo/ ), re( qr/func=add/ ), re( $album->getUrl ), ),