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