Package com.exedosoft.plat.bo

Examples of com.exedosoft.plat.bo.DOBO


          .getTenancyValues().getDataDDS();
      dataSourceUid = dss.getObjUid();

    } else {

      DOBO bo = DOBO.getDOBOByName("do_datasource");
      dataSourceUid = bo.getCorrInstance().getUid();

    }

    String[] tables = this.actionForm.getValueArray("checkinstance");
    String bpUid = this.actionForm.getValue("bpUid");
View Full Code Here


    if (keys != null && keys.length > 0) {
      listKeys = Arrays.asList(keys);
    }
    List listHiddenKeys = Arrays.asList(key_hiddens);

    DOBO bo = DOBO.getDOBOByName("do_bo");
    DOBO selected = DOBO.getDOBOByID(bo.getCorrInstance().getUid());

    DODataSource dss = null;
    ///多租户情况`
   
    if ("true".equals(DOGlobals.getValue("multi.tenancy"))) {
      dss = DOGlobals.getInstance().getSessoinContext()
          .getTenancyValues().getDataDDS();
    } else {//单租户情况
      dss = selected.getDataBase();
    }
   
   
    Transaction t = dss.getTransaction();
    t.begin();

    // /先确定删除的
    List list = selected.retrieveProperties();
    List propCols = new ArrayList();

    for (Iterator it = list.iterator(); it.hasNext();) {
      DOBOProperty dop = (DOBOProperty) it.next();
      if (dop.getIsPersistence() == null
          || dop.getIsPersistence().intValue() == DOBOProperty.PERSISTENCE_YES) {
        propCols.add(dop.getObjUid());
      }
    }
    List removeCols = new ArrayList(propCols);

    System.out.println("AllCols::" + removeCols);

    removeCols.removeAll(listHiddenKeys);
    // //需要删除的字段propCols

    System.out.println("RemoveCols::" + removeCols);

    for (int i = 0; i < removeCols.size(); i++) {
      String colObjuid = (String) removeCols.get(i);
      DOBOProperty dop = DOBOProperty.getDOBOPropertyByID(colObjuid);

      StringBuffer sb = new StringBuffer("alter table ");
      sb.append(selected.getSqlStr()).append(" drop column ").append(
          dop.getColName());

      listSql.add(sb.toString());

      pm.removeProperty(selected, dop);
    }

    // 先确定新增的

    for (int len = 0; len < key_hiddens.length; len++) {

      String keyHidden = key_hiddens[len];
      if (keyHidden == null || keyHidden.equals("")) {
        if (colNames[len] != null && !colNames[len].equals("")) {
          DOBOProperty dopExists =  DOBOProperty.getDOBOPropertyByName(selected.getName(),
              colNames[len]);
          if (dopExists==null || dopExists.getColName()==null) {

            StringBuffer sb = new StringBuffer("alter table ");
            sb.append(selected.getSqlStr()).append(" add  ")
                .append(colNames[len]).append(" ").append(
                    dbtypes[len]);

            int iDBSize = 255;
            if (dbsizes[len] != null && !dbsizes[len].equals("")) {
              iDBSize = Integer
                  .parseInt(dbsizes[len]);
              sb.append(" (").append(dbsizes[len]).append(")");
            }
            listSql.add(sb.toString());

            int iType = 12;
            try {
              iType = Integer.parseInt(map.get(dbtypes[len]
                  .toLowerCase()));
            } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
            System.out.println("ColName:" + colNames[len]
                + "  DBSize:" + dbsizes[len]);
            pm.addProperty(selected, colNames[len], iType, iDBSize);
           

          }else{
            System.out.println("已经存在ColName::" + DOBOProperty.getDOBOPropertyByName(selected.getName(),
                colNames[len]));
          }
        }
      }
    }

    // //确定修改的

    Connection con = null;
    try {
      con = dss.getConnection();
      Statement stmt = con.createStatement();

      for (Iterator<String> it = listSql.iterator(); it.hasNext();) {
        String aSql = it.next();
        stmt.execute(aSql);
      }
      stmt.close();
    } catch (SQLException ex) {
      ex.printStackTrace();
      this.setEchoValue(ex.getMessage());
      return NO_FORWARD;

    } finally {

      t.end();
      try {
        if (con != null && !con.isClosed()) {
          con.close();
        }
      } catch (SQLException ex1) {
        ex1.printStackTrace();
      }
    }
    // TODO Auto-generated method stub
    CacheFactory.getCacheRelation().getData().remove((new StringBuilder(String.valueOf(selected.getObjUid()))).append("_property").toString());
    this.setEchoValue(I18n.instance().get("保存成功!"));
    return DEFAULT_FORWARD;
  }
