home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2003 March / DPPCPRO0303.ISO / Components / Microsoft ASP / _SETUP.1 / ASPWizard.jar / asp / wizard / def / LayoutGenerator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-20  |  20.4 KB  |  562 lines

  1. package asp.wizard.def;
  2.  
  3. import asp.nfx.MSDBConnection.MSDBConnection;
  4. import asp.nfx.MSDBDynaField.MSDBDynaField;
  5. import asp.nfx.MSDBList.MSDBList;
  6. import asp.nfx.MSDBQuery.MSDBQuery;
  7. import asp.util.ResourceUtil;
  8. import asp.wizard.AspWizardExceptionHandler;
  9. import com.netobjects.nfc.api.ComponentApp;
  10. import com.netobjects.nfc.api.ComponentData;
  11. import com.netobjects.nfc.api.ComponentInfo;
  12. import com.netobjects.nfc.api.DNode;
  13. import com.netobjects.nfc.api.DRect;
  14. import com.netobjects.nfc.api.DSiteView;
  15. import java.util.Enumeration;
  16. import java.util.Hashtable;
  17. import java.util.Vector;
  18.  
  19. public class LayoutGenerator {
  20.    private static String ERR_CONNECTION = "msg.error.connection";
  21.    private static String ERR_QUERY = "msg.error.query";
  22.    private static String ERR_LIST = "msg.error.list";
  23.    private static String ERR_TEXTBOX = "msg.error.textbox";
  24.    private static String ERR_TEXTAREA = "msg.error.textarea";
  25.    private static String ERR_LABEL = "msg.error.label";
  26.    DSiteView theDSiteView;
  27.    int placeAt;
  28.    private Vector _listeners = new Vector();
  29.    private Hashtable _placedComponentsByDefOb = new Hashtable();
  30.    // $FF: synthetic field
  31.    static Class class$asp$wizard$def$LayoutGenerator;
  32.    // $FF: synthetic field
  33.    static Class class$asp$wizard$def$DefList;
  34.    // $FF: synthetic field
  35.    static Class class$asp$wizard$def$DefDynaField;
  36.  
  37.    public LayoutGenerator(DSiteView theDSV) {
  38.       this.theDSiteView = theDSV;
  39.       new DNode();
  40.    }
  41.  
  42.    public void generate(DefPage theDefPage) {
  43.       LayoutGeneratorEvent evt = new LayoutGeneratorEvent(this, 1000, theDefPage);
  44.       this.processLayoutGeneratorEvent(evt);
  45.       DNode theDNode = new DNode();
  46.       this.generate(theDefPage, theDNode);
  47.       this.placeAt = 0;
  48.       evt = new LayoutGeneratorEvent(this, 1001, theDefPage);
  49.       this.processLayoutGeneratorEvent(evt);
  50.    }
  51.  
  52.    public void addLayoutGeneratorListener(LayoutGeneratorListener listener) {
  53.       if (!this._listeners.contains(listener)) {
  54.          this._listeners.addElement(listener);
  55.       }
  56.  
  57.    }
  58.  
  59.    public void removeLayoutGeneratorListener(LayoutGeneratorListener listener) {
  60.       this._listeners.removeElement(listener);
  61.    }
  62.  
  63.    private void processLayoutGeneratorEvent(LayoutGeneratorEvent evt) {
  64.       LayoutGeneratorListener aListener = null;
  65.       Enumeration e = this._listeners.elements();
  66.  
  67.       while(e.hasMoreElements()) {
  68.          aListener = (LayoutGeneratorListener)e.nextElement();
  69.          switch (evt.getType()) {
  70.             case 1000:
  71.                aListener.genStarted(evt);
  72.                break;
  73.             case 1001:
  74.                aListener.genEnded(evt);
  75.                break;
  76.             case 1002:
  77.                aListener.genObjectStarted(evt);
  78.                break;
  79.             case 1003:
  80.                aListener.genObjectEnded(evt);
  81.          }
  82.       }
  83.  
  84.    }
  85.  
  86.    private void generate(DefPage theDefPage, DNode theDNode) {
  87.       LayoutGeneratorEvent evt = new LayoutGeneratorEvent(this, 1002, theDefPage);
  88.       this.processLayoutGeneratorEvent(evt);
  89.       theDNode = this.buildPage(theDefPage, theDNode);
  90.       Enumeration defObs = ((DefCollection)theDefPage).getElements();
  91.       String msg = null;
  92.  
  93.       while(defObs.hasMoreElements()) {
  94.          DefAbstract theDefOb = (DefAbstract)defObs.nextElement();
  95.          this.dropComponent(theDefOb, theDNode);
  96.       }
  97.  
  98.       evt = new LayoutGeneratorEvent(this, 1003, theDefPage);
  99.       this.processLayoutGeneratorEvent(evt);
  100.       DefCollection children = theDefPage.getChildPages();
  101.       Enumeration childElements = children.getElements();
  102.  
  103.       while(childElements.hasMoreElements()) {
  104.          DefPage theChildPage = (DefPage)childElements.nextElement();
  105.          this.generate(theChildPage, theDNode);
  106.       }
  107.  
  108.    }
  109.  
  110.    private void dropComponent(DefAbstract theDefOb, DNode theDNode) {
  111.       if (theDefOb instanceof DefQuery) {
  112.          DefConnection theDefConnection = ((DefQuery)theDefOb).getDefConnection();
  113.          if (!((DefAbstract)theDefConnection).getPlaced()) {
  114.             this.dropComponent(theDefConnection, theDNode);
  115.          }
  116.       } else if (theDefOb.getDefQuery() != null) {
  117.          DefQuery theDefQuery = theDefOb.getDefQuery();
  118.          if (!((DefAbstract)theDefQuery).getPlaced()) {
  119.             this.dropComponent(theDefQuery, theDNode);
  120.          }
  121.       }
  122.  
  123.       this.placeComponent(theDefOb, theDNode);
  124.    }
  125.  
  126.    private void placeComponent(DefAbstract theDefOb, DNode theDNode) {
  127.       ComponentApp myCompApp = new ComponentApp();
  128.       new String();
  129.       DRect theDRect = new DRect();
  130.       ComponentInfo myCompInfo = new ComponentInfo();
  131.       ComponentData[] installedComps = myCompInfo.getAllComponentsInstalled("asp.nfx");
  132.       LayoutGeneratorEvent evt = new LayoutGeneratorEvent(this, 1002, theDefOb);
  133.       this.processLayoutGeneratorEvent(evt);
  134.  
  135.       for(int i = 0; i < installedComps.length; ++i) {
  136.          String compName = installedComps[i].getComponentName();
  137.          String defType = new String();
  138.          if (theDefOb instanceof DefConnection && compName.compareTo("asp.nfx.MSDBConnection.MSDBConnection") == 0) {
  139.             defType = "DefConnection";
  140.             theDRect.setTop(10);
  141.             theDRect.setLeft(10);
  142.             theDRect.setBottom(50);
  143.             theDRect.setRight(90);
  144.             myCompApp = theDNode.addNFX(installedComps[i], theDRect);
  145.             this._placedComponentsByDefOb.put(theDefOb, myCompApp);
  146.          }
  147.  
  148.          if (theDefOb instanceof DefQuery && compName.compareTo("asp.nfx.MSDBQuery.MSDBQuery") == 0) {
  149.             defType = "DefQuery";
  150.             theDRect.setTop(10);
  151.             theDRect.setLeft(100);
  152.             theDRect.setBottom(50);
  153.             theDRect.setRight(180);
  154.             myCompApp = theDNode.addNFX(installedComps[i], theDRect);
  155.             this._placedComponentsByDefOb.put(theDefOb, myCompApp);
  156.          }
  157.  
  158.          if (theDefOb instanceof DefList && compName.compareTo("asp.nfx.MSDBList.MSDBList") == 0) {
  159.             defType = "DefList";
  160.             theDRect.setTop(60);
  161.             theDRect.setLeft(10);
  162.             theDRect.setBottom(100);
  163.             theDRect.setRight(70);
  164.             myCompApp = theDNode.addNFX(installedComps[i], theDRect);
  165.             this._placedComponentsByDefOb.put(theDefOb, myCompApp);
  166.          }
  167.  
  168.          if (theDefOb instanceof DefDynaField && compName.compareTo("asp.nfx.MSDBDynaField.MSDBDynaField") == 0) {
  169.             String labelText = ((DefDynaField)theDefOb).getLabelText();
  170.             if (this.placeAt == 0) {
  171.                this.placeAt = 100;
  172.             }
  173.  
  174.             defType = "DefDynaField";
  175.             theDRect.setTop(this.placeAt);
  176.             theDRect.setLeft(200);
  177.             theDRect.setBottom(this.placeAt + 30);
  178.             theDRect.setRight(480);
  179.             myCompApp = theDNode.addNFX(installedComps[i], theDRect);
  180.             this._placedComponentsByDefOb.put(theDefOb, myCompApp);
  181.             theDRect.setTop(this.placeAt);
  182.             theDRect.setLeft(0);
  183.             theDRect.setBottom(this.placeAt + 30);
  184.             theDRect.setRight(190);
  185.             theDNode.insertTextObject2Page(labelText, theDRect);
  186.             this.placeAt += 40;
  187.          }
  188.  
  189.          this.setProperties(theDefOb, defType, myCompApp, theDNode);
  190.          theDefOb.setPlaced(true);
  191.       }
  192.  
  193.       evt = new LayoutGeneratorEvent(this, 1003, theDefOb);
  194.       this.processLayoutGeneratorEvent(evt);
  195.    }
  196.  
  197.    private void setProperties(DefAbstract theDefOb, String defType, ComponentApp myCompApp, DNode theDNode) {
  198.       myCompApp.setName(theDefOb.getName());
  199.       if (defType == "DefConnection") {
  200.          MSDBConnection myMSDBCon = (MSDBConnection)myCompApp;
  201.          DefConnection defCon = (DefConnection)theDefOb;
  202.  
  203.          try {
  204.             this.setConnectionProperties(myMSDBCon, defCon, theDNode);
  205.          } catch (Exception e) {
  206.             String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_CONNECTION);
  207.             AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  208.          }
  209.       }
  210.  
  211.       if (defType == "DefQuery") {
  212.          MSDBQuery myMSDBQuery = (MSDBQuery)myCompApp;
  213.          DefQuery defQuery = (DefQuery)theDefOb;
  214.  
  215.          try {
  216.             this.setQueryProperties(myMSDBQuery, defQuery);
  217.          } catch (Exception e) {
  218.             String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_QUERY);
  219.             AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  220.          }
  221.       }
  222.  
  223.       if (defType == "DefList") {
  224.          MSDBList myMSDBList = (MSDBList)myCompApp;
  225.          DefList defList = (DefList)theDefOb;
  226.  
  227.          try {
  228.             this.setListProperties(myMSDBList, defList);
  229.          } catch (Exception e) {
  230.             String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_LIST);
  231.             AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  232.          }
  233.       }
  234.  
  235.       if (defType == "DefDynaField") {
  236.          MSDBDynaField myMSDBDynaField = (MSDBDynaField)myCompApp;
  237.          if (theDefOb instanceof DefTextBox) {
  238.             DefTextBox defTextBox = (DefTextBox)theDefOb;
  239.  
  240.             try {
  241.                this.setTextBoxProperties(myMSDBDynaField, defTextBox);
  242.             } catch (Exception e) {
  243.                String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_TEXTBOX);
  244.                AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  245.             }
  246.          }
  247.  
  248.          if (theDefOb instanceof DefTextArea) {
  249.             DefTextArea defTextArea = (DefTextArea)theDefOb;
  250.  
  251.             try {
  252.                this.setTextAreaProperties(myMSDBDynaField, defTextArea);
  253.             } catch (Exception e) {
  254.                String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_TEXTAREA);
  255.                AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  256.             }
  257.          }
  258.  
  259.          if (theDefOb instanceof DefLabel) {
  260.             DefLabel defLabel = (DefLabel)theDefOb;
  261.  
  262.             try {
  263.                this.setLabelProperties(myMSDBDynaField, defLabel);
  264.             } catch (Exception e) {
  265.                String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_LABEL);
  266.                AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  267.             }
  268.          }
  269.       }
  270.  
  271.    }
  272.  
  273.    private void setConnectionProperties(MSDBConnection myMSDBCon, DefConnection defCon, DNode theDNode) {
  274.       try {
  275.          ResourceUtil ru = MSDBConnection.initResourceUtil(myMSDBCon.getClass());
  276.          String _odbctype = ru.getString("property.odbctype");
  277.          String _dsnname = ru.getString("property.dsnname");
  278.          String _username = ru.getString("property.username");
  279.          String _password = ru.getString("property.password");
  280.          String _globconn = ru.getString("property.globconn");
  281.          Integer odbc = new Integer(defCon.getOdbcType());
  282.          Integer globcon = new Integer(defCon.getGlobalConnection());
  283.          this.setComponentAppProperty(myMSDBCon, _odbctype, odbc.toString());
  284.          this.setComponentAppProperty(myMSDBCon, _dsnname, defCon.getDSNName());
  285.          this.setComponentAppProperty(myMSDBCon, _username, defCon.getUserName());
  286.          this.setComponentAppProperty(myMSDBCon, _password, defCon.getPassword());
  287.          this.setComponentAppProperty(myMSDBCon, _globconn, globcon.toString());
  288.       } catch (Exception e) {
  289.          String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_CONNECTION);
  290.          AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  291.       }
  292.  
  293.    }
  294.  
  295.    private void setQueryProperties(MSDBQuery myMSDBQuery, DefQuery defQuery) {
  296.       try {
  297.          ResourceUtil resUtil = MSDBQuery.initResourceUtil(myMSDBQuery.getClass());
  298.          String _name = resUtil.getString("property.name");
  299.          String _useprev = resUtil.getString("property.useprev");
  300.          String _select = resUtil.getString("property.select");
  301.          String _from = resUtil.getString("property.from");
  302.          String _where = resUtil.getString("property.where");
  303.          String _orderby = resUtil.getString("property.orderby");
  304.          Integer usePrev = new Integer(defQuery.getUsePreviousQuery());
  305.          this.setComponentAppProperty(myMSDBQuery, _name, ((DefAbstract)defQuery).getName());
  306.          this.setComponentAppProperty(myMSDBQuery, _useprev, usePrev.toString());
  307.          this.setComponentAppProperty(myMSDBQuery, _select, defQuery.getSelect());
  308.          this.setComponentAppProperty(myMSDBQuery, _from, defQuery.getFrom());
  309.          this.setComponentAppProperty(myMSDBQuery, _where, defQuery.getWhere());
  310.          this.setComponentAppProperty(myMSDBQuery, _orderby, defQuery.getOrderBy());
  311.       } catch (Exception e) {
  312.          String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_QUERY);
  313.          AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  314.       }
  315.  
  316.    }
  317.  
  318.    private void setListProperties(MSDBList myMSDBList, DefList defList) {
  319.       try {
  320.          ResourceUtil ru = MSDBList.initResourceUtil(myMSDBList.getClass());
  321.          String _name = ru.getString("property.name");
  322.          String _query = ru.getString("property.query");
  323.          String _nav = ru.getString("property.nav");
  324.          String _labelfont = ru.getString("property.labelfont");
  325.          String _labelfontsize = ru.getString("property.labelfontsize");
  326.          String _labelfontcolor = ru.getString("property.labelfontcolor");
  327.          String _labelfontbold = ru.getString("property.labelfontbold");
  328.          String _labelfontitalic = ru.getString("property.labelfontitalic");
  329.          String _labelfontunderline = ru.getString("property.labelfontunderline");
  330.          String _datafont = ru.getString("property.datafont");
  331.          String _datafontsize = ru.getString("property.datafontsize");
  332.          String _datafontcolor = ru.getString("property.datafontcolor");
  333.          String _datafontbold = ru.getString("property.datafontbold");
  334.          String _datafontitalic = ru.getString("property.datafontitalic");
  335.          String _datafontunderline = ru.getString("property.datafontunderline");
  336.          String _cellpadding = ru.getString("property.cellpadding");
  337.          String _cellspacing = ru.getString("property.cellspacing");
  338.          String _bordersize = ru.getString("property.bordersize");
  339.          String _hyperlinkpage = ru.getString("property.hyperlinkpage");
  340.          String _hyperlinkfield = ru.getString("property.hyperlinkfield");
  341.          String _kfldcount = ru.getString("property.kfldcount");
  342.          String _kfldname = ru.getString("property.kfldname");
  343.          String _kfldlabel = ru.getString("property.kfldlabel");
  344.          String _kfldtype = ru.getString("property.kfldtype");
  345.          String _fldcount = ru.getString("property.fldcount");
  346.          String _fldname = ru.getString("property.fldname");
  347.          String _fldlabel = ru.getString("property.fldlabel");
  348.          this.setComponentAppProperty(myMSDBList, _name, ((DefAbstract)defList).getName());
  349.          this.setComponentAppProperty(myMSDBList, _query, ((DefAbstract)defList).getDefQuery().getName());
  350.          if (defList.getNavComponent() != null && !defList.getNavComponent().equals("")) {
  351.             this.setComponentAppProperty(myMSDBList, _nav, defList.getNavComponent());
  352.          }
  353.  
  354.          this.setComponentAppProperty(myMSDBList, _labelfont, defList.getLabelFont());
  355.          this.setComponentAppProperty(myMSDBList, _labelfontsize, Integer.toString(defList.getLabelFontSize()));
  356.          this.setComponentAppProperty(myMSDBList, _labelfontcolor, Integer.toString(defList.getLabelFontColor()));
  357.          this.setComponentAppProperty(myMSDBList, _labelfontbold, Integer.toString(defList.getLabelBold()));
  358.          this.setComponentAppProperty(myMSDBList, _labelfontitalic, Integer.toString(defList.getLabelItalic()));
  359.          this.setComponentAppProperty(myMSDBList, _labelfontunderline, Integer.toString(defList.getLabelUnderline()));
  360.          this.setComponentAppProperty(myMSDBList, _datafont, defList.getDataFont());
  361.          this.setComponentAppProperty(myMSDBList, _datafontsize, Integer.toString(defList.getDataFontSize()));
  362.          this.setComponentAppProperty(myMSDBList, _datafontcolor, Integer.toString(defList.getDataFontColor()));
  363.          this.setComponentAppProperty(myMSDBList, _datafontbold, Integer.toString(defList.getDataBold()));
  364.          this.setComponentAppProperty(myMSDBList, _datafontitalic, Integer.toString(defList.getDataItalic()));
  365.          this.setComponentAppProperty(myMSDBList, _datafontunderline, Integer.toString(defList.getDataUnderline()));
  366.          this.setComponentAppProperty(myMSDBList, _cellpadding, Integer.toString(defList.getCellPadding()));
  367.          this.setComponentAppProperty(myMSDBList, _cellspacing, Integer.toString(defList.getCellSpacing()));
  368.          this.setComponentAppProperty(myMSDBList, _bordersize, Integer.toString(defList.getBorderSize()));
  369.          this.setComponentAppProperty(myMSDBList, _hyperlinkpage, Integer.toString(defList.getHyperlinkPage()));
  370.          this.setComponentAppProperty(myMSDBList, _kfldcount, Integer.toString(defList.getKeyFieldCount()));
  371.          this.setComponentAppProperty(myMSDBList, _fldcount, Integer.toString(defList.getFieldCount()));
  372.          String fieldpropname = null;
  373.  
  374.          for(int i = 0; i < defList.getKeyFieldCount(); ++i) {
  375.             fieldpropname = _kfldname + " " + (i + 1);
  376.             String[] keyFieldNames = defList.getKeyFieldNames();
  377.             this.setComponentAppProperty(myMSDBList, fieldpropname, keyFieldNames[i]);
  378.          }
  379.  
  380.          for(int i = 0; i < defList.getKeyFieldCount(); ++i) {
  381.             fieldpropname = _kfldlabel + " " + (i + 1);
  382.             String[] keyFieldLabels = defList.getKeyFieldLabels();
  383.             this.setComponentAppProperty(myMSDBList, fieldpropname, keyFieldLabels[i]);
  384.          }
  385.  
  386.          for(int i = 0; i < defList.getKeyFieldCount(); ++i) {
  387.             fieldpropname = _kfldtype + " " + (i + 1);
  388.             int[] keyFieldDataTypes = defList.getKeyFieldDataTypes();
  389.             this.setComponentAppProperty(myMSDBList, fieldpropname, Integer.toString(keyFieldDataTypes[i]));
  390.          }
  391.  
  392.          for(int i = 0; i < defList.getFieldCount(); ++i) {
  393.             fieldpropname = _fldname + " " + (i + 1);
  394.             String[] fieldNames = defList.getFieldNames();
  395.             this.setComponentAppProperty(myMSDBList, fieldpropname, fieldNames[i]);
  396.          }
  397.  
  398.          for(int i = 0; i < defList.getFieldCount(); ++i) {
  399.             fieldpropname = _fldlabel + " " + (i + 1);
  400.             String[] fieldLabels = defList.getFieldLabels();
  401.             this.setComponentAppProperty(myMSDBList, fieldpropname, fieldLabels[i]);
  402.          }
  403.  
  404.          this.setComponentAppProperty(myMSDBList, _hyperlinkfield, Integer.toString(defList.getHyperlinkField()));
  405.       } catch (Exception e) {
  406.          String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_LIST);
  407.          AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  408.       }
  409.  
  410.    }
  411.  
  412.    private void setTextBoxProperties(MSDBDynaField myMSDBDynaField, DefTextBox defTextBox) {
  413.       try {
  414.          ResourceUtil ru = MSDBDynaField.initResourceUtil(myMSDBDynaField.getClass());
  415.          String _usequery = ru.getString("property.usequery");
  416.          String _query = ru.getString("property.query");
  417.          String _datafield = ru.getString("property.datafield");
  418.          String _datatype = ru.getString("property.datatype");
  419.          String _default = ru.getString("property.default");
  420.          String _vislength = ru.getString("property.vislength");
  421.          String _maxlength = ru.getString("property.maxlength");
  422.          String _visheight = ru.getString("property.visheight");
  423.          String _editable = ru.getString("property.iseditable");
  424.          new Integer(0);
  425.          this.setComponentAppProperty(myMSDBDynaField, _usequery, (new Integer(((DefDynaField)defTextBox).getUseQuery())).toString());
  426.          this.setComponentAppProperty(myMSDBDynaField, _query, ((DefAbstract)defTextBox).getDefQuery().getName());
  427.          this.setComponentAppProperty(myMSDBDynaField, _datafield, ((DefDynaField)defTextBox).getDataField());
  428.          this.setComponentAppProperty(myMSDBDynaField, _datatype, (new Integer(((DefDynaField)defTextBox).getDataType())).toString());
  429.          this.setComponentAppProperty(myMSDBDynaField, _default, ((DefDynaField)defTextBox).getDefaultValue());
  430.          this.setComponentAppProperty(myMSDBDynaField, _vislength, (new Integer(defTextBox.getVisibleLength())).toString());
  431.          this.setComponentAppProperty(myMSDBDynaField, _visheight, (new Integer(defTextBox.getVisibleHeight())).toString());
  432.          this.setComponentAppProperty(myMSDBDynaField, _maxlength, (new Integer(defTextBox.getMaxLength())).toString());
  433.          this.setComponentAppProperty(myMSDBDynaField, _editable, (new Integer(defTextBox.getEditable())).toString());
  434.       } catch (Exception e) {
  435.          String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_TEXTBOX);
  436.          AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  437.       }
  438.  
  439.    }
  440.  
  441.    private void setTextAreaProperties(MSDBDynaField myMSDBDynaField, DefTextArea defTextArea) {
  442.       try {
  443.          ResourceUtil ru = MSDBDynaField.initResourceUtil(myMSDBDynaField.getClass());
  444.          String _usequery = ru.getString("property.usequery");
  445.          String _query = ru.getString("property.query");
  446.          String _datafield = ru.getString("property.datafield");
  447.          String _datatype = ru.getString("property.datatype");
  448.          String _default = ru.getString("property.default");
  449.          String _vislength = ru.getString("property.vislength");
  450.          String _maxlength = ru.getString("property.maxlength");
  451.          String _visheight = ru.getString("property.visheight");
  452.          String _editable = ru.getString("property.iseditable");
  453.          new Integer(0);
  454.          this.setComponentAppProperty(myMSDBDynaField, _usequery, (new Integer(((DefDynaField)defTextArea).getUseQuery())).toString());
  455.          this.setComponentAppProperty(myMSDBDynaField, _query, ((DefAbstract)defTextArea).getDefQuery().getName());
  456.          this.setComponentAppProperty(myMSDBDynaField, _datafield, ((DefDynaField)defTextArea).getDataField());
  457.          this.setComponentAppProperty(myMSDBDynaField, _datatype, (new Integer(((DefDynaField)defTextArea).getDataType())).toString());
  458.          this.setComponentAppProperty(myMSDBDynaField, _default, ((DefDynaField)defTextArea).getDefaultValue());
  459.          this.setComponentAppProperty(myMSDBDynaField, _vislength, (new Integer(defTextArea.getVisibleLength())).toString());
  460.          this.setComponentAppProperty(myMSDBDynaField, _visheight, (new Integer(defTextArea.getVisibleHeight())).toString());
  461.          this.setComponentAppProperty(myMSDBDynaField, _maxlength, (new Integer(defTextArea.getMaxLength())).toString());
  462.          this.setComponentAppProperty(myMSDBDynaField, _editable, (new Integer(defTextArea.getEditable())).toString());
  463.       } catch (Exception e) {
  464.          String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_TEXTAREA);
  465.          AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  466.       }
  467.  
  468.    }
  469.  
  470.    private void setLabelProperties(MSDBDynaField myMSDBDynaField, DefLabel defLabel) {
  471.       try {
  472.          ResourceUtil ru = MSDBDynaField.initResourceUtil(myMSDBDynaField.getClass());
  473.          String _usequery = ru.getString("property.usequery");
  474.          String _query = ru.getString("property.query");
  475.          String _datafield = ru.getString("property.datafield");
  476.          String _datatype = ru.getString("property.datatype");
  477.          String _default = ru.getString("property.default");
  478.          String _font = ru.getString("property.font");
  479.          String _bold = ru.getString("property.bold");
  480.          String _color = ru.getString("property.color");
  481.          String _underline = ru.getString("property.underline");
  482.          String _italic = ru.getString("property.italic");
  483.          String _fontsize = ru.getString("property.fontsize");
  484.          String _editable = ru.getString("property.iseditable");
  485.          new Integer(0);
  486.          this.setComponentAppProperty(myMSDBDynaField, _usequery, (new Integer(((DefDynaField)defLabel).getUseQuery())).toString());
  487.          this.setComponentAppProperty(myMSDBDynaField, _query, ((DefAbstract)defLabel).getDefQuery().getName());
  488.          this.setComponentAppProperty(myMSDBDynaField, _datafield, ((DefDynaField)defLabel).getDataField());
  489.          this.setComponentAppProperty(myMSDBDynaField, _datatype, (new Integer(((DefDynaField)defLabel).getDataType())).toString());
  490.          this.setComponentAppProperty(myMSDBDynaField, _default, ((DefDynaField)defLabel).getDefaultValue());
  491.          this.setComponentAppProperty(myMSDBDynaField, _font, defLabel.getFont());
  492.          this.setComponentAppProperty(myMSDBDynaField, _bold, (new Integer(defLabel.getBold())).toString());
  493.          this.setComponentAppProperty(myMSDBDynaField, _color, (new Integer(defLabel.getColor())).toString());
  494.          this.setComponentAppProperty(myMSDBDynaField, _underline, (new Integer(defLabel.getUnderline())).toString());
  495.          this.setComponentAppProperty(myMSDBDynaField, _italic, (new Integer(defLabel.getItalic())).toString());
  496.          this.setComponentAppProperty(myMSDBDynaField, _fontsize, (new Integer(defLabel.getSize())).toString());
  497.          this.setComponentAppProperty(myMSDBDynaField, _editable, (new Integer(defLabel.getEditable())).toString());
  498.       } catch (Exception e) {
  499.          String err = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$def$LayoutGenerator != null ? class$asp$wizard$def$LayoutGenerator : (class$asp$wizard$def$LayoutGenerator = class$("asp.wizard.def.LayoutGenerator")), ERR_LABEL);
  500.          AspWizardExceptionHandler.showMessage(0, err + ": " + ((Throwable)e).getMessage());
  501.       }
  502.  
  503.    }
  504.  
  505.    private void fixupParentListHyperlink(DefPage defPage, DNode realPage) {
  506.       if (((DefAbstract)defPage).getParent() != null) {
  507.          DefPage parentPage = (DefPage)((DefAbstract)defPage).getParent();
  508.          Vector searchResult = ((DefCollection)parentPage).getElements(class$asp$wizard$def$DefList != null ? class$asp$wizard$def$DefList : (class$asp$wizard$def$DefList = class$("asp.wizard.def.DefList")));
  509.          if (searchResult.size() > 0) {
  510.             DefList defList = (DefList)searchResult.elementAt(0);
  511.             MSDBList realList = (MSDBList)this._placedComponentsByDefOb.get(defList);
  512.             if (realList != null) {
  513.                realList.setHyperlinkPage(realPage);
  514.             }
  515.          }
  516.       }
  517.  
  518.    }
  519.  
  520.    private void fixupForDetailPage(DefPage theDefPage, DNode theDNode) {
  521.       Vector defObjects = ((DefCollection)theDefPage).getElements(class$asp$wizard$def$DefDynaField != null ? class$asp$wizard$def$DefDynaField : (class$asp$wizard$def$DefDynaField = class$("asp.wizard.def.DefDynaField")));
  522.       if (defObjects.size() > 0) {
  523.          theDNode.setNodeAsForm(true);
  524.       }
  525.  
  526.    }
  527.  
  528.    private DNode buildPage(DefPage theDefPage, DNode theParentDNode) {
  529.       new String();
  530.       String nodeName = ((DefAbstract)theDefPage).getName();
  531.       DNode theDNode = this.theDSiteView.createNewPage(theParentDNode);
  532.       theDNode.setNodeName(nodeName);
  533.       theDNode.setFileExtension("asp");
  534.       this.fixupParentListHyperlink(theDefPage, theDNode);
  535.       this.fixupForDetailPage(theDefPage, theDNode);
  536.       return theDNode;
  537.    }
  538.  
  539.    private final void setComponentAppProperty(ComponentApp comp, String property, String value) {
  540.       value = value == null ? "" : value;
  541.       if (comp instanceof MSDBConnection) {
  542.          ((MSDBConnection)comp).propertyManager(property, value, 0);
  543.       } else if (comp instanceof MSDBQuery) {
  544.          ((MSDBQuery)comp).propertyManager(property, value, 0);
  545.       } else if (comp instanceof MSDBList) {
  546.          ((MSDBList)comp).propertyManager(property, value, 0);
  547.       } else if (comp instanceof MSDBDynaField) {
  548.          ((MSDBDynaField)comp).propertyManager(property, value, 0);
  549.       }
  550.  
  551.    }
  552.  
  553.    // $FF: synthetic method
  554.    static Class class$(String class$) {
  555.       try {
  556.          return Class.forName(class$);
  557.       } catch (ClassNotFoundException forName) {
  558.          throw new NoClassDefFoundError(((Throwable)forName).getMessage());
  559.       }
  560.    }
  561. }
  562.