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.ade.contenteditor.client; 029 030import java.util.Collections; 031import java.util.HashMap; 032import java.util.Map; 033 034/** 035 * This class can be used by code which uses the Acacia editor to pass additional information to the editor on startup.<p> 036 */ 037public class CmsEditorContext { 038 039 /** The path of the style sheet to use for the WYSIWYG editor. */ 040 private String m_editorStylesheet; 041 042 /** The HTML context info. */ 043 private String m_htmlContextInfo; 044 045 /** The parameters for the publish function in the Acacia editor. */ 046 private Map<String, String> m_publishParameters = new HashMap<String, String>(); 047 048 /** The setting presets. */ 049 private Map<String, String> m_settingPresets = Collections.emptyMap(); 050 051 /** 052 * Default constructor.<p> 053 */ 054 public CmsEditorContext() { 055 056 // do nothing 057 } 058 059 /** 060 * Gets the path of the style sheet to use for the WYSIWYG editor. 061 * 062 * @return the style sheet path 063 */ 064 public String getEditorStylesheet() { 065 066 return m_editorStylesheet; 067 } 068 069 /** 070 * Returns the HTML context info.<p> 071 * 072 * @return the HTML context info 073 */ 074 public String getHtmlContextInfo() { 075 076 return m_htmlContextInfo; 077 } 078 079 /** 080 * Gets the additional publish parameters which should be used for the publish functionality in the Acacia editor.<p> 081 * 082 * @return the additional publish parameters 083 */ 084 public Map<String, String> getPublishParameters() { 085 086 return m_publishParameters; 087 } 088 089 /** 090 * Returns the setting presets.<p> 091 * 092 * @return the setting presets 093 */ 094 public Map<String, String> getSettingPresets() { 095 096 return m_settingPresets; 097 } 098 099 /** 100 * Sets the path of the style sheet to use for the WYSIWYG editor. 101 * 102 * @param stylesheetPath the style sheet path 103 */ 104 public void setEditorStylesheet(String stylesheetPath) { 105 106 m_editorStylesheet = stylesheetPath; 107 } 108 109 /** 110 * Sets the HTML context info.<p> 111 * 112 * @param htmlContextInfo the HTML context info to set 113 */ 114 public void setHtmlContextInfo(String htmlContextInfo) { 115 116 m_htmlContextInfo = htmlContextInfo; 117 } 118 119 /** 120 * Sets the additional publish parameters for the publish functionality in the Acacia editor.<p> 121 * 122 * @param publishParams the additional publish parameters 123 */ 124 public void setPublishParameters(Map<String, String> publishParams) { 125 126 m_publishParameters = publishParams; 127 } 128 129 /** 130 * Sets the setting presets.<p> 131 * 132 * @param settingPresets the setting presets to set 133 */ 134 public void setSettingPresets(Map<String, String> settingPresets) { 135 136 m_settingPresets = settingPresets; 137 } 138}