01: /**
02: * $Id: PortalConstants.java,v 1.3 2004/01/07 23:56:25 mjain Exp $
03: * Copyright 2003 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.providers.window.util;
14:
15: import java.util.*;
16:
17: public final class PortalConstants {
18:
19: private static List portalParamKeyList = new ArrayList();
20: private static List portalSuffixList = new ArrayList();
21:
22: static {
23:
24: portalParamKeyList.add("action");
25: portalParamKeyList.add("provider");
26: portalParamKeyList.add("targetprovider");
27: portalParamKeyList.add("containerName");
28: portalParamKeyList.add("last");
29: portalParamKeyList.add("page");
30: portalParamKeyList.add("error");
31: portalParamKeyList.add("container");
32: portalParamKeyList.add("selected");
33: portalParamKeyList.add("editChannelName");
34: portalParamKeyList.add("targetPortletChannel");
35: portalParamKeyList.add("currentChannelMode");
36:
37: portalSuffixList.add(".targetProvider");
38: portalSuffixList.add(".channelAction");
39: portalSuffixList.add(".setSelected");
40: }
41:
42: /*
43: * Returns a list containing parameter keys used by the portal or portlet
44: * container. These keys should be filtered out when passing the
45: * parameters to the portlet
46: */
47: public static List getPortalParamKeyList() {
48:
49: return portalParamKeyList;
50:
51: }
52:
53: public static List getPortalSuffixList() {
54: return portalSuffixList;
55: }
56:
57: public static boolean isPortalKey(String key) {
58: if (key != null) {
59: if (portalParamKeyList.contains(key)) {
60: return true;
61: } else {
62: Iterator suffixIter = portalSuffixList.iterator();
63: if (suffixIter.hasNext()) {
64: if (key.endsWith((String) suffixIter.next())) {
65: return true;
66: }
67: }
68: }
69: }
70: return false;
71:
72: }
73:
74: }
|