CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • ajax, the easy way.
Pages: [1]

Author Topic: ajax, the easy way.  (Read 4312 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
ajax, the easy way.
November 13, 2008, 10:31:19 am
Hi,

 While modifying the tags so they can be grouped by parents, I'm toying with the rest interface.

I have now a working Raw js function,

CiviREST (entity, function,params), that returns a json. Eg CiviREST ('contact','search', array(...) )  or CiviREST ('tagEntity', 'add',array(...))

That's nice and it works. I'm wondering if/when go a bit higher in the abstraction, and have a server.contact.search() server.tagEntity.add ()...

Basically, have a OO interface on the js that more or less matches the one on the server, at least for some basic functions (CRUD), or something like the api.

Anyway, the code is a bit of a mess, and I had to add things here and there.  Any input greatly appreciated, and Lobo, do you think I can still provide you the hierarchical tags before the code freeze (it's using jquery, shall I include it or is it now always on) ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: ajax, the easy way.
November 13, 2008, 11:09:35 am

hey xavier:

we are still tweaking the jquery interface. ideally we will avoid loading in all pages, but do it selectively on pages that use it. Still a work in progress

Do u wanna post your code, so we can kinda see what it is / does. messy code is fine to begin with (we specialize in it :)

submitting your code a week or so before code freeze will help make it into the release :)

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: ajax, the easy way.
November 13, 2008, 11:40:39 am
Hi,

Not that I don't like doing patch and adding them on the issue tracker, and then realising that I didn't give you the right version, but based on your experience, what's the best way of sharing code in progress like that ?

Do you use git or do you have a "experimental" branch you could give me write access to ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: ajax, the easy way.
November 13, 2008, 11:59:31 am

we can give u access to a branch / trunk. But before that, can you file an issue and a detailed description of what you are doing/planning to do, so we can agree on the functionality and what the deliverables are :). If the descriptio is too long etc, you might be better off doing it on the wiki

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: ajax, the easy way.
November 18, 2008, 12:41:06 pm
This topic is largely outside my expertise, but since I was asked to comment, this is all that comes to mind:

Is there a way to leverage code from Drupal's Services module?
http://drupal.org/handbook/modules/services
http://drupal.org/project/services

From what I've seen, Services looks like a great framework, and might provide a nice abstraction layer for remote API's of all kinds, including those not yet invented.

Or does the wheel really need to be re-invented to maintain cross-CMS support?

Or maybe it really is more efficient to add on top of what we already have, rather than trying to star over on a different foundation? I wouldn't know. Just my 2c.

Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

acrosman

  • Guest
Re: ajax, the easy way.
November 18, 2008, 02:15:34 pm
Matt, While I like the idea of using the work of others as a platform to stand on, that seems like it's asking for trouble to make it cross-CMS/stand-alone compatible.  It might be the case that for future versions we can use ideas/code from that module to help make Civi's interface stronger.

That's my initial response anyway.
Aaron

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: ajax, the easy way.
December 10, 2008, 12:25:38 am
In svn trunk

http://civicrm.org/node/483
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • ajax, the easy way.

This forum was archived on 2017-11-26.