001/* 002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl-2.1.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Nicolas Chapurlat <nchapurlat@nuxeo.com> 016 */ 017 018package org.nuxeo.ecm.core.io.registry; 019 020import org.nuxeo.ecm.core.io.registry.context.RenderingContext; 021import org.nuxeo.ecm.core.io.registry.context.WrappedContext; 022 023/** 024 * This class gather all marshalling related constants. 025 * 026 * @since 7.2 027 */ 028public interface MarshallingConstants { 029 030 // Entity names 031 032 /** 033 * The field name for entity's type. 034 */ 035 String ENTITY_FIELD_NAME = "entity-type"; 036 037 // Parameters 038 039 /** 040 * Prefix to put Nuxeo parameters in Headers. 041 */ 042 String HEADER_PREFIX = "X-NX"; 043 044 /** 045 * Parameter name to specify which document's properties should be loaded. 046 */ 047 String EMBED_PROPERTIES = "properties"; 048 049 /** 050 * Parameter name to specify which ContentEnrichers should be activated. 051 */ 052 String EMBED_ENRICHERS = "enrichers"; 053 054 /** 055 * Parameter name to specify which properties should be fetched. 056 */ 057 String FETCH_PROPERTIES = "fetch"; 058 059 /** 060 * Parameter name to specify which properties should be translated. 061 */ 062 String TRANSLATE_PROPERTIES = "translate"; 063 064 /** 065 * Parameter name to specify how deep the marshallers should call sub marshallers. 066 */ 067 String MAX_DEPTH_PARAM = "depth"; 068 069 /** 070 * Value to specify embed all or fetch all 071 */ 072 String WILDCARD_VALUE = "*"; 073 074 /** 075 * @deprecated use {@value #EMBED_PROPERTIES} instead 076 */ 077 @Deprecated 078 String DOCUMENT_PROPERTIES_HEADER = "X-NXDocumentProperties"; 079 080 /** 081 * @deprecated use {@value #EMBED_ENRICHERS} concatenated with "document" (example: enrichers:document=acls) 082 */ 083 @Deprecated 084 String NXCONTENT_CATEGORY_HEADER = "X-NXContext-Category"; 085 086 // Technical 087 088 /** 089 * Context parameter key used to get current {@link WrappedContext} in a {@link RenderingContext}. 090 */ 091 String WRAPPED_CONTEXT = "_MarshalledEntitiesWrappedContext"; 092 093 /** 094 * Key used to isolate depth control key: counter to manage infinite marshaller to marshaller call. 095 */ 096 String DEPTH_CONTROL_KEY_PREFIX = "_DepthControlKey_"; 097 098}