src/cm/templates/api_doc.html
author Yves-Marie Haussonne <ymh.work+github@gmail.com>
Fri, 09 May 2014 18:35:26 +0200
changeset 656 a84519031134
parent 298 f6dab88267b7
permissions -rw-r--r--
add link to "privacy policy" in the header test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
287
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     1
{% extends "site/layout/base_workspace.html" %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     2
{% load com %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     3
{% load i18n %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     4
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     5
{% block title %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     6
{% blocktrans %}API Documentation{% endblocktrans %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     7
{% endblock %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     8
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
     9
{% block head %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    10
{% endblock %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    11
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    12
{% block content %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    13
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    14
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    15
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    16
  <style type="text/css" media="screen">
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    17
a.reflink {
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    18
color:#C60F0F;
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    19
font-size:0.8em;
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    20
padding:0 4px;
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    21
text-decoration:none;
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    22
visibility:hidden;
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    23
}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    24
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    25
:hover > a.reflink {
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    26
visibility:visible;
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    27
}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    28
  </style>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    29
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    30
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    31
<h1>API Documentation</h1>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    32
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    33
<h2>Presentation</h2>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    34
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    35
The API exposes method for external application to deal with content store in COMT.
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    36
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    37
The authentification is done using <a href="http://fr.wikipedia.org/wiki/HTTP_Authentification">HTTP Authentification</a>.
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    38
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    39
The default return format is 'json', add '?format=other_format' where other_format is 'json', 'xml', 'yaml' to change the results' format. 
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    40
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    41
		{% regroup docs by type as grouped_docs %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    42
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    43
		
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    44
		{% for dd in grouped_docs %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    45
			<h2>{{ dd.grouper }}</h2>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    46
		    {% for doc in dd.list %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    47
			{% if not doc.handler.no_display %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    48
			<h3>{{ doc.handler.title }}&nbsp;<a href="#{{ doc.handler.title|iriencode }}" class="reflink" title="Permalink" name="{{ doc.handler.title|iriencode }}">ΒΆ</a></h3>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    49
			
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    50
			<p>{{ doc.handler.desc }}</p>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    51
			<p>
298
f6dab88267b7 cleanup unused 'markup' template tag lib usage
raph
parents: 287
diff changeset
    52
				{{ doc.doc|default:"" }}
287
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    53
			</p>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    54
			
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    55
			<p>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    56
				Endpoint: <b>{{ doc.handler.endpoint }}</b>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    57
			</p>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    58
			
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    59
			<p>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    60
				Method: {% for meth in doc.allowed_methods %}<b>{{ meth }}</b>{% if not forloop.last %}, {% endif %}{% endfor %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    61
			</p>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    62
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    63
			<p>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    64
				Args: {% if doc.handler.args %}{{ doc.handler.args|safe }}{% else %}None{% endif %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    65
			</p>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    66
			
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    67
					
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    68
			<br />		
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    69
			{% endif %}		
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    70
			{% endfor %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    71
		{% endfor %}
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    72
	</body>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    73
</html>
fc5ed157ebfe add api: basic auth / unit tests / online doc (based on django-piston)
raph
parents:
diff changeset
    74
{% endblock %}