Hello there!
Thank you for your wonderful plugin.
I'm trying to update with Piwigo webservices the value added from your plugin (in table _images, value is_sphere).
I tried with the service pwg.images.setInfo but the field is_sphere is not recognized.
I don't know if I have to use the service pwg.plugins.performAction, but in this case, I don't know the first parameter. They are (action, plugin, pwg_token).
Can you help me or suggest me a solution?
Because when I add a new image through webservice, the field is_sphere is 0 by default.
Now it works as I would!
Can you modify the original function php in order to do that in the next update?
Thank you!
Hello there!
Thank you for your wonderful plugin.
I'm trying to update with Piwigo webservices the value added from your plugin (in table _images, value is_sphere).
I tried with the service pwg.images.setInfo but the field is_sphere is not recognized.
I don't know if I have to use the service pwg.plugins.performAction, but in this case, I don't know the first parameter. They are (action, plugin, pwg_token).
Can you help me or suggest me a solution?
Because when I add a new image through webservice, the field is_sphere is 0 by default.
I've modified as follow:
```
$info_columns = array(
'name',
'author',
'comment',
'date_creation',
'is_sphere',
);
```
Now it works as I would!
Can you modify the original function php in order to do that in the next update?
Thank you!
<!-- github-sync-id:209543085 -->
I will reformulate : this request is about allowing plugins to expose more image properties updatable via pwg.images.setInfo.
I will reformulate : this request is about allowing plugins to expose more image properties updatable via `pwg.images.setInfo`.
<!-- github-comment-id:281913917 -->
@plegall I looked a bit a this to integrate it in the PhotoSphere plugin and I see two possibilities :
add a trigger_change to allow plugins to modify $info_columns, this would work for most cases for simple columns
add a trigger_notify at the end of the method to allow plugins to make arbitrary updates, this is more flexible, but in case a simple updates would require two or more SQL updates.
In both cases the ws.htm file won't be updated, unless adding adding yet another trigger for the reflection method.
@plegall I looked a bit a this to integrate it in the PhotoSphere plugin and I see two possibilities :
1. add a trigger_change to allow plugins to modify `$info_columns`, this would work for most cases for simple columns
2. add a trigger_notify at the end of the method to allow plugins to make arbitrary updates, this is more flexible, but in case a simple updates would require two or more SQL updates.
In both cases the ws.htm file won't be updated, unless adding adding yet another trigger for the reflection method.
<!-- github-comment-id:2322112027 -->
The Batch Manager Unit Mode is under heavy redesign in Piwigo 15. Instead of a big POST request with all photos at once, it's going to be (already in 15beta2) one call to pwg.images.setInfo for each photo. And we want it to be "extendable". @marsooooo is working on this subject and he may have some thougts to share.
The Batch Manager Unit Mode is under heavy redesign in Piwigo 15. Instead of a big POST request with all photos at once, it's going to be (already in 15beta2) one call to `pwg.images.setInfo` for each photo. And we want it to be "extendable". @marsooooo is working on this subject and he may have some thougts to share.
<!-- github-comment-id:2322215295 -->
I am currently working on the Skeleton plugin to showcase new ways to validate extension fields in Batch Manager Unit Mode. An update should be available early next week.
The idea behind the redesign is to give collaborators more freedom in how they implement new functionalities based on their needs. Moving away from the old POST request was necessary because now you can validate your changes one picture at a time, dynamically.
For the Batch Manager Unit Mode, the idea is for an extension to inject its template and functions directly into the page. When validating a picture, the core calls each extension's JavaScript functions named batchManagerSave_[pluginID] , which then call the assigned API method. For example, in the Skeleton plugin, I've been working on a method called skeleton.setInfo that updates the skeleton field in the piwigo_images table.
A performance question remains since this method would result in many API calls during large-scale validations. However, the initial tests I've conducted suggest that this should not cause any issues, given how optimized Piwigo's core is today.
I am currently working on the Skeleton plugin to showcase new ways to validate extension fields in Batch Manager Unit Mode. An update should be available early next week.
The idea behind the redesign is to give collaborators more freedom in how they implement new functionalities based on their needs. Moving away from the old POST request was necessary because now you can validate your changes one picture at a time, dynamically.
For the Batch Manager Unit Mode, the idea is for an extension to inject its template and functions directly into the page. When validating a picture, the core calls each extension's JavaScript functions named `batchManagerSave_[pluginID]` , which then call the assigned API method. For example, in the Skeleton plugin, I've been working on a method called `skeleton.setInfo` that updates the skeleton field in the `piwigo_images` table.
A performance question remains since this method would result in many API calls during large-scale validations. However, the initial tests I've conducted suggest that this should not cause any issues, given how optimized Piwigo's core is today.
<!-- github-comment-id:2322299495 -->
Does that mean if I have OSM, PhotoSphere and Gvideo plugins enabled, it would make 4 requests by image ?
That's really not ideal, Piwigo itself might be optimized, but you potentially put a big load on the SQL server.
Another possibility (after the two I gave earlier, whose have the same "problem") is a trigger_change acting on the $update variable, than way any plugin can hook just before the SQL update is performed.
Anyway, looking forward for Pwg 15 :)
Does that mean if I have OSM, PhotoSphere and Gvideo plugins enabled, it would make 4 requests by image ?
That's really not ideal, Piwigo itself might be optimized, but you potentially put a big load on the SQL server.
Another possibility (after the two I gave earlier, whose have the same "problem") is a trigger_change acting on the $update variable, than way any plugin can hook just before the SQL update is performed.
---
Anyway, looking forward for Pwg 15 :)
<!-- github-comment-id:2323491875 -->
Having successive SQL requests will not cause performance issues. We've tested both our lower end and high performance servers and none of them ever exceeded 1ms per request (except low end on wake up requests only) with databases of up to five hundred thousand pictures.
Although, the real performance issue might be the multiple HTTP requests made by the Ajax calls, even if we know that the core can handle a lot of requests, it's indeed still far from optimal. We've decided that we'd use the ws_invoke_allowed event handler (also used for the recently updated skeleton_ws_users_setInfo in skeleton) as a 2nd extensibility option for pwg.images.setInfo. It will allow extensions to register a field to the API call which will keep the amount of both HTTP and SQL requests as low as possible. We will keep the method I previously mentioned available since these options (either this event handler or the possible trigger you've mentionned) only covers plugins using the piwigo_images table.
Having successive SQL requests will not cause performance issues. We've tested both our lower end and high performance servers and none of them ever exceeded 1ms per request (except low end on wake up requests only) with databases of up to five hundred thousand pictures.
```
Bigger CPU :
MariaDB [base_vniiqsbbd4]> update images set author='test' where id=575026;
Query OK, 1 row affected (0.000 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [base_vniiqsbbd4]> update images set author=null where id=575026;
Query OK, 1 row affected (0.000 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [base_vniiqsbbd4]> update images set comment='test desc' where id=575026;
Query OK, 1 row affected (0.000 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [base_vniiqsbbd4]> update images set comment=null where id=575026;
Query OK, 1 row affected (0.000 sec)
Rows matched: 1 Changed: 1 Warnings: 0
Smaller CPU :
MariaDB [base_3tnbp3308p]> update images set comment='test desc' where id=336393;
Query OK, 1 row affected (0.016 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [base_3tnbp3308p]> update images set comment=null where id=336393;
Query OK, 1 row affected (0.000 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [base_3tnbp3308p]> update images set comment='test desc' where id=336393;
Query OK, 1 row affected (0.001 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [base_3tnbp3308p]> update images set comment=null where id=336393;
Query OK, 1 row affected (0.001 sec)
Rows matched: 1 Changed: 1 Warnings: 0
```
Although, the real performance issue might be the multiple HTTP requests made by the Ajax calls, even if we know that the core can handle a lot of requests, it's indeed still far from optimal. We've decided that we'd use the `ws_invoke_allowed` event handler (also used for the recently updated `skeleton_ws_users_setInfo` in skeleton) as a 2nd extensibility option for `pwg.images.setInfo`. It will allow extensions to register a field to the API call which will keep the amount of both HTTP and SQL requests as low as possible. We will keep the method I previously mentioned available since these options (either this event handler or the possible trigger you've mentionned) only covers plugins using the `piwigo_images` table.
<!-- github-comment-id:2324489438 -->
In the end, the most complicated is not to deal with extra parameters sent during the call to pwg.images.setInfo but to be able to add the extra parameters to the API call in javascript. In my opinion, this is the main problem we should focus on if we want to make a page like Batch Manager Unit Mode extensible (or User Manager, exact same situation)
In the end, the most complicated is not to deal with extra parameters sent during the call to `pwg.images.setInfo` but to be able to add the extra parameters to the API call in javascript. In my opinion, this is the main problem we should focus on if we want to make a page like Batch Manager Unit Mode extensible (or User Manager, exact same situation)
<!-- github-comment-id:2325256300 -->
As seen in previous comments, you can already interact with existing API methods. The second concern was the extensibility of the batch manager unit mode so that, for example, when a user saves changes, it also takes fields added by plugins (this has been added in Piwigo 15).
As seen in previous comments, you can already interact with existing API methods. The second concern was the extensibility of the batch manager unit mode so that, for example, when a user saves changes, it also takes fields added by plugins (this has been added in Piwigo 15).
<!-- github-comment-id:3052666927 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hello there!
Thank you for your wonderful plugin.
I'm trying to update with Piwigo webservices the value added from your plugin (in table _images, value is_sphere).
I tried with the service pwg.images.setInfo but the field is_sphere is not recognized.
I don't know if I have to use the service pwg.plugins.performAction, but in this case, I don't know the first parameter. They are (action, plugin, pwg_token).
Can you help me or suggest me a solution?
Because when I add a new image through webservice, the field is_sphere is 0 by default.
I've modified as follow:
Now it works as I would!
Can you modify the original function php in order to do that in the next update?
Thank you!
I will reformulate : this request is about allowing plugins to expose more image properties updatable via
pwg.images.setInfo.Thank you for changing the title!
@plegall I looked a bit a this to integrate it in the PhotoSphere plugin and I see two possibilities :
$info_columns, this would work for most cases for simple columnsIn both cases the ws.htm file won't be updated, unless adding adding yet another trigger for the reflection method.
The Batch Manager Unit Mode is under heavy redesign in Piwigo 15. Instead of a big POST request with all photos at once, it's going to be (already in 15beta2) one call to
pwg.images.setInfofor each photo. And we want it to be "extendable". @marsooooo is working on this subject and he may have some thougts to share.I am currently working on the Skeleton plugin to showcase new ways to validate extension fields in Batch Manager Unit Mode. An update should be available early next week.
The idea behind the redesign is to give collaborators more freedom in how they implement new functionalities based on their needs. Moving away from the old POST request was necessary because now you can validate your changes one picture at a time, dynamically.
For the Batch Manager Unit Mode, the idea is for an extension to inject its template and functions directly into the page. When validating a picture, the core calls each extension's JavaScript functions named
batchManagerSave_[pluginID], which then call the assigned API method. For example, in the Skeleton plugin, I've been working on a method calledskeleton.setInfothat updates the skeleton field in thepiwigo_imagestable.A performance question remains since this method would result in many API calls during large-scale validations. However, the initial tests I've conducted suggest that this should not cause any issues, given how optimized Piwigo's core is today.
Does that mean if I have OSM, PhotoSphere and Gvideo plugins enabled, it would make 4 requests by image ?
That's really not ideal, Piwigo itself might be optimized, but you potentially put a big load on the SQL server.
Another possibility (after the two I gave earlier, whose have the same "problem") is a trigger_change acting on the $update variable, than way any plugin can hook just before the SQL update is performed.
Anyway, looking forward for Pwg 15 :)
Having successive SQL requests will not cause performance issues. We've tested both our lower end and high performance servers and none of them ever exceeded 1ms per request (except low end on wake up requests only) with databases of up to five hundred thousand pictures.
Although, the real performance issue might be the multiple HTTP requests made by the Ajax calls, even if we know that the core can handle a lot of requests, it's indeed still far from optimal. We've decided that we'd use the
ws_invoke_allowedevent handler (also used for the recently updatedskeleton_ws_users_setInfoin skeleton) as a 2nd extensibility option forpwg.images.setInfo. It will allow extensions to register a field to the API call which will keep the amount of both HTTP and SQL requests as low as possible. We will keep the method I previously mentioned available since these options (either this event handler or the possible trigger you've mentionned) only covers plugins using thepiwigo_imagestable.Just to give an actual example of use of
ws_invoke_allowed, in plugin AddUsersNotes:You can do pretty much anything in here. Working on
USER_INFOS_TABLEbut not only. Plugin Prepaid Credits also works withws_invoke_allowed:In the end, the most complicated is not to deal with extra parameters sent during the call to
pwg.images.setInfobut to be able to add the extra parameters to the API call in javascript. In my opinion, this is the main problem we should focus on if we want to make a page like Batch Manager Unit Mode extensible (or User Manager, exact same situation)As seen in previous comments, you can already interact with existing API methods. The second concern was the extensibility of the batch manager unit mode so that, for example, when a user saves changes, it also takes fields added by plugins (this has been added in Piwigo 15).