001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.ugc.shared; 029 030/** 031 * Shared constants used by the client- and server-side components of the form editing module.<p> 032 */ 033public class CmsUgcConstants { 034 035 /** Enum representing the different types of errors. The string values of these enum values are intended for use in JavaScript error handling functions. */ 036 public enum ErrorCode { 037 /** Invalid action error. */ 038 errInvalidAction, 039 040 /** Configuration error. */ 041 errConfiguration, 042 043 /** Error when trying to upload a file and uploads are not allowed. */ 044 errNoUploadAllowed, 045 046 /** Error when the maximum number of contents in the content directory is reached. */ 047 errMaxContentsExceeded, 048 049 /** Error when the maximum number of entries in the form session request queue is reached. */ 050 errMaxQueueLengthExceeded, 051 052 /** Error when user tries to upload a file with a file extension which is not among the configured file extensions. */ 053 errInvalidExtension, 054 055 /** Validation error. */ 056 errValidation, 057 058 /** Miscellaneous other errors. */ 059 errMisc, 060 061 /** Error when uploaded files exceed the configured maximum upload size. */ 062 errMaxUploadSizeExceeded; 063 064 } 065 066 /** The request parameter used for identifying form submits. */ 067 public static final String PARAM_FORM_DATA_ID = "formDataId"; 068 069 /** Name of the parameter containing the session id. */ 070 public static final String PARAM_SESSION_ID = "formSessionId"; 071 072 /** Javascript attribute name. */ 073 public static final String JS_ATTR_ERROR = "error"; 074 075 /** JavaScript attribute name. */ 076 public static final String JS_ATTR_VALIDATION_ERRORS = "validationErrors"; 077 078}