[BioMart Users] Plugin development for candidate 7

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[BioMart Users] Plugin development for candidate 7

Mariette
Hi everyone,
I'm new in using biomart and I'm trying to understand how to develop a
basic plugin. To do so, I have a single mart table:
contig_db with the table:
  species__contig__main
     - contig_id_key
     - name
     - length
interfacing an already existing plugin works just fine, I can request
and I have results displayed.
I made request using the REST api as following:

http://localhost:9000/martservice/results?query=<!DOCTYPE Query><Query
client="webbrowser" processor="TSVX" limit="-1"header="0"><Datase
name="species_db" config="species_config"><Attribute
name="species__contig__main__length" /></Dataset></Query>

what is working,

however inside my plugin, in my .js if I made the same request as following:

function initialize() {

    xml = '<!DOCTYPE Query><Query client="webbrowser" processor="TSVX"
limit="-1"header="0"><Datase name="species_db"    
config="species_config"><Attribute name="species__contig__main__length"
/></Dataset></Query>';
    $.ajax({
        url: 'martservice/results?query='+xml,
        success: function(data) {
            alert(data);
        }
    });
}

what is just returning nothing!
I tryed using the "biomart.resource.load('results', function(json) {"
function as well but I wasn't more more lucky !

I barely understand how request results are displayed in other plugins,
if I take martform as example, I get stocke here
        _elements.content.slideUp({
            duration: 'fast',
            complete: function() {
                _elements.results.resultsPanel('run',
                    title,
                    $.extend({
                        queries: xml,
                        downloadXml: downloadXml,
                        martObj: mart,
                        dataAggregation: 'none',
                        displayType: 'table'
                    }, QUERY_RESULTS_OPTIONS));
            }
        });
I don't get which function is called to process the data.

Thanks for your help,
Jerome

_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: [BioMart Users] Plugin development for candidate 7

Jack Hsu
Hi Mariette,

Make sure the request URL is correct. From your code, the martservice path
is relative to your current path.

You can use BIOMART_CONFIG.service.url to get the proper prefix. Also, you
may want to pass the query inside the data portion of the $.ajax options.

E.g.

$.ajax({
    url: BIOMART_CONFIG.service.url + 'results',
    data: {
        query: '<!DOCTYPE Query><Query client="webbrowser"
processor="TSVX" limit="-1"header="0">'
        + '<Datase name="species_db" config="species_config"><Attribute
name="species__contig__main__length" />'
        + '</Dataset></Query>'    }

});



-jack


On 11-10-17 4:50 AM, "Mariette" <[hidden email]> wrote:

>Hi everyone,
>I'm new in using biomart and I'm trying to understand how to develop a
>basic plugin. To do so, I have a single mart table:
>contig_db with the table:
>  species__contig__main
>     - contig_id_key
>     - name
>     - length
>interfacing an already existing plugin works just fine, I can request
>and I have results displayed.
>I made request using the REST api as following:
>
>http://localhost:9000/martservice/results?query=<!DOCTYPE Query><Query
>client="webbrowser" processor="TSVX" limit="-1"header="0"><Datase
>name="species_db" config="species_config"><Attribute
>name="species__contig__main__length" /></Dataset></Query>
>
>what is working,
>
>however inside my plugin, in my .js if I made the same request as
>following:
>
>function initialize() {
>
>    xml = '<!DOCTYPE Query><Query client="webbrowser" processor="TSVX"
>limit="-1"header="0"><Datase name="species_db"
>config="species_config"><Attribute name="species__contig__main__length"
>/></Dataset></Query>';
>    $.ajax({
>        url: 'martservice/results?query='+xml,
>        success: function(data) {
>            alert(data);
>        }
>    });
>}
>
>what is just returning nothing!
>I tryed using the "biomart.resource.load('results', function(json) {"
>function as well but I wasn't more more lucky !
>
>I barely understand how request results are displayed in other plugins,
>if I take martform as example, I get stocke here
>        _elements.content.slideUp({
>            duration: 'fast',
>            complete: function() {
>                _elements.results.resultsPanel('run',
>                    title,
>                    $.extend({
>                        queries: xml,
>                        downloadXml: downloadXml,
>                        martObj: mart,
>                        dataAggregation: 'none',
>                        displayType: 'table'
>                    }, QUERY_RESULTS_OPTIONS));
>            }
>        });
>I don't get which function is called to process the data.
>
>Thanks for your help,
>Jerome
>
>_______________________________________________
>Users mailing list
>[hidden email]
>https://lists.biomart.org/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: [BioMart Users] Plugin development for candidate 7

Mariette

Hi and thanks for your reply !!!


Jack Hsu a écrit :
> Hi Mariette,
>
> Make sure the request URL is correct. From your code, the martservice path
> is relative to your current path.
>
> You can use BIOMART_CONFIG.service.url to get the proper prefix. Also, you
> may want to pass the query inside the data portion of the $.ajax options.
>
>  
forgot to tell, but I tryed this alos ... BIOMART_CONFIG.service.url
without any success