View Full Code Here

  private static final long serialVersionUID = 8336023748771461161L;

  private static Log log = LogFactory.getLog(DOGeneParentChild.class);

  public String excute() {
    DOBO bo = DOBO.getDOBOByName("do.bo");

    String boUid = bo.getCorrInstance().getUid();
    log.info("CurBOUID::" + boUid);

    DOBO curBO = DOBO.getDOBOByID(boUid);
    //
    String parentBOUid = this.actionForm
        .getValue("qingxuanzezhuyewuduixiang");
    log.info("ParentBOUid:" + parentBOUid);

    DOBO parentBO = DOBO.getDOBOByID(parentBOUid);

    String aField = this.actionForm.getValue("qingxuanzelianjiedeshuxing");
    log.info("Field::" + aField);

   
    DOBOProperty prop = DOBOProperty.getDOBOPropertyByID(aField);
    DOParameter propPara = DOParameter.getParameterByProperty(prop,DOParameter.TYPE_FORM);
   
    DOBOProperty parentKey = DOBOProperty.getDOBOPropertyByName(parentBO.getName(),parentBO
        .getKeyCol());
    DOParameter keyPara = DOParameter.getParameterByProperty(
        parentKey, DOParameter.TYPE_CURRENT);


    if (boUid == null) {
      return "";
    }
    // ////////////////清楚缓存
//    HbmDAO dao = new HbmDAO();
//    dao.setAutoClose(false);
//    dao.setIsTransaction(true);
   
    DODataSource dds = DODataSource.parseGlobals();
   
    Transaction t = dds.getTransaction();
   
    t.begin();
   
    try {

      StringBuffer aServiceSql = new StringBuffer("select * from ");
      aServiceSql.append(bo.getCorrInstance().getValue("sqlStr")).append(
          " where ").append(prop.getColName()).append(" = ?");
      log.info(" The Service Sql is ::" + aServiceSql);
      DOService aService = new DOService();
      aService.setBo(curBO);
      aService.setMainSql(aServiceSql.toString());
      aService.setName(parentBO.getName() + "have" + curBO.getName());
      aService.setL10n(parentBO.getL10n() + "拥有的" + curBO.getL10n());
      DAOUtil.INSTANCE().store(aService);

      DOParameterService dps = new DOParameterService();
      dps.setDop(keyPara);
      dps.setDos(aService);
      dps.setOrderNum(new Integer(5));
      DAOUtil.INSTANCE().store(dps);

      DOService sInsert = DOService.getService(curBO.getName()
          + ".insert");
      log.info("Find the insert Service::" + sInsert.getName());
      DOParameterService paraInsert = DOParameterService
          .getDOParaService(propPara.getObjUid(), sInsert.getObjUid());
      if (paraInsert != null) {
        paraInsert.setDop(keyPara);
        DAOUtil.INSTANCE().store(paraInsert);
      }

      DOService sUpdate = DOService.getService(curBO.getName()
          + ".update");
      log.info("Find the update Service::" + sUpdate.getName());
      DOParameterService paraUpdate = DOParameterService
          .getDOParaService(propPara.getObjUid(), sUpdate.getObjUid());
      if (paraUpdate != null) {
        paraUpdate.setDop(keyPara);
        DAOUtil.INSTANCE().store(paraUpdate);
      }
     
   
      //////////////////////////////////////////end Business
     
     
     
     
      DOPaneModel pmParentInsert = DOPaneModel.getPaneModelByName("pane_"+ parentBO.getName()+".list.insert");
      DOPaneModel pmChildList = DOPaneModel.getPaneModelByName("pane_"+ curBO.getName()+".list");
     
      pmChildList.setTargetPane(pmChildList);
      DAOUtil.INSTANCE().store(pmChildList);
     
      DOController ccSplitePane = DOController.getControllerByName(LayOutSplitPane.class.getName());
      DOPaneModel pm = new DOPaneModel();
      pm.setName(curBO.getName()+"And"+parentBO.getName()+"LinkPane");
      pm.setL10n(curBO.getName()+"And"+parentBO.getName()+"LinkPane");
      pm.setController(ccSplitePane);
      pm.setLinkType(Integer.valueOf(DOPaneModel.LAYOUT_VERTICAL));
      pm.setCategory(pmParentInsert.getCategory());
     
      DAOUtil.INSTANCE().store(pm);
      //pane_test.dept.list.insert
      DOGridModel childListGrid  = DOGridModel.getGridModelByName("grid_" + curBO.getName()+".list");
      log.info("get the chidlListGrid" + childListGrid.getName());
      childListGrid.setService(aService);
      childListGrid.setIsCheckBox(Integer.valueOf(1));
      DAOUtil.INSTANCE().store(childListGrid);
     
      //pane_test.dept.list.insert

      DOServiceRedirect sr = DOServiceRedirect.getServiceRedirect(sInsert.getObjUid());
      sr.setPaneModel(pmChildList);
      DAOUtil.INSTANCE().store(sr);

     
      DOPaneLinks dpl1 = new DOPaneLinks();
      dpl1.setParentPane(pm);
      dpl1.setChildPane(pmParentInsert);
      dpl1.setOrderNum(Integer.valueOf(5));
      DAOUtil.INSTANCE().store(dpl1);
     
      DOPaneLinks dpl2 = new DOPaneLinks();
      dpl2.setParentPane(pm);
      dpl2.setChildPane(pmChildList);
      dpl2.setOrderNum(Integer.valueOf(10));
      DAOUtil.INSTANCE().store(dpl2);
     
     
      DOService parentInsert =  DOService.getService(parentBO.getName()
          + ".insert");
     
      DOService parentUpdate =  DOService.getService(parentBO.getName()
          + ".update");

      DOPaneModel pmParentUpdate = DOPaneModel.getPaneModelByName("pane_"+ parentBO.getName()+".browse.update");
     
      pmParentUpdate.setTargetPane(pmParentInsert);
      DAOUtil.INSTANCE().store(pmParentUpdate);
     
      DOServiceRedirect srParent = DOServiceRedirect.getServiceRedirect(parentInsert.getObjUid());
      srParent.setPaneModel(pmParentUpdate);
      DAOUtil.INSTANCE().store(srParent);
     
     
      DOServiceRedirect srParentU = DOServiceRedirect.getServiceRedirect(parentUpdate.getObjUid());
      srParentU.setPaneModel(pmParentUpdate);
      DAOUtil.INSTANCE().store(srParentU);
     
     
      DOGridModel parentUpdateGrid  = DOGridModel.getGridModelByName("grid_" + parentBO.getName()+".browse.update");
     
     
      DOController formSaveButton = DOController.getControllerByName(TService.class.getName());
      DOPaneModel pmChildInsert = DOPaneModel.getPaneModelByName("pane_"+ curBO.getName()+".list.insert");

View Full Code Here

  @Override
  public String excute() throws ExedoException {

    StringBuilder sb = new StringBuilder("<export>");
    DOBO bo = DOBO.getDOBOByName("DO_UI_Controller");

    BOInstance biController = bo.getCorrInstance();
    if (biController != null) {
      DOService pm = DOService.getService(biController.getUid());
      sb.append("\n<controller><li>").append(StringUtil.filter(biController.toJSONString())).append(
          "</li></controller>");
    }
View Full Code Here

  @Override
  public String excute() throws ExedoException {

 
    DOBO bo = DOBO.getDOBOByName("DO_UI_PaneModel");
    BOInstance bi = bo.getCorrInstance();
    if(bi!=null){
      DOPaneModel pm = DOPaneModel.getPaneModelByID(bi.getUid());
      this.setEchoValue(pm.getHtmlCode());
    }
    return DEFAULT_FORWARD;
View Full Code Here

  private static final long serialVersionUID = 4555077593344493040L;

  @Override
  public String excute() throws ExedoException {
   
    DOBO bo = DOBO.getDOBOByName("do_bo");
    BOInstance instance = bo.getCorrInstance();
    if(instance==null){
      this.setEchoValue(I18n.instance().get("没有数据!"));
      return NO_FORWARD;
    }
   
    String colName =  this.actionForm.getValue("col_name");
    String type = this.actionForm.getValue("dbtype");
    String dbsize = this.actionForm.getValue("dbsize");
    String l10n = this.actionForm.getValue("l10n");
   
    if(colName==null || type ==null || dbsize==null){
      this.setEchoValue(I18n.instance().get("字段名称或者类型或者长度没有定义!"));
      return NO_FORWARD;
    }

   
    DOBO thisBO = DOBO.getDOBOByID(instance.getUid());
   
    PropertyManager pm = new PropertyManager();
    pm.addProperty(thisBO, colName,l10n,Integer.parseInt( type ),Integer.parseInt(dbsize));

    return DEFAULT_FORWARD;
View Full Code Here

      this.setEchoValue(I18n.instance().get("未配置SQL 语句"));
      return NO_FORWARD;
    }

    StringBuilder sb = new StringBuilder("<export>");
    DOBO bo = DOBO.getDOBOByName("do_bo");
    DOBO boGrid = DOBO.getDOBOByName("DO_UI_GridModel");
    BOInstance selectBI = bo.getCorrInstance();

    sb.append("<bo>").append(selectBI.toJSONString()).append("</bo>\n");

    Transaction t = this.service.currentTransaction();
    List<String> allIDs = new ArrayList<String>();
    try {
      t.begin();

      // /属性
      DOService servProperties = DOService
          .getService("DO_BO_Property_findbybouid");
      appendJSONS(sb, "property", servProperties);
      // /参数
      DOService servParameters = DOService
          .getService("DO_Parameter_findbybouid");
      appendJSONS(sb, "parameter", servParameters);
      // 规则
      DOService servRules = DOService.getService("DO_Rule_findbybouid");
      appendJSONS(sb, "rule", servRules);

      // 业务对象下面的服务
      DOService servServices = DOService
          .getService("DO_Service_Browse_findbybouid");
      List services = appendJSONS(sb, "service", servServices);

      // 服务下面的参数
      DOService servParaService = DOService
          .getService("DO_Parameter_Service_findbyserviceUid");
      sb.append("\n<parameter_service>");
      for (Iterator it = services.iterator(); it.hasNext();) {
        BOInstance bi = (BOInstance) it.next();
        List paraServices = servParaService.invokeSelect(bi.getUid());
        appendLi(sb, paraServices);
      }
      sb.append("</parameter_service>");

      // 服务下面的规则
      DOService servRuleService = DOService
          .getService("DO_Service_Rule_findbyserviceuid");
      sb.append("\n<rule_service>");
      for (Iterator it = services.iterator(); it.hasNext();) {
        BOInstance bi = (BOInstance) it.next();
        List ruleServices = servRuleService.invokeSelect(bi.getUid());
        appendLi(sb, ruleServices);
      }
      sb.append("</rule_service>");

      // 业务对象下面的面板
      DOService servPanes = DOService
          .getService("DO_UI_PaneModel_selectbyboduid");
      List panes = appendJSONS(sb, "pane", servPanes);

      DOService servPaneLinks = DOService
          .getService("DO_UI_PaneLinks_findbyparentPaneUid");
      sb.append("\n<pane_links>");
      List<BOInstance> listGridOfPane = new ArrayList();
      for (Iterator it = panes.iterator(); it.hasNext();) {
        BOInstance aPane = (BOInstance) it.next();
        if (aPane!=null && aPane.getValue("linkType")!=null && aPane.getValue("linkType").equals(
            DOPaneModel.LINKTYPE_GRIDMODEL)) {
          BOInstance aGrid = boGrid.getInstance(aPane
              .getValue("linkUID"));
          if (aGrid != null) {
            listGridOfPane.add(aGrid);
          }
        }
View Full Code Here

  @Override
  public String excute() throws ExedoException {

    StringBuilder sb = new StringBuilder("<export>");

    DOBO bo = DOBO.getDOBOByName("DO_UI_PaneModel");
    DOBO boGrid = DOBO.getDOBOByName("DO_UI_GridModel");
    BOInstance biPane = bo.getCorrInstance();
    if (biPane != null) {
      DOPaneModel pm = DOPaneModel.getPaneModelByID(biPane.getUid());
      // 面板
      sb.append("<pane><li>").append(StringUtil.filter(biPane.toJSONString())).append("</li></pane>");

      DOService servPaneLinks = DOService
          .getService("DO_UI_PaneLinks_findbyparentPaneUid");
      sb.append("\n<pane_links>");
      List list = servPaneLinks.invokeSelect(biPane.getUid());
      appendLi(sb, list);
      sb.append("</pane_links>");

      // /面板下面的表格
      DOGridModel gm = pm.getGridModel();
      if (gm != null) {
        BOInstance biGrid = boGrid.getInstance(gm.getObjUid());
        sb.append("<grid>").append(biGrid.toJSONString()).append(
            "</grid>");

        // /表格下面的表格元素
        DOService servForms = DOService
View Full Code Here

  public String excute() {
   
    //DOService DO_BusiPackage_deletebyapplicationuid = DOService.getService("DO_BusiPackage_deletebyapplicationuid");
   
    DOBO bo = DOBO.getDOBOByName("DO_Application");
    BOInstance<?> biApp = bo.getCorrInstance();
   
    DOService deleteApp = DOService.getService("DO_Application_Delete");
    DOService deletePackages = DOService.getService("DO_BusiPackage_deletebyapplicationuid");
    DOService findBOByPackage = DOService.getService("DO_BO_FindByBPUid");
   
View Full Code Here

      this.setEchoValue(I18n.instance().get("未配置SQL 语句"));
      return NO_FORWARD;
    }

    StringBuilder sb = new StringBuilder("<export>");
    DOBO bo = DOBO.getDOBOByName("do_bo");

    BOInstance selectBI = bo.getCorrInstance();
    Transaction t = this.service.currentTransaction();
    List<String> allIDs = new ArrayList<String>();
    try {
      t.begin();
View Full Code Here

TOP

Related Classes of com.exedosoft.plat.bo.DOBO

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.