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

Notification

Icon
Error

sort albums
nbdyspl
#1 Posted : Wednesday, 18 June 2008 10:11:29 AM(UTC)
Rank: Member

Joined: 16/06/2008(UTC)
Posts: 17

I have read the admin guide and I cant find anything that says about sorting albums.For example I have an album named 2003 and in that album there are albums using names or numbers.How would you sort them so that they were in alphabetical order or number order.

Thanks and I really think this is a stupid question however I cant seem to find the answer anywhere.
Roger Martin
#2 Posted : Wednesday, 18 June 2008 11:55:11 AM(UTC)
Roger Martin

Rank: Administration

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

The only sorting option at the moment is manually sorting them with the rearrange feature. This is a frequently requested feature and is scheduled for the 2.3 release, due in 2009.

If you are good with SQL, you can construct a SQL UPDATE statement to modify the Seq column in the gs_MediaObject and gs_Album tables. That column is the sequence, and objects are always sorted by that column in ascending order.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
nbdyspl
#3 Posted : Friday, 20 June 2008 3:55:46 AM(UTC)
Rank: Member

Joined: 16/06/2008(UTC)
Posts: 17

That is what I was looking for we will give it a go in sql

Thanks :)


nbdyspl
#4 Posted : Monday, 23 June 2008 10:59:47 PM(UTC)
Rank: Member

Joined: 16/06/2008(UTC)
Posts: 17

Just in case others want to know this does indeed work you can schedule a job to do this once a day.You also want to make sure you restart iis as well after the sql job is done or at least in our case that is what we had to do.
Roger Martin
#5 Posted : Tuesday, 24 June 2008 12:23:09 AM(UTC)
Roger Martin

Rank: Administration

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

Gallery Server stores albums and media objects in it's cache, so that's probably why you restarted IIS. You can also clear the cache by restarting the application pool or "touching" the web.config file. That is, opening it and resaving it.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
rathin1980
#6 Posted : Friday, 23 October 2009 2:26:42 AM(UTC)
Rank: Member

Joined: 8/07/2009(UTC)
Posts: 25
Location: Indiana

Roger or someone who have done this before, can you please elaborate a bit on the SQL update? I see in the gs_Albums the seq doesnot have unique numbers. it repeats itself for every album i guess?

I am just puzzled on how to do it.

Thanks
Rathna
Roger Martin
#7 Posted : Saturday, 24 October 2009 2:14:26 AM(UTC)
Roger Martin

Rank: Administration

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

As you know, an album can contain many child albums and/or media objects. When GSP displays them, it sorts them in order of the Seq field that exists in both gs_Album and gs_MediaObject.

Each time you rearrange the items, GSP automatically assigns each object a Seq number starting with 1.

Therefore, each level of albums has Seq numbers starting with 1.

Hope this gives you enough info to be able to put together a SQL statement.

And fyi, earlier in this thread I said additional sorting options were scheduled for 2.3. Unfortunately, those have been pushed back to 2.4.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
rathin1980
#8 Posted : Saturday, 24 October 2009 2:48:47 AM(UTC)
Rank: Member

Joined: 8/07/2009(UTC)
Posts: 25
Location: Indiana

Thanks for that info Roger I figured the sql and wrote a small VB.net app to do it. Yeah I figured it was going to take some time from you so this time I thought I will give it a shot.
Also now that I have a tool to do this I was thinking may be I can add Sync as well. any pointers on that?

For anyone who want to do this, I am not a programmer but this is what I used in a loop for each row in gs_album. no judging! :-)

Code:
SQLcommand.CommandText = "Update gs_album SET Seq = '" & Seq(i) & "' where AlbumParentId ='" & albumpid(i) & "' and AlbumId = '" & AlbumId(i) & "'"
SQLcommand.ExecuteNonQuery()


Thanks
Rathna
Roger Martin
#9 Posted : Sunday, 25 October 2009 1:57:53 PM(UTC)
Roger Martin

Rank: Administration

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

Glad you got it.

You can programmatically start a synch from your utility without too much trouble, but it may be difficult for a self-proclaimed non-programmer. Essentially, you would add references to the dll's used by GSP, create an app.config that contains the config settings in galleryserverpro.config, and then invoke the Synchronize function just like it is done in the real app (gs\pages\task\synchronize.ascx.cs).
Roger Martin
Creator and Lead Developer of Gallery Server Pro
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.