10 Collection Lifecycle

The collection lifecycle involves moving from the Draft state to the Published state.

After you publish a collection, it can’t be modified. While you can publish a collection and also create a new version of a collection, you can also remove a collection as described in Move a Collection to the Trash.

If you want a general introduction to how artifacts interrelate in the overall lifecycle before exploring the lifecycle of collections, see Understanding Lifecycles.

Publish a Collection

You create a collection within the context of a backend. When you’re satisfied with that collection, you can publish it.

  1. Click open the side menu icon and select Development > Storage from the side menu.

  2. Select the collection you want to publish.

  3. In the Details section on the right, click Publish.

You can publish a draft collection whenever you feel that it’s complete. After it's published, however, it can't be changed.

A collection can also be published involuntarily when a backend associated with a collection is published. If the associated collection isn’t yet published, it will be published automatically to support the backend.

When a collection is published:

  • Its metadata (its description and access roles) are frozen. To update the collections metadata, you must create a new version.

  • The major version (given the version that you arbitrarily defined) is incremented.

  • It’s no longer in your personal development space. It’s available for anyone with the proper permissions to associate with a backend.

  • Instance data isn’t moved with the collection.

    Instance data (such as actual user objects or actual collection objects stored in collections) is typically created at runtime, or by user scripts or code as part of a configuration. It isn't moved with the collection.

Update the Version Number of a Collection

When you update a version, the new number is backward-compatible and the collection history continues.

  1. Click open the side menu icon and select Development > Storage from the side menu.

  2. Select a collection.

  3. In the Details section, select More > Update Version Number.

  4. Specify an optional comment and click Update.

    The collection history reflects the incremented number.

Create a New Version of a Collection

You can’t copy a collection, but you can save yourself some time by creating a new version of an existing collection. If you create a new version, you’ll have the same data. It is possible to rename the collection and reset the version as long as the collection is in a Draft state.

If you want a collection that starts with 1.0 and that has the same data as another collection, you must make a new collection and import the data.

When you create a new version number, an independent collection is spawned from that point with a new history that’s unrelated to the previous collection. Any data is carried forward to the new version.

A collection can’t have more than one version of an object.

  1. Click open the side menu icon and select Development > Storage from the side menu.

  2. Select a collection.

  3. In the Details section on the right, select More > New Version.

  4. Specify an optional comment and click Update.

Move a Collection to the Trash

Remove a collection by moving it to the trash. Moving a collection to the trash means it’s no longer listed but it’s still viable. If the collection is needed later, you can restore it.

  1. Click open the side menu icon and select Development > Storage from the side menu.

  2. Select the collection you want to remove.

  3. In the Details section on the right, select More > Move to Trash.

  4. Click Trash in the confirmation dialog if there are no dependency issues.

    If you think you or someone else might restore it later on, enter a brief comment about why you're putting this item in the trash.

Although only a mobile cloud administrator can purge a collection (eliminate it permanently), you can delete an object in a collection using the command-line operation, DELETE.

Restore a Collection

  1. Click open the side menu icon and select Development > Storage from the side menu.
  2. Click Trash (open the trash list icon).
  3. In the list of items in the trash, click open the trash drawer icon by the collection you want and select Restore from Trash.
  4. Click Restore in the confirmation dialog if there are no conflicts.
Restoring an artifact can cause conflicts if a duplicate artifact already exists.

Manage a Collection

After you create a collection, you’ll want to edit it, publish it, and in short, manage the collection and examine details of collections created by other mobile developers. The Storage page gives you access to all these features.

When at least one collection exists, you’ll be taken to the Storage page every time you click open the side menu icon and select Development > Storage from the side menu. On the left side of the page, you’ll see a list of all the collections except for those in the trash. You can see which collections are in the Draft state and which are in the Published state. Every collection is listed by its name and version number.

The upper right side of the page is where you can open, test and publish the selected collection:

  • Click Open to see details about the selected collection.

  • Click Publish to change the state of your collection from Draft to Published.

  • Click More to create a new version, update an existing version, associate the collection with a backend, or move a collection to the trash.

On the lower right of the page, you can examine usage and history details:
  • Expand Used By to see which backends are associated with the collection. To disassociate the selected collection from an artifact that uses it, click X next to the artifact’s name.

  • Expand the History section to quickly see the latest activity for the selected collection.