ClickPackageIndex

Differences between revisions 20 and 21
Revision 20 as of 2013-07-16 11:46:35
Size: 12638
Editor: sixtymilesmilew
Comment:
Revision 21 as of 2013-07-16 11:51:46
Size: 12638
Editor: sixtymilesmilew
Comment:
Deletions are marked like this. Additions are marked like this.
Line 40: Line 40:
|| title_''lang'' || text_''lang''|| false || true || true || true || true || Display name, as presented in menus. ||
|| description_''lang'' || text_''lang''|| false || true || true || true || true || Full description of the app's functionality. ||
|| version || string || false || true || true || true || false || ||
|| click_version || string || false || true || true || true || false || ||
|| framework || string || true || true || true || true || false || ||
|| license || text_general || false || true || true || true || false || License under which the software is made available. ||
|| download_url || url || false || false || true || true || false || ||
|| title_''lang'' || text_''lang''|| false || true || true || true (en) || true || Display name, as presented in menus. ||
|| description_''lang'' || text_''lang''|| false || true || true || true (en) || true || Full description of the app's functionality. ||
|| text_''lang'' || text_''lang''|| true || true || false || false || true || Default searchable field containing tokens from title, description and keywords. ||
Line 50: Line 56:
|| license || text_general || false || true || true || true || false || License under which the software is made available. ||
Line 55: Line 60:
|| version || string || false || true || true || true || false || ||
Line 61: Line 65:
|| click_version || string || false || true || true || true || false || ||
|| framework || string || true || true || true || true || false || ||
|| download_url || url || false || false || true || true || false || ||
Line 65: Line 66:
|| text_''lang'' || text_''lang''|| true || true || false || false || true || Default searchable field containing tokens from title, description and keywords. ||

Click Package Index

Contact: James Tait (JamesTait)

  • Solr-backed repository for Click Application metadata
  • Public front-end will serve as access control, apply sane defaults and massage request and response for ease of use.
  • Interfaces with:
    • Software Centre Agent
      • App developer defines app in Software Centre website
      • App developer uploads packaged app
      • Software Centre Agent pushes metadata to Click Package Index
        • First iteration, metadata is entered by developer
        • Later to be harvested from Click Manifest
    • Dash
      • "Surfacing", i.e. first view of app lens before querying
      • "Search", i.e. list of apps that match search criteria
      • "Detail", i.e. full metadata for a given app

Solr Schema

Field Types

Name

Class

Notes

string

solr.StrField

Untokenised text.

boolean

solr.BoolField

True or False.

float

solr.TrieFloatField

Floating point number.

long

solr.TrieLongField

Long integer.

date

solr.TrieDateField

Date of the format 'YYYY-MM-DD"T"hh24:mm:ss[.nnn]"Z"', e.g. '2013-06-27T12:39:45.776Z'

url

solr.StrField

Untokenised text.

text_general

solr.TextField

Tokenised text. Reasonable cross-language defaults. StandardTokenizer, case-insensitive stop words, and down-casing. Query-time synonyms.

text_lang

solr.TextField

Localised tokenised text. StandardTokenizer, case-insensitive stop words, down-casing, protected words and minimal stemming. Query-time synonyms. See Localisation below.

key_value

solr.TextField

Key-value pair, i.e. 'key|value'.

Fields

Name

Type

Multi-value

Searchable

Retrievable

Required

Translatable

Notes

name

string

false

true

true

true

false

e.g. org.example.my_app

version

string

false

true

true

true

false

click_version

string

false

true

true

true

false

framework

string

true

true

true

true

false

license

text_general

false

true

true

true

false

License under which the software is made available.

download_url

url

false

false

true

true

false

title_lang

text_lang

false

true

true

true (en)

true

Display name, as presented in menus.

description_lang

text_lang

false

true

true

true (en)

true

Full description of the app's functionality.

text_lang

text_lang

true

true

false

false

true

Default searchable field containing tokens from title, description and keywords.

price

float

false

true

true

false

true (currencies)

binary_filesize

long

false

false

true

false

false

Size of the downloadable package, in bytes.

icon_url

url

false

false

true

false

false

URL to a 64x64px PNG image to use as an application icon, e.g. in menus.

icon_urls

string

true

true

true

false

false

List of delimited strings in the format ${size}|${url} describing URLs to square PNG icons of various sizes.

screenshot_url

url

false

false

true

false

false

URL to a screen shot.

screenshot_urls

url

true

false

true

false

false

List of URLs to other screenshots.

terms_of_service_lang

url

false

false

true

false

true

URL to localised ToS.

support_url_lang

url

false

false

true

false

true

URL to localised support channel.

date_published

date

false

true

true

false

false

Date of publication.

