Welcome Guest Search | Active Topics | Members | Log In | Register
dataprovider in local (windows.forms) app Options
compugraph
Posted: Wednesday, October 01, 2008 11:48:41 AM
Rank: Member

Joined: 10/1/2008
Posts: 18
Location: Germany
Roger,

could you help me in implementing the gs....initialize() section.
The dataprovidermanager.cs spawns an error when I try to initialize a simple c# app.

GalleryServerPro.Data.SqlServer.SqlDataProvider in Assembly System.Web couldn't be loaded.

Since I'm actually not referencing System.Web there's an error trying to use
System.Web.Configuration.ProvidersHelper.InstantiateProviders() in dataprovidermanager.cs.

in configmanager.cs you're evaluating if the app is running under System.Web.HttpContext...


if (System.Web.HttpContext.Current == null)
{connectionStringsSection = System.Configuration.ConfigurationManager.ConnectionStrings[connectionStringName];
}
else
{
connectionStringsSection = System.Web.Configuration.WebConfigurationManager.ConnectionStrings[connectionStringName];
}

---

so how can I use the initialize() function first? Do I have to use <System.web> in app.config, too?

Ralf.





Roger Martin
Posted: Wednesday, October 01, 2008 2:22:31 PM
Rank: Administration

Joined: 8/3/2007
Posts: 844
Location: Fort Atkinson, WI
If you haven't already seen this thread, check it out.

You don't need <system.web> in your app.config, nor does your app need a reference to System.Web.dll.

Below is an example of an app.config I created a while back for a WinForm app. Note that I haven't updated it for the latest GS release, so just use this as a template to get a feel for how it should look. You'll want to build a new app.config based on the most current web.config and galleryserverpro.config.

Note: I deleted some repeating data to keep the size down.

Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

    <configSections>
        <section name="galleryServerPro" type="GalleryServerPro.Configuration.GalleryServerProConfigSettings, GalleryServerPro.Configuration" allowDefinition="MachineToApplication" requirePermission="false"/>
        <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </configSections>

    <connectionStrings>
        <add name="GalleryServerDbConnection" connectionString="Data Source=(local);Initial Catalog=GalleryServerPro;User ID=GalleryServerWebUser;Password=XXXXXX;Application Name=Gallery Server Pro"/>
    </connectionStrings>

    <cachingConfiguration defaultCacheManager="Cache Manager">
        <cacheManagers>
            <add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage" name="Cache Manager"/>
        </cacheManagers>
        <backingStores>
            <add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Null Storage"/>
        </backingStores>
    </cachingConfiguration>

    <galleryServerPro>
        <core galleryId="1" mediaObjectPath="D:\development\TIS\TIS.GSP\gsweb\mediaobjects" websiteTitle="Gallery Server Pro"
         pageHeaderText="My Photo Gallery" pageHeaderTextUrl="~/" defaultAlbumDirectoryName="DefaultName"
         defaultAlbumThumbnailBackgroundColor="Navy" defaultAlbumThumbnailText="Empty album"
         defaultAlbumThumbnailFontName="Comic Sans MS" defaultAlbumThumbnailFontSize="13"
         defaultAlbumThumbnailFontColor="White" defaultAlbumThumbnailWidthToHeightRatio="1.33"
         maxAlbumThumbnailTitleDisplayLength="20" maxMediaObjectThumbnailTitleDisplayLength="18"
         allowHtmlInTitlesAndCaptions="false" mediaObjectTransitionType="Fade"
         mediaObjectTransitionDuration="0.2" slideshowInterval="3000"
         mediaObjectDownloadBufferSize="32768" maxRequestLengthKB="1048576"
         encryptMediaObjectUrlOnClient="false" encryptionKey="Phoenix 13drycity minnea"
         allowUnspecifiedMimeTypes="false" imageTypesStandardBrowsersCanDisplay=".jpg,.jpeg,.gif,.png"
         maxThumbnailLength="115" thumbnailImageJpegQuality="70" thumbnailClickShowsOriginal="false"
         thumbnailWidthBuffer="30" thumbnailHeightBuffer="65" thumbnailFilenamePrefix="zThumb_"
         thumbnailPath="D:\development\TIS\TIS.GSP\gsweb\mediaobjects" maxOptimizedLength="640" optimizedImageJpegQuality="70"
         optimizedImageTriggerSizeKB="50" optimizedFilenamePrefix="zOpt_"
         optimizedPath="D:\development\TIS\TIS.GSP\gsweb\mediaobjects" originalImageJpegQuality="95" applyWatermark="false"
         applyWatermarkToThumbnails="false" watermarkText="Copyright 2007 Your Company Name. All Rights Reserved."
         watermarkTextFontName="Verdana" watermarkTextFontSize="12" watermarkTextWidthPercent="50"
         watermarkTextColor="White" watermarkTextOpacityPercent="35" watermarkTextLocation="BottomCenter"
         watermarkImagePath="images/companylogo.jpg" watermarkImageWidthPercent="50"
         watermarkImageOpacityPercent="25" watermarkImageLocation="MiddleCenter"
         sendEmailOnError="false" emailFromName="Gallery Server Error Reporting"
         emailFromAddress="webmaster@yourisp.com" emailToName="Gallery Server Admin"
         emailToAddress="name@yourisp.com" autoStartMediaObject="false"
         defaultVideoPlayerWidth="640" defaultVideoPlayerHeight="480"
         defaultAudioPlayerWidth="300" defaultAudioPlayerHeight="200"
         defaultGenericObjectWidth="640" defaultGenericObjectHeight="480" />
        <galleryObject>
            <mediaObjects>
                <mediaObject mimeType="image/*">
                    <browsers>
                        <browser id="default" htmlOutput="&lt;img src=&quot;{MediaObjectUrl}&quot; class=&quot;{CssClass}&quot; alt=&quot;{TitleNoHtml}&quot; title=&quot;{TitleNoHtml}&quot; style=&quot;height:{Height}px;width:{Width}px;&quot; /&gt;" />
                    </browsers>
                </mediaObject>
            </mediaObjects>
            <mimeTypes>
                <mimeType fileExtension=".abc" browserId="default" type="text/unsupported"
                 allowAddToGallery="false" />
            </mimeTypes>
        </galleryObject>
        <dataStore albumTitleLength="200" albumDirectoryNameLength="25"
         albumSummaryLength="1500" mediaObjectTitleLength="1000" mediaObjectFilenameLength="255"
         mediaObjectHashKeyLength="47" mediaObjectMetadataDescriptionLength="100"
         mediaObjectMetadataValueLength="2000" roleNameLength="256" />
        <dataProvider defaultProvider="SqlDataProvider">
            <providers>
                <add name="SqlDataProvider" type="GalleryServerPro.Data.SqlDataProvider, GalleryServerPro.Data" />
            </providers>
        </dataProvider>
    </galleryServerPro>

