Is it possible to assign a gscope to a database collection?
created
Jun '18
last reply
Jun '18
- 4
replies
- 5.5k
views
- 3
users
- 3
links
Is it possible to assign a gscope to a database collection?
gscopes are tied to the URLs usually - for DB collections this might be difficult as the URL is usually linked to the primary key - so you end usually up with URLs that look like http://1 http://2 and so on.
However you should be able to make use of query gscopes with database collections, which assign gscopes based on a query. eg. you might assign a gscopes of "publications" to all DB items that have a type of pub - which could be something like query of type:pub if the DB types are mapped to a metadata class called 'type'. See: https://docs.funnelback.com/15.14/more/extra/query-gscopes.cfg.html6
Thanks all - I had looked at the query gscopes. From my understanding I would need to add something into my DB query to identify it - e.g. add a hard coded field in my query (select "publications" as type) - then map this to a metadata class so I can then use it in the gscopes. Or is there an alternative way of doing this?
Query gscopes uses a funnelback query to scope the results.
For a DB collection you'll presumably be mapping the DB fields returned by the SQL query to Funnelback meta classes so as long as you can come up with a Funnelback query that returns the set of results you want to group together you can use this as the query gscopes constraint.