Hi there,

I want to build a queue system to edit a specific drupal node. There should be a que for the people who want to point the telescop. For example I click on "point the telescope" link, a counter says 6 minutes later you'll have the control. After that time it says ok, you have five minutes to use it.

any ideas? where to start?


keremito’s picture

1- I've created a new content type with required fields. For example, to point a telescope, two integer fields for altitude and azimuth angles. I've create a content of this type.
2- A flag set to be used only for this content.
3- An operatör role was created.
4- A views is created listing user who hold the flag: "I want to control".
5- A VBO field created in this views: "Bulk operations: User"
6- With Rules, I've developed algorithms for the following cases: flag, unflag, cron execution. All rules set up is attached as images. (I've used scheduled action after cron execution, to guarantee the minimum control time)
7- Cron will manage the queue, so with crontab it should work very often. (For cron settings: https://drupal.org/cron and to avoid performance problems: with https://drupal.org/project/elysia_cron we can set only rules actions to be performed every cron)
8- With https://drupal.org/project/refresh every 10 seconds my control page will be refreshed. There is a flag and the queue list under the main content. So I can get in the queue, follow it as it refreshes, and when the time comes, can see the edit link in my page as the operator.

Control page: https://groups.drupal.org/files/liste.png
Rules main page: https://groups.drupal.org/files/rules-s%C4%B1ra.png
Flag when nobody in the queue: https://groups.drupal.org/files/s%C4%B1rada-kimse-yoksa.png
Flag when other in the queue: https://groups.drupal.org/files/s%C4%B1rada-birileri-varsa.png
Make the second in queue operator, when operator unflags: https://groups.drupal.org/files/unflag-1.png
Drop the operator role, when operator unflags: https://groups.drupal.org/files/unflag-2.png
Cron every minute: https://groups.drupal.org/files/dakikada-bir.png
Scheduled action of the cron: https://groups.drupal.org/files/dakikada-bir-2.png