SolutionModel - Get a list of Medias

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

SolutionModel - Get a list of Medias

Postby LOGIsoft » Mon Jun 29, 2009 9:45 pm

Hi,

It would be nice to be able to obtain a list of medias for a solution via the SolutionModel, just like we do for the Methods and Variables (both form and Global) - maybe even including the medias in the modules used? Pretty please... :)

Thanks,

Ben
Benoit R. Savignac, president
LOGIsoft Consulting inc.
--------------------------------------------------------
Servoy Alliance Network Partner
User avatar
LOGIsoft
 
Posts: 260
Joined: Wed May 24, 2006 3:06 pm
Location: St-Basile-le-Grand (Montreal), Qc, Canada

Re: SolutionModel - Get a list of Medias

Postby mboegem » Tue Jun 30, 2009 9:45 am

Although you must be carefull with this: you could use the repository database to extract this data.

For medianames this would be the query:
Code: Select all
SELECT DISTINCT property_value FROM servoy_element_properties WHERE content_id = 276
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1526
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: SolutionModel - Get a list of Medias

Postby ROCLASI » Tue Jun 30, 2009 9:51 am

Of course that would return ALL media from ALL solutions in the repository. Not only the ones from your loaded solution and it's modules.
But if that is what you want then that would work I guess.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Twitter: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5322
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: SolutionModel - Get a list of Medias

Postby LOGIsoft » Tue Jun 30, 2009 12:27 pm

Thanks Marc and Robert - I guess I could specify the name/ID of my solution and modules in the SQL query - does anybody know the correct syntax for this?

Actually, it would be nice to have an (exhaustive) list of properties (such as all possible values for content_id and what they mean, ie. 276 = MEDIA) we can get back from the repository using SQL queries... :idea:

Thanks again,

Ben
Benoit R. Savignac, president
LOGIsoft Consulting inc.
--------------------------------------------------------
Servoy Alliance Network Partner
User avatar
LOGIsoft
 
Posts: 260
Joined: Wed May 24, 2006 3:06 pm
Location: St-Basile-le-Grand (Montreal), Qc, Canada

Re: SolutionModel - Get a list of Medias

Postby mboegem » Tue Jun 30, 2009 9:16 pm

Hi Ben,

looked a bit further into this as it is not a big mysterie to get down to what you want from the repository...

Code: Select all
SELECT ep.property_value FROM servoy_element_properties ep, servoy_elements e, servoy_root_elements re where re.name = ? and ep.content_id = 276 and ep.element_id = e.element_id and e.root_element_id = re.root_element_id


you need to pass an argument into the query which is the name of the solution...
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1526
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: SolutionModel - Get a list of Medias

Postby LOGIsoft » Wed Jul 01, 2009 12:24 pm

Thanks for that code snippet, Marc - much obliged. :)

Still would like to know where we can find a list of content_id numbers and what they mean, though... :(
Benoit R. Savignac, president
LOGIsoft Consulting inc.
--------------------------------------------------------
Servoy Alliance Network Partner
User avatar
LOGIsoft
 
Posts: 260
Joined: Wed May 24, 2006 3:06 pm
Location: St-Basile-le-Grand (Montreal), Qc, Canada

Re: SolutionModel - Get a list of Medias

Postby pbakker » Wed Jul 01, 2009 12:47 pm

Querying the repository database is not recommended at all. For one, the structure of the repository database might change between versions of Servoy.

Better to request the feature to get a list of all media's.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: SolutionModel - Get a list of Medias

Postby mboegem » Wed Jul 01, 2009 2:56 pm

mboegem wrote:Although you must be carefull with this


That's why I started off with the above at the first place.

Reading the data will not harm the repository, but what Paul stated is right (of course, he's a Servoyian :D )

We use it to have easy access to the correct spelling of our media, when entering the medianame in the applications metadata.
As this is for internal use, customers won't even notice when this piece of code won't work as a result of future repository changes...

Anyway, thnkx for your completion Paul!
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1526
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 0 guests