Package com.exedosoft.plat.ui

Examples of com.exedosoft.plat.ui.DOFormModel


public class DOValueLink implements DOIView {

  public String getHtmlCode(DOIModel aModel) {

    DOFormModel property = (DOFormModel) aModel;
    StringBuffer buffer = new StringBuffer();
    // //////////对picture类型的特殊处理

    String[] oneLink = property.getValue().split(",");
    for (int i = 0; i < oneLink.length; i++) {
      buffer.append("<a class='exedo_link' href='/").append("/").append(oneLink[i]).append(
          "'>").append(oneLink[i]).append("</a>");
      if (i < oneLink.length - 1) {
        buffer.append(",&nbsp;");
View Full Code Here


        deletes.invokeUpdate();
     
       
//////////////////////表格元素
        for(int i = 0 ;i < 10;i++){
          DOFormModel aFm = DOFormModel.getFormModelByProperty(dop.getObjUid());
          if(aFm!=null){
            DAOUtil.INSTANCE().delete(aFm);
          }
        }
        DAOUtil.INSTANCE().delete(dop);
View Full Code Here

  }
 
 
  private  void geneForm(DOBOProperty prop, DOGridModel gridM){
   
    DOFormModel formM = new DOFormModel();
    formM.setRelationProperty(prop);
   
    String aName = gridM.getName().toLowerCase();
   
    /**
     *  * 客户端验证配置,分为3部分,以;隔开 1,类型:Integer RealNumber EMail Text Others 2, 长度 3,
       * 其他Script 约束
       *
     */
     
   
    if (prop.isNumberType()) {
      String  exedoType = "RealNumber";
      formM.setExedojoType(exedoType);
    }else if(!prop.isDateOrTimeType()){
      formM.setExedojoType(";"+ prop.getDbSize().intValue());
    }

    formM.setL10n(prop.getColName());
    formM.setGridModel(gridM);

   
    formM.setOrderNum(1000);
    if (prop.isDateOrTimeType()) {
      if (aName.endsWith("browse") || aName.endsWith("list")) {
        formM.setController(formValueDate);
      } else {
        formM.setController(formDateMy97);
      }
    } else {
      if (aName.endsWith("browse") || aName.endsWith("list")) {
        formM.setController(formValueSimple);
      } else {
       
        if(prop.getDbSize()!=null && prop.getDbSize().intValue()>500){
          formM.setController(formTextArea);
          formM.setIsNewLine(DOFormModel.NEWLINE_YES);
        }else{
          formM.setController(formInputText);
        }
      }

    }
    try {
View Full Code Here

public class DOSelectInvokeWithInsert extends DOBaseForm {

  public String getHtmlCode(DOIModel iModel) {

    DOFormModel property = (DOFormModel) iModel;

    StringBuffer buffer = new StringBuffer();

    buffer.append("<input name=\"").append(property.getFullColName())
        .append("\" type=\"hidden\"").append(" id=\"").append(
            property.getFullColName()).append("\" ");

    if (property.getValue() != null
        && !property.getValue().trim().equals("")) {
      buffer.append(" value=\"").append(property.getValue()).append("\"");
    }

    buffer.append(" />");

    if (property.getInputConfig() != null) {
     
      ////////////////隐藏的inputType formModel Name
      buffer.append("<input name=\"").append(property.getInputConfig())
          .append("\" type=\"hidden\"").append(" id=\"").append(
              property.getInputConfig()).append("\" ");

      if (property.getValue() != null
          && !property.getValue().trim().equals("")) {
        buffer.append(" value=\"").append(property.getValue()).append(
            "\"");
      }
      buffer.append(" />");
    }

    // onkeydown
    buffer.append("<input name=\"").append(property.getFullColName())
        .append("show\" type=\"text\"").append(" id=\"").append(
            property.getFullColName()).append("show\"")
    // .append(" onkeydown=\"")
    // .append("recieveKeyValue('")
    // .append(property.getFullColName())
    // .append("',this.value)\"")
    ;

    buffer.append(this.appendValidateConfig(property));

    if (property.getValue() != null
        && !property.getValue().trim().equals("")) {

      DOBO doBO = null;

      if (property.getLinkBO() != null) {
        doBO = property.getLinkBO();
      } else if (property.getLinkService() != null) {
        doBO = property.getLinkService().getBo();
      }

      BOInstance bi = DOValueResultList.getAInstance(property, doBO,
          property.getValue());

      System.out.println("BOInstance===========" + bi);

      if (bi != null) {
        buffer.append(" value=\"").append(bi.getName()).append("\"");
      }

    }

    buffer.append(" readonly=\"readonly\" ");

    // ////增加装饰
    buffer.append(getDecoration(property));

    // ///////end 增加装饰
    buffer.append(" title='").append(property.getL10n()).append("'");

    buffer.append(" size=\"").append(getInputSize(property)).append("\"/>");

    buffer.append(DOValueService.stardardOnlyPane(property, "查找"));
   
   
   
    buffer.append("&nbsp;&nbsp;");
 
 
    DOFormModel newFm = DOFormModel.getFormModelByID("2dc40ca2088c4e87a99478fd50db9c5b") ;
   
    buffer.append(DOValueService.stardardOnlyPane(newFm, " 新增 "));
   
  //  buffer.append("&nbsp;&nbsp;&nbsp;<a href='#' onclick='doAjax.refresh(\"dojo.openwindow\", \"pane_tbstudent.list.insertxuers.tbstudent.tbstudenthopeclass.pml?isGet=true\");'>新增</a>");
View Full Code Here

          dop.setLinkBO(aBO);
          DAOUtil.INSTANCE().store(dop);
        }
        List<DOFormModel>  forms = DAOUtil.INSTANCE().select(DOFormModel.class, "select * from DO_UI_FormModel  where relationPropertyUid = ?", dop.getObjUid());
        for(Iterator<DOFormModel>  itFm = forms.iterator(); itFm.hasNext();){
          DOFormModel fm = itFm.next();
          if(fm.getLinkService()==null){
            if(fm.getGridModel().getName().toLowerCase().contains("browse") || fm.getGridModel().getName().toLowerCase().contains("_list") || fm.getGridModel().getName().toLowerCase().contains("_result") ){
              fm.setLinkService(aBO.getDSeleByIdService());
              fm.setController(DOController.getControllerByName(DOValueResultList.class.getCanonicalName()));
            }else{
              fm.setLinkService(aBO.getDSeleAllService());
              fm.setController(DOController.getControllerByName(DOResultListPopup.class.getCanonicalName()));
            }
            DAOUtil.INSTANCE().store(fm);
          }
        }
      }
View Full Code Here

public class DOInputTextBetweenOnlyInteger extends DOBaseForm {

  public String getHtmlCode(DOIModel aModel) {

    DOFormModel fm = (DOFormModel) aModel;

    StringBuffer buffer = new StringBuffer();

    getAInputTimeStr(fm, buffer, "");
    buffer.append("&nbsp;至 &nbsp;");
View Full Code Here

public class DOValueResultList extends DOBaseForm {

  public String getHtmlCode(DOIModel iModel) {

    DOFormModel fm = (DOFormModel) iModel;

    /**
     * 可变动态下拉列表, 根据连接的FORMMODEL,一般静态staticlist 确定使用的服务
     */
    boolean isDyn = false;

    if (fm.getLinkForms() != null && !fm.getLinkForms().isEmpty()
        && fm.getInputConfig() != null) {
      isDyn = true;
    }

    String theValue = fm.getValue();

    if (theValue == null && fm.getData() != null
        && fm.getRelationProperty() != null) {
      theValue = fm.getData().getValue(
          fm.getRelationProperty().getColName());
    }

    if (theValue != null && !"".equals(theValue.trim())) {

      DOBO corrBO = fm.getLinkBO();

      if (corrBO == null && fm.getLinkService() != null) {
        corrBO = fm.getLinkService().getBo();
      }
      if (theValue.indexOf(";") == -1) {
        BOInstance<?> bi = null;

        /**
         * 可变动态下拉列表, 根据连接的FORMMODEL,一般静态staticlist 确定使用的服务
         */
        if (isDyn) {
          DOFormModel linkFm = (DOFormModel) fm.getLinkForms().get(0);
          String theLinkValue = fm.getData().getValue(
              linkFm.getColName());

          if (theLinkValue != null) {

            List list = StringUtil.getStaticList(fm
                .getInputConfig());
View Full Code Here

    // ///////////界面对应的业务对象即使需要刷新的业务对象

    DOBO refreshBO = null;

    try {
      DOFormModel buttonForm = null;

      String invokeButtonID = this.actionForm.getValue("invokeButtonUid");
      if (invokeButtonID != null && !"".equals(invokeButtonID.trim())) {// ////////////首先根据启发按钮获取
        buttonForm = DOFormModel.getFormModelByID(invokeButtonID);
      }
      if (buttonForm != null
          && buttonForm.getTargetGridModels().size() <= 1) {
        if (buttonForm.getGridModel().getService() != null) {
          refreshBO = buttonForm.getGridModel().getService().getBo();
        }
      }

    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


    BOInstance uiForm = DOGlobals.getInstance().getSessoinContext()
        .getFormInstance();
    String formUid = uiForm.getValue("formUid");
    DOFormModel aFm = DOFormModel.getFormModelByID(formUid);

    if (aFm == null) {
      setEchoValue(I18n.instance().get("未配置FormModel"));
      return NO_FORWARD;
    }

    /*
     * 必须定义两个服务,新增的服务和修改 的服务
     */
    DOService insertService = aFm.getLinkService();
    DOService updateService = aFm.getSecondService();

    if (insertService == null || updateService == null) {
      setEchoValue(I18n.instance().get("必须定义两个服务,新增的服务和修改的服务!"));
      return NO_FORWARD;
    }

    Connection con = null;
    int batchSize = 0;
    try {

      con = insertService.getBo().getDataBase().getContextConnection();
       // ////////////////////////////////////新增
      String inputName = uiForm.getValue("inputName");
      if (inputName != null && !inputName.trim().equals("")) {
        String[] inputValues = uiForm.getValueArray(inputName);
        log.info("Current SQL:" + insertService.getTempSql());
        PreparedStatement pstmt = con.prepareStatement(insertService
            .getTempSql());

        List<String> newIds = new ArrayList<String>();
        for (int len = 0; len < inputValues.length; len++) {
          int i = 1;
          for (Iterator it = insertService.retrieveParaServiceLinks()
              .iterator(); it.hasNext();) {
            DOParameterService dops = (DOParameterService) it
                .next();
            DOParameter dop = dops.getDop();

            String value = null;

            if (dop.getType() != null
                && dop.getType().intValue() == DOParameter.TYPE_FORM
                && dop.getDefaultValue() == null) {// //form类型直接从节目获取
              log.info("Batch Parameter Name:::" + dop.getName());
              String[] valueArray = uiForm.getValueArray(dop
                  .getName());
              value = valueArray[len];
              if ("".equals(value)) {
                value = null;
              }
            } else {
              value = dop.getValue();
            }
           
            if (dop.getType() != null
                && dop.getType().intValue() == DOParameter.TYPE_KEY) {
              newIds.add(value);
            }
            value = dops.getAfterPattermValue(value);
            insertService.putStatementAValue(pstmt, i, dops, value);
            i++;
          }
          batchSize++;
          pstmt.addBatch();
        }
        log.info("::batchSize:::" + batchSize);
        pstmt.executeBatch();
       
        /////多租户的处理
        for(String anID : newIds){
          insertService.dealMultiTenancy(null, con, anID);
        }
      }
      // ////////////////////////////////////end 新增=====================

      // ////////////修改   begin==============================================
      DOBO refreshBO = aFm.getGridModel().getService().getBo();

      String[] ids = uiForm.getValueArray("id");
      if (ids != null && ids.length > 0) {

        PreparedStatement pstmt = con.prepareStatement(updateService
View Full Code Here

      DOBOProperty prop = (DOBOProperty) itProp.next();
      if (prop.isKeyCol()) {
        continue;
      }
      DOFormModel formM = new DOFormModel();
      formM.setRelationProperty(prop);
     
     
      /**
       *  * 客户端验证配置,分为3部分,以;隔开 1,类型:Integer RealNumber EMail Text Others 2, 长度 3,
         * 其他Script 约束
         *
       */
       
     
      if (prop.isNumberType()) {
       
        String  exedoType = "RealNumber";
        formM.setExedojoType(exedoType);
      }else if(!prop.isDateOrTimeType()){
        formM.setExedojoType(";"+ (int)(prop.getDbSize().intValue()/2));
      }

      formM.setL10n(prop.getColName());
      formM.setGridModel(gridM);

     
      formM.setOrderNum(Integer.valueOf(i * 5));
      if (prop.isDateOrTimeType()) {
        if ("".equals(aName)) {
          formM.setController(formValueDate);
        } else {
          formM.setController(formTimeC);
        }
      } else {
        if ("".equals(aName)) {
          formM.setController(formValueTextC);
        } else {
         
          if(prop.getDbSize()!=null && prop.getDbSize().intValue()>500){
            formM.setController(formTextArea);
            formM.setIsNewLine(DOFormModel.NEWLINE_YES);
          }else{
            formM.setController(formTextC);
          }
        }

      }
      DAOUtil.INSTANCE().store(formM);
View Full Code Here

TOP

Related Classes of com.exedosoft.plat.ui.DOFormModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.