Re: [Dev] Implementing -Dsetup in a Carbon product

2015-11-21 Thread Hasitha Hiranya
Hi Anuruddha,

Thanks for the response.
Spotted following code,

https://github.com/wso2/carbon-ml/blob/master/components/ml/org.wso2.carbon.ml.database/src/main/java/org/wso2/carbon/ml/database/internal/MLConfigurationParser.java


Here we use javax.xml.bind.Unmarshaller

With

https://github.com/wso2/carbon-ml/blob/master/components/ml/org.wso2.carbon.ml.commons/src/main/java/org/wso2/carbon/ml/commons/domain/config/MLConfiguration.java


Is this the way to decrypt the xml tags properly? Are we looking at the
correct place?

Thanks

On Sat, Nov 21, 2015 at 6:46 PM, Anuruddha Premalal 
wrote:

> Hi Hiranya,
>
> [1] might help you.
>
> [1]
> https://github.com/wso2/carbon-ml/tree/master/components/ml/org.wso2.carbon.ml.database
>
> On Sat, Nov 21, 2015 at 8:58 AM, Hasitha Hiranya 
> wrote:
>
>> Hi,
>>
>> In our carbon product, we have a new database to deal with. We have the
>> DB script that creates the necessary tables to work with the product in a
>> specified  database pointed by
>> /repository/conf/datasources/masterdatasource.xml.
>>
>> If we write a code to source the DB Script, we need to
>> read masterdatasource.xml file ourselves and decode necessary xml values
>> from data source configuration. Is this the correct way of doing it?
>>
>> Or does Carbon have some interface or configuration object where it loads
>> the configs in masterdatasource.xml so that our code can read from?
>>
>> Thanks
>> --
>> *Hasitha Abeykoon*
>> Senior Software Engineer; WSO2, Inc.; http://wso2.com
>> *cell:* *+94 719363063*
>> *blog: **abeykoon.blogspot.com* 
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Anuruddha Premalal*
> Software Eng. | WSO2 Inc.
> Mobile : +94717213122
> Web site : www.anuruddha.org
>
>


-- 
*Hasitha Abeykoon*
Senior Software Engineer; WSO2, Inc.; http://wso2.com
*cell:* *+94 719363063*
*blog: **abeykoon.blogspot.com* 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Access DAS analytics tables through REST API

2015-11-21 Thread Dinali Dabarera
Hi Sinthuja,

i got a clue from your words "For each scenarios you can see a sample
request, and according to that you need to send the authentication headers
with your request. You can first try with curl or any other REST API tools,
and then try to incorporate with jaggery app"

Thank you very much. i confirmed the data on the database using curl, it
worked Now i will try that with jaggery. Thanks for giving a little
explanation.

Cheers!

On Sat, Nov 21, 2015 at 7:48 PM, Sinthuja Ragendran 
wrote:

