-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Crowdin Connector - Meeds-io/MIPs#121 (#25)
- Loading branch information
Showing
73 changed files
with
6,575 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...fication-crowdin-services/src/main/java/io/meeds/gamification/crowdin/dao/WebHookDAO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.gamification.crowdin.dao; | ||
|
||
import io.meeds.gamification.crowdin.entity.WebhookEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface WebHookDAO extends JpaRepository<WebhookEntity, Long> { | ||
|
||
WebhookEntity findWebhookEntityByProjectId(long projectId); | ||
} |
75 changes: 75 additions & 0 deletions
75
...on-crowdin-services/src/main/java/io/meeds/gamification/crowdin/entity/WebhookEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.gamification.crowdin.entity; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Data; | ||
import org.exoplatform.commons.utils.StringListConverter; | ||
|
||
@Entity(name = "CrowdinWebhooks") | ||
@Table(name = "CROWDIN_WEBHOOKS") | ||
@Data | ||
public class WebhookEntity implements Serializable { | ||
|
||
private static final long serialVersionUID = 2607146513663056421L; | ||
|
||
@Id | ||
@SequenceGenerator(name = "SEQ_CROWDIN_WEBHOOKS_ID", sequenceName = "SEQ_CROWDIN_WEBHOOKS_ID", allocationSize = 1) | ||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_CROWDIN_WEBHOOKS_ID") | ||
@Column(name = "ID") | ||
private Long id; | ||
|
||
@Column(name = "WEBHOOK_ID") | ||
private Long webhookId; | ||
|
||
@Column(name = "PROJECT_ID", nullable = false) | ||
private Long projectId; | ||
|
||
@Column(name = "PROJECT_NAME", nullable = false) | ||
private String projectName; | ||
|
||
@Convert(converter = StringListConverter.class) | ||
@Column(name = "TRIGGERS", nullable = false) | ||
private List<String> triggers; | ||
|
||
@Column(name = "ENABLED", nullable = false) | ||
private Boolean enabled; | ||
|
||
@Column(name = "WATCHED_DATE", nullable = false) | ||
private Date watchedDate; | ||
|
||
@Column(name = "WATCHED_BY", nullable = false) | ||
private Long watchedBy; | ||
|
||
@Column(name = "UPDATED_DATE", nullable = false) | ||
private Date updatedDate; | ||
|
||
@Column(name = "REFRESH_DATE", nullable = false) | ||
private Date refreshDate; | ||
|
||
@Column(name = "SECRET", nullable = false) | ||
private String secret; | ||
|
||
@Column(name = "TOKEN", nullable = false) | ||
private String token; | ||
} |
32 changes: 32 additions & 0 deletions
32
...ces/src/main/java/io/meeds/gamification/crowdin/exception/CrowdinConnectionException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.gamification.crowdin.exception; | ||
|
||
public class CrowdinConnectionException extends Exception { | ||
|
||
private static final long serialVersionUID = -2437500058122638710L; | ||
|
||
public CrowdinConnectionException(String e) { | ||
super(e); | ||
} | ||
|
||
public CrowdinConnectionException(String message, Exception e) { | ||
super(message, e); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
gamification-crowdin-services/src/main/java/io/meeds/gamification/crowdin/model/Event.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.gamification.crowdin.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
public class Event { | ||
|
||
String name; | ||
|
||
String sender; | ||
|
||
String receiver; | ||
|
||
String objectId; | ||
|
||
String objectType; | ||
|
||
String projectId; | ||
|
||
String languageId; | ||
|
||
boolean mustBeHuman; | ||
|
||
String directoryId; | ||
|
||
boolean isCancelling; | ||
} |
35 changes: 35 additions & 0 deletions
35
...n-crowdin-services/src/main/java/io/meeds/gamification/crowdin/model/RemoteDirectory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.gamification.crowdin.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class RemoteDirectory { | ||
|
||
private long id; | ||
|
||
private long projectId; | ||
|
||
private String path; | ||
} |
33 changes: 33 additions & 0 deletions
33
...on-crowdin-services/src/main/java/io/meeds/gamification/crowdin/model/RemoteLanguage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.gamification.crowdin.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class RemoteLanguage { | ||
|
||
private String id; | ||
|
||
private String name; | ||
} |
48 changes: 48 additions & 0 deletions
48
...ion-crowdin-services/src/main/java/io/meeds/gamification/crowdin/model/RemoteProject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.gamification.crowdin.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class RemoteProject implements Cloneable { | ||
|
||
private long id; | ||
|
||
private String identifier; | ||
|
||
private String name; | ||
|
||
private String description; | ||
|
||
private String avatarUrl; | ||
|
||
private List<RemoteLanguage> languages; | ||
|
||
@Override | ||
public RemoteProject clone() { // NOSONAR | ||
return new RemoteProject(id, identifier, name, description, avatarUrl, languages); | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
gamification-crowdin-services/src/main/java/io/meeds/gamification/crowdin/model/WebHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.gamification.crowdin.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class WebHook implements Cloneable { | ||
|
||
private long id; | ||
|
||
private long webhookId; | ||
|
||
private long projectId; | ||
|
||
private String projectName; | ||
|
||
private List<String> triggers; | ||
|
||
private Boolean enabled; | ||
|
||
private String watchedDate; | ||
|
||
private String watchedBy; | ||
|
||
private String updatedDate; | ||
|
||
private String refreshDate; | ||
|
||
private String token; | ||
|
||
private String secret; | ||
|
||
public WebHook clone() { // NOSONAR | ||
return new WebHook(id, | ||
webhookId, | ||
projectId, | ||
projectName, | ||
triggers, | ||
enabled, | ||
watchedDate, | ||
watchedBy, | ||
updatedDate, | ||
refreshDate, | ||
token, | ||
secret); | ||
} | ||
|
||
} |
Oops, something went wrong.