Author: dkatayev
Date: 2010-06-09 04:26:14 -0400 (Wed, 09 Jun 2010)
New Revision: 2519
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java
Log:
EXOJCR-751 EXOJCR-732 ported to trunk from 1.14.branch
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java 2010-06-08
15:32:15 UTC (rev 2518)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java 2010-06-09
08:26:14 UTC (rev 2519)
@@ -18,31 +18,29 @@
*/
package org.exoplatform.services.jcr.ext.backup.impl;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.RandomAccessFile;
-import java.util.ArrayList;
-import java.util.List;
-
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
import org.exoplatform.services.jcr.datamodel.ItemData;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.ext.replication.FixupStream;
import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.impl.util.io.SpoolFile;
import org.exoplatform.services.jcr.util.IdGenerator;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.RandomAccessFile;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Created by The eXo Platform SAS.
*
@@ -483,7 +481,7 @@
public void restore() throws IOException
{
// TODO same code as in BackupWorkspaceInitializer?
-
+
List<ItemState> listItemState = itemDataChangesLog.getAllStates();
for (int i = 0; i < this.listFixupStream.size(); i++)
{
@@ -491,12 +489,12 @@
ItemData itemData = itemState.getData();
PersistedPropertyData propertyData = (PersistedPropertyData)itemData;
- ValueData tvd =
-
(ValueData)(propertyData.getValues().get(listFixupStream.get(i).getValueDataId()));
+ TransientValueData tvd =
+
(TransientValueData)(propertyData.getValues().get(listFixupStream.get(i).getValueDataId()));
// re-init the value
- propertyData.getValues().set(listFixupStream.get(i).getValueDataId(),
- new StreamPersistedValueData(tvd.getOrderNumber(), listFile.get(i)));
+ tvd.delegate(new TransientValueData(tvd.getOrderNumber(), null, null, new
SpoolFile(listFile.get(i)
+ .getAbsolutePath()), fileCleaner, -1, null, true));
}
if (listRandomAccessFile != null)
@@ -508,4 +506,4 @@
}
-}
+}
\ No newline at end of file
Show replies by date