> Hi Dinali,
>
> Please find the documentation [1] for interacting with the data which is
> stored in DAL via REST api. For each scenarios you can see a sample
> request, and according to that you need to send the authentication headers
> with your request. You can first try with curl or any other REST API tools,
> and then try to incorporate with jaggery app.
>
> [1]
> https://docs.wso2.com/display/DAS300/Checking+if+a+Given+Table+Exists+via+REST+API
>
> Thanks,
> Sinthuja.
>
> On Sat, Nov 21, 2015 at 7:10 AM, Dinali Dabarera  wrote:
>
>> HI,
>>
>> I am new to DAS and REST API.
>>
>> I converted normal h2 databases in to mysql as follows,
>>
>>  
>> WSO2_ANALYTICS_EVENT_STORE_DB
>> The datasource used for analytics record
>> store
>> 
>> 
>> jdbc:mysql://localhost:3306/Election
>> root
>> root
>>
>> com.mysql.jdbc.Driver
>> 80
>> 6
>> SELECT 1
>> false
>> 0
>> true
>>
>> 4000
>> 
>> 
>> 
>>
>> My intention is to store persistent data which i got from SPARK queeries
>> in to a mySQL databse/tables, so that i get retrieve them from outside
>> jaggery server/juggeryApp.
>>
>>
>> My work succeeded, I get data into databases.
>>
>> Now I tried to retrieve those data through a juggeryapp
>>
>> 
>> 
>>
>> Below is a Jaggery print
>>
>>  <%
>> config = {};
>> var db = new Database("jdbc:mysql://localhost:3306/Election",
>> "root", "root", config);
>> var q1 =" SELECT * FROM ANX___7LgTGRXo_ ";
>> var data= db.query(q1);
>> print(data);
>>
>>
>>  %>
>> 
>> 
>>
>>
>>
>> I get data but they are not in the format that I can read. MyQSL tables
>> created inside the Election database is unreadable.
>>
>> Database changed
>> mysql> show tables;
>> ++
>> | Tables_in_Election |
>> ++
>> | ANX___7LgTGRXo_|
>> | ANX___8GECxAtQ_|
>> | ANX___8GIvT7Rc_|
>> | ANX___8GMmoCp8_|
>> ++
>> 4 rows in set (0.00 sec)
>>
>>
>>
>> I found out this is because they are using rest API, But I cant find a
>> complete documentation to do what i want.
>>
>>
>> I did this,
>>
>> 
>> 
>>
>> Below is a Jaggery print
>>
>>  <%
>>
>>
>> var url  = " https://localhost:9446/api/configs/das/tables;;
>>
>>var twitterJson = get(url);
>>   print(twitterJson);
>>
>>
>>
>>
>>  %>
>>
>>
>> 
>> 
>>
>>
>>
>> But it does not work! it gives Error 500
>>
>> Can anyone give any suggestions!
>>
>> Thanks!
>>
>> Cheers!
>>
>> Dinali Rosemin
>> University of Peradeniya (Computer Engineering)
>> WSO2 Intern
>> 077-0198933
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Sinthuja Rajendran*
> Associate Technical Lead
> WSO2, Inc.:http://wso2.com
>
> Blog: http://sinthu-rajan.blogspot.com/
> Mobile: +94774273955
>
>
>


-- 
Dinali Rosemin
University of Peradeniya (Computer Engineering)
WSO2 Intern
077-0198933
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Access DAS analytics tables through REST API

2015-11-21 Thread Sinthuja Ragendran
Hi Dinali,

Please find the documentation [1] for interacting with the data which is
stored in DAL via REST api. For each scenarios you can see a sample
request, and according to that you need to send the authentication headers
with your request. You can first try with curl or any other REST API tools,
and then try to incorporate with jaggery app.

[1]
https://docs.wso2.com/display/DAS300/Checking+if+a+Given+Table+Exists+via+REST+API

Thanks,
Sinthuja.

On Sat, Nov 21, 2015 at 7:10 AM, Dinali Dabarera  wrote:

> HI,
>
> I am new to DAS and REST API.
>
> I converted normal h2 databases in to mysql as follows,
>
>  
> WSO2_ANALYTICS_EVENT_STORE_DB
> The datasource used for analytics record
> store
> 
> 
> jdbc:mysql://localhost:3306/Election
> root
> root
>
> com.mysql.jdbc.Driver
> 80
> 6
> SELECT 1
> false
> 0
> true
>
> 4000
> 
> 
> 
>
> My intention is to store persistent data which i got from SPARK queeries
> in to a mySQL databse/tables, so that i get retrieve them from outside
> jaggery server/juggeryApp.
>
>
> My work succeeded, I get data into databases.
>
> Now I tried to retrieve those data through a juggeryapp
>
> 
> 
>
> Below is a Jaggery print
>
>  <%
> config = {};
> var db = new Database("jdbc:mysql://localhost:3306/Election",
> "root", "root", config);
> var q1 =" SELECT * FROM ANX___7LgTGRXo_ ";
> var data= db.query(q1);
> print(data);
>
>
>  %>
> 
> 
>
>
>
> I get data but they are not in the format that I can read. MyQSL tables
> created inside the Election database is unreadable.
>
> Database changed
> mysql> show tables;
> ++
> | Tables_in_Election |
> ++
> | ANX___7LgTGRXo_|
> | ANX___8GECxAtQ_|
> | ANX___8GIvT7Rc_|
> | ANX___8GMmoCp8_|
> ++
> 4 rows in set (0.00 sec)
>
>
>
> I found out this is because they are using rest API, But I cant find a
> complete documentation to do what i want.
>
>
> I did this,
>
> 
> 
>
> Below is a Jaggery print
>
>  <%
>
>
> var url  = " https://localhost:9446/api/configs/das/tables;;
>
>var twitterJson = get(url);
>   print(twitterJson);
>
>
>
>
>  %>
>
>
> 
> 
>
>
>
> But it does not work! it gives Error 500
>
> Can anyone give any suggestions!
>
> Thanks!
>
> Cheers!
>
> Dinali Rosemin
> University of Peradeniya (Computer Engineering)
> WSO2 Intern
> 077-0198933
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Sinthuja Rajendran*
Associate Technical Lead
WSO2, Inc.:http://wso2.com

