Provider Properties Details Wish

13 messages Options
Embed this post
Permalink
Crispin_at_1Spatial

Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
Hi,

The FDO provider classes have methods that enable the auto generation of the user interfaces that create a FDO connection. However there is some information the providers should provide but don’t / could.

For instance, it is not possible to find out if a string parameter represents a file name, or a password. So the auto generated user interface code cannot instantiate the file open panel, or anonymize a password field.

I assume this seemingly simple change would require a fairly major RFC and support by all the providers.
If there are alternative workarounds to this I would be glad to hear...
Dan Stoica

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
Hi,

The info you need is available through the connection object:

       FdoPtr<FdoIConnectionInfo> connInfo = mConnection->GetConnectionInfo();

Where FdoIConnectionInfo has this method:

    /// \brief
    /// Returns the provider type. A provider can be a file-based, database-based or
    /// web-based provider. The valid values the function may return are defined in
    /// the enumeration FdoProviderDatastoreType. The enumeration includes the following
    /// values: FdoProviderDatastoreType_Unknown, FdoProviderDatastoreType_File,
    /// FdoProviderDatastoreType_DatabaseServer, FdoProviderDatastoreType_WebServer.
    ///
    /// \return
    /// Returns the provider data store type.
    ///
    FDO_API virtual FdoProviderDatastoreType GetProviderDatastoreType() = 0;

Then with this you can dig further for detailed info:

FdoPtr<FdoIConnectionPropertyDictionary> connProps = connInfo->GetConnectionProperties();


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Crispin_at_1Spatial
Sent: Thursday, February 26, 2009 10:37 AM
To: [hidden email]
Subject: [fdo-users] Provider Properties Details Wish


Hi,

The FDO provider classes have methods that enable the auto generation of the
user interfaces that create a FDO connection. However there is some
information the providers should provide but don’t / could.

For instance, it is not possible to find out if a string parameter
represents a file name, or a password. So the auto generated user interface
code cannot instantiate the file open panel, or anonymize a password field.

I assume this seemingly simple change would require a fairly major RFC and
support by all the providers.
If there are alternative workarounds to this I would be glad to hear...

--
View this message in context: http://n2.nabble.com/Provider-Properties-Details-Wish-tp2390311p2390311.html
Sent from the FDO Users mailing list archive at Nabble.com.

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Orest Halustchak

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
In reply to this post by Crispin_at_1Spatial
Hi Crispin,

The connection property dictionary (FdoIConnectionPropertyDictionary) has some methods that should help.

IsPropertyProtected() - if true, then it's a password type property.

IsPropertyFileName()
IsPropertyFilePath()

Thanks,
Orest.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Crispin_at_1Spatial
Sent: Thursday, February 26, 2009 10:37 AM
To: [hidden email]
Subject: [fdo-users] Provider Properties Details Wish


Hi,

The FDO provider classes have methods that enable the auto generation of the
user interfaces that create a FDO connection. However there is some
information the providers should provide but don’t / could.

For instance, it is not possible to find out if a string parameter
represents a file name, or a password. So the auto generated user interface
code cannot instantiate the file open panel, or anonymize a password field.

I assume this seemingly simple change would require a fairly major RFC and
support by all the providers.
If there are alternative workarounds to this I would be glad to hear...

--
View this message in context: http://n2.nabble.com/Provider-Properties-Details-Wish-tp2390311p2390311.html
Sent from the FDO Users mailing list archive at Nabble.com.

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Crispin_at_1Spatial

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
In reply to this post by Dan Stoica
Dan,

Not quite what I was after - you can derive much from this and the names but it's the actual connection parameters.  For example SHP has a "DefaultFileLocation" that is a file but I only know it's a file by human logic and looking up in the manual.  "MySQL" has a "DataStore" that is not a file but SQLite's datastore is a file.  A generic application should know how to present each parameter as boolean / file / hiddenpassword without having to create custom pages per provider.  Is that clearer?
Crispin_at_1Spatial

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
In reply to this post by Orest Halustchak
Thanks Orest - that's pretty much what I couldn't find myself...

 Crispin
Dan Stoica

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
In reply to this post by Crispin_at_1Spatial
> that is a file but I only know it's a file by human logic and looking up in the manual

But GetProviderDatastoreType() tells you if it's a file or not.


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Crispin_at_1Spatial
Sent: Thursday, February 26, 2009 11:14 AM
To: [hidden email]
Subject: RE: [fdo-users] Provider Properties Details Wish


Dan,

Not quite what I was after - you can derive much from this and the names but
it's the actual connection parameters.  For example SHP has a
"DefaultFileLocation" that is a file but I only know it's a file by human
logic and looking up in the manual.  "MySQL" has a "DataStore" that is not a
file but SQLite's datastore is a file.  A generic application should know
how to present each parameter as boolean / file / hiddenpassword without
having to create custom pages per provider.  Is that clearer?
--
View this message in context: http://n2.nabble.com/Provider-Properties-Details-Wish-tp2390311p2390564.html
Sent from the FDO Users mailing list archive at Nabble.com.

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Crispin_at_1Spatial

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
In reply to this post by Orest Halustchak
Orest,

Using .net it looks like only 'IsPropertyProtected()' is exposed - I don't see the other methods, should they be in the API?

 Crispin


Orest Halustchak wrote:
Hi Crispin,

The connection property dictionary (FdoIConnectionPropertyDictionary) has some methods that should help.

