Skip to content

Commit cd90fda

Browse files
author
svuillet
committed
feature #14220
1 parent 1a58810 commit cd90fda

File tree

15 files changed

+439
-4
lines changed

15 files changed

+439
-4
lines changed

mobile-configuration/src/main/config/properties/org/silverpeas/mobile/mobileSettings.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ spacehomepage.lastEvents.order=
8080
spacehomepage.freeZoneThinSection.order=
8181

8282
# Apps display
83-
apps.supported=gallery, kmelia, quickinfo, webPages, blog, hyperlink, almanach, userCalendar, formsOnline, classifieds, survey, questionReply, pollingStation, resourcesManager
83+
apps.supported=gallery, kmelia, quickinfo, webPages, blog, hyperlink, almanach, userCalendar, formsOnline, classifieds, survey, questionReply, pollingStation, resourcesManager, orgchartGroup
8484
apps.exclude.intances=
8585

8686
##

mobile-war/src/main/java/org/silverpeas/mobile/client/SpMobil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import org.silverpeas.mobile.client.apps.navigation.events.pages.HomePageLoadedEvent;
5656
import org.silverpeas.mobile.client.apps.news.NewsApp;
5757
import org.silverpeas.mobile.client.apps.notificationsbox.NotificationsBoxApp;
58+
import org.silverpeas.mobile.client.apps.orgchartgroup.OrgChartGroupApp;
5859
import org.silverpeas.mobile.client.apps.resourcesManager.ResourcesManagerApp;
5960
import org.silverpeas.mobile.client.apps.sharesbox.SharesBoxApp;
6061
import org.silverpeas.mobile.client.apps.survey.SurveyApp;
@@ -233,6 +234,7 @@ public void onResize(final ResizeEvent resizeEvent) {
233234
apps.add(new SharesBoxApp());
234235
apps.add(new FaqApp());
235236
apps.add(new ResourcesManagerApp());
237+
apps.add(new OrgChartGroupApp());
236238
}
237239

