Package com.gcrm.domain

Examples of com.gcrm.domain.User


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

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

            String oldStatus = getOptionValue(originalTask.getStatus());
            String newStatus = getOptionValue(task.getStatus());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.status.label", oldStatus, newStatus, loginUser);

            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    Constant.DATE_EDIT_FORMAT);
            String oldStartDateValue = "";
            Date oldStartDate = originalTask.getStart_date();
            if (oldStartDate != null) {
                oldStartDateValue = dateFormat.format(oldStartDate);
            }
            String newStartDateValue = "";
            Date newStartDate = task.getStart_date();
            if (newStartDate != null) {
                newStartDateValue = dateFormat.format(newStartDate);
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.start_date.label", oldStartDateValue,
                    newStartDateValue, loginUser);

            String oldDueDateValue = "";
            Date oldDueDate = originalTask.getDue_date();
            if (oldDueDate != null) {
                oldDueDateValue = dateFormat.format(oldDueDate);
            }
            String newDueDateValue = "";
            Date newDueDate = task.getDue_date();
            if (newDueDate != null) {
                newDueDateValue = dateFormat.format(newDueDate);
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "task.due_date.label", oldDueDateValue, newDueDateValue,
                    loginUser);

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

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

            String oldContactName = "";
            Contact oldContact = originalTask.getContact();
            if (oldContact != null) {
                oldContactName = CommonUtil.fromNullToEmpty(oldContact
                        .getName());
            }
            String newContactName = "";
            Contact newContact = task.getContact();
            if (newContact != null) {
                newContactName = CommonUtil.fromNullToEmpty(newContact
                        .getName());
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.contact.label", oldContactName, newContactName,
                    loginUser);

            String oldTaskPriority = getOptionValue(originalTask.getPriority());
            String newTaskPriority = getOptionValue(task.getPriority());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.priority.label", oldTaskPriority, newTaskPriority,
                    loginUser);

            String oldDescription = CommonUtil.fromNullToEmpty(originalTask
                    .getDescription());
            String newDescription = CommonUtil.fromNullToEmpty(task
                    .getDescription());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.description.label", oldDescription, newDescription,
                    loginUser);

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

            String oldAssignedToName = "";
            User oldAssignedTo = originalTask.getAssigned_to();
            if (oldAssignedTo != null) {
                oldAssignedToName = oldAssignedTo.getName();
            }
            String newAssignedToName = "";
            User newAssignedTo = task.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


            Contact contact = task.getContact();
            if (contact != null) {
                contactID = contact.getId();
                contactText = contact.getName();
            }
            User assignedTo = task.getAssigned_to();
            if (assignedTo != null) {
                this.setAssignedToID(assignedTo.getId());
                this.setAssignedToText(assignedTo.getName());
            }
            Date start_date = task.getStart_date();
            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    Constant.DATE_TIME_FORMAT);
            if (start_date != null) {
View Full Code Here

        saveEntity();
        String[] fieldNames = this.massUpdate;
        if (fieldNames != null) {
            String[] selectIDArray = this.seleteIDs.split(",");
            Collection<Task> tasks = new ArrayList<Task>();
            User loginUser = this.getLoginUser();
            User user = userService
                    .getEntityById(User.class, loginUser.getId());
            Collection<ChangeLog> allChangeLogs = new ArrayList<ChangeLog>();
            for (String IDString : selectIDArray) {
                int id = Integer.parseInt(IDString);
                Task taskInstance = this.baseService.getEntityById(Task.class,
View Full Code Here

        Contact contact = null;
        if (contactID != null) {
            contact = contactService.getEntityById(Contact.class, contactID);
        }
        task.setContact(contact);
        User assignedTo = null;
        if (this.getAssignedToID() != null) {
            assignedTo = userService.getEntityById(User.class,
                    this.getAssignedToID());
        }
        task.setAssigned_to(assignedTo);
        User owner = null;
        if (this.getOwnerID() != null) {
            owner = userService.getEntityById(User.class, this.getOwnerID());
        }
        task.setOwner(owner);
        SimpleDateFormat dateFormat = new SimpleDateFormat(
View Full Code Here

   * @return the SUCCESS result
   */
  public String load() throws ServiceException {
    ActionContext context = ActionContext.getContext();
    Map<String, Object> session = context.getSession();
    User loginUser = (User) session
        .get(AuthenticationSuccessListener.LOGIN_USER);
    this.userID = loginUser.getId();
    return SUCCESS;
  }
View Full Code Here

            this.addActionError(this.getText("changePassword.password.noequal"));
            return INPUT;
        }
        ActionContext context = ActionContext.getContext();
        Map<String, Object> session = context.getSession();
        User loginUser = (User) session
                .get(AuthenticationSuccessListener.LOGIN_USER);
        Md5PasswordEncoder encoder = new Md5PasswordEncoder();
        String encodePassword = encoder.encodePassword(oldPassword,
                AuthenticationFilter.SALT);
        if (!encodePassword.equals(loginUser.getPassword())) {
            this.addActionError(this
                    .getText("changePassword.wrong.oldPassword"));
            return INPUT;
        }
        encodePassword = encoder.encodePassword(newPassword,
                AuthenticationFilter.SALT);
        loginUser.setPassword(encodePassword);
        baseService.makePersistent(loginUser);
        this.addActionError(this.getText("changePassword.password.success"));
        return SUCCESS;
    }
View Full Code Here

        Map<String, String> fieldTypeMap = new HashMap<String, String>();
        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_targetList(), loginUser);
        SearchResult<TargetList> result = baseService.getPaginationObjects(
                CLAZZ, searchCondition);
        Iterator<TargetList> targetLists = result.getResult().iterator();
        long totalRecords = result.getTotalRecords();
        getListJson(targetLists, totalRecords, searchCondition, true);
View Full Code Here

        String assignedTo = null;
        while (targetLists.hasNext()) {
            TargetList instance = targetLists.next();
            int id = instance.getId();
            String name = CommonUtil.fromNullToEmpty(instance.getName());
            User user = instance.getAssigned_to();
            if (user != null) {
                assignedTo = 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 dateFormat = new SimpleDateFormat(
                        Constant.DATE_TIME_FORMAT);
                Date createdOn = instance.getCreated_on();
View Full Code Here

                    String assignedToID = row
                            .get(getText("entity.assigned_to_id.label"));
                    if (CommonUtil.isNullOrEmpty(assignedToID)) {
                        targetList.setAssigned_to(null);
                    } else {
                        User assignedTo = userService.getEntityById(User.class,
                                Integer.parseInt(assignedToID));
                        targetList.setAssigned_to(assignedTo);
                    }
                    baseService.makePersistent(targetList);
                    successfulNum++;
View Full Code Here

            UserUtil.permissionCheck("create_system");
        } else {
            UserUtil.permissionCheck("update_system");
        }

        User owner = null;
        if (this.getOwnerID() != null) {
            owner = userService.getEntityById(User.class, this.getOwnerID());
        }
        role.setOwner(owner);
        super.updateBaseInfo(role);
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.