Skip to content

Commit d847f6f

Browse files
committed
rewrite of OC branch difference docs; updates #463
1 parent 5e516c2 commit d847f6f

File tree

6 files changed

+112
-60
lines changed

6 files changed

+112
-60
lines changed

okapi/services/caches/geocache/docs.xml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,16 @@
5858
<li><b>description</b> - inserts the OC team annotations into the
5959
description texts,</li>
6060
<li><b>separate</b> (recommended) - includes the <b>oc_team_annotation</b> field
61-
instead.</li>
61+
instead. You are REQUIRED to display its contents alongside with
62+
the owner's cache listing.</li>
6263
</ul>
63-
<p>Please note that you are REQUIRED to display OC team annotations
64-
alongside with the owner's cache listing. In this they differ from
65-
<i>OC team
66-
<a href="%OKAPI:methodargref:services/logs/entry%">log entries</a></i>,
67-
which will only be visible when logs are displayed.</p>
68-
<p>OC team annotations so far are only in use at OCPL-based sites.
69-
OCDE installations will ignore this parameter.</p>
64+
<p>OC team annotations are not to be confused with "OC Team comment"
65+
<a href='%OKAPI:methodargref:services/logs/entry%'>log entries</a>,
66+
which have a similar purpose, but need not to be visible with the cache
67+
description. OC team annotations will be deleted when obsolete, while
68+
the log entries usually will stay.</p>
69+
<p>Note that some OC installations do not implement team annotations. They will
70+
ignore this parameter.</p>
7071
</opt>
7172
<opt name='lpc' default='10'>
7273
Log-entries per cache - the number of logs returned in the <b>latest_logs</b> field.
@@ -153,7 +154,8 @@
153154
<ul>
154155
<li><b>Own</b>, a moving geocache which is carried by the owner,</li>
155156
<li><b>Podcast</b>, a geocache with attached MP3 file(s). The MP3
156-
data is not accessible via OKAPI.</li>
157+
data is not accessible via OKAPI. This type is only in use
158+
at Opencaching.US.</li>
157159
<li>(Types may be added or removed. Your application MUST be
158160
prepared for any new types and may handle them as "Other".)</li>
159161
</ul>
@@ -174,8 +176,8 @@
174176
known to be in poor condition, e.g. damaged. Usually there will be further
175177
explanations in the log entries.</p>
176178

177-
<p>Please note that only OCDE-based Opencaching installations provide this
178-
information. ODPL-based sites will always return <b>false</b> here.</p>
179+
<p>Please note that some Opencaching installations don't provide
180+
this information; they will always return <b>false</b>.</p>
179181
</li>
180182
<li><b>url</b> - URL of the cache's web page,</li>
181183
<li>
@@ -322,11 +324,13 @@
322324
overall rating of the cache, or <b>null</b> when the geocache does not have a
323325
sufficient amount of votes to have a rating.</p>
324326

325-
<p><b>Note:</b> Only OCPL-based Opencaching installations provide ratings for
326-
their geocaches. On OCDE-based installations, this field will always contain
327-
<b>null</b>.</p>
327+
<p><b>Note:</b> Some installations don't provide ratings for
328+
their geocaches; they will always return <b>null</b> for this
329+
field. The <b>has_ratings</b> field of
330+
<a href='%OKAPI:methodargref:services/caches/capabilities%'>services/caches/capabilities</a>
331+
tells if ratings are available.</p>
328332

329-
<p><b>Note:</b> Currently OCPL exposes cache ratings as integers only.
333+
<p><b>Note:</b> Currently OC sites expose cache ratings as integers only.
330334
OKAPI used floats here for forward-compatibility only. In other words, currently
331335
you can get 4.0 or 5.0 here, but not 4.5. This may change in the future though,
332336
without notice.</p>
@@ -335,16 +339,17 @@
335339
<p>%OKAPI:infotag:ocpl-specific% <b>rating_votes</b> - number of votes submitted
336340
for the rating of this cache.</p>
337341

