Commit bc6f10bf authored by sunye's avatar sunye
Browse files

Projet 2020 initial commit

parent e5ca28d0
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
# IDE
.classpath
.project
.idea
*.iml
# MacOS
.java-version
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.alma</groupId>
<artifactId>GTDServer</artifactId>
<version>1.0</version>
</parent>
<groupId>fr.alma</groupId>
<artifactId>GTDServerGUI</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>GTD-Server-GUI</name>
<scm>
<connection>scm:svn:http://serveurgtd.googlecode.com/svn/trunk/</connection>
<developerConnection>scm:svn:https://serveurgtd.googlecode.com/svn/trunk/</developerConnection>
<url>http://code.google.com/p/serveurgtd/</url>
</scm>
<dependencies>
<dependency>
<groupId>com.extjs</groupId>
<artifactId>gxt</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.8.2</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='ihmgtd'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.extjs.gxt.ui.GXT'/>
<inherits name="com.extjs.gxt.charts.Chart"/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='fr.alma.client.IHMGtd'/>
</module>
package fr.alma.client;
import java.util.List;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.HistoryListener;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import fr.alma.client.model.Error;
import fr.alma.client.model.Idee;
import fr.alma.client.model.PieChartData;
import fr.alma.client.model.Projet;
import fr.alma.client.model.ServerData;
import fr.alma.client.model.Stock;
import fr.alma.client.model.Tache;
import fr.alma.client.page.ConnexionErrorPage;
import fr.alma.client.page.ConnexionPage;
import fr.alma.client.page.FAQPage;
import fr.alma.client.page.GeneralHistoriquePage;
import fr.alma.client.page.IdeeHistoriquePage;
import fr.alma.client.page.IdeeStatistiquePage;
import fr.alma.client.page.ProjetHistoriquePage;
import fr.alma.client.page.ProjetStatistiquePage;
import fr.alma.client.page.TacheHistoriquePage;
import fr.alma.client.page.TacheStatistiquePage;
import fr.alma.client.page.UtilisateurStatistiquePage;
import fr.alma.client.service.LoadDataService;
import fr.alma.client.service.LoadDataServiceAsync;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
@SuppressWarnings("deprecation")
public class IHMGtd implements EntryPoint, HistoryListener {
private LoadDataServiceAsync stockDataService = GWT
.create(LoadDataService.class);
/**
* This is the entry point method.
*/
public void onModuleLoad() {
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new ConnexionPage());
History.addHistoryListener(this);
}
public void onHistoryChanged(String historyToken) {
int numPage = Integer.parseInt(historyToken);
switch (numPage) {
case -1 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new ConnexionErrorPage());
break;
case 0 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new ConnexionErrorPage());
break;
case 1 :
stockDataService.getStocks(new AsyncCallback<List<Stock>>() {
@Override
public void onSuccess(List<Stock> result) {
//Ajoute le portail IHM à la page
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new GeneralHistoriquePage(result)));
}
@Override
public void onFailure(Throwable caught) {
Error.showLoadError();
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
case 2 :
stockDataService.getIdee(new AsyncCallback<List<Idee>>() {
@Override
public void onSuccess(List<Idee> result) {
//Ajoute le portail IHM à la page
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new IdeeHistoriquePage(result)));
}
@Override
public void onFailure(Throwable caught) {
MessageBox.alert("Erreur", "Impossible de récupérer vos données", null);
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
case 3 :
stockDataService.getTache(new AsyncCallback<List<Tache>>() {
@Override
public void onSuccess(List<Tache> result) {
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new TacheHistoriquePage(result)));
}
@Override
public void onFailure(Throwable caught) {
Error.showLoadError();
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
case 4 :
stockDataService.getProjet(new AsyncCallback<List<Projet>>() {
@Override
public void onSuccess(List<Projet> result) {
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new ProjetHistoriquePage(result)));
}
@Override
public void onFailure(Throwable caught) {
Error.showLoadError();
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
case 5 :
stockDataService.getUserStats(new AsyncCallback<List<PieChartData>>() {
@Override
public void onSuccess(List<PieChartData> result) {
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new UtilisateurStatistiquePage(result)));
}
@Override
public void onFailure(Throwable caught) {
Error.showLoadError();
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
case 6 :
stockDataService.getIdeeStats(new AsyncCallback<List<Integer>>() {
@Override
public void onSuccess(List<Integer> result) {
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new IdeeStatistiquePage(result)));
}
@Override
public void onFailure(Throwable caught) {
Error.showLoadError();
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
case 7 :
stockDataService.getTacheStats(new AsyncCallback<List<Integer>>() {
@Override
public void onFailure(Throwable caught) {
Error.showLoadError();
}
@Override
public void onSuccess(List<Integer> result) {
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new TacheStatistiquePage(result)));
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
case 8 :
stockDataService.getProjetStats(new AsyncCallback<List<Integer>>() {
@Override
public void onSuccess(List<Integer> result) {
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new ProjetStatistiquePage(result)));
}
@Override
public void onFailure(Throwable caught) {
Error.showLoadError();
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
case 9 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("900px");
RootPanel.get("portalIHM").add(new PortalIHM(new FAQPage()));
break;
case 98 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new GeneralHistoriquePage(ServerData.getSeekStocks())));
break;
case 99 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new GeneralHistoriquePage(ServerData.getSeekStocks())));
break;
case 100 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new IdeeHistoriquePage(ServerData.getDataIdee())));
break;
case 101 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new IdeeHistoriquePage(ServerData.getDataIdee())));
break;
case 102 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new TacheHistoriquePage(ServerData.getDataTache())));
break;
case 103 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new TacheHistoriquePage(ServerData.getDataTache())));
break;
case 104 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new ProjetHistoriquePage(ServerData.getDataProjet())));
break;
case 105 :
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new ProjetHistoriquePage(ServerData.getDataProjet())));
break;
default :
stockDataService.getStocks(new AsyncCallback<List<Stock>>() {
@Override
public void onSuccess(List<Stock> result) {
//Ajoute le portail IHM à la page
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new PortalIHM(new GeneralHistoriquePage(result)));
}
@Override
public void onFailure(Throwable caught) {
MessageBox.alert("Erreur", "Impossible de récupérer vos données", null);
}
});
//Chargement
RootPanel.get("portalIHM").clear();
RootPanel.get("portalIHM").setHeight("400px");
RootPanel.get("portalIHM").add(new HTML("Chargement..."));
break;
}
}
}
package fr.alma.client;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import fr.alma.client.model.IPageIHM;
import fr.alma.client.model.Navigation;
public class PortalIHM extends LayoutContainer {
private IPageIHM page;
public PortalIHM(IPageIHM page) {
this.page=page;
}
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
setLayout(new BorderLayout());
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 220, 0, 0);
westData.setMargins(new Margins(5, 0, 5, 5));
westData.setCollapsible(true);
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(5));
BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH);
northData.setSize(60);
northData.setMargins(new Margins(5));
add(new Navigation(), westData);
VerticalPanel vp = new VerticalPanel();
Button deco = new Button("Se déconnecter", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
History.newItem("0");
}
});
deco.setIconStyle("deco");
vp.add(deco);
vp.add(page.getRecherchePanel());
add(vp, northData);
add(page.getPortalPanel(), centerData);
}
public void setPage(IPageIHM pageIHM) {
this.page=pageIHM;
}
}
package fr.alma.client.model;
import java.util.ArrayList;
public class ChampComboBox {
public static ArrayList<String> getAvancements() {
ArrayList<String> avancements = new ArrayList<String>();
avancements.add("A faire");
avancements.add("En attente");
avancements.add("Delegue");
avancements.add("Termine");
return avancements;
}
}
package fr.alma.client.model;
import com.extjs.gxt.ui.client.widget.MessageBox;
public class Error {
public static void showLoadError() {
MessageBox.alert("Erreur", "Impossible de récupérer vos données", null);
}
public static void showSaveError() {
MessageBox.alert("Erreur", "Impossible de sauvegarder vos données", null);
}
public static void showConnectError() {
MessageBox.alert("Erreur", "Impossible de se connecter", null);
}
}
/*
* Ext GWT - Ext for GWT
* Copyright(c) 2007-2009, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
package fr.alma.client.model;
import com.google.gwt.user.client.Window;
public class Examples {
public static boolean isExplorer() {
String test = Window.Location.getPath();
if (test.indexOf("pages") != -1) {
return false;
}
return true;
}
public static final String SERVICE = "service";
public static final String FILE_SERVICE = "fileservice";
public static final String MODEL = "model";
}
\ No newline at end of file
package fr.alma.client.model;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.custom.Portal;
public interface IPageIHM {
public HorizontalPanel getRecherchePanel();
public Portal getPortalPanel();
}