•  » Engine
  •  » Refactor web service output json/xml for version 2.6

#1 2013-05-14 09:01:38

rvelices
Former Piwigo Team
2005-12-29
1960

Refactor web service output json/xml for version 2.6

For piwigo 2.6 I have in mind to rewrite partially the encoding of web service output (json/php/xml). Today it is slow and sometimes you have a _content member in json/php appearing out of nowhere.

The impact will be minimal, but there will be an impact in the output. For example today if you get a list of images (for album/tag or search) you will get something like

Code:

stat
result
  images
    page=0
    per_page=100
    count=100
    _content
      0
        Object { id=4039, width=2832, height=4248, more...}
      1
        Object { id=4040, width=4224, height=2816, more...}

What you will be getting:

Code:

stat
result
  paging
    page=0
    per_page=100
    count=100
  images
      0
        Object { id=4039, width=2832, height=4248, more...}
      1
        Object { id=4040, width=4224, height=2816, more...}

Is it ok to go for it ?

Last edited by rvelices (2013-05-14 09:02:00)

Offline

 

#2 2013-05-14 09:20:58

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

Re: Refactor web service output json/xml for version 2.6

It means that remote software (pLoader, Lightroom, digiKam, shotwell, PiwigoMedia, PiwigoPress, iPhoto...) will be broken :-/ The impact is absolutely huge and I'm not sure it is absolutely necessary (considering that all remote software will need rewrite).

Can't we add a parameter like outputFormat=v2 with the new structure?

Offline

 

#3 2013-05-14 09:21:49

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

Re: Refactor web service output json/xml for version 2.6

(pLoader won't be modified, so if we break it, pLoader dies)

Offline

 

#4 2013-05-14 09:58:23

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Refactor web service output json/xml for version 2.6

Agree, the second version is obviously better but we can't break the API

I like the idea of a version (or format_version or 'v') parameter

(but the scripts will be even more big, well actually no if you code it :-) )

Offline

 

#5 2013-05-14 11:42:41

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Refactor web service output json/xml for version 2.6

It's too complicated to keep the two versions because in order to do it properly some changes would be required in some ws_xxx functions ( those using WS_XML_CONTENT, WS_XML_ATTRIBUTES ...)

I'll try to make changes without breaking things.

Is it possible to get a list of used methods by shotwell, digikam, lightroom, piwigomedia ? (ploader and piwigopress are in svn) Just to make sure I don't break those ...

Offline

 

#6 2013-05-14 17:50:13

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

Re: Refactor web service output json/xml for version 2.6

Here is what I have found:

1) pLoader

http://piwigo.org/dev/browser/extension … ervices.pm

pwg.categories.getAdminList, pwg.categories.getList, pwg.tags.getAdminList, pwg.images.checkUpload, pwg.session.login, pwg.tags.add, pwg.images.add, pwg.images.setInfo, pwg.images.setPrivacyLevel, pwg.images.checkFiles, pwg.images.addFile, pwg.images.exist, pwg.categories.add, pwg.categories.setInfo, pwg.images.addChunk

2) Shotwell

http://redmine.yorba.org/projects/shotw … shing.vala
pwg.session.login, pwg.session.getStatus, pwg.categories.getList, pwg.session.logout, pwg.categories.add, pwg.images.addSimple

3) digiKam

https://github.com/rtsisyk/kipi-plugins … talker.cpp

pwg.session.login, pwg.categories.getList, pwg.images.exist, pwg.getVersion, pwg.images.getInfo, pwg.images.addChunk, pwg.images.setInfo, pwg.images.add

4) PiwigoMedia

pwg.categories.getList, pwg.categories.getImages, pwg.images.getInfo

Offline

 

#7 2013-05-14 21:35:47

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Refactor web service output json/xml for version 2.6

I think I could do the change without impact if it was not

plg wrote:

Here is what I have found:
...4) PiwigoMedia

pwg.categories.getImages, pwg.images.getInfo

What's piwigomedia by the way ?

Offline

 

#8 2013-05-14 21:36:48

flop25
Piwigo Team
2006-07-06
7038

Re: Refactor web service output json/xml for version 2.6

WP extension


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#9 2013-05-14 21:37:01

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Refactor web service output json/xml for version 2.6

Offline

 

#10 2013-05-15 09:00:00

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Refactor web service output json/xml for version 2.6

I think I can do everything properly with impacting only used pwg.categories.getImages . It means that piwigomedia, piwigopress only will need to be changed. The others will work.
Are you ok ?

Offline

 

#11 2013-05-15 09:10:08

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14049

Re: Refactor web service output json/xml for version 2.6

That should be fine :-)

Offline

 

#12 2013-05-21 05:11:21

alloyphoto
Member
alloyphoto.com
2010-11-09
157

Re: Refactor web service output json/xml for version 2.6

Here is what's being used in the Piwigo Plugin for Adobe Lightroom:
pwg.getVersion
pwg.session.login
pwg.session.getStatus
pwg.tags.getAdminList
pwg.tags.add
pwg.session.logout
pwg.categories.getList
pwg.categories.getAdminList
pwg.categories.add
pwg.categories.delete
pwg.categories.getImages
pwg.categories.setInfo
pwg.categories.move
pwg.categories.setRepresentative
pwg.images.setInfo
pwg.images.checkUpload
pwg.images.addChunk
pwg.images.add
pwg.images.resizeThumbnail
pwg.images.resizeWebsize
pwg.images.addSimple
pwg.images.delete
pwg.images.getInfo
pwg.images.addComment
pwg.images.setRank

Offline

 

#13 2013-05-21 05:55:40

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Refactor web service output json/xml for version 2.6

alloyphoto wrote:

Here is what's being used in the Piwigo Plugin for Adobe Lightroom:

Thanks alloy, I already commited the new code. FYI pwg.categories.getImages has slightly changed, but I believe the others are ok (not sure about addComment now that I read your list ...)

Offline

 
  •  » Engine
  •  » Refactor web service output json/xml for version 2.6

Board footer

Powered by FluxBB

github linkedin newsletter Piwigo.org © 2002-2026 · Contact