001: /*
002: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004: */
005: package com.sun.portal.rproxy.rewriter.test.util;
006:
007: import com.sun.portal.rewriter.RewriterModule;
008: import com.sun.portal.log.common.PortalLogger;
009: import com.sun.portal.rewriter.rom.RuleSet;
010: import com.sun.portal.rewriter.rom.RuleSetManager;
011: import com.sun.portal.rproxy.rewriter.SRAPRewriterModule;
012:
013: import java.util.ArrayList;
014: import java.util.Arrays;
015:
016: public class RuleSetData {
017: private static final String DEFAULT_GATEWAY_RULESET_60_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
018: + "\n"
019: + "<!--\n"
020: + " DefaultGatewayRuleSet.xml contains all the default rules that\n"
021: + " are used by the Rewriter Component to rewrite the URLs.\n"
022: + "-->\n"
023: + "\n"
024: + "<!DOCTYPE RuleSet SYSTEM \"jar://rewriter.jar/resources/RuleSet.dtd\">\n"
025: + "\n"
026: + "<RuleSet type=\"GROUPED\" id=\"default_gateway_ruleset_60_version\">\n"
027: + "\n"
028: + " <!-- Rules for Rewriting HTML Source -->\n"
029: + " <HTMLRules>\n"
030: + "\n"
031: + " <!-- Rules for Rewriting Applet Parameter Values List -->\n"
032: + "\n"
033: + " <!-- The following rules apply to NetMail -->\n"
034: + "\n"
035: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail.class\"\n"
036: + " param=\"servletURL\" />\n"
037: + "\n"
038: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail.class\"\n"
039: + " param=\"exitURL\" />\n"
040: + "\n"
041: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail.class\"\n"
042: + " param=\"resourcesURL\" />\n"
043: + "\n"
044: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail.class\"\n"
045: + " param=\"helpURL\" />\n"
046: + "\n"
047: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail\"\n"
048: + " param=\"servletURL\" />\n"
049: + "\n"
050: + " <!-- End-of-NetMail Applet rules -->\n"
051: + "\n"
052: + " <!-- Rules for NetMail Local Installer -->\n"
053: + "\n"
054: + " <Applet source=\"*/portal/NetMailServlet\"\n"
055: + " code=\"Installer.class\" param=\"cabbase\" />\n"
056: + " <Applet source=\"*/portal/NetMailServlet\"\n"
057: + " code=\"Installer.class\" param=\"helpfilesURL\" />\n"
058: + "\n"
059: + " <!-- End-of-NetMail-Local-Installer rules -->\n"
060: + "\n"
061: + " <!-- The following rules apply to NetFile -->\n"
062: + "\n"
063: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
064: + " param=\"cabbase\" />\n"
065: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
066: + " param=\"uploadURL\" />\n"
067: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
068: + " param=\"NetFileURL\" />\n"
069: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
070: + " param=\"InitURL\" />\n"
071: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
072: + " param=\"exitURL\" />\n"
073: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
074: + " param=\"OpenFileURL\" />\n"
075: + "\n"
076: + " <!-- End-of-NetFile Applet rules -->\n"
077: + "\n"
078: + " <!-- The following rules apply to NetFile Java 2 -->\n"
079: + "\n"
080: + " <Applet source=\"*/portal/NetFileApplet\"\n"
081: + " code=\"NetFileApplet.class\" param=\"UploadURL\" />\n"
082: + " <Applet source=\"*/portal/NetFileApplet\"\n"
083: + " code=\"NetFileApplet.class\" param=\"NetFileURL\" />\n"
084: + " <Applet source=\"*/portal/NetFileApplet\"\n"
085: + " code=\"NetFileApplet.class\" param=\"OpenFileURL\" />\n"
086: + " <Applet source=\"*/portal/NetFileApplet\"\n"
087: + " code=\"NetFileApplet.class\" param=\"exitURL\" />\n"
088: + "\n"
089: + " <!-- End-of-NetFile Applet rules Java 2 -->\n"
090: + "\n"
091: + " <!-- The following rewriting rules apply to the NetLet -->\n"
092: + "\n"
093: + " <Applet source=\"*/portal/NetletConfig\" code=\"com/sun/portal/netlet/client/applet/NetletApplet.class\"\n"
094: + " param=\"configURL\" />\n"
095: + " <Applet source=\"*/portal/NetletConfig\" code=\"com/sun/portal/netlet/client/applet/NetletApplet.class\"\n"
096: + " param=\"resourcesURL\" />\n"
097: + "\n"
098: + " <!-- End-of-NetLet rules -->\n"
099: + "\n"
100: + " <!-- Rules for Rewriting HTML Attributes -->\n"
101: + "\n"
102: + " <Attribute name=\"href\" />\n"
103: + " <Attribute name=\"src\" />\n"
104: + " <Attribute name=\"action\" />\n"
105: + " <Attribute name=\"background\" />\n"
106: + " <Attribute name=\"codebase\" />\n"
107: + " <Attribute name=\"style\" />\n"
108: + " <Attribute name=\"content\" tag=\"meta\" />\n"
109: + " <Attribute name=\"pluginspage\" tag=\"embed\" />\n"
110: + " <Attribute name=\"lowsrc\" />\n"
111: + " <Attribute name=\"url\" />\n"
112: + " <Attribute name=\"imagePath\" />\n"
113: + " <Attribute name=\"viewClass\" />\n"
114: + " <Attribute name=\"emptyURL\" />\n"
115: + " <Attribute name=\"draftsURL\" />\n"
116: + " <Attribute name=\"folderURL\" />\n"
117: + " <Attribute name=\"prevMonthImage\" />\n"
118: + " <Attribute name=\"nextMonthImage\" />\n"
119: + "\n"
120: + " <!-- Rules for HTML Attributes containing Java Script -->\n"
121: + "\n"
122: + " <JSToken>onClick</JSToken>\n"
123: + " <JSToken>onLoad</JSToken>\n"
124: + " <JSToken>onSubmit</JSToken>\n"
125: + " <JSToken>onUnload</JSToken>\n"
126: + " <JSToken>onChange</JSToken>\n"
127: + " <JSToken>onMouseDown</JSToken>\n"
128: + " <JSToken>onMouseMove</JSToken>\n"
129: + " <JSToken>onMouseOut</JSToken>\n"
130: + " <JSToken>onMouseOver</JSToken>\n"
131: + " <JSToken>onMouseUp</JSToken>\n"
132: + " <JSToken>onAbort</JSToken>\n"
133: + " <JSToken>onBlur</JSToken>\n"
134: + " <JSToken>onDblClick</JSToken>\n"
135: + " <JSToken>onError</JSToken>\n"
136: + " <JSToken>onFocus</JSToken>\n"
137: + " <JSToken>onKeyDown</JSToken>\n"
138: + " <JSToken>onKeyPress</JSToken>\n"
139: + " <JSToken>onKeyUp</JSToken>\n"
140: + " <JSToken>onReset</JSToken>\n"
141: + " <JSToken>onSelect</JSToken>\n"
142: + "\n"
143: + " </HTMLRules>\n"
144: + "\n"
145: + " <!-- Rules for Rewriting JavaScript Source -->\n"
146: + " <JSRules>\n"
147: + "\n"
148: + " <!-- Rules for Rewriting JavaScript variables in URLs\n"
149: + " <Variable type=\"URL\"> document.location.href </Variable>\n"
150: + " <Variable type=\"URL\"> location.href </Variable>\n"
151: + " <Variable type=\"URL\"> top.location </Variable>\n"
152: + " <Variable type=\"URL\"> document.location </Variable>\n"
153: + " <Variable type=\"URL\"> window.location </Variable>\n"
154: + " <Variable type=\"URL\"> top.frames.headerFrame.location</Variable>\n"
155: + " <Variable type=\"URL\"> top.frames.dataFrame.location</Variable>\n"
156: + " <Variable type=\"URL\"> parent.location </Variable>\n"
157: + " <Variable type=\"URL\"> parentwindow.location</Variable>\n"
158: + " <Variable type=\"URL\"> self.location </Variable>\n"
159: + " <Variable type=\"URL\"> top.document.location.href</Variable>\n"
160: + " <Variable type=\"URL\"> location </Variable>\n"
161: + "\n"
162: + " <Variable type=\"URL\"> imgsrc </Variable>\n"
163: + " <Variable type=\"URL\"> banner_homeoff.src </Variable>\n"
164: + " <Variable type=\"URL\"> banner_tabsoff.src </Variable>\n"
165: + " <Variable type=\"URL\"> banner_helpoff.src </Variable>\n"
166: + " <Variable type=\"URL\"> banner_logoutoff.src </Variable>\n"
167: + " <Variable type=\"URL\"> banner_themeoff.src </Variable>\n"
168: + " <Variable type=\"URL\"> banner_homeover.src </Variable>\n"
169: + " <Variable type=\"URL\"> banner_tabsover.src </Variable>\n"
170: + " <Variable type=\"URL\"> banner_helpover.src </Variable>\n"
171: + " <Variable type=\"URL\"> banner_logoutover.src </Variable>\n"
172: + " <Variable type=\"URL\"> banner_helpover.src </Variable>\n"
173: + " <Variable type=\"URL\"> banner_themeover.src </Variable>\n"
174: + " <Variable type=\"URL\"> documentationoff.src </Variable>\n"
175: + " <Variable type=\"URL\"> userlogoutoff.src </Variable>\n"
176: + " <Variable type=\"URL\"> userlogoutover.src </Variable>\n"
177: + " <Variable type=\"URL\"> documentationover.src </Variable>\n"
178: + " <Variable type=\"URL\"> banner_upper_leftoff.src</Variable>\n"
179: + " <Variable type=\"URL\"> banner_lower_leftoff.src</Variable>\n"
180: + " <Variable type=\"URL\"> banner_upper_rightoff.src</Variable>\n"
181: + " <Variable type=\"URL\"> banner_lower_rightoff.src</Variable>\n"
182: + " <Variable type=\"URL\"> banner_upper_leftover.src</Variable>\n"
183: + " <Variable type=\"URL\"> banner_lower_leftover.src</Variable>\n"
184: + " <Variable type=\"URL\"> banner_upper_rightover.src</Variable>\n"
185: + " <Variable type=\"URL\"> banner_lower_rightover.src</Variable>\n"
186: + " <Variable type=\"URL\"> banner_optionsoff.src </Variable>\n"
187: + " <Variable type=\"URL\"> banner_optionsover.src </Variable>\n"
188: + "\n"
189: + " <Variable type=\"URL\"> document.GatewaySelect.action</Variable>\n"
190: + " <Variable type=\"URL\"> document.GatewayData.action</Variable>\n"
191: + " <Variable type=\"URL\"> document.CreateRule.action</Variable>\n"
192: + " <Variable type=\"URL\"> document.GatewayCreate.action</Variable>\n"
193: + " <Variable type=\"URL\"> document.SelectRule.action</Variable>\n"
194: + " <Variable type=\"URL\"> document.EditRule.action</Variable>\n"
195: + " <Variable type=\"EXPRESSION\"> surf_form_URL </Variable>\n"
196: + " <Variable type=\"EXPRESSION\"> location </Variable>\n"
197: + " <Variable type=\"SYSTEM\"> window.location.pathname </Variable>\n"
198: + "\n"
199: + " <Function type=\"URL\" name=\"window.open\" paramPatterns=\"y\"/>\n"
200: + " <Function type=\"URL\" name=\"Console_goToURL\" paramPatterns=\",y\"/>\n"
201: + " <Function type=\"URL\" name=\"openAppURL\" paramPatterns=\"y\"/>\n"
202: + " <Function type=\"URL\" name=\"openNewWindow\" paramPatterns=\"y\"/>\n"
203: + " <Function type=\"URL\" name=\"parent.openNewWindow\" paramPatterns=\"y\"/>\n"
204: + " <Function type=\"URL\" name=\"netletConfigOpen\" paramPatterns=\"y,y\"/>\n"
205: + " <Function type=\"URL\" name=\"netletWinOpen\" paramPatterns=\"y\"/>\n"
206: + " <Function type=\"URL\" name=\"netletActionOpen\" paramPatterns=\"y\"/>\n"
207: + " <Function type=\"URL\" name=\"openUploadWin\" paramPatterns=\"y\"/>\n"
208: + " <Function type=\"URL\" name=\"invokeVB\" paramPatterns=\",y,,\"/>\n"
209: + " <Function type=\"URL\" name=\"*findWindow\" paramPatterns=\"y\"/>\n"
210: + " <Function type=\"URL\"\n"
211: + " name=\"top.frames.dataFrame.location.replace\"\n"
212: + " paramPatterns=\"y\"/>\n"
213: + "\n"
214: + " <Function type=\"EXPRESSION\" name=\"*location.replace\" paramPatterns=\"y\"/>\n"
215: + "\n"
216: + " <Function type=\"DHTML\" name=\"document.write\" paramPatterns=\"y\"/>\n"
217: + " <Function type=\"DHTML\" name=\"document.writeln\" paramPatterns=\"y\"/>\n"
218: + " -->\n"
219: + "\n"
220: + " <Variable type=\"EXPRESSION\"> *location </Variable>\n"
221: + " <Variable type=\"EXPRESSION\"> *location.href </Variable>\n"
222: + " <Variable type=\"EXPRESSION\"> *action</Variable>\n"
223: + " <Variable type=\"EXPRESSION\"> *.src</Variable>\n"
224: + " <Variable type=\"EXPRESSION\"> *.lowsrc</Variable>\n"
225: + "\n"
226: + " <Variable type=\"SYSTEM\"> *location.pathname </Variable>\n"
227: + "\n"
228: + " <!-- Rules for Rewriting JavaScript Function Parameters -->\n"
229: + " <Function type=\"URL\" name=\"Console_goToURL\" paramPatterns=\",y\"/>\n"
230: + " <!--window.open-->\n"
231: + " <Function type=\"EXPRESSION\" name=\"*open\" paramPatterns=\"y\"/>\n"
232: + " <Function type=\"EXPRESSION\" name=\"*location.replace\" paramPatterns=\"y\"/>\n"
233: + " <!-- MS Specific javascript functions -->\n"
234: + " <Function type=\"EXPRESSION\" name=\"*navigate\" paramPatterns=\"y\"/>\n"
235: + " <Function type=\"EXPRESSION\" name=\"*showModel*Dialog\" paramPatterns=\"y,,\"/>\n"
236: + "\n"
237: + " <Function type=\"DHTML\" name=\"document.write\" paramPatterns=\"y\"/>\n"
238: + " <Function type=\"DHTML\" name=\"document.writeln\" paramPatterns=\"y\"/>\n"
239: + " </JSRules>\n"
240: + "\n"
241: + "\n"
242: + " <!-- Rules for Rewriting XML Source -->\n"
243: + " <XMLRules>\n"
244: + "\n"
245: + " <!-- Rules for Rewriting Attributes -->\n"
246: + "\n"
247: + " <Attribute name=\"helpURL\"/>\n"
248: + " <Attribute name=\"loginHelpURL\"/>\n"
249: + " <Attribute name=\"xmlns\"/>\n"
250: + " <Attribute name=\"href\" tag=\"a\"/>\n"
251: + "\n"
252: + " <!-- Rules for Rewriting TagTexts -->\n"
253: + "\n"
254: + " <TagText tag=\"baseroot\" />\n"
255: + " <TagText tag=\"prop2\" />\n"
256: + " <TagText tag=\"prop1\" />\n"
257: + " <TagText tag=\"img\" />\n"
258: + " <TagText tag=\"xsl:attribute\" attributePatterns=\"name=src\" />\n"
259: + "\n" + " </XMLRules>\n" + "\n" + "</RuleSet>\n";
260:
261: public static final String GENERIC_RULESET_60_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
262: + "\n"
263: + "<!--\n"
264: + " DefaultGatewayRuleSet.xml contains all the default rules that\n"
265: + " are used by the Rewriter Component to rewrite the URLs.\n"
266: + "-->\n"
267: + "\n"
268: + "<!DOCTYPE RuleSet SYSTEM \"jar://rewriter.jar/resources/RuleSet.dtd\">\n"
269: + "\n"
270: + "<RuleSet type=\"GROUPED\" id=\"generic_ruleset_60_version\">\n"
271: + "\n"
272: + " <!-- Rules for Rewriting HTML Source -->\n"
273: + " <HTMLRules>\n"
274: + "\n"
275: + " <!-- Rules for Rewriting Applet Parameter Values List -->\n"
276: + "\n"
277: + " <!-- The following rules apply to NetMail -->\n"
278: + "\n"
279: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail.class\"\n"
280: + " param=\"servletURL\" />\n"
281: + "\n"
282: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail.class\"\n"
283: + " param=\"exitURL\" />\n"
284: + "\n"
285: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail.class\"\n"
286: + " param=\"resourcesURL\" />\n"
287: + "\n"
288: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail.class\"\n"
289: + " param=\"helpURL\" />\n"
290: + "\n"
291: + " <Applet source=\"*/portal/NetMailServlet\" code=\"NetMail\"\n"
292: + " param=\"servletURL\" />\n"
293: + "\n"
294: + " <!-- End-of-NetMail Applet rules -->\n"
295: + "\n"
296: + " <!-- Rules for NetMail Local Installer -->\n"
297: + "\n"
298: + " <Applet source=\"*/portal/NetMailServlet\"\n"
299: + " code=\"Installer.class\" param=\"cabbase\" />\n"
300: + " <Applet source=\"*/portal/NetMailServlet\"\n"
301: + " code=\"Installer.class\" param=\"helpfilesURL\" />\n"
302: + "\n"
303: + " <!-- End-of-NetMail-Local-Installer rules -->\n"
304: + "\n"
305: + " <!-- The following rules apply to NetFile -->\n"
306: + "\n"
307: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
308: + " param=\"cabbase\" />\n"
309: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
310: + " param=\"uploadURL\" />\n"
311: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
312: + " param=\"NetFileURL\" />\n"
313: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
314: + " param=\"InitURL\" />\n"
315: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
316: + " param=\"exitURL\" />\n"
317: + " <Applet source=\"*/portal/NetFileApplet\" code=\"rp.class\"\n"
318: + " param=\"OpenFileURL\" />\n"
319: + "\n"
320: + " <!-- End-of-NetFile Applet rules -->\n"
321: + "\n"
322: + " <!-- The following rules apply to NetFile Java 2 -->\n"
323: + "\n"
324: + " <Applet source=\"*/portal/NetFileApplet\"\n"
325: + " code=\"NetFileApplet.class\" param=\"UploadURL\" />\n"
326: + " <Applet source=\"*/portal/NetFileApplet\"\n"
327: + " code=\"NetFileApplet.class\" param=\"NetFileURL\" />\n"
328: + " <Applet source=\"*/portal/NetFileApplet\"\n"
329: + " code=\"NetFileApplet.class\" param=\"OpenFileURL\" />\n"
330: + " <Applet source=\"*/portal/NetFileApplet\"\n"
331: + " code=\"NetFileApplet.class\" param=\"exitURL\" />\n"
332: + "\n"
333: + " <!-- End-of-NetFile Applet rules Java 2 -->\n"
334: + "\n"
335: + " <!-- The following rewriting rules apply to the NetLet -->\n"
336: + "\n"
337: + " <Applet source=\"*/portal/NetletConfig\" code=\"com/sun/portal/netlet/client/applet/NetletApplet.class\"\n"
338: + " param=\"configURL\" />\n"
339: + " <Applet source=\"*/portal/NetletConfig\" code=\"com/sun/portal/netlet/client/applet/NetletApplet.class\"\n"
340: + " param=\"resourcesURL\" />\n"
341: + "\n"
342: + " <!-- End-of-NetLet rules -->\n"
343: + "\n"
344: + " <!-- Rules for Rewriting HTML Attributes -->\n"
345: + "\n"
346: + " <Attribute name=\"href\" />\n"
347: + " <Attribute name=\"src\" />\n"
348: + " <Attribute name=\"action\" />\n"
349: + " <Attribute name=\"background\" />\n"
350: + " <Attribute name=\"codebase\" />\n"
351: + " <Attribute name=\"style\" />\n"
352: + " <Attribute name=\"content\" tag=\"meta\" />\n"
353: + " <Attribute name=\"pluginspage\" tag=\"embed\" />\n"
354: + " <Attribute name=\"lowsrc\" />\n"
355: + " <Attribute name=\"url\" />\n"
356: + " <Attribute name=\"imagePath\" />\n"
357: + " <Attribute name=\"viewClass\" />\n"
358: + " <Attribute name=\"emptyURL\" />\n"
359: + " <Attribute name=\"draftsURL\" />\n"
360: + " <Attribute name=\"folderURL\" />\n"
361: + " <Attribute name=\"prevMonthImage\" />\n"
362: + " <Attribute name=\"nextMonthImage\" />\n"
363: + "\n"
364: + " <!-- Rules for HTML Attributes containing Java Script -->\n"
365: + "\n"
366: + " <JSToken>on*</JSToken>\n"
367: + "\n"
368: + " </HTMLRules>\n"
369: + "\n"
370: + " <!-- Rules for Rewriting JavaScript Source -->\n"
371: + " <JSRules>\n"
372: + "\n"
373: + " <Variable type=\"EXPRESSION\"> *location </Variable>\n"
374: + " <Variable type=\"EXPRESSION\"> *location.href </Variable>\n"
375: + " <Variable type=\"EXPRESSION\"> *action</Variable>\n"
376: + " <Variable type=\"EXPRESSION\"> *.src</Variable>\n"
377: + " <Variable type=\"EXPRESSION\"> *.lowsrc</Variable>\n"
378: + "\n"
379: + " <Variable type=\"SYSTEM\"> *location.pathname </Variable>\n"
380: + "\n"
381: + " <!-- Rules for Rewriting JavaScript Function Parameters -->\n"
382: + " <Function type=\"URL\" name=\"Console_goToURL\" paramPatterns=\",y\"/>\n"
383: + "\n"
384: + " <!-- MS Specific ActiveX functions -->\n"
385: + " <Function type=\"EXPRESSION\" name=\"*HTTP.open\" paramPatterns=\",y,\"/>\n"
386: + " <Function type=\"EXPRESSION\" name=\"*XMLhttp*.open\" paramPatterns=\",y,\"/>\n"
387: + " <Function type=\"EXPRESSION\" name=\"*XSL.load\" paramPatterns=\"y\"/>\n"
388: + " <Function type=\"EXPRESSION\" name=\"*.addBehavior\" paramPatterns=\"y\"/>\n"
389: + " <Function type=\"EXPRESSION\" name=\"*.addHierarchy\" paramPatterns=\"y,,\"/>\n"
390: + "\n"
391: + " <!-- window.open -->\n"
392: + " <Function type=\"EXPRESSION\" name=\"*open\" paramPatterns=\"y\"/>\n"
393: + " <Function type=\"EXPRESSION\" name=\"*location.replace\" paramPatterns=\"y\"/>\n"
394: + "\n"
395: + " <!-- MS Specific javascript functions -->\n"
396: + " <Function type=\"EXPRESSION\" name=\"*navigate\" paramPatterns=\"y\"/>\n"
397: + " <Function type=\"EXPRESSION\" name=\"*showModel*Dialog\" paramPatterns=\"y,,\"/>\n"
398: + "\n"
399: + " <Function type=\"DHTML\" name=\"document.write\" paramPatterns=\"y\"/>\n"
400: + " <Function type=\"DHTML\" name=\"document.writeln\" paramPatterns=\"y\"/>\n"
401: + "\n"
402: + " </JSRules>\n"
403: + "\n"
404: + "\n"
405: + " <!-- Rules for Rewriting XML Source -->\n"
406: + " <XMLRules>\n"
407: + "\n"
408: + " <!-- Rules for Rewriting Attributes -->\n"
409: + "\n"
410: + " <Attribute name=\"xmlns\"/>\n"
411: + " <Attribute name=\"helpURL\"/>\n"
412: + " <Attribute name=\"loginHelpURL\"/>\n"
413: + " <Attribute name=\"href\" tag=\"a\"/>\n"
414: + "\n"
415: + " <!-- Rules for Rewriting TagTexts -->\n"
416: + "\n"
417: + " <TagText tag=\"baseroot\" />\n"
418: + " <TagText tag=\"prop2\" />\n"
419: + " <TagText tag=\"prop1\" />\n"
420: + " <TagText tag=\"img\" />\n"
421: + " <TagText tag=\"xsl:attribute\" attributePatterns=\"name=src\" />\n"
422: + "\n" + " </XMLRules>\n" + "\n" + "</RuleSet>\n";
423:
424: private static RuleSet[] trun62PSRuleSets;
425:
426: private static RuleSet[] rtm60RuleSets;
427:
428: public static RuleSet[] getRTM60RuleSets() {
429: if (rtm60RuleSets == null) {
430: try {
431: rtm60RuleSets = new RuleSet[] {
432: RuleSetManager
433: .create(DEFAULT_GATEWAY_RULESET_60_VERSION),
434: RuleSetManager.create(RuleSetManager.create(
435: DEFAULT_GATEWAY_RULESET_60_VERSION)
436: .toXML()),
437: RuleSetManager
438: .create(GENERIC_RULESET_60_VERSION),
439: RuleSetManager.create(RuleSetManager.create(
440: GENERIC_RULESET_60_VERSION).toXML()), };
441: } catch (Exception e) {
442: e.printStackTrace();
443: }
444: }
445:
446: return rtm60RuleSets;
447: }//getRTMRuleSets()
448:
449: public static RuleSet[] getTrunk62PSRuleSets() {
450: if (trun62PSRuleSets == null) {
451: try {
452: trun62PSRuleSets = new RuleSet[] {
453: // RuleSetManager.getDefault().fetchRuleSet( RewriterModule.DEFAULT_RULESET_ID ),
454: RuleSetManager.getDefault().fetchRuleSet(
455: RewriterModule.GENRIC_RULESET_ID),
456: // RuleSetManager.create( RuleSetManager.getDefault().fetchRuleSet( RewriterModule.DEFAULT_RULESET_ID ).toXML() ),
457: RuleSetManager
458: .create(RuleSetManager
459: .getDefault()
460: .fetchRuleSet(
461: RewriterModule.GENRIC_RULESET_ID)
462: .toXML()), };
463: } catch (Exception e) {
464: e.printStackTrace();
465: }
466: }
467:
468: return trun62PSRuleSets;
469: }//getTrunk62PSRuleSets()
470:
471: private static RuleSet[] trunk62SRARuleSets;
472:
473: public static RuleSet[] getTrunk62SRARuleSets() {
474: if (trunk62SRARuleSets == null) {
475: try {
476: trunk62SRARuleSets = new RuleSet[] {
477: RuleSetManager
478: .getDefault()
479: .fetchRuleSet(
480: SRAPRewriterModule.DEFAULT_GATEWAY_RULESET_ID),
481: RuleSetManager
482: .create(RuleSetManager
483: .getDefault()
484: .fetchRuleSet(
485: SRAPRewriterModule.DEFAULT_GATEWAY_RULESET_ID)
486: .toXML()), };
487: } catch (Exception e) {
488: e.printStackTrace();
489: }
490: }
491:
492: return trunk62SRARuleSets;
493: }//getTrunk62SRARuleSets()
494:
495: private static RuleSet[] trun62AllRuleSets;
496:
497: public static RuleSet[] getTrunk62AllRuleSets() {
498: if (trun62AllRuleSets == null) {
499: ArrayList bList = new ArrayList(Arrays
500: .asList(getTrunk62PSRuleSets()));
501: bList.addAll(Arrays.asList(getTrunk62SRARuleSets()));
502:
503: trun62AllRuleSets = (RuleSet[]) bList
504: .toArray(new RuleSet[0]);
505: }
506:
507: return trun62AllRuleSets;
508: }//getTrunk62AllRuleSets()
509:
510: private static RuleSet[] allRuleSets;
511:
512: public static RuleSet[] getAllRuleSets() {
513: if (allRuleSets == null) {
514: ArrayList bList = new ArrayList(Arrays
515: .asList(getRTM60RuleSets()));
516: bList.addAll(Arrays.asList(getTrunk62AllRuleSets()));
517:
518: allRuleSets = (RuleSet[]) bList.toArray(new RuleSet[0]);
519: }
520:
521: return allRuleSets;
522: }//getAllRuleSets()
523:
524: }//class RuleSetData
|