exo-jcr SVN: r3776 - jcr/trunk.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-01-05 09:08:35 -0500 (Wed, 05 Jan 2011)
New Revision: 3776
Modified:
jcr/trunk/pom.xml
Log:
EXOJCR-1084: excluded jgroups 2.6.13-GA from transitive dependency in jcr parent pom.xml
Modified: jcr/trunk/pom.xml
===================================================================
--- jcr/trunk/pom.xml 2011-01-05 10:47:59 UTC (rev 3775)
+++ jcr/trunk/pom.xml 2011-01-05 14:08:35 UTC (rev 3776)
@@ -382,6 +382,12 @@
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
<version>3.2.6.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>jboss.jbossts</groupId>
@@ -398,16 +404,16 @@
<artifactId>aspectjrt</artifactId>
<version>1.6.8</version>
</dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-core</artifactId>
- <version>4.1.0.FINAL</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-cachestore-jdbc</artifactId>
- <version>4.1.0.FINAL</version>
- </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-core</artifactId>
+ <version>4.1.0.FINAL</version>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-cachestore-jdbc</artifactId>
+ <version>4.1.0.FINAL</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<dependencies>
13 years, 5 months
exo-jcr SVN: r3775 - jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-01-05 05:47:59 -0500 (Wed, 05 Jan 2011)
New Revision: 3775
Modified:
jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
Log:
JCR-1557: added try-catch section to prevent deploy failure of correct groovy scripts
Modified: jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2011-01-05 08:57:01 UTC (rev 3774)
+++ jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2011-01-05 10:47:59 UTC (rev 3775)
@@ -429,9 +429,15 @@
{
continue;
}
-
- loadScript(new NodeScriptKey(repositoryName, workspaceName, node), node.getPath(), node.getProperty(
- "jcr:data").getStream());
+ try
+ {
+ loadScript(new NodeScriptKey(repositoryName, workspaceName, node), node.getPath(),
+ node.getProperty("jcr:data").getStream());
+ }
+ catch (Exception e)
+ {
+ LOG.error("Error occured while trying to load script " + node.getParent().getName());
+ }
}
session.getWorkspace().getObservationManager().addEventListener(
13 years, 5 months
exo-jcr SVN: r3774 - jcr/branches/1.12.x/exo.jcr.component.ext/src/test/resources/conf/standalone.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-01-05 03:57:01 -0500 (Wed, 05 Jan 2011)
New Revision: 3774
Modified:
jcr/branches/1.12.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
Log:
JCR-1502: remove unessasary components from configuration
Modified: jcr/branches/1.12.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2011-01-05 08:29:01 UTC (rev 3773)
+++ jcr/branches/1.12.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2011-01-05 08:57:01 UTC (rev 3774)
@@ -375,52 +375,6 @@
</init-params>
</component -->
- <component>
- <key>org.exoplatform.services.database.creator.DBCreator</key>
- <type>org.exoplatform.services.database.creator.DBCreator</type>
- <init-params>
- <properties-param>
- <name>db-connection</name>
- <description>database connection properties</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/" />
- <property name="username" value="sa" />
- <property name="password" value="" />
- </properties-param>
- <properties-param>
- <name>db-creation</name>
- <description>database creation properties</description>
- <property name="scriptPath" value="src/test/resources/test.sql" />
- <property name="username" value="sa" />
- <property name="password" value="" />
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.rpc.RPCService</key>
- <type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type>
- <init-params>
- <value-param>
- <name>jgroups-configuration</name>
- <value>jar:/conf/standalone/udp-mux.xml</value>
- </value-param>
- <value-param>
- <name>jgroups-cluster-name</name>
- <value>RPCService-Cluster</value>
- </value-param>
- <value-param>
- <name>jgroups-default-timeout</name>
- <value>0</value>
- </value-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationService</key>
- <type>org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl</type>
- </component>
-
<!-- component>
<key>org.exoplatform.services.organization.OrganizationService</key>
<type>org.exoplatform.services.organization.hibernate.OrganizationServiceImpl</type>
13 years, 5 months
exo-jcr SVN: r3773 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-01-05 03:29:01 -0500 (Wed, 05 Jan 2011)
New Revision: 3773
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
Log:
EXOJCR-1140 : locks are now removed only on startup
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2011-01-05 08:07:48 UTC (rev 3772)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2011-01-05 08:29:01 UTC (rev 3773)
@@ -273,14 +273,6 @@
{
log.debug("Stoping FileSystemLockPersister");
}
- try
- {
- removeAll();
- }
- catch (LockException e)
- {
- log.error(e.getLocalizedMessage(), e);
- }
if (log.isDebugEnabled())
{
log.debug("FileSystemLockPersister stoped");
13 years, 5 months
exo-jcr SVN: r3772 - ws/branches/2.1.x/packaging/module/src/main/javascript.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-01-05 03:07:48 -0500 (Wed, 05 Jan 2011)
New Revision: 3772
Modified:
ws/branches/2.1.x/packaging/module/src/main/javascript/ws.packaging.module.js
Log:
PLF-1053: fixmistake in WS packaging JS file
Modified: ws/branches/2.1.x/packaging/module/src/main/javascript/ws.packaging.module.js
===================================================================
--- ws/branches/2.1.x/packaging/module/src/main/javascript/ws.packaging.module.js 2011-01-05 07:49:49 UTC (rev 3771)
+++ ws/branches/2.1.x/packaging/module/src/main/javascript/ws.packaging.module.js 2011-01-05 08:07:48 UTC (rev 3772)
@@ -40,7 +40,7 @@
addDependency(new Project("javax.ws.rs", "jsr311-api", "jar", "1.0")).
addDependency(new Project("commons-chain", "commons-chain", "jar", "1.0")) .
// addDependency(new Project("javax.xml.parsers", "jaxp-api", "jar", "1.4")) .
- addDependency(new Project("javax.xml.bind", "jaxb-api", "jar", "2.1")) .
+ addDependency(new Project("javax.xml.bind", "jaxb-api", "jar", "2.1"));
//addDependency(new Project("com.sun.xml.bind", "jaxb-impl", "jar", "2.1.7")) .
// addDependency(new Project("com.sun.xml.parsers", "jaxp-ri", "jar", "1.4")) .
//addDependency(new Project("org.jvnet.jaxb2.maven2", "maven-jaxb2-plugin", "jar", "0.1"));
13 years, 5 months
exo-jcr SVN: r3771 - in jcr/branches/1.12.x/patch: JCR-1552 and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-01-05 02:49:49 -0500 (Wed, 05 Jan 2011)
New Revision: 3771
Added:
jcr/branches/1.12.x/patch/JCR-1552/
jcr/branches/1.12.x/patch/JCR-1552/JCR-1552.diff
Log:
JCR-1552 : attaching the patch, that removes locks on server startup only (1.12.x)
Added: jcr/branches/1.12.x/patch/JCR-1552/JCR-1552.diff
===================================================================
--- jcr/branches/1.12.x/patch/JCR-1552/JCR-1552.diff (rev 0)
+++ jcr/branches/1.12.x/patch/JCR-1552/JCR-1552.diff 2011-01-05 07:49:49 UTC (rev 3771)
@@ -0,0 +1,20 @@
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java (revision 3770)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java (working copy)
+@@ -263,14 +263,7 @@
+ {
+ log.debug("Stoping FileSystemLockPersister");
+ }
+- try
+- {
+- removeAll();
+- }
+- catch (LockException e)
+- {
+- log.error(e.getLocalizedMessage(), e);
+- }
++
+ if (log.isDebugEnabled())
+ {
+ log.debug("FileSystemLockPersister stoped");
13 years, 5 months
exo-jcr SVN: r3770 - in jcr/branches/1.12.x/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/importing and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2011-01-04 10:38:12 -0500 (Tue, 04 Jan 2011)
New Revision: 3770
Added:
jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImportVersionHistory.java
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
Log:
JCR-1566: restored version nodes now uses generated id instead fetch it from jcr:uuid property.
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2011-01-04 15:36:06 UTC (rev 3769)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2011-01-04 15:38:12 UTC (rev 3770)
@@ -383,6 +383,15 @@
*/
protected void checkReferenceable(ImportNodeData currentNodeInfo, String olUuid) throws RepositoryException
{
+ // if node is in version storrage - do not assign new id from jcr:uuid
+ // property
+ if (Constants.JCR_VERSION_STORAGE_PATH.getDepth() + 3 <= currentNodeInfo.getQPath().getDepth()
+ && currentNodeInfo.getQPath().getEntries()[Constants.JCR_VERSION_STORAGE_PATH.getDepth() + 3]
+ .equals(Constants.JCR_FROZENNODE)
+ && currentNodeInfo.getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH))
+ {
+ return;
+ }
String identifier = validateUuidCollision(olUuid);
Added: jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImportVersionHistory.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImportVersionHistory.java (rev 0)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImportVersionHistory.java 2011-01-04 15:38:12 UTC (rev 3770)
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * 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, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.api.importing;
+
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.jcr.util.VersionHistoryImporter;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Calendar;
+
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.Node;
+import javax.jcr.Value;
+
+/**
+ * Created by The eXo Platform SAS Author : eXoPlatform exo(a)exoplatform.com
+ */
+public class TestImportVersionHistory extends JcrAPIBaseTest
+{
+
+ Node testRoot;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ testRoot = this.root.addNode("parent", "nt:folder");
+ root.save();
+ }
+
+ public void tearDown() throws Exception
+ {
+ testRoot.remove();
+ root.save();
+ super.tearDown();
+ }
+
+ public void testImportVersionHistory() throws Exception
+ {
+
+ Node parent = testRoot.addNode("child", "nt:folder");
+ parent.addMixin("mix:versionable");
+
+ Node subNode = parent.addNode("subnode", "nt:file");
+ subNode.addMixin("mix:referenceable");
+
+ Node res = subNode.addNode("jcr:content", "nt:resource");
+ res.setProperty("jcr:lastModified", Calendar.getInstance());
+ res.setProperty("jcr:data", new ByteArrayInputStream("".getBytes()));
+ res.setProperty("jcr:mimeType", "application/x-javascript");
+
+ root.save();
+
+ // make checkin/checkout
+
+ parent.checkin();
+ parent.checkout();
+
+ subNode.remove();
+ subNode = parent.addNode("subnode", "nt:file");
+ subNode.addMixin("mix:referenceable");
+
+ res = subNode.addNode("jcr:content", "nt:resource");
+ res.setProperty("jcr:lastModified", Calendar.getInstance());
+ res.setProperty("jcr:data", new ByteArrayInputStream("".getBytes()));
+ res.setProperty("jcr:mimeType", "application/x-javascript");
+ root.save();
+
+ parent.checkin();
+ parent.checkout();
+
+ // export import version history and node
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ session.exportSystemView("/parent/child", out, false, false);
+
+ ByteArrayOutputStream vhout = new ByteArrayOutputStream();
+ session.exportSystemView(parent.getVersionHistory().getPath(), vhout, false, false);
+
+ // prepare data for version import
+
+ String versionHistory = parent.getProperty("jcr:versionHistory").getValue().getString();
+ String baseVersion = parent.getProperty("jcr:baseVersion").getValue().getString();
+ Value[] jcrPredecessors = parent.getProperty("jcr:predecessors").getValues();
+ StringBuilder jcrPredecessorsBuilder = new StringBuilder();
+ String[] predecessorsHistory;
+ for (Value value : jcrPredecessors)
+ {
+ if (jcrPredecessorsBuilder.length() > 0)
+ jcrPredecessorsBuilder.append(",");
+ jcrPredecessorsBuilder.append(value.getString());
+ }
+ if (jcrPredecessorsBuilder.toString().indexOf(",") > -1)
+ {
+ predecessorsHistory = jcrPredecessorsBuilder.toString().split(",");
+ }
+ else
+ {
+ predecessorsHistory = new String[]{jcrPredecessorsBuilder.toString()};
+ }
+
+ // remove node
+ parent.remove();
+ session.save();
+
+ // import
+ session.importXML("/parent", new ByteArrayInputStream(out.toByteArray()),
+ ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW, true);
+
+ session.save();
+
+ parent = (NodeImpl)session.getItem("/parent/child");
+ VersionHistoryImporter versionHistoryImporter =
+ new VersionHistoryImporter((NodeImpl)parent, new ByteArrayInputStream(vhout.toByteArray()), baseVersion,
+ predecessorsHistory, versionHistory);
+ versionHistoryImporter.doImport();
+ session.save();
+
+ // try to restore first version
+ parent.restore("1", true);
+ }
+}
13 years, 5 months
exo-jcr SVN: r3769 - in jcr/trunk: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-01-04 10:36:06 -0500 (Tue, 04 Jan 2011)
New Revision: 3769
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
Log:
EXOJCR-1077 : The problem with portability repository backup created on OS Windows to OS Linux was fixed.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java 2011-01-04 14:52:22 UTC (rev 3768)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java 2011-01-04 15:36:06 UTC (rev 3769)
@@ -83,7 +83,7 @@
this.containerName = wsEntry.getName();
LockManagerEntry lockEntry = wsEntry.getLockManager();
- if (lockEntry != null)
+ if (lockEntry != null && lockEntry.getParameters() != null)
{
for (String tableName : AbstractCacheableLockManager.getLockTableNames(lockEntry))
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2011-01-04 14:52:22 UTC (rev 3768)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2011-01-04 15:36:06 UTC (rev 3769)
@@ -45,6 +45,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
+import java.net.URL;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
@@ -149,8 +150,11 @@
for (String path : wsLogFilePathList)
{
writer.writeStartElement("url");
- writer.writeCharacters(path.replace(PrivilegedFileHelper.getCanonicalPath(config.getBackupDir())
- + File.separator, ""));
+ URL urlPath = new URL("file:" + path);
+ URL urlBackupDir =
+ new URL("file:" + PrivilegedFileHelper.getCanonicalPath(config.getBackupDir()) + File.separator);
+
+ writer.writeCharacters(urlPath.toString().replace(urlBackupDir.getPath(), ""));
writer.writeEndElement();
}
@@ -421,10 +425,13 @@
{
if (version != null && version.equals(VERSION_LOG_1_1))
{
- String path =
- PrivilegedFileHelper.getCanonicalPath(config.getBackupDir()) + File.separator
- + readContent();
- wsBackupInfo.add(path);
+ String path = readContent();
+ path = path.replace("file:", "file:" + PrivilegedFileHelper.getCanonicalPath(config.getBackupDir()) + File.separator);
+
+
+ URL urlPath = new URL(path);
+
+ wsBackupInfo.add(urlPath.getFile());
}
else
{
13 years, 5 months
exo-jcr SVN: r3768 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/importing and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2011-01-04 09:52:22 -0500 (Tue, 04 Jan 2011)
New Revision: 3768
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImportVersionHistory.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
Log:
EXOJCR-1139: restored version nodes now uses generated id instead fetch it from jcr:uuid property.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2011-01-04 14:09:53 UTC (rev 3767)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2011-01-04 14:52:22 UTC (rev 3768)
@@ -383,6 +383,15 @@
*/
protected void checkReferenceable(ImportNodeData currentNodeInfo, String olUuid) throws RepositoryException
{
+ // if node is in version storrage - do not assign new id from jcr:uuid
+ // property
+ if (Constants.JCR_VERSION_STORAGE_PATH.getDepth() + 3 <= currentNodeInfo.getQPath().getDepth()
+ && currentNodeInfo.getQPath().getEntries()[Constants.JCR_VERSION_STORAGE_PATH.getDepth() + 3]
+ .equals(Constants.JCR_FROZENNODE)
+ && currentNodeInfo.getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH))
+ {
+ return;
+ }
String identifier = validateUuidCollision(olUuid);
Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImportVersionHistory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImportVersionHistory.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImportVersionHistory.java 2011-01-04 14:52:22 UTC (rev 3768)
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * 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, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.api.importing;
+
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.jcr.util.VersionHistoryImporter;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Calendar;
+
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.Node;
+import javax.jcr.Value;
+
+/**
+ * Created by The eXo Platform SAS Author : eXoPlatform exo(a)exoplatform.com
+ */
+public class TestImportVersionHistory extends JcrAPIBaseTest
+{
+
+ Node testRoot;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ testRoot = this.root.addNode("parent", "nt:folder");
+ root.save();
+ }
+
+ public void tearDown() throws Exception
+ {
+ testRoot.remove();
+ root.save();
+ super.tearDown();
+ }
+
+ public void testImportVersionHistory() throws Exception
+ {
+
+ Node parent = testRoot.addNode("child", "nt:folder");
+ parent.addMixin("mix:versionable");
+
+ Node subNode = parent.addNode("subnode", "nt:file");
+ subNode.addMixin("mix:referenceable");
+
+ Node res = subNode.addNode("jcr:content", "nt:resource");
+ res.setProperty("jcr:lastModified", Calendar.getInstance());
+ res.setProperty("jcr:data", new ByteArrayInputStream("".getBytes()));
+ res.setProperty("jcr:mimeType", "application/x-javascript");
+
+ root.save();
+
+ // make checkin/checkout
+
+ parent.checkin();
+ parent.checkout();
+
+ subNode.remove();
+ subNode = parent.addNode("subnode", "nt:file");
+ subNode.addMixin("mix:referenceable");
+
+ res = subNode.addNode("jcr:content", "nt:resource");
+ res.setProperty("jcr:lastModified", Calendar.getInstance());
+ res.setProperty("jcr:data", new ByteArrayInputStream("".getBytes()));
+ res.setProperty("jcr:mimeType", "application/x-javascript");
+ root.save();
+
+ parent.checkin();
+ parent.checkout();
+
+ // export import version history and node
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ session.exportSystemView("/parent/child", out, false, false);
+
+ ByteArrayOutputStream vhout = new ByteArrayOutputStream();
+ session.exportSystemView(parent.getVersionHistory().getPath(), vhout, false, false);
+
+ // prepare data for version import
+
+ String versionHistory = parent.getProperty("jcr:versionHistory").getValue().getString();
+ String baseVersion = parent.getProperty("jcr:baseVersion").getValue().getString();
+ Value[] jcrPredecessors = parent.getProperty("jcr:predecessors").getValues();
+ StringBuilder jcrPredecessorsBuilder = new StringBuilder();
+ String[] predecessorsHistory;
+ for (Value value : jcrPredecessors)
+ {
+ if (jcrPredecessorsBuilder.length() > 0)
+ jcrPredecessorsBuilder.append(",");
+ jcrPredecessorsBuilder.append(value.getString());
+ }
+ if (jcrPredecessorsBuilder.toString().indexOf(",") > -1)
+ {
+ predecessorsHistory = jcrPredecessorsBuilder.toString().split(",");
+ }
+ else
+ {
+ predecessorsHistory = new String[]{jcrPredecessorsBuilder.toString()};
+ }
+
+ // remove node
+ parent.remove();
+ session.save();
+
+ // import
+ session.importXML("/parent", new ByteArrayInputStream(out.toByteArray()),
+ ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW, true);
+
+ session.save();
+
+ parent = (NodeImpl)session.getItem("/parent/child");
+ VersionHistoryImporter versionHistoryImporter =
+ new VersionHistoryImporter((NodeImpl)parent, new ByteArrayInputStream(vhout.toByteArray()), baseVersion,
+ predecessorsHistory, versionHistory);
+ versionHistoryImporter.doImport();
+ session.save();
+
+ // try to restore first version
+ parent.restore("1", true);
+ }
+}
13 years, 5 months
exo-jcr SVN: r3767 - jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-01-04 09:09:53 -0500 (Tue, 04 Jan 2011)
New Revision: 3767
Modified:
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml
Log:
JCR-1559: databases list supported by eXo JCR updated
Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml
===================================================================
--- jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml 2011-01-04 14:06:26 UTC (rev 3766)
+++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml 2011-01-04 14:09:53 UTC (rev 3767)
@@ -30,34 +30,28 @@
<para>Currently the data container is tested with the following
RDBMS:<itemizedlist>
<listitem>
- <para>MySQL (5.x including UTF8 support)</para>
+ <para>MySQL 5.1 MYSQL Connector/J 5.1.8</para>
</listitem>
<listitem>
- <para>PostgreSQL (8.x)</para>
+ <para>PostgresSQL 8.3.7 JDBC4 Driver, Version 8.3-605</para>
</listitem>
<listitem>
- <para>Oracle Database (9i, 10g)</para>
+ <para>Oracle DB 11g (11.0.1.6), JDBC Driver Oracle 11g R1
+ (11.1.0.6.0)</para>
</listitem>
<listitem>
- <para>Microsoft SQL Server (2005)</para>
+ <para>DB2 9,7 IBM Data Server Driver for JDBC and SQLJ (JCC Driver)
+ v.9.1 (fixpack 3a)</para>
</listitem>
<listitem>
- <para>Sybase ASE (15.0)</para>
+ <para>MS SQL Server 2005 SP3 JDBC Driver 2.0</para>
</listitem>
<listitem>
- <para>Apache Derby/Java DB (10.1.x, 10.2.x)</para>
- </listitem>
-
- <listitem>
- <para>IBM DB2 (8.x, 9.x)</para>
- </listitem>
-
- <listitem>
<para>HSQLDB (1.8.0.7)</para>
</listitem>
</itemizedlist></para>
13 years, 5 months