01: package com.sun.portal.rewriter.test.util;
02:
03: import com.sun.portal.rewriter.AbsoluteJSFunctionSpec;
04: import com.sun.portal.rewriter.AbstractJSFunctionSpec;
05: import com.sun.portal.rewriter.RewriterModule;
06: import com.sun.portal.rewriter.engines.LanguageConstants;
07: import com.sun.portal.rewriter.util.Resource;
08: import com.sun.portal.rewriter.util.StringHelper;
09:
10: /*
11: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
12: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
13: */
14:
15: public interface JSWrapperHelper {
16: public static final String CONVERT_EXPRESSION_FUNCTION_NAME = AbsoluteJSFunctionSpec
17: .getDefault().getExpressionFunctionName();
18:
19: public static final String CONVERT_SYSTEM_FUNCTION_NAME = AbsoluteJSFunctionSpec
20: .getDefault().getSystemFunctionName();
21:
22: public static final String CONVERT_EXPRESSION_FUNCTION_WRAP_START = CONVERT_EXPRESSION_FUNCTION_NAME
23: + "(";
24:
25: public static final String CONVERT_SYSTEM_FUNCTION_WRAP_START = CONVERT_SYSTEM_FUNCTION_NAME
26: + "(";
27:
28: public static final String COMMON_JS_FUNCTIONS = "\n"
29: + Resource.read(RewriterModule.RESOURCE_URI_UTILS_LOCATION)
30: .trim() + "\n";
31:
32: public static final String EXPRESSION_FUNCTION_JS = "\n"
33: + StringHelper
34: .searchAndReplace(
35: StringHelper
36: .searchAndReplace(
37: StringHelper
38: .searchAndReplace(
39: Resource
40: .read(
41: RewriterModule.RESOURCE_CONVERT_EXPRESSTION_FUNCTION_LOCATION)
42: .trim(),
43: AbstractJSFunctionSpec.INSERT_EXPRESSION_FUNCTION_NAME_PATTERN,
44: CONVERT_EXPRESSION_FUNCTION_NAME),
45: AbstractJSFunctionSpec.INSERT_PAGE_NETWORK_URI_PATTERN,
46: "http://rajanagendra.sun.com"),
47: AbstractJSFunctionSpec.INSERT_PAGE_BASE_URI_PATTERN,
48: "http://rajanagendra.sun.com/Base/Raja/")
49: + "\n";
50:
51: public static final String SYSTEM_FUNCTION_JS = "\n"
52: + StringHelper
53: .searchAndReplace(
54: StringHelper
55: .searchAndReplace(
56: StringHelper
57: .searchAndReplace(
58: Resource
59: .read(
60: RewriterModule.RESOURCE_CONVERT_SYSTEM_FUNCTION_LOCATION)
61: .trim(),
62: AbstractJSFunctionSpec.INSERT_SYSTEM_FUNCTION_NAME_PATTERN,
63: CONVERT_SYSTEM_FUNCTION_NAME),
64: AbstractJSFunctionSpec.INSERT_PAGE_NETWORK_URI_PATTERN,
65: "http://rajanagendra.sun.com"),
66: AbstractJSFunctionSpec.INSERT_PAGE_BASE_URI_PATTERN,
67: "http://rajanagendra.sun.com/Base/Raja/")
68: + "\n";
69:
70: public static final String CONVERT_EXPRESSION_FUNCTION_JS = COMMON_JS_FUNCTIONS
71: + EXPRESSION_FUNCTION_JS;
72:
73: public static final String CONVERT_SYSTEM_FUNCTION_JS = COMMON_JS_FUNCTIONS
74: + SYSTEM_FUNCTION_JS;
75:
76: public static final String CONVERT_ALL_FUNCTIONS_JS = COMMON_JS_FUNCTIONS
77: + EXPRESSION_FUNCTION_JS + SYSTEM_FUNCTION_JS;
78:
79: public static final String CONVERT_ALL_FUNCTIONS_HTML = LanguageConstants.SCRIPT_TAG_BEGIN
80: + CONVERT_ALL_FUNCTIONS_JS
81: + LanguageConstants.SCRIPT_TAG_END;
82:
83: public static final String CONVERT_EXPRESSION_FUNCTION_HTML = LanguageConstants.SCRIPT_TAG_BEGIN
84: + CONVERT_EXPRESSION_FUNCTION_JS
85: + LanguageConstants.SCRIPT_TAG_END;
86:
87: public static final String CONVERT_SYSTEM_FUNCTION_HTML = LanguageConstants.SCRIPT_TAG_BEGIN
88: + CONVERT_SYSTEM_FUNCTION_JS
89: + LanguageConstants.SCRIPT_TAG_END;
90:
91: }//Interface JSWrapperHelper
|