'
- + t('invitation', 'Your cloud ID: {cloudId}', { "cloudId": recipientCloudId }) + '
'
- + t('invitation', 'Your name: {name}', { "name": recipientName }) + '
'
- + t('invitation', 'Your email: {email}', { "email": recipientEmail }) + '
'
+ + t('collaboration', 'Your cloud ID: {cloudId}', { "cloudId": recipientCloudId }) + '
'
+ + t('collaboration', 'Your name: {name}', { "name": recipientName }) + '
'
+ + t('collaboration', 'Your email: {email}', { "email": recipientEmail }) + '
'
+ '
'
+ '
'
);
@@ -75,15 +75,15 @@
return acceptButton;
}
if (status === 'declined') {
- var declineButton = $('' + t('collaboration', invitation.sentReceived)
+ ' | ' + invitation.remoteUserName
+ ' | ' + invitation.remoteUserProviderName
+ ' | ' + invitation.remoteUserEmail
@@ -217,7 +217,7 @@
$('#invitation-message span.error').text("");
OC.dialogs.message(
'',
- t('invitation', 'confirmation-header'),
+ t('collaboration', 'confirmation-header'),
'',
OCdialogs.YES_BUTTON,
function () {
@@ -230,7 +230,7 @@
if ($('input[value="deploy_mode_test"]').size() === 1) {
$('#invitation-index-message span.message').html(
' '
- + ' ' + t('invitation', 'Your invitation has been sent to', { recipientName: result.data.recipientName, recipientEmail: result.data.email }) + ''
+ + ' ' + t('collaboration', 'Your invitation has been sent to', { recipientName: result.data.recipientName, recipientEmail: result.data.email }) + ''
+ ' '
+ ' '
);
@@ -238,7 +238,7 @@
} else {
$('#invitation-index-message span.message').html(
' '
- + ' ' + t('invitation', 'Your invitation has been sent to', { recipientName: result.data.recipientName, recipientEmail: result.data.email }) + ''
+ + '' + t('collaboration', 'Your invitation has been sent to', { recipientName: result.data.recipientName, recipientEmail: result.data.email }) + ''
+ ''
);
}
@@ -246,7 +246,7 @@
window.INVITATION.closeInvitationForm();
},
function (errorMessage) {
- $('#invitation-message span.error').append(' ' + t('invitation', errorMessage));
+ $('#invitation-message span.error').append(' ' + t('collaboration', errorMessage));
}
);
},
@@ -254,7 +254,7 @@
dialogClass
).done(() => { // this prevents the message dialog to remove the html present in the translation
$('.' + dialogClass).empty().append(
- t('invitation', 'confirmation', { "cloudId": cloudId, "name": yourName, "email": email })
+ t('collaboration', 'confirmation', { "cloudId": cloudId, "name": yourName, "email": email })
);
// to position the confirmation dialog overlay on top of the invitation form overlay
$('div.oc-dialog-dim:last').addClass('confirmation');
@@ -284,8 +284,8 @@
console.log(errorMessage);
}
v = [];
- status.forEach((e) => v.push(t('invitation', e.status)));
- $('#invitation-index-message span.error').append(' ' + t('invitation', 'GET_INVITATIONS_ERROR_UNSPECIFIED', { status: v.join() }) + ' ');
+ status.forEach((e) => v.push(t('collaboration', e.status)));
+ $('#invitation-index-message span.error').append(' ' + t('collaboration', 'GET_INVITATIONS_ERROR_UNSPECIFIED', { status: v.join() }) + ' ');
}
);
};
@@ -342,7 +342,7 @@
close: function () {
window.INVITATION.closeInvitationForm();
},
- title: t('invitation', 'Create Invitation')
+ title: t('collaboration', 'Create invitation to exchange cloud ID')
});
}
} else {
@@ -353,7 +353,7 @@
if ($('input[value="deploy_mode_test"]').size() === 1) {
console.log(response.toString());
}
- $('#invitation-error span').text(t('invitation', 'ERROR_UNSPECIFIED'));
+ $('#invitation-error span').text(t('collaboration', 'ERROR_UNSPECIFIED'));
}
);
}
@@ -363,6 +363,6 @@
window.INVITATION.listInvitations([{ "status": "open" }], window.INVITATION.renderOpenInvitations);
window.INVITATION.listInvitations([{ "status": "accepted" }], window.INVITATION.renderAcceptedInvitations);
- $(".information").html(t('invitation', 'explanation'));
+ $(".information").html(t('collaboration', 'explanation'));
});
})(window, jQuery);
\ No newline at end of file
diff --git a/js/settings.js b/js/settings.js
index 04857d4..4e5c287 100644
--- a/js/settings.js
+++ b/js/settings.js
@@ -21,11 +21,11 @@
if (result.success == true) {
console.log('allow sharing with invited users only updated to "' + result.data + '"');
} else {
- document.getElementById('allow-sharing-with-invited-users-only-error').innerText = t('invitation', result.error_message);
+ document.getElementById('allow-sharing-with-invited-users-only-error').innerText = t('collaboration', result.error_message);
}
},
(response) => {
- document.getElementById('allow-sharing-with-invited-users-only-error').innerText = t('invitation', 'SETTINGS_UPDATE_ERROR');
+ document.getElementById('allow-sharing-with-invited-users-only-error').innerText = t('collaboration', 'SETTINGS_UPDATE_ERROR');
console.log(response.toString());
}
)
@@ -56,20 +56,20 @@
$('[id="invitation-service-settings-success"]').text('saved');
$('[id="invitation-service-settings-success"]').addClass('fade-out');
} else {
- document.getElementById('invitation-service-settings-error').innerText = t('invitation', result.error_message);
+ document.getElementById('invitation-service-settings-error').innerText = t('collaboration', result.error_message);
}
},
(response) => {
- document.getElementById('invitation-service-settings-error').innerText = t('invitation', 'MESH_REGISTRY_UPDATE_PROVIDER_ERROR');
+ document.getElementById('invitation-service-settings-error').innerText = t('collaboration', 'MESH_REGISTRY_UPDATE_PROVIDER_ERROR');
console.log(response.toString());
}
)
} else {
if (_endpoint === "") {
- document.getElementById('invitation-service-settings-endpoint-error').innerText = t('invitation', 'MESH_REGISTRY_UPDATE_PROVIDER_REQUIRED_FIELD_ERROR');
+ document.getElementById('invitation-service-settings-endpoint-error').innerText = t('collaboration', 'MESH_REGISTRY_UPDATE_PROVIDER_REQUIRED_FIELD_ERROR');
}
if (_name === "") {
- document.getElementById('invitation-service-settings-name-error').innerText = t('invitation', "MESH_REGISTRY_UPDATE_PROVIDER_REQUIRED_FIELD_ERROR");
+ document.getElementById('invitation-service-settings-name-error').innerText = t('collaboration', "MESH_REGISTRY_UPDATE_PROVIDER_REQUIRED_FIELD_ERROR");
}
}
}
@@ -98,11 +98,11 @@
}
});
} else {
- document.getElementById('invitation-remote-service-providers-error').innerText = t('invitation', result.error_message);
+ document.getElementById('invitation-remote-service-providers-error').innerText = t('collaboration', result.error_message);
}
},
function (response) {
- document.getElementById('invitation-remote-service-providers-error').innerText = t('invitation', 'MESH_REGISTRY_GET_SERVICE_PROVIDERS_ERROR');
+ document.getElementById('invitation-remote-service-providers-error').innerText = t('collaboration', 'MESH_REGISTRY_GET_SERVICE_PROVIDERS_ERROR');
console.log(response.toString());
}
);
@@ -129,11 +129,11 @@
getAllProviders();
console.log('invitation service provider with endpoint ' + endpoint + ' deleted');
} else {
- errorElement.innerText = t('invitation', result.error_message);
+ errorElement.innerText = t('collaboration', result.error_message);
}
},
(response) => {
- errorElement.innerText = t('invitation', 'MESH_REGISTRY_DELETE_SERVICE_PROVIDER_ERROR');
+ errorElement.innerText = t('collaboration', 'MESH_REGISTRY_DELETE_SERVICE_PROVIDER_ERROR');
console.log(response.toString());
}
)
@@ -174,15 +174,15 @@
document.getElementById('invitation-add-remote-service-provider-endpoint').value = "";
getAllProviders();
} else {
- document.getElementById('invitation-remote-service-provider-save-error').innerText = t('invitation', result.error_message);
+ document.getElementById('invitation-remote-service-provider-save-error').innerText = t('collaboration', result.error_message);
}
},
(response) => {
console.log(response.toString());
if (response == "SETTINGS_ADD_PROVIDER_IS_NOT_REMOTE_ERROR") {
- document.getElementById('invitation-remote-service-provider-save-error').innerText = t('invitation', 'SETTINGS_ADD_PROVIDER_IS_NOT_REMOTE_ERROR');
+ document.getElementById('invitation-remote-service-provider-save-error').innerText = t('collaboration', 'SETTINGS_ADD_PROVIDER_IS_NOT_REMOTE_ERROR');
} else {
- document.getElementById('invitation-remote-service-provider-save-error').innerText = t('invitation', 'MESH_REGISTRY_ADD_PROVIDER_ERROR');
+ document.getElementById('invitation-remote-service-provider-save-error').innerText = t('collaboration', 'MESH_REGISTRY_ADD_PROVIDER_ERROR');
}
}
);
diff --git a/l10n/en.js b/l10n/en.js
index ac6c6c8..9352a6e 100644
--- a/l10n/en.js
+++ b/l10n/en.js
@@ -1,5 +1,5 @@
OC.L10N.register(
- "invitation",
+ "collaboration",
{
"ERROR_UNSPECIFIED": "An error has occurred. No further information available.",
"APPLICATION_CONFIGURATION_EXCEPTION": "An error has occurred. The application is not configured correctly.",
@@ -24,7 +24,7 @@ OC.L10N.register(
"confirmation": "Your cloud ID: {cloudId} Your email: {email} Your name: {name}
",
"sent": "Sent to",
"received": "Received from",
- "explanation": "Invite a remote user to exchange cloud ID's.If you want to share data with a Research Drive user from a different institute you need that person's cloud ID. You can obtain the cloud ID of the person you want to share with by sending a one time invitation. When this person accepts the invitation your cloud IDs will be exchanged and saved in each others Research Drive environment. From then on, when sharing, you can find that remote person by name, email or institute name.",
+ "explanation": "Collaborate with users between Research Drive environments.To share data with a Research Drive user from another institute, who is active on another Research Drive environment, you need the cloud ID of that user. With the cloud ID, you can immediately start sharing a folder or file between Research Drive environments. To simplify federated sharing, a one-time invitation allows you to request this remote user to exchange your cloud IDs. When that user accepts the invitation, the cloud IDs are automatically exchanged and stored. From then on, when sharing, you can find that remote person by name, email or institute name.
If you want to collaborate with an external user, you can invite them to a Research Drive account, go to Research Drive Dashboard.",
"MESH_REGISTRY_ADD_PROVIDER_ERROR": "An error has occurred. Could not add provider.",
"MESH_REGISTRY_UPDATE_PROVIDER_ERROR": "An error has occurred. Could not update provider.",
"SETTINGS_UPDATE_ERROR": "An error has occurred. Could not update this setting.",
diff --git a/l10n/nl.js b/l10n/nl.js
index dbb6777..8658ec0 100644
--- a/l10n/nl.js
+++ b/l10n/nl.js
@@ -1,7 +1,8 @@
OC.L10N.register(
- "invitation",
+ "collaboration",
{
- "Create Invitation": "Nieuwe Uitnodiging",
+ "Exchange cloud ID": "Cloud ID uitwisselen",
+ "Create invitation to exchange cloud ID":"Nieuwe uitnodiging voor het uitwisselen van cloud ID",
"ERROR_UNSPECIFIED": "Er is iets misgegaan. Geen verdere informatie beschikbaar.",
"APPLICATION_CONFIGURATION_EXCEPTION": "Er is iets misgegaan. De applicatie is incorrect geconfigureerd.",
"GET_INVITATIONS_ERROR_UNSPECIFIED": "Foutmelding: kon geen {status} uitnodigingen ophalen.",
@@ -32,7 +33,7 @@ OC.L10N.register(
"revoke": "intrekken",
"confirmation-header": "Let op, the volgende informatie zal worden gedeeld met de ontvanger van de uitnodiging:",
"confirmation": "Uw cloud ID: {cloudId} Uw email: {email} Uw naam: {name}
",
- "explanation": "Een remote gebruiker uitnodigen om cloud IDs uit te wisselen.Om data te kunnen delen met een Research Drive gebruiker van een ander instituut heeft u het cloud ID van die gebruiker nodig. U kunt middels een eenmalige uitnodiging deze remote gebruiker verzoeken uw cloud IDs uit te wisselen. Wanneer die gebruiker de uitnodiging accepteert worden de cloud IDs automatisch uitgewisseld en opgeslagen in de Research Drive omgeving. Vanaf dat moment kunt u bij het data delen elkaar vinden op basis van naam, email en naam van het instituut.",
+ "explanation": "Samenwerken met gebruikers tussen Research Drive omgevingen.Om data te kunnen delen met een Research Drive gebruiker van een ander instituut, die op een andere Research Drive omgeving actief is, heeft u het cloud ID van deze gebruiker nodig. Met het cloud id kunt u direct beginnen met het delen van bestand of map tussen Research Drive omgeving in. Om het gefedereerd delen te vereenvoudigen, kunt u middels een eenmalige uitnodiging deze remote gebruiker verzoeken de cloud IDs uit te wisselen. Wanneer die gebruiker de uitnodiging accepteert worden de cloud IDs automatisch uitgewisseld en opgeslagen. Vanaf dat moment kunt u bij het data delen elkaar direct vinden op basis van naam, email en naam van het instituut.
Wilt u samenwerken met een externe gebruiker, dan kunt u deze uitnodigen voor een Research Drive account, ga hiervoor naar het Research Drive Dashboard.",
"MESH_REGISTRY_ADD_PROVIDER_ERROR": "Er is iets misgegaan. Kan geen provider toevoegen.",
"MESH_REGISTRY_UPDATE_PROVIDER_ERROR": "Er is iets misgegaan. Kan provider niet aanpassen.",
"SETTINGS_UPDATE_ERROR": "An error has occurred. Kon deze setting niet updaten.",
diff --git a/l10n/nl.json b/l10n/nl.json
index 271fb0d..d080336 100644
--- a/l10n/nl.json
+++ b/l10n/nl.json
@@ -1,6 +1,6 @@
{
"translations": {
- "Create invitation": "Nieuwe Uitnodiging",
+ "Exchange cloud ID": "Cloud ID uitwisselen",
"Recipient email": "Email ontvanger",
"Recipient name": "Naam ontvanger",
"Invitation to": "Uitnodiging naar",
diff --git a/lib/AppInfo/AppError.php b/lib/AppInfo/AppError.php
index e1b1e3d..b7318d0 100644
--- a/lib/AppInfo/AppError.php
+++ b/lib/AppInfo/AppError.php
@@ -4,7 +4,7 @@
* Translatable errors that may be returned or used as exception messages.
*/
-namespace OCA\Invitation\AppInfo;
+namespace OCA\Collaboration\AppInfo;
class AppError
{
diff --git a/lib/AppInfo/InvitationApp.php b/lib/AppInfo/CollaborationApp.php
similarity index 80%
rename from lib/AppInfo/InvitationApp.php
rename to lib/AppInfo/CollaborationApp.php
index 071048f..3d47c12 100644
--- a/lib/AppInfo/InvitationApp.php
+++ b/lib/AppInfo/CollaborationApp.php
@@ -4,19 +4,19 @@
* Setup and wiring of the app.
*/
-namespace OCA\Invitation\AppInfo;
+namespace OCA\Collaboration\AppInfo;
-use OCA\Invitation\Federation\InvitationServiceProviderMapper;
-use OCA\Invitation\Federation\InvitationMapper;
-use OCA\Invitation\Service\InvitationNotifier;
-use OCA\Invitation\Service\InvitationService;
-use OCA\Invitation\Service\MeshRegistry\MeshRegistryService;
+use OCA\Collaboration\Federation\InvitationServiceProviderMapper;
+use OCA\Collaboration\Federation\InvitationMapper;
+use OCA\Collaboration\Service\InvitationNotifier;
+use OCA\Collaboration\Service\InvitationService;
+use OCA\Collaboration\Service\MeshRegistry\MeshRegistryService;
use OCP\AppFramework\App;
use OCP\IContainer;
-class InvitationApp extends App
+class CollaborationApp extends App
{
- public const APP_NAME = 'invitation';
+ public const APP_NAME = 'collaboration';
public const CONFIG_ALLOW_SHARING_WITH_INVITED_USERS_ONLY = 'allow_sharing_with_invited_users_only';
@@ -68,8 +68,8 @@ function () {
},
function () {
return [
- 'id' => 'invitation',
- 'name' => 'Invitation app'
+ 'id' => 'collaboration',
+ 'name' => 'Collaboration app'
];
}
);
diff --git a/lib/Controller/ErrorController.php b/lib/Controller/ErrorController.php
index b45199a..594e130 100644
--- a/lib/Controller/ErrorController.php
+++ b/lib/Controller/ErrorController.php
@@ -5,9 +5,9 @@
*
*/
-namespace OCA\Invitation\Controller;
+namespace OCA\Collaboration\Controller;
-use OCA\Invitation\AppInfo\InvitationApp;
+use OCA\Collaboration\AppInfo\CollaborationApp;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IRequest;
@@ -29,6 +29,6 @@ public function __construct($appName, IRequest $request)
*/
public function invitation(string $message, string $param1 = ""): TemplateResponse
{
- return new TemplateResponse(InvitationApp::APP_NAME, 'error', ['message' => $message, 'param1' => $param1]);
+ return new TemplateResponse(CollaborationApp::APP_NAME, 'error', ['message' => $message, 'param1' => $param1]);
}
}
diff --git a/lib/Controller/InvitationController.php b/lib/Controller/InvitationController.php
index a928cad..b718c1a 100644
--- a/lib/Controller/InvitationController.php
+++ b/lib/Controller/InvitationController.php
@@ -5,20 +5,20 @@
*
*/
-namespace OCA\Invitation\Controller;
+namespace OCA\Collaboration\Controller;
use DateTime;
use Exception;
-use OCA\Invitation\AppInfo\InvitationApp;
-use OCA\Invitation\AppInfo\AppError;
-use OCA\Invitation\Db\Schema;
-use OCA\Invitation\Federation\Invitation;
-use OCA\Invitation\HttpClient;
-use OCA\Invitation\Service\ApplicationConfigurationException;
-use OCA\Invitation\Service\InvitationService;
-use OCA\Invitation\Service\MeshRegistry\MeshRegistryService;
-use OCA\Invitation\Service\NotFoundException;
-use OCA\Invitation\Service\ServiceException;
+use OCA\Collaboration\AppInfo\CollaborationApp;
+use OCA\Collaboration\AppInfo\AppError;
+use OCA\Collaboration\Db\Schema;
+use OCA\Collaboration\Federation\Invitation;
+use OCA\Collaboration\HttpClient;
+use OCA\Collaboration\Service\ApplicationConfigurationException;
+use OCA\Collaboration\Service\InvitationService;
+use OCA\Collaboration\Service\MeshRegistry\MeshRegistryService;
+use OCA\Collaboration\Service\NotFoundException;
+use OCA\Collaboration\Service\ServiceException;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
@@ -84,7 +84,7 @@ public function invitation(string $token): DataResponse
$data["remoteUserProviderName"] = $this->meshRegistryService->getName();
$data["status"] = $invitation->getStatus();
} catch (NotFoundException $e) {
- $this->logger->debug($e->getMessage(), ["app" => InvitationApp::APP_NAME]);
+ $this->logger->debug($e->getMessage(), ["app" => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -93,7 +93,7 @@ public function invitation(string $token): DataResponse
Http::STATUS_NOT_FOUND
);
} catch (ServiceException $e) {
- $this->logger->debug($e->getMessage(), ["app" => InvitationApp::APP_NAME]);
+ $this->logger->debug($e->getMessage(), ["app" => CollaborationApp::APP_NAME]);
return new DataResponse(
[
"success" => false
@@ -101,7 +101,7 @@ public function invitation(string $token): DataResponse
Http::STATUS_NOT_FOUND
);
} catch (Exception $e) {
- $this->logger->error($e->getMessage(), ["app" => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage(), ["app" => CollaborationApp::APP_NAME]);
return new DataResponse(
[
"success" => false
@@ -130,8 +130,8 @@ public function invitationForm()
if (strtolower(\OC::$server->getUserSession()->getUser()->getUID()) === strtolower($displayName)) {
$displayName = '';
}
- $languageCode = \OC::$server->getL10NFactory()->findLanguage(InvitationApp::APP_NAME);
- $tmpl = new Template(InvitationApp::APP_NAME, "invitation.form", '', false, $languageCode);
+ $languageCode = \OC::$server->getL10NFactory()->findLanguage(CollaborationApp::APP_NAME);
+ $tmpl = new Template(CollaborationApp::APP_NAME, "invitation.form", '', false, $languageCode);
$tmpl->assign('senderName', $displayName);
$tmpl->assign('cloudID', \OC::$server->getUserSession()->getUser()->getCloudId());
return new DataResponse(
@@ -240,7 +240,7 @@ public function generateInvite(string $email = '', string $recipientName = '', s
$inviteLink = $this->meshRegistryService->inviteLink($params);
} catch (ApplicationConfigurationException $e) {
- $this->logger->error("An error has occurred: " . $e->getMessage() . " Stacktrace: " . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("An error has occurred: " . $e->getMessage() . " Stacktrace: " . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -249,7 +249,7 @@ public function generateInvite(string $email = '', string $recipientName = '', s
Http::STATUS_NOT_FOUND,
);
} catch (Exception $e) {
- $this->logger->error("An error has occurred: " . $e->getMessage() . " Stacktrace: " . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("An error has occurred: " . $e->getMessage() . " Stacktrace: " . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -274,7 +274,7 @@ public function generateInvite(string $email = '', string $recipientName = '', s
try {
$mailer = \OC::$server->getMailer();
$mail = $mailer->createMessage();
- $mail->setSubject($this->il10n->t(InvitationApp::INVITATION_EMAIL_SUBJECT));
+ $mail->setSubject($this->il10n->t(CollaborationApp::INVITATION_EMAIL_SUBJECT));
$mail->setFrom([$this->getEmailFromAddress('invitation-no-reply')]);
$mail->setTo(array($email => $email));
$language = 'en'; // actually not used, the email itself is multi language
@@ -284,10 +284,10 @@ public function generateInvite(string $email = '', string $recipientName = '', s
$mail->setPlainBody($plainText);
$failedRecipients = $mailer->send($mail);
if (sizeof($failedRecipients) > 0) {
- $this->logger->error(' - failed recipients: ' . print_r($failedRecipients, true), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error(' - failed recipients: ' . print_r($failedRecipients, true), ['app' => CollaborationApp::APP_NAME]);
}
} catch (Exception $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
// TODO Instead of failing, we could continue and still insert and display the invitation as failed in the list
// this would probably work best with a modify and resend option
@@ -299,7 +299,7 @@ public function generateInvite(string $email = '', string $recipientName = '', s
try {
$newInvitation = $this->invitationService->insert($invitation);
} catch (Exception $e) {
- $this->logger->error('An error occurred while generating the invite: ' . $e->getMessage(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('An error occurred while generating the invite: ' . $e->getMessage(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -354,7 +354,7 @@ private function getEmailFromAddress(string $address = null)
*/
private function getMailBody(string $inviteLink, string $recipientName, string $message, string $targetTemplate = 'html', string $languageCode = '')
{
- $tmpl = new Template('invitation', "mail/$targetTemplate", '', false, $languageCode);
+ $tmpl = new Template('collaboration', "mail/$targetTemplate", '', false, $languageCode);
$tmpl->assign('recipientName', $recipientName);
$tmpl->assign('fromName', \OC::$server->getUserSession()->getUser()->getDisplayName());
$tmpl->assign('inviteLink', $inviteLink);
@@ -377,17 +377,17 @@ public function handleInvite(string $token = '', string $providerEndpoint = ''):
$urlGenerator = \OC::$server->getURLGenerator();
if ($token == '') {
- \OC::$server->getLogger()->error('Invite is missing the token.', ['app' => InvitationApp::APP_NAME]);
- return new RedirectResponse($urlGenerator->linkToRoute(InvitationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
+ \OC::$server->getLogger()->error('Invite is missing the token.', ['app' => CollaborationApp::APP_NAME]);
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
}
if ($providerEndpoint == '') {
- \OC::$server->getLogger()->error('Invite is missing the invitation service provider endpoint.', ['app' => InvitationApp::APP_NAME]);
- return new RedirectResponse($urlGenerator->linkToRoute(InvitationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
+ \OC::$server->getLogger()->error('Invite is missing the invitation service provider endpoint.', ['app' => CollaborationApp::APP_NAME]);
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
}
if (!$this->meshRegistryService->isKnowInvitationServiceProvider($providerEndpoint)) {
- \OC::$server->getLogger()->error('Invitation service provider endpoint is unknown.', ['app' => InvitationApp::APP_NAME]);
- return new RedirectResponse($urlGenerator->linkToRoute(InvitationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
+ \OC::$server->getLogger()->error('Invitation service provider endpoint is unknown.', ['app' => CollaborationApp::APP_NAME]);
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
}
// check if invitation doesn't already exists
@@ -397,17 +397,17 @@ public function handleInvite(string $token = '', string $providerEndpoint = ''):
if ($invitation->getStatus() === Invitation::STATUS_OPEN) {
// redirect to the open invitation
- return new RedirectResponse($urlGenerator->linkToRoute('invitation.invitation.index'));
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.index'));
}
if ($invitation->getStatus() === Invitation::STATUS_ACCEPTED) {
- return new RedirectResponse($urlGenerator->linkToRoute(InvitationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ALREADY_ACCEPTED, 'param1' => $invitation->getSenderName()]));
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ALREADY_ACCEPTED, 'param1' => $invitation->getSenderName()]));
}
- return new RedirectResponse($urlGenerator->linkToRoute(InvitationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_EXISTS, 'param1' => $this->il10n->t($invitation->getStatus())]));
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_EXISTS, 'param1' => $this->il10n->t($invitation->getStatus())]));
} catch (NotFoundException $e) {
// we're good to go
} catch (Exception $e) {
- $this->logger->error($e->getMessage(), ['app' => InvitationApp::APP_NAME]);
- return new RedirectResponse($urlGenerator->linkToRoute(InvitationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
+ $this->logger->error($e->getMessage(), ['app' => CollaborationApp::APP_NAME]);
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
}
//retrieve the sender info
@@ -415,11 +415,11 @@ public function handleInvite(string $token = '', string $providerEndpoint = ''):
$httpClient = new HttpClient();
$response = $httpClient->curlGet($url);
if ($response['success'] == false) {
- $this->logger->error("Failed to retrieve the invitation with token $token from $providerEndpoint: " . print_r($response, true), ['app' => InvitationApp::APP_NAME]);
- $this->logger->error($e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("Failed to retrieve the invitation with token $token from $providerEndpoint: " . print_r($response, true), ['app' => CollaborationApp::APP_NAME]);
+ $this->logger->error($e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new RedirectResponse(
$urlGenerator->linkToRoute(
- InvitationApp::APP_NAME . '.error.invitation',
+ CollaborationApp::APP_NAME . '.error.invitation',
[
'message' => AppError::GET_INVITE_ERROR
]
@@ -431,10 +431,10 @@ public function handleInvite(string $token = '', string $providerEndpoint = ''):
$data['status'] !== Invitation::STATUS_OPEN
|| $data['token'] !== $token
) {
- $this->logger->error("Unable to handle invitation. /invite response from sender seems invalid. Response: " . print_r($response, true), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("Unable to handle invitation. /invite response from sender seems invalid. Response: " . print_r($response, true), ['app' => CollaborationApp::APP_NAME]);
return new RedirectResponse(
$urlGenerator->linkToRoute(
- InvitationApp::APP_NAME . '.error.invitation',
+ CollaborationApp::APP_NAME . '.error.invitation',
[
'message' => AppError::HANDLE_INVITATION_INVALID_INVITELINK
]
@@ -459,28 +459,28 @@ public function handleInvite(string $token = '', string $providerEndpoint = ''):
try {
$this->invitationService->insert($invitation);
} catch (Exception $e) {
- $this->logger->error($e->getMessage(), ['app' => InvitationApp::APP_NAME]);
- return new RedirectResponse($urlGenerator->linkToRoute(InvitationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
+ $this->logger->error($e->getMessage(), ['app' => CollaborationApp::APP_NAME]);
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.error.invitation', ['message' => AppError::HANDLE_INVITATION_ERROR]));
}
$manager = \OC::$server->getNotificationManager();
$notification = $manager->createNotification();
- $notification->setApp(InvitationApp::APP_NAME)
+ $notification->setApp(CollaborationApp::APP_NAME)
// the user that has received the invite is logged in at this point
->setUser(\OC::$server->getUserSession()->getUser()->getUID())
->setDateTime(new DateTime())
->setObject(MeshRegistryService::PARAM_NAME_TOKEN, $token)
- ->setSubject('invitation', [
+ ->setSubject('collaboration', [
MeshRegistryService::PARAM_NAME_TOKEN => $token,
MeshRegistryService::PARAM_NAME_PROVIDER_ENDPOINT => $providerEndpoint,
MeshRegistryService::PARAM_NAME_NAME => $senderName,
])
- ->setLink($urlGenerator->linkToRoute('invitation.invitation.index'));
+ ->setLink($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.invitation.index'));
$manager->notify($notification);
- return new RedirectResponse($urlGenerator->linkToRoute('invitation.invitation.index'));
+ return new RedirectResponse($urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.invitation.index'));
}
/**
@@ -497,7 +497,7 @@ public function acceptInvite(string $token = ''): DataResponse
{
try {
if ($token == '') {
- $this->logger->error('acceptInvite: missing parameter token.', ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('acceptInvite: missing parameter token.', ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
['success' => false, 'error_message' => AppError::REQUEST_MISSING_PARAMETER],
Http::STATUS_NOT_FOUND
@@ -508,7 +508,7 @@ public function acceptInvite(string $token = ''): DataResponse
try {
$invitation = $this->invitationService->findByToken($token);
} catch (NotFoundException $e) {
- $this->logger->error("acceptInvite: invitation not found for token '$token'", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("acceptInvite: invitation not found for token '$token'", ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
['success' => false, 'error_message' => AppError::INVITATION_NOT_FOUND],
Http::STATUS_NOT_FOUND
@@ -538,7 +538,7 @@ public function acceptInvite(string $token = ''): DataResponse
$response = $httpClient->curlPost($url, $params);
if (isset($response['success']) && $response['success'] == false) {
- $this->logger->error('Failed to accept the invitation: /invite-accepted failed with response: ' . print_r($response, true), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('Failed to accept the invitation: /invite-accepted failed with response: ' . print_r($response, true), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -549,7 +549,7 @@ public function acceptInvite(string $token = ''): DataResponse
}
// note: beware of the format of response of the OCM call, it has no 'data' field
if ($this->verifiedInviteAcceptedResponse($response) == false) {
- $this->logger->error('Failed to accept the invitation - returned fields not valid: ' . print_r($response, true), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('Failed to accept the invitation - returned fields not valid: ' . print_r($response, true), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -573,7 +573,7 @@ public function acceptInvite(string $token = ''): DataResponse
$existingInvitations = array_merge($existingInvitationsReceived, $existingInvitationsSent);
if (count($existingInvitations) > 0) {
foreach ($existingInvitations as $existingInvitation) {
- $this->logger->debug("A previous invitation for remote user with name " . $response[MeshRegistryService::PARAM_NAME_NAME] . " was accepted already. Withdrawing that one", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->debug("A previous invitation for remote user with name " . $response[MeshRegistryService::PARAM_NAME_NAME] . " was accepted already. Withdrawing that one", ['app' => CollaborationApp::APP_NAME]);
$updateResult = $this->invitationService->update([
Schema::INVITATION_TOKEN => $existingInvitation->getToken(),
Schema::INVITATION_STATUS => Invitation::STATUS_WITHDRAWN,
@@ -602,7 +602,7 @@ public function acceptInvite(string $token = ''): DataResponse
true
);
if ($updateResult == false) {
- $this->logger->error("Failed to handle /accept-invite (invitation with token '$token' could not be updated).", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("Failed to handle /accept-invite (invitation with token '$token' could not be updated).", ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -621,7 +621,7 @@ public function acceptInvite(string $token = ''): DataResponse
Http::STATUS_OK
);
} catch (Exception $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app]' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app]' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -725,7 +725,7 @@ public function declineInvite(string $token = ''): DataResponse
Http::STATUS_NOT_FOUND,
);
} catch (NotFoundException $e) {
- $this->logger->error("declineInvite: invitation not found for token '$token'", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("declineInvite: invitation not found for token '$token'", ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -734,7 +734,7 @@ public function declineInvite(string $token = ''): DataResponse
Http::STATUS_NOT_FOUND,
);
} catch (Exception $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app]' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app]' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -758,12 +758,12 @@ private function removeInvitationNotification(string $token): void
$manager = \OC::$server->getNotificationManager();
$notification = $manager->createNotification();
$notification
- ->setApp(InvitationApp::APP_NAME)
+ ->setApp(CollaborationApp::APP_NAME)
->setUser(\OC::$server->getUserSession()->getUser()->getUID())
->setObject(MeshRegistryService::PARAM_NAME_TOKEN, $token);
$manager->markProcessed($notification);
} catch (Exception $e) {
- $this->logger->error('Remove notification failed: ' . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('Remove notification failed: ' . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
throw $e;
}
}
@@ -798,7 +798,7 @@ private function verifiedInviteAcceptedResponse(array $response): bool
public function find(int $id = null): DataResponse
{
if (!isset($id)) {
- $this->logger->error("find() - missing parameter 'id'.", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("find() - missing parameter 'id'.", ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -816,7 +816,7 @@ public function find(int $id = null): DataResponse
]
);
} catch (NotFoundException $e) {
- $this->logger->error("invitation not found for id $id. Error: " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("invitation not found for id $id. Error: " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -828,7 +828,7 @@ public function find(int $id = null): DataResponse
}
/**
- * example url: https://rd-1.nl/apps/invitation/find-all-invitations?fields=[{"status":"open"},{"status":"accepted"}]
+ * example url: https://rd-1.nl/apps/collaboration/find-all-invitations?fields=[{"status":"open"},{"status":"accepted"}]
*
* @NoAdminRequired
* @NoCSRFRequired
@@ -836,7 +836,7 @@ public function find(int $id = null): DataResponse
public function findAll(string $fields = null): DataResponse
{
if (!isset($fields)) {
- $this->logger->error("findAll() - missing parameter 'fields'.", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("findAll() - missing parameter 'fields'.", ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -856,7 +856,7 @@ public function findAll(string $fields = null): DataResponse
Http::STATUS_OK
);
} catch (Exception $e) {
- $this->logger->error('invitations not found for fields: ' . print_r($fields, true) . 'Error: ' . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('invitations not found for fields: ' . print_r($fields, true) . 'Error: ' . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -874,7 +874,7 @@ public function findAll(string $fields = null): DataResponse
public function findByToken(string $token = null): DataResponse
{
if (!isset($token)) {
- $this->logger->error("findByToken() - missing parameter 'token'.", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("findByToken() - missing parameter 'token'.", ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -893,7 +893,7 @@ public function findByToken(string $token = null): DataResponse
Http::STATUS_OK,
);
} catch (NotFoundException $e) {
- $this->logger->error("invitation not found for token '$token'. Error: " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("invitation not found for token '$token'. Error: " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -902,7 +902,7 @@ public function findByToken(string $token = null): DataResponse
Http::STATUS_NOT_FOUND,
);
} catch (Exception $e) {
- $this->logger->error("invitation not found for token '$token'. Error: " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("invitation not found for token '$token'. Error: " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
diff --git a/lib/Controller/MeshRegistryController.php b/lib/Controller/MeshRegistryController.php
index 820fbd5..85b713a 100644
--- a/lib/Controller/MeshRegistryController.php
+++ b/lib/Controller/MeshRegistryController.php
@@ -5,18 +5,18 @@
*
*/
-namespace OCA\Invitation\Controller;
+namespace OCA\Collaboration\Controller;
use Exception;
-use OCA\Invitation\AppInfo\AppError;
-use OCA\Invitation\AppInfo\InvitationApp;
-use OCA\Invitation\Db\Schema;
-use OCA\Invitation\Federation\InvitationServiceProvider;
-use OCA\Invitation\HttpClient;
-use OCA\Invitation\Service\ApplicationConfigurationException;
-use OCA\Invitation\Service\MeshRegistry\MeshRegistryService;
-use OCA\Invitation\Service\NotFoundException;
-use OCA\Invitation\Service\ServiceException;
+use OCA\Collaboration\AppInfo\AppError;
+use OCA\Collaboration\AppInfo\CollaborationApp;
+use OCA\Collaboration\Db\Schema;
+use OCA\Collaboration\Federation\InvitationServiceProvider;
+use OCA\Collaboration\HttpClient;
+use OCA\Collaboration\Service\ApplicationConfigurationException;
+use OCA\Collaboration\Service\MeshRegistry\MeshRegistryService;
+use OCA\Collaboration\Service\NotFoundException;
+use OCA\Collaboration\Service\ServiceException;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
@@ -54,10 +54,10 @@ public function forwardInvite(string $token = '', string $providerEndpoint = '')
$urlGenerator = \OC::$server->getURLGenerator();
if ($token == '') {
- \OC::$server->getLogger()->error('Invite is missing the token.', ['app' => InvitationApp::APP_NAME]);
+ \OC::$server->getLogger()->error('Invite is missing the token.', ['app' => CollaborationApp::APP_NAME]);
return new RedirectResponse(
$urlGenerator->linkToRoute(
- InvitationApp::APP_NAME . '.error.invitation',
+ CollaborationApp::APP_NAME . '.error.invitation',
[
'message' => AppError::HANDLE_INVITATION_MISSING_TOKEN
]
@@ -65,10 +65,10 @@ public function forwardInvite(string $token = '', string $providerEndpoint = '')
);
}
if ($providerEndpoint == '') {
- \OC::$server->getLogger()->error('Invite is missing the invitation service provider endpoint.', ['app' => InvitationApp::APP_NAME]);
+ \OC::$server->getLogger()->error('Invite is missing the invitation service provider endpoint.', ['app' => CollaborationApp::APP_NAME]);
return new RedirectResponse(
$urlGenerator->linkToRoute(
- InvitationApp::APP_NAME . '.error.invitation',
+ CollaborationApp::APP_NAME . '.error.invitation',
[
'message' => AppError::HANDLE_INVITATION_MISSING_PROVIDER_ENDPOINT
]
@@ -76,10 +76,10 @@ public function forwardInvite(string $token = '', string $providerEndpoint = '')
);
}
if (!$this->meshRegistryService->isKnowInvitationServiceProvider($providerEndpoint)) {
- \OC::$server->getLogger()->error("Invitation service provider endpoint '$providerEndpoint' is unknown.", ['app' => InvitationApp::APP_NAME]);
+ \OC::$server->getLogger()->error("Invitation service provider endpoint '$providerEndpoint' is unknown.", ['app' => CollaborationApp::APP_NAME]);
return new RedirectResponse(
$urlGenerator->linkToRoute(
- InvitationApp::APP_NAME . '.error.invitation',
+ CollaborationApp::APP_NAME . '.error.invitation',
[
'message' => AppError::HANDLE_INVITATION_PROVIDER_UNKNOWN
]
@@ -116,7 +116,7 @@ public function invitationServiceProvider(): DataResponse
Http::STATUS_OK,
);
} catch (NotFoundException $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -153,7 +153,7 @@ public function updateInvitationServiceProvider(string $endpoint, string $name):
$httpClient = new HttpClient();
$response = $httpClient->curlGet($url);
if ($response['success'] == false) {
- $this->logger->error('Failed to call ' . MeshRegistryService::ENDPOINT_INVITATION_SERVICE_PROVIDER . " on endpoint '$endpoint'. Response: " . print_r($response, true), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('Failed to call ' . MeshRegistryService::ENDPOINT_INVITATION_SERVICE_PROVIDER . " on endpoint '$endpoint'. Response: " . print_r($response, true), ['app' => CollaborationApp::APP_NAME]);
throw new ServiceException("Failed to call endpoint '$endpoint'");
}
@@ -167,7 +167,7 @@ public function updateInvitationServiceProvider(string $endpoint, string $name):
Http::STATUS_OK,
);
} catch (Exception $e) {
- $this->logger->error($e->getMessage() . " Trace: " . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . " Trace: " . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -197,7 +197,7 @@ public function invitationServiceProviders(): DataResponse
Http::STATUS_OK,
);
} catch (ServiceException $e) {
- $this->logger->error($e, ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e, ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -256,7 +256,7 @@ public function addInvitationServiceProvider(string $endpoint): DataResponse
$httpClient = new HttpClient();
$response = $httpClient->curlGet($url);
if ($response['success'] == false) {
- $this->logger->error('Failed to call ' . MeshRegistryService::ENDPOINT_INVITATION_SERVICE_PROVIDER . " on endpoint '$endpoint'. Response: " . print_r($response, true), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('Failed to call ' . MeshRegistryService::ENDPOINT_INVITATION_SERVICE_PROVIDER . " on endpoint '$endpoint'. Response: " . print_r($response, true), ['app' => CollaborationApp::APP_NAME]);
throw new ServiceException("Failed to call endpoint '$endpoint'");
}
@@ -281,7 +281,7 @@ public function addInvitationServiceProvider(string $endpoint): DataResponse
throw new ServiceException(AppError::MESH_REGISTRY_ENDPOINT_INVITATION_SERVICE_PROVIDER_RESPONSE_INVALID);
} catch (ServiceException $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
// try to delete the previously inserted new provider
$this->meshRegistryService->deleteInvitationServiceProvider($endpoint);
return new DataResponse(
@@ -292,7 +292,7 @@ public function addInvitationServiceProvider(string $endpoint): DataResponse
Http::STATUS_NOT_FOUND,
);
} catch (Exception $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
// final effort trying to delete the previously inserted new provider
$this->meshRegistryService->deleteInvitationServiceProvider($endpoint);
return new DataResponse(
@@ -321,7 +321,7 @@ private function verifyInvitationServiceProviderResponse(array $params): bool
) {
return true;
}
- $this->logger->error('Could not validate the response fields. Fields: ' . print_r($params, true), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error('Could not validate the response fields. Fields: ' . print_r($params, true), ['app' => CollaborationApp::APP_NAME]);
return false;
}
@@ -344,7 +344,7 @@ public function deleteInvitationServiceProvider(string $endpoint): DataResponse
Http::STATUS_OK,
);
} catch (ServiceException $e) {
- $this->logger->error($e, ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e, ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -375,7 +375,7 @@ public function setAllowSharingWithInvitedUsersOnly(bool $allow): DataResponse
Http::STATUS_OK
);
} catch (Exception $e) {
- $this->logger->error("Unable to set 'allow_sharing_with_invited_users_only' config param. " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("Unable to set 'allow_sharing_with_invited_users_only' config param. " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -436,7 +436,7 @@ public function setEndpoint(string $endpoint): DataResponse
Http::STATUS_OK,
);
} catch (ServiceException $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -497,7 +497,7 @@ public function setName(string $name): DataResponse
Http::STATUS_OK,
);
} catch (ServiceException $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -527,7 +527,7 @@ public function getAllowSharingWithInvitedUsersOnly(): DataResponse
Http::STATUS_OK
);
} catch (Exception $e) {
- $this->logger->error("Unable to get 'allow_sharing_with_invited_users_only' config param. " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("Unable to get 'allow_sharing_with_invited_users_only' config param. " . $e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
diff --git a/lib/Controller/OcmController.php b/lib/Controller/OcmController.php
index 71ad67a..ddf8bb3 100644
--- a/lib/Controller/OcmController.php
+++ b/lib/Controller/OcmController.php
@@ -4,15 +4,15 @@
* OCM controller
*/
-namespace OCA\Invitation\Controller;
+namespace OCA\Collaboration\Controller;
-use OCA\Invitation\AppInfo\InvitationApp;
-use OCA\Invitation\AppInfo\AppError;
-use OCA\Invitation\Db\Schema;
-use OCA\Invitation\Federation\Invitation;
-use OCA\Invitation\Service\InvitationService;
-use OCA\Invitation\Service\NotFoundException;
-use OCA\Invitation\Service\ServiceException;
+use OCA\Collaboration\AppInfo\CollaborationApp;
+use OCA\Collaboration\AppInfo\AppError;
+use OCA\Collaboration\Db\Schema;
+use OCA\Collaboration\Federation\Invitation;
+use OCA\Collaboration\Service\InvitationService;
+use OCA\Collaboration\Service\NotFoundException;
+use OCA\Collaboration\Service\ServiceException;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
@@ -108,7 +108,7 @@ public function inviteAccepted(
try {
$invitation = $this->invitationService->findByToken($token, false);
} catch (NotFoundException $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -117,7 +117,7 @@ public function inviteAccepted(
Http::STATUS_NOT_FOUND
);
} catch (ServiceException $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
@@ -142,7 +142,7 @@ public function inviteAccepted(
$existingInvitations = array_merge($existingInvitationsSent, $existingInvitationsReceived);
if (count($existingInvitations) > 0) {
foreach ($existingInvitations as $existingInvitation) {
- $this->logger->debug("A previous established invitation relation exists. Withdrawing that one.", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->debug("A previous established invitation relation exists. Withdrawing that one.", ['app' => CollaborationApp::APP_NAME]);
$updateResult = $this->invitationService->update([
Schema::INVITATION_TOKEN => $existingInvitation->getToken(),
Schema::INVITATION_STATUS => Invitation::STATUS_WITHDRAWN,
@@ -169,7 +169,7 @@ public function inviteAccepted(
Schema::VINVITATION_STATUS => Invitation::STATUS_ACCEPTED,
], false);
if ($updateResult == false) {
- $this->logger->error("Update failed for invitation with token '$token'", ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error("Update failed for invitation with token '$token'", ['app' => CollaborationApp::APP_NAME]);
return new DataResponse(
[
'success' => false,
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
index e9860b6..6fa0813 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -4,13 +4,13 @@
* Page controller
*/
-namespace OCA\Invitation\Controller;
+namespace OCA\Collaboration\Controller;
use Exception;
-use OCA\Invitation\AppInfo\AppError;
-use OCA\Invitation\AppInfo\InvitationApp;
-use OCA\Invitation\Service\MeshRegistry\MeshRegistryService;
-use OCA\Invitation\Service\ServiceException;
+use OCA\Collaboration\AppInfo\AppError;
+use OCA\Collaboration\AppInfo\CollaborationApp;
+use OCA\Collaboration\Service\MeshRegistry\MeshRegistryService;
+use OCA\Collaboration\Service\ServiceException;
use OCP\AppFramework\Controller;
use OCP\ILogger;
use OCP\IRequest;
@@ -44,16 +44,16 @@ public function wayf(string $token, string $providerEndpoint): void
if (sizeof($wayfItems) == 0) {
throw new ServiceException(AppError::WAYF_NO_PROVIDERS_FOUND);
}
- $l = \OC::$server->getL10NFactory()->findLanguage(InvitationApp::APP_NAME);
- $tmpl = new Template('invitation', "wayf/wayf", '', false, $l);
+ $l = \OC::$server->getL10NFactory()->findLanguage(CollaborationApp::APP_NAME);
+ $tmpl = new Template('collaboration', "wayf/wayf", '', false, $l);
$tmpl->assign('wayfItems', $wayfItems);
echo $tmpl->fetchPage();
} catch (ServiceException $e) {
- $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => InvitationApp::APP_NAME]);
+ $this->logger->error($e->getMessage() . ' Trace: ' . $e->getTraceAsString(), ['app' => CollaborationApp::APP_NAME]);
$html = '' . $e->getMessage() . ' |