r417 - in trunk/simexplorer-is-web: . src/java/fr/cemagref/simexplorer/is/ui/web/grid src/java/fr/cemagref/simexplorer/is/ui/web/pages src/java/fr/cemagref/simexplorer/is/ui/web/pages/security
Author: glandais Date: 2008-01-22 15:15:54 +0000 (Tue, 22 Jan 2008) New Revision: 417 Modified: trunk/simexplorer-is-web/pom.xml trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ElementDataSource.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/ElementDetail.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java Log: Secured service Modified: trunk/simexplorer-is-web/pom.xml =================================================================== --- trunk/simexplorer-is-web/pom.xml 2008-01-22 15:15:22 UTC (rev 416) +++ trunk/simexplorer-is-web/pom.xml 2008-01-22 15:15:54 UTC (rev 417) @@ -58,11 +58,6 @@ <dependencies> <dependency> <groupId>simexplorer-is</groupId> - <artifactId>simexplorer-is-security</artifactId> - <version>0.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>simexplorer-is</groupId> <artifactId>simexplorer-is-entities</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ElementDataSource.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ElementDataSource.java 2008-01-22 15:15:22 UTC (rev 416) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ElementDataSource.java 2008-01-22 15:15:54 UTC (rev 417) @@ -2,6 +2,7 @@ import javax.naming.NamingException; +import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.beaneditor.PropertyModel; import org.apache.tapestry.grid.GridDataSource; import org.apache.tapestry.ioc.annotations.Inject; @@ -15,6 +16,9 @@ private int indexStart = 0; private MetaDataEntity[] entities = null; + @ApplicationState + private String token; + public ElementDataSource(String query) { super(); this.query = query; @@ -29,9 +33,9 @@ int result = 0; try { if (query.equals("")) { - result = RemoteStorageService.getStorageService().findApplicationsCount(false); + result = RemoteStorageService.getStorageService().findApplicationsCount(token, false); } else { - result = RemoteStorageService.getStorageService().findFullTextCount(query, false); + result = RemoteStorageService.getStorageService().findFullTextCount(token, query, false); } } catch (NamingException e) { // TODO Auto-generated catch block @@ -68,10 +72,10 @@ if (query.equals("")) { entities = RemoteStorageService.getStorageService() - .findApplications(false, startIndex, + .findApplications(token, false, startIndex, 1 + endIndex - startIndex, dateOrder); } else { - entities = RemoteStorageService.getStorageService().findFullText( + entities = RemoteStorageService.getStorageService().findFullText(token, query, false, startIndex, 1 + endIndex - startIndex, dateOrder); } 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 2008-01-22 15:15:22 UTC (rev 416) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2008-01-22 15:15:54 UTC (rev 417) @@ -34,7 +34,7 @@ if (fileEA != null) { RemoteInputStreamServer zipRemoteStream = new SimpleRemoteInputStream( fileEA.getStream()); - RemoteStorageService.getStorageService().saveElement( + RemoteStorageService.getStorageService().saveElement(getToken(), zipRemoteStream.export()); } } Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDetail.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDetail.java 2008-01-22 15:15:22 UTC (rev 416) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDetail.java 2008-01-22 15:15:54 UTC (rev 417) @@ -41,7 +41,8 @@ private LoggableElement element; public void setup(String uuid, String version) throws Exception { - element = RemoteStorageService.getStorageService().getElement(uuid, version); + element = RemoteStorageService.getStorageService().getElement( + getToken(), uuid, version); } public List<String> getHeaders() { @@ -65,11 +66,11 @@ ByteArrayOutputStream bos = new ByteArrayOutputStream(); RemoteOutputStreamServer xmlRemoteOutputStream = new SimpleRemoteOutputStream( bos); - RemoteStorageService.getStorageService().exportElement( + RemoteStorageService.getStorageService().exportElement(getToken(), xmlRemoteOutputStream.export(), uuid, version); - MetaDataEntity mde = RemoteStorageService.getStorageService().getMetadata( - uuid, version); + MetaDataEntity mde = RemoteStorageService.getStorageService() + .getMetadata(uuid, version); ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); response = new XMLAttachment(bis, mde.getType() + "." + mde.getUuid() + ".v" + mde.getVersion()); Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java 2008-01-22 15:15:22 UTC (rev 416) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java 2008-01-22 15:15:54 UTC (rev 417) @@ -17,12 +17,16 @@ return null; } + public String getToken() { + return token; + } + public User getUserLogged() { User loggedUser = null; if (token != null) { try { - loggedUser = RemoteSecurityService.getAuthentificationService().getLoggedUser( - token); + loggedUser = RemoteSecurityService.getAuthentificationService() + .getLoggedUser(token); } catch (Exception e) { // TODO: handle exception }
participants (1)
-
glandais@users.labs.libre-entreprise.org