Examples of UserPropertyRight


Examples of easyJ.system.data.UserPropertyRight

        .getAttribute(Globals.SYS_USER_CACHE);
    String className = request.getParameter(Globals.CLASS_NAME);
    ArrayList displayProperties = userCache.getDisplayProperties(className);
    StringBuffer properties = new StringBuffer();
    for (int i = 0; i < displayProperties.size(); i++) {
      UserPropertyRight property = (UserPropertyRight) displayProperties
          .get(i);
      properties.append(property.getPropertyName());
      if (i != displayProperties.size() - 1)
        properties.append(",");
    }
    buffer
        .append("<input type=\"hidden\" id = \"properties\" name = \"properties\" "
View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

                continue;
            }
            Class type = field.getType();
            String fieldName = field.getName();
            /* 这里得到property是为了得到property的type信息,如果此property的type是checkboxs,那么就需要对客户端传过来的信息进行处理 */
            UserPropertyRight property = (UserPropertyRight) SystemDataCache
                    .getPropertyHT(false).get(obj.getClass().getName() + fieldName);
            Object value = null;
            boolean detailCheckBox = false;
            if (!GenericValidator.isBlankOrNull(prefix)) {
                value = properties.get(prefix + fieldName);
            } else {
                value = properties.get(fieldName);
                //当明细当中有checkbox的时候,而且checkbox可能数目不一致,就一定需要知道是第几行的。
                if ("columns".equals(fieldName)) {
                    System.out.println("columns".equals(fieldName));
                }
                if (value == null) {
                    value = properties.get(fieldName + position);
                    if (value != null) {
                        detailCheckBox = true;
                    }
                }
            }
            //明细中含有checkbox的时候的做法,todo:这里将来如何处理要分情况,一种是现在这种直接填值的,另外一种是和下面的checkbox类似的。
            if (detailCheckBox) {
                String propertyValue = ",";
                String[] valueArr = (String[]) value;
                for (String v : valueArr) {
                    propertyValue += (v + ",");
                }
                BeanUtil.setFieldValue(obj, fieldName, propertyValue);
                continue;
            }

           
            /*
             * value==null的时候不应该直接continue,因为如果是checkbox的话,取消之后虽然没有数据传过来,但是那是意味着取消操作
             * property==null意味着用户没有权限看到,所以就不做任何处理。如果prefix存在说明是查询,则不做处理。
             */
           
            if (value == null) {
                if (property == null || !"checkboxs".equals(property.getType())
                        || !GenericValidator.isBlankOrNull(prefix))
                    continue;
                else {
                    BeanUtil.setFieldValue(obj, fieldName, null);
                    BeanUtil.setFieldValue(obj, property.getShowProperty(),
                            null);
                }
            }
            /* property中的数据除了FormFile之外,都是String[]。 */
            if (value instanceof String[]) {
                String[] valueArray = (String[]) value;
                /*
                 * 如果是checkboxs类型的,则需要将用户客户端传过来的数据进行处理。在此情况下,客户端传过来的数据格式是
                 * id,name,需要取出id,和name并分别付给ids和names属性
                 */
                if (property != null && "checkboxs".equals(property.getType())) {
                    String ids = ",", names = "";
                    for (int j = 0; j < valueArray.length; j++) {
                        StringTokenizer st = new StringTokenizer(valueArray[j],
                                ",");
                        ids = ids + st.nextToken() + ",";
                        if (j != valueArray.length - 1)
                            names = names + st.nextToken() + "、";
                        else
                            names = names + st.nextToken();
                    }
                    BeanUtil.setFieldValue(obj, fieldName, ids);
                    BeanUtil.setFieldValue(obj, property.getShowProperty(),
                            names);
                } else {
                    /*
                     * 有些情况比如子表的外键,也就是主表的主键是不在字表明细当中列出的,而且也是不可能被改变的,所以传过来的就只能有一个值,
                     * 在这种情况下valueArray.length<=position,就不应该执行
 
View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

        }
    }

    // 用来显示调整字段的界面
    public void adjustProperty() throws EasyJException {
        UserPropertyRight userPropertyRight = new UserPropertyRight();
        userPropertyRight.setUserId(userId);
        userPropertyRight.setClassName(className);
        Property property = new Property();
        BeanUtil.transferObject(userPropertyRight, property, true, false);
        // 用来指示当前显示的是查询的字段,还是显示的字段,还是编辑的字段。
        String propertyType = request.getParameter("propertyType");
        if (GenericValidator.isBlankOrNull(propertyType))
View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

        buffer
                .append("<td align=\"center\" class=\"trTitle\" width=\"5%\"><input type=\"checkbox\" name=\"checkAll\" onclick=\"Data.checkAll()\"/>\n");
        buffer.append("</td>\n");
        /* 下面输入用来浏览的数据字段 */
        for (int i = 0; i < propertySize; i++) {
            UserPropertyRight property = (UserPropertyRight) displayProperties
                    .get(i);
            propertyBuffer.append(property.getPropertyName());
            if (i != propertySize - 1) {
                propertyBuffer.append(",");
            }
            buffer.append("<td nowrap class=\"trTitle\" align=\"center\">\n");
            buffer
                    .append("<a style=\"text-decoration:none\" href=\"javascript:Data.orderBy('"
                            + property.getPropertyName()
                            + "')\">"
                            + property.getPropertyChiName() + "</a>\n");
            buffer.append("</td>\n");
        }
        buffer.append("</tr>\n");
        buffer.append("<input type=\"hidden\"  name=\"properties\" value=\""
                + propertyBuffer.toString() + "\"/>");
        if (request.getAttribute(Globals.PAGE) != null) {
            Page page = (Page) request.getAttribute(Globals.PAGE);
            ArrayList dataList = page.getPageData();
            int dataSize = dataList.size();
            for (int i = 0; i < dataSize; i++) {
                Object object = dataList.get(i);
                String primaryKey = (String) BeanUtil.getPubStaticFieldValue(
                        object.getClass(), Const.PRIMARY_KEY);
                Object primaryKeyValue = BeanUtil.getFieldValue(object,
                        primaryKey);
                buffer.append("<tr id=\"tr" + primaryKeyValue + "\">\n");
                buffer
                        .append("<td class=\"trContent\"  align=\"center\" width=\"5%\"><input type=\"checkbox\" name=\"check\" value=\""
                                + primaryKeyValue + "\"/> </td>\n");
                for (int j = 0; j < propertySize; j++) {
                    UserPropertyRight property = (UserPropertyRight) displayProperties
                            .get(j);
                    buffer
                            .append("<td class=\"trContent\"abbr=\"asdf\" align=\"center\" onclick=\"Discuss.expandContent('"
                                    + primaryKey
                                    + "'"
                                    + ",'"
                                    + primaryKeyValue
                                    + "','"
                                    + queryByTopic
                                    + "','"
                                    + primaryKeyValue + "')\" nowrap>\n");
                    String propertyName = property.getPropertyName();
                    if (GenericValidator.isBlankOrNull(property
                            .getShowProperty())) {
                        buffer.append(Format.formatDisplay(BeanUtil
                                .getFieldValue(object, propertyName)));
                        /* 下面在属性propertyName要加上Value是从数据字典中取出数据时显示用的。在创建试图的时候的规定 */
                    } else {
                        buffer.append(Format.formatDisplay(BeanUtil
                                .getFieldValue(object, property
                                        .getShowProperty())));
                    }
                    buffer.append("</td>\n");
                }
                buffer.append("</tr>\n");
View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

        buffer
                .append("<th align=\"center\" class=\"trTitle\" width=\"5%\"><input type=\"checkbox\" name=\"checkAll\" onclick=\"Data.checkAll()\"/>\n");
        buffer.append("</th>\n");
        /* 下面输入用来浏览的数据字段 */
        for (int i = 0; i < propertySize; i++) {
            UserPropertyRight property = (UserPropertyRight) displayProperties
                    .get(i);
            buffer.append("<th class=\"order\" onclick=\"Data.orderBy('"
                    + property.getPropertyName() + "', "+editable+")\">"
                    + property.getPropertyChiName() + "</a>\n");
            buffer.append("</th>\n");
        }

        // 判断是否需要显示操作栏

View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

        int size = queryProperties.size();
        /* sizePerLin指每一行有多少个字段 */
        int sizePerLine = Integer.parseInt(columnsPerLine);
        int j = 0;
        for (int i = 0; i < size; i++) {
            UserPropertyRight property = (UserPropertyRight) queryProperties
                    .get(i);
            if (j % sizePerLine == 0) {
                buffer.append("<tr>\n");
            }
            String propertyName = property.getPropertyName();
            if ("Y".equals(property.getScopeQuery())) {
                /* 如果范围查询 */
                buffer.append("<td nowrap>" + property.getPropertyChiName()
                        + "</td>\n");
                buffer.append("<td>\n");
                buffer.append("<input type=\"text\" name=\"lower"
                        + property.getPropertyName()
                        + "\" value=\""
                        + Format.format(BeanUtil.getFieldValue(lower,
                                propertyName)) + "\"/>--\n");
                buffer.append("<input type=\"text\" name=\"upper"
                        + property.getPropertyName()
                        + "\" value=\""
                        + Format.format(BeanUtil.getFieldValue(upper,
                                propertyName)) + "\"/>\n");
                buffer.append("</td>\n");
            } else {
                /* 如果不是hidden字段 */
                if (GenericValidator.isBlankOrNull(property.getHidden())) {
                    buffer.append("<td>" + property.getPropertyChiName()
                            + "</td>\n");
                }
                propertyName = property.getPropertyName();
                buffer.append("<td>\n");
                /* 如果不是范围查询 */
                if (GenericValidator.isBlankOrNull(property
                        .getPropertyValueTable())) {
                    /* 如果不是从数据字典表或者其他表中选取,则显示输入框 */
                    if (GenericValidator.isBlankOrNull(property.getHidden())) {
                        buffer.append("<input type=\"text\" name=\""
                                + property.getPropertyName()
                                + "\" value=\""
                                + Format.format(BeanUtil.getFieldValue(lower,
                                        propertyName)) + "\"/>\n");
                    } else {
                        buffer.append("<input type=\"hidden\" name=\""
                                + property.getPropertyName()
                                + "\" value=\""
                                + Format.format(BeanUtil.getFieldValue(lower,
                                        propertyName)) + "\"/>\n");

                    }
                } else {
                    /* 如果是从数据字典表或者其他表中选取,则显示下拉列表或者弹出框 */
                    String propertyValueTable = property
                            .getPropertyValueTable();
                    if (property.getFromDictionary() != null) {
                        if (property.getFromDictionary().booleanValue()) {
                            StringBuffer selectBuffer = DictionaryProxy
                                    .getHtmlSelect(propertyName,
                                            propertyValueTable, BeanUtil
                                                    .getFieldValue(lower,
                                                            propertyName),
                                            BeanUtil.getFieldValue(lower,
                                                    property.getShowProperty()));
                            buffer.append(selectBuffer);
                        } else {
                            if ("select".equalsIgnoreCase(property
                                    .getShowType())) {
                                StringBuffer selectBuffer = HtmlClientComponentService
                                        .getSelect(propertyValueTable, BeanUtil
                                                .getFieldValue(lower,
                                                        propertyName));
                                buffer.append(selectBuffer);
                            } else {
                                buffer.append("<input type=\"text\" name=\""
                                        + property.getShowProperty()
                                        + "\" value=\""
                                        + Format.format(BeanUtil.getFieldValue(
                                                lower, property
                                                        .getShowProperty()))
                                        + "\"/>");
                            }
                        }
                    }
View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

            ArrayList editProperties = userCache.getEditProperties(classType);
           
            //得到用来显示的字段。
            ArrayList showProperties = new ArrayList();
            for (Object object : editProperties) {
                UserPropertyRight property = (UserPropertyRight)object;
                if (columns != null &&
                        columns.indexOf(","+property.getPropertyName()+",") >= 0) {
                    showProperties.add(property);
                }
            }
            //如果用户没有设置,则默认显示所有字段
            if (showProperties.size() == 0)
View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

        .getAttribute(Globals.SYS_USER_CACHE);
        String className = request.getParameter(Globals.CLASS_NAME);
    ArrayList displayProperties = userCache.getDisplayProperties(className);
    StringBuffer properties = new StringBuffer();
    for (int i = 0; i< displayProperties.size(); i++) {
      UserPropertyRight property = (UserPropertyRight)displayProperties.
                      get(i);
      properties.append(property.getPropertyName());
      if (i != displayProperties.size()-1)
        properties.append(",");
    }
    buffer.append("<input type=\"hidden\" id = \"properties\" name = \"properties\" "
        + " value = \"" + properties + "\"");
View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

        }
    }

    // 用来显示调整字段的界面
    public void adjustProperty() throws EasyJException {
        UserPropertyRight userPropertyRight = new UserPropertyRight();
        userPropertyRight.setUserId(userId);
        userPropertyRight.setClassName(className);
        Property property = new Property();
        BeanUtil.transferObject(userPropertyRight, property, true, false);
        // 用来指示当前显示的是查询的字段,还是显示的字段,还是编辑的字段。
        String propertyType = request.getParameter("propertyType");
        if (GenericValidator.isBlankOrNull(propertyType))
View Full Code Here

Examples of easyJ.system.data.UserPropertyRight

                continue;
            }
            Class type = field.getType();
            String fieldName = field.getName();
            /* 这里得到property是为了得到property的type信息,如果此property的type是checkboxs,那么就需要对客户端传过来的信息进行处理 */
            UserPropertyRight property = (UserPropertyRight) SystemDataCache
                    .getPropertyHT(false).get(obj.getClass().getName() + fieldName);
            Object value = null;
            boolean detailCheckBox = false;
            if (!GenericValidator.isBlankOrNull(prefix)) {
                value = properties.get(prefix + fieldName);
            } else {
                value = properties.get(fieldName);
                //当明细当中有checkbox的时候,而且checkbox可能数目不一致,就一定需要知道是第几行的。
                if ("columns".equals(fieldName)) {
                    System.out.println("columns".equals(fieldName));
                }
                if (value == null) {
                    value = properties.get(fieldName + position);
                    if (value != null) {
                        detailCheckBox = true;
                    }
                }
            }
            //明细中含有checkbox的时候的做法,todo:这里将来如何处理要分情况,一种是现在这种直接填值的,另外一种是和下面的checkbox类似的。
            if (detailCheckBox) {
                String propertyValue = ",";
                String[] valueArr = (String[]) value;
                for (String v : valueArr) {
                    propertyValue += (v + ",");
                }
                BeanUtil.setFieldValue(obj, fieldName, propertyValue);
                continue;
            }

           
            /*
             * value==null的时候不应该直接continue,因为如果是checkbox的话,取消之后虽然没有数据传过来,但是那是意味着取消操作
             * property==null意味着用户没有权限看到,所以就不做任何处理。如果prefix存在说明是查询,则不做处理。
             */
           
            if (value == null) {
                if (property == null || !"checkboxs".equals(property.getType())
                        || !GenericValidator.isBlankOrNull(prefix))
                    continue;
                else {
                    BeanUtil.setFieldValue(obj, fieldName, null);
                    BeanUtil.setFieldValue(obj, property.getShowProperty(),
                            null);
                }
            }
            /* property中的数据除了FormFile之外,都是String[]。 */
            if (value instanceof String[]) {
                String[] valueArray = (String[]) value;
                /*
                 * 如果是checkboxs类型的,则需要将用户客户端传过来的数据进行处理。在此情况下,客户端传过来的数据格式是
                 * id,name,需要取出id,和name并分别付给ids和names属性
                 */
                if (property != null && "checkboxs".equals(property.getType())) {
                    String ids = ",", names = "";
                    for (int j = 0; j < valueArray.length; j++) {
                        StringTokenizer st = new StringTokenizer(valueArray[j],
                                ",");
                        ids = ids + st.nextToken() + ",";
                        if (j != valueArray.length - 1)
                            names = names + st.nextToken() + "、";
                        else
                            names = names + st.nextToken();
                    }
                    BeanUtil.setFieldValue(obj, fieldName, ids);
                    BeanUtil.setFieldValue(obj, property.getShowProperty(),
                            names);
                } else {
                    /*
                     * 有些情况比如子表的外键,也就是主表的主键是不在字表明细当中列出的,而且也是不可能被改变的,所以传过来的就只能有一个值,
                     * 在这种情况下valueArray.length<=position,就不应该执行
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.