Package com.sogou.qadev.service.login.bean

Examples of com.sogou.qadev.service.login.bean.Key


   * @throws Exception
   */
  @ResponseBody
  @RequestMapping("/getTemplatesByTemplateType.do")
  public String getTemplatesByTemplateType(@RequestParam("templateType") String templateType, HttpSession httpSession) throws Exception {
    Key key   = ((Key)httpSession.getAttribute("key"));
    Long keyId = (Long)httpSession.getAttribute("kid");
    das = DataAccessFactory.getInstance().createDataAccessSession(key.getUsername(), keyId);
   
    Template[] templates = DataManager.getInstance().queryUserTemplates(DataAccessFactory.getInstance().createUUID(templateType), das);
    JSONArray json = JSONArray.fromObject(templates);
    return json.toString();
  }
View Full Code Here


   */
  @RequestMapping("/getFilterXml.do")
  @ResponseBody
  public String getFilterXml(HttpServletRequest request, HttpServletResponse response ,HttpSession session) throws Exception {
   
    Key key = (Key)session.getAttribute("key");
    String filterId = request.getParameter("filterId");
    Filter filter = das.queryFilter(DataAccessFactory.getInstance().createUUID(filterId));
    if (filter == null) {
      return "";
    }
    else {
      if(filter.getCreateUser().equals("admin@sohu-rd.com"))
         {
           Document filterDoc = XMLUtil.string2Document(filter.getXml(), "UTF-8");

           Node envNode = XMLUtil.getSingleNode(filterDoc, "query/env");

           XMLUtil.getSingleNode(envNode, "current_user").setTextContent(key.getUsername());

           UserInfo userInfo = das.queryUserInfoByUserName(key.getUsername());
           if (userInfo != null) {
             Node userListNode = filterDoc.createElement("user_list");
             userListNode.setTextContent(userInfo.getUserName());
             envNode.appendChild(userListNode);
        }
View Full Code Here

  @RequestMapping("/initUserTemplateRight.do")
  public String initUserTemplateRight(HttpServletRequest request,HttpSession httpSession) throws Exception {
    String userMail = request.getParameter("userMail");
   
    if (userMail == null || userMail.length() == 0) {
      Key key = (Key)httpSession.getAttribute("key");
      userMail = key.getUsername();
    }
    Map<String, String> temMap = new HashMap<String, String>();
   
    temMap = das.queryUserTemplateRights(userMail);
   
View Full Code Here

   */
  @ResponseBody
  @RequestMapping("/initUserFlowRight.do")
  public String initUserFlowRight(HttpServletRequest request,HttpSession httpSession) throws Exception {
   
    Key key = (Key)httpSession.getAttribute("key");
    String userMail = key.getUsername();
   
    Map<String, String> temMap = das.queryUserTemplateRights(userMail);
    Set<String> flowSet = new HashSet<String>();
    for (String templateId : temMap.keySet()) {
      Template template = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateId));
      if (template != null) {
        flowSet.add(template.getFlowId().getValue());
      }
    }
   
    //自己创建的表单具有编辑权限
    for (Flow flow : das.queryAllFlows()) {
      if (flow != null && flow.getCreateUser() != null && flow.getCreateUser().equals(key.getUsername())) {
        flowSet.add(flow.getId().getValue());
      }
    }
    return JSONArray.toJSONString(flowSet);
  }
View Full Code Here

        nextFilter.doFilter(request, response);
        return;
      }
    }

    Key key = (Key) session.getAttribute("key");
    long k = -1;

    if (session.getAttribute("kid") != null)
      k = (Long) session.getAttribute("kid");
   
View Full Code Here

TOP

Related Classes of com.sogou.qadev.service.login.bean.Key

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.