Package com.gcrm.domain

Examples of com.gcrm.domain.Meeting


     * Saves the entity.
     *
     * @return the SUCCESS result
     */
    public String save() throws Exception {
        Meeting originalMeeting = saveEntity();
        final Collection<ChangeLog> changeLogs = changeLog(originalMeeting,
                meeting);
        // Validate Reminder Email Template
        if (meeting.isReminder_email() && reminderTemplateID == null) {
            String errorMessage = getText("error.reminderEamilTemplate");
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);
                Meeting meetingInstance = this.baseService.getEntityById(
                        Meeting.class, id);
                Meeting originalMeeting = meetingInstance.clone();
                for (String fieldName : fieldNames) {
                    Object value = BeanUtil.getFieldValue(meeting, fieldName);
                    BeanUtil.setFieldValue(meetingInstance, fieldName, value);
                }
                meetingInstance.setUpdated_by(user);
View Full Code Here

     *
     * @return original meeting record
     * @throws ParseException
     */
    private Meeting saveEntity() throws Exception {
        Meeting originalMeeting = null;
        if (meeting.getId() == null) {
            UserUtil.permissionCheck("create_meeting");
        } else {
            UserUtil.permissionCheck("update_meeting");
            originalMeeting = baseService.getEntityById(Meeting.class,
                    meeting.getId());
            meeting.setContacts(originalMeeting.getContacts());
            meeting.setLeads(originalMeeting.getLeads());
            meeting.setUsers(originalMeeting.getUsers());
            meeting.setCreated_on(originalMeeting.getCreated_on());
            meeting.setCreated_by(originalMeeting.getCreated_by());
        }

        MeetingStatus status = null;
        if (statusID != null) {
            status = meetingStatusService.getEntityById(MeetingStatus.class,
View Full Code Here

            if (calls == null) {
                calls = new HashSet<Call>();
            }
            calls.add(call);
        } else if ("Meeting".equals(this.getRelationKey())) {
            Meeting meeting = meetingService.getEntityById(Meeting.class,
                    Integer.valueOf(this.getRelationValue()));
            Set<Meeting> meetings = contact.getMeetings();
            if (meetings == null) {
                meetings = new HashSet<Meeting>();
            }
View Full Code Here

        jsonBuilder
                .append(getJsonHeader(totalRecords, searchCondition, isList));
        String statusName = null;
        String assignedTo = null;
        while (meetings.hasNext()) {
            Meeting instance = meetings.next();
            int id = instance.getId();
            String subject = CommonUtil.fromNullToEmpty(instance.getSubject());
            MeetingStatus status = instance.getStatus();
            statusName = CommonUtil.getOptionLabel(status);
            SimpleDateFormat dateTimeFormat = new SimpleDateFormat(
                    Constant.DATE_TIME_FORMAT);
            Date startDate = instance.getStart_date();
            String startDateString = "";
            if (startDate != null) {
                startDateString = dateTimeFormat.format(startDate);
            }
            Date endDate = instance.getEnd_date();
            String endDateString = "";
            if (endDate != null) {
                endDateString = dateTimeFormat.format(endDate);
            }
            String location = instance.getLocation();
            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());
                }
                Date createdOn = instance.getCreated_on();
                String createdOnName = "";
                if (createdOn != null) {
                    createdOnName = dateTimeFormat.format(createdOn);
                }
                Date updatedOn = instance.getUpdated_on();
                String updatedOnName = "";
                if (updatedOn != null) {
                    updatedOnName = dateTimeFormat.format(updatedOn);
                }
View Full Code Here

        UserUtil.permissionCheck("create_meeting");
        if (this.getSeleteIDs() != null) {
            String[] ids = seleteIDs.split(",");
            for (int i = 0; i < ids.length; i++) {
                String copyid = ids[i];
                Meeting oriRecord = baseService.getEntityById(Meeting.class,
                        Integer.valueOf(copyid));
                Meeting 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];
                    Meeting meeting = baseService.getEntityById(Meeting.class,
                            Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], meeting.getId());
                    data1.put(header[1],
                            CommonUtil.fromNullToEmpty(meeting.getSubject()));
                    MeetingStatus meetingStatus = meeting.getStatus();
                    if (meetingStatus != null) {
                        data1.put(header[2], meetingStatus.getId());
                    } else {
                        data1.put(header[2], "");
                    }
                    data1.put(header[3],
                            CommonUtil.getOptionLabel(meetingStatus));
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_TIME_FORMAT);
                    Date startDate = meeting.getStart_date();
                    if (startDate != null) {
                        data1.put(header[4], dateFormat.format(startDate));
                    } else {
                        data1.put(header[4], "");
                    }
                    Date endDate = meeting.getEnd_date();
                    if (endDate != null) {
                        data1.put(header[5], dateFormat.format(endDate));
                    } else {
                        data1.put(header[5], "");
                    }
                    data1.put(header[6], CommonUtil.fromNullToEmpty(meeting
                            .getRelated_object()));
                    if (meeting.getRelated_record() == null) {
                        data1.put(header[7], "");
                    } else {
                        data1.put(header[7],
                                String.valueOf(meeting.getRelated_record()));
                    }
                    data1.put(header[8],
                            CommonUtil.fromNullToEmpty(meeting.getLocation()));
                    data1.put(header[9], meeting.isReminder_email());
                    ReminderOption reminderOptionEmail = meeting
                            .getReminder_option_email();
                    if (reminderOptionEmail != null) {
                        data1.put(header[10], reminderOptionEmail.getId());
                    } else {
                        data1.put(header[10], "");
                    }
                    data1.put(header[11],
                            CommonUtil.getOptionLabel(reminderOptionEmail));
                    data1.put(header[12],
                            CommonUtil.fromNullToEmpty(meeting.getNotes()));
                    if (meeting.getAssigned_to() != null) {
                        data1.put(header[13], meeting.getAssigned_to().getId());
                        data1.put(header[14], meeting.getAssigned_to()
                                .getName());
                    } else {
                        data1.put(header[13], "");
                        data1.put(header[14], "");
                    }
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));
                }
                Meeting meeting = new Meeting();
                try {
                    String id = row.get(getText("entity.id.label"));
                    if (!CommonUtil.isNullOrEmpty(id)) {
                        meeting.setId(Integer.parseInt(id));
                    }
                    meeting.setSubject(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.subject.label"))));
                    String statusID = row
                            .get(getText("entity.status_id.label"));
                    if (CommonUtil.isNullOrEmpty(statusID)) {
                        meeting.setStatus(null);
                    } else {
                        MeetingStatus status = meetingStatusService
                                .getEntityById(MeetingStatus.class,
                                        Integer.parseInt(statusID));
                        meeting.setStatus(status);
                    }
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_TIME_FORMAT);
                    String startDateS = row
                            .get(getText("entity.start_date.label"));
                    if (startDateS != null) {
                        Date startDate = dateFormat.parse(startDateS);
                        meeting.setStart_date(startDate);
                    } else {
                        meeting.setStart_date(null);
                    }
                    String endDateS = row.get(getText("entity.end_date.label"));
                    if (endDateS != null) {
                        Date endDate = dateFormat.parse(endDateS);
                        meeting.setEnd_date(endDate);
                    } else {
                        meeting.setEnd_date(null);
                    }
                    meeting.setRelated_object(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.related_object.label"))));
                    String relatedRecord = row
                            .get(getText("entity.related_record_id.label"));
                    if (CommonUtil.isNullOrEmpty(relatedRecord)) {
                        meeting.setRelated_record(0);
                    } else {
                        meeting.setRelated_record(Integer
                                .parseInt(relatedRecord));
                    }
                    meeting.setLocation(CommonUtil.fromNullToEmpty(row
                            .get(getText("meeting.location.label"))));
                    String reminderWayEmail = row
                            .get(getText("entity.reminder_email.label"));
                    if (CommonUtil.isNullOrEmpty(reminderWayEmail)) {
                        meeting.setReminder_email(false);
                    } else {
                        meeting.setReminder_email(Boolean
                                .parseBoolean(reminderWayEmail));
                    }
                    String reminderOptionEmailID = row
                            .get(getText("entity.reminder_option_email_id.label"));
                    if (CommonUtil.isNullOrEmpty(reminderOptionEmailID)) {
                        meeting.setReminder_option_email(null);
                    } else {
                        ReminderOption reminderOption = reminderOptionService
                                .getEntityById(ReminderOption.class,
                                        Integer.parseInt(reminderOptionEmailID));
                        meeting.setReminder_option_email(reminderOption);
                    }
                    meeting.setNotes(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.notes.label"))));
                    String assignedToID = row
                            .get(getText("entity.assigned_to_id.label"));
                    if (CommonUtil.isNullOrEmpty(assignedToID)) {
                        meeting.setAssigned_to(null);
                    } else {
                        User assignedTo = userService.getEntityById(User.class,
                                Integer.parseInt(assignedToID));
                        meeting.setAssigned_to(assignedTo);
                    }
                    baseService.makePersistent(meeting);
                    successfulNum++;
                } catch (Exception e) {
                    failedNum++;
                    failedMsg.put(meeting.getSubject(), e.getMessage());
                }

            }

            this.setFailedMsg(failedMsg);
View Full Code Here

     */
    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())) {
            document = documentService.getEntityById(Document.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = document.getContacts();
        } else if ("CaseInstance".equals(this.getRelationKey())) {
View Full Code Here

     */
    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())) {
            document = documentService.getEntityById(Document.class,
                    Integer.valueOf(this.getRelationValue()));
            contacts = document.getContacts();
        } else if ("CaseInstance".equals(this.getRelationKey())) {
View Full Code Here

TOP

Related Classes of com.gcrm.domain.Meeting

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.