</configuration>


Hope this helps,


Roger Martin
Lead Developer for Gallery Server Pro
compugraph
Posted: Thursday, October 02, 2008 10:58:33 AM
Rank: Member

Joined: 10/1/2008
Posts: 18
Location: Germany
thx a lot,
changed all settings to the current, still have dataprovider problem:
"File or Assembly GalleryServerPro.Data" couldn't be found

Problem occurs when instantiating the providers in DataProviderManager.cs:

System.Web.Configuration.ProvidersHelper.InstantiateProviders(dataProviderConfig.Providers, _providerCollection, typeof(DataProvider));

Ralf

Roger Martin
Posted: Friday, October 03, 2008 10:29:20 AM
Rank: Administration

Joined: 8/3/2007
Posts: 844
Location: Fort Atkinson, WI
The <dataProvider ...> section changed a bit in the later versions. It should look like this:

Code:
<dataProvider defaultProvider="SqlServerGalleryServerProProvider">
<providers>
<add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection"
  name="SqlServerGalleryServerProProvider" type="GalleryServerPro.Data.SqlServer.SqlDataProvider, GalleryServerPro.Data.SqlServer" />
</providers>
</dataProvider>


Note that it references GalleryServerPro.Data.SqlServer instead of GalleryServerPro.Data. That's because, starting in 2.1.3162, I replaced GalleryServerPro.Data.dll with one for each data provider: GalleryServerPro.Data.SqlServer.dll and GalleryServerPro.Data.SQLite.dll.



Roger Martin
Lead Developer for Gallery Server Pro
compugraph
Posted: Friday, October 03, 2008 11:31:01 AM
Rank: Member

Joined: 10/1/2008
Posts: 18
Location: Germany
yep! thx!!!!
got it, and it works! :-)

....currently on extracting more metadata out of images, esp. the xmp tags.
and found a nice app helping us a lot:

http://www.wiredprairie.us/journal/2007/04/photoscroll_the_worst_named_wp.html



Ralf.
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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.2 (NET v2.0) - 9/27/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.