> E.g.
>
> $.ajax({
>     url: BIOMART_CONFIG.service.url + 'results',
>     data: {
>         query: '<!DOCTYPE Query><Query client="webbrowser"
> processor="TSVX" limit="-1"header="0">'
>         + '<Datase name="species_db" config="species_config"><Attribute
> name="species__contig__main__length" />'
>         + '</Dataset></Query>'    }
>
> });
>
>  
the whole function is then:
    $.ajax({
        url: BIOMART_CONFIG.service.url + 'results',
        data: {
            query: '<!DOCTYPE Query><Query client="webbrowser"
processor="TSVX" limit="-1"header="0"> <Datase name="species_db"
config="species_config"><Attribute name="species__contig__main__length"
/> </Dataset></Query>'
            },
            success: function(data) {
                alert("ssdsds");
            }
    });

but it's not working either ... Is this the right way to request the
database ?
Because this is the way provided in the documentation to implement a
plugin, but this is not the way it's done in martform, martsearch ...

Thanks,
Jerome


>
> -jack
>
>
> On 11-10-17 4:50 AM, "Mariette" <[hidden email]> wrote:
>
>  
>> Hi everyone,
>> I'm new in using biomart and I'm trying to understand how to develop a
>> basic plugin. To do so, I have a single mart table:
>> contig_db with the table:
>>  species__contig__main
>>     - contig_id_key
>>     - name
>>     - length
>> interfacing an already existing plugin works just fine, I can request
>> and I have results displayed.
>> I made request using the REST api as following:
>>
>> http://localhost:9000/martservice/results?query=<!DOCTYPE Query><Query
>> client="webbrowser" processor="TSVX" limit="-1"header="0"><Datase
>> name="species_db" config="species_config"><Attribute
>> name="species__contig__main__length" /></Dataset></Query>
>>
>> what is working,
>>
>> however inside my plugin, in my .js if I made the same request as
>> following:
>>
>> function initialize() {
>>
>>    xml = '<!DOCTYPE Query><Query client="webbrowser" processor="TSVX"
>> limit="-1"header="0"><Datase name="species_db"
>> config="species_config"><Attribute name="species__contig__main__length"
>> /></Dataset></Query>';
>>    $.ajax({
>>        url: 'martservice/results?query='+xml,
>>        success: function(data) {
>>            alert(data);
>>        }
>>    });
>> }
>>
>> what is just returning nothing!
>> I tryed using the "biomart.resource.load('results', function(json) {"
>> function as well but I wasn't more more lucky !
>>
>> I barely understand how request results are displayed in other plugins,
>> if I take martform as example, I get stocke here
>>        _elements.content.slideUp({
>>            duration: 'fast',
>>            complete: function() {
>>                _elements.results.resultsPanel('run',
>>                    title,
>>                    $.extend({
>>                        queries: xml,
>>                        downloadXml: downloadXml,
>>                        martObj: mart,
>>                        dataAggregation: 'none',
>>                        displayType: 'table'
>>                    }, QUERY_RESULTS_OPTIONS));
>>            }
>>        });
>> I don't get which function is called to process the data.
>>
>> Thanks for your help,
>> Jerome
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> https://lists.biomart.org/mailman/listinfo/users
>>    
>
>  

_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

[BioMart Users] Plugin configuration

Mariette
In reply to this post by Mariette
Hi everyone,
I'm implementing a biomart plugin, however I'd like it be generic and
not depending on a database.
To do so I would like to be able to configure it, as exmeple I would
like to have some configuration like this:

table_name = table__table__main
table_start_field = start
table_end_field = end

with this parameters, the plugin can extract the data required from any
database model. I tryed to use the processor.properties, but this
one doesn't want any other value than the expected ones.

What would be the best way to do this in biomart ?
other question, is it plain to allow a configuration of a plugin in the
martconfigurator ?

thanks,
Jerome
_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: [BioMart Users] Plugin configuration

Arek Kasprzyk
Dear Mariette,
yes definitely, the plugin configuration will happen in MConfigurator. That's the plan for the near future.
I am cc'ing Jack Hsu who  implemented pluggins for BioMart in case he would like to help with your current problem

a

On Tue, Dec 20, 2011 at 5:06 AM, Mariette <[hidden email]> wrote:
Hi everyone,
I'm implementing a biomart plugin, however I'd like it be generic and not depending on a database.
To do so I would like to be able to configure it, as exmeple I would like to have some configuration like this:

table_name = table__table__main
table_start_field = start
table_end_field = end

with this parameters, the plugin can extract the data required from any database model. I tryed to use the processor.properties, but this
one doesn't want any other value than the expected ones.

What would be the best way to do this in biomart ?
other question, is it plain to allow a configuration of a plugin in the martconfigurator ?

thanks,
Jerome
_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users