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;
07:
08: import java.util.Enumeration;
09: import java.util.Hashtable;
10:
11: /**
12: * Stylesheet description for stylesheets performing structure transformation
13: * @author Peter Kharchenko
14: * @version $Revision: 34820 $
15: */
16:
17: public class StructureStylesheetDescription extends
18: CoreXSLTStylesheetDescription {
19: Hashtable folderAttributeTable;
20:
21: public StructureStylesheetDescription() {
22: super ();
23: folderAttributeTable = new Hashtable();
24: }
25:
26: public Enumeration getFolderAttributeNames() {
27: return folderAttributeTable.keys();
28: }
29:
30: public String getFolderAttributeWordDescription(String attributeName) {
31: DescriptionDefaultValuePair pair = (DescriptionDefaultValuePair) folderAttributeTable
32: .get(attributeName);
33: if (pair != null)
34: return pair.wordDescription;
35: else
36: return null;
37: }
38:
39: public String getFolderAttributeDefaultValue(String attributeName) {
40: DescriptionDefaultValuePair pair = (DescriptionDefaultValuePair) folderAttributeTable
41: .get(attributeName);
42: if (pair != null)
43: return pair.defaultValue;
44: else
45: return null;
46: }
47:
48: public void setFolderAttributeWordDescription(String attributeName,
49: String wordDescription) {
50: DescriptionDefaultValuePair pair = (DescriptionDefaultValuePair) folderAttributeTable
51: .get(attributeName);
52: if (pair != null)
53: pair.wordDescription = wordDescription;
54: }
55:
56: public void setFolderAttributeDefaultValue(String attributeName,
57: String defaultValue) {
58: DescriptionDefaultValuePair pair = (DescriptionDefaultValuePair) folderAttributeTable
59: .get(attributeName);
60: if (pair != null)
61: pair.defaultValue = defaultValue;
62: }
63:
64: public boolean containsFolderAttribute(String attributeName) {
65: return folderAttributeTable.containsKey(attributeName);
66: }
67:
68: public void addFolderAttribute(String name, String defaultValue,
69: String wordDescription) {
70: DescriptionDefaultValuePair pair = new DescriptionDefaultValuePair();
71: pair.defaultValue = defaultValue;
72: pair.wordDescription = wordDescription;
73: folderAttributeTable.put(name, pair);
74: }
75:
76: }
|