Package com.gcrm.domain

Examples of com.gcrm.domain.User


     *
     * @param entity
     *            instance
     */
    protected void updateBaseInfo(BaseEntity entity) {
        User loginUser = getLoginUser();
        if (entity.getId() == null) {
            entity.setCreated_by(loginUser);
            entity.setCreated_on(new Date());
        } else {
            entity.setUpdated_by(loginUser);
View Full Code Here


     * @return login user
     */
    protected User getLoginUser() {
        ActionContext context = ActionContext.getContext();
        Map<String, Object> session = context.getSession();
        User loginUser = (User) session
                .get(AuthenticationSuccessListener.LOGIN_USER);
        return loginUser;
    }
View Full Code Here

     *            instance
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    protected void getBaseInfo(BaseEntity entity, String entityName,
            String namespace) {
        User createdUser = entity.getCreated_by();
        if (createdUser != null) {
            this.setCreatedBy(createdUser.getName());
        }
        User updatedUser = entity.getUpdated_by();
        if (updatedUser != null) {
            this.setUpdatedBy(updatedUser.getName());
        }
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                Constant.DATE_TIME_FORMAT);
        Date createdOn = entity.getCreated_on();
        if (createdOn != null) {
            this.setCreatedOn(dateFormat.format(createdOn));
        }
        Date updatedOn = entity.getUpdated_on();
        if (updatedOn != null) {
            this.setUpdatedOn(dateFormat.format(updatedOn));
        }
        User owner = entity.getOwner();
        if (owner != null) {
            ownerID = owner.getId();
            ownerText = owner.getName();
        }

        // Sets navigation history
        HttpServletRequest request = ServletActionContext.getRequest();
        HttpSession session = request.getSession();
View Full Code Here

     *
     */
    protected void initBaseInfo() {
        ActionContext context = ActionContext.getContext();
        Map<String, Object> session = context.getSession();
        User loginUser = (User) session
                .get(AuthenticationSuccessListener.LOGIN_USER);
        assignedToID = loginUser.getId();
        assignedToText = loginUser.getName();
        ownerID = loginUser.getId();
        ownerText = loginUser.getName();
    }
View Full Code Here

    public String listFull() throws Exception {
        UserUtil.permissionCheck("view_system");

        Map<String, String> fieldTypeMap = new HashMap<String, String>();
        fieldTypeMap.put("updated_on", Constant.DATA_TYPE_DATETIME);
        User loginUser = UserUtil.getLoginUser();
        SearchCondition searchCondition = getSearchCondition(fieldTypeMap,
                loginUser.getScope_account(), loginUser);
        SearchResult<ChangeLog> result = baseService.getPaginationObjects(
                CLAZZ, searchCondition);
        Iterator<ChangeLog> changeLogs = result.getResult().iterator();
        long totalRecords = result.getTotalRecords();
        getListJson(changeLogs, totalRecords, searchCondition, true);
View Full Code Here

            columnName = this.getText(columnName);
            String oldValue = CommonUtil
                    .fromNullToEmpty(instance.getOldValue());
            String newValue = CommonUtil
                    .fromNullToEmpty(instance.getNewValue());
            User updatedBy = instance.getUpdated_by();
            String updatedByName = "";
            if (updatedBy != null) {
                updatedByName = CommonUtil.fromNullToEmpty(updatedBy.getName());
            }
            Date updatedOn = instance.getUpdated_on();
            String updatedOnName = "";
            if (updatedOn != null) {
                updatedOnName = dateFormat.format(updatedOn);
View Full Code Here

        fieldTypeMap.put("start_date", Constant.DATA_TYPE_DATETIME);
        fieldTypeMap.put("end_date", Constant.DATA_TYPE_DATETIME);
        fieldTypeMap.put("created_on", Constant.DATA_TYPE_DATETIME);
        fieldTypeMap.put("updated_on", Constant.DATA_TYPE_DATETIME);

        User loginUser = UserUtil.getLoginUser();
        SearchCondition searchCondition = getSearchCondition(fieldTypeMap,
                loginUser.getScope_campaign(), loginUser);
        SearchResult<Campaign> result = baseService.getPaginationObjects(CLAZZ,
                searchCondition);
        Iterator<Campaign> campaigns = result.getResult().iterator();

        long totalRecords = result.getTotalRecords();
View Full Code Here

            String endDateString = "";
            Date endDate = instance.getEnd_date();
            if (endDate != null) {
                endDateString = dateFormat.format(endDate);
            }
            User user = instance.getAssigned_to();
            if (user != null) {
                assignedTo = CommonUtil.fromNullToEmpty(user.getName());
            } else {
                assignedTo = "";
            }
            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 dateTimeFormat = new SimpleDateFormat(
                        Constant.DATE_TIME_FORMAT);
                Date createdOn = instance.getCreated_on();
View Full Code Here

        if (originalCall != null) {
            ActionContext context = ActionContext.getContext();
            Map<String, Object> session = context.getSession();
            String entityName = Call.class.getSimpleName();
            Integer recordID = call.getId();
            User loginUser = (User) session
                    .get(AuthenticationSuccessListener.LOGIN_USER);
            changeLogs = new ArrayList<ChangeLog>();

            String oldSubject = CommonUtil.fromNullToEmpty(originalCall
                    .getSubject());
            String newSubject = CommonUtil.fromNullToEmpty(call.getSubject());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.subject.label", oldSubject, newSubject, loginUser);

            String oldStatus = getOptionValue(originalCall.getStatus());
            String newStatus = getOptionValue(call.getStatus());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.status.label", oldStatus, newStatus, loginUser);
            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    Constant.DATE_EDIT_FORMAT);
            String oldStartDateValue = "";
            Date oldStartDate = originalCall.getStart_date();
            if (oldStartDate != null) {
                oldStartDateValue = dateFormat.format(oldStartDate);
            }
            String newStartDateValue = "";
            Date newStartDate = call.getStart_date();
            if (newStartDate != null) {
                newStartDateValue = dateFormat.format(newStartDate);
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.start_date.label", oldStartDateValue,
                    newStartDateValue, loginUser);

            String oldRelatedObject = CommonUtil.fromNullToEmpty(originalCall
                    .getRelated_object());
            String newRelatedObject = CommonUtil.fromNullToEmpty(call
                    .getRelated_object());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.related_object.label", oldRelatedObject,
                    newRelatedObject, loginUser);

            String oldRelatedRecord = String.valueOf(originalCall
                    .getRelated_record());
            String newRelatedRecord = String.valueOf(call.getRelated_record());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.related_record.label", oldRelatedRecord,
                    newRelatedRecord, loginUser);

            boolean oldReminderEmail = originalCall.isReminder_email();
            boolean newReminderEmail = call.isReminder_email();
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.reminder.label", String.valueOf(oldReminderEmail),
                    String.valueOf(newReminderEmail), loginUser);

            String oldReminderOption = getOptionValue(originalCall
                    .getReminder_option_email());
            String newReminderOption = getOptionValue(call
                    .getReminder_option_email());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.reminder_option_email_name.label",
                    oldReminderOption, newReminderOption, loginUser);

            String oldReminderTemplateName = "";
            EmailTemplate oldReminderTemplate = originalCall
                    .getReminder_template();
            if (oldReminderTemplate != null) {
                oldReminderTemplateName = CommonUtil
                        .fromNullToEmpty(oldReminderTemplate.getName());
            }
            String newReminderTemplateName = "";
            EmailTemplate newReminderTemplate = call.getReminder_template();
            if (newReminderTemplate != null) {
                newReminderTemplateName = CommonUtil
                        .fromNullToEmpty(newReminderTemplate.getName());
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.reminder_template.label", oldReminderTemplateName,
                    newReminderTemplateName, loginUser);

            String oldNotes = CommonUtil.fromNullToEmpty(originalCall
                    .getNotes());
            String newNotes = CommonUtil.fromNullToEmpty(call.getNotes());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.notes.label", oldNotes, newNotes, loginUser);

            String oldAssignedToName = "";
            User oldAssignedTo = originalCall.getAssigned_to();
            if (oldAssignedTo != null) {
                oldAssignedToName = oldAssignedTo.getName();
            }
            String newAssignedToName = "";
            User newAssignedTo = call.getAssigned_to();
            if (newAssignedTo != null) {
                newAssignedToName = newAssignedTo.getName();
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.assigned_to.label",
                    CommonUtil.fromNullToEmpty(oldAssignedToName),
                    CommonUtil.fromNullToEmpty(newAssignedToName), loginUser);
