Hi Gimantha,

Thanks for the explanation. :)

Sorry Im still a bit unclear. So should it be "new AnalyticsClient()" ? But
with this constructor, found out that "this.serverUrl" is always null..
Which causes the ajax call to be passed to a wrong url..

 Am I missing anything here?, or was it something that is being fixed in a
later version?

Thanks,
Supun


On Mon, Dec 14, 2015 at 8:45 PM, Gimantha Bandara <[email protected]> wrote:

> Hi Supun,
>
> Carbon-analytics.js had init() method as its default constructor, but
> later it was removed. I am sorry the docs were not updated properly after
> that change.
>
> The javascript API internally calls a jaggery page to fetch data from DAS.
> In DAS 3.0.0, we are not able to send cross domain requests to this jaggery
> page, so if we try to do so, it will return 403 http code.
>
> On Monday, December 14, 2015, Supun Sethunga <[email protected]> wrote:
>
>> Hi,
>>
>>
>>> btw, in the doc [1]  var client = new AnalyticsClient().init(); should
>>> be changed to var client = new AnalyticsClient() it seems (no *init()*
>>>  part).
>>
>> Seems like the issue was that the AnalyticsClient.prototype.init() method
>> in carbon-analytics.js was never loaded. Hence AnalyticsClient().init() 
>> returned
>> a method not found error.
>>
>> However, I was calling the carbon-analytics.js within another dashboard
>> gadget. But the doc says:
>> *"Currently due to a limitation, client applications should be deployed
>> in the same domain as the Dashboard server. i.e -
>> DAS_HOME/repository/deployment/server/webapp*"
>>
>> Can I know what is this limitation and whether this issue is related to
>> the above limitation?
>>
>> Thanks,
>> Supun
>>
>> On Mon, Dec 14, 2015 at 10:01 AM, Anjana Fernando <[email protected]>
>> wrote:
>>
>>> [Adding Gimantha].
>>>
>>> On Sun, Dec 13, 2015 at 1:01 PM, Supun Sethunga <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I was trying to do a drillDownSearch using [1]. This operation always
>>>> returned *"{"status" : "failed", "message" : "drilldownSearch
>>>> parameters are not provided"}"*. Further debugging, found out out
>>>> that, this happens due to the "request" is not getting build at the
>>>> https://localhost:9443/portal/controllers/apis/analytics.jag, hence
>>>> contentAsString = stringify(content); always resolve to null, resulting the
>>>> above error.
>>>>
>>>> I could overcome this by adding the following to the "analytics.jag"
>>>> file [2]:
>>>>
>>>> *if(request.getMethod() == "POST") {*
>>>>
>>>> *log.debug(request.getContent());*
>>>>
>>>> *}  *
>>>>
>>>>
>>>> Further, I also had to change [3] to follow:
>>>>
>>>> contentAsString = content;
>>>>
>>>>
>>>> It seemed like to me, the request was not getting built. Any idea what
>>>> would be the reason for this?
>>>>
>>>> btw, in the doc [1]  var client = new AnalyticsClient().init(); should
>>>> be changed to var client = new AnalyticsClient() it seems (no *init()*
>>>> part).
>>>>
>>>> [1] https://docs.wso2.com/display/DAS300/Analytics+JavaScript+(JS)+API
>>>> [2]
>>>> https://github.com/wso2/carbon-dashboards/blob/master/apps/portal/controllers/apis/analytics.jag
>>>> [3]
>>>> https://github.com/wso2/carbon-dashboards/blob/master/apps/portal/controllers/apis/analytics.jag#L151
>>>>
>>>> Thanks,
>>>> Supun
>>>> --
>>>> *Supun Sethunga*
>>>> Software Engineer
>>>> WSO2, Inc.
>>>> http://wso2.com/
>>>> lean | enterprise | middleware
>>>> Mobile : +94 716546324
>>>>
>>>
>>>
>>>
>>> --
>>> *Anjana Fernando*
>>> Senior Technical Lead
>>> WSO2 Inc. | http://wso2.com
>>> lean . enterprise . middleware
>>>
>>
>>
>>
>> --
>> *Supun Sethunga*
>> Software Engineer
>> WSO2, Inc.
>> http://wso2.com/
>> lean | enterprise | middleware
>> Mobile : +94 716546324
>>
>
>
> --
> Gimantha Bandara
> Software Engineer
> WSO2. Inc : http://wso2.com
> Mobile : +94714961919
>
>


-- 
*Supun Sethunga*
Software Engineer
WSO2, Inc.
http://wso2.com/
lean | enterprise | middleware
Mobile : +94 716546324
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to