[Owncloud] Share API with APP framework

Bernhard Posselt dev at bernhard-posselt.com
Fri Sep 6 13:00:51 UTC 2013


Btw, also turn off opcode caching, it can lead to weird development
problems, see https://github.com/owncloud/news/issues/319

On 09/06/2013 02:58 PM, Bernhard Posselt wrote:
> use $(document).ready(function()
>
> Also turn on Debug mode (see docs) to prevent js caching for development.
>
>
> On 09/06/2013 02:53 PM, Kropf Johannes wrote:
>> Hi,
>>
>> many thanks, the token issue works now, but somehow my $(document.ready(function() JS code is not called.
>> It only works if I manually import jquery.
>>
>> Any idea what I'm doing wrong?  Unfortunately I'm not a JS expert........
>>
>> Kind regards,
>>
>> Johannes
>>
>>
>>
>>
>> JOHANNES KROPF
>> Health & Environment Department
>> Biomedical Systems
>>
>> AIT Austrian Institute of Technology GmbH
>> Viktor Kaplan Straße 2  |  2700 Wiener Neustadt  |  Austria
>> T +43(0) 50550-4845  |  M +43(0) 664 235 1732  |  F +43(0) 50550-4803
>> johannes.kropf at ait.ac.at |  http://www.ait.ac.at
>>
>> FN: 115980 i HG Wien  |  UID: ATU14703506
>> www.ait.ac.at/Email-Disclaimer
>>
>> ________________________________________
>> Von: Bernhard Posselt [dev at bernhard-posselt.com]
>> Gesendet: Freitag, 6. September 2013 14:40
>> An: Kropf Johannes
>> Cc: owncloud at kde.org
>> Betreff: Re: AW: [Owncloud] Share API with APP framework
>>
>> If you use jquery you dont have to watch out for anything at all. It
>> should work out of the box.
>>
>> On 09/06/2013 02:24 PM, Kropf Johannes wrote:
>>> Ok, I understand.
>>>
>>> How do I correctly use jquery as provided by OwnCloud in my own app?
>>> Do I need to import jquery manually, what I'm doing currently, but it seems to interfere with the owncloud framework.
>>> I guess there is another solution.
>>>
>>> Kind reagards,
>>>
>>> Johannes
>>>
>>>
>>>
>>> JOHANNES KROPF
>>> Health & Environment Department
>>> Biomedical Systems
>>>
>>> AIT Austrian Institute of Technology GmbH
>>> Viktor Kaplan Straße 2  |  2700 Wiener Neustadt  |  Austria
>>> T +43(0) 50550-4845  |  M +43(0) 664 235 1732  |  F +43(0) 50550-4803
>>> johannes.kropf at ait.ac.at |  http://www.ait.ac.at
>>>
>>> FN: 115980 i HG Wien  |  UID: ATU14703506
>>> www.ait.ac.at/Email-Disclaimer
>>>
>>> ________________________________________
>>> Von: owncloud-bounces at kde.org [owncloud-bounces at kde.org]" im Auftrag von "Bernhard Posselt [dev at bernhard-posselt.com]
>>> Gesendet: Freitag, 6. September 2013 14:20
>>> An: owncloud at kde.org
>>> Betreff: Re: [Owncloud] Share API with APP framework
>>>
>>> The request token is sent automatically for each jquery request, see
>>> core/js/oc-requesttoken.js so no need to send it by yourself if you use
>>> jquery. If you use something else you need to send the global variable
>>> oc_requesttoken as header "requesttoken" for each request that checks
>>> the CSRF token.
>>>
>>> On 09/06/2013 12:12 PM, Kropf Johannes wrote:
>>>> Dear Owncloud experts,
>>>>
>>>> I wanna use the Share API in my own app which is based on the App Framework approach.
>>>>
>>>> When the shared API does its AJAX request wthen calling "getItems" I get an error "No token found".
>>>> In the ajax request in JS it seems that there is no requesttoken submitted:
>>>>
>>>> $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItem', itemType: itemType, itemSource: itemSource, checkReshare: checkReshare, checkShares: checkShares }, async: false, success: function(result) { ....
>>>>
>>>>
>>>> How should that work? How can I set the requesttoken for the share api?
>>>>
>>>> Unfortunately there is nothing written in the doc about that issue.
>>>>
>>>> Kind regards,
>>>>
>>>> Johannes
>>>>
>>>>
>>>>
>>>>
>>>> JOHANNES KROPF
>>>> Health & Environment Department
>>>> Biomedical Systems
>>>>
>>>> AIT Austrian Institute of Technology GmbH
>>>> Viktor Kaplan Straße 2  |  2700 Wiener Neustadt  |  Austria
>>>> T +43(0) 50550-4845  |  M +43(0) 664 235 1732  |  F +43(0) 50550-4803
>>>> johannes.kropf at ait.ac.at<mailto:johannes.kropf at ait.ac.at> |  http://www.ait.ac.at
>>>>
>>>> FN: 115980 i HG Wien  |  UID: ATU14703506
>>>> www.ait.ac.at/Email-Disclaimer<http://www.ait.ac.at/Email-Disclaimer> <http://www.ait.ac.at/Email-Disclaimer>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Owncloud mailing list
>>>> Owncloud at kde.org
>>>> https://mail.kde.org/mailman/listinfo/owncloud
>>> _______________________________________________
>>> Owncloud mailing list
>>> Owncloud at kde.org
>>> https://mail.kde.org/mailman/listinfo/owncloud
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud




More information about the Owncloud mailing list