Blog: http://sinthu-rajan.blogspot.com/
Mobile: +94774273955
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Implementing -Dsetup in a Carbon product

2015-11-21 Thread Anuruddha Premalal
Hi Hiranya,

[1] might help you.

[1]
https://github.com/wso2/carbon-ml/tree/master/components/ml/org.wso2.carbon.ml.database

On Sat, Nov 21, 2015 at 8:58 AM, Hasitha Hiranya  wrote:

> Hi,
>
> In our carbon product, we have a new database to deal with. We have the DB
> script that creates the necessary tables to work with the product in a
> specified  database pointed by
> /repository/conf/datasources/masterdatasource.xml.
>
> If we write a code to source the DB Script, we need to
> read masterdatasource.xml file ourselves and decode necessary xml values
> from data source configuration. Is this the correct way of doing it?
>
> Or does Carbon have some interface or configuration object where it loads
> the configs in masterdatasource.xml so that our code can read from?
>
> Thanks
> --
> *Hasitha Abeykoon*
> Senior Software Engineer; WSO2, Inc.; http://wso2.com
> *cell:* *+94 719363063*
> *blog: **abeykoon.blogspot.com* 
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Anuruddha Premalal*
Software Eng. | WSO2 Inc.
Mobile : +94717213122
Web site : www.anuruddha.org
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Access DAS analytics tables through REST API

2015-11-21 Thread Dinali Dabarera
HI,

I am new to DAS and REST API.

I converted normal h2 databases in to mysql as follows,

 
WSO2_ANALYTICS_EVENT_STORE_DB
The datasource used for analytics record
store


jdbc:mysql://localhost:3306/Election
root
root
com.mysql.jdbc.Driver
80
6
SELECT 1
false
0
true

4000




My intention is to store persistent data which i got from SPARK queeries in
to a mySQL databse/tables, so that i get retrieve them from outside jaggery
server/juggeryApp.


My work succeeded, I get data into databases.

Now I tried to retrieve those data through a juggeryapp




Below is a Jaggery print

 <%
config = {};
var db = new Database("jdbc:mysql://localhost:3306/Election",
"root", "root", config);
var q1 =" SELECT * FROM ANX___7LgTGRXo_ ";
var data= db.query(q1);
print(data);


 %>





I get data but they are not in the format that I can read. MyQSL tables
created inside the Election database is unreadable.

Database changed
mysql> show tables;
++
| Tables_in_Election |
++
| ANX___7LgTGRXo_|
| ANX___8GECxAtQ_|
| ANX___8GIvT7Rc_|
| ANX___8GMmoCp8_|
++
4 rows in set (0.00 sec)



I found out this is because they are using rest API, But I cant find a
complete documentation to do what i want.


I did this,




Below is a Jaggery print

 <%


var url  = " https://localhost:9446/api/configs/das/tables;;

   var twitterJson = get(url);
  print(twitterJson);




 %>







But it does not work! it gives Error 500

Can anyone give any suggestions!

Thanks!

Cheers!

Dinali Rosemin
University of Peradeniya (Computer Engineering)
WSO2 Intern
077-0198933
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev