Package com.gcrm.domain

Examples of com.gcrm.domain.Call


     * Saves the entity.
     *
     * @return the SUCCESS result
     */
    public String save() throws Exception {
        Call originalCall = saveEntity();
        final Collection<ChangeLog> changeLogs = changeLog(originalCall, call);
        // Validate Reminder Email Template
        if (call.isReminder_email() && reminderTemplateID == null) {
            String errorMessage = getText("error.reminderEamilTemplate");
            super.addActionError(errorMessage);
View Full Code Here


            User user = userService
                    .getEntityById(User.class, loginUser.getId());
            Collection<ChangeLog> allChangeLogs = new ArrayList<ChangeLog>();
            for (String IDString : selectIDArray) {
                int id = Integer.parseInt(IDString);
                Call callInstance = this.baseService.getEntityById(Call.class,
                        id);
                Call originalCall = callInstance.clone();
                for (String fieldName : feildNameCollection) {
                    Object value = BeanUtil.getFieldValue(call, fieldName);
                    BeanUtil.setFieldValue(callInstance, fieldName, value);
                }
                callInstance.setUpdated_by(user);
View Full Code Here

     *
     * @return original call record
     * @throws ParseException
     */
    private Call saveEntity() throws Exception {
        Call originalCall = null;
        if (call.getId() == null) {
            UserUtil.permissionCheck("create_call");
        } else {
            UserUtil.permissionCheck("update_call");
            originalCall = baseService.getEntityById(Call.class, call.getId());
            call.setContacts(originalCall.getContacts());
            call.setLeads(originalCall.getLeads());
            call.setUsers(originalCall.getUsers());
            call.setCreated_on(originalCall.getCreated_on());
            call.setCreated_by(originalCall.getCreated_by());
        }

        CallDirection direction = null;
        if (directionID != null) {
            direction = callDirectionService.getEntityById(CallDirection.class,
View Full Code Here

            if (targetLists == null) {
                targetLists = new HashSet<TargetList>();
            }
            targetLists.add(targetList);
        } else if ("Call".equals(this.getRelationKey())) {
            Call call = callService.getEntityById(Call.class,
                    Integer.valueOf(this.getRelationValue()));
            Set<Call> calls = contact.getCalls();
            if (calls == null) {
                calls = new HashSet<Call>();
            }
View Full Code Here

            if (targetLists == null) {
                targetLists = new HashSet<TargetList>();
            }
            targetLists.add(targetList);
        } else if ("Call".equals(this.getRelationKey())) {
            Call call = callService.getEntityById(Call.class,
                    Integer.valueOf(this.getRelationValue()));
            Set<Call> calls = lead.getCalls();
            if (calls == null) {
                calls = new HashSet<Call>();
            }
View Full Code Here

     * @return the SUCCESS result
     */
    public String select() throws ServiceException {
        Opportunity opportunity = null;
        TargetList targetList = null;
        Call call = null;
        Meeting meeting = null;
        Document document = null;
        CaseInstance caseInstance = null;
        Set<Contact> contacts = null;

        if ("Opportunity".equals(this.getRelationKey())) {
            opportunity = opportunityService.getEntityById(Opportunity.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = opportunity.getContacts();
        } else if ("TargetList".equals(this.getRelationKey())) {
            targetList = targetListService.getEntityById(TargetList.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = targetList.getContacts();
        } else if ("Call".equals(this.getRelationKey())) {
            call = callService.getEntityById(Call.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = call.getContacts();
        } else if ("Meeting".equals(this.getRelationKey())) {
            meeting = meetingService.getEntityById(Meeting.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = meeting.getContacts();
        } else if ("Document".equals(this.getRelationKey())) {
View Full Code Here

     * @return the SUCCESS result
     */
    public String unselect() throws ServiceException {
        Opportunity opportunity = null;
        TargetList targetList = null;
        Call call = null;
        Meeting meeting = null;
        Document document = null;
        CaseInstance caseInstance = null;
        Set<Contact> contacts = null;
        if ("Opportunity".equals(this.getRelationKey())) {
            opportunity = opportunityService.getEntityById(Opportunity.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = opportunity.getContacts();
        } else if ("TargetList".equals(this.getRelationKey())) {
            targetList = targetListService.getEntityById(TargetList.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = targetList.getContacts();
        } else if ("Call".equals(this.getRelationKey())) {
            call = callService.getEntityById(Call.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = call.getContacts();
        } else if ("Meeting".equals(this.getRelationKey())) {
            meeting = meetingService.getEntityById(Meeting.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = meeting.getContacts();
        } else if ("Document".equals(this.getRelationKey())) {
View Full Code Here

        String statusName = null;
        String directionName = null;
        String assignedTo = null;
        while (calls.hasNext()) {
            Call instance = calls.next();
            int id = instance.getId();
            CallDirection direction = instance.getDirection();
            directionName = CommonUtil.getOptionLabel(direction);
            String subject = CommonUtil.fromNullToEmpty(instance.getSubject());
            CallStatus status = instance.getStatus();
            statusName = CommonUtil.getOptionLabel(status);
            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    Constant.DATE_TIME_FORMAT);
            Date startDate = instance.getStart_date();
            String startDateString = "";
            if (startDate != null) {
                startDateString = dateFormat.format(startDate);
            }

            if (isList) {
                User user = instance.getAssigned_to();
                if (user != null) {
                    assignedTo = CommonUtil.fromNullToEmpty(user.getName());
                } else {
                    assignedTo = "";
                }
                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();
                String createdOnString = "";
                if (createdOn != null) {
                    createdOnString = dateTimeFormat.format(createdOn);
                }
                Date updatedOn = instance.getUpdated_on();
                String updatedOnString = "";
                if (updatedOn != null) {
                    updatedOnString = dateTimeFormat.format(updatedOn);
                }
View Full Code Here

        UserUtil.permissionCheck("create_call");
        if (this.getSeleteIDs() != null) {
            String[] ids = seleteIDs.split(",");
            for (int i = 0; i < ids.length; i++) {
                String copyid = ids[i];
                Call oriRecord = baseService.getEntityById(Call.class,
                        Integer.valueOf(copyid));
                Call targetRecord = oriRecord.clone();
                targetRecord.setId(null);
                this.getbaseService().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];
                    Call call = baseService.getEntityById(Call.class,
                            Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], call.getId());
                    data1.put(header[1],
                            CommonUtil.fromNullToEmpty(call.getSubject()));
                    CallDirection callDirection = call.getDirection();
                    if (callDirection != null) {
                        data1.put(header[2], callDirection.getId());
                    } else {
                        data1.put(header[2], "");
                    }
                    data1.put(header[3],
                            CommonUtil.getOptionLabel(callDirection));
                    CallStatus callStatus = call.getStatus();
                    if (call.getStatus() != null) {
                        data1.put(header[4], callStatus.getId());
                    } else {
                        data1.put(header[4], "");
                    }
                    data1.put(header[5], CommonUtil.getOptionLabel(callStatus));
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_TIME_FORMAT);
                    Date startDate = call.getStart_date();
                    if (startDate != null) {
                        data1.put(header[6], dateFormat.format(startDate));
                    } else {
                        data1.put(header[6], "");
                    }
                    data1.put(header[7], call.isReminder_email());
                    ReminderOption reminderOptionEmail = call
                            .getReminder_option_email();
                    if (reminderOptionEmail != null) {
                        data1.put(header[8], reminderOptionEmail.getId());
                    } else {
                        data1.put(header[8], "");
                    }
                    data1.put(header[9],
                            CommonUtil.getOptionLabel(reminderOptionEmail));
                    data1.put(header[10],
                            CommonUtil.fromNullToEmpty(call.getNotes()));
                    if (call.getAssigned_to() != null) {
                        data1.put(header[11], call.getAssigned_to().getId());
                        data1.put(header[12], call.getAssigned_to().getName());
                    } else {
                        data1.put(header[11], "");
                        data1.put(header[12], "");
                    }
                    writer.write(data1, header);
View Full Code Here

TOP

Related Classes of com.gcrm.domain.Call

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.