Package easyJ.system.data

Examples of easyJ.system.data.SysUserCache


        buffer
                .append("<div class=\"t1\"><div class=\"ico\"><div class=\"icomment\"></div></div>");
        buffer.append("对于问题的价值现有<span style=\"color:#FF0000\">"
                + problemvalues.size() + "</span>个讨论</div>");
        // 投票面板,先从缓存中得到目前用户的信息,然后查看ProblemvalueTypeValue表,是否已经投过票了,这里更高的效率应该是用主子表查询
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        pvtv.setProblemId(problemvalue.getProblemId());
        // evaluation所有人的关于这个问题可理解行的没有过期的投票结果。
        ArrayList evaluation_num = cdp.query(pvtv);
        pvtv.setCreatorId(userId);
        // 当前登陆者关于这个问题可理解行的没有过期的投票结果。
View Full Code Here


    }

    public String creatingProblemValue(Problemvalue pv,
            HttpServletRequest request, HttpServletResponse response)
            throws EasyJException, IOException {
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();

        SingleDataProxy sdp = SingleDataProxy.getInstance();
        String type0[] = request.getParameterValues("problemavalue_type0");
        String type1[] = request.getParameterValues("problemavalue_type1");
        String type2[] = request.getParameterValues("problemavalue_type2");
View Full Code Here

    }

    public StringBuffer viewAllProblemvalue(Problemvalue problemvalue,
            HttpServletRequest request) throws EasyJException {
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        StringBuffer buffer = new StringBuffer();
        String ifNewWindow = new String();
        if (request.getParameter("ifNewWindow") != null) {
            ifNewWindow = request.getParameter("ifNewWindow");
            if (ifNewWindow.equals("Y")) {
View Full Code Here

public class ProjectAction extends SingleDataAction {
  public void showFeatureModel() throws EasyJException,SQLException{
    System.out.println("Come into ProjectAction#showFeatureModel()");
    Project project = (Project)object;
    // 从context 中取出 project 的id .
    SysUserCache userCache = (SysUserCache) request.getSession()
        .getAttribute(Globals.SYS_USER_CACHE);
    Long id = userCache.getContext().getProjectId();
    project.setProjectId(id);
    project = (Project)dp.get(project);
    Long domainId = project.getDomainId()
 
    returnMessage +=
View Full Code Here

   * @throws EasyJException
   */
    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

    }

    public void queryByOwner() throws EasyJException {
        dp.setContext(null);
        Project project = new Project();
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        project.setCreatorId(userCache.getUser().getUserId());
        ArrayList list = dp.query(project);
        StringBuffer result = HtmlClientComponentService.getObjectListHtml(
                list, this.getClass().getName(), "domainName", "projectName",
                "", 4);
        if (result != null) {
View Full Code Here

        ProblemSolutionInterface {
    public ProblemSolutionImpl() {}

    public StringBuffer getProblemsolution(Problemsolution problemsolution,
            HttpServletRequest request, boolean vote) throws EasyJException {
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();

        // 这个方法输出问题的价值界面
        StringBuffer buffer = new StringBuffer();
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
View Full Code Here

    }

    public StringBuffer problemsolutionUpdate(ProblemsolutionEvaluation pse,
            HttpServletRequest request, HttpServletResponse response)
            throws EasyJException, IOException {
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        pse.setCreatorId(userId);
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        Problemsolution ps = new Problemsolution();
        ps.setProblemsolutionId(pse.getProblemsolutionId());
View Full Code Here

    }

    public String creatingReply(ProblemsolutionReply psr,
            HttpServletRequest request, HttpServletResponse response)
            throws EasyJException, IOException {
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();

        // 这里还缺少一个对主贴和跟贴的回复的区别
        Long referenceId = new Long(request.getParameter("referenceId"));
        if (referenceId.equals(new Long("000"))) {} else if (referenceId
                .equals(new Long("000"))) {
View Full Code Here

    }

    public StringBuffer viewDetailedSolution(Problemsolution problemsolution,
            HttpServletRequest request) throws EasyJException {
        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

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.