Updated on 2024-07-30 GMT+08:00

Scenario 5: Editing a Meeting

Description

After logging in to Huawei Cloud Meeting using an account, call the API for Obtaining Meeting Details to obtain the meeting details and then call the editConf API to edit the meeting.

Service Process

To start a meeting using the SDK, call the editConf API and then implement hwmCallback.

  1. Call the API.

    Call the editConf API to edit a meeting.

  2. Implement the callback.

    Implement hwmCallback.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Assemble parameters required for editing a meeting.
// Set the meeting topic.
String subject = getSubject();
// Set the start time, time zone, and duration of the meeting.
String startTimeLocal = startTimeText.getText().toString();
String startTime = BaseDateUtil.transTimeZone(startTimeLocal, TimeZone.getTimeZone("GMT+08:00"), TimeZone.getTimeZone("GMT+00:00"), BaseDateUtil.FMT_YMDHMS);
long startTimeStamp = BaseDateUtil.dateToTimeStamp(startTime, BaseDateUtil.FMT_YMDHMS);
String timeZomeStr = timezomeText.getText().toString();
String timedurStr = timeDuartionText.getText().toString();
int timeZone = Integer.parseInt(timeZomeStr);
int timeDuration = Integer.parseInt(timedurStr);
// Set the meeting type.
MeetingType confType = audioBtn.isChecked() ? MeetingType.CONF_AUDIO : MeetingType.CONF_VIDEO;
String joinConfTypeStr = joinConfPerText.getText().toString();
// Set restrictions on participants.
int joinConfPermission = Integer.parseInt(joinConfTypeStr);
JoinConfPermissionType permissionType = JoinConfPermissionType.valueOf(joinConfPermission);
// Specify whether to record the meeting.
boolean needRecord = recordSwitch.isChecked();
// Specify whether to send email notifications.
boolean needEmail = sendEmailSwitch.isChecked();
// Specify whether to send SMS notifications.
boolean needSms = sendSmsSwitch.isChecked();
// Specify whether to send an email calendar.
boolean needEmailCalendar = sendEmailCalendarSwitch.isChecked();
// Set the participant list.
List<AttendeeModel> attendeeInfos = this.confDetailModel.getAttendeeModels();
Switch needWithMemberSwitch = findViewById(R.id.edit_switch_with_attend);
boolean needWithMember = needWithMemberSwitch.isChecked();
if (needWithMember) {
        // The following three methods are available:
	String name = getName();
	String number = getNumber();
	String thirdAccount = getThirdAccount();
           if (!TextUtils.isEmpty(thirdAccount)) {
                if (LoginStatusCache.getsLoginAccountInfo() instanceof AppIdAuthParam) {
                    // An app ID is used for login.
                    attendeeList.add(AttendeeModel.buildAttendeeByThirdAccountId(thirdAccount,name));
                }
            } else if (number.startsWith("+99")){
                // A SIP number is used to join the meeting.
                attendeeList.add(AttendeeModel.buildAttendeeBySipNumber(number, name));
            } else {
                // A mobile number or a fixed-line phone number is used to join the meeting.
                attendeeList.add(AttendeeModel.buildAttendeeByPhone(number, name));
            }

}

EditConfParam editConfParam = new EditConfParam()
		.setConfId(this.confDetailModel.getConfId())
		.setVmrIdFlag(1 == this.confDetailModel.getVmrFlag())
		.setVmrId(this.confDetailModel.getVmrId())
		.setConfSubject(subject)
		.setStartTime(startTimeStamp)
		.setTimeZone(timeZone)
		.setDuration(timeDuration)
		.setConfType(confType)
		.setNeedConfPwd(!this.confDetailModel.getIsGuestFreePwd())
		.setJoinConfRestrictionType(permissionType)
		.setRecordOn(needRecord)
		.setMailOn(needEmail)
		.setSmsOn(needSms)
		.setEmailCalenderOn(needEmailCalendar)
		.setAttendees(attendeeInfos);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// Call the editConf API.
HWMBizSdk.getBizOpenApi().editConf(editConfParam, new HwmCallback<Integer>() {
	@Override
	public void onSuccess(Integer integer) {
		dismissLoading();
		DemoUtil.showToast("Meeting edited:" + integer);
	}

	@Override
	public void onFailed(int retCode, String desc) {
		dismissLoading();
		String err = ErrorMessageFactory.create(Utils.getApp(), retCode);
		if (TextUtils.isEmpty(err)) {
			err = Utils.getApp().getString(R.string.hwmconf_edit_failed);
		}
		DemoUtil.showToast("Failed to edit the meeting: " + retCode +", desc: "+ err);
	}
});