338-
<p><b>Note:</b> Only OCPL-based Opencaching installations provide ratings for
339-
their geocaches. On OCDE-based installations, this field will always contain
340-
<b>0</b>.</p>
342+
<p><b>Note:</b> Some installations don't provide ratings for their geocaches;
343+
they will always return <b>0</b> for this field. The <b>has_ratings</b> field of
344+
<a href='%OKAPI:methodargref:services/caches/capabilities%'>services/caches/capabilities</a>
345+
tells if ratings are available.</p>
341346
</li>
342347
<li>
343348
<p>%OKAPI:infotag:ocpl-specific% <b>my_rating</b> - float (between 1 and 5),
344349
the rating the user gave for this cache; <b>null</b> if the user did not rate.</p>
345350
<p>This is private data. You will need Level 3 Authentication to access
346351
this field.</p>
347-
<p>See the notices on the <b>rating</b> field.</p>
352+
<p>See the notes on the <b>rating</b> field.</p>
348353
</li>
349354
<li><b>recommendations</b> - number of recommendations for this cache,</li>
350355
<li>
@@ -414,10 +419,10 @@
414419
</ul>
415420
</li>
416421
<li>
417-
<p>%OKAPI:infotag:ocde-specific% <b>preview_image</b> - On OCDE-based
422+
<p>%OKAPI:infotag:ocde-specific% <b>preview_image</b> - On some
418423
installations, owners may select one of the <b>images</b>
419424
(see above) as a preview image. You are encouraged to display it as a 'teaser'
420-
for this cache. On OCPL-based installations this functionality is disabled and you
425+
for this cache. On other installations this functionality is disabled and you
421426
will always get the <b>null</b> value here.</p>
422427

423428
<p>The value of <b>preview_image</b> is either <b>null</b> or a dictionary describing
@@ -443,7 +448,8 @@
443448
It will only partially respond to the <b>langpref</b> parameter and may
444449
contain an arbitrary mixture of languages and differently localized data
445450
(<a href='https://github.com/opencaching/okapi/issues/533'>why?</a>).
446-
OCDE installations currently will always return an empty string.</p>
451+
Some installations don't implement OC team annotations; they currently
452+
always return an empty string for this field.</p>
447453
</li>
448454
<li>
449455
<p><b>attribution_note</b> - the proper attribution note for the cache listing according
@@ -581,7 +587,7 @@
581587
<li>
582588
<b>date_created</b> - date and time (ISO 8601) when the
583589
geocache was listed at the Opencaching site. For OCDE-based installations
584-
this is the date when it was published, while for ODPL installations it is the
590+
this is the date when it was published, while for OCPL installations it is the
585591
date when it was originally submitted. These dates differ if the
586592
geocache is prepared and then published later.
587593
</li>

okapi/services/logs/edit/docs.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474
<opt name='rating' default='unchanged' infotags="ocpl-specific">
7575
<p>If the user rated the cache, the option <b>false</b> will withdraw
7676
that rating. Otherwise, it will be ignored (which includes
77-
installations that do not provide geocache ratings).</p>
77+
installations that do not provide geocache ratings; see the
78+
<b>has_ratings</b> field of
79+
<a href='%OKAPI:methodargref:services/caches/capabilities'>services/caches/capabilities</a>).</p>
7880
</opt>
7981
<opt name='langpref' default='en'>
8082
<p>Pipe-separated list of ISO 639-1 language codes. This indicates the

okapi/services/logs/entry/docs.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@
157157
state of the geocache listing.
158158
</li>
159159
</ul>
160-
<p>Please note that OCPL-based installations will always return <b>null</b> here.</p>
160+
<p>Please note that some OC installations do not implement this
161+
flag and will always return <b>null</b>.</p>
161162
</li>
162163
<li><b>comment</b> - <a href='%OKAPI:docurl:html%'>HTML string</a>, text entered
163164
with the log entry,

