tdraier 2005/06/03 18:04:47 CEST
Modified files:
src/java/org/jahia/update/core PatchSlide2b.java
Log:
fixed bad max id,
updates bad contentlength for folder
Revision Changes Path
1.3 +15 -4
jahia_update/src/java/org/jahia/update/core/PatchSlide2b.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia_update/src/java/org/jahia/update/core/PatchSlide2b.java.diff?r1=1.2&r2=1.3&f=h
Index: PatchSlide2b.java
===================================================================
RCS file:
/home/cvs/repository/jahia_update/src/java/org/jahia/update/core/PatchSlide2b.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PatchSlide2b.java 31 May 2005 15:01:31 -0000 1.2
+++ PatchSlide2b.java 3 Jun 2005 16:04:47 -0000 1.3
@@ -32,7 +32,7 @@
ResultSet rs =
dbManager.selectFromTable("jahia_autoids_currentindex","jahia_autoids WHERE
jahia_autoids_tablename='JAHIA_SL2_URI'");
rs.next();
- int uriId = rs.getInt(1);
+ int uriId = rs.getInt(1) + 1;
rs.close();
PreparedStatement selectUri = dbManager.prepareStatement("select
uri_id from jahia_sl2_uri where uri_string=? and namespace=?");
@@ -106,8 +106,9 @@
PreparedStatement getVersion =
dbManager.prepareStatement("select * from jahia_sl2_version where uri_id=?");
PreparedStatement insertVersion =
dbManager.prepareStatement("insert into jahia_sl2_version values(?,?)");
PreparedStatement insertVersionHistory =
dbManager.prepareStatement("insert into jahia_sl2_version_history
values(?,?,?,?)");
- PreparedStatement getProperty =
dbManager.prepareStatement("select * from jahia_sl2_properties where
version_id=?");
+ PreparedStatement getProperty =
dbManager.prepareStatement("select
property_namespace,property_name,property_value from jahia_sl2_properties where
version_id=?");
PreparedStatement insertProperty =
dbManager.prepareStatement("insert into jahia_sl2_properties
values(?,?,?,?,?,?)");
+ PreparedStatement updateProperty =
dbManager.prepareStatement("update jahia_sl2_properties set property_value=?
where version_id=? and property_namespace=? and property_name=?");
rs = dbManager.selectFromTable("uri_id", "jahia_sl2_uri");
while (rs.next()) {
@@ -146,10 +147,20 @@
insertProperty.setString(3,"source");
insertProperty.setString(4,"");
insertProperty.executeUpdate();
- }
+ } else do {
+ if ("DAV:".equals(rs2.getString(1)) &&
+ "getcontentlength".equals(rs2.getString(2)) &&
+ "-1".equals(rs2.getString(3))) {
+ updateProperty.setString(1,"0");
+ updateProperty.setInt(2, uriId);
+ updateProperty.setString(3, rs2.getString(1));
+ updateProperty.setString(4, rs2.getString(2));
+ updateProperty.executeUpdate();
+ }
+ } while (rs2.next());
}
insertProperty.close();
-
+ updateProperty.close();
File f = new
File("WEB-INF/classes/org/apache/slide/slide.properties");
if (f.exists()) {