001/*
002 * (C) Copyright 2015 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 *     Nicolas Chapurlat <nchapurlat@nuxeo.com>
018 */
019
020package org.nuxeo.ecm.core.io.registry;
021
022import org.nuxeo.ecm.core.io.registry.context.RenderingContext;
023import org.nuxeo.ecm.core.io.registry.context.WrappedContext;
024
025/**
026 * This class gather all marshalling related constants.
027 *
028 * @since 7.2
029 */
030public interface MarshallingConstants {
031
032    // Entity names
033
034    /**
035     * The field name for entity's type.
036     */
037    String ENTITY_FIELD_NAME = "entity-type";
038
039    // Parameters
040
041    /**
042     * Prefix to put Nuxeo parameters in Headers.
043     */
044    String HEADER_PREFIX = "X-NX";
045
046    /**
047     * Parameter name to specify which document's properties should be loaded.
048     */
049    String EMBED_PROPERTIES = "properties";
050
051    /**
052     * Parameter name to specify which ContentEnrichers should be activated.
053     */
054    String EMBED_ENRICHERS = "enrichers";
055
056    /**
057     * Parameter name to specify which properties should be fetched.
058     */
059    String FETCH_PROPERTIES = "fetch";
060
061    /**
062     * Parameter name to specify which properties should be translated.
063     */
064    String TRANSLATE_PROPERTIES = "translate";
065
066    /**
067     * Default separator for enrichers, fetch and translate based properties.
068     */
069    char SEPARATOR = '-';
070
071    /**
072     * Parameter name to specify how deep the marshallers should call sub marshallers.
073     */
074    String MAX_DEPTH_PARAM = "depth";
075
076    /**
077     * Value to specify embed all or fetch all
078     */
079    String WILDCARD_VALUE = "*";
080
081    /**
082     * @deprecated use {@value #EMBED_PROPERTIES} instead
083     */
084    @Deprecated
085    String DOCUMENT_PROPERTIES_HEADER = "X-NXDocumentProperties";
086
087    /**
088     * @deprecated use {@value #EMBED_ENRICHERS} concatenated with the entity type "document" seprated with a '-'
089     *             (example: enrichers-document=acls)
090     */
091    @Deprecated
092    String NXCONTENT_CATEGORY_HEADER = "X-NXContext-Category";
093
094    // Technical
095
096    /**
097     * Context parameter key used to get current {@link WrappedContext} in a {@link RenderingContext}.
098     */
099    String WRAPPED_CONTEXT = "_MarshalledEntitiesWrappedContext";
100
101    /**
102     * Key used to isolate depth control key: counter to manage infinite marshaller to marshaller call.
103     */
104    String DEPTH_CONTROL_KEY_PREFIX = "_DepthControlKey_";
105
106}