Re: [Dev] [DEV][Automation] - How to automate the Drag-Drop Action in Test-case Using selenium

2015-11-03 Thread Rajeenthini Satkunam
Hi All,

I tried out what nipuna suggested.I have done small change Because using
"nth child" is not good way to have in test java file.that
1) first we make all the element of class .ues-thumbnails will be draggable
element
2) Then we point out the elements we need to move and the target which the
element need to be drop,
3) Action drag and drop using simulate function using jquery.simulate.js

$(".ues-thumbnail").draggable({
  cancel: false,
  appendTo: 'body',// These are the options we gave when writing the
draggable element.
  helper: 'clone',
  start: function (event, ui) {
ui.helper.addClass('ues-store-thumbnail');
},
  stop: function (event, ui) {
ui.helper.removeClass('ues-store-thumbnail');
}
});

var gadget = $("#g1");
var target = $("#a");
var targetOffset = target.offset();
var gadgetOffset = gadget.offset();

var dx = targetOffset.left - gadgetOffset.left;
var dy = targetOffset.top - gadgetOffset.top;

gadget.simulate('drag', {
dx: dx,
dy: dy
});

Thank you @nipuna for your prompt reply and a try.


On Tue, Nov 3, 2015 at 12:07 PM, Rajeenthini Satkunam 
wrote:

> Hi all,
>
> IMHO when we calling the Javascript method directly it does not mean
> actual drag and drop.So better we can try @nipuna suggestion as first
> making the elements draggable and try simulate function using
> jquery.simulate.js for drag and drop action,I have tried simulate earlier
> but I missed to make elements draggable.So I am working on this approach :).
>
> On Tue, Nov 3, 2015 at 11:55 AM, Nipuna Chandradasa 
> wrote:
>
>> HI manu,
>>
>> I didn't try the 1st alternative that Rajeenthini mentioned ( set
>> timeout for ues thumbnails to make them drag-gable to drag and drop action).
>> But i tried the 2nd alternative which making  createComponent() and
>> findStoreCache() methods public... and it worked.
>>
>> But isn't it good if we did not change the code to do the tests ... ?
>> Also Jquery uses their jquery.simulate.js to test there functionalities. So
>> using that to test the drag and drop in our scenario is good isn't it?
>>
>> On Tue, Nov 3, 2015 at 11:33 AM, Rajeenthini Satkunam <
>> rajeenth...@wso2.com> wrote:
>>
>>> Hi manu,
>>>
>>> I have tried with the modification done in my local checkout.
>>>
>>> 1) we have set timeout for ues thumbnails to make them drag-gable to
>>> drag and drop action.
>>> 2) we have called the javascript function  { createComponent($("#a"),
>>> findStoreCache("gadget", "g1")); } to crate gadget using the method
>>> JavascriptExecutor
>>>
>>> By first approach I could not resolve the drag and drop action using
>>> selenium But the second approach works fine and we have drawback that we
>>> need to make two javascript function at designer.js file as global
>>> functions to use the createComponent to do drag and drop Action using
>>> selenium.
>>>
>>> As per discussion with @nipuna the only problem with our UI that only
>>> those elements are draggable when mouse over.So IMHO we can make them
>>> draggable and after that can do the drag and drop Action.I will go through
>>> the nipuna's suggestion as well and will update the mail thread.
>>>
>>>
>>>
>>> On Tue, Nov 3, 2015 at 6:35 AM, Manuranga Perera  wrote:
>>>
 I also noted the on mouseenter event drag-able issue and made a local
 change in Rajeenthini's checkout.
 Rajeenthini, were you able to test it with that change?

 On Mon, Nov 2, 2015 at 7:16 PM, Nipuna Chandradasa 
 wrote:

> Hi Rajeenthini,
>
> I tried one of your references which uses jquery.simulate.js to test
> the jquery UI functionality. It worked.
> Only thing that it didnt work with out product is we only make the
> element draggable when the mouseenter event. I progamatically made it
> draggable. Then using jquery simulator i simulate the drag and drop.
>
> this is the link i refer ( it's 6th reference in your list :D )
>
>
> http://stackoverflow.com/questions/16848165/programmatically-drag-and-drop-element-onto-another-element
>
> Following is what i did:
>
> ((JavascriptExecutor)getDriver()).executeScript(" var draggableElement = 
> $('#ues-store-gadget > div > div.row.ues-thumbnails > div:nth-child(1) > 
> div').draggable({"+
>
> "cancel: false," +
>
> "appendTo: 'body'," + // These are 
> the options we gave when writing the draggable element.
>
> "helper: 'clone'," +
>
> "start: function (event, ui) {" +
>
> "ui.helper.addClass('ues-store-thumbnail');}," +
>
> "stop: function (event, ui) {" +
>
> "ui.helper.removeClass('ues-store-thumbnail');" +
>
> "}})," +
>
> "dropableElement=$('#a');"+   // Defining Dropable element
>
> "var droppableOffset = 

[Dev] [IS] Yahoo OAuth2/OpenID Connect as Identity Provider - Creating Yahoo Oauth App to get client credentials.

2015-11-03 Thread Nadeesha Meegoda
Hi IS team,

I've created an Yahoo App for the above mentioned purpose and to add the
Callback domain  it requires a payment to be done. I get the following
message

"Enable billing for BOSS API
. No Billing
Information has been provided. The API will not work until you complete
this step."

Do we need to actually give the callback domain? Without that I have tried
but fails when authenticating. (Note that it directs to Yahoo
authentication successfully). I have attached my IDP configuration

Has anyone of you tested Yahoo OAuth2/OpenID Connect as Identity Provider?
If so can you please provide the test client credentials or let me know how
this should be done.

Since this was added recently to IS implementation, the IS 510
documentation should be updated. The improvement tracked in [1]

[1] - https://wso2.org/jira/browse/DOCUMENTATION-2664

Thanks
Nadeesha

-- 
*Nadeesha Meegoda*
Software Engineer - QA
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
email : nadees...@wso2.com
mobile: +94783639540
<%2B94%2077%202273555>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS][Workflow] Workflow Dashboard Gadget - Operations Exposed to End User

2015-11-03 Thread Chamila Wijayarathna
Hi all,

Currently we don't have any use case for the suspend operation, also when
we are using external BPS for an interested party suspending human tasks
can be done by logging to BPS. So we will remove suspend/resume operations
from dashboard gadget.

Thanks.

On Tue, Nov 3, 2015 at 10:43 AM, Hasitha Aravinda  wrote:

> Hi Chamila,
>
> On Tue, Nov 3, 2015 at 9:50 AM, Chamila Wijayarathna 
> wrote:
>
>> Hi all,
>>
>> Currently IS expose a dashboard gadget where users can see and
>> approve/reject workflow requests assigned to him or claimable to him.
>> Previously we exposed following operations for dashboard users.
>>
>> Claim, Release, Start. Stop, Approve, Reject, Suspend, Resume.
>>
>> From the discussion I had with Prabath and Darshana, we decided that
>> Start and Stop operation does not mean any use for end user so we decided
>> to remove them. So now we have following operations.
>>
>> Claim, Release, Approve, Reject, Suspend, Resume
>>
>
> +1, This will simplify
> ​user operations. Do you have  use case where you need to suspend an
> approval. If so keep Suspend, Resume options. In Normal scenario Claim,
> Complete (Approve or Reject), Release should be sufficient.
>
> ​Thanks,
> Hasitha. ​
>
> ​
>
>
>>
>> Now users can directly approve or disapprove tasks in READY or RESERVED
>> state without starting them, and starting will be handled without user
>> involvement.
>>
>> It's obvious that user should be able to do Claim, Release, Approve,
>> Reject operations using dashboard, but I'm not sure that if we should allow
>> and user to suspend and then resume tasks. I believe giving minimum number
>> of options for end user is the best thing to do. WDYT? Should we keep those
>> two options or shall we remove them?
>>
>> Thanks
>>
>> [1].
>> http://docs.oasis-open.org/bpel4people/ws-humantask-1.1-spec-cs-01.html#_Toc135718798
>>
>> --
>> *Chamila Dilshan Wijayarathna,*
>> Software Engineer
>> Mobile:(+94)788193620
>> WSO2 Inc., http://wso2.com/
>>
>
>
>
> --
> --
> Hasitha Aravinda,
> Senior Software Engineer,
> WSO2 Inc.
> Email: hasi...@wso2.com
> Mobile : +94 718 210 200
>



-- 
*Chamila Dilshan Wijayarathna,*
Software Engineer
Mobile:(+94)788193620
WSO2 Inc., http://wso2.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to pass pair of values to Message-contest from proxy operation

2015-11-03 Thread Malaka Silva
Kathees but with this approach the config will be lengthy and will become
hard to read.

IMO we should have something like [1] or [2]. We can easily iterate
properties using [3] WDYT?

[1]

jboss
org.jnp.interfaces.
NamingContextFactory
org.jboss.naming:org.jnp.
interfaces
jnp://localhost:1099

[2]

org.jnp.interfaces.
NamingContextFactory
org.jboss.naming:org.jnp.
interfaces
jnp://localhost:1099


[3]
public static Object lookupTemplateParamater(MessageContext ctxt, int
index) {
Stack funcStack = (Stack)
ctxt.getProperty(SynapseConstants.SYNAPSE__FUNCTION__STACK);
TemplateContext currentFuncHolder = funcStack.peek();
Collection paramList = currentFuncHolder.getParameters();
Iterator it = paramList.iterator();
int i = 0;
while (it.hasNext()) {
String param = (String) it.next();
if (i == index) {
return param;
}
i++;
}
return null;
}

On Mon, Nov 2, 2015 at 10:50 PM, Kathees Rajendram  wrote:

> Hi,
>
> In the template,We can use a parameter[1] for the JNDI dynamic properties
> and input the values with the pattern[2]. The each ejb JNDI properties can
> be gotten from the parameter and set to the properties[3] using a class
> mediator.
>
> [1]
> 
> {$ctx:ejbJNDIProperties}
> 
>
> [2]
> A:B,C:D,E:F
>
> [3]
> Properties props = new Properties();
> props.put("A" ,"B");
> props.setProperty("C","D");
> props.setProperty("E", "F");
>
> Thanks,
> Kathees
>
> On Mon, Nov 2, 2015 at 7:23 PM, Malaka Silva  wrote:
>
>> Challenge here is parameters depends on the container rather than the
>> inbound connector.
>>
>> IMO we should follow the same concept followed in ejb mediator. (Except
>> we need to make it dynamic)
>>
>> eg:
>>
>> Will have one JNDIID and user can add multiple entries against it.
>>
>> inbound.ejb.JNDIID=jboss
>>
>> inbound.ejb.JNDIID.jboss.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
>>
>> inbound.ejb.JNDIID.jboss.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
>> inbound.ejb.JNDIID.jboss.java.naming.provider.url=jnp://localhost:1099
>>
>> [1] https://docs.wso2.com/display/ESB490/EJB+Mediator
>>
>> On Mon, Nov 2, 2015 at 5:34 PM, Rajjaz Mohammed  wrote:
>>
>>> Hi,
>>> I'm implementing Connector for EJB 2.x. so in order to create JNDI
>>> properties i need pair of parameters [1]. and the number of parameters also
>>> depend on EJB server and Version. How can i write the operation fro
>>> that?(normally our Init methods will be like [2])
>>>
>>>
>>> [1]
>>> Properties props = new Properties();
>>> props.put("A" ,"B");
>>> props.setProperty("C","D");
>>> props.setProperty("E", "F");
>>>
>>>
>>> [2]
>>> 
>>> {$ctx:a}
>>> {$ctx:b}
>>> {$ctx:c}
>>> {$ctx:d}
>>> 
>>>
>>>
>>> --
>>> Thank you
>>> Best Regards
>>>
>>> *Rajjaz HM*
>>> Associate Software Engineer
>>> WSO2 Inc. 
>>> lean | enterprise | middleware
>>> Mobile | +94752833834
>>> Email   | raj...@wso2.com
>>> LinkedIn | Blogger | WSO2 Profile
>>> 
>>>
>>
>>
>>
>> --
>>
>> Best Regards,
>>
>> Malaka Silva
>> Senior Tech Lead
>> M: +94 777 219 791
>> Tel : 94 11 214 5345
>> Fax :94 11 2145300
>> Skype : malaka.sampath.silva
>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>> Blog : http://mrmalakasilva.blogspot.com/
>>
>> WSO2, Inc.
>> lean . enterprise . middleware
>> http://www.wso2.com/
>> http://www.wso2.com/about/team/malaka-silva/
>> 
>> https://store.wso2.com/store/
>>
>> Save a tree -Conserve nature & Save the world for your future. Print this
>> email only if it is absolutely necessary.
>>
>
>
>
> --
> Kathees
> Software Engineer,
> email: kath...@wso2.com
> mobile: +94772596173
>



-- 

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/

https://store.wso2.com/store/

Save a tree -Conserve nature & Save the world for your future. Print this
email only if it is absolutely necessary.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to pass pair of values to Message-contest from proxy operation

2015-11-03 Thread Kathees Rajendram
Hi Malaka,

+1 For your approach.

Thanks,
Kathees

On Tue, Nov 3, 2015 at 4:16 PM, Malaka Silva  wrote:

> Kathees but with this approach the config will be lengthy and will become
> hard to read.
>
> IMO we should have something like [1] or [2]. We can easily iterate
> properties using [3] WDYT?
>
> [1]
> 
> jboss
> org.jnp.interfaces.
> NamingContextFactory
> org.
> jboss.naming:org.jnp.interfaces naming.factory.url.pkgs>
> jnp://localhost:1099 ejbJNDIKey.jboss.java.naming.provider.url>
> 
> [2]
> 
> org.jnp.interfaces.
> NamingContextFactory
> org.jboss.naming:org.jnp.
> interfaces
> jnp://localhost:1099 jboss.java.naming.provider.url>
> 
>
> [3]
> public static Object lookupTemplateParamater(MessageContext ctxt, int
> index) {
> Stack funcStack = (Stack)
> ctxt.getProperty(SynapseConstants.SYNAPSE__FUNCTION__STACK);
> TemplateContext currentFuncHolder = funcStack.peek();
> Collection paramList = currentFuncHolder.getParameters();
> Iterator it = paramList.iterator();
> int i = 0;
> while (it.hasNext()) {
> String param = (String) it.next();
> if (i == index) {
> return param;
> }
> i++;
> }
> return null;
> }
>
> On Mon, Nov 2, 2015 at 10:50 PM, Kathees Rajendram 
> wrote:
>
>> Hi,
>>
>> In the template,We can use a parameter[1] for the JNDI dynamic properties
>> and input the values with the pattern[2]. The each ejb JNDI properties can
>> be gotten from the parameter and set to the properties[3] using a class
>> mediator.
>>
>> [1]
>> 
>> {$ctx:ejbJNDIProperties}
>> 
>>
>> [2]
>> A:B,C:D,E:F
>>
>> [3]
>> Properties props = new Properties();
>> props.put("A" ,"B");
>> props.setProperty("C","D");
>> props.setProperty("E", "F");
>>
>> Thanks,
>> Kathees
>>
>> On Mon, Nov 2, 2015 at 7:23 PM, Malaka Silva  wrote:
>>
>>> Challenge here is parameters depends on the container rather than the
>>> inbound connector.
>>>
>>> IMO we should follow the same concept followed in ejb mediator. (Except
>>> we need to make it dynamic)
>>>
>>> eg:
>>>
>>> Will have one JNDIID and user can add multiple entries against it.
>>>
>>> inbound.ejb.JNDIID=jboss
>>>
>>> inbound.ejb.JNDIID.jboss.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
>>>
>>> inbound.ejb.JNDIID.jboss.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
>>> inbound.ejb.JNDIID.jboss.java.naming.provider.url=jnp://localhost:1099
>>>
>>> [1] https://docs.wso2.com/display/ESB490/EJB+Mediator
>>>
>>> On Mon, Nov 2, 2015 at 5:34 PM, Rajjaz Mohammed  wrote:
>>>
 Hi,
 I'm implementing Connector for EJB 2.x. so in order to create JNDI
 properties i need pair of parameters [1]. and the number of parameters also
 depend on EJB server and Version. How can i write the operation fro
 that?(normally our Init methods will be like [2])


 [1]
 Properties props = new Properties();
 props.put("A" ,"B");
 props.setProperty("C","D");
 props.setProperty("E", "F");


 [2]
 
 {$ctx:a}
 {$ctx:b}
 {$ctx:c}
 {$ctx:d}
 


 --
 Thank you
 Best Regards

 *Rajjaz HM*
 Associate Software Engineer
 WSO2 Inc. 
 lean | enterprise | middleware
 Mobile | +94752833834
 Email   | raj...@wso2.com
 LinkedIn | Blogger | WSO2 Profile
 

>>>
>>>
>>>
>>> --
>>>
>>> Best Regards,
>>>
>>> Malaka Silva
>>> Senior Tech Lead
>>> M: +94 777 219 791
>>> Tel : 94 11 214 5345
>>> Fax :94 11 2145300
>>> Skype : malaka.sampath.silva
>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>> Blog : http://mrmalakasilva.blogspot.com/
>>>
>>> WSO2, Inc.
>>> lean . enterprise . middleware
>>> http://www.wso2.com/
>>> http://www.wso2.com/about/team/malaka-silva/
>>> 
>>> https://store.wso2.com/store/
>>>
>>> Save a tree -Conserve nature & Save the world for your future. Print
>>> this email only if it is absolutely necessary.
>>>
>>
>>
>>
>> --
>> Kathees
>> Software Engineer,
>> email: kath...@wso2.com
>> mobile: +94772596173
>>
>
>
>
> --
>
> Best Regards,
>
> Malaka Silva
> Senior Tech Lead
> M: +94 777 219 791
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> http://www.wso2.com/
> http://www.wso2.com/about/team/malaka-silva/
> 
> https://store.wso2.com/store/
>
> Save a tree -Conserve nature & Save the world for your future. Print this
> email only if it is absolutely necessary.
>



-- 
Kathees
Software Engineer,
email: kath...@wso2.com
mobile: +94772596173

Re: [Dev] [UX] [DS] Users able to create dashboards and pages inside dashboards with same title

2015-11-03 Thread Dakshika Jayathilaka
Hi Udara,

Seems this mail subject is quite misleading. Actual issue is on URL
mapping,  not in the title. :)

Cheers,

*Dakshika Jayathilaka*
PMC Member & Committer of Apache Stratos
Senior Software Engineer
WSO2, Inc.
lean.enterprise.middleware
0771100911

On Tue, Nov 3, 2015 at 5:44 PM, Udara Rathnayake  wrote:

> Hi Dakshika/UX team,
>
> Do you see a real use-case to have duplicate titles?
>
> On Tue, Nov 3, 2015 at 6:09 AM, Dakshika Jayathilaka 
> wrote:
>
>> Hi All,
>>
>> +1 to have URL validation on dashboard creation + page creation. AFAIK we
>> can duplicate page titles, but we need to prevent URL duplication.
>>
>> Regards,
>>
>> *Dakshika Jayathilaka*
>> PMC Member & Committer of Apache Stratos
>> Senior Software Engineer
>> WSO2, Inc.
>> lean.enterprise.middleware
>> 0771100911
>>
>> On Tue, Nov 3, 2015 at 11:26 AM, Ayesha Dissanayaka 
>> wrote:
>>
>>> Hi all,
>>>
>>> On Mon, Nov 2, 2015 at 7:40 PM, Nipuna Chandradasa 
>>> wrote:
>>>
 There is a scenario which users can create multiple dashboards with
 same titles. But in any scenario they cannot create a dashboard with same
 URL ( Dashboard ID).

>>>
>>> To address this issue, we will need to go through all the available
>>> dashboards in order to check whether the title exists and it will be an
>>> unnecessary overhead. We also considered few other options, such as
>>> changing resource path to a value which contains title. But it also leads
>>> to unnecessary complications of the design.
>>>
>>> URL is unique for a dashboard and it becomes the dashboard "id". We are
>>> validating existing dashboards for 'id' at creation. Hence, an user cannot
>>> create multiple dashboards with same url.
>>> Therefore we decided to allow users to change the dashboard title to an
>>> existing one and in-order to distinguish such dashboards , show dashboard
>>> 'url' in dashboard listing page (above the description) next to title.
>>>
>>>
 Also there is another similar scenario with Pages inside dashboards,
 which user can create multiple pages with same title. But in any scenario
 they cannot create pages with same URL (Page ID).

>>>
>>> We can do a simple check for page titles and show a validation failure
>>> here.
>>>
>>> Thanks!
>>> -Ayesha
>>>
>>> --
>>> *Ayesha Dissanayaka*
>>> Software Engineer,
>>> WSO2, Inc : http://wso2.com
>>> 
>>> 20, Palmgrove Avenue, Colombo 3
>>> E-Mail: aye...@wso2.com 
>>>
>>
>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Builder] Jenkins build became unstable: product-es #7768

2015-11-03 Thread Ayesha Dissanayaka
Hi all,

I just tried running above test cases locally in a clean build and they get
successfully executed.
Shall we trigger another build to see whether the issue still persists
since there are no any recent changes to the code base.

Thanks!
-Ayesha

On Tue, Nov 3, 2015 at 5:32 PM, Udara Rathnayake  wrote:

> please check
>
>
> -- Forwarded message --
> From: 
> Date: Tue, Nov 3, 2015 at 12:35 AM
> Subject: [Builder] Jenkins build became unstable: product-es #7768
> To: buil...@wso2.org
>
>
> See 
>
> ___
> Builder mailing list
> buil...@wso2.org
> https://wso2.org/cgi-bin/mailman/listinfo/builder
>
>


-- 
*Ayesha Dissanayaka*
Software Engineer,
WSO2, Inc : http://wso2.com

20, Palmgrove Avenue, Colombo 3
E-Mail: aye...@wso2.com 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Occurring more callbacks after the initial run of the android app-Siddhi

2015-11-03 Thread Lasantha Fernando
Hi Lakini,

It seems multiple Siddhi managers are getting instantiated and each siddhi
manager is running without being shut down. Can you point to the code where
the CEP class is instantiated?

Also, you can try a singleton pattern for the CEP class and do some checks
when adding the queries or adopt a similar approach to avoid the issue of
multiple queries running.

Thanks,
Lasantha

On 3 November 2015 at 15:31, Lakini Senanayaka  wrote:

> adding Dev@wso2
>
> On Tue, Nov 3, 2015 at 3:25 PM, Lakini Senanayaka  wrote:
>
>> Hi,
>>
>> I have implemented a service using Siddhi 2.1.0.
>> This is my Service class which deals with siddhimanager.
>>
>> package org.wso2.edgeanalyticsservice1;
>>
>> import android.content.Context;
>>
>> import org.wso2.siddhi.core.SiddhiManager;
>> import org.wso2.siddhi.core.event.Event;
>> import org.wso2.siddhi.core.stream.input.InputHandler;
>> import org.wso2.siddhi.core.stream.output.StreamCallback;
>> import org.wso2.siddhi.core.util.EventPrinter;
>>
>> /**
>>  * This class create from the build in sensors and inject
>>  * to the EdgeAnalytics Service for processing on a query passed.
>>  */
>> public class CEP {
>>
>> private SiddhiManager mSiddhiManager;
>> private IEdgeAnalyticServiceCallback mCallb = null;
>>
>> /** Initialize the SiddhiManager Instance */
>> public CEP() {
>> mSiddhiManager = new SiddhiManager();
>> }
>>
>> /** Add extra details to the SiddhiManager object  */
>> public void cepAddDetails(final Context context, String 
>> streamDefinition, String stream, final String query, final String 
>> callbackFunction,IEdgeAnalyticServiceCallback cb) {
>> mCallb=cb;
>>
>> /** Define the stream to the Siddhi Manager  */
>> mSiddhiManager.defineStream(streamDefinition);
>>
>> /** Define the query to the Siddhi Manager  */
>> mSiddhiManager.addQuery(query);
>>
>> /** Define the scallback details to the Siddhi Manager  */
>> mSiddhiManager.addCallback(callbackFunction, new StreamCallback() {
>> public void receive(Event[] events) {
>> EventPrinter.print(events);
>> try {
>> mCallb.addCallBack("Passed!! " );
>> } catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>> });
>> }
>>
>> /** Add extra details to the SiddhiManager object  */
>> public void cepAddDetails(final Context context, String 
>> streamDefinition, String stream, final String query1, final String 
>> query2,final String callbackFunction1,final String 
>> callbackFunction2,IEdgeAnalyticServiceCallback cb) {
>> //todo:Check the pattern queries
>>
>> mCallb=cb;
>>
>> /** Define the stream to the Siddhi Manager  */
>> mSiddhiManager.defineStream(streamDefinition);
>>
>> /** Define the query to the Siddhi Manager  */
>> mSiddhiManager.addQuery(query1);
>> mSiddhiManager.addQuery(query2);
>>
>> /** Define the scallback details to the Siddhi Manager  */
>> mSiddhiManager.addCallback(callbackFunction1, new StreamCallback() {
>> public void receive(Event[] events) {
>> EventPrinter.print(events);
>> try {
>> mCallb.addCallBack("callback1");
>> } catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>> });
>>
>> mSiddhiManager.addCallback(callbackFunction2, new StreamCallback() {
>> public void receive(Event[] events) {
>> EventPrinter.print(events);
>> try {
>> mCallb.addCallBack("callback2");
>> } catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>> });
>> }
>>
>> /** Analyse single data and send the notification back to client through 
>> callbacks */
>> public void analyseTheData(String value, String stream, 
>> IEdgeAnalyticServiceCallback cb) {
>>
>> String[] dataCollection=value.split(",");
>> String[] value_type=null;
>> Object[] x =new Object[dataCollection.length];
>>
>> /** Identify the data types which the client sends. */
>> for(int i=0;i> {
>> value_type=dataCollection[i].split("-");
>> x[i]=0;
>> switch (value_type[1]) {
>> case "double":
>> x[i]=Double.parseDouble(value_type[0]);
>> break;
>> case "float":
>> x[i]=Float.parseFloat(value_type[0]);
>> break;
>> case "int":
>> x[i]=Integer.parseInt(value_type[0]);
>> break;
>> case "string":
>> x[i]=value_type[0];
>> 

Re: [Dev] [UX] [DS] Users able to create dashboards and pages inside dashboards with same title

2015-11-03 Thread Udara Rathnayake
Hi Dakshika/UX team,

Do you see a real use-case to have duplicate titles?

On Tue, Nov 3, 2015 at 6:09 AM, Dakshika Jayathilaka 
wrote:

> Hi All,
>
> +1 to have URL validation on dashboard creation + page creation. AFAIK we
> can duplicate page titles, but we need to prevent URL duplication.
>
> Regards,
>
> *Dakshika Jayathilaka*
> PMC Member & Committer of Apache Stratos
> Senior Software Engineer
> WSO2, Inc.
> lean.enterprise.middleware
> 0771100911
>
> On Tue, Nov 3, 2015 at 11:26 AM, Ayesha Dissanayaka 
> wrote:
>
>> Hi all,
>>
>> On Mon, Nov 2, 2015 at 7:40 PM, Nipuna Chandradasa 
>> wrote:
>>
>>> There is a scenario which users can create multiple dashboards with same
>>> titles. But in any scenario they cannot create a dashboard with same URL (
>>> Dashboard ID).
>>>
>>
>> To address this issue, we will need to go through all the available
>> dashboards in order to check whether the title exists and it will be an
>> unnecessary overhead. We also considered few other options, such as
>> changing resource path to a value which contains title. But it also leads
>> to unnecessary complications of the design.
>>
>> URL is unique for a dashboard and it becomes the dashboard "id". We are
>> validating existing dashboards for 'id' at creation. Hence, an user cannot
>> create multiple dashboards with same url.
>> Therefore we decided to allow users to change the dashboard title to an
>> existing one and in-order to distinguish such dashboards , show dashboard
>> 'url' in dashboard listing page (above the description) next to title.
>>
>>
>>> Also there is another similar scenario with Pages inside dashboards,
>>> which user can create multiple pages with same title. But in any scenario
>>> they cannot create pages with same URL (Page ID).
>>>
>>
>> We can do a simple check for page titles and show a validation failure
>> here.
>>
>> Thanks!
>> -Ayesha
>>
>> --
>> *Ayesha Dissanayaka*
>> Software Engineer,
>> WSO2, Inc : http://wso2.com
>> 
>> 20, Palmgrove Avenue, Colombo 3
>> E-Mail: aye...@wso2.com 
>>
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DEV] Implement unit/integration test cases for API Manager JAX-RS Rest API

2015-11-03 Thread Krishantha Samaraweera
Hi Sanjeewa

On Tue, Oct 20, 2015 at 2:47 PM, Sanjeewa Malalgoda 
wrote:

> QAA team shall we have discussion on this and come to conclusion?
> Please let us know possible time slots.
>

+1 shall we meet this week.

Thanks,
Krishantha.

>
> Thanks,
> sanjeewa.
>
> On Mon, Oct 19, 2015 at 12:44 PM, Sanjeewa Malalgoda 
> wrote:
>
>> Here idea is easily manage the tests and web application.
>> Since web application purely depend on swagger definition it will
>> automatically generate beans, service skeletons etc.
>>
>> So in same way if we implement test cases we don't have to go and edit
>> test case code after we adding new parameters or something like that.
>> What we can simply do is change sample data set feed into test.
>>
>>
>>
>> On Mon, Oct 19, 2015 at 12:34 PM, Joseph Fonseka  wrote:
>>
>>> Hi Nuwan
>>>
>>> Thanks for pointing that out, in that case test can be version-ed so
>>> auto generated tests for version 1.0.0 should work with API 1.0.1 ...
>>>
>>> WDYT?
>>>
>>> Regards
>>> Jo
>>>
>>> On Mon, Oct 19, 2015 at 12:29 PM, Nuwan Dias  wrote:
>>>
 Is it right to auto-generate the test client code? IMO one objective of
 this should be to make sure the REST APIs don't change across patch
 releases, etc. If we auto-generate the test stubs we would loose that
 advantage.

>>> I don't get how we loose advantage here.
>> If we don't want to change service API we don't have to edit swagger json
>> and that is it.
>> Then it will not change service API, neither test client or data set feed
>> in to test.
>> If we consider both integration and unit tests those will be released
>> anyway with product and component release.
>> So tests will be automatically version-ed with component/product version.
>>
>> Thanks,
>> sanjeewa.
>>
>>
>>>
 Thanks,
 NuwanD.

 On Mon, Oct 19, 2015 at 12:26 PM, Joseph Fonseka 
 wrote:

> Hi Sanjeewa
>
> Saneth & I had an offline chat regarding this last week there are few
> things we need to consider.
>
> 1. Generating integration test for the Jax-RS functionality ex . If
> crud operations work, if it returns correct error messages.
>  -  We can use swagger-codegen to do this.
>  -  API Definition has all the details of the API interface
> what missing are the data fixtures.
>  - There are few options with the fixtures which we can auto
> generate since the schema of the model is there or we can use a predefined
> set of json files.
>
> 2. How to get the existing integration test to utilize the new API.
>  - We already have a lot of integration tests which uses
> existing store & publisher APIs to add/remove resources. As Saneth mention
> they have written it in a layered architecture this replacing the existing
> API layer with Jax-rs existing test should work.
>  - We might have to look at this in the next phase when we
> plan to deprecate the existing APIs.
>
> 3. How to make it easy to write test in the future with Jax-Rs API.
>  - Ex Creating a Jax-rs client/library to utilize by other
> integration test.
>
> Thanks & Regards
> Jo
>
> On Mon, Oct 19, 2015 at 12:17 PM, Joseph Fonseka 
> wrote:
>
>> Sorry mail got sent accidentally half written. will complete and send
>> shortly.
>>
>> On Mon, Oct 19, 2015 at 12:15 PM, Joseph Fonseka 
>> wrote:
>>
>>> Hi Sanjeewa
>>>
>>> Saneth & I had an offline chat regarding this last week there are
>>> few things we need to consider.
>>>
>>> 1. Generating integration test for the Jax-RS functionality ex . If
>>> crud operations work, if it returns correct error messages.
>>>  -  We can use swagger-codegen to do this.
>>>  API Definition has all the details of the API interface what
>>> missing are
>>>
>>> 2. How to get the existing integration test to utilize the new API.
>>>  - We already have a lot of integration tests which uses
>>> existing store & publisher APIs to add/remove resources. As Saneth 
>>> mention
>>> they have written it in a layered architecture this replacing the 
>>> existing
>>> API layer with Jax-rs existing test should work.
>>>
>>>
>>> 3. How to make it easy to write test in the future with Jax-Rs API.
>>>
>>>
>>>
>>>
>>> On Mon, Oct 19, 2015 at 11:39 AM, Sanjeewa Malalgoda <
>>> sanje...@wso2.com> wrote:
>>>
 Hi Team,
 We are planning to implement complete REST API for all operations
 available in API Manager.
 This will be CXF based jax-rs application.
 This application based on swagger template and service skeleton
 automatically generate according to swagger to cxf implementation 

Re: [Dev] [UX] [DS] Users able to create dashboards and pages inside dashboards with same title

2015-11-03 Thread Udara Rathnayake
Hi Dakshika,

As far as I remember URL mapping (Page ID) thing is fixed by Nipuna. Title
refers to the name of the page right?
May be I'm wrong.

On Tue, Nov 3, 2015 at 7:17 AM, Dakshika Jayathilaka 
wrote:

> Hi Udara,
>
> Seems this mail subject is quite misleading. Actual issue is on URL
> mapping,  not in the title. :)
>
> Cheers,
>
> *Dakshika Jayathilaka*
> PMC Member & Committer of Apache Stratos
> Senior Software Engineer
> WSO2, Inc.
> lean.enterprise.middleware
> 0771100911
>
> On Tue, Nov 3, 2015 at 5:44 PM, Udara Rathnayake  wrote:
>
>> Hi Dakshika/UX team,
>>
>> Do you see a real use-case to have duplicate titles?
>>
>> On Tue, Nov 3, 2015 at 6:09 AM, Dakshika Jayathilaka 
>> wrote:
>>
>>> Hi All,
>>>
>>> +1 to have URL validation on dashboard creation + page creation. AFAIK
>>> we can duplicate page titles, but we need to prevent URL duplication.
>>>
>>> Regards,
>>>
>>> *Dakshika Jayathilaka*
>>> PMC Member & Committer of Apache Stratos
>>> Senior Software Engineer
>>> WSO2, Inc.
>>> lean.enterprise.middleware
>>> 0771100911
>>>
>>> On Tue, Nov 3, 2015 at 11:26 AM, Ayesha Dissanayaka 
>>> wrote:
>>>
 Hi all,

 On Mon, Nov 2, 2015 at 7:40 PM, Nipuna Chandradasa 
 wrote:

> There is a scenario which users can create multiple dashboards with
> same titles. But in any scenario they cannot create a dashboard with same
> URL ( Dashboard ID).
>

 To address this issue, we will need to go through all the available
 dashboards in order to check whether the title exists and it will be an
 unnecessary overhead. We also considered few other options, such as
 changing resource path to a value which contains title. But it also leads
 to unnecessary complications of the design.

 URL is unique for a dashboard and it becomes the dashboard "id". We are
 validating existing dashboards for 'id' at creation. Hence, an user cannot
 create multiple dashboards with same url.
 Therefore we decided to allow users to change the dashboard title to an
 existing one and in-order to distinguish such dashboards , show dashboard
 'url' in dashboard listing page (above the description) next to title.


> Also there is another similar scenario with Pages inside dashboards,
> which user can create multiple pages with same title. But in any scenario
> they cannot create pages with same URL (Page ID).
>

 We can do a simple check for page titles and show a validation failure
 here.

 Thanks!
 -Ayesha

 --
 *Ayesha Dissanayaka*
 Software Engineer,
 WSO2, Inc : http://wso2.com
 
 20, Palmgrove Avenue, Colombo 3
 E-Mail: aye...@wso2.com 

>>>
>>>
>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Occurring more callbacks after the initial run of the android app-Siddhi

2015-11-03 Thread Lasantha Fernando
On 3 November 2015 at 16:09, Lakini Senanayaka  wrote:

> Hi Lasantha,
>
> This is the class I'm calling and instantiate the CEP object.
>
> package org.wso2.edgeanalyticsservice1;
>
> import android.app.Service;
> import android.content.Intent;
> import android.os.IBinder;
> import android.util.Log;
>
> /**
>  * This class implements IEdgeAnalyticService.aidl interface
>  */
> public class EdgeAnalyticsService extends Service {
>
> private CEP mCep;
> private TaskManager taskManager=null;
>
> public EdgeAnalyticsService() {
> mCep = new CEP();
> }
>
> @Override
> public void onCreate() {
> }
>
> /** Returns the IBinder object for the connection */
> @Override
> public IBinder onBind(Intent intent) {
> taskManager=null;
> return mBinder;
> }
>
> @Override
> public int onStartCommand(Intent intent, int flags, int startId) {
> return Service.START_STICKY;
> }
>
> @Override
> public boolean onUnbind (Intent intent){
> return false;
> }
>
> @Override
> public void onDestroy() {
> stopSelf();
> }
>
> /** Implementation of methods in the IEdgeAnalyticsService interface */
> public final IEdgeAnalyticsService.Stub mBinder = new 
> IEdgeAnalyticsService.Stub() {
>
> IEdgeAnalyticServiceCallback mIEdgeAnalyticServiceCallback=null;
>
> @Override
> public void getServiceNormal(String type, String streamDefinition, 
> String stream, String query, String 
> callbackFunctionName,IEdgeAnalyticServiceCallback cb) {
>
> mIEdgeAnalyticServiceCallback = cb;
>
>
> /** Add the details to CEP if the Client is Type1 */
> if (type.equalsIgnoreCase("TYPE1")) {
> mCep.cepAddDetails(getApplicationContext(), streamDefinition, 
> stream, query, callbackFunctionName, cb);
> }
>
> /** Add the details to CEP if the Client is 
> Type2-LOCATION_SERVICE */
> else if (type.equalsIgnoreCase("LOCATION_SERVICE")) {
> mCep.cepAddDetails(getApplicationContext(), "define stream 
> LocationStream (latitude double,longitude double); ", "LocationStream", 
> query, callbackFunctionName,cb);
> taskManager = new 
> TaskManager(getApplicationContext(),"LocationStream",mIEdgeAnalyticServiceCallback,mCep);
> taskManager.initializeServiceType(type);
> }
>
> /** Add the details to CEP if the Client is 
> Type2-HUMIDITY_SERVICE */
> else if (type.equalsIgnoreCase("HUMIDITY_SERVICE")) {
> mCep.cepAddDetails(getApplicationContext(), "define stream 
> HumidityStream (humidity float); ", "HumidityStream", query, 
> callbackFunctionName, cb);
> taskManager = new 
> TaskManager(getApplicationContext(),"HumidityStream",mIEdgeAnalyticServiceCallback,mCep);
> taskManager.initializeServiceType(type);
> }
>
> /** Add the details to CEP if the Client is 
> Type2-TEMPERATURE_SERVICE */
> else if (type.equalsIgnoreCase("TEMPERATURE_SERVICE")) {
> mCep.cepAddDetails(getApplicationContext(), "define stream 
> temperatureStream (tempValue float); ", "temperatureStream", query, 
> callbackFunctionName,cb);
> taskManager = new 
> TaskManager(getApplicationContext(),"temperatureStream",mIEdgeAnalyticServiceCallback,mCep);
> taskManager.initializeServiceType(type);
> }
>
> /** Add the details to CEP if the Client is 
> Type2-INTENSITY_SERVICE*/
> else if (type.equalsIgnoreCase("INTENSITY_SERVICE")) {
> Log.d("client","INTENSITY SERVICE");
> mCep.cepAddDetails(getApplicationContext(), "define stream 
> lightIntensityStream (lightValue double); ", "lightIntensityStream", query, 
> callbackFunctionName, cb);
> taskManager = new 
> TaskManager(getApplicationContext(),"lightIntensityStream",mIEdgeAnalyticServiceCallback,mCep);
> taskManager.initializeServiceType(type);
>
> }
> }
>
> //get servicePatterns
> @Override
> public void getServicePattern(String type, String streamDefinition, 
> String stream, String query1,String query2 ,String 
> callbackFunctionName1,String 
> callbackFunctionName2,IEdgeAnalyticServiceCallback cb) {
>
> mIEdgeAnalyticServiceCallback = cb;
>
> /** Add the details to CEP if the Client is Type1 */
> if (type.equalsIgnoreCase("TYPE1")) {
> mCep.cepAddDetails(getApplicationContext(), streamDefinition, 
> stream, query1, query2, callbackFunctionName1,callbackFunctionName2,cb);
> }
>
> else if (type.equalsIgnoreCase("LOCATION_SERVICE")) {
> mCep.cepAddDetails(getApplicationContext(), "define stream 
> LocationStream (latitude double,longitude double); ", 

[Dev] [APIM] Need an opinion on mediation extensions

2015-11-03 Thread Rushmin Fernando
Hi APIM team,

The doc [1] says that the recommended way to add a mediation extension is
the registry approach.

*"The recommended way to engage a mediation extension sequence per API is
to upload an XML file through the registry and then engage it using the API
Publisher."*

Are there any drawbacks in using the file based mediation extensions ?


Thanks
Rushmin

[1] - https://docs.wso2.com/display/AM191/Adding+Mediation+Extensions



-- 
*Rushmin Fernando*
*Technical Lead*

WSO2 Inc.  - Lean . Enterprise . Middleware

email : rush...@wso2.com
mobile : +94772310855
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] Yahoo OAuth2/OpenID Connect as Identity Provider - Creating Yahoo Oauth App to get client credentials.

2015-11-03 Thread Isura Karunaratne
Hi Nadeesha,




On Tue, Nov 3, 2015 at 3:00 PM, Nadeesha Meegoda  wrote:

> Hi IS team,
>
> I've created an Yahoo App for the above mentioned purpose and to add the
> Callback domain  it requires a payment to be done. I get the following
> message
>
> "Enable billing for BOSS API
> . No
> Billing Information has been provided. The API will not work until you
> complete this step."
>
> Do we need to actually give the callback domain? Without that I have tried
> but fails when authenticating. (Note that it directs to Yahoo
> authentication successfully). I have attached my IDP configuration
>

You need to start Identity server in port 443 and change host name (test.com).
Then put callback domain as https://test.com

Thanks
Isura

>
> Has anyone of you tested Yahoo OAuth2/OpenID Connect as Identity Provider?
> If so can you please provide the test client credentials or let me know how
> this should be done.
>
> Since this was added recently to IS implementation, the IS 510
> documentation should be updated. The improvement tracked in [1]
>
> [1] - https://wso2.org/jira/browse/DOCUMENTATION-2664
>
> Thanks
> Nadeesha
>
> --
> *Nadeesha Meegoda*
> Software Engineer - QA
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
> email : nadees...@wso2.com
> mobile: +94783639540
> <%2B94%2077%202273555>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Isura Dilhara Karunaratne
Senior Software Engineer

Mob +94 772 254 810
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UX] [DS] Users able to create dashboards and pages inside dashboards with same title

2015-11-03 Thread Dakshika Jayathilaka
Hi All,

+1 to have URL validation on dashboard creation + page creation. AFAIK we
can duplicate page titles, but we need to prevent URL duplication.

Regards,

*Dakshika Jayathilaka*
PMC Member & Committer of Apache Stratos
Senior Software Engineer
WSO2, Inc.
lean.enterprise.middleware
0771100911

On Tue, Nov 3, 2015 at 11:26 AM, Ayesha Dissanayaka  wrote:

> Hi all,
>
> On Mon, Nov 2, 2015 at 7:40 PM, Nipuna Chandradasa 
> wrote:
>
>> There is a scenario which users can create multiple dashboards with same
>> titles. But in any scenario they cannot create a dashboard with same URL (
>> Dashboard ID).
>>
>
> To address this issue, we will need to go through all the available
> dashboards in order to check whether the title exists and it will be an
> unnecessary overhead. We also considered few other options, such as
> changing resource path to a value which contains title. But it also leads
> to unnecessary complications of the design.
>
> URL is unique for a dashboard and it becomes the dashboard "id". We are
> validating existing dashboards for 'id' at creation. Hence, an user cannot
> create multiple dashboards with same url.
> Therefore we decided to allow users to change the dashboard title to an
> existing one and in-order to distinguish such dashboards , show dashboard
> 'url' in dashboard listing page (above the description) next to title.
>
>
>> Also there is another similar scenario with Pages inside dashboards,
>> which user can create multiple pages with same title. But in any scenario
>> they cannot create pages with same URL (Page ID).
>>
>
> We can do a simple check for page titles and show a validation failure
> here.
>
> Thanks!
> -Ayesha
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> 
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: aye...@wso2.com 
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Dependency Inject not working to get IEclipseContext Object

2015-11-03 Thread Nuwan Pallewela
Hi Devs,

I'm trying to get a IEclipseContext object to get IEventBroker. DI method
to get IEventBroker instance always gives a null. Alternative method to get
IEventBroker is through IEclipseContext instance. DI method to get it also
not working. Is there any way to get a instance of IEclipseContext object?

Thanks,
Nuwan

-- 
--

*Nuwan Chamara Pallewela*


*Software Engineer*

*WSO2, Inc. *http://wso2.com
*lean . enterprise . middleware*

Email   *nuw...@wso2.com *
Mobile  *+94719079739@*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UX] [DS] Users able to create dashboards and pages inside dashboards with same title

2015-11-03 Thread Nipuna Chandradasa
Hi Udara,

Title refers to the name of the page URL(Page ID) issue is fixed but
not yet merged in to the repo.. because of there is a issue where user can
create multiple dashboards with same name and we have to differentiate
those dashboards when we are displaying them back to the user in the
landing page of Portal ( List of Dashboards).

So ayesha and me decided to show the dashboard URL right below the
dashboard title... So after implementing it i'll do a PR.

Thank you

On Tue, Nov 3, 2015 at 5:51 PM, Udara Rathnayake  wrote:

> Hi Dakshika,
>
> As far as I remember URL mapping (Page ID) thing is fixed by Nipuna. Title
> refers to the name of the page right?
> May be I'm wrong.
>
> On Tue, Nov 3, 2015 at 7:17 AM, Dakshika Jayathilaka 
> wrote:
>
>> Hi Udara,
>>
>> Seems this mail subject is quite misleading. Actual issue is on URL
>> mapping,  not in the title. :)
>>
>> Cheers,
>>
>> *Dakshika Jayathilaka*
>> PMC Member & Committer of Apache Stratos
>> Senior Software Engineer
>> WSO2, Inc.
>> lean.enterprise.middleware
>> 0771100911
>>
>> On Tue, Nov 3, 2015 at 5:44 PM, Udara Rathnayake  wrote:
>>
>>> Hi Dakshika/UX team,
>>>
>>> Do you see a real use-case to have duplicate titles?
>>>
>>> On Tue, Nov 3, 2015 at 6:09 AM, Dakshika Jayathilaka 
>>> wrote:
>>>
 Hi All,

 +1 to have URL validation on dashboard creation + page creation. AFAIK
 we can duplicate page titles, but we need to prevent URL duplication.

 Regards,

 *Dakshika Jayathilaka*
 PMC Member & Committer of Apache Stratos
 Senior Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware
 0771100911

 On Tue, Nov 3, 2015 at 11:26 AM, Ayesha Dissanayaka 
 wrote:

> Hi all,
>
> On Mon, Nov 2, 2015 at 7:40 PM, Nipuna Chandradasa 
> wrote:
>
>> There is a scenario which users can create multiple dashboards with
>> same titles. But in any scenario they cannot create a dashboard with same
>> URL ( Dashboard ID).
>>
>
> To address this issue, we will need to go through all the available
> dashboards in order to check whether the title exists and it will be an
> unnecessary overhead. We also considered few other options, such as
> changing resource path to a value which contains title. But it also leads
> to unnecessary complications of the design.
>
> URL is unique for a dashboard and it becomes the dashboard "id". We
> are validating existing dashboards for 'id' at creation. Hence, an user
> cannot create multiple dashboards with same url.
> Therefore we decided to allow users to change the dashboard title to
> an existing one and in-order to distinguish such dashboards , show
> dashboard 'url' in dashboard listing page (above the description) next to
> title.
>
>
>> Also there is another similar scenario with Pages inside dashboards,
>> which user can create multiple pages with same title. But in any scenario
>> they cannot create pages with same URL (Page ID).
>>
>
> We can do a simple check for page titles and show a validation failure
> here.
>
> Thanks!
> -Ayesha
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> 
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: aye...@wso2.com 
>


>>>
>>
>


-- 
Nipuna Marcus
*Software Engineer*
WSO2 Inc.
http://wso2.com/ - "lean . enterprise . middleware"
Mobile : +94 (0) 713 667906
nipu...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Builder] Jenkins build became unstable: product-es #7768

2015-11-03 Thread Nipuna Chandradasa
HI Team,

I tried building the product-es with tests locally There is one test
failure. That is one of the 2 test failures mentioned in the Jenkins report.

   -
   
org.wso2.es.ui.integration.test.store.ESStoreSocialSharingTestCase.testTwitterSharing
   



Following is the test failure log:

Failed tests:
testTwitterSharing(org.wso2.es.ui.integration.test.store.ESStoreSocialSharingTestCase):
Twitter sharing is wrong expected [true] but found [false]

Thank you.


On Tue, Nov 3, 2015 at 6:25 PM, Ayesha Dissanayaka  wrote:

> Hi all,
>
> I just tried running above test cases locally in a clean build and they
> get successfully executed.
> Shall we trigger another build to see whether the issue still persists
> since there are no any recent changes to the code base.
>
> Thanks!
> -Ayesha
>
> On Tue, Nov 3, 2015 at 5:32 PM, Udara Rathnayake  wrote:
>
>> please check
>>
>>
>> -- Forwarded message --
>> From: 
>> Date: Tue, Nov 3, 2015 at 12:35 AM
>> Subject: [Builder] Jenkins build became unstable: product-es #7768
>> To: buil...@wso2.org
>>
>>
>> See 
>>
>> ___
>> Builder mailing list
>> buil...@wso2.org
>> https://wso2.org/cgi-bin/mailman/listinfo/builder
>>
>>
>
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> 
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: aye...@wso2.com 
>



-- 
Nipuna Marcus
*Software Engineer*
WSO2 Inc.
http://wso2.com/ - "lean . enterprise . middleware"
Mobile : +94 (0) 713 667906
nipu...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 DAS 3.0.0 issue: failed to get records from table

2015-11-03 Thread Jorge
Hi Niranda,
I try with this query:  SELECT COUNT(temp) FROM temperaturasfechadesagregada

And the result = 20596

Attached the log with the errors and warnings, the main issues:

The errors:

TID: [-1234] [] [2015-11-03 18:36:55,956] ERROR
{org.apache.hadoop.util.Shell} -  Failed to locate the winutils binary
in the hadoop binary path {org.apache.hadoop.util.Shell}
java.io.IOException: Could not locate executable null\bin\winutils.exe
in the Hadoop binaries.

TID: [-1234] [] [2015-11-03 18:40:15,960]  INFO
{org.apache.axis2.transport.http.HTTPSender} -  Unable to sendViaPost
to url[https://169.254.56.94:9443/services/AnalyticsWebService]
{org.apache.axis2.transport.http.HTTPSender}
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
at sun.security.ssl.InputRecord.read(InputRecord.java:480)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:884)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
at 
org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at 
org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at 
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
at 
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at 
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at 
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:630)
at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at 
org.wso2.carbon.analytics.webservice.stub.AnalyticsWebServiceStub.getByRange(AnalyticsWebServiceStub.java:1762)
at 
org.wso2.carbon.analytics.jsservice.AnalyticsWebServiceConnector.getRecordsByRange(AnalyticsWebServiceConnector.java:424)
at 
org.wso2.carbon.analytics.jsservice.AnalyticsCachedWebServiceConnector.getRecordsByRange(AnalyticsCachedWebServiceConnector.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at 
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at 
org.jaggeryjs.rhino.portal.controllers.apis.c2._c_anonymous_1(/portal/controllers/apis/analytics.jag:194)
at 
org.jaggeryjs.rhino.portal.controllers.apis.c2.call(/portal/controllers/apis/analytics.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at 
org.jaggeryjs.rhino.portal.controllers.apis.c2._c_script_0(/portal/controllers/apis/analytics.jag:2)
at 
org.jaggeryjs.rhino.portal.controllers.apis.c2.call(/portal/controllers/apis/analytics.jag)
at 
org.jaggeryjs.rhino.portal.controllers.apis.c2.exec(/portal/controllers/apis/analytics.jag)
at 

Re: [Dev] [IS] Yahoo OAuth2/OpenID Connect as Identity Provider - Creating Yahoo Oauth App to get client credentials.

2015-11-03 Thread Nadeesha Meegoda
Hi Isura,

Thanks for the Response. I created another app named "test app" and gave
callback domain as* https://test.com * while I have
already changed the hostname to test.com. Still the authentication fails
directed to a URL like this
https://test.com/?code=dj8pebu=bc76104c-2e6b-432c-985c-6afabe7d4ad8%2COIDC

Can you please let me know what else should be done to proceed with a
successful authentication to the travelocity app?

Herewith I have attached the IDP configuration and the details of the yahoo
app I registered.

Thanks
Nadeesha


On Tue, Nov 3, 2015 at 5:34 PM, Isura Karunaratne  wrote:

> Hi Nadeesha,
>
>
>
>
> On Tue, Nov 3, 2015 at 3:00 PM, Nadeesha Meegoda 
> wrote:
>
>> Hi IS team,
>>
>> I've created an Yahoo App for the above mentioned purpose and to add the
>> Callback domain  it requires a payment to be done. I get the following
>> message
>>
>> "Enable billing for BOSS API
>> . No
>> Billing Information has been provided. The API will not work until you
>> complete this step."
>>
>> Do we need to actually give the callback domain? Without that I have
>> tried but fails when authenticating. (Note that it directs to Yahoo
>> authentication successfully). I have attached my IDP configuration
>>
>
> You need to start Identity server in port 443 and change host name (
> test.com). Then put callback domain as https://test.com
>
> Thanks
> Isura
>
>>
>> Has anyone of you tested Yahoo OAuth2/OpenID Connect as Identity
>> Provider? If so can you please provide the test client credentials or let
>> me know how this should be done.
>>
>> Since this was added recently to IS implementation, the IS 510
>> documentation should be updated. The improvement tracked in [1]
>>
>> [1] - https://wso2.org/jira/browse/DOCUMENTATION-2664
>>
>> Thanks
>> Nadeesha
>>
>> --
>> *Nadeesha Meegoda*
>> Software Engineer - QA
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>> email : nadees...@wso2.com
>> mobile: +94783639540
>> <%2B94%2077%202273555>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Isura Dilhara Karunaratne
> Senior Software Engineer
>
> Mob +94 772 254 810
>
>


-- 
*Nadeesha Meegoda*
Software Engineer - QA
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
email : nadees...@wso2.com
mobile: +94783639540
<%2B94%2077%202273555>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dependency Inject not working to get IEclipseContext Object

2015-11-03 Thread Nuwan Pallewela
Hi,

I have tried the above method and got an exception of
"org.eclipse.e4.core.di.InjectionException:
Unable to process "EventBroker.logger": no actual value was found for the
argument "Logger".".
As discussed off line with kavith, this was occurred because of
ServiceContext does not give the logger for IEventBroker.

Alternative way to get IEventBroker instance and subscribe without using DI
was found using PlatformUI and shown in following code.

debuggerEventBroker = (IEventBroker)
PlatformUI.getWorkbench().getService(IEventBroker.class);
debuggerEventBroker.subscribe(ESBDebuggerConstants.ESBDEBUGTARGET_EVENT_TOPIC,
this);

And we can listen and handle events by implementing
org.osgi.service.event.EventHandler interface in our subscriber class.

Thanks,
Nuwan


On Tue, Nov 3, 2015 at 9:52 PM, Kavith Lokuhewage  wrote:

> Hi Nuwan,
>
> You can observe a reference to IEclipseContext using the bundleContext
> object. You can get a reference to bundleContext via bundle activator or
> via FrameworkUtil class.
>
> See following snippet.
>
> BundleContext bundleContext =
> FrameworkUtil.getBundle(SomeClassInYourBundle.class).getBundleContext();
> IEclipseContext eclipseContext =
> EclipseContextFactory.getServiceContext(bundleContext);
>
> BTW, how did you try to get a IEventBroker reference via Dependency
> Injection?
> If you are getting null for injected references always, I suspect that DI
> engine does not manage your object.
>
> FYI, Eclipse E4 DI engine only manages classes in Application Model or
> framework components by default (eg. commands, handlers, activators,
> declarative services, etc.). If your class is not a framework component and
> you manually instantiate it in your code using *new *operator, DI engine
> is not aware of that. In such kind of a situation, you need to manually
> inject the required references using ContextInjectionFactory. See following
> snippet.
>
> YourClass object = new YourClass();
> ContextInjectionFactory.inject(object, eclipseContext);
>
> For the ContextInjectionFactory.inject method, you need to pass the DI
> context (to tell DI engine from which context to obtain references which
> are needed to inject - this should be the global eclipse context in most
> cases) and your object. You can obtain the global eclipseContext using
> first snippet.
>
> For example, you can use below code to get a reference to IEventBroker in
> a custom class which is not a framework component.
>
> public YourClass{
>
> @Inject
> IEventBroker eventBroker;
>
> public YourClass(){}
>
> }
>
> Then, inject reference while instantiating.
>
> BundleContext bundleContext =
> FrameworkUtil.getBundle(YourClass.class).getBundleContext();
> IEclipseContext eclipseContext =
> EclipseContextFactory.getServiceContext(bundleContext);
> YourClass object = new YourClass();
> ContextInjectionFactory.inject(object, eclipseContext);
>
> HTH.
> Thanks,
>
> On Tue, Nov 3, 2015 at 9:07 PM, Nuwan Pallewela  wrote:
>
>> Hi Devs,
>>
>> I'm trying to get a IEclipseContext object to get IEventBroker. DI method
>> to get IEventBroker instance always gives a null. Alternative method to get
>> IEventBroker is through IEclipseContext instance. DI method to get it also
>> not working. Is there any way to get a instance of IEclipseContext object?
>>
>> Thanks,
>> Nuwan
>>
>> --
>> --
>>
>> *Nuwan Chamara Pallewela*
>>
>>
>> *Software Engineer*
>>
>> *WSO2, Inc. *http://wso2.com
>> *lean . enterprise . middleware*
>>
>> Email   *nuw...@wso2.com *
>> Mobile  *+94719079739 <%2B94719079739>@*
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Kavith Lokuhewage*
> Software Engineer
> WSO2 Inc. - http://wso2.com
> lean . enterprise . middleware
> Mobile - +9477-9-145-123 | +9471-455-6-401
> Linkedin 
> Twitter 
>



-- 
--

*Nuwan Chamara Pallewela*


*Software Engineer*

*WSO2, Inc. *http://wso2.com
*lean . enterprise . middleware*

Email   *nuw...@wso2.com *
Mobile  *+94719079739@*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] Yahoo OAuth2/OpenID Connect as Identity Provider - Creating Yahoo Oauth App to get client credentials.

2015-11-03 Thread Isura Karunaratne
Hi,


On Wed, Nov 4, 2015 at 9:49 AM, Nadeesha Meegoda  wrote:

> Hi Isura,
>
> Thanks for the Response. I created another app named "test app" and gave
> callback domain as* https://test.com * while I have
> already changed the hostname to test.com. Still the authentication fails
> directed to a URL like this
> https://test.com/?code=dj8pebu=bc76104c-2e6b-432c-985c-6afabe7d4ad8%2COIDC
>
> Can you please let me know what else should be done to proceed with a
> successful authentication to the travelocity app?
>
> Herewith I have attached the IDP configuration and the details of the
> yahoo app I registered.
>
> Callback URL in Identity server side should be https://test.com/commonauth

Thanks
Isura


> Thanks
> Nadeesha
>
>
> On Tue, Nov 3, 2015 at 5:34 PM, Isura Karunaratne  wrote:
>
>> Hi Nadeesha,
>>
>>
>>
>>
>> On Tue, Nov 3, 2015 at 3:00 PM, Nadeesha Meegoda 
>> wrote:
>>
>>> Hi IS team,
>>>
>>> I've created an Yahoo App for the above mentioned purpose and to add the
>>> Callback domain  it requires a payment to be done. I get the following
>>> message
>>>
>>> "Enable billing for BOSS API
>>> . No
>>> Billing Information has been provided. The API will not work until you
>>> complete this step."
>>>
>>> Do we need to actually give the callback domain? Without that I have
>>> tried but fails when authenticating. (Note that it directs to Yahoo
>>> authentication successfully). I have attached my IDP configuration
>>>
>>
>> You need to start Identity server in port 443 and change host name (
>> test.com). Then put callback domain as https://test.com
>>
>> Thanks
>> Isura
>>
>>>
>>> Has anyone of you tested Yahoo OAuth2/OpenID Connect as Identity
>>> Provider? If so can you please provide the test client credentials or let
>>> me know how this should be done.
>>>
>>> Since this was added recently to IS implementation, the IS 510
>>> documentation should be updated. The improvement tracked in [1]
>>>
>>> [1] - https://wso2.org/jira/browse/DOCUMENTATION-2664
>>>
>>> Thanks
>>> Nadeesha
>>>
>>> --
>>> *Nadeesha Meegoda*
>>> Software Engineer - QA
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>> email : nadees...@wso2.com
>>> mobile: +94783639540
>>> <%2B94%2077%202273555>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Isura Dilhara Karunaratne
>> Senior Software Engineer
>>
>> Mob +94 772 254 810
>>
>>
>
>
> --
> *Nadeesha Meegoda*
> Software Engineer - QA
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
> email : nadees...@wso2.com
> mobile: +94783639540
> <%2B94%2077%202273555>
>



-- 
Isura Dilhara Karunaratne
Senior Software Engineer

Mob +94 772 254 810
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to pass pair of values to Message-contest from proxy operation

2015-11-03 Thread Rajjaz Mohammed
Hi Malaka,
method [2] and [3] are seems to be good and understandable by user so i
will try on that method.

On Tue, Nov 3, 2015 at 4:29 PM, Kathees Rajendram  wrote:

> Hi Malaka,
>
> +1 For your approach.
>
> Thanks,
> Kathees
>
> On Tue, Nov 3, 2015 at 4:16 PM, Malaka Silva  wrote:
>
>> Kathees but with this approach the config will be lengthy and will
>> become hard to read.
>>
>> IMO we should have something like [1] or [2]. We can easily iterate
>> properties using [3] WDYT?
>>
>> [1]
>> 
>> jboss
>> org.jnp.interfaces.
>> NamingContextFactory
>> org.
>> jboss.naming:org.jnp.interfaces> naming.factory.url.pkgs>
>> jnp://localhost:1099> ejbJNDIKey.jboss.java.naming.provider.url>
>> 
>> [2]
>> 
>> org.jnp.interfaces.
>> NamingContextFactory
>> org.jboss.naming:org.jnp.
>> interfaces
>> jnp://localhost:1099> ejbJNDIKey.jboss.java.naming.provider.url>
>> 
>>
>> [3]
>> public static Object lookupTemplateParamater(MessageContext ctxt, int
>> index) {
>> Stack funcStack = (Stack)
>> ctxt.getProperty(SynapseConstants.SYNAPSE__FUNCTION__STACK);
>> TemplateContext currentFuncHolder = funcStack.peek();
>> Collection paramList = currentFuncHolder.getParameters();
>> Iterator it = paramList.iterator();
>> int i = 0;
>> while (it.hasNext()) {
>> String param = (String) it.next();
>> if (i == index) {
>> return param;
>> }
>> i++;
>> }
>> return null;
>> }
>>
>> On Mon, Nov 2, 2015 at 10:50 PM, Kathees Rajendram 
>> wrote:
>>
>>> Hi,
>>>
>>> In the template,We can use a parameter[1] for the JNDI dynamic
>>> properties and input the values with the pattern[2]. The each ejb JNDI
>>> properties can be gotten from the parameter and set to the properties[3]
>>> using a class mediator.
>>>
>>> [1]
>>> 
>>> {$ctx:ejbJNDIProperties}
>>> 
>>>
>>> [2]
>>> A:B,C:D,E:F
>>>
>>> [3]
>>> Properties props = new Properties();
>>> props.put("A" ,"B");
>>> props.setProperty("C","D");
>>> props.setProperty("E", "F");
>>>
>>> Thanks,
>>> Kathees
>>>
>>> On Mon, Nov 2, 2015 at 7:23 PM, Malaka Silva  wrote:
>>>
 Challenge here is parameters depends on the container rather than the
 inbound connector.

 IMO we should follow the same concept followed in ejb mediator. (Except
 we need to make it dynamic)

 eg:

 Will have one JNDIID and user can add multiple entries against it.

 inbound.ejb.JNDIID=jboss

 inbound.ejb.JNDIID.jboss.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

 inbound.ejb.JNDIID.jboss.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
 inbound.ejb.JNDIID.jboss.java.naming.provider.url=jnp://localhost:1099

 [1] https://docs.wso2.com/display/ESB490/EJB+Mediator

 On Mon, Nov 2, 2015 at 5:34 PM, Rajjaz Mohammed 
 wrote:

> Hi,
> I'm implementing Connector for EJB 2.x. so in order to create JNDI
> properties i need pair of parameters [1]. and the number of parameters 
> also
> depend on EJB server and Version. How can i write the operation fro
> that?(normally our Init methods will be like [2])
>
>
> [1]
> Properties props = new Properties();
> props.put("A" ,"B");
> props.setProperty("C","D");
> props.setProperty("E", "F");
>
>
> [2]
> 
> {$ctx:a}
> {$ctx:b}
> {$ctx:c}
> {$ctx:d}
> 
>
>
> --
> Thank you
> Best Regards
>
> *Rajjaz HM*
> Associate Software Engineer
> WSO2 Inc. 
> lean | enterprise | middleware
> Mobile | +94752833834
> Email   | raj...@wso2.com
> LinkedIn | Blogger | WSO2 Profile
> 
>



 --

 Best Regards,

 Malaka Silva
 Senior Tech Lead
 M: +94 777 219 791
 Tel : 94 11 214 5345
 Fax :94 11 2145300
 Skype : malaka.sampath.silva
 LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
 Blog : http://mrmalakasilva.blogspot.com/

 WSO2, Inc.
 lean . enterprise . middleware
 http://www.wso2.com/
 http://www.wso2.com/about/team/malaka-silva/
 
 https://store.wso2.com/store/

 Save a tree -Conserve nature & Save the world for your future. Print
 this email only if it is absolutely necessary.

>>>
>>>
>>>
>>> --
>>> Kathees
>>> Software Engineer,
>>> email: kath...@wso2.com
>>> mobile: +94772596173
>>>
>>
>>
>>
>> --
>>
>> Best Regards,
>>
>> Malaka Silva
>> Senior Tech Lead
>> M: +94 777 219 791
>> Tel : 94 11 214 5345
>> Fax :94 11 2145300
>> Skype : malaka.sampath.silva
>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>> Blog : 

[Dev] [IS] [SP01][H2] install_sp.sh script copies h2 database into a wrong location

2015-11-03 Thread Madusanka Premaratne
Hi IS Team,
I have installed sp1 to IS 5.0.0 in my local machine with local H2 db. And
found the script install_sp.sh copies new database to /wso2is-5.0.0
/repository/. The correct location is /wso2is-5.0.0/repository/database/.

In the readme you have guided to start the server with -Dsetup which
creates a new database in correct location but the copied databases also
exists in a wrong location.

I have attached the corrected script herewith.

Thanks,
Madusanka

-- 
*Madusanka Premaratne* | Associate Software Engineer
WSO2, Inc | lean. enterprise. middleware.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 71 835 70 73| Work: +94 112 145 345
Email: madusan...@wso2.com | Web: www.wso2.com

[image: Facebook]  [image: Twitter]
 [image: Google Plus]
 [image:
Linkedin]  [image: Instagram]
 [image: Skype]



install_sp.sh
Description: Bourne shell script
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] [SP01][H2] install_sp.sh script copies h2 database into a wrong location

2015-11-03 Thread Johann Nallathamby
@Thainrdu, can you take a quick look at this ?

On Wed, Nov 4, 2015 at 9:56 AM, Madusanka Premaratne 
wrote:

> Hi IS Team,
> I have installed sp1 to IS 5.0.0 in my local machine with local H2 db. And
> found the script install_sp.sh copies new database to /wso2is-5.0.0
> /repository/. The correct location is /wso2is-5.0.0/repository/database/.
>
> In the readme you have guided to start the server with -Dsetup which
> creates a new database in correct location but the copied databases also
> exists in a wrong location.
>
> I have attached the corrected script herewith.
>
> Thanks,
> Madusanka
>
> --
> *Madusanka Premaratne* | Associate Software Engineer
> WSO2, Inc | lean. enterprise. middleware.
> #20, Palm Grove, Colombo 03, Sri Lanka
> Mobile: +94 71 835 70 73| Work: +94 112 145 345
> Email: madusan...@wso2.com | Web: www.wso2.com
>
> [image: Facebook]  [image: Twitter]
>  [image: Google Plus]
>  [image:
> Linkedin]  [image: Instagram]
>  [image: Skype]
> 
>
>


-- 
Thanks & Regards,

*Johann Dilantha Nallathamby*
Technical Lead & Product Lead of WSO2 Identity Server
Governance Technologies Team
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+9476950*
Blog - *http://nallaa.wordpress.com *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM] Need an opinion on mediation extensions

2015-11-03 Thread Rushmin Fernando
Thanks NuwanD for the clarification.

Yes I agree with the fact that, UX point of view its the best way to
provide an UI for that.

Sorry I didn't mention the requirement behind this scenario.

I'm trying to automate API deployment.

So first thought of creating an ESB project to contain the sequences for
the file based mediation extension. Then I ran in to a trouble because DevS
+ Maven plugins didn't allow the sequence names like 'API-NAME:Vversio--IN'

Then I created a registry resource project and added the sequences with a
standard name. It works fine now.

I'm going to use the Publisher ReST API to create the API specifying the
in/out sequence extensions.

Please let me know if I'm doing something wrong here.

Thanks
Rushmin

On Tue, Nov 3, 2015 at 4:05 PM, Nuwan Dias  wrote:

>
>
> On Tue, Nov 3, 2015 at 2:03 AM, Rushmin Fernando  wrote:
>
>>
>> Hi APIM team,
>>
>> The doc [1] says that the recommended way to add a mediation extension is
>> the registry approach.
>>
>> *"The recommended way to engage a mediation extension sequence per API is
>> to upload an XML file through the registry and then engage it using the API
>> Publisher."*
>>
>> Are there any drawbacks in using the file based mediation extensions ?
>>
>
> No drawbacks. Even when you select a sequence from the UI and publish an
> API, we deploy the sequence xml in the file system.
>
> The reason we ask to upload to registry is because..
>
> 1. It gives the opportunity for others to reuse the same sequence.
> 2. Its not nice to say use the UI for API Publishing and go to the
> filesystem to deploy a sequence.
> 3. In most cases people don't have access to the filesystem (ex: Cloud)
>
> Thanks,
> NuwanD.
>
>>
>>
>> Thanks
>> Rushmin
>>
>> [1] - https://docs.wso2.com/display/AM191/Adding+Mediation+Extensions
>>
>>
>>
>> --
>> *Rushmin Fernando*
>> *Technical Lead*
>>
>> WSO2 Inc.  - Lean . Enterprise . Middleware
>>
>> email : rush...@wso2.com
>> mobile : +94772310855
>>
>>
>>
>
>
> --
> Nuwan Dias
>
> Technical Lead - WSO2, Inc. http://wso2.com
> email : nuw...@wso2.com
> Phone : +94 777 775 729
>



-- 
*Rushmin Fernando*
*Technical Lead*

WSO2 Inc.  - Lean . Enterprise . Middleware

email : rush...@wso2.com
mobile : +94772310855
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] Yahoo OAuth2/OpenID Connect as Identity Provider - Creating Yahoo Oauth App to get client credentials.

2015-11-03 Thread Nadeesha Meegoda
Thanks Isura.

On Wed, Nov 4, 2015 at 11:38 AM, Isura Karunaratne  wrote:

> Hi,
>
>
> On Wed, Nov 4, 2015 at 9:49 AM, Nadeesha Meegoda 
> wrote:
>
>> Hi Isura,
>>
>> Thanks for the Response. I created another app named "test app" and gave
>> callback domain as* https://test.com * while I have
>> already changed the hostname to test.com. Still the authentication fails
>> directed to a URL like this
>> https://test.com/?code=dj8pebu=bc76104c-2e6b-432c-985c-6afabe7d4ad8%2COIDC
>>
>> Can you please let me know what else should be done to proceed with a
>> successful authentication to the travelocity app?
>>
>> Herewith I have attached the IDP configuration and the details of the
>> yahoo app I registered.
>>
>> Callback URL in Identity server side should be
> https://test.com/commonauth
>
> Thanks
> Isura
>
>
>> Thanks
>> Nadeesha
>>
>>
>> On Tue, Nov 3, 2015 at 5:34 PM, Isura Karunaratne  wrote:
>>
>>> Hi Nadeesha,
>>>
>>>
>>>
>>>
>>> On Tue, Nov 3, 2015 at 3:00 PM, Nadeesha Meegoda 
>>> wrote:
>>>
 Hi IS team,

 I've created an Yahoo App for the above mentioned purpose and to add
 the Callback domain  it requires a payment to be done. I get the following
 message

 "Enable billing for BOSS API
 . No
 Billing Information has been provided. The API will not work until you
 complete this step."

 Do we need to actually give the callback domain? Without that I have
 tried but fails when authenticating. (Note that it directs to Yahoo
 authentication successfully). I have attached my IDP configuration

>>>
>>> You need to start Identity server in port 443 and change host name (
>>> test.com). Then put callback domain as https://test.com
>>>
>>> Thanks
>>> Isura
>>>

 Has anyone of you tested Yahoo OAuth2/OpenID Connect as Identity
 Provider? If so can you please provide the test client credentials or let
 me know how this should be done.

 Since this was added recently to IS implementation, the IS 510
 documentation should be updated. The improvement tracked in [1]

 [1] - https://wso2.org/jira/browse/DOCUMENTATION-2664

 Thanks
 Nadeesha

 --
 *Nadeesha Meegoda*
 Software Engineer - QA
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware
 email : nadees...@wso2.com
 mobile: +94783639540
 <%2B94%2077%202273555>

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Isura Dilhara Karunaratne
>>> Senior Software Engineer
>>>
>>> Mob +94 772 254 810
>>>
>>>
>>
>>
>> --
>> *Nadeesha Meegoda*
>> Software Engineer - QA
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>> email : nadees...@wso2.com
>> mobile: +94783639540
>> <%2B94%2077%202273555>
>>
>
>
>
> --
> Isura Dilhara Karunaratne
> Senior Software Engineer
>
> Mob +94 772 254 810
>
>


-- 
*Nadeesha Meegoda*
Software Engineer - QA
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
email : nadees...@wso2.com
mobile: +94783639540
<%2B94%2077%202273555>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] ES REST API calls does not communicate exceptions to REST clients

2015-11-03 Thread Sameera Kannangara
Hi ES team,

Currently I'm working on test automating life-cycle operations done via ES
apis.

In order to check or uncheck an check item associated with a life-cycle
state user makes a POST REST call to the following URL,

https://localhost:9443/publisher/apis/asset/{UUID}/update-checklist?type={shortname}={lifecyclename}

ex -
https://localhost:9443/publisher/apis/asset/12ae928a-06b9-4662-8a2a-bd9fd2a51fd9/update-checklist?type=restservice=ServiceLifeCycle

with pay load

{"checklist":[{"index":{checkitem-index},"checked":{checkbox-state}}]}

ex -
{"checklist":[{"index":2,"checked":true}]}

Also note that "checklist" array object in payload can hold multiple check
items to be committed.

Currently I'm writing a test case associated with permissions on life-cycle
check items and state transition actions.
With above REST call even if user does not have permission to check a check
item REST call returns a 200 OK response.
When such an unauthorized action is performed we can see a stack trace
logged in back-end showing the exception case occurred.
But ES API layer does not communicate this problem to the REST client.
Due to this issue, tests written to validate check item permissions are
failing.

Not only this test case similar situation (exception condition occurs in
back end but is not propagated to front end) happens in subscription test
cases.

Please provide a solution for these scenarios.

Thank you,
SameeraK.


-- 
*Sameera Kannangara*
Software Engineer
Platform TG; WSO2 Inc. http://wso2.com
Contact:
phone: +94719541577
Lean . Enterprise . Middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Fwd: WSO2 development contributions

2015-11-03 Thread Malaka Silva
Santiago we always encourage community to contribute and thank you for your
mail.

You can follow the following process with related to you contributions.

Bug fixes - You can create a jira and send the Git Pull Request to the jira
itself. Product team will validate your fix and if all good will include it
for the next release.

New feature - Before doing you can discuss this on architecture (
architect...@wso2.org) mail group. Once completed send the relevant details
as pull requests afterwards. Product team will validate this.

+dev list

-- Forwarded message --
From: Santiago Montico <
​​
smont...@gmail.com>
Date: Tue, Nov 3, 2015 at 9:36 PM
Subject: WSO2 development contributions
To: mal...@wso2.com


Hi Malaka,

My name is Santiago Montico, I'm from Uruguay and I've been working with
JEE and open source technologies since my beginnings as a developer,
architect and project leader.
Some time ago I've involved in a project in Latin America where we have
used WSO2 ESB as a CORE for our integration platform, developing mediation
projects using some of the features provided by the ESB.

Now a days I'm working in another project with a different role but I tried
to keep in touch with WSO2 news regarding the products released.

Particullary in this moment I'm interested in contribute with the
development of some of the WSO2 projects.
I'm interested in the ESB project, Machine Learner and Complex Event
Processor.
To play around I have forked the ESB project in my git account and have
generated the binary files in order to check the construction process with
maven.
Also I've seen some of the issues in JIRA related to theses projects to
check wich are the needs.

I've seen in the WSO2 development group that you are involved with the
development process that's why i'm sending you this email in order to check
with you which could be the procedure in order to collaborate with some of
the projects mentioned above.
There's some technical documentation in order to understand how the
projects were constructed and make easy to understand how to make bugfixing
or develop new requirements?

If you are not the correct person, please feel free to forward this email
to the correct one.

Thank you very much.

Regards.

Santiago.



-- 

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/

https://store.wso2.com/store/

Save a tree -Conserve nature & Save the world for your future. Print this
email only if it is absolutely necessary.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 Committers += Shakila Sivagnanarajah

2015-11-03 Thread NIFRAS ISMAIL
Great Congratz Ms. Shakila

Regards.
*M. Nifras Ismail*
[image: LinkedIn] 



On Tue, Nov 3, 2015 at 8:02 PM, Kalyani Yogeswaranathan 
wrote:

> Congrats!
>
> On Thu, Oct 29, 2015 at 10:54 AM, Hariprasath Thanarajah <
> haripras...@wso2.com> wrote:
>
>> Congratz Shakila...
>>
>> On Wed, Oct 28, 2015 at 8:51 PM, Malaka Silva  wrote:
>>
>>> Hi Devs,
>>>
>>> Its my pleasure to welcome Shakila Sivagnanarajah as a WSO2 Committer.
>>>
>>> Shakila has been a member of the Platform Extensions Team (Earlier
>>> Connector Team) contributing immensely to many aspects ESB Product, ESB
>>> Connectors development ever since she joined us. butions, ownership shown
>>> towards the tasks/responsibilities assigned to her. She is always
>>> enthusiastic to learn new things by further investigating the issues
>>> in-depth.
>>>
>>> Shakila, welcome aboard and keep up the good work .. !
>>>
>>> Best Regards,
>>>
>>> Malaka Silva
>>> Senior Tech Lead
>>> M: +94 777 219 791
>>> Tel : 94 11 214 5345
>>> Fax :94 11 2145300
>>> Skype : malaka.sampath.silva
>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>> Blog : http://mrmalakasilva.blogspot.com/
>>>
>>> WSO2, Inc.
>>> lean . enterprise . middleware
>>> http://www.wso2.com/
>>> http://www.wso2.com/about/team/malaka-silva/
>>> 
>>> https://store.wso2.com/store/
>>>
>>> Save a tree -Conserve nature & Save the world for your future. Print
>>> this email only if it is absolutely necessary.
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>>
>>
>> *Thank you and Regards**Hariprasath Thanarajah*
>> Associate Software Engineer | WSO2
>> E: haripras...@wso2.com
>> M: +94752806528
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> *Kalyani Yogeswaranathan*
>
> *Associate software engineer*
> *WSO2 Inc.*
>
> *Mobile: 0776390284 <0776390284>*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 Committers += Shakila Sivagnanarajah

2015-11-03 Thread Kalyani Yogeswaranathan
Congrats!

On Thu, Oct 29, 2015 at 10:54 AM, Hariprasath Thanarajah <
haripras...@wso2.com> wrote:

> Congratz Shakila...
>
> On Wed, Oct 28, 2015 at 8:51 PM, Malaka Silva  wrote:
>
>> Hi Devs,
>>
>> Its my pleasure to welcome Shakila Sivagnanarajah as a WSO2 Committer.
>>
>> Shakila has been a member of the Platform Extensions Team (Earlier
>> Connector Team) contributing immensely to many aspects ESB Product, ESB
>> Connectors development ever since she joined us. butions, ownership shown
>> towards the tasks/responsibilities assigned to her. She is always
>> enthusiastic to learn new things by further investigating the issues
>> in-depth.
>>
>> Shakila, welcome aboard and keep up the good work .. !
>>
>> Best Regards,
>>
>> Malaka Silva
>> Senior Tech Lead
>> M: +94 777 219 791
>> Tel : 94 11 214 5345
>> Fax :94 11 2145300
>> Skype : malaka.sampath.silva
>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>> Blog : http://mrmalakasilva.blogspot.com/
>>
>> WSO2, Inc.
>> lean . enterprise . middleware
>> http://www.wso2.com/
>> http://www.wso2.com/about/team/malaka-silva/
>> 
>> https://store.wso2.com/store/
>>
>> Save a tree -Conserve nature & Save the world for your future. Print this
>> email only if it is absolutely necessary.
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
>
> *Thank you and Regards**Hariprasath Thanarajah*
> Associate Software Engineer | WSO2
> E: haripras...@wso2.com
> M: +94752806528
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Kalyani Yogeswaranathan*

*Associate software engineer*
*WSO2 Inc.*

*Mobile: 0776390284*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM] Need an opinion on mediation extensions

2015-11-03 Thread Nuwan Dias
On Tue, Nov 3, 2015 at 2:03 AM, Rushmin Fernando  wrote:

>
> Hi APIM team,
>
> The doc [1] says that the recommended way to add a mediation extension is
> the registry approach.
>
> *"The recommended way to engage a mediation extension sequence per API is
> to upload an XML file through the registry and then engage it using the API
> Publisher."*
>
> Are there any drawbacks in using the file based mediation extensions ?
>

No drawbacks. Even when you select a sequence from the UI and publish an
API, we deploy the sequence xml in the file system.

The reason we ask to upload to registry is because..

1. It gives the opportunity for others to reuse the same sequence.
2. Its not nice to say use the UI for API Publishing and go to the
filesystem to deploy a sequence.
3. In most cases people don't have access to the filesystem (ex: Cloud)

Thanks,
NuwanD.

>
>
> Thanks
> Rushmin
>
> [1] - https://docs.wso2.com/display/AM191/Adding+Mediation+Extensions
>
>
>
> --
> *Rushmin Fernando*
> *Technical Lead*
>
> WSO2 Inc.  - Lean . Enterprise . Middleware
>
> email : rush...@wso2.com
> mobile : +94772310855
>
>
>


-- 
Nuwan Dias

Technical Lead - WSO2, Inc. http://wso2.com
email : nuw...@wso2.com
Phone : +94 777 775 729
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dependency Inject not working to get IEclipseContext Object

2015-11-03 Thread Kavith Lokuhewage
Hi Nuwan,

You can observe a reference to IEclipseContext using the bundleContext
object. You can get a reference to bundleContext via bundle activator or
via FrameworkUtil class.

See following snippet.

BundleContext bundleContext =
FrameworkUtil.getBundle(SomeClassInYourBundle.class).getBundleContext();
IEclipseContext eclipseContext =
EclipseContextFactory.getServiceContext(bundleContext);

BTW, how did you try to get a IEventBroker reference via Dependency
Injection?
If you are getting null for injected references always, I suspect that DI
engine does not manage your object.

FYI, Eclipse E4 DI engine only manages classes in Application Model or
framework components by default (eg. commands, handlers, activators,
declarative services, etc.). If your class is not a framework component and
you manually instantiate it in your code using *new *operator, DI engine is
not aware of that. In such kind of a situation, you need to manually inject
the required references using ContextInjectionFactory. See following
snippet.

YourClass object = new YourClass();
ContextInjectionFactory.inject(object, eclipseContext);

For the ContextInjectionFactory.inject method, you need to pass the DI
context (to tell DI engine from which context to obtain references which
are needed to inject - this should be the global eclipse context in most
cases) and your object. You can obtain the global eclipseContext using
first snippet.

For example, you can use below code to get a reference to IEventBroker in a
custom class which is not a framework component.

public YourClass{

@Inject
IEventBroker eventBroker;

public YourClass(){}

}

Then, inject reference while instantiating.

BundleContext bundleContext =
FrameworkUtil.getBundle(YourClass.class).getBundleContext();
IEclipseContext eclipseContext =
EclipseContextFactory.getServiceContext(bundleContext);
YourClass object = new YourClass();
ContextInjectionFactory.inject(object, eclipseContext);

HTH.
Thanks,

On Tue, Nov 3, 2015 at 9:07 PM, Nuwan Pallewela  wrote:

> Hi Devs,
>
> I'm trying to get a IEclipseContext object to get IEventBroker. DI method
> to get IEventBroker instance always gives a null. Alternative method to get
> IEventBroker is through IEclipseContext instance. DI method to get it also
> not working. Is there any way to get a instance of IEclipseContext object?
>
> Thanks,
> Nuwan
>
> --
> --
>
> *Nuwan Chamara Pallewela*
>
>
> *Software Engineer*
>
> *WSO2, Inc. *http://wso2.com
> *lean . enterprise . middleware*
>
> Email   *nuw...@wso2.com *
> Mobile  *+94719079739 <%2B94719079739>@*
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Kavith Lokuhewage*
Software Engineer
WSO2 Inc. - http://wso2.com
lean . enterprise . middleware
Mobile - +9477-9-145-123 | +9471-455-6-401
Linkedin   Twitter

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Occurring more callbacks after the initial run of the android app-Siddhi

2015-11-03 Thread Lakini Senanayaka
adding Dev@wso2

On Tue, Nov 3, 2015 at 3:25 PM, Lakini Senanayaka  wrote:

> Hi,
>
> I have implemented a service using Siddhi 2.1.0.
> This is my Service class which deals with siddhimanager.
>
> package org.wso2.edgeanalyticsservice1;
>
> import android.content.Context;
>
> import org.wso2.siddhi.core.SiddhiManager;
> import org.wso2.siddhi.core.event.Event;
> import org.wso2.siddhi.core.stream.input.InputHandler;
> import org.wso2.siddhi.core.stream.output.StreamCallback;
> import org.wso2.siddhi.core.util.EventPrinter;
>
> /**
>  * This class create from the build in sensors and inject
>  * to the EdgeAnalytics Service for processing on a query passed.
>  */
> public class CEP {
>
> private SiddhiManager mSiddhiManager;
> private IEdgeAnalyticServiceCallback mCallb = null;
>
> /** Initialize the SiddhiManager Instance */
> public CEP() {
> mSiddhiManager = new SiddhiManager();
> }
>
> /** Add extra details to the SiddhiManager object  */
> public void cepAddDetails(final Context context, String streamDefinition, 
> String stream, final String query, final String 
> callbackFunction,IEdgeAnalyticServiceCallback cb) {
> mCallb=cb;
>
> /** Define the stream to the Siddhi Manager  */
> mSiddhiManager.defineStream(streamDefinition);
>
> /** Define the query to the Siddhi Manager  */
> mSiddhiManager.addQuery(query);
>
> /** Define the scallback details to the Siddhi Manager  */
> mSiddhiManager.addCallback(callbackFunction, new StreamCallback() {
> public void receive(Event[] events) {
> EventPrinter.print(events);
> try {
> mCallb.addCallBack("Passed!! " );
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> });
> }
>
> /** Add extra details to the SiddhiManager object  */
> public void cepAddDetails(final Context context, String streamDefinition, 
> String stream, final String query1, final String query2,final String 
> callbackFunction1,final String callbackFunction2,IEdgeAnalyticServiceCallback 
> cb) {
> //todo:Check the pattern queries
>
> mCallb=cb;
>
> /** Define the stream to the Siddhi Manager  */
> mSiddhiManager.defineStream(streamDefinition);
>
> /** Define the query to the Siddhi Manager  */
> mSiddhiManager.addQuery(query1);
> mSiddhiManager.addQuery(query2);
>
> /** Define the scallback details to the Siddhi Manager  */
> mSiddhiManager.addCallback(callbackFunction1, new StreamCallback() {
> public void receive(Event[] events) {
> EventPrinter.print(events);
> try {
> mCallb.addCallBack("callback1");
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> });
>
> mSiddhiManager.addCallback(callbackFunction2, new StreamCallback() {
> public void receive(Event[] events) {
> EventPrinter.print(events);
> try {
> mCallb.addCallBack("callback2");
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> });
> }
>
> /** Analyse single data and send the notification back to client through 
> callbacks */
> public void analyseTheData(String value, String stream, 
> IEdgeAnalyticServiceCallback cb) {
>
> String[] dataCollection=value.split(",");
> String[] value_type=null;
> Object[] x =new Object[dataCollection.length];
>
> /** Identify the data types which the client sends. */
> for(int i=0;i {
> value_type=dataCollection[i].split("-");
> x[i]=0;
> switch (value_type[1]) {
> case "double":
> x[i]=Double.parseDouble(value_type[0]);
> break;
> case "float":
> x[i]=Float.parseFloat(value_type[0]);
> break;
> case "int":
> x[i]=Integer.parseInt(value_type[0]);
> break;
> case "string":
> x[i]=value_type[0];
> break;
> default:
> break;
>}
>}
>
> InputHandler inputHandler = mSiddhiManager.getInputHandler(stream);
>try
>{
>inputHandler.send(x);
>}
>catch (InterruptedException e) {
>e.printStackTrace();
>}
> }
> }
>
> I have set a timer and I'm passing data to the siddhi stream.
> When I run this app for the first time it gives only one callback and
> working fine.But After I run the same app again and again it gives 

Re: [Dev] Occurring more callbacks after the initial run of the android app-Siddhi

2015-11-03 Thread Lakini Senanayaka
Hi Lasantha,

This is the class I'm calling and instantiate the CEP object.

package org.wso2.edgeanalyticsservice1;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

/**
 * This class implements IEdgeAnalyticService.aidl interface
 */
public class EdgeAnalyticsService extends Service {

private CEP mCep;
private TaskManager taskManager=null;

public EdgeAnalyticsService() {
mCep = new CEP();
}

@Override
public void onCreate() {
}

/** Returns the IBinder object for the connection */
@Override
public IBinder onBind(Intent intent) {
taskManager=null;
return mBinder;
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return Service.START_STICKY;
}

@Override
public boolean onUnbind (Intent intent){
return false;
}

@Override
public void onDestroy() {
stopSelf();
}

/** Implementation of methods in the IEdgeAnalyticsService interface */
public final IEdgeAnalyticsService.Stub mBinder = new
IEdgeAnalyticsService.Stub() {

IEdgeAnalyticServiceCallback mIEdgeAnalyticServiceCallback=null;

@Override
public void getServiceNormal(String type, String
streamDefinition, String stream, String query, String
callbackFunctionName,IEdgeAnalyticServiceCallback cb) {

mIEdgeAnalyticServiceCallback = cb;


/** Add the details to CEP if the Client is Type1 */
if (type.equalsIgnoreCase("TYPE1")) {
mCep.cepAddDetails(getApplicationContext(),
streamDefinition, stream, query, callbackFunctionName, cb);
}

/** Add the details to CEP if the Client is
Type2-LOCATION_SERVICE */
else if (type.equalsIgnoreCase("LOCATION_SERVICE")) {
mCep.cepAddDetails(getApplicationContext(), "define
stream LocationStream (latitude double,longitude double); ",
"LocationStream", query, callbackFunctionName,cb);
taskManager = new
TaskManager(getApplicationContext(),"LocationStream",mIEdgeAnalyticServiceCallback,mCep);
taskManager.initializeServiceType(type);
}

/** Add the details to CEP if the Client is
Type2-HUMIDITY_SERVICE */
else if (type.equalsIgnoreCase("HUMIDITY_SERVICE")) {
mCep.cepAddDetails(getApplicationContext(), "define
stream HumidityStream (humidity float); ", "HumidityStream", query,
callbackFunctionName, cb);
taskManager = new
TaskManager(getApplicationContext(),"HumidityStream",mIEdgeAnalyticServiceCallback,mCep);
taskManager.initializeServiceType(type);
}

/** Add the details to CEP if the Client is
Type2-TEMPERATURE_SERVICE */
else if (type.equalsIgnoreCase("TEMPERATURE_SERVICE")) {
mCep.cepAddDetails(getApplicationContext(), "define
stream temperatureStream (tempValue float); ", "temperatureStream",
query, callbackFunctionName,cb);
taskManager = new
TaskManager(getApplicationContext(),"temperatureStream",mIEdgeAnalyticServiceCallback,mCep);
taskManager.initializeServiceType(type);
}

/** Add the details to CEP if the Client is
Type2-INTENSITY_SERVICE*/
else if (type.equalsIgnoreCase("INTENSITY_SERVICE")) {
Log.d("client","INTENSITY SERVICE");
mCep.cepAddDetails(getApplicationContext(), "define
stream lightIntensityStream (lightValue double); ",
"lightIntensityStream", query, callbackFunctionName, cb);
taskManager = new
TaskManager(getApplicationContext(),"lightIntensityStream",mIEdgeAnalyticServiceCallback,mCep);
taskManager.initializeServiceType(type);

}
}

//get servicePatterns
@Override
public void getServicePattern(String type, String
streamDefinition, String stream, String query1,String query2 ,String
callbackFunctionName1,String
callbackFunctionName2,IEdgeAnalyticServiceCallback cb) {

mIEdgeAnalyticServiceCallback = cb;

/** Add the details to CEP if the Client is Type1 */
if (type.equalsIgnoreCase("TYPE1")) {
mCep.cepAddDetails(getApplicationContext(),
streamDefinition, stream, query1, query2,
callbackFunctionName1,callbackFunctionName2,cb);
}

else if (type.equalsIgnoreCase("LOCATION_SERVICE")) {
mCep.cepAddDetails(getApplicationContext(), "define
stream LocationStream (latitude double,longitude double); ",
"LocationStream",
query1,query2,callbackFunctionName1,callbackFunctionName2,cb);
taskManager = new
TaskManager(getApplicationContext(),"LocationStream",mIEdgeAnalyticServiceCallback,mCep);
taskManager.initializeServiceType(type);
}

/** Add the details to CEP if the Client is