okapi/services/logs/submit/docs.xml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,18 @@
9595
<opt name='rating' infotags="ocpl-specific">
9696
<p>An integer in range between 1 and 5 - user's optional rating of a found cache.</p>
9797
<p>Important: <b>logtype</b> has to be "Found it" or "Attended" in order to use
98-
this argument.</p>
99-
<p>Note: You should allow your user to <b>not</b> rate a found cache.</p>
100-
<p>Note: Some OKAPI installations (OCDE codebase) currently do not support
101-
cache ratings. On such installations user's rating will be <b>ignored</b>
102-
(if you include the rating, log entry will be posted successfully, but
103-
rating will be ignored). The <b>can_rate</b> field of
98+
this argument. The rating may be rejected if the user already rated
99+
this cache. You may consult the <b>can_rate</b> field of
104100
<a href="%OKAPI:methodargref:services/logs/capabilities%">services/logs/capabilities</a>
105-
tells if <em>this</em> installation implements rating.</p>
101+
to find out if the rating will be accepted.</p>
102+
103+
<p>Note: You should allow your user to <b>not</b> rate a found cache.</p>
104+
<p>Note: Some OKAPI installations do not support cache ratings. On such
105+
installations user's rating will always be <i>ignored</i> (if you include
106+
the rating, log entry will be posted successfully, but rating will be
107+
ignored). The <b>has_ratings</b> field of
108+
<a href="%OKAPI:methodargref:services/caches/capabilities%">services/caches/capabilities</a>
109+
tells if ratings are avaialble at this installation.</p>
106110
</opt>
107111
<opt name='recommend' default='false'>
108112
<p>Set to <b>true</b> if the user wants to recommend this cache.</p>
@@ -148,7 +152,7 @@
148152
your user thinks that the cache's condition is fine.</p>
149153

150154
<p>Note: The <b>false</b> option currently is not evaluated by some
151-
installation (OCPL-based sites). They will just ignore it.</p>
155+
installations. They will just ignore it.</p>
152156
</li>
153157
</ul>
154158

