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.groupsmanager.commands;
07:
08: import org.jasig.portal.ChannelRuntimeData;
09: import org.jasig.portal.channels.groupsmanager.CGroupsManagerSessionData;
10: import org.jasig.portal.channels.groupsmanager.GroupsManagerXML;
11: import org.jasig.portal.channels.groupsmanager.Utility;
12: import org.w3c.dom.Document;
13: import org.w3c.dom.Element;
14:
15: /**
16: * This command sets the expanded attribute for an element to "false" and lets
17: * the transformation handle the tree collapse display.
18: * @author Don Fracapane
19: * @version $Revision: 35496 $
20: */
21: public class CollapseGroup extends GroupsManagerCommand {
22:
23: /** Creates new CollapseGroup */
24: public CollapseGroup() {
25: }
26:
27: /**
28: * This is the public method
29: * @param sessionData
30: * @throws Exception
31: */
32: public void execute(CGroupsManagerSessionData sessionData)
33: throws Exception {
34: ChannelRuntimeData runtimeData = sessionData.runtimeData;
35:
36: Utility.logMessage("DEBUG", "CollapseGroup::execute(): Start");
37: Document model = getXmlDoc(sessionData);
38: Element collapseElem = GroupsManagerXML
39: .getElementByTagNameAndId(model, GROUP_TAGNAME,
40: getCommandArg(runtimeData));
41: Utility.logMessage("DEBUG",
42: "CollapseGroup::execute(): collapseElem was found: "
43: + collapseElem);
44: if (collapseElem != null) {
45: Utility.logMessage("DEBUG",
46: "CollapseGroup::execute(): Element to be expanded: \n"
47: + collapseElem);
48: GroupsManagerXML.refreshAllNodesIfRequired(sessionData
49: .getUnrestrictedData(), collapseElem);
50: collapseElem.setAttribute("expanded", "false");
51: GroupsManagerXML.refreshAllNodesIfRequired(sessionData
52: .getUnrestrictedData(), collapseElem);
53: }
54: return;
55: }
56: }
|