238240
private static void checkVersion() {

mobile-war/src/main/java/org/silverpeas/mobile/client/apps/navigation/pages/widgets/NavigationItem.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public void setData(SilverpeasObjectDTO data) {
112112
} else if (type.equalsIgnoreCase(Apps.resourcesManager.name())) {
113113
setStyleName("app-resourcesManager");
114114
icon.setHTML(resources.bookonline().getText());
115+
} else if(type.equalsIgnoreCase(Apps.orgchartGroup.name())) {
116+
setStyleName("app-orgaChartGroup");
117+
icon.setHTML(resources.orgchartGroup().getText());
115118
}
116119
link.setStyleName("ui-btn ui-icon-carat-r");
117120
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package org.silverpeas.mobile.client.apps.orgchartgroup;
2+
3+
import com.google.gwt.core.client.GWT;
4+
import com.google.gwt.user.client.Window;
5+
import org.fusesource.restygwt.client.Method;
6+
import org.silverpeas.mobile.client.apps.navigation.events.app.external.AbstractNavigationEvent;
7+
import org.silverpeas.mobile.client.apps.navigation.events.app.external.NavigationAppInstanceChangedEvent;
8+
import org.silverpeas.mobile.client.apps.navigation.events.app.external.NavigationEventHandler;
9+
import org.silverpeas.mobile.client.apps.navigation.events.app.external.NavigationShowContentEvent;
10+
import org.silverpeas.mobile.client.apps.orgchartgroup.pages.OrgChartGroupPage;
11+
import org.silverpeas.mobile.client.common.EventBus;
12+
import org.silverpeas.mobile.client.common.ServicesLocator;
13+
import org.silverpeas.mobile.client.common.app.App;
14+
import org.silverpeas.mobile.client.common.network.MethodCallbackOnlineOnly;
15+
import org.silverpeas.mobile.client.resources.ApplicationMessages;
16+
import org.silverpeas.mobile.shared.dto.ContentDTO;
17+
import org.silverpeas.mobile.shared.dto.navigation.Apps;
18+
import org.silverpeas.mobile.shared.dto.orgchart.GroupOrgChartDTO;
19+
20+
public class OrgChartGroupApp extends App implements NavigationEventHandler {
21+
22+
private ApplicationMessages msg;
23+
24+
public OrgChartGroupApp() {
25+
super();
26+
msg = GWT.create(ApplicationMessages.class);
27+
EventBus.getInstance().addHandler(AbstractNavigationEvent.TYPE, this);
28+
}
29+
30+
public void start() {
31+
// no "super.start(lauchingPage);" this apps is used in another apps
32+
}
33+
34+
@Override
35+
public void showContent(NavigationShowContentEvent event) {
36+
super.showContent(event);
37+
}
38+
39+
@Override
40+
public void startWithContent(ContentDTO content) {
41+
super.startWithContent(content);
42+
}
43+
44+
@Override
45+
public void stop() {
46+
// never stop
47+
}
48+
49+
@Override
50+
public void appInstanceChanged(NavigationAppInstanceChangedEvent event) {
51+
if (event.getInstance().getType().equals(Apps.orgchartGroup.name())) {
52+
setApplicationInstance(event.getInstance());
53+
54+
MethodCallbackOnlineOnly action = new MethodCallbackOnlineOnly<GroupOrgChartDTO>() {
55+
@Override
56+
public void attempt() {
57+
super.attempt();
58+
ServicesLocator.getServiceOrgChartGroup().getOrgChart(event.getInstance().getId(), this);
59+
}
60+
61+
@Override
62+
public void onSuccess(Method method, GroupOrgChartDTO groupOrgChartDTO) {
63+
super.onSuccess(method, groupOrgChartDTO);
64+
OrgChartGroupPage page = new OrgChartGroupPage();
65+
page.setApp(OrgChartGroupApp.this);
66+
page.setPageTitle(event.getInstance().getLabel());
67+
page.setData(groupOrgChartDTO);
68+
page.show();
69+
}
70+
};
71+
action.attempt();
72+
73+
74+
75+
76+
77+
}
78+
}
79+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (C) 2000 - 2024 Silverpeas
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as
6+
* published by the Free Software Foundation, either version 3 of the
7+
* License, or (at your option) any later version.
8+
*
9+
* As a special exception to the terms and conditions of version 3.0 of
10+
* the GPL, you may redistribute this Program in connection with Free/Libre
11+
* Open Source Software ("FLOSS") applications as described in Silverpeas's
12+
* FLOSS exception. You should have received a copy of the text describing
13+
* the FLOSS exception, and it is also available here:
14+
* "https://www.silverpeas.org/legal/floss_exception.html"
15+
*
16+
* This program is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU Affero General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU Affero General Public License
22+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23+
*/
24+
25+
package org.silverpeas.mobile.client.apps.orgchartgroup.pages;
26+
27+
import com.google.gwt.core.client.GWT;
28+
import com.google.gwt.uibinder.client.UiBinder;
29+
import com.google.gwt.uibinder.client.UiField;
30+
import com.google.gwt.user.client.ui.Widget;
31+
import org.silverpeas.mobile.client.components.UnorderedList;
32+
import org.silverpeas.mobile.client.components.base.PageContent;
33+
import org.silverpeas.mobile.client.resources.ApplicationMessages;
34+
import org.silverpeas.mobile.shared.dto.orgchart.GroupOrgChartDTO;
35+
36+
public class OrgChartGroupPage extends PageContent {
37+
38+
private static OrgChartGroupPageUiBinder uiBinder = GWT.create(OrgChartGroupPageUiBinder.class);
39+
40+
private GroupOrgChartDTO data;
41+
42+
@UiField(provided = true) protected ApplicationMessages msg = null;
43+
@UiField
44+
UnorderedList units;
45+
46+
public void setData(GroupOrgChartDTO groupOrgChartDTO) {
47+
this.data = groupOrgChartDTO;
48+
}
49+
50+
interface OrgChartGroupPageUiBinder extends UiBinder<Widget, OrgChartGroupPage> {
51+
}
52+
53+
public OrgChartGroupPage() {
54+
msg = GWT.create(ApplicationMessages.class);
55+
setPageTitle(msg.notifications());
56+
initWidget(uiBinder.createAndBindUi(this));
57+
}
58+
59+
@Override
60+
public void stop() {
61+
super.stop();
62+
63+
}
64+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--
2+
~ Copyright (C) 2000 - 2024 Silverpeas
3+
~
4+
~ This program is free software: you can redistribute it and/or modify
5+
~ it under the terms of the GNU Affero General Public License as
6+
~ published by the Free Software Foundation, either version 3 of the
7+
~ License, or (at your option) any later version.
8+
~
9+
~ As a special exception to the terms and conditions of version 3.0 of
10+
~ the GPL, you may redistribute this Program in connection with Free/Libre
11+
~ Open Source Software ("FLOSS") applications as described in Silverpeas's
12+
~ FLOSS exception. You should have received a copy of the text describing
13+
~ the FLOSS exception, and it is also available here:
14+
~ "https://www.silverpeas.org/legal/floss_exception.html"
15+
~
16+
~ This program is distributed in the hope that it will be useful,
17+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
~ GNU Affero General Public License for more details.
20+
~
21+
~ You should have received a copy of the GNU Affero General Public License
22+
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
23+
-->
24+
25+
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
26+
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
27+
xmlns:g="urn:import:com.google.gwt.user.client.ui"
28+
xmlns:base="urn:import:org.silverpeas.mobile.client.components.base"
29+
xmlns:components="urn:import:org.silverpeas.mobile.client.components">
30+
31+
<ui:with field='msg' type='org.silverpeas.mobile.client.resources.ApplicationMessages' />
32+
33+
<g:HTMLPanel ui:field="container" styleName="content ui-body-a orgchartgroup">
34+
<components:UnorderedList ui:field="units" stylePrimaryName="ui-listview ui-listview-inset ui-corner-all ui-shadow units"></components:UnorderedList>
35+
</g:HTMLPanel>
36+
</ui:UiBinder>

mobile-war/src/main/java/org/silverpeas/mobile/client/common/ServicesLocator.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
package org.silverpeas.mobile.client.common;
2626

2727
import com.google.gwt.core.client.GWT;
28-
import com.google.gwt.user.client.rpc.ServiceDefTarget;
2928
import org.fusesource.restygwt.client.Defaults;
3029
import org.silverpeas.mobile.client.common.network.RestAuthenticationDispatcher;
3130
import org.silverpeas.mobile.client.common.network.RestDispatcher;
@@ -71,6 +70,7 @@ public class ServicesLocator {
7170
private static ServiceTermsOfService serviceTermsOfService = GWT.create(ServiceTermsOfService.class);
7271

7372
private static ServiceResourcesManager serviceResourcesManager = GWT.create(ServiceResourcesManager.class);
73+
private static ServiceOrgChartGroup serviceOrgChartGroup = GWT.create(ServiceOrgChartGroup.class);
7474

7575
private static void initRestContext() {
7676
Defaults.getServiceRoot().equals("/silverpeas/services");
@@ -225,4 +225,9 @@ public static ServiceContact getServiceContact() {
225225
return serviceContact;
226226
}
227227

228+
public static ServiceOrgChartGroup getServiceOrgChartGroup() {
229+
initRestContext();
230+
return serviceOrgChartGroup;
231+
}
232+
228233
}

mobile-war/src/main/java/org/silverpeas/mobile/client/resources/ApplicationResources.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.gwt.resources.client.DataResource;
2929
import com.google.gwt.resources.client.ImageResource;
3030
import com.google.gwt.resources.client.TextResource;
31+
import org.silverpeas.mobile.shared.dto.ShortCutLinkDTO;
3132

3233
/**
3334
* @author: svu
@@ -194,5 +195,9 @@ public interface ApplicationResources extends ClientBundle {
194195
@Source("icons/menu/search.svg")
195196
@DataResource.MimeType("image/svg+xml")
196197
TextResource search();
198+
199+
@Source("icons/apps/orgchartgroup.svg")
200+
@DataResource.MimeType("image/svg+xml")
201+
TextResource orgchartGroup();
197202
}
198203

Lines changed: 1 addition & 0 deletions
Loading

mobile-war/src/main/java/org/silverpeas/mobile/public/spmobile.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,8 @@ html .ui-controlgroup-controls .ui-btn-up-c {
866866
}
867867

868868
.folder-ged a, .folder-galery a, .publication a, .media a, .trash a, .app-actuality a, .app-ged a, .app-medialib a,
869-
.publication.ui-input-text, .app-blog a, .app-pageWeb a, .app-workflow a, .app-link a, .app-almanach a, .app-formsOnline a, .app-classifieds a, .app-survey a, .app-faq a, .app-polling a, .app-resourcesManager a {
869+
.publication.ui-input-text, .app-blog a, .app-pageWeb a, .app-workflow a, .app-link a, .app-almanach a, .app-formsOnline a, .app-classifieds a, .app-survey a, .app-faq a, .app-polling a,
870+
.app-resourcesManager a, .app-orgaChartGroup a {
870871
padding-left: 2.5em;
871872
}
872873

@@ -952,6 +953,10 @@ html .ui-controlgroup-controls .ui-btn-up-c {
952953

953954
}
954955

956+
.app-orgaChartGroup a {
957+
958+
}
959+
955960
ul>.folder-galery {
956961
display: flex;
957962
align-items: center !important;

0 commit comments

Comments
 (0)