Simexplorer-si-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- 1607 discussions
r875 - trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service
by glandais@users.labs.libre-entreprise.org 12 Feb '08
by glandais@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: glandais
Date: 2008-02-12 19:55:26 +0000 (Tue, 12 Feb 2008)
New Revision: 875
Modified:
trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java
Log:
Versioning business rules
Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java 2008-02-12 19:54:32 UTC (rev 874)
+++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java 2008-02-12 19:55:26 UTC (rev 875)
@@ -561,18 +561,26 @@
*/
protected boolean processVersionRules(String token, MetaData metaData)
throws Exception {
+ // This one will always be the latest
+ metaData.setLatest(true);
+
// Check existing version in storage
MetaData previousVersion = getStorageEngine().getMetadata(token,
- metaData.getUuid(), metaData.getVersion());
+ metaData.getUuid());
+
// Version rules
if (previousVersion != null) {
previousVersion.setLatest(false);
update(token, previousVersion.getUuid(), previousVersion
.getVersion(), previousVersion);
- metaData.setLatest(true);
- metaData.setVersion(incrementVersion(previousVersion.getVersion())
- .toString());
+ // Increment version only if needed
+ if (metaData.getVersion().compareTo(
+ incrementVersion(previousVersion.getVersion())) <= 0) {
+ metaData.setVersion(incrementVersion(
+ previousVersion.getVersion()).toString());
+ }
+
return true;
}
return false;
@@ -580,9 +588,20 @@
private boolean notExists(String token, MetaData metaData) throws Exception {
MetaData previousVersion = getStorageEngine().getMetadata(token,
- metaData.getUuid(), metaData.getVersion());
+ metaData.getUuid());
+
if (previousVersion != null
&& previousVersion.getHash().equals(metaData.getHash())) {
+
+ if (metaData.getVersion().compareTo(previousVersion.getVersion()) < 0) {
+ metaData.setVersion(previousVersion.getVersion().toString());
+ } else {
+ Version versionToUpgrade = previousVersion.getVersion().clone();
+ previousVersion.setVersion(metaData.getVersion().toString());
+ update(token, previousVersion.getUuid(), versionToUpgrade,
+ previousVersion);
+ }
+
return false;
}
return true;
1
0
r874 - trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories
by glandais@users.labs.libre-entreprise.org 12 Feb '08
by glandais@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: glandais
Date: 2008-02-12 19:54:32 +0000 (Tue, 12 Feb 2008)
New Revision: 874
Modified:
trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java
Log:
Compute hash working
Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java 2008-02-12 18:20:30 UTC (rev 873)
+++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java 2008-02-12 19:54:32 UTC (rev 874)
@@ -309,8 +309,18 @@
return is;
}
+ /**
+ * Compute hash.
+ *
+ * @param xmlStream the xml stream
+ *
+ * @return the string
+ *
+ * @throws Exception the exception
+ */
public String computeHash(InputStream xmlStream) throws Exception {
Document document = getXMLBuilder().parse(xmlStream);
+ int removeNodes = removeMetadatas(document);
DigestGenerator digestGenerator = new DigestGenerator();
byte[] digest = digestGenerator.getDigest(document,
@@ -319,23 +329,40 @@
return MD5.asHex(digest);
}
- private int removeMetadatas(Document document, Node node) {
+ /**
+ * Removes the metadatas.
+ *
+ * @param document the document
+ * @param node the node
+ *
+ * @return the int
+ */
+ private int removeMetadatas(Node node) {
int tot = 0;
NodeList childNodes = node.getChildNodes();
List<Node> toRemove = new ArrayList<Node>();
+
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.item(i);
if (child instanceof Element
&& KEY_METADATA.equals(((Element) child).getTagName())) {
toRemove.add(child);
- } else {
- tot = tot + removeMetadatas(document, child);
}
}
+
for (Node metadata : toRemove) {
node.removeChild(metadata);
tot++;
}
+
+ if (tot == 0) {
+ childNodes = node.getChildNodes();
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ Node child = childNodes.item(i);
+ tot = tot + removeMetadatas(child);
+ }
+ }
+
return tot;
}
1
0
r873 - in trunk/simexplorer-is: simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages
by glandais@users.labs.libre-entreprise.org 12 Feb '08
by glandais@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: glandais
Date: 2008-02-12 18:20:30 +0000 (Tue, 12 Feb 2008)
New Revision: 873
Added:
trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceLocalReplace.java
Modified:
trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageService.java
trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceClient.java
trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java
trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceServer.java
trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceMassInsert.java
trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceTest.java
trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service/MockStorageServiceImpl.java
trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementImport.java
trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java
Log:
Usage of magic streams as standard for interface
Reformat
Update business rules (hash, check previous version)
Simple StorageServiceLocal test
Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageService.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageService.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageService.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -22,8 +22,6 @@
import javax.ejb.Remote;
-import com.healthmarketscience.rmiio.RemoteInputStream;
-
import fr.cemagref.simexplorer.is.attachment.Attachment;
import fr.cemagref.simexplorer.is.entities.data.LoggableElement;
import fr.cemagref.simexplorer.is.entities.metadata.MetaData;
@@ -40,67 +38,53 @@
/**
* Login user onto system Not used for local usages.
*
- * @param login
- * Login
- * @param password
- * Password
+ * @param login Login
+ * @param password Password
*
* @return Token as logon evidence
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
String loginUser(String login, String password)
throws SimExplorerServiceException;
/**
- * Save a remote element.
+ * Save an element.
*
- * @param token
- * the token
- * @param zipRemoteStream
- * RIIO stream containing data inside a zip
+ * @param token the token
+ * @param zipStream the zip stream
*
* @return Metadata of element imported
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
- MetaData saveElement(String token, RemoteInputStream zipRemoteStream)
+ MetaData saveElement(String token, SimExplorerServiceStream zipStream)
throws SimExplorerServiceException;
/**
- * Save a remote element.
+ * Save an element.
*
- * @param token
- * the token
- * @param xmlRemoteStream
- * RIIO stream containing XML Stream
- * @param attachmentsRemoteStream
- * RIIO stream containing attached data. Key matches metadata
- * attachment keys
+ * @param token the token
+ * @param xmlStream the xml stream
+ * @param attachmentsStream the attachments stream
*
* @return Metadata of element saved
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
- MetaData saveElement(String token, RemoteInputStream xmlRemoteStream,
- Map<Attachment, RemoteInputStream> attachmentsRemoteStream)
+ MetaData saveElement(String token, SimExplorerServiceStream xmlStream,
+ Map<Attachment, SimExplorerServiceStream> attachmentsStream)
throws SimExplorerServiceException;
/**
* Retrieve metadata (latest version).
*
- * @param token
- * the token
- * @param uuid
- * the uuid
+ * @param token the token
+ * @param uuid the uuid
*
* @return the metadata
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
MetaData getMetadata(String token, String uuid)
throws SimExplorerServiceException;
@@ -108,17 +92,13 @@
/**
* Retrieve metadata.
*
- * @param token
- * the token
- * @param uuid
- * the uuid
- * @param version
- * the version
+ * @param token the token
+ * @param uuid the uuid
+ * @param version the version
*
* @return the metadata
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
MetaData getMetadata(String token, String uuid, String version)
throws SimExplorerServiceException;
@@ -126,17 +106,13 @@
/**
* Export XML of element to a stream.
*
- * @param token
- * the token
- * @param uuid
- * the uuid
- * @param version
- * the version
+ * @param token the token
+ * @param uuid the uuid
+ * @param version the version
*
* @return RMIIO stream with data
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
InputStream retrieveElementXML(String token, String uuid, String version)
throws SimExplorerServiceException;
@@ -144,17 +120,13 @@
/**
* Export full element to a stream as a zip.
*
- * @param token
- * the token
- * @param uuid
- * the uuid
- * @param version
- * the version
+ * @param token the token
+ * @param uuid the uuid
+ * @param version the version
*
* @return the input stream
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
InputStream retrieveElementFull(String token, String uuid, String version)
throws SimExplorerServiceException;
@@ -162,19 +134,14 @@
/**
* Retrieve data related to an entity.
*
- * @param token
- * the token
- * @param uuid
- * the uuid
- * @param version
- * the version
- * @param attachment
- * the attachment
+ * @param token the token
+ * @param uuid the uuid
+ * @param version the version
+ * @param attachment the attachment
*
* @return the input stream
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
InputStream retrieveElementData(String token, String uuid, String version,
Attachment attachment) throws SimExplorerServiceException;
@@ -182,19 +149,14 @@
/**
* Export element to another service.
*
- * @param token
- * the token
- * @param otherService
- * the other service
- * @param uuid
- * the uuid
- * @param version
- * the version
+ * @param token the token
+ * @param otherService the other service
+ * @param uuid the uuid
+ * @param version the version
*
* @return the version
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
Version exportElementTo(String token, StorageService otherService,
String uuid, String version) throws SimExplorerServiceException;
@@ -202,17 +164,13 @@
/**
* Retrieve number of elements matching query.
*
- * @param token
- * the token
- * @param query
- * the query
- * @param onlyLatest
- * the only latest
+ * @param token the token
+ * @param query the query
+ * @param onlyLatest the only latest
*
* @return the int
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
int findFullTextCount(String token, String query, boolean onlyLatest)
throws SimExplorerServiceException;
@@ -220,23 +178,16 @@
/**
* Find elements matching query.
*
- * @param token
- * the token
- * @param query
- * the query
- * @param onlyLatest
- * the only latest
- * @param indexStart
- * the index start
- * @param count
- * the count
- * @param dateOrder
- * the date order
+ * @param token the token
+ * @param query the query
+ * @param onlyLatest the only latest
+ * @param indexStart the index start
+ * @param count the count
+ * @param dateOrder the date order
*
* @return the meta data[]
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
MetaData[] findFullText(String token, String query, boolean onlyLatest,
int indexStart, int count, int dateOrder)
@@ -245,15 +196,12 @@
/**
* Retrieve number of applications.
*
- * @param token
- * the token
- * @param onlyLatest
- * the only latest
+ * @param token the token
+ * @param onlyLatest the only latest
*
* @return the int
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
int findApplicationsCount(String token, boolean onlyLatest)
throws SimExplorerServiceException;
@@ -261,21 +209,15 @@
/**
* Get a list of applications.
*
- * @param token
- * the token
- * @param onlyLatest
- * the only latest
- * @param start
- * the start
- * @param count
- * the count
- * @param dateOrder
- * the date order
+ * @param token the token
+ * @param onlyLatest the only latest
+ * @param start the start
+ * @param count the count
+ * @param dateOrder the date order
*
* @return the meta data[]
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
MetaData[] findApplications(String token, boolean onlyLatest, int start,
int count, int dateOrder) throws SimExplorerServiceException;
@@ -283,17 +225,13 @@
/**
* Fully load an element.
*
- * @param token
- * the token
- * @param uuid
- * the uuid
- * @param version
- * the version
+ * @param token the token
+ * @param uuid the uuid
+ * @param version the version
*
* @return the element
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
LoggableElement getLoggableElement(String token, String uuid, String version)
throws SimExplorerServiceException;
@@ -301,15 +239,12 @@
/**
* Get all version of an element.
*
- * @param token
- * the token
- * @param uuid
- * the uuid
+ * @param token the token
+ * @param uuid the uuid
*
* @return the versions
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
Version[] getVersions(String token, String uuid)
throws SimExplorerServiceException;
@@ -317,15 +252,11 @@
/**
* Delete element.
*
- * @param token
- * the token
- * @param uuid
- * the uuid
- * @param version
- * the version
+ * @param token the token
+ * @param uuid the uuid
+ * @param version the version
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
void deleteElement(String token, String uuid, String version)
throws SimExplorerServiceException;
@@ -333,13 +264,10 @@
/**
* Delete element.
*
- * @param token
- * the token
- * @param uuid
- * the uuid
+ * @param token the token
+ * @param uuid the uuid
*
- * @throws SimExplorerServiceException
- * the sim explorer service exception
+ * @throws SimExplorerServiceException the sim explorer service exception
*/
void deleteElement(String token, String uuid)
throws SimExplorerServiceException;
Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceClient.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceClient.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceClient.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -23,6 +23,7 @@
import fr.cemagref.simexplorer.is.attachment.Attachment;
import fr.cemagref.simexplorer.is.entities.metadata.MetaData;
+import fr.cemagref.simexplorer.is.entities.metadata.Version;
import fr.cemagref.simexplorer.is.storage.SimExplorerStorageException;
import fr.cemagref.simexplorer.is.storage.engine.StorageEngine;
import fr.cemagref.simexplorer.is.storage.engine.StorageEngineImpl;
@@ -57,50 +58,9 @@
return storageEngine;
}
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageServiceCommon#processVersionRules(java.lang.String, fr.cemagref.simexplorer.is.entities.metadata.MetaData)
- */
@Override
- protected void processVersionRules(String token, MetaData metaData)
- throws Exception {
- // Check existing version in storage
- MetaData previousVersion = getStorageEngine().getMetadata(token,
- metaData.getUuid(), metaData.getVersion());
- // Version rules
- if (previousVersion != null) {
- previousVersion.setLatest(false);
- update(token, previousVersion.getUuid(), previousVersion
- .getVersion(), previousVersion);
-
- metaData.setLatest(true);
- metaData.setVersion(previousVersion.getVersion().incVersion(1)
- .toString());
- }
+ protected Version incrementVersion(Version version) {
+ return version.incVersion(1);
}
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageService#retrieveElementData(java.lang.String, java.lang.String, java.lang.String, fr.cemagref.simexplorer.is.attachment.Attachment)
- */
- public InputStream retrieveElementData(String token, String uuid,
- String version, Attachment attachment)
- throws SimExplorerServiceException {
- return retrieveElementDataCommon(token, uuid, version, attachment);
- }
-
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageService#retrieveElementFull(java.lang.String, java.lang.String, java.lang.String)
- */
- public InputStream retrieveElementFull(String token, String uuid,
- String version) throws SimExplorerServiceException {
- return retrieveElementFullCommon(token, uuid, version);
- }
-
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageService#retrieveElementXML(java.lang.String, java.lang.String, java.lang.String)
- */
- public InputStream retrieveElementXML(String token, String uuid,
- String version) throws SimExplorerServiceException {
- return retrieveElementXMLCommon(token, uuid, version);
- }
-
}
Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -19,7 +19,6 @@
import static org.codelutin.i18n.I18n._;
-import java.io.IOException;
import java.io.InputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
@@ -37,9 +36,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import com.healthmarketscience.rmiio.RemoteInputStream;
-import com.healthmarketscience.rmiio.RemoteInputStreamClient;
-
import fr.cemagref.simexplorer.is.attachment.Attachment;
import fr.cemagref.simexplorer.is.entities.data.DataEntity;
import fr.cemagref.simexplorer.is.entities.data.LoggableElement;
@@ -85,43 +81,6 @@
}
/* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageService#saveElement(java.lang.String, com.healthmarketscience.rmiio.RemoteInputStream)
- */
- public MetaData saveElement(String token, RemoteInputStream zipRemoteStream)
- throws SimExplorerServiceException {
- InputStream zipStream;
- try {
- zipStream = RemoteInputStreamClient.wrap(zipRemoteStream);
- return saveElement(token, zipStream);
- } catch (IOException e) {
- throw new SimExplorerServiceException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageService#saveElement(java.lang.String, com.healthmarketscience.rmiio.RemoteInputStream, java.util.Map)
- */
- public MetaData saveElement(String token,
- RemoteInputStream xmlRemoteStream,
- Map<Attachment, RemoteInputStream> attachmentsRemoteStream)
- throws SimExplorerServiceException {
- try {
- InputStream xmlStream = RemoteInputStreamClient
- .wrap(xmlRemoteStream);
- Map<Attachment, InputStream> attachmentStreams = new HashMap<Attachment, InputStream>();
- for (Map.Entry<Attachment, RemoteInputStream> entry : attachmentsRemoteStream
- .entrySet()) {
- InputStream stream = RemoteInputStreamClient.wrap(entry
- .getValue());
- attachmentStreams.put(entry.getKey(), stream);
- }
- return saveElement(token, xmlStream, attachmentStreams);
- } catch (Exception e) {
- throw new SimExplorerServiceException(e);
- }
- }
-
- /* (non-Javadoc)
* @see fr.cemagref.simexplorer.is.service.StorageService#getMetadata(java.lang.String, java.lang.String)
*/
public MetaData getMetadata(String token, String uuid)
@@ -232,7 +191,7 @@
*
* @throws SimExplorerServiceException the sim explorer service exception
*/
- private MetaData saveElement(String token, InputStream zipStream)
+ public MetaData saveElement(String token, SimExplorerServiceStream zipStream)
throws SimExplorerServiceException {
String xmlFile = null;
Map<Attachment, String> attachments = new HashMap<Attachment, String>();
@@ -298,28 +257,34 @@
*
* @return the meta data
*
- * @throws Exception the exception
+ * @throws SimExplorerServiceException the exception
*/
- private MetaData saveElement(String token, InputStream xmlFile,
- Map<Attachment, InputStream> attachments) throws Exception {
- // Store temporary data
- String idxml = getStorageEngine().storeTempData(xmlFile);
- Map<Attachment, String> idsattachment = new HashMap<Attachment, String>();
- for (Map.Entry<Attachment, InputStream> entry : attachments.entrySet()) {
- String idattachment = getStorageEngine().storeTempData(
- entry.getValue());
- idsattachment.put(entry.getKey(), idattachment);
+ public MetaData saveElement(String token, SimExplorerServiceStream xmlFile,
+ Map<Attachment, SimExplorerServiceStream> attachments)
+ throws SimExplorerServiceException {
+ try {
+ // Store temporary data
+ String idxml = getStorageEngine().storeTempData(xmlFile);
+ Map<Attachment, String> idsattachment = new HashMap<Attachment, String>();
+ for (Map.Entry<Attachment, SimExplorerServiceStream> entry : attachments
+ .entrySet()) {
+ String idattachment = getStorageEngine().storeTempData(
+ entry.getValue());
+ idsattachment.put(entry.getKey(), idattachment);
+ }
+ MetaData elementSaved = saveElement(token, idxml, idsattachment);
+ getStorageEngine().deleteTempData(idxml);
+ for (Map.Entry<Attachment, String> tmpId : idsattachment.entrySet()) {
+ getStorageEngine().deleteTempData(tmpId.getValue());
+ }
+ return elementSaved;
+ } catch (Exception e) {
+ throw new SimExplorerServiceException(e);
}
- MetaData elementSaved = saveElement(token, idxml, idsattachment);
- getStorageEngine().deleteTempData(idxml);
- for (Map.Entry<Attachment, String> tmpId : idsattachment.entrySet()) {
- getStorageEngine().deleteTempData(tmpId.getValue());
- }
- return elementSaved;
}
/**
- * Retrieve element data common.
+ * Retrieve element data.
*
* @param token the token
* @param uuid the uuid
@@ -330,7 +295,7 @@
*
* @throws SimExplorerServiceException the sim explorer service exception
*/
- protected InputStream retrieveElementDataCommon(String token, String uuid,
+ public InputStream retrieveElementData(String token, String uuid,
String version, Attachment attachment)
throws SimExplorerServiceException {
try {
@@ -338,8 +303,8 @@
InputStream stream = getStorageEngine().retrieveData(token, mde,
attachment);
- return stream;
- } catch (SimExplorerStorageException e) {
+ return new SimExplorerServiceStream(stream);
+ } catch (Exception e) {
throw new SimExplorerServiceException(e);
}
}
@@ -355,21 +320,21 @@
*
* @throws SimExplorerServiceException the sim explorer service exception
*/
- public InputStream retrieveElementXMLCommon(String token, String uuid,
+ public InputStream retrieveElementXML(String token, String uuid,
String version) throws SimExplorerServiceException {
MetaData mde = getMetadata(token, uuid, version);
try {
InputStream xmlStream = getStorageEngine().retrieveData(token, mde,
getXMLAttachment());
- return xmlStream;
- } catch (SimExplorerStorageException e) {
+ return new SimExplorerServiceStream(xmlStream);
+ } catch (Exception e) {
throw new SimExplorerServiceException(e);
}
}
/**
- * Retrieve element full common.
+ * Retrieve element full.
*
* @param token the token
* @param uuid the uuid
@@ -379,7 +344,7 @@
*
* @throws SimExplorerServiceException the sim explorer service exception
*/
- public InputStream retrieveElementFullCommon(String token, String uuid,
+ public InputStream retrieveElementFull(String token, String uuid,
String version) throws SimExplorerServiceException {
LoggableElement element = getLoggableElement(token, uuid, version);
MetaData mde = element.getMetaData();
@@ -406,11 +371,9 @@
ZipStreamEncoder zse = new ZipStreamEncoder(files, pipedOut);
zse.start();
- return pipedIn;
- } catch (SimExplorerStorageException e) {
+ return new SimExplorerServiceStream(pipedIn);
+ } catch (Exception e) {
throw new SimExplorerServiceException(e);
- } catch (IOException e) {
- throw new SimExplorerServiceException(e);
}
}
@@ -435,51 +398,65 @@
.loadElementFromParentXML(getStorageEngine().retrieveTempData(
idxml));
- if (metaData.getType() != null
- && VALUE_METADATA_TYPE_EA.equals(metaData.getType())) {
- // Save components
- saveSubElements(token, idxml,
- KEY_EXPLORATIONAPPLICATION_COMPONENTS,
- KEY_EXPLORATIONAPPLICATION_COMPONENT_NODE, idsattachment);
- // Save exploration data
- saveSubElements(token, idxml, KEY_EXPLORATIONAPPLICATION_DATA,
- KEY_EXPLORATIONAPPLICATION_DATA_NODE, idsattachment);
- }
- if (metaData.getType() != null
- && VALUE_METADATA_TYPE_COMPONENT.equals(metaData.getType())) {
- // Save libraries
- saveSubElements(token, idxml, KEY_COMPONENT_LIBRARIES,
- KEY_COMPONENT_LIBRARY_NODE, idsattachment);
- }
+ // Compute element hash
+ metaData.setHash(mdeFactory.computeHash(getStorageEngine()
+ .retrieveTempData(idxml)));
- // Process version rules
- processVersionRules(token, metaData);
+ if (notExists(token, metaData)) {
- // Prepare saving
- Map<Attachment, InputStream> attachments = new HashMap<Attachment, InputStream>();
+ // Process version rules
+ if (processVersionRules(token, metaData)) {
+ // Update XML
+ InputStream newXml = mdeFactory.replaceElementInParentXML(
+ getStorageEngine().retrieveTempData(idxml), metaData);
+ getStorageEngine().storeTempData(idxml, newXml);
+ }
- attachments.put(getXMLAttachment(), getStorageEngine()
- .retrieveTempData(idxml));
+ if (metaData.getType() != null
+ && VALUE_METADATA_TYPE_EA.equals(metaData.getType())) {
+ // Save components
+ saveSubElements(token, idxml,
+ KEY_EXPLORATIONAPPLICATION_COMPONENTS,
+ KEY_EXPLORATIONAPPLICATION_COMPONENT_NODE,
+ idsattachment);
+ // Save exploration data
+ saveSubElements(token, idxml, KEY_EXPLORATIONAPPLICATION_DATA,
+ KEY_EXPLORATIONAPPLICATION_DATA_NODE, idsattachment);
+ }
+ if (metaData.getType() != null
+ && VALUE_METADATA_TYPE_COMPONENT.equals(metaData.getType())) {
+ // Save libraries
+ saveSubElements(token, idxml, KEY_COMPONENT_LIBRARIES,
+ KEY_COMPONENT_LIBRARY_NODE, idsattachment);
+ }
- List<Attachment> realAttachments = metaData.getAttachments();
- for (Attachment attachment : realAttachments) {
- String idAttachment = idsattachment.get(attachment);
+ // Prepare saving
+ Map<Attachment, InputStream> attachments = new HashMap<Attachment, InputStream>();
- // Check hash of attachments
- if (idAttachment == null) {
+ attachments.put(getXMLAttachment(), getStorageEngine()
+ .retrieveTempData(idxml));
- throw new SimExplorerServiceException(
- _("simexplorer.service.attachmentnotfund"));
+ List<Attachment> realAttachments = metaData.getAttachments();
+ for (Attachment attachment : realAttachments) {
+ String idAttachment = idsattachment.get(attachment);
+ // Check hash of attachments
+ if (idAttachment == null) {
+
+ throw new SimExplorerServiceException(
+ _("simexplorer.service.attachmentnotfund"));
+
+ }
+ attachments.put(attachment, getStorageEngine()
+ .retrieveTempData(idAttachment));
+
}
- attachments.put(attachment, getStorageEngine().retrieveTempData(
- idAttachment));
+ getStorageEngine().saveElement(token, metaData, attachments);
+ getStorageEngine().commit();
+
}
- getStorageEngine().saveElement(token, metaData, attachments);
- getStorageEngine().commit();
-
return metaData;
}
@@ -537,9 +514,16 @@
MetaData oldMetaData = getStorageEngine().getMetadata(token,
oldUuid, oldVersion);
- attachments.put(getXMLAttachment(), getStorageEngine()
- .retrieveData(token, oldMetaData, getXMLAttachment()));
+ InputStream oldXml = getStorageEngine().retrieveData(token,
+ oldMetaData, getXMLAttachment());
+ MetaDataFactory<MetaData> mdeFactory = MetaDataFactory
+ .getFactory(MetaData.class);
+ InputStream newXml = mdeFactory.replaceElementInParentXML(oldXml,
+ newVersion);
+
+ attachments.put(getXMLAttachment(), newXml);
+
List<Attachment> realAttachments = oldMetaData.getAttachments();
for (Attachment attachment : realAttachments) {
attachments.put(attachment, getStorageEngine().retrieveData(
@@ -548,7 +532,7 @@
getStorageEngine().saveElement(token, newVersion, attachments);
getStorageEngine().commit();
- } catch (SimExplorerStorageException e) {
+ } catch (Exception e) {
throw new SimExplorerServiceException(e);
}
}
@@ -559,7 +543,9 @@
@Override
public Version exportElementTo(String token, StorageService otherService,
String uuid, String version) throws SimExplorerServiceException {
+
// TODO Auto-generated method stub
+
return null;
}
@@ -569,11 +555,48 @@
* @param token the token
* @param metaData the meta data
*
+ * @return true, if process version rules
+ *
* @throws Exception the exception
*/
- protected abstract void processVersionRules(String token, MetaData metaData)
- throws Exception;
+ protected boolean processVersionRules(String token, MetaData metaData)
+ throws Exception {
+ // Check existing version in storage
+ MetaData previousVersion = getStorageEngine().getMetadata(token,
+ metaData.getUuid(), metaData.getVersion());
+ // Version rules
+ if (previousVersion != null) {
+ previousVersion.setLatest(false);
+ update(token, previousVersion.getUuid(), previousVersion
+ .getVersion(), previousVersion);
+ metaData.setLatest(true);
+ metaData.setVersion(incrementVersion(previousVersion.getVersion())
+ .toString());
+ return true;
+ }
+ return false;
+ }
+
+ private boolean notExists(String token, MetaData metaData) throws Exception {
+ MetaData previousVersion = getStorageEngine().getMetadata(token,
+ metaData.getUuid(), metaData.getVersion());
+ if (previousVersion != null
+ && previousVersion.getHash().equals(metaData.getHash())) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Increment version.
+ *
+ * @param version the version
+ *
+ * @return the version
+ */
+ protected abstract Version incrementVersion(Version version);
+
/* (non-Javadoc)
* @see fr.cemagref.simexplorer.is.service.StorageService#getVersions(java.lang.String, java.lang.String)
*/
@@ -581,14 +604,14 @@
throws SimExplorerServiceException {
try {
Set<MetaData> versions = getStorageEngine().getElementVersions(
- token, uuid);
- Iterator<MetaData> iterator = versions.iterator();
- Version[] result = new Version[versions.size()];
+ token, uuid);
+ Iterator<MetaData> iterator = versions.iterator();
+ Version[] result = new Version[versions.size()];
int i = 0;
for (MetaData metaData : versions) {
result[i] = metaData.getVersion();
i++;
- }
+ }
return result;
} catch (SimExplorerStorageException e) {
throw new SimExplorerServiceException(e);
Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceServer.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceServer.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceServer.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -29,8 +29,8 @@
import com.healthmarketscience.rmiio.RemoteInputStreamServer;
import com.healthmarketscience.rmiio.SimpleRemoteInputStream;
-import fr.cemagref.simexplorer.is.attachment.Attachment;
import fr.cemagref.simexplorer.is.entities.metadata.MetaData;
+import fr.cemagref.simexplorer.is.entities.metadata.Version;
import fr.cemagref.simexplorer.is.storage.SimExplorerStorageException;
import fr.cemagref.simexplorer.is.storage.engine.StorageEngine;
@@ -69,72 +69,9 @@
return storageEngine;
}
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageServiceCommon#processVersionRules(java.lang.String, fr.cemagref.simexplorer.is.entities.metadata.MetaData)
- */
@Override
- protected void processVersionRules(String token, MetaData metaData)
- throws Exception {
- // Check existing version in storage
- MetaData previousVersion = getStorageEngine().getMetadata(token,
- metaData.getUuid(), metaData.getVersion());
- // Version rules
- if (previousVersion != null) {
- previousVersion.setLatest(false);
-// update(token, previousVersion.getUuid(), previousVersion
-// .getVersion(), previousVersion);
-
- metaData.setLatest(true);
- metaData.setVersion(previousVersion.getVersion().incVersion(0)
- .toString());
- }
+ protected Version incrementVersion(Version version) {
+ return version.incVersion(0);
}
- /**
- * Wrap stream.
- *
- * @param streamToWrap
- * the stream to wrap
- *
- * @return the input stream
- *
- * @throws SimExplorerServiceException
- * the sim explorer service exception
- */
- private InputStream wrapStream(InputStream streamToWrap)
- throws SimExplorerServiceException {
- try {
- RemoteInputStreamServer remoteStream = new SimpleRemoteInputStream(
- streamToWrap);
- return new SimExplorerServiceStream(remoteStream.export());
- } catch (RemoteException e) {
- throw new SimExplorerServiceException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageService#retrieveElementData(java.lang.String, java.lang.String, java.lang.String, fr.cemagref.simexplorer.is.attachment.Attachment)
- */
- public InputStream retrieveElementData(String token, String uuid,
- String version, Attachment attachment)
- throws SimExplorerServiceException {
- return wrapStream(retrieveElementDataCommon(token, uuid, version,
- attachment));
- }
-
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageService#retrieveElementFull(java.lang.String, java.lang.String, java.lang.String)
- */
- public InputStream retrieveElementFull(String token, String uuid,
- String version) throws SimExplorerServiceException {
- return wrapStream(retrieveElementFullCommon(token, uuid, version));
- }
-
- /* (non-Javadoc)
- * @see fr.cemagref.simexplorer.is.service.StorageService#retrieveElementXML(java.lang.String, java.lang.String, java.lang.String)
- */
- public InputStream retrieveElementXML(String token, String uuid,
- String version) throws SimExplorerServiceException {
- return wrapStream(retrieveElementXMLCommon(token, uuid, version));
- }
}
Added: trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceLocalReplace.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceLocalReplace.java (rev 0)
+++ trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceLocalReplace.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -0,0 +1,119 @@
+/*
+* ##% Copyright (C) 2008 Code Lutin, Gabriel Landais
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* 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 General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+* ##% */
+package fr.cemagref.simexplorer.is.service;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+
+import junit.framework.TestCase;
+import fr.cemagref.simexplorer.is.attachment.Attachment;
+import fr.cemagref.simexplorer.is.entities.data.Component;
+import fr.cemagref.simexplorer.is.entities.data.ExplorationApplication;
+import fr.cemagref.simexplorer.is.entities.data.ExplorationData;
+import fr.cemagref.simexplorer.is.entities.data.Library;
+import fr.cemagref.simexplorer.is.entities.metadata.MetaData;
+import fr.cemagref.simexplorer.is.factories.BaseEntityFactory;
+import fr.cemagref.simexplorer.is.factories.MetaDataFactory;
+import fr.cemagref.simexplorer.is.factories.XmlConstants;
+import fr.cemagref.simexplorer.is.service.ElementGenerator.RandomStream;
+
+public class StorageServiceLocalReplace extends TestCase {
+
+ /** The storage service. */
+ private StorageService storageService;
+
+ /** The element generator. */
+ private ElementGenerator elementGenerator;
+
+ /** The r. */
+ private Random r = new Random();
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ elementGenerator = new ElementGenerator();
+
+ storageService = new StorageServiceClient();
+ }
+
+ private MetaData saveEa(ExplorationApplication ea) throws Exception {
+ Map<Attachment, SimExplorerServiceStream> attachments = new HashMap<Attachment, SimExplorerServiceStream>();
+
+ List<Attachment> attachmentsKeys = new ArrayList<Attachment>();
+
+ attachmentsKeys.addAll(ea.getMetaData().getAttachments());
+ Set<Component> components = ea.getComponents();
+ for (Component component : components) {
+ attachmentsKeys.addAll(component.getMetaData().getAttachments());
+ Set<Library> libraries = component.getLibraries();
+ for (Library library : libraries) {
+ attachmentsKeys.addAll(library.getMetaData().getAttachments());
+ }
+ }
+ Set<ExplorationData> explorations = ea.getExplorations();
+ for (ExplorationData explorationData : explorations) {
+ attachmentsKeys.addAll(explorationData.getMetaData()
+ .getAttachments());
+ }
+
+ for (Attachment attachment : attachmentsKeys) {
+ RandomStream randomStream = elementGenerator.generateTextStream();
+ attachment.setDataHash(randomStream.getMd5());
+ SimExplorerServiceStream stream = new SimExplorerServiceStream(
+ randomStream.getStream());
+ attachments.put(attachment, stream);
+ }
+
+ SimExplorerServiceStream xmlStream = new SimExplorerServiceStream(
+ BaseEntityFactory.getFactory(ExplorationApplication.class)
+ .saveElement(XmlConstants.VALUE_METADATA_TYPE_EA, ea));
+
+ return storageService.saveElement(null, xmlStream, attachments);
+ }
+
+ public void testReplace() throws Exception {
+ ExplorationApplication ea;
+ MetaData mde;
+ InputStream stream;
+
+ MetaDataFactory<MetaData> mdeFactory = MetaDataFactory
+ .getFactory(MetaData.class);
+
+ ea = elementGenerator.generateRandomEA();
+ mde = saveEa(ea);
+ stream = storageService.retrieveElementXML(null, mde.getUuid(), mde
+ .getVersion().toString());
+ System.out.println(mdeFactory.computeHash(stream));
+
+ ea.getMetaData().setVersion(
+ ea.getMetaData().getVersion().incVersion(0).toString());
+
+ mde = saveEa(ea);
+ stream = storageService.retrieveElementXML(null, mde.getUuid(), mde
+ .getVersion().toString());
+ System.out.println(mdeFactory.computeHash(stream));
+ }
+}
Modified: trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceMassInsert.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceMassInsert.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceMassInsert.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -80,8 +80,7 @@
/**
* Test mass insert.
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public void testMassInsert() throws Exception {
int c = 5;
@@ -106,7 +105,7 @@
ea.getMetaData().getVersion().incVersion(r.nextInt(3))
.toString());
- Map<Attachment, RemoteInputStream> attachments = new HashMap<Attachment, RemoteInputStream>();
+ Map<Attachment, SimExplorerServiceStream> attachments = new HashMap<Attachment, SimExplorerServiceStream>();
List<Attachment> attachmentsKeys = new ArrayList<Attachment>();
@@ -131,19 +130,17 @@
RandomStream randomStream = elementGenerator
.generateTextStream();
attachment.setDataHash(randomStream.getMd5());
- RemoteInputStreamServer remoteStream = new SimpleRemoteInputStream(
+ SimExplorerServiceStream stream = new SimExplorerServiceStream(
randomStream.getStream());
- attachments.put(attachment, remoteStream.export());
+ attachments.put(attachment, stream);
}
- InputStream xmlStream = BaseEntityFactory.getFactory(
- ExplorationApplication.class).saveElement(
- XmlConstants.VALUE_METADATA_TYPE_EA, ea);
+ SimExplorerServiceStream xmlStream = new SimExplorerServiceStream(
+ BaseEntityFactory.getFactory(
+ ExplorationApplication.class).saveElement(
+ XmlConstants.VALUE_METADATA_TYPE_EA, ea));
- RemoteInputStreamServer xmlRemoteStream = new SimpleRemoteInputStream(
- xmlStream);
- storageService.saveElement(token, xmlRemoteStream.export(),
- attachments);
+ storageService.saveElement(token, xmlStream, attachments);
}
if (i > 0 && i % 100 == 0) {
Modified: trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceTest.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceTest.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-service/src/test/fr/cemagref/simexplorer/is/service/StorageServiceTest.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -56,7 +56,7 @@
public void testInsertElementZip() throws Exception {
InputStream zipStream = new FileInputStream(
"./src/ressources/testImport/test.zip");
- RemoteInputStreamServer zipRemoteStream = new SimpleRemoteInputStream(
+ SimExplorerServiceStream zipRemoteStream = new SimExplorerServiceStream(
zipStream);
storageService.saveElement(null, zipRemoteStream);
assertNotNull(storageService.getMetadata(null, "abcd"));
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service/MockStorageServiceImpl.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service/MockStorageServiceImpl.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service/MockStorageServiceImpl.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -60,14 +60,14 @@
throw new IllegalStateException("not implemented");
}
- public MetaData saveElement(String token, RemoteInputStream zipRemoteStream)
+ public MetaData saveElement(String token, SimExplorerServiceStream zipRemoteStream)
throws SimExplorerServiceException {
return (MetaData) checkImplemented();
}
public MetaData saveElement(String token,
- RemoteInputStream xmlRemoteStream,
- Map<Attachment, RemoteInputStream> attachmentsRemoteStream)
+ SimExplorerServiceStream xmlRemoteStream,
+ Map<Attachment, SimExplorerServiceStream> attachmentsRemoteStream)
throws SimExplorerServiceException {
return (MetaData) checkImplemented();
}
Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementImport.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementImport.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementImport.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -25,6 +25,7 @@
import de.hsofttec.t5components.annotations.SetterGetter;
import fr.cemagref.simexplorer.is.entities.metadata.MetaData;
+import fr.cemagref.simexplorer.is.service.SimExplorerServiceStream;
import fr.cemagref.simexplorer.is.ui.web.SimExplorerWebException;
import fr.cemagref.simexplorer.is.ui.web.pages.security.UserPage;
import fr.cemagref.simexplorer.is.ui.web.services.RemoteStorageService;
@@ -54,21 +55,29 @@
public Object onSuccess() {
MetaData mde = null;
if (_fileEA != null) {
- RemoteInputStreamServer zipRemoteStream = new SimpleRemoteInputStream(
+ SimExplorerServiceStream zipStream = new SimExplorerServiceStream(
_fileEA.getStream());
+ // RemoteInputStreamServer zipRemoteStream = new SimpleRemoteInputStream(
+ // _fileEA.getStream());
try {
+ // mde = RemoteStorageService.getStorageService().saveElement(
+ // getToken(), zipRemoteStream.export());
mde = RemoteStorageService.getStorageService().saveElement(
- getToken(), zipRemoteStream.export());
+ getToken(), zipStream);
} catch (Exception e) {
throw new SimExplorerWebException(e);
}
} else {
if (_fileLib != null) {
- RemoteInputStreamServer zipRemoteStream = new SimpleRemoteInputStream(
+ SimExplorerServiceStream zipStream = new SimExplorerServiceStream(
_fileLib.getStream());
+ // RemoteInputStreamServer zipRemoteStream = new SimpleRemoteInputStream(
+ // _fileLib.getStream());
try {
+ // mde = RemoteStorageService.getStorageService().saveElement(
+ // getToken(), zipRemoteStream.export());
mde = RemoteStorageService.getStorageService().saveElement(
- getToken(), zipRemoteStream.export());
+ getToken(), zipStream);
} catch (Exception e) {
throw new SimExplorerWebException();
}
Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java 2008-02-12 18:19:23 UTC (rev 872)
+++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java 2008-02-12 18:20:30 UTC (rev 873)
@@ -27,10 +27,6 @@
import org.apache.tapestry.annotations.InjectPage;
-import com.healthmarketscience.rmiio.RemoteInputStream;
-import com.healthmarketscience.rmiio.RemoteInputStreamServer;
-import com.healthmarketscience.rmiio.SimpleRemoteInputStream;
-
import fr.cemagref.simexplorer.is.attachment.Attachment;
import fr.cemagref.simexplorer.is.entities.data.Component;
import fr.cemagref.simexplorer.is.entities.data.ExplorationApplication;
@@ -40,6 +36,7 @@
import fr.cemagref.simexplorer.is.factories.BaseEntityFactory;
import fr.cemagref.simexplorer.is.factories.XmlConstants;
import fr.cemagref.simexplorer.is.service.ElementGenerator;
+import fr.cemagref.simexplorer.is.service.SimExplorerServiceStream;
import fr.cemagref.simexplorer.is.service.ElementGenerator.RandomStream;
import fr.cemagref.simexplorer.is.ui.web.SimExplorerWebException;
import fr.cemagref.simexplorer.is.ui.web.pages.security.SuperAdminPage;
@@ -81,17 +78,18 @@
parentEa = elementGenerator.generateRandomEA();
int v = 2 + r.nextInt(5);
- Version version = new Version(parentEa.getMetaData().getVersion().toString());
+ Version version = new Version(parentEa.getMetaData()
+ .getVersion().toString());
- for (int j = 0; j < v; j++) {
+ for (int j = 0; j < v; j++) {
ExplorationApplication ea = elementGenerator
.generateRandomEA();
ea.getMetaData().setUuid(parentEa.getMetaData().getUuid());
-
+
version = version.incVersion(r.nextInt(3));
ea.getMetaData().setVersion(version.toString());
- Map<Attachment, RemoteInputStream> attachments = new HashMap<Attachment, RemoteInputStream>();
+ Map<Attachment, SimExplorerServiceStream> attachments = new HashMap<Attachment, SimExplorerServiceStream>();
List<Attachment> attachmentsKeys = new ArrayList<Attachment>();
@@ -116,19 +114,19 @@
RandomStream randomStream = elementGenerator
.generateTextStream();
attachment.setDataHash(randomStream.getMd5());
- RemoteInputStreamServer remoteStream = new SimpleRemoteInputStream(
+ SimExplorerServiceStream remoteStream = new SimExplorerServiceStream(
randomStream.getStream());
- attachments.put(attachment, remoteStream.export());
+ attachments.put(attachment, remoteStream);
}
InputStream xmlStream = BaseEntityFactory.getFactory(
ExplorationApplication.class).saveElement(
XmlConstants.VALUE_METADATA_TYPE_EA, ea);
- RemoteInputStreamServer xmlRemoteStream = new SimpleRemoteInputStream(
+ SimExplorerServiceStream xmlRemoteStream = new SimExplorerServiceStream(
xmlStream);
RemoteStorageService.getStorageService().saveElement(
- getToken(), xmlRemoteStream.export(), attachments);
+ getToken(), xmlRemoteStream, attachments);
}
}
1
0
r872 - trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine
by glandais@users.labs.libre-entreprise.org 12 Feb '08
by glandais@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: glandais
Date: 2008-02-12 18:19:23 +0000 (Tue, 12 Feb 2008)
New Revision: 872
Modified:
trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java
trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java
Log:
Ability to replace temp data
Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java 2008-02-12 18:17:27 UTC (rev 871)
+++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java 2008-02-12 18:19:23 UTC (rev 872)
@@ -292,6 +292,20 @@
throws SimExplorerStorageException;
/**
+ * Store temporary data, for stream duplication.
+ *
+ * @param stream
+ * Stream to store
+ *
+ * @return id for retrieval
+ *
+ * @throws SimExplorerStorageException
+ * the sim explorer storage exception
+ */
+ public abstract void storeTempData(String id, InputStream stream)
+ throws SimExplorerStorageException;
+
+ /**
* Retrieve temporary data.
*
* @param id
Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java 2008-02-12 18:17:27 UTC (rev 871)
+++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java 2008-02-12 18:19:23 UTC (rev 872)
@@ -272,10 +272,16 @@
public String storeTempData(InputStream stream)
throws SimExplorerStorageException {
String id = UUID.randomUUID().toString();
- attachmentHandler.storeData(mdTmp, getTmpAttachment(id), stream);
+ storeTempData(id, stream);
return id;
}
+ @Override
+ public void storeTempData(String id, InputStream stream)
+ throws SimExplorerStorageException {
+ attachmentHandler.storeData(mdTmp, getTmpAttachment(id), stream);
+ }
+
/* (non-Javadoc)
* @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#retrieveTempData(java.lang.String)
*/
1
0
r871 - trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service
by glandais@users.labs.libre-entreprise.org 12 Feb '08
by glandais@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: glandais
Date: 2008-02-12 18:17:27 +0000 (Tue, 12 Feb 2008)
New Revision: 871
Modified:
trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/SimExplorerServiceStream.java
Log:
Magic stream clean up with transient trick for detecting remote mode
Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/SimExplorerServiceStream.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/SimExplorerServiceStream.java 2008-02-12 18:16:40 UTC (rev 870)
+++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/SimExplorerServiceStream.java 2008-02-12 18:17:27 UTC (rev 871)
@@ -21,55 +21,70 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
+import java.rmi.RemoteException;
import com.healthmarketscience.rmiio.RemoteInputStream;
import com.healthmarketscience.rmiio.RemoteInputStreamClient;
+import com.healthmarketscience.rmiio.SimpleRemoteInputStream;
/**
* The Class SimExplorerServiceStream.
+ *
+ * Simplify usage of remote streams.
+ *
+ * To allow magic remoting, your
+ * stream has to encapsulated in a SimExplorerServiceStream with
+ *
+ * <code>
+ * SimExplorerServiceStream serviceStream = new SimExplorerServiceStream(myStream);
+ * service.method(serviceStream);
+ * </code>
+ *
+ * Stream will work, even through a RMI call.
+ *
*/
public class SimExplorerServiceStream extends InputStream implements
Serializable {
private static final long serialVersionUID = 1976003275577858320L;
- /** The ris. */
+ /** The remote output stream from RMIIO, used for serializing stream. */
private RemoteInputStream ris;
- /** The bis. */
- private BufferedInputStream bis;
+ /** The local stream, set to null if stream is serialized. */
+ transient private BufferedInputStream bis;
/**
- * Instantiates a new sim explorer service stream.
+ * Instantiates a new stream.
*
- * @param ris
- * the ris
+ * @param bis the bis
*/
- public SimExplorerServiceStream(RemoteInputStream ris) {
- super();
- this.ris = ris;
- }
-
- /**
- * Instantiates a new sim explorer service stream.
- *
- * @param bis
- * the bis
- */
public SimExplorerServiceStream(InputStream bis) {
super();
+ // Set local stream (null if this is serialized)
this.bis = new BufferedInputStream(bis);
+ try {
+ // Create a stub if possible, used in init
+ this.ris = new SimpleRemoteInputStream(bis).export();
+ } catch (RemoteException e) {
+ this.ris = null;
+ }
}
/**
- * Inits the.
+ * Inits the local stream.
+ *
+ * Called before every delegated method
*/
private void init() {
+ // Check is local stream is ok
if (bis == null) {
try {
+ // Otherwise use RMIIO to retrieve remote stream
this.bis = new BufferedInputStream(RemoteInputStreamClient
.wrap(ris));
} catch (IOException e) {
+ // Something went wrong during transformation
throw new RuntimeException(e);
}
}
1
0
r870 - trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories
by glandais@users.labs.libre-entreprise.org 12 Feb '08
by glandais@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: glandais
Date: 2008-02-12 18:16:40 +0000 (Tue, 12 Feb 2008)
New Revision: 870
Modified:
trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java
Log:
- replace metadata information in a LE xml stream
- compute hash of a xml stream without metadatas
Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java 2008-02-12 18:15:41 UTC (rev 869)
+++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java 2008-02-12 18:16:40 UTC (rev 870)
@@ -18,6 +18,8 @@
package fr.cemagref.simexplorer.is.factories;
import java.io.InputStream;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@@ -26,8 +28,14 @@
import java.util.Map;
import java.util.Set;
+import javax.xml.transform.dom.DOMSource;
+
+import org.codelutin.util.DigestGenerator;
+import org.codelutin.util.MD5;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
import fr.cemagref.simexplorer.is.attachment.Attachment;
import fr.cemagref.simexplorer.is.attachment.ContentType;
@@ -37,8 +45,7 @@
/**
* A factory for creating MetaData objects.
*
- * @param <E>
- * MetaData
+ * @param <E> MetaData
*/
public class MetaDataFactory<E extends MetaData> extends
BaseEntityFactory<MetaData> {
@@ -58,16 +65,13 @@
/**
* Gets the factory.
*
- * @param <E>
- * Metadata
+ * @param <E> Metadata
*
- * @param entityClass
- * the entity class
+ * @param entityClass the entity class
*
* @return the factory
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
@SuppressWarnings( { "unchecked" })
public static <E extends MetaData> MetaDataFactory<E> getFactory(
@@ -254,16 +258,14 @@
}
/**
- * As metadata is stored inside an entity, this method loads metadata with
- * parsing stream and retrieve metadata node.
+ * As metadata is stored inside an entity, this method loads metadata with parsing stream and retrieve metadata
+ * node.
*
- * @param xmlStream
- * the xml stream
+ * @param xmlStream the xml stream
*
* @return the meta data
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public MetaData loadElementFromParentXML(InputStream xmlStream)
throws Exception {
@@ -275,4 +277,66 @@
return mde;
}
+ /**
+ * Replace element in parent xml.
+ *
+ * @param xmlStream the xml stream
+ * @param newMetadata the new metadata
+ *
+ * @return the input stream
+ *
+ * @throws Exception the exception
+ */
+ public InputStream replaceElementInParentXML(InputStream xmlStream,
+ MetaData newMetadata) throws Exception {
+ Document document = getXMLBuilder().parse(xmlStream);
+ Element rootElement = (Element) document.getFirstChild();
+
+ Element newElement = document.createElement(KEY_METADATA);
+ this.saveElement(document, newElement, newMetadata);
+
+ Element oldElement = getXMLElementByTagName(rootElement, KEY_METADATA);
+ rootElement.replaceChild(newElement, oldElement);
+
+ DOMSource domSource = new DOMSource(document);
+
+ PipedOutputStream os = new PipedOutputStream();
+ PipedInputStream is = new PipedInputStream(os);
+
+ XMLStreamEncoder xse = new XMLStreamEncoder(domSource, os);
+ xse.start();
+
+ return is;
+ }
+
+ public String computeHash(InputStream xmlStream) throws Exception {
+ Document document = getXMLBuilder().parse(xmlStream);
+
+ DigestGenerator digestGenerator = new DigestGenerator();
+ byte[] digest = digestGenerator.getDigest(document,
+ DigestGenerator.sha1DigestAlgorithm);
+
+ return MD5.asHex(digest);
+ }
+
+ private int removeMetadatas(Document document, Node node) {
+ int tot = 0;
+ NodeList childNodes = node.getChildNodes();
+ List<Node> toRemove = new ArrayList<Node>();
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ Node child = childNodes.item(i);
+ if (child instanceof Element
+ && KEY_METADATA.equals(((Element) child).getTagName())) {
+ toRemove.add(child);
+ } else {
+ tot = tot + removeMetadatas(document, child);
+ }
+ }
+ for (Node metadata : toRemove) {
+ node.removeChild(metadata);
+ tot++;
+ }
+ return tot;
+ }
+
}
1
0
r869 - trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories
by glandais@users.labs.libre-entreprise.org 12 Feb '08
by glandais@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: glandais
Date: 2008-02-12 18:15:41 +0000 (Tue, 12 Feb 2008)
New Revision: 869
Modified:
trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/BaseEntityFactory.java
Log:
reformat
Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/BaseEntityFactory.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/BaseEntityFactory.java 2008-02-12 17:34:11 UTC (rev 868)
+++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/factories/BaseEntityFactory.java 2008-02-12 18:15:41 UTC (rev 869)
@@ -20,11 +20,27 @@
import java.io.InputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import javax.xml.crypto.dom.DOMStructure;
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.DigestMethod;
+import javax.xml.crypto.dsig.Reference;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.SignedInfo;
+import javax.xml.crypto.dsig.XMLSignature;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+import javax.xml.crypto.dsig.dom.DOMSignContext;
+import javax.xml.crypto.dsig.keyinfo.KeyInfo;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;
@@ -40,6 +56,7 @@
/**
* A factory for creating BaseEntity objects.
+ *
* @param <E> Entity type
*/
public abstract class BaseEntityFactory<E extends BaseEntity> implements
@@ -57,15 +74,14 @@
/**
* Retrieve instance of the factory.
+ *
* @param <E> Entity type
*
- * @param entityClass
- * Class wanted
+ * @param entityClass Class wanted
*
* @return Factory
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
@SuppressWarnings("unchecked")
public static <E extends DataEntity> BaseEntityFactory<E> getFactory(
@@ -90,13 +106,11 @@
/**
* Retrieve a factory with class name.
*
- * @param entityClassName
- * the entity class name
+ * @param entityClassName the entity class name
*
* @return the factory
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public static BaseEntityFactory<? extends DataEntity> getFactory(
String entityClassName) throws Exception {
@@ -110,8 +124,7 @@
*
* @return XML document builder
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public static synchronized DocumentBuilder getXMLBuilder() throws Exception {
if (documentBuilder == null) {
@@ -137,13 +150,11 @@
/**
* Load an element from an XML node.
*
- * @param xmlElement
- * the xml element
+ * @param xmlElement the xml element
*
* @return the E
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public E loadElement(Element xmlElement) throws Exception {
E element = createInstance();
@@ -153,13 +164,11 @@
/**
* Load an element from a XML stream.
*
- * @param stream
- * the stream
+ * @param stream the stream
*
* @return the E
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public E loadElement(InputStream stream) throws Exception {
Document document = getXMLBuilder().parse(stream);
@@ -171,15 +180,11 @@
/**
* Save an element to a XML node.
*
- * @param document
- * XML document
- * @param xmlElement
- * XML node storing the element (not null)
- * @param element
- * Element to save
+ * @param document XML document
+ * @param xmlElement XML node storing the element (not null)
+ * @param element Element to save
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public abstract void saveElement(Document document, Element xmlElement,
E element) throws Exception;
@@ -187,15 +192,12 @@
/**
* Save an element to a XML stream.
*
- * @param rootNodeName
- * the root node name
- * @param element
- * the element
+ * @param rootNodeName the root node name
+ * @param element the element
*
* @return the input stream
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public InputStream saveElement(String rootNodeName, E element)
throws Exception {
@@ -220,29 +222,32 @@
return is;
}
+ public String signXmlElement(Element xmlElement) throws Exception {
+ String result = "";
+
+
+
+ return result;
+ }
+
/*
* Collection methods : Help load/save of inner collections
*/
/**
* Load a collection inside a node.
+ *
* @param <T> Entity type
*
- * @param tagSetName
- * Tag of the node of the collection
- * @param tagName
- * Tag of the node containing an item
- * @param clazz
- * Class type
- * @param xmlElement
- * Node containing the collection
- * @param parentData
- * Element holding the collection
+ * @param tagSetName Tag of the node of the collection
+ * @param tagName Tag of the node containing an item
+ * @param clazz Class type
+ * @param xmlElement Node containing the collection
+ * @param parentData Element holding the collection
*
* @return the set< t>
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public <T extends DataEntity> Set<T> loadCollection(String tagSetName,
String tagName, Class<T> clazz, Element xmlElement,
@@ -270,23 +275,17 @@
/**
* Save a collection of elements to XML node.
+ *
* @param <T> Entity type
*
- * @param entities
- * the entities
- * @param tagSetName
- * the tag set name
- * @param tagName
- * the tag name
- * @param clazz
- * the clazz
- * @param document
- * the document
- * @param xmlElement
- * the xml element
+ * @param entities the entities
+ * @param tagSetName the tag set name
+ * @param tagName the tag name
+ * @param clazz the clazz
+ * @param document the document
+ * @param xmlElement the xml element
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public <T extends DataEntity> void saveCollection(Set<T> entities,
String tagSetName, String tagName, Class<T> clazz,
@@ -306,13 +305,11 @@
/**
* Save an element as a XML stream.
*
- * @param node
- * the node
+ * @param node the node
*
* @return the input stream
*
- * @throws Exception
- * the exception
+ * @throws Exception the exception
*/
public static InputStream serializeElement(Element node) throws Exception {
org.w3c.dom.Document xmlDocument = getXMLBuilder().newDocument();
@@ -339,14 +336,10 @@
/**
* Set a property in XML.
*
- * @param document
- * XML document
- * @param xmlElement
- * Node to modify
- * @param tagName
- * Tag of created node
- * @param value
- * Value of node
+ * @param document XML document
+ * @param xmlElement Node to modify
+ * @param tagName Tag of created node
+ * @param value Value of node
*/
protected void setXMLProperty(Document document, Element xmlElement,
String tagName, Object value) {
@@ -361,10 +354,8 @@
/**
* Get a property in XML.
*
- * @param xmlElement
- * Source node
- * @param tagName
- * Tag name of property
+ * @param xmlElement Source node
+ * @param tagName Tag name of property
*
* @return Property value
*/
@@ -383,10 +374,8 @@
/**
* Retrieve XML element just under with specified tag name.
*
- * @param xmlElement
- * the xml element
- * @param tagName
- * the tag name
+ * @param xmlElement the xml element
+ * @param tagName the tag name
*
* @return First child element with tagName
*/
@@ -401,10 +390,8 @@
/**
* Retrieve all XML elements just under with specified tag name.
*
- * @param xmlElement
- * the xml element
- * @param tagName
- * the tag name
+ * @param xmlElement the xml element
+ * @param tagName the tag name
*
* @return Children with tagName
*/
1
0
r868 - trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions
by tchemit@users.labs.libre-entreprise.org 12 Feb '08
by tchemit@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: tchemit
Date: 2008-02-12 17:34:11 +0000 (Tue, 12 Feb 2008)
New Revision: 868
Modified:
trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ShowDetailTabAction.java
Log:
mauvais nom d'action
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ShowDetailTabAction.java
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ShowDetailTabAction.java 2008-02-12 17:11:54 UTC (rev 867)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ShowDetailTabAction.java 2008-02-12 17:34:11 UTC (rev 868)
@@ -237,7 +237,7 @@
// preparation de l'action de synchronisation
ShowSynchronizeTabAction synchronizeAction;
- synchronizeAction = (ShowSynchronizeTabAction) SimExplorerActionManager.newAction("synchronizeElement", (AbstractButton) null);
+ synchronizeAction = (ShowSynchronizeTabAction) SimExplorerActionManager.newAction("showTab_synchronize", (AbstractButton) null);
synchronizeAction.setRemote(isRemote());
synchronizeAction.setUuid(metas.getUuid());
synchronizeAction.setVersion(metas.getVersion());
1
0
r867 - in trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing: . util
by tchemit@users.labs.libre-entreprise.org 12 Feb '08
by tchemit@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: tchemit
Date: 2008-02-12 17:11:54 +0000 (Tue, 12 Feb 2008)
New Revision: 867
Modified:
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JDetailTab.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JListTab.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JSynchronizeTab.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ChooseFile.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ChooseFilePanel.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ErrorDialog.jaxx
Log:
jaxx supporte i18n, suppression de tous les appels I18n._ + suppression des imports statiques desormais inutiles
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JDetailTab.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JDetailTab.jaxx 2008-02-12 13:59:02 UTC (rev 866)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JDetailTab.jaxx 2008-02-12 17:11:54 UTC (rev 867)
@@ -6,7 +6,7 @@
<row>
<cell weightx="1" fill='horizontal'>
<JPanel opaque='false' >
- <JLabel id='navigationHeader' text='{_("simexplorer.node.navigation")}'/>
+ <JLabel id='navigationHeader' text='simexplorer.node.navigation'/>
</JPanel>
</cell>
<cell anchor="east">
@@ -50,7 +50,7 @@
<Table id='detail' insets='2,2,2,1'>
<row fill='vertical'>
<cell anchor='west'>
- <JLabel text='{_("simexplorer.common.name")}'/>
+ <JLabel text='simexplorer.common.name'/>
</cell>
<cell weightx="1" anchor='west'>
<JLabel id='detailName'/>
@@ -58,7 +58,7 @@
</row>
<row fill='vertical'>
<cell anchor='west'>
- <JLabel text='{_("simexplorer.common.type")}'/>
+ <JLabel text='simexplorer.common.type'/>
</cell>
<cell weightx="1" anchor='west'>
<JLabel id='detailType'/>
@@ -66,7 +66,7 @@
</row>
<row>
<cell anchor='west'>
- <JLabel text='{_("simexplorer.common.version")}'/>
+ <JLabel text='simexplorer.common.version'/>
</cell>
<cell weightx="1" anchor='west'>
<JComboBox id='detailVersions' model='{new DefaultComboBoxModel()}'/>
@@ -74,7 +74,7 @@
</row>
<row fill='vertical'>
<cell anchor='west'>
- <JLabel text='{_("simexplorer.common.description")}'/>
+ <JLabel text='simexplorer.common.description'/>
</cell>
<cell fill='horizontal' weightx="2" anchor='west'>
<JLabel id='detailDescription'/>
@@ -82,7 +82,7 @@
</row>
<row fill='vertical'>
<cell anchor='west'>
- <JLabel text='{_("simexplorer.common.creationDate")}'/>
+ <JLabel text='simexplorer.common.creationDate'/>
</cell>
<cell anchor='west'>
<JLabel id='detailCreationDate'/>
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JListTab.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JListTab.jaxx 2008-02-12 13:59:02 UTC (rev 866)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JListTab.jaxx 2008-02-12 17:11:54 UTC (rev 867)
@@ -11,7 +11,7 @@
</JPopupMenu>
<JToolBar>
<JButton id='importElement'/>
- <JTextField id='searchText' toolTipText='{_("simexplorer.action.searchText.tooltip")}'/>
+ <JTextField id='searchText' toolTipText='simexplorer.action.searchText.tooltip'/>
<JButton id='search'/>
<JButton id='resetSearch'/>
<JButton id='advancedSearch'/>
@@ -41,7 +41,7 @@
<JButton id='goFirstPage' enabled='{goPage.getSelectedIndex()>0}'/>
<JButton id='goPreviousPage' enabled='{goPage.getSelectedIndex()>0}'/>
<JPanel layout='{new GridLayout(0, 2, 0, 0)}'>
- <JLabel id='currentPage' text='{_("simexplorer.action.currentPage")}' labelFor="{goPage}" font-size='9'/>
+ <JLabel id='currentPage' text='simexplorer.action.currentPage' labelFor="{goPage}" font-size='9'/>
<JComboBox id='goPage' enabled='false' font-size='9' opaque='false' preferredSize='{new Dimension(50,5)}'/>
</JPanel>
<JButton id='goNextPage'/>
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JSynchronizeTab.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JSynchronizeTab.jaxx 2008-02-12 13:59:02 UTC (rev 866)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JSynchronizeTab.jaxx 2008-02-12 17:11:54 UTC (rev 867)
@@ -8,7 +8,7 @@
<JPanel>
<JLabel id='navigationHeaderLocal'
icon='{createImageIcon("action/local.png")}'
- text='{_("simexplorer.node.navigation.local")}'/>
+ text='simexplorer.node.navigation.local'/>
</JPanel>
</cell>
<cell anchor="east">
@@ -29,7 +29,7 @@
<JPanel>
<JLabel id='navigationHeaderRemote'
icon='{createImageIcon("action/remote.png")}'
- text='{_("simexplorer.node.navigation.remote")}'/>
+ text='simexplorer.node.navigation.remote'/>
</JPanel>
</cell>
<cell anchor="east">
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx 2008-02-12 13:59:02 UTC (rev 866)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx 2008-02-12 17:11:54 UTC (rev 867)
@@ -1,9 +1,9 @@
-<JFrame name="mainFrame" title='{_("simexplorer.main.ui.title")}'
+<JFrame name="mainFrame" title='simexplorer.main.ui.title'
defaultCloseOperation='DISPOSE_ON_CLOSE' width='700' height='536'>
- <style source="/common.css"/>
+ <style source="/common.css"/>
<JMenuBar>
<!-- menu principal -->
- <JMenu text='{_("simexplorer.main.menu")}' mnemonic="{'M'}">
+ <JMenu text='simexplorer.main.menu' mnemonic="{'M'}">
<JMenuItem id="connect"/>
<JMenuItem id="unconnect"/>
<JSeparator/>
@@ -13,8 +13,8 @@
<JMenuItem id="quit"/>
</JMenu>
<!-- menu config -->
- <JMenu text='{_("simexplorer.config.menu")}' mnemonic="{'C'}">
- <JMenu text='{_("simexplorer.config.i18n.menu")}' mnemonic="{'L'}"
+ <JMenu text='simexplorer.config.menu' mnemonic="{'C'}">
+ <JMenu text='simexplorer.config.i18n.menu' mnemonic="{'L'}"
icon='{createImageIcon("action/translate.png")}'>
<JMenuItem id="i18n_fr_FR"/>
<JMenuItem id="i18n_en_GB"/>
@@ -22,7 +22,7 @@
<JMenuItem id="config"/>
</JMenu>
<!-- menu aide -->
- <JMenu text='{_("simexplorer.help.menu")}' mnemonic="{'e'}">
+ <JMenu text='simexplorer.help.menu' mnemonic="{'e'}">
<JMenuItem id="help"/>
<JMenuItem id="site"/>
<JMenuItem id="about"/>
@@ -51,5 +51,4 @@
</cell>
</row>
</Table>
-
</JFrame>
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ChooseFile.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ChooseFile.jaxx 2008-02-12 13:59:02 UTC (rev 866)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ChooseFile.jaxx 2008-02-12 17:11:54 UTC (rev 867)
@@ -1,7 +1,5 @@
-<JDialog title='{_("simexplorer.error.dialog.title")}'>
+<JDialog title='simexplorer.error.dialog.title'>
<script>
- import static org.codelutin.i18n.I18n._;
- import static jaxx.runtime.UIHelper.createImageIcon;
JRootPane rootPane = getRootPane();
rootPane.setDefaultButton(cancel);
rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "cancel");
@@ -30,8 +28,8 @@
<row fill='horizontal'>
<cell>
<JPanel layout='{new GridLayout(1, 0, 6, 6)}'>
- <JButton id='ok' text='{_("simexplorer.common.ok")}' onActionPerformed='doOk()'/>
- <JButton id='cancel' text='{_("simexplorer.common.cancel")}' onActionPerformed='doCancel()'/>
+ <JButton id='ok' text='simexplorer.common.ok' onActionPerformed='doOk()'/>
+ <JButton id='cancel' text='simexplorer.common.cancel' onActionPerformed='doCancel()'/>
</JPanel>
</cell>
</row>
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ChooseFilePanel.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ChooseFilePanel.jaxx 2008-02-12 13:59:02 UTC (rev 866)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ChooseFilePanel.jaxx 2008-02-12 17:11:54 UTC (rev 867)
@@ -1,8 +1,5 @@
<Table>
<script>
-import static org.codelutin.i18n.I18n._;
-import static jaxx.runtime.UIHelper.createImageIcon;
-
protected void chooseDir() {
String dir= org.codelutin.util.FileUtil.getDirectory();
if (dir!=null) {
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ErrorDialog.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ErrorDialog.jaxx 2008-02-12 13:59:02 UTC (rev 866)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/util/ErrorDialog.jaxx 2008-02-12 17:11:54 UTC (rev 867)
@@ -1,6 +1,5 @@
-<JDialog title='{_("simexplorer.error.dialog.title")}'>
+<JDialog title='simexplorer.error.dialog.title'>
<script>
- import static org.codelutin.i18n.I18n._;
JRootPane rootPane = getRootPane();
rootPane.setDefaultButton(close);
rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close");
@@ -10,7 +9,7 @@
<row fill='both'>
<cell>
<JPanel>
- <JLabel text='{_("simexplorer.error.dialog.message")}'/>
+ <JLabel text='simexplorer.error.dialog.message'/>
</JPanel>
</cell>
</row>
@@ -28,7 +27,7 @@
</row>
<row fill='horizontal'>
<cell>
- <JButton id='close' text='{_("simexplorer.common.close")}' onActionPerformed='dispose()'/>
+ <JButton id='close' text='simexplorer.common.close' onActionPerformed='dispose()'/>
</cell>
</row>
</Table>
1
0
r866 - trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing
by tchemit@users.labs.libre-entreprise.org 12 Feb '08
by tchemit@users.labs.libre-entreprise.org 12 Feb '08
12 Feb '08
Author: tchemit
Date: 2008-02-12 13:59:02 +0000 (Tue, 12 Feb 2008)
New Revision: 866
Modified:
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JDetailTab.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JListTab.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JSynchronizeTab.jaxx
trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx
Log:
utilisation JAXXTab + suppression des declarations d'import puisque c'est desormais gere par jaxx
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JDetailTab.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JDetailTab.jaxx 2008-02-12 13:57:32 UTC (rev 865)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JDetailTab.jaxx 2008-02-12 13:59:02 UTC (rev 866)
@@ -1,14 +1,5 @@
-<Table>
+<JAXXTab>
<style source="common.css"/>
- <style>
- .border {
- border:{javax.swing.border.LineBorder.createBlackLineBorder()};
- height:28;
- }
- </style>
- <script>
- import static org.codelutin.i18n.I18n._;
- </script>
<row>
<cell fill='horizontal'>
<Table id='toolbarNavigation' styleClass='border' insets='0,0,0,0'>
@@ -148,4 +139,4 @@
</JSplitPane>
</cell>
</row>
-</Table>
+</JAXXTab>
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JListTab.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JListTab.jaxx 2008-02-12 13:57:32 UTC (rev 865)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JListTab.jaxx 2008-02-12 13:59:02 UTC (rev 866)
@@ -1,8 +1,5 @@
-<Table>
- <style source="common.css"/>
- <script>
- import static org.codelutin.i18n.I18n._;
- </script>
+<JAXXTab>
+ <style source="common.css"/>
<!-- la barre des actions de la liste -->
<row>
<cell fill='horizontal' insets='0,0,0,0'>
@@ -52,4 +49,4 @@
</JToolBar>
</cell>
</row>
-</Table>
+</JAXXTab>
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JSynchronizeTab.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JSynchronizeTab.jaxx 2008-02-12 13:57:32 UTC (rev 865)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/JSynchronizeTab.jaxx 2008-02-12 13:59:02 UTC (rev 866)
@@ -1,15 +1,5 @@
-<Table insets='0,0,0,0'>
+<JAXXTab insets='0,0,0,0'>
<style source="common.css"/>
- <style>
- .border {
- border:{javax.swing.border.LineBorder.createBlackLineBorder()};
- height:28;
- }
- </style>
- <script>
- import static org.codelutin.i18n.I18n._;
- import static jaxx.runtime.UIHelper.createImageIcon;
- </script>
<row>
<cell>
<Table id='toolbarNavigationLocal' styleClass='border' insets='0,0,0,0'>
@@ -88,4 +78,4 @@
</JScrollPane>
</cell>
</row>
-</Table>
+</JAXXTab>
Modified: trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx
===================================================================
--- trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx 2008-02-12 13:57:32 UTC (rev 865)
+++ trunk/simexplorer-is/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/SimExplorerUI.jaxx 2008-02-12 13:59:02 UTC (rev 866)
@@ -1,10 +1,6 @@
<JFrame name="mainFrame" title='{_("simexplorer.main.ui.title")}'
defaultCloseOperation='DISPOSE_ON_CLOSE' width='700' height='536'>
- <style source="/common.css"/>
- <script>
- import static org.codelutin.i18n.I18n._;
- import static jaxx.runtime.UIHelper.createImageIcon;
- </script>
+ <style source="/common.css"/>
<JMenuBar>
<!-- menu principal -->
<JMenu text='{_("simexplorer.main.menu")}' mnemonic="{'M'}">
1
0