Index: /CKEditor.Java/ckeditor-java-core/trunk/pom.xml
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/pom.xml	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/pom.xml	(revision 6775)
@@ -0,0 +1,103 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.ckeditor</groupId>
+	<artifactId>ckeditor-java-core</artifactId>
+	<version>3.5.3-SNAPSHOT</version>
+	<name>CKEditor for Java - Core</name>
+	<description>CKEditor Server Side Integration for Java. This Java library
+	enables CKEditor to be used in a Servlet/J2EE environment. It provides
+	JSP tags for creating a CKEditor instance.
+	</description>
+	<url>http://ckeditor.com</url>
+	<inceptionYear>2003</inceptionYear>
+	<licenses>
+		<license>
+			<name>GNU General Public License Version 2 or later (GPL)</name>
+			<url>http://www.gnu.org/licenses/gpl.html</url>
+		</license>
+		<license>
+			<name>GNU Lesser General Public License Version 2.1 (LGPL)</name>
+			<url>http://www.gnu.org/licenses/lgpl.html</url>
+		</license>
+		<license>
+			<name>Mozilla Public License Version 1.1 or later (MPL)</name>
+			<url>http://www.mozilla.org/MPL/MPL-1.1.html</url>
+		</license>
+	</licenses>
+	<scm>
+		<url>http://svn.ckeditor.com/CKEditor.Java/ckeditor-java-core/trunk</url>
+		<connection>http://svn.ckeditor.com/CKEditor.Java/ckeditor-java-core/trunk</connection>
+	</scm>
+	<packaging>jar</packaging>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+					<encoding>utf-8</encoding>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-resources-plugin</artifactId>
+				<version>2.2</version>
+				<configuration>
+					<encoding>UTF-8</encoding>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<version>2.7</version>
+				<configuration>
+					<quiet>true</quiet>
+					<show>package</show>
+					<docfilessubdirs>true</docfilessubdirs>
+					<keywords>true</keywords>
+					<detectOfflineLinks>false</detectOfflineLinks>
+					<encoding>UTF-8</encoding>
+				</configuration>
+				<executions>
+					<execution>
+						<id>attach-javadocs</id>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-source-plugin</artifactId>
+				<version>2.1.2</version>
+				<executions>
+					<execution>
+						<id>attach-sources</id>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.5</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet.jsp</groupId>
+			<artifactId>jsp-api</artifactId>
+			<version>2.1</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+</project>
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorConfig.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorConfig.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorConfig.java	(revision 6775)
@@ -0,0 +1,182 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+package com.ckeditor;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * CKEditor tag for Java configuration class.
+ */
+public class CKEditorConfig implements Cloneable {
+
+	private Map<String, Object> config;
+	
+	/**
+	 * Default constructor.
+	 */
+	public CKEditorConfig() {
+		config = new HashMap<String, Object>();		
+	}
+	
+	/**
+	 * Adds number param to config.
+	 * <b>Usage:</b>
+	 * <pre>config.addConfigValue("width", 100);</pre>
+	 * <pre>config.addConfigValue("dialog_backgroundCoverOpacity", 0.7);</pre>
+	 * @param key config param key
+	 * @param value config param value.
+	 */
+	public void addConfigValue(final String key, final Number value) {
+		config.put(key, value);
+	}
+	
+	/**
+	 * Adds String param to config.
+	 * <b>Usage:</b>
+	 * <pre>config.addConfigValue("baseHref", "http://www.example.com/path/");</pre>
+	 * <pre>config.addConfigValue("toolbar", [[ 'Source', '-', 'Bold', 'Italic' ]]);</pre>
+	 * @param key config param key
+	 * @param value config param value.
+	 */
+	public void addConfigValue(final String key, final String value) {
+		config.put(key, value);
+	}
+	
+	/**
+	 * Adds Map param to config.
+	 * <b>Usage:</b>
+	 * <pre>Map<String, Object> map = new HashMap<String, Object>();</pre>
+	 * <pre>map.put("element", "span");</pre>
+	 * <pre>map.put("styles", "{'background-color' : '#(color)'}");</pre>
+	 * <pre>config.addConfigValue("colorButton_backStyle", map);</pre>
+	 * @param key config param key
+	 * @param value config param value.
+	 */
+	public void addConfigValue(final String key, 
+								final Map<String, ? extends Object> value) {
+		config.put(key, value);
+	}
+	
+	/**
+	 * Adds List param to config.
+	 * <b>Usage:</b>
+	 * <pre> 
+		List<List<String>> list = new ArrayList<List<String>>();
+		List<String> subList = new ArrayList<String>();
+		subList.add("Source");
+		subList.add("-");
+		subList.add("Bold");
+		subList.add("Italic");
+		list.add(subList);
+		config.addConfigValue("toolbar", list);
+		</pre>
+	 * @param key config param key
+	 * @param value config param value.
+	 */
+	public void addConfigValue(final String key, final List<? extends Object> value) {
+		config.put(key, value);
+	}
+	
+	/**
+	 * Adds boolean param to config.
+	 * <b>Usage:</b>
+	 * <pre>config.addConfigValue("autoUpdateElement", true);</pre> 
+	 * @param key config param key
+	 * @param value config param value.
+	 */
+	public void addConfigValue(final String key, final Boolean value) {
+		config.put(key, value);
+	}
+	
+	
+	/**
+	 * Gets config value by key.
+	 * @param key config param key
+	 * @return config param value.
+	 */
+	Object getConfigValue(final String key) {
+		return config.get(key);
+	}
+
+	/**
+	 * @return all config values.
+	 */
+	Map<String, Object> getConfigValues() {
+		return config;
+	}
+	
+	/**
+	 * Removes config value by key.
+	 * <b>Usage:</b>
+	 * <pre>config.removeConfigValue("toolbar");</pre>
+	 * @param key config param key.
+	 */
+	public void removeConfigValue(final String key) {
+		config.remove(key);
+	}
+	
+	/**
+	 * Configure settings. Merge config and event handlers.
+	 * @return setting config.
+	 * @param eventHandler events
+	 */
+	CKEditorConfig configSettings(final EventHandler eventHandler) {
+		try {
+			CKEditorConfig cfg = (CKEditorConfig) this.clone();
+			if (eventHandler != null) {
+				for (String eventName : eventHandler.events.keySet()) {
+					Set<String> set = eventHandler.events.get(eventName);
+					if (set.isEmpty()) {
+						continue;
+					} else if (set.size() == 1) {
+						Map<String, String> hm = new HashMap<String, String>();
+						for (String code : set) {
+							hm.put(eventName, "@@" + code);	
+						}					
+						cfg.addConfigValue("on", hm);
+					} else {
+						Map<String, String> hm = new HashMap<String, String>();
+						StringBuilder sb = new StringBuilder("@@function (ev){");
+						for (String code : set) {
+							sb.append("(");
+							sb.append(code);
+							sb.append(")(ev);");
+						}
+						sb.append("}");
+						hm.put(eventName, sb.toString());
+						cfg.addConfigValue("on", hm);
+					}
+				}
+			}			
+			return cfg;
+		} catch (CloneNotSupportedException e) {
+			return null;
+		}
+		
+		
+	}
+	
+	/**
+	 * Checks if config is empty.
+	 * @return true if is
+	 */
+	public boolean isEmpty() {
+		return config.isEmpty();
+	}
+	
+	/**
+	 * Override.
+	 */
+	protected Object clone() throws CloneNotSupportedException {
+		CKEditorConfig cfg = (CKEditorConfig) super.clone();
+		cfg.config = new HashMap<String, Object>(this.config);
+		return cfg; 
+	}
+	
+		
+}
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorInsertTag.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorInsertTag.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorInsertTag.java	(revision 6775)
@@ -0,0 +1,153 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+package com.ckeditor;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+
+/**
+ * &lt;ck:editor&gt; tag code.
+ * <b>Usage:</b>
+ * <pre>&lt;ckeditor:editor basePath="../../ckeditor/" editor="editor1" /&gt;</pre>
+ */
+public class CKEditorInsertTag extends CKEditorTag {
+
+	private static final long serialVersionUID = 1316780332328233835L;
+
+	private static final String DEFAULT_TEXTAREA_ROWS = "8";
+	private static final String DEFAULT_TEXTAREA_COLS = "60";
+	
+	
+	private String editor;
+	private String value;
+	private Map<String, String> textareaAttributes;
+	
+
+
+	/**
+	 * Default constructor.
+	 */
+	public CKEditorInsertTag() {
+		textareaAttributes = new HashMap<String, String>();
+		editor = "";
+		value = "";
+	}
+	
+	@Override
+	public int doStartTag() throws JspException {
+		JspWriter out = pageContext.getOut();
+        try {
+            out.write(createTextareaTag());
+        } catch (Exception e) {
+        	try {
+				HttpServletResponse resp = (HttpServletResponse) 
+														pageContext.getResponse();
+				resp.reset();
+				resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
+								"Problem with creating tag");
+			} catch (IOException e1) {
+				throw new JspException(e1);
+			}
+        }
+        return EVAL_PAGE;
+	}
+	
+	
+	@Override
+	protected String getTagOutput(final CKEditorConfig config) {
+		if (config != null && !config.isEmpty()) {            	
+        	return "CKEDITOR.replace('" + editor + "', " 
+        							+ TagHelper.jsEncode(config) + ");";
+        } else {
+        	return "CKEDITOR.replace('" + editor + "');";	
+        }   
+	}
+
+	/**
+	 * creates HTML code to insert textarea into page.
+	 * @return textarea code.
+	 */
+	private String createTextareaTag() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("<textarea name=\"");
+		sb.append(editor);
+		sb.append("\" ");
+		sb.append(createTextareaAttributesText());
+		sb.append(" >");
+		sb.append(value);
+		sb.append("</textarea>");
+		sb.append("\n");
+		return sb.toString();
+	}
+
+	/**
+	 * Creates string from textarea attributes map.
+	 * @return textarea attributes string.
+	 */
+	private String createTextareaAttributesText() {
+		if (textareaAttributes.isEmpty()) {
+			textareaAttributes.put("rows", DEFAULT_TEXTAREA_ROWS);
+			textareaAttributes.put("cols", DEFAULT_TEXTAREA_COLS);
+		}
+		StringBuilder sb = new StringBuilder();
+		for (String s : textareaAttributes.keySet()) {
+			sb.append(" ");
+			sb.append(s + "=\"" + textareaAttributes.get(s) + "\"");			
+		}
+		return sb.toString();
+	}
+
+
+
+	/**
+	 * @return the editor
+	 */
+	public final String getEditor() {
+		return editor;
+	}
+
+	/**
+	 * @param editor the editor to set
+	 */
+	public final void setEditor(final String editor) {
+		this.editor = editor;
+	}
+
+	/**
+	 * @return the value
+	 */
+	public final String getValue() {
+		return value;
+	}
+
+	/**
+	 * @param value the value to set
+	 */
+	public final void setValue(final String value) {
+		this.value = value;
+	}
+	
+	/**
+	 * @return the textareaAttributes
+	 */
+	public final Map<String, String> getTextareaAttributes() {
+		return textareaAttributes;
+	}
+
+	/**
+	 * @param textareaAttr the textareaAttributes to set
+	 */
+	public final void setTextareaAttributes(final Map<String, String> textareaAttr) {
+		this.textareaAttributes = textareaAttr;
+	}	
+	
+	
+	
+}
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorReplaceAllTag.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorReplaceAllTag.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorReplaceAllTag.java	(revision 6775)
@@ -0,0 +1,67 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+package com.ckeditor;
+
+/**
+ * &lt;ck:repalceAll&gt; tag code.
+ * <b>Usage:</b>
+ * <pre>&lt;ckeditor:replaceAll basePath="../../ckeditor/" /&gt;</pre>
+ */
+public class CKEditorReplaceAllTag extends CKEditorTag {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7331873466295495480L;
+	private String className;
+
+	/**
+	 * Default constructor.
+	 */
+	public CKEditorReplaceAllTag() {
+		this.className = "";
+	}
+	
+	@Override
+	protected String getTagOutput(final CKEditorConfig config) {
+		if (config == null || config.isEmpty()) {
+			if (className == null || "".equals(className)) {
+				return "CKEDITOR.replaceAll();";
+			} else {
+				return "CKEDITOR.replaceAll('" + className + "');";
+			}
+		} else {
+			StringBuilder sb = new StringBuilder(
+					"CKEDITOR.replaceAll( function(textarea, config) {\n");
+			if (className == null || "".equals(className)) {
+				sb.append("	var classRegex = new RegExp('(?:^| )' + '");
+				sb.append(className);
+				sb.append("' + '(?:$| )');\n");
+				sb.append("	if (!classRegex.test(textarea.className))\n");
+				sb.append("		return false;\n");
+			}
+			sb.append("	CKEDITOR.tools.extend(config, ");
+			sb.append(TagHelper.jsEncode(config));
+			sb.append(", true);} );");
+			return sb.toString();
+		}
+	}
+
+	/**
+	 * @return the className
+	 */
+	public final String getClassName() {
+		return className;
+	}
+
+	/**
+	 * @param className the className to set
+	 */
+	public final void setClassName(final String className) {
+		this.className = className;
+	}
+
+	
+}
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorReplaceTag.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorReplaceTag.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorReplaceTag.java	(revision 6775)
@@ -0,0 +1,53 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+package com.ckeditor;
+
+
+/**
+ * &lt;ck:repalce&gt; tag code.
+ * <b>Usage:</b>
+ * <pre>&lt;ckeditor:replace  replace="editor1" basePath="../../ckeditor/" /&gt;</pre>
+ */
+public class CKEditorReplaceTag extends CKEditorTag {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1316780332328233835L;
+	private String replace;
+
+	/**
+	 * Default constructor.
+	 */
+	public CKEditorReplaceTag() {
+		replace = "";
+	}
+	
+	@Override
+	protected String getTagOutput(final CKEditorConfig config) {
+		if (config != null && !config.isEmpty()) {          	
+        	return "CKEDITOR.replace('" + replace + "', " 
+        							+ TagHelper.jsEncode(config) + ");";
+        } else {
+        	return "CKEDITOR.replace('" + replace + "');";	
+        }
+	}
+
+	/**
+	 * @return the replace
+	 */
+	public final String getReplace() {
+		return replace;
+	}
+
+	/**
+	 * @param replace the replace to set
+	 */
+	public final void setReplace(final String replace) {
+		this.replace = replace;
+	}
+
+
+}
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorTag.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorTag.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorTag.java	(revision 6775)
@@ -0,0 +1,198 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+package com.ckeditor;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.tagext.TagSupport;
+
+/**
+ * Base class for CKEditor tags.
+ */
+public abstract class CKEditorTag extends TagSupport {
+	
+	private static final String TIMESTAMP = "B37D54V";
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5642419066547779817L;
+	private String basePath;
+	private String timestamp;
+	private boolean initialized;
+	private CKEditorConfig config;
+	private EventHandler events;
+	private GlobalEventHandler globalEvents;
+		
+	/**
+	 * Default constructor.
+	 */
+	public CKEditorTag() {
+		timestamp = "B37D54V";		
+		basePath = "";
+		initialized = false;
+		config = null;
+		events = null;
+	}
+	
+
+	@Override
+	public int doEndTag() throws JspException {
+		JspWriter out = pageContext.getOut();
+        try {
+        	String output = "";
+            if (!isInitialized()) {
+            	out.write(init());	
+            }  
+            if (globalEvents != null) {
+            	output += globalEvents.returnGlobalEvents();	
+            }
+            CKEditorConfig cfg = null;
+            if (config != null) {
+            	cfg = config.configSettings(this.events);	
+            }            
+            output += getTagOutput(cfg);                       
+            out.write(TagHelper.script(output));
+        } catch (Exception e) {
+        	try {
+				HttpServletResponse resp = (HttpServletResponse) 
+														pageContext.getResponse();
+				resp.reset();
+				resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
+								"Problem with creating tag");
+				e.printStackTrace();
+			} catch (IOException e1) {
+				throw new JspException(e1);
+			}
+        }
+        return EVAL_PAGE;
+	}
+	
+	/**
+	 * Method retruns standard tag output.
+	 * @param config config resolved to string
+	 * @return tag standard output
+	 */
+	protected abstract String getTagOutput(final CKEditorConfig config);
+	
+	/**
+	 * Init metod for tags.
+	 * @return include ckfinder.js code with attributes and additional code.
+	 */
+	protected String init() {
+		String out = "";
+		String args = "";
+		String ckeditorPath = basePath;
+		if (timestamp != null) {
+			args += "?t=" + timestamp;
+		}
+		if (ckeditorPath.contains("..")) {
+			out += TagHelper.script("window.CKEDITOR_BASEPATH='" +  ckeditorPath  + "';");
+		}
+		out += TagHelper.createCKEditorIncJS(ckeditorPath, args);
+		
+		String extraCode = "";
+		if (timestamp != TIMESTAMP) {
+			extraCode += (extraCode.length() > 0) ? "\n" : ""
+				.concat("CKEDITOR.timestamp = '")
+				.concat(timestamp)
+				.concat("';");
+		}
+		if (extraCode.length() > 0) {
+			out += extraCode;
+		}
+		return out;
+	}	
+
+	/**
+	 * @return the basePath
+	 */
+	public final String getBasePath() {
+		return basePath;
+	}
+
+	/**
+	 * @param basePath the basePath to set
+	 */
+	public final void setBasePath(final String basePath) {
+		this.basePath = basePath;
+	}
+
+	/**
+	 * @return the timestamp
+	 */
+	public final String getTimestamp() {
+		return timestamp;
+	}
+
+	/**
+	 * @param timestamp the timestamp to set
+	 */
+	public final void setTimestamp(final String timestamp) {
+		this.timestamp = timestamp;
+	}
+
+	/**
+	 * @return the initialized
+	 */
+	public final boolean isInitialized() {
+		return initialized;
+	}
+
+	/**
+	 * @param initialized the initialized to set
+	 */
+	public final void setInitialized(final boolean initialized) {
+		this.initialized = initialized;
+	}
+
+	/**
+	 * @return the globalEvents
+	 */
+	public final GlobalEventHandler getGlobalEvents() {
+		return globalEvents;
+	}
+
+	/**
+	 * @param globalEvents the globalEvents to set
+	 */
+	public final void setGlobalEvents(final GlobalEventHandler globalEvents) {
+		this.globalEvents = globalEvents;
+	}
+
+
+	/**
+	 * @return the config
+	 */
+	public final CKEditorConfig getConfig() {
+		return config;
+	}
+
+	/**
+	 * @param config the config to set
+	 */
+	public final void setConfig(final CKEditorConfig config) {
+		this.config = config;
+	}
+	
+	/**
+	 * @return the events
+	 */
+	public final EventHandler getEvents() {
+		return events;
+	}
+
+	/**
+	 * @param events the events to set
+	 */
+	public final void setEvents(final EventHandler events) {
+		this.events = events;
+	}
+
+
+
+}
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/EventHandler.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/EventHandler.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/EventHandler.java	(revision 6775)
@@ -0,0 +1,67 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+package com.ckeditor;
+
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * CKEditor event handler class.
+ * <b>Usage:</b>
+ * <pre>
+  		EventHandler eventHandler = new EventHandler();
+		eventHandler.addEvent("instanceReady","function (ev) {    
+            alert(\"Loaded: \" + ev.editor.name); }");
+  </pre>
+ */
+public class EventHandler {
+
+	protected Map<String, Set<String>> events;
+	
+	/**
+	 * Default constructor.
+	 */
+	public EventHandler() {
+		events = new HashMap<String, Set<String>>();
+	}
+	
+	/**
+	 * Adds global event listener.
+	 * @param event Event name
+	 * @param jsCode Javascript anonymous function or function name
+	 */
+	public void addEvent(final String event, final String jsCode) { 
+		if (events.get(event) == null) {
+			events.put(event, new LinkedHashSet<String>());
+		}		
+		events.get(event).add(jsCode);		
+	}
+	
+	/**
+	 * Clear registered global event handlers.
+	 * @param event Event name, if null all event handlers will be removed (optional).
+	 */
+	public void clearEventHandlers(final String event) {
+		if (event == null) {
+			events = new HashMap<String, Set<String>>();
+		} else {
+			if (events.get(event) != null) {
+				events.get(event).clear();
+			}
+		}
+	}
+	
+	/**
+	 * Gets all registered events.
+	 * @return all registered events.
+	 */
+	public Map<String, Set<String>> getEvents() {
+		return events;
+	}
+	
+}
+
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/GlobalEventHandler.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/GlobalEventHandler.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/GlobalEventHandler.java	(revision 6775)
@@ -0,0 +1,49 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+package com.ckeditor;
+
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * CKEditor global events class.
+ * <b>Usage:</b>
+ * <pre>
+ 	GlobalEventHandler globalEventHandler = new GlobalEventHandler();
+	globalEventHandler.addEvent("dialogDefinition","function (ev) {  
+							alert(\"Loading dialog: \" + ev.data.name); }");
+	</pre>
+ */
+public class GlobalEventHandler extends EventHandler {
+
+	
+	private static Map<String, Set<String>> returndEvents;
+	
+	/**
+	 * Resolves global events to String.
+	 * @return global events resolved to String.
+	 */
+	String returnGlobalEvents() {
+		String out = "";
+		if (returndEvents == null) {
+			returndEvents = new HashMap<String, Set<String>>();
+		}
+		for (String event : events.keySet()) {
+			for (String code : events.get(event)) {
+				if (returndEvents.get(event) == null) {
+					returndEvents.put(event, new LinkedHashSet<String>());
+				}
+				out += (!code.equals("") ? "\n" : "") 
+							+ "CKEDITOR.on('" + event + "', " + code + ");";
+				returndEvents.get(event).add(code);
+				
+			}
+		}
+		return out;
+	}
+	
+}
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/TagHelper.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/TagHelper.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/TagHelper.java	(revision 6775)
@@ -0,0 +1,187 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+package com.ckeditor;
+
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * Helper class for CKEditor tags.
+ */
+public class TagHelper {
+	
+	private static final String[] CHARS_FROM 
+					= {"\\", "/", "\n", "\t", "\r", "\0c", "\0c", "\""};
+	private static final String[] CHARS_TO 
+					= {"\\\\", "\\/", "\\\n", "\\\t", "\\\r", "\\\b", "\\\f", "\\\""};
+	
+	/**
+	 * Wrap string with javascript tag.
+	 * @param input input string
+	 * @return input wrapped with javascript tag
+	 */
+	public static String script(final String input) {
+		String out = "<script type=\"text/javascript\">";
+		out += "//<![CDATA[\n";
+		out += input;
+		out += "\n//]]>";
+		out += "</script>\n";		
+		return out;
+	}
+	
+	/**
+	 * Creates javascript code for include ckeditor.js.
+	 * @param basePath ckeditor base path
+	 * @param args script agruments.
+	 * @return javascript code
+	 */
+	public static String createCKEditorIncJS(final String basePath, final String args) {
+		return "<script type=\"text/javascript\" src=\"" 
+				+ basePath + "ckeditor.js" + args + "\"></script>\n";
+	}
+
+	/**
+	 * Provides a basic JSON support.
+	 * @param o object to encode
+	 * @return encoded config object value
+	 */
+	@SuppressWarnings("unchecked")
+	public static String jsEncode(final Object o) {
+		if (o == null) {
+			return "null";
+		}
+		if (o instanceof String) {
+			return jsEncode((String) o);
+		}
+		if (o instanceof Number) {
+			return jsEncode((Number) o);
+		}
+		if (o instanceof Boolean) {
+			return jsEncode((Boolean) o);
+		}
+		if (o instanceof Map) {
+			return jsEncode((Map<String, Object>) o);
+		}
+		if (o instanceof List) {
+			return jsEncode((List<Object>) o);
+		}
+		if (o instanceof CKEditorConfig) {
+			return jsEncode((CKEditorConfig) o);
+		}			
+		return "";
+	}
+	
+	/**
+	 * Provides a basic JSON support for String.
+	 * @param s string to encode
+	 * @return encoded config string value
+	 */
+	public static String jsEncode(final String s) {
+		if (s.indexOf("@@") == 0) {
+			return s.substring(2);	
+		}
+		if (s.length() > 9
+				&& s.substring(0, 9).toUpperCase().equals("CKEDITOR.")) {
+			return s;
+		}			
+		return clearString(s);
+	}
+	
+	/**
+	 * Provides a basic JSON support for Number.
+	 * @param n Number to encode
+	 * @return encoded Number value
+	 */
+	public static String jsEncode(final Number n) {
+		return n.toString().replace(",", ".");
+	}
+	
+	/**
+	 * Provides a basic JSON support for Boolean.
+	 * @param b boolean to encode
+	 * @return encoded boolean value
+	 */
+	public static String jsEncode(final Boolean b) {
+		return b.toString();	
+	}
+	
+	/**
+	 * Provides a basic JSON support for Map.
+	 * @param map map to encode
+	 * @return encoded map value
+	 */
+	public static String jsEncode(final Map<String, Object> map) {
+		StringBuilder sb = new StringBuilder("{");
+		
+		for (Object obj : map.keySet()) {
+			if (sb.length() > 1) {
+				sb.append(",");
+			}
+			sb.append(jsEncode(obj));
+			sb.append(":");				
+			sb.append(jsEncode(map.get(obj)));
+		}
+		sb.append("}");
+		return sb.toString();
+	}
+	
+	/**
+	 * Provides a basic JSON support for List.
+	 * @param list List to encode
+	 * @return encoded List value
+	 */
+	public static String jsEncode(final List<Object> list) {
+		StringBuilder sb = new StringBuilder("[");
+		for (Object obj : list) {
+			if (sb.length() > 1) {
+				sb.append(",");
+			}
+			sb.append(jsEncode(obj));
+		}
+		sb.append("]");
+		return sb.toString();
+	}
+	
+	/**
+	 * Provides a basic JSON support for config.
+	 * @param config config to encode
+	 * @return encoded config value
+	 */
+	public static String jsEncode(final CKEditorConfig config) {
+		StringBuilder sb = new StringBuilder("{");
+		
+		for (Object obj : config.getConfigValues().keySet()) {
+			if (sb.length() > 1) {
+				sb.append(",");
+			}
+			sb.append(jsEncode(obj));
+			sb.append(":");				
+			sb.append(jsEncode((config.getConfigValue((String) obj))));
+		}
+		sb.append("}");
+		return sb.toString();
+	}
+	
+	/**
+	 * Clears string from special chars and quote it.
+	 * @param s input string
+	 * @return cleared string
+	 */
+	private static String clearString(final String s) {
+		String string = s;
+		for (int i = 0; i < CHARS_FROM.length; i++) {
+			string = string.replace(CHARS_FROM[i], CHARS_TO[i]);
+		}
+		if (Pattern.compile("[\\[{].*[\\]}]").matcher(string).matches()) {
+			 return string;
+		} else {
+			return "\"" + string + "\"";	
+		}
+		
+	}
+
+	
+}
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/package-info.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/package-info.java	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/package-info.java	(revision 6775)
@@ -0,0 +1,8 @@
+/*
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see http://ckeditor.com/license
+*/
+/**
+ * 
+ */
+package com.ckeditor;
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/resources/META-INF/MANIFEST.MF	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/resources/META-INF/MANIFEST.MF	(revision 6775)
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Implementation-Title: CKEditor for Java Integration
+Implementation-Version: 3.5.3
+Implementation-Vendor-Id: com.ckeditor
+Implementation-URL: http://ckeditor.com
+Built-By: CKSource - Frederico Knabben
+Build-Jdk: 1.6.0_22
Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/resources/META-INF/ckeditor.tld
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/resources/META-INF/ckeditor.tld	(revision 6775)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/resources/META-INF/ckeditor.tld	(revision 6775)
@@ -0,0 +1,276 @@
+<!DOCTYPE taglib
+  PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+   "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+<!-- a tab library descriptor -->
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
+	http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
+	version="2.0">
+	<tlib-version>3.5.3</tlib-version>
+	<display-name>CKEditor for Java Tag Library</display-name>
+	<jsp-version>1.2</jsp-version>
+	<short-name>ckeditor</short-name>
+	<uri>http://ckeditor.com</uri>
+
+	<description>
+		The CKEditor Tag Library offers a very convenient way to create
+		several CKEditor instances with different configurations.
+		Additionally, you can check for user-based capabilities.
+	</description>
+
+	<tag>
+		<display-name>replace</display-name>
+		<name>replace</name>
+		<tag-class>com.ckeditor.CKEditorReplaceTag</tag-class>
+		<body-content>JSP</body-content>
+		<example><![CDATA[
+			<ckeditor:replace replace="editor1" basePath="ckeditor/" />]]></example>
+
+		<attribute>
+			<name>basePath</name>
+			<required>true</required>
+			<rtexprvalue>true</rtexprvalue>
+			<description>Path to CKEditor folder</description>
+		</attribute>
+
+		<attribute>
+			<name>replace</name>
+			<required>true</required>
+			<rtexprvalue>true</rtexprvalue>
+			<description>Name of textarea HTML tag to replace.</description>
+		</attribute>
+
+		<attribute>
+			<name>timestamp</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+		</attribute>
+
+		<attribute>
+			<name>initialized</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>boolean</type>
+			<description>initalization of ckeditor.js. If false ckeditor.js is
+			included on the page.</description>
+		</attribute>
+
+		<attribute>
+			<name>config</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.CKEditorConfig</type>
+			<description>
+				CKEditor configuration. Example:
+				<![CDATA[
+				CKEditorConfig config2 = new CKEditorConfig();
+				config2.addConfigValue("toolbar","[[ 'Source', '-', 'Bold', 'Italic' ]]");
+				]]>				
+			</description>
+		</attribute>
+
+		<attribute>
+			<name>events</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.EventHandler</type>
+			<description>Events for CKEditor. Example:
+				<![CDATA[
+				EventHandler eventHandler = new EventHandler();
+				eventHandler.addEvent("instanceReady","function (ev) {      
+						          alert(\"Loaded: \" + ev.editor.name); }");
+				]]>
+			</description>
+		</attribute>
+
+		<attribute>
+			<name>globalEvents</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.GlobalEventHandler</type>
+			<description>Global events for CKEditor. Example:
+				<![CDATA[GlobalEventHandler globalEventHandler = new GlobalEventHandler();
+				globalEventHandler.addEvent("dialogDefinition","function (ev) {  alert(\"Loading dialog: \" + ev.data.name); }");
+				]]>
+			</description>
+		</attribute>
+
+	</tag>
+
+	<tag>
+		<display-name>editor</display-name>
+		<name>editor</name>
+		<tag-class>com.ckeditor.CKEditorInsertTag</tag-class>
+		<body-content>JSP</body-content>
+		<example><![CDATA[
+			<ckeditor:editor basePath="../../ckeditor/" editor="editor1" value="This is CKEditor" />]]></example>
+
+		<attribute>
+			<name>basePath</name>
+			<required>true</required>
+			<rtexprvalue>true</rtexprvalue>
+			<description>Path to CKEditor folder</description>
+		</attribute>
+
+		<attribute>
+			<name>editor</name>
+			<required>true</required>
+			<rtexprvalue>true</rtexprvalue>
+			<description>Name of textarea inserted and replaced with CKEditor.</description>
+		</attribute>
+
+		<attribute>
+			<name>value</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<description>Default CKEditor text value.</description>
+		</attribute>
+		
+		<attribute>
+			<name>textareaAttributes</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>java.util.Map</type>
+			<description>Attributes of textarea to insert. Example:
+				
+				<![CDATA[Map<String, String> attr = new HashMap<String, String>();
+				attr.put("rows", "8");
+				attr.put("cols", "50");]]>			
+			</description>
+		</attribute>
+
+		<attribute>
+			<name>timestamp</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+		</attribute>
+
+		<attribute>
+			<name>initialized</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>boolean</type>
+			<description>initalization of ckeditor.js. If false ckeditor.js is
+			included on the page.</description>
+		</attribute>
+
+		<attribute>
+			<name>config</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.CKEditorConfig</type>
+			<description>
+				CKEditor configuration. Example:
+				<![CDATA[
+				CKEditorConfig config2 = new CKEditorConfig();
+				config2.addConfigValue("toolbar","[[ 'Source', '-', 'Bold', 'Italic' ]]");
+				]]>				
+			</description>
+		</attribute>
+
+		<attribute>
+			<name>events</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.EventHandler</type>
+			<description>Events for CKEditor. Example:
+				<![CDATA[
+				EventHandler eventHandler = new EventHandler();
+				eventHandler.addEvent("instanceReady","function (ev) {      
+						          alert(\"Loaded: \" + ev.editor.name); }");
+				]]>
+			</description>
+		</attribute>
+
+		<attribute>
+			<name>globalEvents</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.GlobalEventHandler</type>
+			<description>Global events for CKEditor. Example:
+				<![CDATA[GlobalEventHandler globalEventHandler = new GlobalEventHandler();
+				globalEventHandler.addEvent("dialogDefinition","function (ev) {  alert(\"Loading dialog: \" + ev.data.name); }");
+				]]>
+			</description>
+		</attribute>
+	</tag>
+	
+	<tag>
+		<display-name>replaceAll</display-name>
+		<name>replaceAll</name>
+		<tag-class>com.ckeditor.CKEditorReplaceAllTag</tag-class>
+		<body-content>JSP</body-content>
+
+		<attribute>
+			<name>basePath</name>
+			<required>true</required>
+			<rtexprvalue>true</rtexprvalue>
+			<description>Path to CKEditor folder</description>
+		</attribute>
+
+		<attribute>
+			<name>className</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<description>Name of CSS class of textarea elements to replace</description>
+		</attribute>
+
+		<attribute>
+			<name>timestamp</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+		</attribute>
+
+		<attribute>
+			<name>initialized</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>boolean</type>
+			<description>initalization of ckeditor.js. If false ckeditor.js is
+			included on the page.</description>
+		</attribute>
+
+		<attribute>
+			<name>config</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.CKEditorConfig</type>
+			<description>
+				CKEditor configuration. Example:
+				<![CDATA[
+				CKEditorConfig config2 = new CKEditorConfig();
+				config2.addConfigValue("toolbar","[[ 'Source', '-', 'Bold', 'Italic' ]]");
+				]]>				
+			</description>
+		</attribute>
+
+		<attribute>
+			<name>events</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.EventHandler</type>
+			<description>Events for CKEditor. Example:
+				<![CDATA[
+				EventHandler eventHandler = new EventHandler();
+				eventHandler.addEvent("instanceReady","function (ev) {      
+						          alert(\"Loaded: \" + ev.editor.name); }");
+				]]>
+			</description>
+		</attribute>
+
+		<attribute>
+			<name>globalEvents</name>
+			<required>false</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>com.ckeditor.GlobalEventHandler</type>
+			<description>Global events for CKEditor. Example:
+				<![CDATA[GlobalEventHandler globalEventHandler = new GlobalEventHandler();
+				globalEventHandler.addEvent("dialogDefinition","function (ev) {  alert(\"Loading dialog: \" + ev.data.name); }");
+				]]>
+			</description>
+		</attribute>
+
+	</tag>
+</taglib>
Index: /CKEditor.Java/ckeditor-java/trunk/pom.xml
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/pom.xml	(revision 6775)
+++ /CKEditor.Java/ckeditor-java/trunk/pom.xml	(revision 6775)
@@ -0,0 +1,87 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.ckeditor</groupId>
+	<artifactId>ckeditor-java</artifactId>
+	<name>CKEditor for Java</name>
+	<description>CKEditor Server Side Integration for Java with samples.
+	This Java library enables CKEditor to be used in a Servlet/J2EE
+	environment. It provides JSP tags for creating a CKEditor instance.
+	Samples and CKEditor (the editor) are included.</description>
+	<version>3.5.3-SNAPSHOT</version>
+	<url>http://ckeditor.com</url>
+	<inceptionYear>2003</inceptionYear>
+	<licenses>
+		<license>
+			<name>GNU General Public License Version 2 or later (GPL)</name>
+			<url>http://www.gnu.org/licenses/gpl.html</url>
+		</license>
+		<license>
+			<name>GNU Lesser General Public License Version 2.1 (LGPL)</name>
+			<url>http://www.gnu.org/licenses/lgpl.html</url>
+		</license>
+		<license>
+			<name>Mozilla Public License Version 1.1 or later (MPL)</name>
+			<url>http://www.mozilla.org/MPL/MPL-1.1.html</url>
+		</license>
+	</licenses>
+	<packaging>war</packaging>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+					<encoding>utf-8</encoding>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-resources-plugin</artifactId>
+				<version>2.2</version>
+				<configuration>
+					<encoding>UTF-8</encoding>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-clean-plugin</artifactId>
+				<version>2.4.1</version>
+				<configuration>
+					<filesets>
+						<fileset>
+							<directory>src/main/webapp</directory>
+							<includes>
+								<include>**/*.php</include>
+								<include>**/*.asp</include>
+							</includes>
+							<followSymlinks>false</followSymlinks>
+						</fileset>
+						<fileset>
+							<directory>src/main/webapp/ckeditor/_samples/asp</directory>
+							<followSymlinks>false</followSymlinks>
+						</fileset>
+						<fileset>
+							<directory>src/main/webapp/ckeditor/_samples/adobeair</directory>
+							<followSymlinks>false</followSymlinks>
+						</fileset>
+						<fileset>
+							<directory>src/main/webapp/ckeditor/_samples/php</directory>
+							<followSymlinks>false</followSymlinks>
+						</fileset>
+					</filesets>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>com.ckeditor</groupId>
+			<artifactId>ckeditor-java-core</artifactId>
+			<version>3.5.3</version>
+		</dependency>
+	</dependencies>
+</project>
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/WEB-INF/web.xml	(revision 6775)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/WEB-INF/web.xml	(revision 6775)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="WebApp_ID" version="2.4"
+	xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+	<session-config>
+		<session-timeout>10</session-timeout>
+	</session-config>
+	
+	<jsp-config>
+		<taglib>
+			<taglib-uri>/WEB-INF/ckeditor</taglib-uri>
+			<taglib-location>/WEB-INF/ckeditor.tld</taglib-location>
+		</taglib>
+	</jsp-config>
+</web-app>
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/advanced.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/advanced.jsp	(revision 6775)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/advanced.jsp	(revision 6775)
@@ -0,0 +1,79 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
+<%@page import="com.ckeditor.CKEditorConfig"%>
+<%@page import="com.ckeditor.EventHandler"%>
+<%@page import="java.util.ArrayList"%>
+<%@page import="java.util.List"%>
+<%@page import="java.util.HashMap"%>
+<%@page import="java.util.Map"%>
+<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Creating CKEditor Instances &mdash; CKEditor Sample</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link type="text/css" rel="stylesheet" href="../ckeditor/_samples/sample.css" />
+</head>
+<body>
+	<h1 class="samples">
+		CKEditor Sample &mdash; Creating CKEditor Instances
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML code that you will usually find in your pages. -->
+	<form action="#" method="post">
+		<p>
+			<label for="editor1">
+				Editor 1:</label>
+		</p>
+		<p>
+			<% 
+				String value = "My first CKEditor Java tag"; 
+				CKEditorConfig config2 = new CKEditorConfig();
+				config2.addConfigValue("width", "80%");
+				config2.addConfigValue("toolbar", "Basic");
+				EventHandler eventHandler = new EventHandler();
+				eventHandler.addEvent("instanceReady", "function (ev) { alert(\"Loaded: \" + ev.editor.name); }");
+			%>
+			<ckeditor:editor initialized="false"
+				basePath="../ckeditor/" config="<%=config2 %>"
+				 editor="editor1" value="<%= value %>"
+				 events="<%=eventHandler %>"/>
+			 
+			<input type="submit" value="Submit"/>
+		</p>
+		<p>
+			<label for="editor2">
+				Editor 2:</label>
+			<textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+		</p>
+		<%
+			config2.removeConfigValue("width");
+			config2.addConfigValue("toolbar", "[['Styles'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript']]");
+			config2.addConfigValue("stylesSet", "[{name : 'Strong Emphasis', element : 'strong'}, {name : 'Emphasis', element : 'em'}, {name : 'Computer Code', element : 'code'}]");
+		%>
+		<ckeditor:replace basePath="../ckeditor/" config="<%=config2 %>" replace="editor2" initialized="true"/>
+	</form>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
+			Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/index.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/index.jsp	(revision 6775)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/index.jsp	(revision 6775)
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta content="text/html; charset=utf-8" http-equiv="content-type" />
+	<title>CKEditor Samples &mdash; Java Integration</title>
+	<link type="text/css" rel="stylesheet" href="../ckeditor/_samples/sample.css" />
+</head>
+<body>
+	<h1 class="samples">
+		CKEditor Samples List for Java
+	</h1>
+	<h2 class="samples">
+		Basic Samples
+	</h2>
+	<ul class="samples">
+		<li><a class="samples" href="replace.jsp">Replace existing textarea elements by code</a><br />
+		Replacement of selected textarea elements with CKEditor instances by using a JavaScript call.</li>
+		<li><a class="samples" href="replaceAll.jsp">Replace all textarea elements by code</a><br />
+		Replacement of all textarea elements with CKEditor instances by using a JavaScript call.</li>		
+		<li><a class="samples" href="standalone.jsp">Create CKEditor instances in Java</a><br />
+		Creating a CKEditor instance (no initial textarea element is required).</li>
+		<li><a class="samples" href="advanced.jsp">Create CKEditor instances in Java with eventHandler</a><br />
+		Creating a CKEditor instance (no initial textarea element is required) with advanced settings.</li>
+	</ul>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replace.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replace.jsp	(revision 6775)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replace.jsp	(revision 6775)
@@ -0,0 +1,58 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
+<%@page import="java.util.HashMap"%>
+<%@page import="java.util.Map"%>
+<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Replace Selected Textarea Elements &mdash; CKEditor Sample</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link type="text/css" rel="stylesheet" href="../ckeditor/_samples/sample.css" />
+</head>
+<body>
+	<h1 class="samples">
+		CKEditor Sample &mdash;  Replace Selected Textarea Elements Using Java Code
+	</h1>
+	<div class="description">
+	<p>
+		This sample shows how to replace a selected <code>&lt;textarea&gt;</code> element
+		with a CKEditor instance by using Java code.
+	</p>
+	</div>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<form action="index.php" method="post">
+		<p>
+			<label for="editor1">
+				Editor 1:</label>
+			<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+		</p>
+		<p>
+			<input type="submit" value="Submit"/>
+		</p>
+	</form>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
+			Knabben. All rights reserved.
+		</p>
+	</div>	
+	<ckeditor:replace  replace="editor1" basePath="../ckeditor/" />
+</body>
+</html>
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replaceAll.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replaceAll.jsp	(revision 6775)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replaceAll.jsp	(revision 6775)
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Replace All Textarea Elements &mdash; CKEditor Sample</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link type="text/css" rel="stylesheet" href="../ckeditor/_samples/sample.css" />
+</head>
+<body>
+	<h1 class="samples">
+		CKEditor Sample &mdash; Replace All Textarea Elements Using JSP tag
+	</h1>
+	<div class="description">
+	<p>
+		This sample shows how to replace all <code>&lt;textarea&gt;</code> elements
+		with CKEditor by using JSP tag.
+	</p>
+	<p>
+		To replace all <code>&lt;textarea&gt;</code> elements, place the following call at any point
+		after the last <code>&lt;textarea&gt;</code> element:
+	</p>	
+	</div>
+	<!-- This <div> holds alert messages to be displayed in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<form action="#" method="post">
+		<p>
+			<label for="editor1">
+				Editor 1:</label>
+			<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+		</p>
+		<p>
+			<label for="editor2">
+				Editor 2:</label>
+			<textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+		</p>
+		<p>
+			<input type="submit" value="Submit"/>
+		</p>
+	</form>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
+			Knabben. All rights reserved.
+		</p>
+	</div>
+	<ckeditor:replaceAll basePath="../ckeditor/" />
+</body>
+</html>
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp	(revision 6775)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp	(revision 6775)
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
+<%@page import="com.ckeditor.CKEditorConfig"%>
+<%@page import="java.util.ArrayList"%>
+<%@page import="java.util.List"%>
+<%@page import="java.util.HashMap"%>
+<%@page import="java.util.Map"%>
+<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Creating CKEditor Instances &mdash; CKEditor Sample</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link type="text/css" rel="stylesheet" href="../ckeditor/_samples/sample.css" />
+</head>
+<body>
+	<h1 class="samples">
+		CKEditor Sample &mdash; Creating CKEditor Instances
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML code that you will usually find in your pages. -->
+	<form action="../sample_posteddata.php" method="post">
+		<p>
+			<label for="editor1">
+				Editor 1:</label>
+		</p>
+		<p>
+			<% 
+				String value = "My first <strong>CKEditor</strong> Java tag";
+				Map<String, String> attr = new HashMap<String, String>();
+				attr.put("rows", "8");
+				attr.put("cols", "50");
+				CKEditorConfig settings = new CKEditorConfig();
+				settings.addConfigValue("width", "500");
+				settings.addConfigValue("toolbar", "Basic");
+			%>
+			<ckeditor:editor textareaAttributes="<%=attr %>" initialized="false"
+				basePath="../ckeditor/" config="<%=settings %>"
+				editor="editor1" value="<%= value %>"
+				 />
+			<input type="submit" value="Submit"/>
+		</p>
+	</form>
+	<div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
+			Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/index.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/index.jsp	(revision 6775)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/index.jsp	(revision 6775)
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta content="text/html; charset=utf-8" http-equiv="content-type" />
+	<title>CKEditor for Java &mdash; Samples</title>
+	<link type="text/css" rel="stylesheet" href="ckeditor/_samples/sample.css" />
+</head>
+<body>
+	<h1 class="samples">
+		CKEditor for Java
+	</h1>
+	<p>
+		The samples of CKEditor integration are available in the <a class="samples" href="_samples/index.jsp">_samples folder</a>.
+	</p>
+	<h2 class="samples">
+		Useful Links
+	</h2>
+	<ul class="samples">
+		<li><a class="samples" href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide">CKEditor for Java - Documentation</a><br />The official documentation website.</li>
+	</ul>
+    <div id="footer">
+		<hr />
+		<p>
+			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
