iMAG name imag / NodePadppSo

<% com.xpn.xwiki.api.Object obj = doc.getObject("imag.BasicClass"); if (obj != null) { String EWS_DBNAME = (String) obj.get("EWS_DBNAME");

//Call and use the page Common in space Groovy def grv=xwiki.parseGroovyFromPage("Groovy.Common");

//Call and use the page Translation in space Groovy def grvTrans=xwiki.parseGroovyFromPage("Groovy.Translation"); grvTrans.initRequest(request);

// Call and use HTML Cleaner to normalize on ONE segment. def grvHTMLFilter=xwiki.parseGroovyFromPage("Groovy.HTMLFilter");

// iMAG database access library def grvIMAGLib=xwiki.parseGroovyFromPage("imag.Lib"); grvIMAGLib.initLibrary(xwiki.sql.getDatabase(EWS_DBNAME), grv, grvTrans, grvHTMLFilter, xwiki, request, response, context);

String EWS_URL = (String) obj.get("EWS_URL"); String EWS_TITLE = (String) obj.get("EWS_TITLE"); String EWS_IMAG_URL = (String) obj.get("EWS_IMAG_URL"); String EWS_Slogan = (String) obj.get("EWS_Slogan"); String EWS_CORPUS = (String) obj.get("EWS_CORPUS"); String EWS_PROJET = (String) obj.get("EWS_PROJET"); String EWS_SL_name = (String) obj.get("EWS_SL"); String EWS_SL = grvTrans.getLanguageCode(EWS_SL_name); String EWS_MTSystem = (String) obj.get("EWS_MTSystem"); String EWS_DEFAULT_RATING = (String) obj.get("EWS_DEFAULT_RATING"); if (EWS_DEFAULT_RATING == null) EWS_DEFAULT_RATING = "10";

String EWS_BEGIN_TARGET_MARK = (String) obj.get("EWS_BEGIN_TARGET_MARK"); String EWS_END_TARGET_MARK = (String) obj.get("EWS_END_TARGET_MARK");

int EWS_MOD = 3 ; String EWS_MOD_string = (String) obj.get("EWS_MOD"); if (EWS_MOD_string !=null) EWS_MOD = Integer.valueOf(EWS_MOD_string).intValue();

int IMAG_SECURITY_LEVEL = 1; String IMAG_SECURITY_LEVEL_string = (String) obj.get("IMAG_SECURITY_LEVEL"); if (IMAG_SECURITY_LEVEL_string != null) IMAG_SECURITY_LEVEL = Integer.valueOf(IMAG_SECURITY_LEVEL_string).intValue();

String EWS_CONTROL_LANGUAGE_TYPE = (String) obj.get("EWS_CONTROL_LANGUAGE_TYPE");

Hashtable languages_source = new Hashtable(); languages_source.put(EWS_SL, EWS_URL);

String languages_source_string = (String) obj.get("languages_source");

if (languages_source_string != null && !languages_source_string.equals("")) { Stringsplit(" "); int idx Unhandle = 0; while (idx Unhandle < unhandle Languages.length-1) { String lang = unhandle Languages[idx Unhandle?.trim(); String url = unhandleLanguagesidx Unhandle+1?.trim(); // Cut '(' and ')' lang = lang.substring(1, lang.length()); lang = lang.substring(0, lang.length()-1); String lang_code = grvTrans.getLanguageCode(lang);

// System.out.println("languages_source: " + lang_code + ":" + url);

if (!languages_source.containsKey(lang_code) && url.toLowerCase().startsWith("http")) languages_source.put(lang_code, url); idxUnhandle = idxUnhandle + 2; } }

int prefixIndex = 1; Hashtable ulr_prefix = new Hashtable(); // tableau des préfix d'URL accepté dans un site, si les URL sont hors de ces préfixes, on ne suis plus. ulr_prefix.put(String.valueOf(prefixIndex), EWS_URL);

String ulr_prefix_string = (String) obj.get("ulr_prefix"); // System.out.println("ulr_prefix_string: " + ulr_prefix_string);

if (ulr_prefix_string != null && !ulr_prefix_string.equals("")) { Stringsplit(" "); int idx Prefix = 0; while (idx Prefix < ulr_prefixs.length) { String prefix = ulr_prefixs[idx Prefix?; idxPrefix++; if (!ulr_prefix.containsValue(prefix)) { prefixIndex++; ulr_prefix.put(String.valueOf(prefixIndex), prefix); // System.out.println("prefix: " + prefix); } } }

Hashtable language_code = new Hashtable(); language_code.put(EWS_SL, EWS_SL_name); // Put source language by default

String language_code_string = (String) obj.get("language_code"); // System.out.println("language_code_string:" + language_code_string);

if (language_code_string != null && !language_code_string.equals("")) { String] langs = language_code_string.split(",
?
.trim(); idxLang++; String lang_code = grvTrans.getLanguageCode(lang);

// System.out.println("language_code: " + lang_code + ":" + lang);

if (!language_code.containsKey(lang_code)) { language_code.put(lang_code, lang); } } } else { // Put at least a target language en-fr if (EWS_SL.equals("en")) language_code.put("fr", grvTrans.getLanguageName("fr")); else language_code.put("en", grvTrans.getLanguageName("en"));

}

String GroupName="XWiki."+EWS_PROJET+"Group"; String GroupMod="XWiki."+EWS_PROJET+"ModGroup"; String GroupAdmin="XWiki."+EWS_PROJET+"AdminGroup";

grvIMAGLib.sendTargetPage(EWS_URL, EWS_TITLE, EWS_IMAG_URL, EWS_Slogan, EWS_CORPUS, EWS_DBNAME, EWS_PROJET, EWS_SL, EWS_MTSystem, EWS_DEFAULT_RATING, EWS_BEGIN_TARGET_MARK, EWS_END_TARGET_MARK, EWS_MOD, IMAG_SECURITY_LEVEL, EWS_CONTROL_LANGUAGE_TYPE, languages_source, ulr_prefix, GroupName, GroupMod, GroupAdmin, language_code);

} %>


SAS AXiMAG © 2010 http://aximag.fr