Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Relative album path
Richard
#1 Posted : Thursday, 16 August 2007 8:23:39 AM(UTC)
Rank: Member

Joined: 3/08/2007(UTC)
Posts: 24
Location: Holland

Hi,

I'm updating my windows admin tool for version 2.0. In version 1 the albums table had a relative path for the album, now there is only the folder name of the album.

Is there an easy way to get the whole path, without going recursively up all parents?

Richard
Roger Martin
#2 Posted : Thursday, 16 August 2007 9:22:16 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,167
Location: Fort Atkinson, WI

Are you using the object model in GalleryServerPro.Business.dll? If so, it's a piece of cake:

Code:
int mediaObjectId = 27;
IGalleryObject mediaObject = Factory.LoadMediaObjectInstance(mediaObjectId);
string originalPath = mediaObject.Original.FilenamePhysicalPath;
string optimizedPath = mediaObject.Optimized.FilenamePhysicalPath;
string thumbnailPath = mediaObject.Thumbnail.FilenamePhysicalPath;


Hope this helps,
Roger Martin
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Roger Martin
#3 Posted : Thursday, 16 August 2007 9:27:48 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,167
Location: Fort Atkinson, WI

GS2 has a much improved architecture that allows for utilities such as WinForms to be easily created. Just add a reference to GalleryServerPro.Business.dll to your WinForm project, and you have instant access to all the functionality exposed by the web UI.

All public types, methods and properties have XML comments, so you can generate a document using nDoc or use the intellisense in Visual Studio.

Roger
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Richard
#4 Posted : Thursday, 16 August 2007 7:06:33 PM(UTC)
Rank: Member

Joined: 3/08/2007(UTC)
Posts: 24
Location: Holland

Thanks a lot - will play with it.
Roger Martin
#5 Posted : Friday, 17 August 2007 12:10:13 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,167
Location: Fort Atkinson, WI

I just noticed I didn't quite answer your question. To get the full path for an *album*, use this:

Code:
int albumId = 32;
IAlbum album = Factory.LoadAlbumInstance(albumId);
string directoryPath = album.FullPhysicalPath;


Or, if you have a reference to a media object, you can get it this way:

Code:
string directoryPath = ((IAlbum)mediaObject.Parent).FullPhysicalPath;


Note that FullPhysicalPath is read-only. To move an album to another directory, you assign it a new parent rather than update this path. You can look in the code-behind in transferobject.aspx to see how the web page does it.

Roger
Roger Martin
Creator and Lead Developer of Gallery Server Pro
leocharrua
#6 Posted : Tuesday, 3 August 2010 1:32:03 PM(UTC)
Rank: Newbie

Joined: 3/08/2010(UTC)
Posts: 3
Location: Uruguay

Hello Richard, could you share your windows admin tool for Gallery Server. Thanks.
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.