Package com.sogou.qadev.service.cynthia.bean

Examples of com.sogou.qadev.service.cynthia.bean.UUID


        if(allRefValus == null){
          continue;
        }
       
        for(String refDataId : allRefValus){
          UUID refId = DataAccessFactory.getInstance().createUUID(refDataId);
          if(refDataMap.containsKey(refId)){
            continue;
          }
         
          whereMap.put("id", refDataId);
View Full Code Here


    this.id = daf.createUUID(XMLUtil.getSingleNodeTextContent(flowNode, "id"));
    this.name = XMLUtil.getSingleNodeTextContent(flowNode, "name");
    List<org.w3c.dom.Node> statNodeList = XMLUtil.getNodes(flowNode, "stats/stat");
    for(org.w3c.dom.Node statNode : statNodeList){
      UUID statId = daf.createUUID(XMLUtil.getSingleNodeTextContent(statNode, "id"));
      String statName = XMLUtil.getSingleNodeTextContent(statNode, "name");

      StatImpl statImpl = new StatImpl(statId, this.id);
      statImpl.setName(statName);

      this.statMap.put(statId, statImpl);
    }

    List<org.w3c.dom.Node> actionNodeList = XMLUtil.getNodes(flowNode, "actions/action");
    for(org.w3c.dom.Node actionNode : actionNodeList){
      UUID actionId = daf.createUUID(XMLUtil.getSingleNodeTextContent(actionNode, "id"));
      String actionName = XMLUtil.getSingleNodeTextContent(actionNode, "name");
      UUID beginStatId = daf.createUUID(XMLUtil.getSingleNodeTextContent(actionNode, "startStatId"));
      UUID endStatId = daf.createUUID(XMLUtil.getSingleNodeTextContent(actionNode, "endStatId"));

      ActionImpl actionImpl = new ActionImpl(actionId, this.id);
      actionImpl.setName(actionName);
      actionImpl.setBeginStatId(beginStatId);
      actionImpl.setEndStatId(endStatId);

      this.actionMap.put(actionId, actionImpl);
    }

    List<org.w3c.dom.Node> roleNodeList = XMLUtil.getNodes(flowNode, "roles/role");
    for(org.w3c.dom.Node roleNode : roleNodeList){
      UUID roleId  = daf.createUUID(XMLUtil.getSingleNodeTextContent(roleNode, "id"));
      String roleName = XMLUtil.getSingleNodeTextContent(roleNode, "name");

      RoleImpl roleImpl = new RoleImpl(roleId, this.id);
      roleImpl.setName(roleName);

      this.roleMap.put(roleId, roleImpl);
    }

    List<org.w3c.dom.Node> actionRoleNodeList = XMLUtil.getNodes(flowNode, "actionRoles/actionRole");
    for(org.w3c.dom.Node actionRoleNode : actionRoleNodeList){
      UUID actionId = daf.createUUID(XMLUtil.getSingleNodeTextContent(actionRoleNode, "actionId"));
      UUID roleId = daf.createUUID(XMLUtil.getSingleNodeTextContent(actionRoleNode, "roleId"));

      this.actionRoleSet.add(new ActionRole(actionId, roleId));
    }

    List<org.w3c.dom.Node> rightNodeList = XMLUtil.getNodes(flowNode, "rights/right");
    for(org.w3c.dom.Node rightNode : rightNodeList){
      String username = XMLUtil.getSingleNodeTextContent(rightNode, "username");
      UUID roleId = daf.createUUID(XMLUtil.getSingleNodeTextContent(rightNode, "roleId"));
     
      UUID templateId = daf.createUUID(XMLUtil.getSingleNodeTextContent(rightNode, "templateId"));
      if (templateId == null) {
        continue;
      }
      this.rightSet.add(new Right(username, templateId, roleId));
    }
View Full Code Here

   * @param endStatId
   * @return
   * @see com.sogou.qadev.service.cynthia.bean.Flow#addAction(com.sogou.qadev.service.cynthia.bean.UUID, com.sogou.qadev.service.cynthia.bean.UUID)
   */
  public Action addAction(UUID beginStatId, UUID endStatId){
    UUID actionId = DataAccessFactory.getInstance().newUUID("ACTI");
    ActionImpl action = new ActionImpl(actionId, this.id);
    action.setBeginStatId(beginStatId);
    action.setEndStatId(endStatId);
    this.actionMap.put(actionId, action);

View Full Code Here

   * <p> Description:TODO</p>
   * @return
   * @see com.sogou.qadev.service.cynthia.bean.Flow#addRole()
   */
  public Role addRole(){
    UUID roleId = DataAccessFactory.getInstance().newUUID("ROLE");
    RoleImpl role = new RoleImpl(roleId, this.id);
    this.roleMap.put(roleId, role);

    return role;
  }
View Full Code Here

   * <p> Description:TODO</p>
   * @return
   * @see com.sogou.qadev.service.cynthia.bean.Flow#addStat()
   */
  public Stat addStat(){
    UUID statId = DataAccessFactory.getInstance().newUUID("STAT");
    StatImpl statImpl = new StatImpl(statId, this.id);
    this.statMap.put(statId, statImpl);

    return statImpl;
  }
View Full Code Here

      rs = stat.executeQuery(sql);

      List<Map<String, String>> colValueMapList = DbPoolConnection.getInstance().getDataMapFromRs(rs);

      if (colValueMapList.size() > 0) {
        UUID templateId = DataAccessFactory.getInstance().createUUID(colValueMapList.get(0).get("templateId"));
        if (templateId == null) {
          return data;
        }

        setTemplateFieldNameCache(templateId);
View Full Code Here

    Map<UUID, Template> allTemplateMap = new HashMap<UUID, Template>();
    Map<UUID, Map<String, String>> templateFieldNameMap = new HashMap<UUID, Map<String,String>>();

    for (Map<String, String> colValueMap : colValueMapList) {
      Data data = new DataImpl();
      UUID dataId = DataAccessFactory.getInstance().createUUID(colValueMap.get("id"));
      UUID templateId = DataAccessFactory.getInstance().createUUID(colValueMap.get("templateId"));

      Map<UUID, Object> objectMapUUID = new HashMap<UUID, Object>();
      Map<String, Object> objectMapName = new HashMap<String, Object>();

      data.setId(dataId);
      data.setTemplateId(templateId);
      data.setTemplateTypeId(DataAccessFactory.getInstance().createUUID(colValueMap.get("templateTypeId")));
      data.setTitle(colValueMap.get("title"));
      data.setDescription(colValueMap.get("description"));
      data.setCreateUser(colValueMap.get("createUser"));
      data.setCreateTime(colValueMap.get("createTime") == null ? null:Timestamp.valueOf(colValueMap.get("createTime")));
      data.setLastModifyTime(colValueMap.get("lastModifyTime") == null ? null : Timestamp.valueOf(colValueMap.get("lastModifyTime")));
      data.setAssignUser(colValueMap.get("assignUser"));
      data.setStatusId(DataAccessFactory.getInstance().createUUID(colValueMap.get("statusId")));

      if (allTemplateMap.get(templateId) == null) {
        Template template = TemplateCache.getInstance().get(templateId);
        if (template != null) {
          allTemplateMap.put(templateId, template);
        }
      }

      Template template = allTemplateMap.get(templateId);

      for (String colName : colValueMap.keySet()) {
        Field validField = null;
        try {
          if (colName.startsWith("field") && colValueMap.get(colName) != null && colValueMap.get(colName).length() > 0) {

            String fieldIdStr = "";

            if (templateFieldNameCache == null ) {
              if (templateFieldNameMap.get(templateId) == null) {
                Map<String, String> fieldNameMap = new FieldNameAccessSessionMySQL().queryTemplateFieldMap(templateId.getValue());
                templateFieldNameMap.put(templateId, fieldNameMap);
              }
              fieldIdStr = templateFieldNameMap.get(templateId).get(colName);
            }else {
              fieldIdStr = templateFieldNameCache.get(colName);
            }

            UUID fieldId = DataAccessFactory.getInstance().createUUID(fieldIdStr);

            validField = template.getField(fieldId);

            if (validField == null) {
//              System.out.println("can not find field in assembleData ,fieldIdStr :" + fieldIdStr );
              continue;
            }
           
            if (validField.getType().equals(Type.t_selection))
            {
              if (validField.getDataType().equals(DataType.dt_single))
              {
                UUID dataValidId = DataAccessFactory.getInstance().createUUID(colValueMap.get(colName));
                objectMapUUID.put(fieldId, dataValidId);
                objectMapName.put(validField.getName(), dataValidId);
              }
              else if (validField.getDataType().equals(DataType.dt_multiple))
              {
                String [] alldatas = colValueMap.get(colName).split(",");
                UUID[] dataValidIds = new UUID[alldatas.length];

                for (int i = 0; i < alldatas.length; i++) {
                  dataValidIds[i] = DataAccessFactory.getInstance().createUUID(alldatas[i]);
                }

                objectMapUUID.put(fieldId, dataValidIds);
                objectMapName.put(validField.getName(), dataValidIds);
              }
            }
            else if (validField.getType().equals(Type.t_reference))
            {
              if (validField.getDataType().equals(DataType.dt_single))
              {
                UUID dataValidId = DataAccessFactory.getInstance().createUUID(colValueMap.get(colName));
                objectMapUUID.put(fieldId, dataValidId);
                objectMapName.put(validField.getName(), dataValidId);
              }
              else if (validField.getDataType().equals(DataType.dt_multiple))
              {
View Full Code Here

    {
      conn = DbPoolConnection.getInstance().getConnection();
      stat = conn.createStatement();

      for (UUID uuid : ids) {
        UUID templateId = DataAccessFactory.getInstance().createUUID(queryTemplateId(uuid));
        tableName = TableRuleManager.getInstance().getDataTableName(templateId);
        sql = "update " + tableName + " set is_valid=0 where id = " + uuid.getValue();
        stat.execute(sql);

        tableName = TableRuleManager.getInstance().getDataLogTableName(templateId);
View Full Code Here

    if(field.getType().equals(Field.Type.t_selection))
    {
      if(field.getDataType().equals(Field.DataType.dt_single))
      {
        UUID optionId = data.getSingleSelection(fieldId);
        if(optionId == null)
          return null;

        Option option = field.getOption(optionId);
        if(option != null)
          return "[" + option.getName() + "]";
      }
      else if(field.getDataType().equals(Field.DataType.dt_multiple))
      {
        UUID[] optionIdArray = data.getMultiSelection(fieldId);
        if(optionIdArray == null || optionIdArray.length == 0)
          return null;

        StringBuffer valueStrb = new StringBuffer();
        for(UUID optionId : optionIdArray)
        {
          Option option = field.getOption(optionId);
          if(option == null)
            continue;

          if(valueStrb.length() > 0)
            valueStrb.append(",");

          valueStrb.append("[").append(option.getName()).append("]");
        }

        return valueStrb.toString();
      }
    }
    else if(field.getType().equals(Field.Type.t_reference))
    {
      if(field.getDataType().equals(Field.DataType.dt_single))
      {
        UUID referenceId = data.getSingleReference(fieldId);
        if(referenceId == null)
          return null;

        String[] referTitleArray = new DataAccessSessionMySQL().queryFieldByIds(new UUID[]{referenceId}, "title", templateId);
        if(referTitleArray != null && referTitleArray.length > 0)
View Full Code Here

  public static String getDataXML(DataAccessSession das,String templateIdStr,String startTime)
  {
    StringBuffer  returnXml = new StringBuffer();
    returnXml.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>");

    UUID templateId = DataAccessFactory.getInstance().createUUID(templateIdStr);
    Template template = das.queryTemplate(templateId);
    Flow flow = das.queryFlow(template.getFlowId());
     
    Stat[] stats = flow.getStats();   //状态
    Set<Field> allFields = template.getFields();
View Full Code Here

TOP

Related Classes of com.sogou.qadev.service.cynthia.bean.UUID

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.