The marketplace listing for an app, theme, recipe or library: the name it is installed by, the blurb and images shown on its listing page, and the versions of it which have been published. Each listing wraps exactly one app repository, and its name is the name accounts install it by, so it must not be reused. Publishing snapshots the repository's live branch and commit into a MarketPlacePublishedItem, so an account installs a fixed published version rather than whatever the repository happens to hold now, and each published version records which clusters it is allowed on. Which accounts can see the listing at all is controlled by the availability mode, and whether it is listed publicly at all by the published flag.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| appRatings | List<AppRating> | The reviews left for this item, each with a star rating, the reviewer, and the branch and commit which was current when it was written. Null if it has never been reviewed. |
| appRepository | AppRepository | The repository holding the source this item is published from. Never null, and one repository has at most one listing. Whether the item is an app, a theme, a recipe or a library is decided by flags on this repository. |
| availMode | String | Controls which accounts the item is offered to, as a space separated list of rules. Each rule starts with a plus to allow or a minus to deny, followed by either an admin domain name or the word parent, a colon and an admin domain name to match any account beneath that one. Blank or null means available to every account. Use isAvail rather than reading this directly. |
| banner | ItemImage | The wide header image for the item's marketplace page, holding a file name and the content hash of the image data. Null if no banner has been uploaded. |
| brief | String | The short summary shown in marketplace listings, up to 5000 characters. Like the description, it is copied onto each published version at publish time. |
| createdBy | Profile | The profile which created this marketplace listing. Never null. |
| createdDate | Date | When this marketplace listing was created, which is not when it was first published. |
| currentItem | MarketPlacePublishedItem | The published version this listing last pointed at, set when the item is published and cleared when it is unpublished. Superseded by the published items collection, which holds every published version, and by findPublishedVersion, which picks the right one for a cluster. |
| description | String | The full description shown on the item's marketplace page, up to 100000 characters. It is copied onto each published version at publish time, so changing it here does not change what an already published version shows. |
| id | long | Unique identifier for this marketplace listing, assigned by the database when the row is first saved. |
| logo | ItemImage | The icon shown beside the item in marketplace listings, holding a file name and the content hash of the image data. Null if no logo has been uploaded. |
| name | String | The name accounts install this item by, and the key it is looked up by across the marketplace. Path safe and intended to be unique, so treat it as an identifier rather than a label; the display title comes from the app repository. |
| price | BigDecimal | The price charged for this item, copied onto each published version at publish time. Null or zero for a free item. |
| published | Boolean | Whether the item is listed in the marketplace. Null for an item which has been created but never published, so prefer the published method, which treats null as not published. |
| publishedBy | Profile | The profile which last published this item to the marketplace. Null if it has never been published. |
| publishedDate | Date | When this item was last published to the marketplace. Null if it has never been published. |
| publishedItems | List<MarketPlacePublishedItem> | Every version of this item which has been published, each pinned to the branch and commit it was published from and carrying the clusters it is allowed on. An account installs one of these rather than the listing itself; use findPublishedVersion to pick the right one. |
| screenshots | List<ItemImage> | The screenshots shown on the item's marketplace page, each holding a file name and the content hash of the image data. Copied onto each published version at publish time. Null if none have been added. |
| type | String | The kind of item this is, taken from the flags on its app repository: app, theme, recipe, or lib when it is none of those. |
Methods
getId() · getName() · getAppRepository() · isPublished() · published() · getPublishedBy() · getPublishedDate() · getCreatedBy() · getCreatedDate() · getDescription() · getBrief() · getScreenshots() · getBanner() · getLogo() · getAppRatings() · getPrice() · getPublishedItems() · getAvailMode() · findPublishedVersion(String clusterVersion, boolean isDefaultCluster, String version) · isAvail(Organisation adminOrg) · is(String type) · getType()
getId()
Returns: long
Unique identifier for this marketplace listing, assigned by the database when the row is first saved.
getName()
Returns: String
The name accounts install this item by, and the key it is looked up by across the marketplace. Path safe and intended to be unique, so treat it as an identifier rather than a label; the display title comes from the app repository.
getAppRepository()
Returns: AppRepository
The repository holding the source this item is published from. Never null, and one repository has at most one listing. Whether the item is an app, a theme, a recipe or a library is decided by flags on this repository.
isPublished()
Returns: Boolean
Whether the item is listed in the marketplace. Null for an item which has been created but never published, so prefer the published method, which treats null as not published.
published()
Returns: boolean
Null safe alias for isPublished, which is null for an item added to the marketplace but never published
getPublishedBy()
Returns: Profile
The profile which last published this item to the marketplace. Null if it has never been published.
getPublishedDate()
Returns: Date
When this item was last published to the marketplace. Null if it has never been published.
getCreatedBy()
Returns: Profile
The profile which created this marketplace listing. Never null.
getCreatedDate()
Returns: Date
When this marketplace listing was created, which is not when it was first published.
getDescription()
Returns: String
The full description shown on the item's marketplace page, up to 100000 characters. It is copied onto each published version at publish time, so changing it here does not change what an already published version shows.
getBrief()
Returns: String
The short summary shown in marketplace listings, up to 5000 characters. Like the description, it is copied onto each published version at publish time.
getScreenshots()
Returns: List<ItemImage>
The screenshots shown on the item's marketplace page, each holding a file name and the content hash of the image data. Copied onto each published version at publish time. Null if none have been added.
getBanner()
Returns: ItemImage
The wide header image for the item's marketplace page, holding a file name and the content hash of the image data. Null if no banner has been uploaded.
getLogo()
Returns: ItemImage
The icon shown beside the item in marketplace listings, holding a file name and the content hash of the image data. Null if no logo has been uploaded.
getAppRatings()
Returns: List<AppRating>
The reviews left for this item, each with a star rating, the reviewer, and the branch and commit which was current when it was written. Null if it has never been reviewed.
getPrice()
Returns: BigDecimal
The price charged for this item, copied onto each published version at publish time. Null or zero for a free item.
getPublishedItems()
Returns: List<MarketPlacePublishedItem>
Every version of this item which has been published, each pinned to the branch and commit it was published from and carrying the clusters it is allowed on. An account installs one of these rather than the listing itself; use findPublishedVersion to pick the right one.
getAvailMode()
Returns: String
Controls which accounts the item is offered to, as a space separated list of rules. Each rule starts with a plus to allow or a minus to deny, followed by either an admin domain name or the word parent, a colon and an admin domain name to match any account beneath that one. Blank or null means available to every account. Use isAvail rather than reading this directly.
findPublishedVersion(String clusterVersion, boolean isDefaultCluster, String version)
Returns: MarketPlacePublishedItem
Picks the published version of this item to install, being the most recently published one which supports the given cluster and, when a version is asked for, was published from a branch of that name. Scans the published items on each call.
| Parameter | Description |
|---|---|
clusterVersion | the cluster the item is to be installed on |
isDefaultCluster | true if that cluster is the default one, which published versions may support implicitly |
version | the branch name to pin to, or null or blank to take the latest published version |
isAvail(Organisation adminOrg)
Returns: boolean
Says whether this item should be offered to the given account, by applying the availability rules in order. An item with no rules is available to everyone; otherwise a deny rule which matches wins outright, and at least one allow rule must match. A rule which starts with neither a plus nor a minus is invalid and makes the item unavailable.
| Parameter | Description |
|---|---|
adminOrg | the account to test availability for |
is(String type)
Returns: boolean
Says whether this item is of the given kind, one of app, theme, recipe or lib, according to the flags on its app repository. Note lib is tested as being neither an app nor a theme, so a recipe also answers true to lib.
| Parameter | Description |
|---|---|
type | the kind to test for, being app, theme, recipe or lib |
getType()
Returns: String
The kind of item this is, taken from the flags on its app repository: app, theme, recipe, or lib when it is none of those.