001: /**
002: * Copyright 2002 Sun Microsystems, Inc. All
003: * rights reserved. Use of this product is subject
004: * to license terms. Federal Acquisitions:
005: * Commercial Software -- Government Users
006: * Subject to Standard License Terms and
007: * Conditions.
008: *
009: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
010: * are trademarks or registered trademarks of Sun Microsystems,
011: * Inc. in the United States and other countries.
012: *
013: * Author: Anurag Gupta
014: */package com.sun.portal.netfile.admin;
015:
016: // JDK classes
017: import java.util.HashMap;
018: import com.sun.portal.log.common.PortalLogger;
019: import java.util.Iterator;
020: import java.util.List;
021:
022: // iPlanet JATO classes
023: import com.iplanet.jato.view.View;
024: import com.iplanet.jato.view.html.StaticTextField;
025:
026: // iDS/AME classes
027: import com.iplanet.am.console.components.view.html.DynamicGUI;
028: import com.iplanet.am.console.base.model.AMConsoleException;
029:
030: // NetFile admin console classes
031: import com.sun.portal.netfile.admin.model.NetFileUserProfileModelImpl;
032:
033: public class NetFileTotalOneDotTwoUserProfileViewBean extends
034: NetFileUserProfileViewBeanBase {
035:
036: public static final String PAGE_NAME = "NetFileTotalOneDotTwoUserProfile";
037: public static final String DEFAULT_DISPLAY_URL = "/ps/netfileadmin/NetFileTotalOneDotTwoUserProfile.jsp";
038:
039: public NetFileTotalOneDotTwoUserProfileViewBean() {
040: super (PAGE_NAME, DEFAULT_DISPLAY_URL);
041: registerChildren();
042: }
043:
044: public NetFileTotalOneDotTwoUserProfileViewBean(String pageName) {
045: super (pageName, DEFAULT_DISPLAY_URL);
046: registerChildren();
047: }
048:
049: protected void registerChildren() {
050: super .registerChildren();
051: registerChild(USER_DATA_VIEW,
052: NetFileTotalOneDotTwoUserProfileView.class);
053: }
054:
055: protected View createChild(String name) {
056: getNetFileModelMgr();
057: NetFileUserProfileModelImpl m = (NetFileUserProfileModelImpl) getModel();
058: m.initModel(getUserDN());
059: View child = null;
060:
061: if (name.equals(CHILD_NETFILE_ATTRSFOR)) {
062: child = new StaticTextField(this , CHILD_NETFILE_ATTRSFOR,
063: modelManager.getString("props.total.one")
064: + " "
065: + modelManager.getString("for.label")
066: + " "
067: + modelManager
068: .getString("props.total.one.two")
069: + " " + modelManager.getString("for.label")
070: + " :");
071: } else if (name.equals(USER_DATA_VIEW)) {
072: child = new NetFileTotalOneDotTwoUserProfileView(this ,
073: USER_DATA_VIEW);
074: } else {
075: child = super .createChild(name);
076: }
077: return child;
078: }
079:
080: public void processAttributes() throws AMConsoleException {
081: if (attrValues == null) {
082: attrValues = new HashMap();
083: }
084: if (attrStatus == null) {
085: attrStatus = new HashMap();
086: }
087: NetFileTotalOneDotTwoUserProfileView view = (NetFileTotalOneDotTwoUserProfileView) getChild(USER_DATA_VIEW);
088: List dynComps = view.getDynamicCompList();
089: if (dynComps != null && !dynComps.isEmpty()) {
090: Iterator it = dynComps.iterator();
091: while (it.hasNext()) {
092: DynamicGUI dGui = (DynamicGUI) it.next();
093: if (dGui != null) {
094: attrValues.put(dGui.getName(), dGui.getValues());
095: attrStatus.put(dGui.getName(), dGui
096: .getStatusValue());
097: }
098: }
099: }
100: }
101:
102: }
|