001/* 002 * (C) Copyright 2006-2016 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * bstefanescu 018 */ 019package org.nuxeo.ecm.automation.client; 020 021import javax.ws.rs.core.MediaType; 022 023/** 024 * @author <a href="mailto:[email protected]">Bogdan Stefanescu</a> 025 */ 026public class Constants { 027 028 public static final String CTYPE_AUTOMATION = "application/json+nxautomation"; 029 030 public static final String CTYPE_ENTITY = MediaType.APPLICATION_JSON; 031 032 public static final String CTYPE_MULTIPART_RELATED = "multipart/related"; // for 033 // blobs 034 // upload 035 036 public static final String CTYPE_MULTIPART_MIXED = "multipart/mixed"; // for 037 // blobs 038 // download 039 040 /** @since 8.4 */ 041 public static final String CTYPE_MULTIPART_EMPTY = "application/nuxeo-empty-list"; // for empty blobs 042 043 public static final String REQUEST_ACCEPT_HEADER = CTYPE_ENTITY + ", */*"; 044 045 public static final String CTYPE_REQUEST_NOCHARSET = MediaType.APPLICATION_JSON; 046 047 public static final String CTYPE_REQUEST = CTYPE_REQUEST_NOCHARSET + "; charset=UTF-8"; 048 049 public static final String KEY_ENTITY_TYPE = "entity-type"; 050 051 /** 052 * Header to specify a comma separated list of schemas to be included in the returned doc. 053 * <p> 054 * If the header is not specified, the default properties are returned (the minimal document properties: common, 055 * dublincore, file). To specify all the schemas you can use the <code>*</code> as value. Example: 056 * 057 * <pre> 058 * X-NXDocumentProperties: * 059 * X-NXDocumentProperties: dublincore, file 060 * </pre> 061 */ 062 public static final String HEADER_NX_SCHEMAS = "X-NXDocumentProperties"; 063 064 /** 065 * Header to inform the server that no return entity is wanted. It must be <code>true</code> or <code>false</code>. 066 * If not specified, false will be used by default. 067 * <p> 068 * This can be used to avoid the server sending back the response entity to the client - the operation will be 069 * treated as a void operation. 070 * <p> 071 * For example the operation <code>Blob.Attach</code> returns back the attached blob. This may generate a lot of 072 * network traffic that is not needed by the client (sending back the same blob as the one sent by the client as the 073 * operation input). In such situation you should set this header to true. 074 */ 075 public static final String HEADER_NX_VOIDOP = "X-NXVoidOperation"; 076 077 /** 078 * @since 10.3 079 */ 080 public static final String HEADER_CONTENT_DISPOSITION = "Content-Disposition"; 081 082 private Constants() { 083 } 084 085}