001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 */
019package org.apache.isis.viewer.restfulobjects.applib;
020
021
022/**
023 * Media types including the <tt>profile</tt> parameter.
024 * 
025 * <p>
026 * Because these values are used in the <tt>@Produces</tt> annotation on the jax-rs
027 * resources, they must be constants and must be strings. 
028 * 
029 * @see http://buzzword.org.uk/2009/draft-inkster-profile-parameter-00.html
030 */
031public final class RestfulMediaType {
032
033    private RestfulMediaType() {
034    }
035    
036    static final String PROFILE_PARAM_PREFIX = "urn:org.restfulobjects:repr-types/";
037
038    private static final String BASE = "application/json" + ";profile=" + PROFILE_PARAM_PREFIX;
039
040    public final static String APPLICATION_JSON_HOME_PAGE = BASE + "homepage";
041    public final static String APPLICATION_JSON_USER = BASE + "user";
042    public final static String APPLICATION_JSON_VERSION = BASE + "version";
043    public final static String APPLICATION_JSON_LIST = BASE + "list";
044    public final static String APPLICATION_JSON_OBJECT = BASE + "object";
045    public final static String APPLICATION_JSON_OBJECT_PROPERTY = BASE + "object-property";
046    public final static String APPLICATION_JSON_OBJECT_COLLECTION = BASE + "object-collection";
047    public final static String APPLICATION_JSON_OBJECT_ACTION = BASE + "object-action";
048    public final static String APPLICATION_JSON_ACTION_RESULT = BASE + "action-result";
049    public final static String APPLICATION_JSON_TYPE_LIST = BASE + "type-list";
050    public final static String APPLICATION_JSON_DOMAIN_TYPE = BASE + "domain-type";
051    public final static String APPLICATION_JSON_PROPERTY_DESCRIPTION = BASE + "property-description";
052    public final static String APPLICATION_JSON_COLLECTION_DESCRIPTION = BASE + "collection-description";
053    public final static String APPLICATION_JSON_ACTION_DESCRIPTION = BASE + "action-description";
054    public final static String APPLICATION_JSON_ACTION_PARAMETER_DESCRIPTION = BASE + "action-param-description";
055    public final static String APPLICATION_JSON_ERROR = BASE + "error";
056    public final static String APPLICATION_JSON_TYPE_ACTION_RESULT = BASE + "type-action-result";
057
058    // REVIEW: these do not appear in RO spec 1.0.0 
059    // public final static String APPLICATION_JSON_SCALAR_VALUE = BASE + "scalarvalue";
060    // public final static String APPLICATION_JSON_TRANSIENT_DOMAIN_OBJECT = BASE + "transient";
061
062}