- This line was added.
- This line was removed.
- Formatting was changed.
Android SDK Integration Guide - Content Management
This is Phunware's Android SDK for the Content Management module. Visit http://maas.phunware.com/ for more details and to sign up.
- Android SDK 2.2+ (API level 8) or above
- Android Target 188.8.131.52
- Android Support v4 18.0.+
- Download MaaS Content Management and run the included sample app.
- Continue reading below for installation and integration instructions.
- Be sure to read the documentation for additional details.
The following libraries are required:
MaaS Content Management has a dependency on MaaSCore.jar, which is available here: Core SDK
Documentation is included in the Documents folder in the repository as both HTML and as a .jar. You can also find the latest documentation here: CM API iOS Reference
The MaaS Content Management SDK allows developers to fetch and manage the various pieces of data in the Content Management Engine, including containers, schemas, structure and content. MaaS Content Management spans across your entire organization, so different applications can potentially share the same content.
Containers hold a single structure. You can create any number of containers in the MaaS portal. You can also associate tags with containers to assist with fetching.
Schemas are applied to structure items and define what fields of data a particular structure item can contain. You can create any number of schemas in the MaaS portal. You can also associate tags with schemas to assist with fetching.
Structure items are used to build the structure and hierarchy of the data. Each structure item that is defined as an object can also optionally be assigned a schema that defines what content can be saved to those structure items.
The structure of the content object relies completely on the layout of structures and schemas.
The primary methods in MaaS Content Management revolve fetching, creating, updating and deleting content. You can also get structures, containers and schemas.
// Get a specific piece of content for the specified context, container ID and content ID. // The contents are always returned as a JSONObject. It's recommended that you parse the JSONObject into a model object. JSONObject content = PwCMEModule.getContent(this, containerId, contentId);
// Update content for the specified content ID, container ID and structure ID. // Any fields that are omitted will maintain their previous values. PwCMEModule.updateContent(this, contentId, newContent, structureId);
// Add content to the specified container ID, structure ID and parent content ID. // Ideally, the new content object has all the fields specified by the structure and schema. // If not, the required fields will be created for you with empty values. // The required parent content ID for new content needs to be linked up to any dynamic children of a structure item. PwCMEModule.addContent(this, containerId, structureId, parentId, data); or // If no parent content exists, then the parent content ID is not required. // Otherwise, use the above method to properly link child elements. PwCMEModule.addContent(this, containerId, structureId, data);
// Delete content for the specified content ID as well as all content children. PwCMEModule.deleteContent(this, contentId, traverse); or // Delete all content children for the specified content ID. PwCMEModule.deleteContentAllChildren(context, contentId);
// Fetch all containers. PwContainers containers = PwCMEModule.getContainers(this); // Fetch a specific container item. PwContainer container = PwCMEModule.getContainer(this, containerId); // Get an array of containers that match an array of tags. PwContainers containers = PwCMEModule.getContainers(this, anyTags, allTags);
// Fetch all schemas. PwSchemas schemas = PwCMEModule.getSchemas(this); // Fetch a specific schema item. PwSchema schema = PwCMEModule.getSchema(this, schemaId); // Get an array of schemas that match an array of tags. PwSchemas schemas = PwCMEModule.getSchemas(this, anyTags, allTags);
// Fetch a structure with the specified stucture and container ID. // In this example, we want to traverse into all child structures but not include schema. withSchema = false; PwStructure structure = PwCMEModule.getStructure(this, structureId, containerId, depth, withSchema); // Fetch a structure object containing an array of structures for the specified container ID. // In this example, we want to traverse into all child structures and include schema. withSchema = true; PwStructures structures = PwCMEModule.getStructures(this, containerId, depth, withSchema);
ON THIS PAGE
|Table of Contents|