Skip to content
Snippets Groups Projects
Commit eb4c933c authored by strentini's avatar strentini
Browse files

OO-41

remove legacy wikiMarkup form + RadeoxLibrary
parent 5d959603
No related branches found
No related tags found
No related merge requests found
Showing
with 2 additions and 1091 deletions
......@@ -2168,11 +2168,6 @@
<artifactId>velocity</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>radeox</groupId>
<artifactId>radeox</artifactId>
<version>1.0-b2</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
......
......@@ -581,20 +581,6 @@ public class VelocityRenderDecorator {
return f.formatDateAndTime(date);
}
/**
* Interpret this string using the radeox wiki markup language
*
* @Deprecated The wiki markup area is no longer supported. In the legacy form
* infrastructure it's still there, but it won't be available in the
* new flexi forms. In flexi forms use the RichTextElement instead.
*
* @param wikiMarkupString The original string written in radeox markup
* @return String HTML formatted text
*/
@Deprecated
public String formatWikiMarkup(String wikiMarkupString) {
return Formatter.formatWikiMarkup(wikiMarkupString);
}
/**
* Wrapp given html code with a wrapper an add code to transform latex
......
......@@ -41,12 +41,6 @@ import java.util.regex.Pattern;
import org.apache.commons.lang.StringEscapeUtils;
import org.olat.core.commons.chiefcontrollers.BaseChiefController;
import org.olat.core.logging.LogDelegator;
import org.radeox.api.engine.RenderEngine;
import org.radeox.api.engine.context.InitialRenderContext;
import org.radeox.api.engine.context.RenderContext;
import org.radeox.engine.BaseRenderEngine;
import org.radeox.engine.context.BaseInitialRenderContext;
import org.radeox.engine.context.BaseRenderContext;
/**
* enclosing_type Description: <br>
......@@ -57,19 +51,8 @@ import org.radeox.engine.context.BaseRenderContext;
public class Formatter extends LogDelegator {
private Locale locale;
private static RenderEngine engineWithContext;
private static BaseRenderContext baseRenderContext;
static {
InitialRenderContext initialContext = new BaseInitialRenderContext();
Locale loc = new Locale("olat", "olat");
initialContext.set(RenderContext.INPUT_LOCALE, loc);
initialContext.set(RenderContext.OUTPUT_LOCALE, loc);
initialContext.set(RenderContext.INPUT_BUNDLE_NAME, "radeox_markup_olat");
initialContext.set(RenderContext.OUTPUT_BUNDLE_NAME, "radeox_markup_olat");
engineWithContext = new BaseRenderEngine(initialContext);
baseRenderContext = new BaseRenderContext();
}
/**
* Constructor for Formatter.
......@@ -510,64 +493,7 @@ public class Formatter extends LogDelegator {
}
/**
* renders wiki markup like _italic_ to XHTML see also www.radeox.org
* @Deprecated The wiki markup area is no longer supported. In the legacy form
* infrastructure it's still there, but it won't be available in the
* new flexi forms. In flexi forms use the RichTextElement instead.
*
* tested during migration and expanded to prevent radeox failures
*
* @param originalText
* @return result (rendered originalText) or null if originalText was null
*/
@Deprecated
public static String formatWikiMarkup(String oldValue) {
if (oldValue != null) {
String newValue = "";
// oldValue = oldValue.replaceAll("<>", "&lt;&gt;");
// oldValue = oldValue.replaceAll(Pattern.quote("[]"),
// "&#91;&#93;");
// prevent error with {$} interpreted as regexp
String marker1 = "piYie6Eigh0phafeiTuk4dahwahvoh7eedoegee2egh8xuj9phah8eop8iuk";
oldValue = oldValue.replaceAll(Pattern.quote("{$}"), marker1);
// \{code} will result in an error => convert
String marker2 = "RohbaeW7xahbohk8iewoo7thocaemaech2pahS8oe1UVohkohJiugaagaeco";
oldValue = oldValue.replaceAll(Pattern.quote("\\{code}"), marker2);
// radeox gets an error, if {code} is not a closed tag. prevent at
// least the case with one single statement.
int nrOfCodeStatements = countOccurrences(oldValue, "{code}");
String marker3 = "shagheiph6enieNo0theph9aique0EihoChae6ve2edie4Pohwaok8thaoda";
if (nrOfCodeStatements == 1) {
oldValue = oldValue.replaceAll(Pattern.quote("{code}"), marker3);
}
if (nrOfCodeStatements % 2 != 0 && nrOfCodeStatements != 1) {
Formatter fInst = Formatter.getInstance(new Locale("olat"));
fInst.log("There will be a Warning/NPE from Radeox soon, as there are not enough {code} statements in a text.");
fInst.log("Old value of text will be kept! " + oldValue);
}
//added for compatibility with wikimedia syntax used in the new wiki component. org.olat.core.gui.components.wiki.WikiMarkupComponent
//filters " ''' " for bold and " ''''' " for bold/italic
oldValue = oldValue.replaceAll("(^|>|[\\p{Punct}\\p{Space}]+)'{3}(.*?)'{3}([\\p{Punct}\\p{Space}]+|<|$)", "$1*$2*$3");
oldValue = oldValue.replaceAll("(^|>|[\\p{Punct}\\p{Space}]+)'{5}(.*?)'{5}([\\p{Punct}\\p{Space}]+|<|$)", "$1_*$2*_$3");
// try-catch not usable, as Radeox doesn't throw an exception,
// it just prints warnings and returns unconverted value!
newValue = engineWithContext.render(oldValue, baseRenderContext);
// convert back
newValue = newValue.replaceAll(marker1, Matcher.quoteReplacement("{$}"));
newValue = newValue.replaceAll(marker2, Matcher.quoteReplacement("\\{code}"));
newValue = newValue.replaceAll(marker3, Matcher.quoteReplacement("{code}"));
return newValue;
} else
return null;
}
private static int countOccurrences(String arg1, String arg2) {
int count = 0;
......
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*
*/
public class AngelFilter extends RegexReplaceFilter {
/**
*
*/
public AngelFilter() {
super("(O:-\\)|O:\\)|o:-\\)|o:\\))(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"angel\" class=\"b_emoticons_angel\"/>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*
*/
public class AngryFilter extends RegexReplaceFilter {
/**
*
*/
public AngryFilter() {
super("(:-@|:@)(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"angry\" class=\"b_emoticons_angry\"/>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*
*/
public class ConfusedFilter extends RegexReplaceFilter {
/**
*
*/
public ConfusedFilter() {
super("(:-S|:S|:-s|:s)(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"confused\" class=\"b_emoticons_confused\"/>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Description:<br>
* TODO: rhaag Class Description for CryFilter
*
* <P>
* Initial Date: 17.06.2009 <br>
* @author rhaag
*/
public class CryFilter extends RegexReplaceFilter {
public CryFilter(){
super(":-V", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"cry\" class=\"b_emoticons_cry\"/>");
}
}
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*
*/
public class DevilFilter extends RegexReplaceFilter {
/**
*
*/
public DevilFilter() {
super("(]:-\\)|]:\\)|]:->)(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/emoticicons/devil.gif") + "\" alt=\"devil\" />");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*
*/
public class EmbarrassedFilter extends RegexReplaceFilter {
/**
*
*/
public EmbarrassedFilter() {
super("(:-\\$|:\\$)(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"blushing\" class=\"b_emoticons_blushing\"/>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*
*/
public class ForumQuoteFilter extends RegexReplaceFilter {
/**
*
*/
public ForumQuoteFilter() {
super("^(\\&#62;|\\&gt;|>)(.*?)$", "<blockquote class=\"b_quote\">$2</blockquote>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
*/
package org.olat.core.util.radeox;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Description:<br>
* TODO: rhaag Class Description for GenericFilterForMigration
*
* <P>
* Initial Date: 16.06.2009 <br>
* @author rhaag
*/
public class GenericFilterForMigration extends RegexReplaceFilter {
public GenericFilterForMigration(){
super();
}
}
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Description:<br>
* Italic filter that is added for compatibillity with the wikimedia synatx form
* the WikiMarkupComponent. Filters " ''word-xy'' " and replaces it with <i>word-xy<i>
* <P>
* Initial Date: Jul 24, 2006 <br>
*
* @author guido
*/
public class ItalicFilter extends RegexReplaceFilter {
/**
*
*/
public ItalicFilter() {
super("(^|>|[\\p{Punct}\\p{Space}]+)'{2}(.*?)'{2}([\\p{Punct}\\p{Space}]+|<|$)", "$1<i>$2</i>$3");
}
}
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Description:<br>
* TODO: rhaag Class Description for KissFilter
*
* <P>
* Initial Date: 17.06.2009 <br>
* @author rhaag
*/
public class KissFilter extends RegexReplaceFilter {
public KissFilter(){
super(":-x|:-\\*|:\\*", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"kiss\" class=\"b_emoticons_kiss\"/>");
}
}
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import java.io.IOException;
import java.io.Writer;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.macro.BaseMacro;
import org.radeox.macro.parameter.MacroParameter;
/**
* Description:<BR>
* Implements the timemarker play wiki tag. still beta
*
* <P>
* Initial Date: Dec 22, 2004
*
* @author gnaegi
*/
public class MovieButtonMacro extends BaseMacro {
private static final String CONTROLLER_MOV = StaticMediaDispatcher.createStaticURIFor("movie/controller.mov");
private static final String NAME = "name";
private static final String STARTTIME = "start";
private static final String ENDTIME = "end";
private static final String ADDRESS = "url";
private static final String DISPLAYDURATION = "displayduration";
/**
*
*/
public MovieButtonMacro() {
super();
}
/**
* @see org.radeox.macro.Macro#getName()
*/
public String getName() {
return "movieButton";
}
/**
* @see org.radeox.macro.Macro#execute(java.io.Writer, org.radeox.macro.parameter.MacroParameter)
*/
public void execute(Writer writer, MacroParameter params) throws IllegalArgumentException, IOException {
String name = params.get(NAME);
String starttime = params.get(STARTTIME);
String endtime = params.get(ENDTIME);
String address = params.get(ADDRESS);
String displayduration = params.get(DISPLAYDURATION);
String displayname = params.getContent();
StringBuilder movieInfo = new StringBuilder();
movieInfo.append("<movieinfo>");
if (address != null) {
movieInfo.append("<address>");
movieInfo.append(address);
movieInfo.append("</address>");
}
if (name != null) {
movieInfo.append("<name>");
movieInfo.append(name);
movieInfo.append("</name>");
} else {
// default name
movieInfo.append("<name>remotelyControlled</name>");
}
if (starttime != null) {
movieInfo.append("<starttime>");
movieInfo.append(starttime);
movieInfo.append("</starttime>");
}
if (endtime != null) {
movieInfo.append("<endtime>");
movieInfo.append(endtime);
movieInfo.append("</endtime>");
}
if (displayname != null) {
movieInfo.append("<label>");
movieInfo.append(displayname);
movieInfo.append("</label>");
}
if (displayname != null) {
movieInfo.append("<displayname>");
movieInfo.append(displayname);
movieInfo.append("</displayname>");
}
movieInfo.append("</movieinfo>");
writer.write("<span class=\"b_wiki_timemarker_play\"><object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" width=\"17\" height=\"16\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\">");
writer.write("<param name=\"SRC\" value=\"" + CONTROLLER_MOV + "\">");
writer.write("<param name=\"CONTROLLER\" value=\"FALSE\">");
writer.write("<param name=\"AUTOPLAY\" value=\"FALSE\">");
writer.write("<param name=\"CACHE\" value=\"FALSE\">");
writer.write("<param name = \"MovieQTList\" value=");
writer.write("\"");
writer.write(movieInfo.toString());
writer.write("\">");
writer.write("<embed");
writer.write(" src=\"" + CONTROLLER_MOV + "\"");
writer.write(" width=\"17\" height=\"16\"");
writer.write(" controller=\"FALSE\"");
writer.write(" autoplay=\"FALSE\"");
writer.write(" cache=\"FALSE\"");
writer.write(" MovieQTList=");
writer.write("\"");
writer.write(movieInfo.toString());
writer.write("\"");
writer.write(" type=\"video/quicktime\"");
writer.write(" pluginspage=\"http://www.apple.com/quicktime/download/\">");
writer.write("</embed>");
writer.write("</object> ");
if (displayname != null) {
writer.write(displayname);
if (displayduration != null) {
writer.write(": ");
}
}
if (displayduration != null) {
writer.write(displayduration);
}
writer.write("</span>");
}
}
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import java.io.IOException;
import java.io.Writer;
import org.radeox.macro.BaseMacro;
import org.radeox.macro.parameter.MacroParameter;
/**
* Description:<BR>
* Implements timemarker movie viewer makro, still beta
* <P>
* Initial Date: Dec 22, 2004
*
* @author gnaegi
*/
public class MovieViewerMacro extends BaseMacro {
// allowed macro attributes
private static final String NAME = "name";
private static final String ADDRESS = "url";
private static final String WIDTH = "width";
private static final String HEIGHT = "height";
private static final String DISPLAYDURATION = "displayduration";
// default height and width of player window
private static final int DEFAULT_WIDTH = 320;
private static final int DEFAULT_HEIGHT = 240;
// additional pixels used by the video controller for sliding etc
private static final int CONTROLLER_HEIGHT = 16;
// offset to have enouth space
// height+60 (some browsers need this space) + 20 (to show playButton tag)
// width+40 (some browsers need this space)
private static final int HEIGHT_OFFSET = 80;
private static final int WIDTH_OFFSET = 40;
/**
*
*/
public MovieViewerMacro() {
super();
}
/**
* @see org.radeox.macro.Macro#getName()
*/
public String getName() {
return "movieViewer";
}
/**
* @see org.radeox.macro.Macro#execute(java.io.Writer, org.radeox.macro.parameter.MacroParameter)
*/
public void execute(Writer writer, MacroParameter params) throws IllegalArgumentException, IOException {
String name = params.get(NAME);
String address = params.get(ADDRESS);
String height = params.get(HEIGHT);
String width = params.get(WIDTH);
String displayduration = params.get(DISPLAYDURATION);
String displayname = params.getContent();
if (address == null) {
writer.write("<p>movieViewer: illegal format: missing attribute " + ADDRESS + "</p>");
return;
}
// default values for unset optional parameter
if (name == null) name = "remotelyControlled";
if (width == null) width = Integer.toString(DEFAULT_WIDTH);
if (height == null) height = Integer.toString(DEFAULT_HEIGHT);
try {
int iHeigt = Integer.parseInt(height);
height = Integer.toString(iHeigt + CONTROLLER_HEIGHT );
} catch (NumberFormatException e) {
// using default values
width = Integer.toString(DEFAULT_WIDTH);
height = Integer.toString(DEFAULT_HEIGHT + CONTROLLER_HEIGHT);
}
writer.write("<span class=\"b_wiki_timemarker_viewer\">");
// show popup link
writer.write("<a href=\"javascript:void(");
// open window a bit bitter than the movie size itself
String args = "width=" + (Integer.parseInt(width) + WIDTH_OFFSET) + ",height=" + (Integer.parseInt(height) + HEIGHT_OFFSET) + ",resizable=yes,scrollbars=yes";
writer.write("window.open(o_info.o_baseURI + '/movie/popup.html?maddress=' + encodeURIComponent('" + address + "') + '&mname=' + encodeURIComponent('" + name +
"') + '&displayname=' + encodeURIComponent('" + displayname + "') + '&displayduration=' + encodeURIComponent('" + displayduration + "') + '&width=" + width + "&height=" + height + "', '" + name +"', '" + args + "')");
writer.write(")\">Open movie player");
if (displayname != null) {
writer.write(": ");
writer.write(displayname);
if (displayduration != null) {
writer.write(": ");
}
}
if (displayduration != null) {
writer.write(displayduration);
}
writer.write("</a>");
writer.write("</span>");
}
}
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*
*/
public class OmgFilter extends RegexReplaceFilter {
/**
*
*/
public OmgFilter() {
super("(:-O|:O|:-o|:o)(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"ohoh\" class=\"b_emoticons_ohoh\"/>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*
*/
public class SadFilter extends RegexReplaceFilter {
/**
*
*/
public SadFilter() {
super("(:-\\(|:\\()(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"sad\" class=\"b_emoticons_sad\"/>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*/
public class ShadeFilter extends RegexReplaceFilter {
/**
*
*/
public ShadeFilter() {
super("(8-\\)|8\\))(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"cool\" class=\"b_emoticons_cool\"/>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*/
public class SmileFilter extends RegexReplaceFilter {
/**
*
*/
public SmileFilter() {
super("(:-\\)|:\\))(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"smile\" class=\"b_emoticons_smile\"/>");
}
}
\ No newline at end of file
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
*/
package org.olat.core.util.radeox;
import org.olat.core.defaults.dispatcher.StaticMediaDispatcher;
import org.radeox.filter.regex.RegexReplaceFilter;
/**
* Initial Date: Apr 14, 2004
*
* @author gnaegi
*
* Comment:
*
*/
public class TeethFilter extends RegexReplaceFilter {
/**
*
*/
public TeethFilter() {
super("(:-D|:D|:-d|:d)(\\s|$)", "<img src=\"" + StaticMediaDispatcher.createStaticURIFor("images/transparent.gif", false) + "\" alt=\"grin\" class=\"b_emoticons_grin\"/>");
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment