Skip to content

Commit

Permalink
feat: Configure automatic-translation navigation and pages for admini…
Browse files Browse the repository at this point in the history
…stration site - EXO-66546 - Meeds-io/MIPs#88 (#43)
  • Loading branch information
IlhemEssaadi authored Oct 12, 2023
1 parent 2c39bae commit faae69d
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 38 deletions.
3 changes: 2 additions & 1 deletion translations.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ baseDir=add-ons/automatic-translation/
automaticTranslationNavigation.properties=webapps/src/main/resources/locale/navigation/group/platform/administrators_en.properties
automaticTranslation.properties=webapps/src/main/resources/locale/portlet/automaticTranslation/automaticTranslationAdministration_en.properties
automaticTranslationExtension.properties=webapps/src/main/resources/locale/portlet/automaticTranslation/automaticTranslationExtension_en.properties
Analytics.properties=webapps/src/main/resources/locale/portlet/Analytics_en.properties
Analytics.properties=webapps/src/main/resources/locale/portlet/Analytics_en.properties
administration.properties=webapps/src/main/resources/locale/navigation/portal/administration_en.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (C) 2023 eXo Platform SAS.
#
# This 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 software 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 software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
#
portal.administration.home=Platform settings
portal.administration.applications=Applications
portal.administration.translation=Automatic translation

Original file line number Diff line number Diff line change
@@ -1,39 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_3.xsd http://www.exoplatform.org/xml/ns/kernel_1_3.xsd" xmlns="http://www.exoplatform.org/xml/ns/kernel_1_3.xsd">
<external-component-plugins>
<target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
<component-plugin>
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>This listener creates Automatic Translation Admin Pages</description>
<init-params>
<object-param>
<name>group.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>/platform/administrators</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>group</string>
</field>
<field name="override">
<boolean>${exo.automatic-translation.portalConfig.metadata.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.automatic-translation.portalConfig.metadata.importmode:merge}</string>
</field>
<field name="templateLocation">
<string>war:/conf/automatic-translation/portal</string>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
</external-component-plugins>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_3.xsd http://www.exoplatform.org/xml/ns/kernel_1_3.xsd"
xmlns="http://www.exoplatform.org/xml/ns/kernel_1_3.xsd">
<external-component-plugins>
<target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
<component-plugin>
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>This listener creates Automatic Translation Admin Pages</description>
<init-params>
<object-param>
<name>group.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>/platform/administrators</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>group</string>
</field>
<field name="override">
<boolean>${exo.automatic-translation.portalConfig.metadata.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.automatic-translation.portalConfig.metadata.importmode:merge}</string>
</field>
<field name="templateLocation">
<string>war:/conf/automatic-translation/portal</string>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
<component-plugin>
<name>new.portal.config.user.listener</name>
<set-method>initListener</set-method>
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
<description>this listener init the portal configuration</description>
<init-params>
<object-param>
<name>portal.configuration</name>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>administration</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>portal</string>
</field>
<field name="templateLocation">
<string>war:/conf/automatic-translation/portal</string>
</field>
<field name="override">
<boolean>${exo.automatic-translation.portalConfig.administration.override:true}</boolean>
</field>
<field name="importMode">
<string>${exo.automatic-translation.portalConfig.administration.importmode:merge}</string>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
</external-component-plugins>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
* Copyright (C) 2023 eXo Platform SAS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
-->
<node-navigation
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_6 http://www.gatein.org/xml/ns/gatein_objects_1_6"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_6">
<priority>3</priority>

<page-nodes>
<node>
<name>home</name>
<label>#{portal.administration.home}</label>
<icon>fas fa-cog</icon>
<node>
<name>applications</name>
<label>#{portal.administration.applications}</label>
<icon>fas fa-boxes</icon>
<node>
<name>translation</name>
<label>#{portal.administration.translation}</label>
<icon>fas fa-language</icon>
<page-reference>portal::administration::automatic-translation</page-reference>
</node>
</node>
</node>
</page-nodes>
</node-navigation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright (C) 2023 eXo Platform SAS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
-->
<page-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/gatein_objects_1_8 http://www.exoplatform.org/xml/ns/gatein_objects_1_8"
xmlns="http://www.exoplatform.org/xml/ns/gatein_objects_1_8">
<page>
<name>automatic-translation</name>
<title>Automatic Translation</title>
<access-permissions>*:/platform/administrators</access-permissions>
<edit-permission>manager:/platform/administrators</edit-permission>
<show-max-window>false</show-max-window>
<container id="singlePageApplicationContainer" template="system:/groovy/portal/webui/container/UIContainer.gtmpl" cssClass="singlePageApplication">
<portlet-application>
<portlet>
<application-ref>automatic-translation</application-ref>
<portlet-ref>automaticTranslationAdministration</portlet-ref>
</portlet>
<title>Automatic Translation</title>
<access-permissions>*:/platform/administrators</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
</container>
<container
id="topAnalyticsPage"
template="system:/groovy/portal/webui/container/UIContainer.gtmpl"
cssClass="singlePageApplication">
<access-permissions>Everyone</access-permissions>
<container cssClass="analyticsPageRow" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permissions>Everyone</access-permissions>
<portlet-application>
<portlet>
<application-ref>analytics</application-ref>
<portlet-ref>AnalyticsPortlet</portlet-ref>
<preferences>
<preference>
<name>settings</name>
<value>{
"offset": 0,
"filters": [
{
"valueString": "translate",
"field": "operation",
"type": "EQUAL",
"range": null
},
{
"valueString": "automatic-translation",
"field": "module",
"type": "EQUAL",
"range": null
}
],
"lang": null,
"aggregations": [
{
"field": "timestamp",
"type": "DATE",
"offset": null,
"interval": "month",
"useBounds": false,
"minBound": 0,
"maxBound": 0,
"sortDirection": "asc",
"limit": 0
},
{
"field": "messageLength",
"type": "SUM",
"offset": null,
"interval": null,
"useBounds": false,
"minBound": 0,
"maxBound": 0,
"sortDirection": "desc",
"limit": 0
}
],
"yAxisAggregation": {
"field": "messageLength",
"type": "SUM",
"offset": null,
"interval": null,
"useBounds": false,
"minBound": 0,
"maxBound": 0,
"sortDirection": "desc",
"limit": 0
},
"multipleChartsAggregation": null,
"xAxisAggregations": [
{
"field": "timestamp",
"type": "DATE",
"offset": null,
"interval": "month",
"useBounds": false,
"minBound": 0,
"maxBound": 0,
"sortDirection": "asc",
"limit": 0
}
],
"multipleCharts": false,
"chartType": "bar",
"colors": null,
"multipleChartsField": null,
"limit": 0,
"timeZone": null,
"title": "automatic.translation.analytics.title.charTranslated"
}
</value>
</preference>
</preferences>
</portlet>
<title>Characters Translated</title>
<access-permissions>Everyone</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
</container>
</container>
</page>
</page-set>

0 comments on commit faae69d

Please sign in to comment.