How to save user's absence information programmatically?
7 answers
I want to save user's absence information programmatically.
It seems to refer to IContributorAbsence , ContributorAbsence or
OutOfOfficeItem.
However, I don`t know how to use them. Could anyone professional help
me? :?:
You can create absences programatically similar to the following
snippet. Note that this is internal API and is subject to change at any
time without notice.
Timestamp startDate= null;
Timestamp endDate= null;
IContributor owner;
ITeamRepository teamRepository;
IResourcePlanningClient resourcePlanningClient=
(IResourcePlanningClient)
teamRepository.getClientLibrary(IResourcePlanningClient.class);
ContributorAbsence absence= (ContributorAbsence)
IContributorAbsence.ITEM_TYPE.createItem();
absence.setSummary("My Summary");
absence.setStartDate(startDate);
absence.setEndDate(endDate);
absence.setContributor(owner);
resourcePlanningClient.saveAbsences(new ContributorAbsence[] { absence
}, new SubProgressMonitor(monitor, 1));
--
MikeS
Jazz Agile Planning team
I have tried the snippet, but I met two problems. One is it can not find IResourcePlanningClient class, and the other is it seems that internal classes can not be accessed when it is compiled.
Could you explain it more in details? Thank you again.
You can create absences programatically similar to the following
snippet. Note that this is internal API and is subject to change at any
time without notice.
Timestamp startDate= null;
Timestamp endDate= null;
IContributor owner;
ITeamRepository teamRepository;
IResourcePlanningClient resourcePlanningClient=
(IResourcePlanningClient)
teamRepository.getClientLibrary(IResourcePlanningClient.class);
ContributorAbsence absence= (ContributorAbsence)
IContributorAbsence.ITEM_TYPE.createItem();
absence.setSummary("My Summary");
absence.setStartDate(startDate);
absence.setEndDate(endDate);
absence.setContributor(owner);
resourcePlanningClient.saveAbsences(new ContributorAbsence[] { absence
}, new SubProgressMonitor(monitor, 1));
--
MikeS
Jazz Agile Planning team
Could you explain it more in details? Thank you again.
I want to save user's absence information programmatically.
It seems to refer to IContributorAbsence , ContributorAbsence or
OutOfOfficeItem.
However, I don`t know how to use them. Could anyone professional help
me? :?:
You can create absences programatically similar to the following
snippet. Note that this is internal API and is subject to change at any
time without notice.
Timestamp startDate= null;
Timestamp endDate= null;
IContributor owner;
ITeamRepository teamRepository;
IResourcePlanningClient resourcePlanningClient=
(IResourcePlanningClient)
teamRepository.getClientLibrary(IResourcePlanningClient.class);
ContributorAbsence absence= (ContributorAbsence)
IContributorAbsence.ITEM_TYPE.createItem();
absence.setSummary("My Summary");
absence.setStartDate(startDate);
absence.setEndDate(endDate);
absence.setContributor(owner);
resourcePlanningClient.saveAbsences(new ContributorAbsence[] { absence
}, new SubProgressMonitor(monitor, 1));
--
MikeS
Jazz Agile Planning team
I have tried the snippet, but I met two problems. One is it can not
find IResourcePlanningClient class, and the other is it seems that
internal classes can not be accessed when it is compiled.
you need to add a dependency to the com.ibm.team.apt.client bundle.
because the API is internal and not exported, you must set the
respective compile problem as warning rather than error
--
MikeS
Jazz Agile Planning team
Hi Michael,
Does this solution is still valid for RTC 3.0?
Thanks,
Best Regards,
Dominique
You can create absences programatically similar to the following
snippet. Note that this is internal API and is subject to change at any
time without notice.
Timestamp startDate= null;
Timestamp endDate= null;
IContributor owner;
ITeamRepository teamRepository;
IResourcePlanningClient resourcePlanningClient=
(IResourcePlanningClient)
teamRepository.getClientLibrary(IResourcePlanningClient.class);
ContributorAbsence absence= (ContributorAbsence)
IContributorAbsence.ITEM_TYPE.createItem();
absence.setSummary("My Summary");
absence.setStartDate(startDate);
absence.setEndDate(endDate);
absence.setContributor(owner);
resourcePlanningClient.saveAbsences(new ContributorAbsence[] { absence
}, new SubProgressMonitor(monitor, 1));
--
MikeS
Jazz Agile Planning team
Does this solution is still valid for RTC 3.0?
Thanks,
Best Regards,
Dominique
I want to save user's absence information programmatically.
It seems to refer to IContributorAbsence , ContributorAbsence or
OutOfOfficeItem.
However, I don`t know how to use them. Could anyone professional help
me? :?:
You can create absences programatically similar to the following
snippet. Note that this is internal API and is subject to change at any
time without notice.
Timestamp startDate= null;
Timestamp endDate= null;
IContributor owner;
ITeamRepository teamRepository;
IResourcePlanningClient resourcePlanningClient=
(IResourcePlanningClient)
teamRepository.getClientLibrary(IResourcePlanningClient.class);
ContributorAbsence absence= (ContributorAbsence)
IContributorAbsence.ITEM_TYPE.createItem();
absence.setSummary("My Summary");
absence.setStartDate(startDate);
absence.setEndDate(endDate);
absence.setContributor(owner);
resourcePlanningClient.saveAbsences(new ContributorAbsence[] { absence
}, new SubProgressMonitor(monitor, 1));
--
MikeS
Jazz Agile Planning team