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

Notification

Icon
Error

Seed GS Pro with existing data
jhauge
#1 Posted : Wednesday, 15 September 2010 12:47:46 AM(UTC)
Rank: Newbie

Joined: 15/09/2010(UTC)
Posts: 2
Location: Denmark

Hello all

I'm currently evaluating using GS Pro in a project where we will be creating a new Gallery, that we need to preload with several thousand existing images.

I have a XML file with some data for the images (mainly category labels) and the images, and I'm looking into how one would go about getting these data into GS Pro.

I started trying to set up a small .NET Console Application to handle the task, after reading this article, that suggests using the Factory class to create new GalleryObjects. But I'm having some trouble getting the Console App to run.

Error seems to occur when I'm trying to Initialize the AppSetting with the following code:

Code:
string physicalPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string name = Assembly.GetExecutingAssembly().GetName().FullName;
AppSetting.Instance.Initialize(ApplicationTrustLevel.Full, physicalPath, name);


Where I'll get:

Code:
Could not load type 'GalleryServerPro.Data.SqlServer.SqlDataProvider' from assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'


I tried configuring the console app with the following app.config:

Code:
<configSections>
    <section name="galleryServerPro"
                     type="GalleryServerPro.Configuration.GalleryServerProConfigSettings, GalleryServerPro.Configuration"
                     allowDefinition="MachineToApplication"
                     restartOnExternalChanges="true"
                     requirePermission="false"/>
</configSections>
<galleryServerPro>
<!-- settings from web app copied here -->
</galleryServerPro>


Can anybody tell me what I'm doing wrong, and is there somewhere I can find an example showing me how to do this?

Regards
Jesper Hauge
Roger Martin
#2 Posted : Wednesday, 15 September 2010 1:09:46 AM(UTC)
Roger Martin

Rank: Administration

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

For some reason the app thinks GalleryServerPro.Data.SqlServer.SqlDataProvider is inside System.Web.dll, which it obviously is not. It is in GalleryServerPro.Data.SqlServer.dll, so make sure this dll is available to your app - specifically, it should be in the bin directory.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
jhauge
#3 Posted : Monday, 20 September 2010 2:58:41 AM(UTC)
Rank: Newbie

Joined: 15/09/2010(UTC)
Posts: 2
Location: Denmark

Hi Roger

Thanks for answering. I noticed the reference to System.Web. Odd thing is that GalleryServerPro.Data.SqlServer.dll is already referenced and present i the same folder as the .exe of the console app.

I also tried compiling and running the console both with and without a reference to System.Web. Both configurations yield the same result. Also noticed that the error occurs before running the Main method in the console app.

Maybe it's just that I am doing this the wrong way. How would you go about setting up a site with all these pictures? Maybe I should start by just importing the pictures (that can be done by just placing the pictures in a folder and as GS Pro to update, right?), and then find another way to import the categories for each picture.

Regards
Jesper Hauge
Roger Martin
#4 Posted : Tuesday, 21 September 2010 9:43:10 AM(UTC)
Roger Martin

Rank: Administration

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

The best way to migrate objects into GSP depends on what you have to migrate.

1. For many objects/complex scenarios, use the API like you are attempting. But this takes some time to set up.

2. If you don't care about the captions or ordering, copy the files into the media objects directory and ask GSP to synch them. This is the easiest.

3. If you have decent SQL skills, consider importing them directly into the tables. All albums go in gs_Album, media objects go in gs_MediaObject, and image metadata (if it exists) go in gs_MediaObjectMetadata.

You could also try a hybrid, like synching all the objects and then updating the tables as desired.

If you can put the categories into the image files as metadata, GSP will automatically extract them.
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.