Package com.gcrm.domain

Examples of com.gcrm.domain.Role


        StringBuilder jsonBuilder = new StringBuilder("");
        jsonBuilder
                .append(getJsonHeader(totalRecords, searchCondition, isList));

        while (roles.hasNext()) {
            Role instance = roles.next();
            int id = instance.getId();
            String name = CommonUtil.fromNullToEmpty(instance.getName());
            String description = CommonUtil.fromNullToEmpty(instance
                    .getDescription());
            if (isList) {
                User createdBy = instance.getCreated_by();
                String createdByName = "";
                if (createdBy != null) {
                    createdByName = CommonUtil.fromNullToEmpty(createdBy
                            .getName());
                }
                User updatedBy = instance.getUpdated_by();
                String updatedByName = "";
                if (updatedBy != null) {
                    updatedByName = CommonUtil.fromNullToEmpty(updatedBy
                            .getName());
                }
                SimpleDateFormat dateFormat = new SimpleDateFormat(
                        Constant.DATE_TIME_FORMAT);
                Date createdOn = instance.getCreated_on();
                String createdOnName = "";
                if (createdOn != null) {
                    createdOnName = dateFormat.format(createdOn);
                }
                Date updatedOn = instance.getUpdated_on();
                String updatedOnName = "";
                if (updatedOn != null) {
                    updatedOnName = dateFormat.format(updatedOn);
                }
                jsonBuilder.append("{\"cell\":[\"").append(id).append("\",\"")
View Full Code Here


        UserUtil.permissionCheck("create_system");
        if (this.getSeleteIDs() != null) {
            String[] ids = seleteIDs.split(",");
            for (int i = 0; i < ids.length; i++) {
                String copyid = ids[i];
                Role oriRecord = baseService.getEntityById(Role.class,
                        Integer.valueOf(copyid));
                Role targetRecord = oriRecord.clone();
                targetRecord.setId(null);
                this.baseService.makePersistent(targetRecord);
            }
        }
        return SUCCESS;
    }
View Full Code Here

            writer.writeHeader(header);
            if (!isTemplate) {
                String[] ids = seleteIDs.split(",");
                for (int i = 0; i < ids.length; i++) {
                    String id = ids[i];
                    Role role = baseService.getEntityById(Role.class,
                            Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], role.getId());
                    data1.put(header[1],
                            CommonUtil.fromNullToEmpty(role.getName()));
                    data1.put(header[2],
                            CommonUtil.fromNullToEmpty(role.getDescription()));
                    data1.put(header[3],
                            CommonUtil.fromNullToEmpty(role.getNotes()));
                    writer.write(data1, header);
                }
            }
        } catch (Exception e) {
            throw e;
View Full Code Here

                Map<String, String> row = new HashMap<String, String>();
                for (int i = 0; i < line.size(); i++) {
                    row.put(header[i], line.get(i));
                }

                Role role = new Role();
                try {
                    String id = row.get(rb.getString("entity.id.label"));
                    if (!CommonUtil.isNullOrEmpty(id)) {
                        role.setId(Integer.parseInt(id));
                    }
                    role.setName(CommonUtil.fromNullToEmpty(row.get(rb
                            .getString("entity.name.label"))));
                    role.setDescription(CommonUtil.fromNullToEmpty(row.get(rb
                            .getString("entity.description.label"))));
                    role.setNotes(CommonUtil.fromNullToEmpty(row.get(rb
                            .getString("entity.notes.label"))));
                    baseService.makePersistent(role);
                    successfulNum++;
                } catch (Exception e) {
                    failedNum++;
                    failedMsg.put(role.getName(), e.getMessage());
                }

            }

            this.setFailedMsg(failedMsg);
View Full Code Here

TOP

Related Classes of com.gcrm.domain.Role

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.