001/*
002 * (C) Copyright 2006-2011 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
021/**
022 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
023 */
024public class Constants {
025
026    public static final String CTYPE_AUTOMATION = "application/json+nxautomation";
027
028    public static final String CTYPE_ENTITY = "application/json+nxentity";
029
030    public static final String CTYPE_MULTIPART_RELATED = "multipart/related"; // for
031                                                                              // blobs
032                                                                              // upload
033
034    public static final String CTYPE_MULTIPART_MIXED = "multipart/mixed"; // for
035                                                                          // blobs
036                                                                          // download
037
038    public static final String REQUEST_ACCEPT_HEADER = CTYPE_ENTITY + ", */*";
039
040    public static final String CTYPE_REQUEST = "application/json+nxrequest; charset=UTF-8";
041
042    public static final String CTYPE_REQUEST_NOCHARSET = "application/json+nxrequest";
043
044    public static final String KEY_ENTITY_TYPE = "entity-type";
045
046    /**
047     * Header to specify a comma separated list of schemas to be included in the returned doc.
048     * <p>
049     * If the header is not specified, the default properties are returned (the minimal document properties: common,
050     * dublincore, file). To specify all the schemas you can use the <code>*</code> as value. Example:
051     *
052     * <pre>
053     * X-NXDocumentProperties: *
054     * X-NXDocumentProperties: dublincore, file
055     * </pre>
056     */
057    public static final String HEADER_NX_SCHEMAS = "X-NXDocumentProperties";
058
059    /**
060     * Header to inform the server that no return entity is wanted. It must be <code>true</code> or <code>false</code>.
061     * If not specified, false will be used by default.
062     * <p>
063     * This can be used to avoid the server sending back the response entity to the client - the operation will be
064     * treated as a void operation.
065     * <p>
066     * For example the operation <code>Blob.Attach</code> returns back the attached blob. This may generate a lot of
067     * network traffic that is not needed by the client (sending back the same blob as the one sent by the client as the
068     * operation input). In such situation you should set this header to true.
069     */
070    public static final String HEADER_NX_VOIDOP = "X-NXVoidOperation";
071
072    private Constants() {
073    }
074
075}