Atom Publishing Protocol (
...
Apache Wink provides a set of providers that are capable of mapping APP Service Document and APP Categories data models to their xml representations. The following tables list these providers.
AppServiceProvider
AtomPub) Overview
The Atom Publishing Protocol (AtomPub) is an application-level protocol for publishing and editing Web resources. The protocol is based on HTTP transport of Atom-formatted representations. The Atom format is documented in the Atom Syndication Format.
Data Model
Apache Wink provides an Atom Publishing Protocol data model for producing Service Documents (application/atomsvc+xml) and Categories Documents (application/atomcat+xml). All of the model classes are located under the org.apache.wink.common.model.app package.
Info | ||
---|---|---|
| ||
The APP data model can also be used to produce Service and Categories documents in HTML (text/html) and JSON (application/json) formats. For more details regarding HTML see section HTML (TBD). For JSON format see section (TBD) |
APP Service Document Support
The following table shows the APP service document data models and the representations in which it can be serialized and de-serialized.TBD
| Supported | Media Types | Data Model | Provider Registration Entity | |
---|---|---|---|---|---|
Read | Yes No | N/A | application/atomsvc+xml | org.apache.wink.common | Not required. Registered by default N/A |
Write | Yes | application/atomsvc+xml | AppService>> |
AppCategoriesProvider
org.apache.wink.common | Not required. Registered by default |
APP Categories Document Support
The following table shows the APP Catagories document data models and the representations in which it can be serialized and de-serialized.TBD
| Supported | Media Types | Data Model | Provider Registration Entity | ||
---|---|---|---|---|---|---|
Read | N/A | N/A | Write | Yes | application/atomcat+xml | AppCategories>> |
CategoriesProvider
TBD
org.apache.wink.common | Not required. Registered by default | ||
| Supported | Media Types | Entity |
---|---|---|---|
Read | No | N/A | N/A |
Write | Yes | application/atomcat+xml | Categories>> |
Atom Publishing Protocol (APP) Data Models
org.apache.wink.common | Not required. Registered by default |
Producing an APP Service Document Example
The following code example demonstrates the creation of an APP Service Document.
Code Block |
---|
@GET
@Produces(MediaTypeUtils.ATOM_SERVICE_DOCUMENT)
public AppService getServiceDocument() {
AppService serviceDocument = new AppService();
List<AppWorkspace> workspaces = serviceDocument.getWorkspace();
AppWorkspace workspace1 = new AppWorkspace();
workspace1.setTitle(new AtomText("Workspace1"));
List<AppCollection> collections = workspace1.getCollection();
AppCollection collection = new AppCollection();
collection.setTitle(new AtomText("Collection1"));
collections.add(collection);
workspaces.add(workspace1);
...
return serviceDocument;
}
|
Explanation
AppService class is JAXB annotated POJO. An instance of an AppService class is created, populated and returned by the resource. A generic JAXB provider is used to serializes this class into an XML representationApache Wink provides an Atom Publishing Protocol data model for producing Service Documents (application/atomsvc+xml) and Categories Documents (application/atomcat+xml). The APP data model can also be used to produce Service and Categories documents in HTML (text/html) and JSON (application/json) formats. All of the model classes are located under the com.hp.symphony.common.model.app package.