View Full Code Here

            startDate = dateFormat.format(start_date);
        }
        this.setId(call.getId());
        ActionContext context = ActionContext.getContext();
        Map<String, Object> session = context.getSession();
        User loginUser = (User) session
                .get(AuthenticationSuccessListener.LOGIN_USER);

        StringBuilder targetEmails = new StringBuilder("");
        Set<Contact> contacts = call.getContacts();
        if (contacts != null) {
            for (Contact contact : contacts) {
                String email = contact.getEmail();
                if (CommonUtil.isNullOrEmpty(email)) {
                    continue;
                }
                if (targetEmails.length() > 0) {
                    targetEmails.append(",");
                }
                targetEmails.append(email);
            }
        }
        Set<Lead> leads = call.getLeads();
        if (leads != null) {
            for (Lead lead : leads) {
                String email = lead.getEmail();
                if (CommonUtil.isNullOrEmpty(email)) {
                    continue;
                }
                if (targetEmails.length() > 0) {
                    targetEmails.append(",");
                }
                targetEmails.append(email);
            }
        }
        from = loginUser.getEmail();
        if (from == null) {
            from = "";
        }
        Set<User> users = call.getUsers();
        if (users != null) {
View Full Code Here

TOP

Related Classes of com.gcrm.domain.User

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.