okapi/static/common.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body.api { background: #f5f1eb; }
2020

2121
.infotag {
2222
display: inline-block;
23-
background: #d9534f;
23+
background: #5486b2;
2424
color: #fff !important;
2525
font-weight: normal;
2626
font-size: 68%;
@@ -63,6 +63,7 @@ a.infotag:hover {
6363
.article h1 .subh1 { font-size: 18px; font-weight: normal; color: #888; }
6464
.article h1 .subh1 b { font-weight: normal; color: #944; }
6565
.article h2 { clear: both; margin: 50px 0 10px 0; padding-top: 20px; font-weight: bold; font-style: italic; font-size: 22px; border-top: 2px dotted #aaf; }
66+
.article h3 { clear: both; margin: 20px 0 6px 0; font-weight: bold; font-style: italic; font-size: 18px }
6667
.article p { margin-bottom: 15px; }
6768
.article pre { margin-bottom: 15px; }
6869
.article ul { margin-bottom: 15px; margin-left: 35px; }

okapi/views/introduction/introduction.tpl.php

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -475,40 +475,78 @@
475475
<div class='issue-comments' issue_id='117'></div>
476476

477477

478-
<h2 id='oc-branch-differences'>Differences between OCPL and OCDE branches</h2>
478+
<h2>Differences between Opencaching installations</h2>
479479

480-
<p>Client developers should be aware that the are two primary Opencaching
481-
codebase branches. Some Opencaching installations are running the OCPL branch,
482-
some other are running the OCDE branch. (You can read more about this
483-
<a href='https://github.com/opencaching/opencaching-pl/wiki#brief-introduction-in-english'>here</a>.)</p>
480+
<p>Client developers should be aware that Opencaching sites provide different
481+
sets of features. E.g. Opencaching.US currently does not support OKAPI log
482+
image upload, and there is no geocache rating system at Opencaching.DE.
483+
OKAPI implements several mechanisms that either hide those differences -
484+
you don't need to care about them - or allows your application to automatically
485+
adjust to the Opencaching site's capabilities.</p>
484486

485-
<p>In general, <b>OKAPI supports both of these branches via exactly the same
486-
API interface</b>, so you don't have to worry about the internal differences.
487-
However, you should be aware of the fact, that some things work a bit different
488-
on one branch, than they on the other. (Like, for example, OCDE doesn't have a
489-
cache rating system, so whenever you ask for the <b>rating</b> field of a
490-
geocache, you will get <b>null</b>.)</p>
487+
<h3>OKAPI versions</h3>
491488

492-
<p>In order for you to easily notice methods, parameters and fields which are
493-
specific to only a single of these branches, we display the following "tags" in
494-
many places:</p>
489+
<p>Now and then, new features are added to OKAPI. They will be listed in the
490+
<a href="changelog.html">Changelog</a>, including version numbers. By comparing
491+
those numbers to the installation's current OKAPI version number, as returned by the
492+
<a href='%OKAPI:methodargref:services/apisrv/installation%'>services/apisrv/installation</a>
493+
method, applications can detect if a new feature is available.</p>
494+
495+
<h3 id='site-capabilities'>Site capabilities</h3>
496+
497+
<p>OKAPI methods generally are designed to abstract from differences between OC
498+
installations. E.g. if some geocache or log property is not implemented, OKAPI
499+
will return <i>null</i> or <i>false</i> (as explained in the method docs).
500+
When submitting data, unsupported options are mostly ignored (as documented),
501+
or OKAPI will return an HTTP 200 result with the <i>success</i>=<i>false</i>
502+
field and a user-friendly explanation (as documented).</p>
503+
504+
<p>However, when searching for caches or submitting content, there are a few
505+
exceptions where this can't be done. The docs then will refer to one of the
506+
following methods, that your application can call to find out what features
507+
are available:</p>
495508

496509
<ul>
497-
<li><span class='infotag infotag-ocpl-specific'>OCPL</span> - indicates
498-
that a certain method, parameter or field was designed specificly for
499-
OCPL-based Opencaching sites,</li>
510+
<li><a href='services/attrs/attribute_index.html'>services/attrs/attribute_index</a>
511+
- list of available cache attributes,</li>
512+
<li><a href='services/caches/capabilities.html'>services/caches/capabilities</a>
513+
- geocache capabilities,</li>
514+
<li><a href='services/logs/capabilities.html'>services/logs/capabilities</a>
515+
- logging capabilities, including the submission of cache
516+
recommendations and ratings.</li>
517+
</ul>
518+
519+
<p>This methods also return additional information, that allows to hide
520+
nonfunctional features from user interfaces. E.g. you may want to disable
521+
searching for geocaches by rating, if OKAPI will ignore the user's input
522+
(because the OC site does not implement rating).</p>
523+
524+
<h3></h3>
525+
526+
<h3 id='oc-branch-differences'>Branch tags</h3>
500527

501-
<li><span class='infotag infotag-ocde-specific'>OCDE</span> - indicates
502-
that a certain method, parameter or field was designed specificly for
503-
OCDE-based Opencaching sites.</li>
528+
<p>Throughout the OKAPI documentation, you will encounter options and fields
529+
that are tagged as "OCPL" or "OCDE". These tags have the following meaning:</p>
530+
531+
<ul>
532+
<li>
533+
<span class='infotag infotag-ocde-specific'>OCDE</span> - This feature
534+
currently is only in use at Opencaching sites that are based on the
535+
OCDE software branch (currently Opencaching.DE/IT/FR). If your
536+
application is NOT intended to be used with those sites, you may want
537+
to skip this feature and not implement it.
538+
</li>
539+
<li>
540+
<span class='infotag infotag-ocpl-specific'>OCPL</span> - This feature
541+
currently is only in use at Opencaching sites that are based on the
542+
OCPL software branch (currently Opencaching.PL, NL, US, UK, RO). If
543+
your application is NOT intended to be used with those sites, you
544+
may want to skip this feature and not implement it.
545+
</li>
504546
</ul>
505547

506-
<p>Please note, that <b>you still MAY use all such "marked" methods, parameters
507-
and fields on ALL OKAPI sites.</b> Our methods are designed in such a way that,
508-
even if they are not supported by the underlying Opencaching site, they still
509-
won't throw errors, etc. At worst, they will "fail silently", or return empty
510-
results. All these differences should be described in detail in the
511-
documentation of the affected methods, parameters and fields.</p>
548+
<p>In all other cases, you are recommended to ignore the branch tags. See above
549+
for more information on differences between Opencaching sites.</p>
512550

513551
<p>If you have any questions about this, then ask them
514552
<a href="https://github.com/opencaching/okapi/issues/463">here</a>.</p>

0 commit comments

Comments
 (0)