Skip to content
Snippets Groups Projects
Commit a2505931 authored by Alexander Niebisch's avatar Alexander Niebisch :coffee: Committed by Johannes Goderbauer
Browse files

[Projekt: Entwicklung - Infrastruktur][TicketNr.: 1051513][DominoRest -...

[Projekt: Entwicklung - Infrastruktur][TicketNr.: 1051513][DominoRest - Aufruffehler bei verschiedenen NoticeTypes]
parent 82979d7b
No related branches found
No related tags found
No related merge requests found
......@@ -242,6 +242,9 @@
<tooltip>New activity</tooltip>
<tooltipProcess>%aditoprj%/entity/Appointment_entity/entityfields/newactivity/tooltipProcess.js</tooltipProcess>
</entityActionField>
<entityField>
<name>STATUS_ACTION</name>
</entityField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......@@ -324,6 +327,9 @@
<jDitoRecordFieldMapping>
<name>MASTEREND.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>STATUS_ACTION.value</name>
</jDitoRecordFieldMapping>
</recordFieldMappings>
</jDitoRecordContainer>
</recordContainers>
......
......@@ -19,4 +19,5 @@ else
var currentAttendees = vars.get("$field.ATTENDEES");
var updatedAttendees = AppointmentUtils.setPartStat(currentUserUri, currentAttendees, newState);
neon.setFieldValue("$field.ATTENDEES", updatedAttendees);
neon.setFieldValue("$field.STATUS_ACTION", calendars.STATUS_ACCEPTED)
}
......@@ -19,4 +19,5 @@ else
var currentAttendees = vars.get("$field.ATTENDEES");
var updatedAttendees = AppointmentUtils.setPartStat(currentUserUri, currentAttendees, newState);
neon.setFieldValue("$field.ATTENDEES", updatedAttendees);
neon.setFieldValue("$field.STATUS_ACTION", calendars.STATUS_DECLINED);
}
......@@ -19,4 +19,5 @@ else
var currentAttendees = vars.get("$field.ATTENDEES");
var updatedAttendees = AppointmentUtils.setPartStat(currentUserUri, currentAttendees, newState);
neon.setFieldValue("$field.ATTENDEES", updatedAttendees);
neon.setFieldValue("$field.STATUS_ACTION", calendars.STATUS_TENTATIVE);
}
\ No newline at end of file
......@@ -119,6 +119,7 @@ function buildEntry(pEntry, pMasterentry)
recurrenceID,
null,
masterBegin,
masterEnd
masterEnd,
null
];
}
......@@ -59,6 +59,9 @@ if(event)
if(event[calendars.RRULE])
event[calendars.RRULE] = [fields["RRULE.value"]];
// Adds the required X-Header for status actions needed by Exchange and Domino
addStatusAction(event, fields);
calendars.updateEntry(event);
}
......@@ -90,4 +93,101 @@ function areEventAndFieldsDifferent(event){
}
return different;
}
/**
* Summary. Sets the "X-ADITO-STATUSACTION" - header which is needed for Exchange and Domino to process changes.
*
* Description. Checks if the backendType requires a special X-Header to handle certain updates. Currently
* only Domino (calendars.BACKEND_DOMINO_REST) and Exchange (calendars.BACKEND_EXCHANGEWS) require this header.
* <br/>
* The required status action needs to be stored in the entityField <tt>STATUS_ACTION</tt>
* in order to set the header correctly.
* <br/>
* The X-Header <tt>X-ADITO-STATUSACTION</tt> is an internal placeholder for setting
* the status action for certain calendar backends. The required value depends on the backend used.
* <br/>
* The X-Header is added to the given calender event.
*
*
* @param {JSON} pEvent the calendar event for the update
* @param {Array} pFields the current field values of the entity
*
* @see calendars.getBackendType
* @see _getExchangeStatusAction
* @see _getDominoStatusAction
*/
function addStatusAction (pEvent, pFields)
{
var statusAction = pFields["STATUS_ACTION.value"];
var backendType = calendars.getBackendType();
if(statusAction != null
&& ( backendType == calendars.BACKEND_EXCHANGEWS || backendType == calendars.BACKEND_DOMINO_REST ))
{
statusAction = statusAction.toUpperCase();
if(backendType == calendars.BACKEND_EXCHANGEWS)
{
statusAction = _getExchangeStatusAction(statusAction);
}
else if(backendType == calendars.BACKEND_DOMINO_REST)
{
statusAction = _getDominoStatusAction(statusAction);
}
if(statusAction != null)
pEvent["X-ADITO-STATUSACTION"] = statusAction;
}
}
/**
* Translates the given action into a status action for ExchangeWS.
*
* @param {String} pStatusAction the general Key for the status action
* @return {String} The specific value for the specified Exchange status action.
*/
function _getExchangeStatusAction(pStatusAction)
{
switch (pStatusAction)
{
case calendars.STATUS_ACCEPTED:
return "ACCEPT";
case calendars.STATUS_TENTATIVE:
return "TENTATIVELYACCEPT";
case calendars.STATUS_DECLINED:
return "DECLINE";
case calendars.STATUS_CANCELLED:
return "CANCEL_MEETING";
default:
return null;
}
}
/**
* Translates the given action into a status action for Domino.
*
* @param {String} pStatusAction the general Key for the status action
* @return {String} The specific value for the specified Domino status action.
*/
function _getDominoStatusAction(pStatusAction)
{
switch (pStatusAction)
{
case calendars.STATUS_ACCEPTED:
return "accept";
case calendars.STATUS_TENTATIVE:
return "tentative";
case calendars.STATUS_DECLINED:
return "decline";
case calendars.STATUS_CANCELLED:
return "cancel";
// Not needed.
// Entries are deleted using the system.calendars own delte method
//
// case "DELETED":
// return "delete";
default:
return null;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment