Author: glandais Date: 2007-12-26 16:30:43 +0000 (Wed, 26 Dec 2007) New Revision: 89 Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/TreeData.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/errors/ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java trunk/simexplorer-is-web/src/webcontent/WEB-INF/dwr.xml trunk/simexplorer-is-web/src/webcontent/index.html Modified: trunk/simexplorer-is-web/.classpath trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component trunk/simexplorer-is-web/pom.xml trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js Log: Upload et affichage des applications Modified: trunk/simexplorer-is-web/.classpath =================================================================== --- trunk/simexplorer-is-web/.classpath 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/.classpath 2007-12-26 16:30:43 UTC (rev 89) @@ -1,13 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="target/gen/java"/> + <classpathentry kind="src" path="src/ressources"/> <classpathentry kind="src" path="src/java"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"> - <attributes> - <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> - </attributes> - </classpathentry> <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-storage"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> <classpathentry kind="output" path="target/classes"/> </classpath> Modified: trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component =================================================================== --- trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2007-12-26 16:30:43 UTC (rev 89) @@ -4,6 +4,7 @@ <wb-resource deploy-path="/" source-path="/src/webcontent"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/gen/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/java"/> + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/ressources"/> <property name="context-root" value="simexplorer-is"/> <property name="java-output-path" value="build/classes"/> </wb-module> Modified: trunk/simexplorer-is-web/pom.xml =================================================================== --- trunk/simexplorer-is-web/pom.xml 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/pom.xml 2007-12-26 16:30:43 UTC (rev 89) @@ -152,5 +152,11 @@ <artifactId>rmiio</artifactId> <version>2.0.0</version> </dependency> + <dependency> + <groupId>org.directwebremoting</groupId> + <artifactId>dwr</artifactId> + <version>2.0.2</version> + <scope>compile</scope> + </dependency> </dependencies> </project> \ No newline at end of file Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java 2007-12-26 16:30:43 UTC (rev 89) @@ -1,33 +1,26 @@ package fr.cemagref.simexplorer.is.ui.web; -import javax.naming.Context; -import javax.naming.InitialContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; -import fr.cemagref.simexplorer.is.storage.service.StorageService; +import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory; public class ContextListener implements ServletContextListener { - StorageService serviceProjets = null; + public void contextDestroyed(ServletContextEvent arg0) { + try { + StorageServiceFactory.getService().close(); + } catch (Throwable e) { + e.printStackTrace(); + } + } - public void contextDestroyed(ServletContextEvent arg0) { - try { - serviceProjets.close(); - } catch (Throwable e) { - e.printStackTrace(); - } - } + public void contextInitialized(ServletContextEvent arg0) { + try { + StorageServiceFactory.getService().open(); + } catch (Throwable e) { + e.printStackTrace(); + } + } - public void contextInitialized(ServletContextEvent arg0) { - try { - Context context = new InitialContext(System.getProperties()); - serviceProjets = (StorageService) context - .lookup("ejb3/StorageService"); - serviceProjets.open(); - } catch (Throwable e) { - e.printStackTrace(); - } - } - } Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java (rev 0) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java 2007-12-26 16:30:43 UTC (rev 89) @@ -0,0 +1,33 @@ +package fr.cemagref.simexplorer.is.ui.web.beans; + +public class TreeNode { + + private long id; + private String libelle; + private TreeNode[] enfants; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getLibelle() { + return libelle; + } + + public void setLibelle(String libelle) { + this.libelle = libelle; + } + + public TreeNode[] getEnfants() { + return enfants; + } + + public void setEnfants(TreeNode[] enfants) { + this.enfants = enfants; + } + +} Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/TreeData.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/TreeData.java (rev 0) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/TreeData.java 2007-12-26 16:30:43 UTC (rev 89) @@ -0,0 +1,28 @@ +package fr.cemagref.simexplorer.is.ui.web.dwr; + +import java.util.Random; + +import fr.cemagref.simexplorer.is.ui.web.beans.TreeNode; + +public class TreeData { + + public TreeNode getNode(long id) { + Random r = new Random(); + + TreeNode tn = new TreeNode(); + tn.setId(id); + tn.setLibelle(Long.toHexString(r.nextLong())); + int n = 5 + r.nextInt(10); + TreeNode[] children = new TreeNode[n]; + for (int i = 0; i < children.length; i++) { + children[i] = new TreeNode(); + children[i].setId(1 + r.nextLong()); + children[i].setLibelle(Long.toHexString(r.nextLong())); + children[i].setEnfants(new TreeNode[0]); + } + tn.setEnfants(children); + + return tn; + } + +} Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java (rev 0) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java 2007-12-26 16:30:43 UTC (rev 89) @@ -0,0 +1,74 @@ +package fr.cemagref.simexplorer.is.ui.web.grid; + +import javax.naming.NamingException; + +import org.apache.tapestry.beaneditor.PropertyModel; +import org.apache.tapestry.grid.GridDataSource; + +import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity; +import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory; + +public class ApplicationDataSource implements GridDataSource { + + private String query = ""; + private int indexStart = 0; + private MetaDataEntity[] entities = null; + + public ApplicationDataSource(String query) { + super(); + this.query = query; + } + + public ApplicationDataSource() { + super(); + this.query = ""; + } + + public int getAvailableRows() { + int result = 0; + try { + if (query.isEmpty()) { + result = StorageServiceFactory.getService() + .findApplicationsCount(false); + } else { + result = StorageServiceFactory.getService().findFullTextCount( + query, false); + } + } catch (NamingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return result; + } + + public Class getRowType() { + return MetaDataEntity.class; + } + + public Object getRowValue(int index) { + return entities[index - indexStart]; + } + + public void prepare(int startIndex, int endIndex, PropertyModel sortModel, + boolean ascending) { + try { + this.indexStart = startIndex; + if (query.isEmpty()) { + entities = StorageServiceFactory.getService().findApplications( + false, startIndex, 1 + endIndex - startIndex); + } else { + entities = StorageServiceFactory.getService().findFullText( + query, false, startIndex, 1 + endIndex - startIndex); + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + this.indexStart = 0; + entities = new MetaDataEntity[0]; + } + } + +} Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2007-12-26 16:30:43 UTC (rev 89) @@ -2,12 +2,11 @@ import org.apache.tapestry.annotations.Component; - public class ApplicationDetail extends AbstractApplicationDetail { - /** layout */ - @SuppressWarnings("unused") - @Component - private Layout layout; + /** layout */ + @SuppressWarnings("unused") + @Component + private Layout layout; } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java 2007-12-26 16:30:43 UTC (rev 89) @@ -2,12 +2,11 @@ import org.apache.tapestry.annotations.Component; - public class ApplicationExport extends AbstractApplicationExport { - - /** layout */ - @SuppressWarnings("unused") - @Component - private Layout layout; + /** layout */ + @SuppressWarnings("unused") + @Component + private Layout layout; + } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2007-12-26 16:30:43 UTC (rev 89) @@ -3,30 +3,44 @@ import org.apache.tapestry.annotations.Component; import org.apache.tapestry.upload.services.UploadedFile; +import com.healthmarketscience.rmiio.RemoteInputStreamServer; +import com.healthmarketscience.rmiio.SimpleRemoteInputStream; +import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory; + public class ApplicationImport extends AbstractApplicationImport { - /** layout */ - @SuppressWarnings("unused") - @Component - private Layout layout; + /** layout */ + @SuppressWarnings("unused") + @Component + private Layout layout; - private UploadedFile _file; + private UploadedFile fileEA; + private UploadedFile fileLib; - public UploadedFile getFile() - { - return _file; - } + public UploadedFile getFileEA() { + return fileEA; + } - public void setFile(UploadedFile file) - { - _file = file; - } + public void setFileEA(UploadedFile fileEA) { + this.fileEA = fileEA; + } - public void onSuccess() - { - //File copied = new File("/my/file/location/" + _file.getFileName()); - //_file.write(copied); - } - + public UploadedFile getFileLib() { + return fileLib; + } + + public void setFileLib(UploadedFile fileLib) { + this.fileLib = fileLib; + } + + public void onSuccess() throws Exception { + if (fileEA != null) { + RemoteInputStreamServer zipRemoteStream = new SimpleRemoteInputStream( + fileEA.getStream()); + StorageServiceFactory.getService().saveElement( + zipRemoteStream.export()); + } + } + } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java 2007-12-26 16:30:43 UTC (rev 89) @@ -1,12 +1,30 @@ package fr.cemagref.simexplorer.is.ui.web.pages; import org.apache.tapestry.annotations.Component; +import org.apache.tapestry.ioc.annotations.Inject; +import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity; +import fr.cemagref.simexplorer.is.ui.web.grid.ApplicationDataSource; + public class ApplicationList extends AbstractApplicationList { - /** layout */ - @SuppressWarnings("unused") - @Component - private Layout layout; + /** layout */ + @SuppressWarnings("unused") + @Component + private Layout layout; + private MetaDataEntity application; + + public ApplicationDataSource getApplications() { + return new ApplicationDataSource(); + } + + public MetaDataEntity getApplication() { + return application; + } + + public void setApplication(MetaDataEntity application) { + this.application = application; + } + } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2007-12-26 16:30:43 UTC (rev 89) @@ -3,19 +3,18 @@ import org.apache.tapestry.annotations.Component; import org.apache.tapestry.annotations.Persist; - public class GroupEdit extends AbstractGroupEdit { - /** layout */ - @SuppressWarnings("unused") - @Component - private Layout layout; + /** layout */ + @SuppressWarnings("unused") + @Component + private Layout layout; - @Persist - private int groupId; + @Persist + private int groupId; - void onActivate(int groupId) { - this.groupId = groupId; - this.onActivate(); - } + void onActivate(int groupId) { + this.groupId = groupId; + this.onActivate(); + } } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2007-12-26 16:30:43 UTC (rev 89) @@ -2,11 +2,10 @@ import org.apache.tapestry.annotations.Component; - public class GroupList extends AbstractGroupList { - /** layout */ - @SuppressWarnings("unused") - @Component - private Layout layout; + /** layout */ + @SuppressWarnings("unused") + @Component + private Layout layout; } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java 2007-12-26 16:30:43 UTC (rev 89) @@ -28,8 +28,6 @@ import org.apache.tapestry.ioc.annotations.Inject; import org.apache.tapestry.services.PersistentLocale; - - /** * AbstractPage.java * @@ -39,94 +37,93 @@ * Last update : $Date: 2007/05/14 07:56:43 $ By : $Author: E023931M $ */ public class Layout { - + /* linked state "UserList" */ @InjectPage private UserList userList; - - /** - * page title - */ - @Parameter("defaulttitle") - private String title; - - @Inject - @Path("context:css/general.css") - private Asset _stylesheetGeneral; - + + /** + * page title + */ + @Parameter("defaulttitle") + private String title; + @Inject + @Path("context:css/general.css") + private Asset _stylesheetGeneral; + + @Inject @Path("context:css/layout.css") private Asset _stylesheetLayout; - + @Inject @Path("context:css/dftree.css") private Asset stylesheetTree; - + @Inject @Path("context:js/dftree.js") private Asset javascriptTree; - /** - * @return the title - */ - public String getTitle() { - return title; - } - - /** - * Set default title - */ - void getDefaultTitle() { - title = ""; - } + /** + * @return the title + */ + public String getTitle() { + return title; + } - /** - * @return the _stylesheetGeneral - */ - public Asset getStylesheetGeneral() { - return _stylesheetGeneral; - } + /** + * Set default title + */ + void getDefaultTitle() { + title = ""; + } - /** - * @return the _stylesheetLayout - */ - public Asset getStylesheetLayout() { - return _stylesheetLayout; - } - - @Inject - @Service("PersistentLocale") - private PersistentLocale persistentLocale; - + /** + * @return the _stylesheetGeneral + */ + public Asset getStylesheetGeneral() { + return _stylesheetGeneral; + } + + /** + * @return the _stylesheetLayout + */ + public Asset getStylesheetLayout() { + return _stylesheetLayout; + } + + @Inject + @Service("PersistentLocale") + private PersistentLocale persistentLocale; + Object onActionFromSwitchLocaleFr() { persistentLocale.set(new Locale("fr")); return null; } - - Object onActionFromSwitchLocaleEn() { - persistentLocale.set(new Locale("en")); - return null; - } - - Object onActionFromAdministration() { - return userList; - } - public boolean getAdministrator() { - return true; - } + Object onActionFromSwitchLocaleEn() { + persistentLocale.set(new Locale("en")); + return null; + } + Object onActionFromAdministration() { + return userList; + } + + public boolean getAdministrator() { + return true; + } + public Asset getStylesheetTree() { return stylesheetTree; } public Asset getJavascriptTree() { - return javascriptTree; + return javascriptTree; } - + public String getJavascriptFolder() { return javascriptTree.toClientURL().replace("dftree.js", ""); } - } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2007-12-26 16:30:43 UTC (rev 89) @@ -3,19 +3,18 @@ import org.apache.tapestry.annotations.Component; import org.apache.tapestry.annotations.Persist; - public class UserEdit extends AbstractUserEdit { - /** layout */ - @SuppressWarnings("unused") - @Component - private Layout layout; + /** layout */ + @SuppressWarnings("unused") + @Component + private Layout layout; - @Persist - private int userId; + @Persist + private int userId; - void onActivate(int userId) { - this.userId = userId; - this.onActivate(); - } + void onActivate(int userId) { + this.userId = userId; + this.onActivate(); + } } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2007-12-26 16:30:43 UTC (rev 89) @@ -2,11 +2,10 @@ import org.apache.tapestry.annotations.Component; - public class UserList extends AbstractUserList { - /** layout */ - @SuppressWarnings("unused") - @Component - private Layout layout; + /** layout */ + @SuppressWarnings("unused") + @Component + private Layout layout; } Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java (rev 0) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java 2007-12-26 16:30:43 UTC (rev 89) @@ -0,0 +1,22 @@ +package fr.cemagref.simexplorer.is.ui.web.services; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import fr.cemagref.simexplorer.is.storage.service.StorageService; + +public class StorageServiceFactory { + + private static StorageService serviceProjets = null; + + public static StorageService getService() throws NamingException { + if (serviceProjets == null) { + Context context = new InitialContext(System.getProperties()); + serviceProjets = (StorageService) context + .lookup("ejb3/StorageService"); + } + return serviceProjets; + } + +} Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml =================================================================== --- trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml 2007-12-26 16:30:43 UTC (rev 89) @@ -3,8 +3,17 @@ <t:form> <t:errors/> - <input t:type="upload" t:id="file" validate="required"/> + + <h1 class="Title">${message:explorationapplication}</h1> + + <input t:type="upload" t:id="fileEA"/> <br/> + + <h1 class="Title">${message:library}</h1> + + <input t:type="upload" t:id="fileLib"/> + <br/> + <input type="submit" value="${message:upload}"/> </t:form> Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml =================================================================== --- trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml 2007-12-26 16:30:43 UTC (rev 89) @@ -1,15 +1,14 @@ <t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" title="message:windowtitle"> - - <div id="dftree_tree"> - </div> + + <table t:type="Grid" source="applications" row="application"> + <t:parameter name="uuidCell"> + ${application.uuid} + </t:parameter> + </table> + <a t:type="ActionLink" t:id="edit">Details</a> <a t:type="ActionLink" t:id="create">Create</a> <a t:type="ActionLink" t:id="delete">Delete</a> - - -<script> -initTree(); -</script> - + </t:layout> Added: trunk/simexplorer-is-web/src/webcontent/WEB-INF/dwr.xml =================================================================== --- trunk/simexplorer-is-web/src/webcontent/WEB-INF/dwr.xml (rev 0) +++ trunk/simexplorer-is-web/src/webcontent/WEB-INF/dwr.xml 2007-12-26 16:30:43 UTC (rev 89) @@ -0,0 +1,12 @@ +<!DOCTYPE dwr PUBLIC + "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" + "http://www.getahead.ltd.uk/dwr/dwr10.dtd"> + +<dwr> + <allow> + <convert converter="bean" match="fr.cemagref.simexplorer.is.ui.web.beans.*"/> + <create creator="new" javascript="TreeData"> + <param name="class" value="fr.cemagref.simexplorer.is.ui.web.dwr.TreeData"/> + </create> + </allow> +</dwr> \ No newline at end of file Modified: trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml =================================================================== --- trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml 2007-12-26 16:30:43 UTC (rev 89) @@ -21,6 +21,20 @@ <url-pattern>/*</url-pattern> </filter-mapping> + <servlet> + <servlet-name>dwr-invoker</servlet-name> + <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> + <init-param> + <param-name>debug</param-name> + <param-value>true</param-value> + </init-param> + </servlet> + + <servlet-mapping> + <servlet-name>dwr-invoker</servlet-name> + <url-pattern>/js/dwr/*</url-pattern> + </servlet-mapping> + <listener> <listener-class> fr.cemagref.simexplorer.is.ui.web.ContextListener @@ -28,6 +42,6 @@ </listener> <welcome-file-list> - <welcome-file>ApplicationList</welcome-file> + <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app> \ No newline at end of file Added: trunk/simexplorer-is-web/src/webcontent/index.html =================================================================== --- trunk/simexplorer-is-web/src/webcontent/index.html (rev 0) +++ trunk/simexplorer-is-web/src/webcontent/index.html 2007-12-26 16:30:43 UTC (rev 89) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> + <meta http-equiv="refresh" + content="0; url=applicationlist"/> + <title></title> + <meta name="robots" content="noindex,follow"/> + </head> + + <body> + </body> +</html> \ No newline at end of file Modified: trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js =================================================================== --- trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js 2007-12-26 16:30:11 UTC (rev 88) +++ trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js 2007-12-26 16:30:43 UTC (rev 89) @@ -10,24 +10,25 @@ function createNode(idNode, nodeCaption, parentId) { var node = new dNode({id: idNode,caption: nodeCaption}); - /* + if (parentId == -1) { TreeData.getNode(idNode, getNodeCallback); } else { node.alter({onFirstOpen: 'TreeData.getNode('+idNode+', getNodeCallback)'}); } - */ + tree.add(node, parentId); nodes[inode++] = node; } function initTree() { - tree = new dFTree({name: 'tree', icondir: '../images/tree'}); + tree = new dFTree({name: 'tree', icondir: './images/tree'}); tree.useIcons = true; var i = 0; var pid = []; createNode(i++, 'Applications', -1); //root node + /* pid[0] = i; createNode(i++, 'My first application', 0); @@ -63,6 +64,8 @@ createNode(i++, 'Components', pid[0]); createNode(i++, 'Explorations', pid[0]); + */ + for (var j = 0; j < inode; j++) { nodes[j].open(); }