001: package com.sun.portal.rewriter.services.ids;
002:
003: import com.iplanet.portalserver.gwutils.PropertiesProfile;
004: import com.sun.portal.rewriter.util.Constants;
005:
006: import java.util.List;
007: import java.util.Set;
008:
009: public final class IDSDataSource implements DataSource {
010: private static final String HTML_APPLET_RULES = "AppletParamValues";
011: private static final String HTML_FORM_RULES = "FormInputValues";
012: private static final String HTML_URL_ATTRIBUTE_RULES = "Tags";
013: private static final String HTML_DJS_ATTRIBUTE_RULES = "JavaScriptTags";
014:
015: private static final String JS_URL_VARIABLE_RULES = "JavaScriptVariables";
016: private static final String JS_EXPRESSION_VARIABLE_RULES = "JavaScriptVariableConvert";
017: private static final String JS_DHTML_VARIABLE_RULES = "JavaScriptHTMLVariables";
018: private static final String JS_DJS_VARIABLE_RULES = "JavaScriptVariableJavaScript";
019: private static final String JS_SYSTEM_VARIABLE_RULES = "JavaScriptSystemVariableConvert";
020:
021: private static final String JS_URL_FUNCTION_RULES = "JavaScriptRewrite";
022: private static final String JS_EXPRESSION_FUNCTION_RULES = "JavaScriptFunctionParameterConvert";
023: private static final String JS_DHTML_FUNCTION_RULES = "JavaScriptHTML";
024: private static final String JS_DJS_FUNCTION_RULES = "JavaScriptFunctionParameterJavaScript";
025:
026: private static final String XML_URL_ATTRIBUTE_RULES = "XMLAttributeRewrite";
027: private static final String XML_TAGTEXT_RULES = "XMLTextRewrite";
028:
029: public String[] getHTMLAppletData() {
030: final List htmlAppletRules = PropertiesProfile
031: .getAppList(HTML_APPLET_RULES);
032: return (String[]) htmlAppletRules
033: .toArray(Constants.EMPTY_STRING_ARRAY);
034: }//getHTMLAppletData()
035:
036: public String[] getHTMLFormData() {
037: final List htmlFORMRules = PropertiesProfile
038: .getAppList(HTML_FORM_RULES);
039: return (String[]) htmlFORMRules
040: .toArray(Constants.EMPTY_STRING_ARRAY);
041: }//getHTMLFormData()
042:
043: public String[] getHTMLAttributeData() {
044: final Set htmlURLAttributeRules = PropertiesProfile
045: .getAppHashSet(HTML_URL_ATTRIBUTE_RULES, true);
046: return (String[]) htmlURLAttributeRules
047: .toArray(Constants.EMPTY_STRING_ARRAY);
048: }//getHTMLAttributeData()
049:
050: public String[] getHTMLJSTokenData() {
051: final Set htmlDJSAttributeRules = PropertiesProfile
052: .getAppHashSet(HTML_DJS_ATTRIBUTE_RULES, true);
053: return (String[]) htmlDJSAttributeRules
054: .toArray(Constants.EMPTY_STRING_ARRAY);
055: }//getHTMLJSTokenData()
056:
057: public String[] getJSURLVariablesData() {
058: final Set jsURLVariableRules = PropertiesProfile.getAppHashSet(
059: JS_URL_VARIABLE_RULES, false);
060: return (String[]) jsURLVariableRules
061: .toArray(Constants.EMPTY_STRING_ARRAY);
062: }//getJSURLVariablesData()
063:
064: public String[] getJSExpressionVariablesData() {
065: final Set jsEXPRESSIONVariableRules = PropertiesProfile
066: .getAppHashSet(JS_EXPRESSION_VARIABLE_RULES, false);
067: return (String[]) jsEXPRESSIONVariableRules
068: .toArray(Constants.EMPTY_STRING_ARRAY);
069: }//getJSExpressionVariablesData()
070:
071: public String[] getJSDHTMLVariablesData() {
072: final Set jsDHTMLVariableRules = PropertiesProfile
073: .getAppHashSet(JS_DHTML_VARIABLE_RULES, false);
074: return (String[]) jsDHTMLVariableRules
075: .toArray(Constants.EMPTY_STRING_ARRAY);
076: }//getJSDHTMLVariablesData()
077:
078: public String[] getJSDJSVariablesData() {
079: final Set jsDJSVariableRules = PropertiesProfile.getAppHashSet(
080: JS_DJS_VARIABLE_RULES, false);
081: return (String[]) jsDJSVariableRules
082: .toArray(Constants.EMPTY_STRING_ARRAY);
083: }//getJSDJSVariablesData()
084:
085: public String[] getJSSystemVariablesData() {
086: final Set jsSYSTEMVariableRules = PropertiesProfile
087: .getAppHashSet(JS_SYSTEM_VARIABLE_RULES, false);
088: return (String[]) jsSYSTEMVariableRules
089: .toArray(Constants.EMPTY_STRING_ARRAY);
090: }//getJSSystemVariablesData()
091:
092: public String[] getJSURLFunctionData() {
093: final List jsURLFunctionRules = PropertiesProfile
094: .getAppList(JS_URL_FUNCTION_RULES);
095: return (String[]) jsURLFunctionRules
096: .toArray(Constants.EMPTY_STRING_ARRAY);
097: }//getJSURLFunctionData()
098:
099: public String[] getJSExpressionFunctionData() {
100: final List jsEXPRESSIONFunctionRules = PropertiesProfile
101: .getAppList(JS_EXPRESSION_FUNCTION_RULES);
102: return (String[]) jsEXPRESSIONFunctionRules
103: .toArray(Constants.EMPTY_STRING_ARRAY);
104: }//getJSExpressionFunctionData()
105:
106: public String[] getJSDHTMLFunctionData() {
107: final List jsDHTMLFunctionRules = PropertiesProfile
108: .getAppList(JS_DHTML_FUNCTION_RULES);
109: return (String[]) jsDHTMLFunctionRules
110: .toArray(Constants.EMPTY_STRING_ARRAY);
111: }//getJSDHTMLFunctionData()
112:
113: public String[] getJSDJSFunctionData() {
114: final List jsDJSFunctionRules = PropertiesProfile
115: .getAppList(JS_DJS_FUNCTION_RULES);
116: return (String[]) jsDJSFunctionRules
117: .toArray(Constants.EMPTY_STRING_ARRAY);
118: }//getJSDJSFunctionData()
119:
120: public String[] getXMLAttributeData() {
121: final List xmlURLAttributeRules = PropertiesProfile
122: .getAppList(XML_URL_ATTRIBUTE_RULES);
123: return (String[]) xmlURLAttributeRules
124: .toArray(Constants.EMPTY_STRING_ARRAY);
125: }//getXMLAttributeData()
126:
127: public String[] getXMLTagTextData() {
128: final List xmlURLAttributeRules = PropertiesProfile
129: .getAppList(XML_TAGTEXT_RULES);
130: return (String[]) xmlURLAttributeRules
131: .toArray(Constants.EMPTY_STRING_ARRAY);
132: }//getXMLTagTextData()
133:
134: }//class IDSDataSource
|