01: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.channels.permissionsmanager;
07:
08: import java.util.HashMap;
09:
10: import org.jasig.portal.IPermissible;
11: import org.apache.commons.logging.Log;
12: import org.apache.commons.logging.LogFactory;
13:
14: /**
15: * An IPermissible implementation that provides management of uPortal 2.0
16: * channel publishing permissions
17: *
18: * @author Alex Vigdor
19: * @version $Revision: 34837 $
20: */
21: public class PermissiblePublishChannels implements IPermissible {
22: private static final Log log = LogFactory
23: .getLog(PermissiblePublishChannels.class);
24: protected HashMap activities = new HashMap();
25: protected HashMap targets = new HashMap();
26:
27: /**
28: * put your documentation comment here
29: */
30: public PermissiblePublishChannels() {
31: try {
32: activities.put("PUBLISH", "Publish a Channel");
33: targets.put("CHAN_ID.*", "This uPortal installation");
34: } catch (Exception e) {
35: log.error(e, e);
36: }
37: }
38:
39: /**
40: * put your documentation comment here
41: * @return an array of <code>String</code> activity tokens
42: */
43: public String[] getActivityTokens() {
44: return (String[]) activities.keySet().toArray(new String[0]);
45: }
46:
47: /**
48: * put your documentation comment here
49: * @param token
50: * @return a <code>String</code> activity name
51: */
52: public String getActivityName(String token) {
53: return (String) activities.get(token);
54: }
55:
56: /**
57: * put your documentation comment here
58: * @return an array of <code>String</code> target tokens
59: */
60: public String[] getTargetTokens() {
61: return (String[]) targets.keySet().toArray(new String[0]);
62: }
63:
64: /**
65: * put your documentation comment here
66: * @param token
67: * @return a <code>String</code> target name
68: */
69: public String getTargetName(String token) {
70: return (String) targets.get(token);
71: }
72:
73: /**
74: * put your documentation comment here
75: * @return a <code>String</code> owner token
76: */
77: public String getOwnerToken() {
78: return "UP_FRAMEWORK";
79: }
80:
81: /**
82: * put your documentation comment here
83: * @return a <code>String</code> owner name
84: */
85: public String getOwnerName() {
86: return "uPortal Channel Publication";
87: }
88: }
|