IsPropertyProtected() - if true, then it's a password type property.

IsPropertyFileName()
IsPropertyFilePath()

Thanks,
Orest.
Romica Dascalescu

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
Hi Crispin,

I had a look in .NET FDO API and below is the class containing connection properties:
Indeed there are a few things missing here to be able to create a nice dynamical connection dialog.

namespace OSGeo.FDO.Connections

public interface IConnectionPropertyDictionary : IDisposable
{
    // Methods
    string[] EnumeratePropertyValues(string name);
    string GetLocalizedName(string name);
    string GetProperty(string name);
    string GetPropertyDefault(string name);
    [return: MarshalAs(UnmanagedType.U1)]
    bool IsPropertyEnumerable(string name);
    [return: MarshalAs(UnmanagedType.U1)]
    bool IsPropertyFileName(string name);
    [return: MarshalAs(UnmanagedType.U1)]
    bool IsPropertyFilePath(string name);
    [return: MarshalAs(UnmanagedType.U1)]
    bool IsPropertyProtected(string name);
    [return: MarshalAs(UnmanagedType.U1)]
    bool IsPropertyRequired(string name);
    void SetProperty(string name, string value);
    // Properties
    string[] PropertyNames { get; }
}

Romy.
________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Crispin_at_1Spatial [[hidden email]]
Sent: Thursday, February 26, 2009 12:28 PM
To: [hidden email]
Subject: RE: [fdo-users] Provider Properties Details Wish

Orest,

Using .net it looks like only 'IsPropertyProtected()' is exposed - I don't
see the other methods, should they be in the API?

 Crispin



Orest Halustchak wrote:

>
> Hi Crispin,
>
> The connection property dictionary (FdoIConnectionPropertyDictionary) has
> some methods that should help.
>
> IsPropertyProtected() - if true, then it's a password type property.
>
> IsPropertyFileName()
> IsPropertyFilePath()
>
> Thanks,
> Orest.
>
>

--
View this message in context: http://n2.nabble.com/Provider-Properties-Details-Wish-tp2390311p2391055.html
Sent from the FDO Users mailing list archive at Nabble.com.

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Jackie Ng

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
In reply to this post by Crispin_at_1Spatial
Are you using 3.3? Those APIs were omitted from the managed API (for reasons unknown). 3.4 has these omitted methods the managed API.

- Jackie

Crispin_at_1Spatial wrote:
Orest,

Using .net it looks like only 'IsPropertyProtected()' is exposed - I don't see the other methods, should they be in the API?

 Crispin


Orest Halustchak wrote:
Hi Crispin,

The connection property dictionary (FdoIConnectionPropertyDictionary) has some methods that should help.

IsPropertyProtected() - if true, then it's a password type property.

IsPropertyFileName()
IsPropertyFilePath()

Thanks,
Orest.
Crispin_at_1Spatial

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
Jackie,

Thanks - 3.3 it is.  I have a parallell solution sharing source code but referencing the 3.4 resources so I will be able to use these going forwards...  Crispin


Jackie Ng wrote:
Are you using 3.3? Those APIs were omitted from the managed API (for reasons unknown). 3.4 has these omitted methods the managed API.

- Jackie

Crispin_at_1Spatial wrote:
Orest,

Using .net it looks like only 'IsPropertyProtected()' is exposed - I don't see the other methods, should they be in the API?

 Crispin


Orest Halustchak wrote:
Hi Crispin,

The connection property dictionary (FdoIConnectionPropertyDictionary) has some methods that should help.

IsPropertyProtected() - if true, then it's a password type property.

IsPropertyFileName()
IsPropertyFilePath()

Thanks,
Orest.
Crispin_at_1Spatial

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
In reply to this post by Romica Dascalescu
OK,

So now it looks like not all the providers support this functionality properly in the 3.4 RC

For example:

 * The WFS provider does not set the "Password" property with IsPropertyProtected()

 * The SQLite provider does not set the "File" property with IsPropertyFileName()

 Crispin
Crispin_at_1Spatial

RE: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
Reply to my own post...

SQLite is OK (my mistake) but the following minor properties could be fixed:

 * The WFS provider does not set the "Password" property with IsPropertyProtected()

 * The KingOra provider does not set the "Password" property with IsPropertyProtected()


Crispin_at_1Spatial wrote:
OK,

So now it looks like not all the providers support this functionality properly in the 3.4 RC

For example:

 * The WFS provider does not set the "Password" property with IsPropertyProtected()

 * The SQLite provider does not set the "File" property with IsPropertyFileName()

 Crispin
Frank Warmerdam

Re: Provider Properties Details Wish

Reply Threaded More More options
Print post
Permalink
In reply to this post by Crispin_at_1Spatial
Crispin_at_1Spatial wrote:

> OK,
>
> So now it looks like not all the providers support this functionality
> properly in the 3.4 RC
>
> For example:
>
>  * The WFS provider does not set the "Password" property with
> IsPropertyProtected()
>
>  * The SQLite provider does not set the "File" property with
> IsPropertyFileName()

Crispin,

I'd suggest filing tickets on all the issues you encounter in this
regard.  It would be even nicer to file them with patches.

I've been thinking a bit about this with regard to the GDAL provider.
Unfortunately the dataset argument to the GDAL provider might be
a file, a directory or something not obviously related to the file
system so it isn't obvious what to do about it.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users