video_urls

url

true

false

true

false

false

license_key_path

string

false

false

true

false

false

requires_license_key

boolean

false

true

true

false

false

website_lang

url

false

false

true

false

true

company_name

text_general

false

true

true

false

false

keywords_lang

text_lang

true

true

true

false

true

main_categories

string

true

true

true

false

false

See the freedesktop.org Desktop Menu Specification

additional_categories

string

true

true

true

false

false

See the freedesktop.org Desktop Menu Specification

countries_to_distribute

string

true

true

false

false

false

Localisation

Fields marked as translatable will have localised variants whose field name is suffixed with one of the following country codes:

Suffix

Language

ar

Arabic

bg

Bulgarian

ca

Catalan

cn

Chinese

cz

Czech

da

Danish

de

German

el

Greek

en

English

es

Spanish

eu

Basque

fa

Persian

fi

Finnish

fr

French

ga

Irish

gl

Galician

hi

Hindi

hu

Hungarian

hy

Armenian

id

Indonesian

it

Italian

ja

Japanese

kr

Korean

lv

Latvian

nl

Dutch

no

Norwegian

pt

Portuguese

ro

Romanian

ru

Russian

sv

Swedish

th

Thai

tr

Turkish

For queries:

  • If the query specifies a localisation (e.g. q=description_en:foo), we will use it.

  • Similarly, if a specific localised result field is requested (e.g. fl=description_en), we will use it.

  • In the general case, clients should use the non-localised field name in queries (q=description) and result fields (fl=description) and provide an Accept-Language header, which we will use to choose the localised variant.

  • If the request specifies an alternative localisation via the lang query parameter (e.g. lang=en) we will use that in preference to the language in the Accept-Language header.

  • If the request specifies a localisation which is unavailable, the English localisation will be returned.

This keeps the query API flexible, but avoids unnecessary complexity in the client for the general case. We'll need to be wary of caching, in particular - Vary: Accept-Language and ETag headers will be required at least.

API

Guiding principles:

  • JSON-based
  • Discoverable
  • Browseable

API Root

/api/v1

Provides clickable links to the other endpoints for discoverability.

Request

GET /api/v1 HTTP/1.1
Host: search.apps.ubuntu.com

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
    "search": "http://search.apps.ubuntu.com/api/v1/search",
    "package": "http://search.apps.ubuntu.com/api/v1/package"
}

/api/v1/search

Proxies requests to Solr's SearchHandler. A subset of the standard Solr syntax is used for querying. Clients should indicate the desired localisation as described in Localisation.

Request

GET /api/v1/search?q=description:rubbish&fl=name,title,description,price,icon_url HTTP/1.1
Host: search.apps.ubuntu.com
Accept-Language: en

Response

HTTP/1.1 204 No Content
Vary: Accept-Language

Request

GET /api/v1/search?q=framework:ubuntu-sdk-13.10,description:awesome HTTP/1.1
Host: search.apps.ubuntu.com
Accept-Language: en

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Vary: Accept-Language
ETag: abc123

[
  {
    "name": "org.example.awesomelauncher",
    "title": "Awesome Launcher",
    "description": "This is an awesome launcher.",
    "price": 1.99,
    "icon_url": "http://example.org/media/awesomelauncher/icons/icon16.png",
    "resource_url": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher"
  },
  {
    "name": "org.example.awesomewidget",
    "title": "Awesome Widget",
    "description": "This is an awesome widget.",
    "price": 1.99,
    "icon_url": "http://example.org/media/awesomewidget/icons/icon16.png",
    "resource_url": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomewidget"
  }
]

Details

/api/v1/package

Requests details for a specific package. Cleans the query string to ensure the user cannot be tricked into installing the wrong package, and enforces a single item in the response.

Request

GET /api/v1/package/org.example.awesomewidget?fl=name,title,description,price,icon_url HTTP/1.1
Host: search.apps.ubuntu.com
Accept-Language: en

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Vary: Accept-Language
ETag: xyz987

{
  "name": "org.example.awesomewidget",
  "title": "Awesome Widget",
  "description": "This is an awesome widget.",
  "price": 1.99,
  "icon_url": "http://example.org/media/awesomewidget/icons/icon16.png",
}

Request

GET /api/v1/package/org.example.awesomewidget?fl=name,title,description,price,icon_url HTTP/1.1
Host: search.apps.ubuntu.com
Accept-Language: en
If-None-Match: xyz987

Response

HTTP/1.1 304 Not Modified
Vary: Accept-Language
ETag: xyz987
Date: Thu, 04 Jul 2013 18:44:24 BST

AppStore/Interfaces/ClickPackageIndex (last edited 2018-04-01 09:09:46 by popey)