-
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.
feat: Added Four Events - Meeds-io/MIPs#121 (#2)
These events were added stringCommentCreated, suggestionAdded, suggestionApproved, approveSuggestion
- Loading branch information
1 parent
dd7335d
commit 410dae9
Showing
26 changed files
with
511 additions
and
424 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
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,38 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2023 Meeds Lab [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; | ||
} |
27 changes: 27 additions & 0 deletions
27
...-services/src/main/java/io/meeds/gamification/crowdin/plugin/SuggestionTriggerPlugin.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 @@ | ||
package io.meeds.gamification.crowdin.plugin; | ||
|
||
import io.meeds.gamification.model.EventDTO; | ||
import io.meeds.gamification.service.EventRegistry; | ||
import jakarta.annotation.PostConstruct; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.exoplatform.container.component.BaseComponentPlugin; | ||
import org.exoplatform.services.log.ExoLogger; | ||
import org.exoplatform.services.log.Log; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@Component | ||
public class SuggestionTriggerPlugin extends BaseComponentPlugin { | ||
|
||
private static final Log LOG = ExoLogger.getLogger(SuggestionTriggerPlugin.class); | ||
|
||
protected String EVENT_TITLE = "suggestionAdded"; | ||
protected String EVENT_TYPE = "crowdin"; | ||
protected String EVENT_TRIGGER = "suggestion.added"; | ||
protected List<String> EVENT_CANCELLER_EVENTS = Collections.singletonList("suggestionDeleted"); | ||
|
||
|
||
} |
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
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
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
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
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
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
149 changes: 149 additions & 0 deletions
149
...-services/src/main/resources/conf/portal/gamification-crowdin-connector-configuration.xml
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,149 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
This file is part of the Meeds project (https://meeds.io/). | ||
Copyright (C) 2023 Meeds Lab [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. | ||
--> | ||
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd" | ||
xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"> | ||
|
||
<external-component-plugins> | ||
<target-component>io.meeds.gamification.service.EventRegistry</target-component> | ||
<component-plugin> | ||
<name>StringCommentCreated</name> | ||
<set-method>addPlugin</set-method> | ||
<type>io.meeds.gamification.plugin.EventConfigPlugin</type> | ||
<init-params> | ||
<object-param> | ||
<name>event</name> | ||
<object type="io.meeds.gamification.model.EventDTO"> | ||
<field name="title"> | ||
<string>stringCommentCreated</string> | ||
</field> | ||
<field name="type"> | ||
<string>crowdin</string> | ||
</field> | ||
<field name="trigger"> | ||
<string>stringComment.created</string> | ||
</field> | ||
<field name="cancellerEvents"> | ||
<collection type="java.util.ArrayList" item-type="java.lang.String"> | ||
<value> | ||
<string>stringCommentDeleted</string> | ||
</value> | ||
</collection> | ||
</field> | ||
</object> | ||
</object-param> | ||
</init-params> | ||
</component-plugin> | ||
</external-component-plugins> | ||
<external-component-plugins> | ||
<target-component>io.meeds.gamification.service.EventRegistry</target-component> | ||
<component-plugin> | ||
<name>SuggestionAdded</name> | ||
<set-method>addPlugin</set-method> | ||
<type>io.meeds.gamification.plugin.EventConfigPlugin</type> | ||
<init-params> | ||
<object-param> | ||
<name>event</name> | ||
<object type="io.meeds.gamification.model.EventDTO"> | ||
<field name="title"> | ||
<string>suggestionAdded</string> | ||
</field> | ||
<field name="type"> | ||
<string>crowdin</string> | ||
</field> | ||
<field name="trigger"> | ||
<string>suggestion.added</string> | ||
</field> | ||
<field name="cancellerEvents"> | ||
<collection type="java.util.ArrayList" item-type="java.lang.String"> | ||
<value> | ||
<string>suggestionDeleted</string> | ||
</value> | ||
</collection> | ||
</field> | ||
</object> | ||
</object-param> | ||
</init-params> | ||
</component-plugin> | ||
</external-component-plugins> | ||
<external-component-plugins> | ||
<target-component>io.meeds.gamification.service.EventRegistry</target-component> | ||
<component-plugin> | ||
<name>SuggestionApproved</name> | ||
<set-method>addPlugin</set-method> | ||
<type>io.meeds.gamification.plugin.EventConfigPlugin</type> | ||
<init-params> | ||
<object-param> | ||
<name>event</name> | ||
<object type="io.meeds.gamification.model.EventDTO"> | ||
<field name="title"> | ||
<string>suggestionApproved</string> | ||
</field> | ||
<field name="type"> | ||
<string>crowdin</string> | ||
</field> | ||
<field name="trigger"> | ||
<string>suggestion.approved</string> | ||
</field> | ||
<field name="cancellerEvents"> | ||
<collection type="java.util.ArrayList" item-type="java.lang.String"> | ||
<value> | ||
<string>suggestionDisapproved</string> | ||
</value> | ||
</collection> | ||
</field> | ||
</object> | ||
</object-param> | ||
</init-params> | ||
</component-plugin> | ||
</external-component-plugins> | ||
<external-component-plugins> | ||
<target-component>io.meeds.gamification.service.EventRegistry</target-component> | ||
<component-plugin> | ||
<name>ApproveSuggestion</name> | ||
<set-method>addPlugin</set-method> | ||
<type>io.meeds.gamification.plugin.EventConfigPlugin</type> | ||
<init-params> | ||
<object-param> | ||
<name>event</name> | ||
<object type="io.meeds.gamification.model.EventDTO"> | ||
<field name="title"> | ||
<string>approveSuggestion</string> | ||
</field> | ||
<field name="type"> | ||
<string>crowdin</string> | ||
</field> | ||
<field name="trigger"> | ||
<string>approve.suggestion</string> | ||
</field> | ||
<field name="cancellerEvents"> | ||
<collection type="java.util.ArrayList" item-type="java.lang.String"> | ||
<value> | ||
<string>suggestionDisapproved</string> | ||
</value> | ||
</collection> | ||
</field> | ||
</object> | ||
</object-param> | ||
</init-params> | ||
</component-plugin> | ||
</external-component-plugins> | ||
</configuration> |
Oops, something went wrong.