Author: mfortun Date: 2011-08-11 18:09:18 +0200 (Thu, 11 Aug 2011) New Revision: 1124 Url: http://nuiton.org/repositories/revision/wikitty/1124 Log: *improve mimetype handling, still need to load mimetype helper config from properties file Added: trunk/wikitty-publication/src/main/resources/mimetype.properties Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/MimeTypePubHelper.java trunk/wikitty-publication/src/site/rst/sync.rst Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/MimeTypePubHelper.java =================================================================== --- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/MimeTypePubHelper.java 2011-08-11 14:33:36 UTC (rev 1123) +++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/MimeTypePubHelper.java 2011-08-11 16:09:18 UTC (rev 1124) @@ -29,6 +29,7 @@ import javax.script.ScriptEngineManager; import org.apache.commons.collections.BidiMap; import org.apache.commons.collections.bidimap.DualHashBidiMap; +import org.nuiton.util.ApplicationConfig; import org.nuiton.util.StringUtil; import org.nuiton.wikitty.ScriptEvaluator; @@ -56,6 +57,7 @@ static public String PUBLICATION_MIME_SEP="."; static public String PREFIX_MIME_PUB_TEXT= "text"; + static public String MIME_PROPERTIE="mimetype.properties"; /** * match pub text that must be converted via ui decorateur * text/\w*\.\w* @@ -78,8 +80,9 @@ manager = ScriptEvaluator.getScriptEnginManager(null); + // TODO mfortun-2011-08-11 need to load thos properties from the file + bidiMap.put("wp", "text/javascript"); - //bidiMap.put("js", "text/javascript"); bidiMap.put("htmljs", "text/html.javascript"); bidiMap.put("jpg", "image/jpeg"); bidiMap.put("png", "image/png"); Added: trunk/wikitty-publication/src/main/resources/mimetype.properties =================================================================== --- trunk/wikitty-publication/src/main/resources/mimetype.properties (rev 0) +++ trunk/wikitty-publication/src/main/resources/mimetype.properties 2011-08-11 16:09:18 UTC (rev 1124) @@ -0,0 +1,16 @@ +# Properties file used by MimeTypePubHelper inside wikitty publication +# to define file that have to be transform with ui decorator +# and mime type for wikitty pub text +# +#MimeType that begin by "text/" are treat as wikittypubtext +# +# Mime type for wikittypubText that must be converted must have the syntaxe: +# text/xxx.yyy +# xxx.yyy is the filter option like html.javascript +# after transformation the mime type will be text/yyy (must have the scriptevaluator +# for this mime type) +text/javascript=wp +text/html.javascript=htmljs +image/jpeg=jpg +image/png=png +text/java=java \ No newline at end of file Modified: trunk/wikitty-publication/src/site/rst/sync.rst =================================================================== --- trunk/wikitty-publication/src/site/rst/sync.rst 2011-08-11 14:33:36 UTC (rev 1123) +++ trunk/wikitty-publication/src/site/rst/sync.rst 2011-08-11 16:09:18 UTC (rev 1124) @@ -1,6 +1,6 @@ +//TODO mettre que synchro sert aussi pour déplacer - Spécification Wikitty publication module de synchronisation =========================================================== :Authors: Manoël Fortun