Package easyJ.system.data

Examples of easyJ.system.data.SysUserCache


    }

    public String creatingSolution(Problemsolution problemsolution,
            HttpServletRequest request) throws EasyJException {

        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        String name[] = request.getParameterValues("choose_reason");
        String solutionContent = request.getParameter("solutionContent");
        Problem problem = new Problem();
        Problemsolution ps = new Problemsolution();
        ProblemreasonSolution psr = new ProblemreasonSolution();
View Full Code Here


        return buffer;
    }

    public String modifyProblem(Problem problem, DataProxy dp,
            HttpServletRequest request) throws EasyJException {
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();

        this.dp = dp;
        String name[] = request.getParameterValues("overdue_ambiguity");
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        // 将所有的Ambiguity的ProblemChange设置为Y,将所有的AmbiguityEvaluationType中的设置use_state设置为N
View Full Code Here

    }

    public String newProblem(Problem problem, DataProxy dp,
            HttpServletRequest request) throws EasyJException {
        String problemContent = request.getParameter("problemContent");
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Problem newProblem = new Problem();

        Long userId = userCache.getUser().getUserId();
        problem.setCreatorId(userId);
        Short a;
        a = 0;
        problem.setProblemAward(a);
        problem.setStatusId(0);
View Full Code Here

        this.returnPath = "/WEB-INF/template/AjaxNewWindowMessage.jsp";

    }

    public void getMessageTemplate() throws EasyJException, IOException {
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        StringBuffer buffer = new StringBuffer();
        buffer
                .append("<meta http-equiv=\"Expires\" content=\"0\"><meta http-equiv=\"Pragma\" content=\"no-cache\"><meta http-equiv=\"Cache-Control\" content=\"no-cache\">");
        buffer
                .append("<link href=\"/css/iknow1_1.css\" rel=\"stylesheet\" type=\"text/css\">");
View Full Code Here

        }

        content = content
                + "<TD class=tdline28 width=\"1%\">&nbsp;</TD><TD class=tdline28><B>消息</B></TD><TD class=tdline28 width=\"15%\"><B>发送时间</B></TD></TR>";
        // 生成消息标题行
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        SysUser user = userCache.getUser();
        Message message = new Message();
        ArrayList messageList = new ArrayList();
        // 查询好友发送的信息
        if (choose.equals("1")) {
            Object o = BeanUtil
View Full Code Here

        Session session = SessionFactory.openSession();
        ArrayList userId = session.query(scmd);
        if (userId.size() > 0) {
            SysUser sys = (SysUser) userId.get(0);
            message.setMessageReceiver(sys.getUserId());
            SysUserCache syscuercache = (SysUserCache) request.getSession()
                    .getAttribute(Globals.SYS_USER_CACHE);
            SysUser sysuser = syscuercache.getUser();
            message.setCreatorId(sysuser.getUserId());
            message.setIsRead("N");
            try {
                dp.create(message);
                returnMessage = "sucess";
View Full Code Here

            /* 当rootId不为空的时候,只显示rootId的子树内容,用在SingleDataEdit.jsp中选择数据时用 */
            String rootId = request.getParameter("rootId");
            int selectModeInt = Const.TREE_SELECT_SPREAD;
            TreeService ts = TreeServiceFactory.getTreeService();
            /* 得到用户拥有权限的数据,如果这些数据不为空则用这些数据构造树结构,否则用整个className对应的表来构造树结构 */
            SysUserCache userCache = (SysUserCache) request.getSession()
                    .getAttribute(Globals.SYS_USER_CACHE);
            ArrayList list = (ArrayList) userCache.getCacheData(className);
            list = filterTreeList(list);
           
            DataContextFilter filter= DataContextFilter.getInstance();
            filter.setContext(userCache.getContext());
            list=filter.filter(list);
           
            Tree tree = ts.getTree(className, list);
            StringBuffer buffer = new StringBuffer();
            if (!GenericValidator.isBlankOrNull(selectMode))
View Full Code Here

    cookie.setPath("/");
    cookie.setMaxAge(60 * 60 * 24 * 365);
    response.addCookie(cookie);

    // 得到用户拥有权限数据的缓存,并放入session当中。
    userCache = new SysUserCache(user);
    userCache.setAjax(request.getParameter("ajax"));
    request.getSession().setAttribute(Globals.SYS_USER_CACHE, userCache);

    // 用户登陆进来之后进入个人主页。
    // returnPath = "/WEB-INF/AjaxMain.jsp";
View Full Code Here

  public void register() throws EasyJException {
    SysUser user = new SysUser();
    user.setUserId(new Long(-1));
    user = (SysUser) dp.get(user);
    userCache = new SysUserCache(user);
    userCache.setAjax(request.getParameter("ajax"));
    request.getSession().setAttribute(Globals.SYS_USER_CACHE, userCache);
    returnPath = "/WEB-INF/AjaxRegister.jsp";
    return;
  }
View Full Code Here

public class ProjectAction extends SingleDataAction {
    public void view() throws EasyJException {
        Project project = (Project) object;
        project = (Project) dp.get(project);
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Context context = new Context();
        context.setProjectId(project.getProjectId());
        context.setProjectName(project.getProjectName());
        // 下面的程序用来确定此用户在此project中的角色

        // 1.首先确定是不是owner。
        if (project.getCreatorId().longValue() == user.getUserId().longValue()) {
            context.setProjectRole(DictionaryConstant.OWNER);
        } else {
            // 2.判断用户是否是参与了当前项目
            UserProjectRelation relation = new UserProjectRelation();
            relation.setUserId(user.getUserId());
            relation.setProjectId(project.getProjectId());
            ArrayList relationList = dp.query(relation);
            // 如果不存在数据,说明没有加入;否则根据状态来确定。
            if (relationList.size() == 0) {
                context.setProjectRole(DictionaryConstant.OTHER);
            } else {
                relation = (UserProjectRelation) relationList.get(0);
                int applyState = relation.getUserProjectStateRelatedValue()
                        .intValue();
                // 此状态请参见表dictionary中的PROJECT_APPLY_STATE 对应的related value部分。
                switch (applyState) {
                    case 2:
                        context.setProjectRole(DictionaryConstant.GROUP);
                        break;
                    default:
                        context.setProjectRole(DictionaryConstant.OTHER);
                        break;
                }
            }
        }

        userCache.setContext(context);

        HashMap<String,String> roles = context.getRoles();
        roles.clear();
       
        //将此项目所拥有的角色加入环境当中
View Full Code Here

TOP

Related Classes of easyJ.system.data.SysUserCache

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.