Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OCDE "needs maintenance" flags/status #373

Closed
following5 opened this issue Feb 26, 2016 · 12 comments
Closed

Add OCDE "needs maintenance" flags/status #373

following5 opened this issue Feb 26, 2016 · 12 comments

Comments

@following5
Copy link
Contributor

@following5 following5 commented Feb 26, 2016

Opencaching.de will soon add the feature to submit the flags "geocache needs maintenance" and "geocache listing is outdated" when logging a cache. This will set the new geocache properties "needs maintenance since" and "listing is outdated since" to an appropriate date, or reset them to null.

Adding this properly to OKAPI will need lots of detail solutions and bells & whistles. (Maybe I can simplify it by moving some common code into database trigger functions). I think it is easiest if I do a sample implementation.

@wrygiel

This comment has been minimized.

Copy link
Member

@wrygiel wrygiel commented Feb 26, 2016

Note, that "needs maintenance" is already implemented (see the submit method), because we have a similar feature in OCPL. However, I'm not sure if it's compatible.

@following5

This comment has been minimized.

Copy link
Contributor Author

@following5 following5 commented Feb 26, 2016

It's somewhat different. OCPL has a log type "needs maintenance", while I have added a flag "needs mantainence" to OCDE which can be combined with different log types. This makes both the impementation as well as submitting NM logs simpler. There is some small intersection of both which can be implemented.

I have just overhauled the OCDE implementation, which simplifys the OKAPI implementation.

@following5

This comment has been minimized.

Copy link
Contributor Author

@following5 following5 commented Feb 26, 2016

Oh wait, I misunderstood what you wrote. Yes, the OKAPI needs_maintenance option for submitting logs perfectly matches the OCDE implementation. Unfortuntately, it was not implemented in the log entry retrieval method - the current OKAPI implementation is asymmetric. But this will change now.

@following5

This comment has been minimized.

Copy link
Contributor Author

@following5 following5 commented Feb 26, 2016

I should read everything more carefully. The OKAPI needs_maintenance option is just two-state, while OCDE wants to do it three-state. And the concept may not be stable yet, so I will slow down this issue.

@wrygiel

This comment has been minimized.

Copy link
Member

@wrygiel wrygiel commented Feb 26, 2016

Depending on the number and mutability of flags, perhaps it's worth to consider exposing an API for a dynamic set of flags. That is, one method to retrieve all the available flags and their possible states, another method to set them.

@following5

This comment has been minimized.

Copy link
Contributor Author

@following5 following5 commented Feb 26, 2016

This sounds promising. But it can grow out to a huge job. E.g. the next logging options at OCDE won't be flags but coordinates and multiple-choice things, and that API may be designed also to query which options and fields are availabe for which cache types, log types and OC nodes (not just for logging cache properties).

I would like to start with a minimal solution for issue #373 and just add two things:

  • a new submit-log-field which allows to reset the OCDE needs-maintenance geocache flag
  • displaying the NM and LO state of caches to the users somehow; a red text line inserted at the top of descriptions may be sufficient.
@wrygiel

This comment has been minimized.

Copy link
Member

@wrygiel wrygiel commented Feb 26, 2016

But it can grow out to a huge job.

That's true. This would require multiple types of fields, server-side validation of all user input etc.

@following5

This comment has been minimized.

Copy link
Contributor Author

@following5 following5 commented Mar 1, 2016

The differences between implementations are:

  • OCPL has a log type "needs maintenance" (like GC), while OCDE has a log flag "needs maintenance" which can be combined with different log types (like OKAPI).
  • OCPL shows NM only to the logger and the cache owner, while OCDE shows NM logs to everyone (like OKAPI, which may be wrong for OCPL sites).
  • OCDE has a geocache flag "needs maintenance" (like GC, which stores it as attribute 42 - THE ANSWER :), while OCPL has not.
@following5

This comment has been minimized.

Copy link
Contributor Author

@following5 following5 commented Mar 2, 2016

I have implemented it in this branch: https://github.com/following5/okapi/commits/ocde-maintenance-states. There are three changes to the interface, which are all related to the OCDE
"needs maintenance" feature:

  • new option needs_maintenance=clear for logs/submit
  • new field needs_maintenance for logs/entries
  • new field needs_maintenance for cache/geocaches

The OC.de change will go online in a few days. It won't break anything technical if it is missing in OKAPI, but the "listing is outdated" information in the geocache descriptions should be available asap, and I have already talked to a c:geo developer regarding support for needs-maintenance logs.

Now I will setup OCPL code on my new developer VM (didn't run on the old one due to PDO) so that I can test this for OCPL.

@following5

This comment has been minimized.

Copy link
Contributor Author

@following5 following5 commented Mar 4, 2016

Works fine on OCPL site.

@following5 following5 changed the title Add OCDE "needs maintenance" and "listing is outdated" flags/status Add OCDE "needs maintenance" flags/status Mar 8, 2016
@wrygiel

This comment has been minimized.

Copy link
Member

@wrygiel wrygiel commented Mar 10, 2016

(in reply to #378 (comment))

I have named the NM options "yes", "no" and "null" because this avoids errors when migrating from logs/subit needs_maintenance. Ok?

We haven't used "yes" and "no" in OKAPI before. I don't see how they would help here. Of course, the meaning of false in needs_maintenance and needs_maintenance2 will be different, but developers will be warned on this difference (also they will be investigating why needs_maintenance2 has been introduced in the first place).

@wrygiel

This comment has been minimized.

Copy link
Member

@wrygiel wrygiel commented Mar 10, 2016

Created a shared pull request for this. We can both add commits to this branch: #380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.