Author: pnedonosko
Date: 2009-12-24 09:56:17 -0500 (Thu, 24 Dec 2009)
New Revision: 1166
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/FrozenNodeInitializer.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
Log:
EOXJCR-333 apply workaround for FrozenNodeInitializer in TransientValueData (from JBC),
should be fixed by OPT merge
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/FrozenNodeInitializer.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/FrozenNodeInitializer.java 2009-12-24
14:42:15 UTC (rev 1165)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/FrozenNodeInitializer.java 2009-12-24
14:56:17 UTC (rev 1166)
@@ -104,7 +104,11 @@
List<ValueData> values = new ArrayList<ValueData>();
for (ValueData valueData : property.getValues())
{
- values.add(((TransientValueData)valueData).createTransientCopy());
+ // values.add(((TransientValueData)valueData).createTransientCopy());
+
+ // TODO workaround for JBC branch, issued by the FileRestoreTest
+ TransientValueData tvd = (TransientValueData)valueData;
+ values.add(tvd.createTransientCopy1());
}
boolean mv = property.isMultiValued();
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2009-12-24
14:42:15 UTC (rev 1165)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2009-12-24
14:56:17 UTC (rev 1166)
@@ -426,6 +426,37 @@
return this;
}
}
+
+ /**
+ * Create TransientCopy of data.
+ *
+ * TODO workaround for JBC branch, issued by the FileRestoreTest.
+ *
+ * @return TransientValueData
+ * @throws RepositoryException
+ */
+ public TransientValueData createTransientCopy1() throws RepositoryException
+ {
+ try
+ {
+ if (isByteArray())
+ {
+ // bytes based
+ return new TransientValueData(orderNumber, data, null, null, fileCleaner,
maxBufferSize, tempDirectory,
+ deleteSpoolFile);
+ }
+ else
+ {
+ // stream (or file) based , i.e. shared across sessions
+ return new TransientValueData(orderNumber, null, getAsStream(), null,
fileCleaner, maxBufferSize,
+ tempDirectory, true);
+ }
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
/**
* Create editable ValueData copy.
Show replies by date