exo-jcr SVN: r4991 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/backup and 11 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-09-28 04:31:57 -0400 (Wed, 28 Sep 2011)
New Revision: 4991
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/DummySession.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLog.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/WorkspaceImpl.java
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/observation/ActionLauncher.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/observation/TestSessionsObservation.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestItemDataChangesLog.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLogTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/fs/TestJCRVSReadWrite.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/version/BaseVersionImplTest.java
Log:
EXOJCR-1562 : add Session instance to PlainChangesLog.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLog.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLog.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -22,6 +22,8 @@
import java.util.List;
+import javax.jcr.Session;
+
/**
* Created by The eXo Platform SAS.<br/> Plain changes log implementation (i.e. no nested logs
* inside)
@@ -38,7 +40,7 @@
* @return sessionId of a session produced this changes log
*/
String getSessionId();
-
+
/**
* Return pair Id of system and non-system logs.
*
@@ -67,4 +69,10 @@
* @param states List of ItemState
*/
PlainChangesLog addAll(List<ItemState> states);
+
+ /**
+ * Returns session instance is present
+ * @return session instance
+ */
+ Session getSession();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.dataflow;
+import org.exoplatform.services.jcr.core.ExtendedSession;
import org.exoplatform.services.jcr.impl.Constants;
import java.io.Externalizable;
@@ -27,6 +28,8 @@
import java.util.ArrayList;
import java.util.List;
+import javax.jcr.Session;
+
/**
* Created by The eXo Platform SAS.
*
@@ -37,7 +40,7 @@
public class PlainChangesLogImpl implements Externalizable, PlainChangesLog
{
private static final int NULL_VALUE = -1;
-
+
private static final int NOT_NULL_VALUE = 1;
private static final long serialVersionUID = 5624550860372364084L;
@@ -48,15 +51,34 @@
protected int eventType;
+ protected ExtendedSession session;
+
/**
* Identifier of system and non-system logs pair. Null if no pair found.
*/
- protected String pairId = null;
+ protected String pairId;
/**
* Full qualified constructor.
*
* @param items List of ItemState
+ * @param session Session
+ * @param eventType int
+ * @param pairId String
+ */
+ public PlainChangesLogImpl(List<ItemState> items, Session session, int eventType, String pairId)
+ {
+ this.items = items;
+ this.session = (ExtendedSession)session;
+ this.sessionId = this.session.getId();
+ this.eventType = eventType;
+ this.pairId = pairId;
+ }
+
+ /**
+ * Full qualified constructor. Used for compatibility with asynchronous replication.
+ *
+ * @param items List of ItemState
* @param sessionId String
* @param eventType int
* @param pairId String
@@ -73,35 +95,57 @@
* Constructor.
*
* @param items List of ItemState
+ * @param session Session
+ * @param eventType int
+ */
+ public PlainChangesLogImpl(List<ItemState> items, Session session, int eventType)
+ {
+ this(items, session, eventType, null);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param items List of ItemState
* @param sessionId String
* @param eventType int
*/
public PlainChangesLogImpl(List<ItemState> items, String sessionId, int eventType)
{
- this.items = items;
- this.sessionId = sessionId;
- this.eventType = eventType;
+ this(items, sessionId, eventType, null);
}
+ //
+
/**
* Constructor with undefined event type.
*
* @param items List of ItemState
- * @param sessionId String
+ * @param session Session
*/
- public PlainChangesLogImpl(List<ItemState> items, String sessionId)
+ public PlainChangesLogImpl(List<ItemState> items, Session session)
{
- this(items, sessionId, -1);
+ this(items, session, -1);
}
/**
* An empty log.
*
+ * @param session Session
+ */
+ public PlainChangesLogImpl(Session session)
+ {
+ this(new ArrayList<ItemState>(), session);
+ }
+
+ /**
+ * An empty log.
+ *
* @param sessionId String
*/
public PlainChangesLogImpl(String sessionId)
{
- this(new ArrayList<ItemState>(), sessionId);
+ this(new ArrayList<ItemState>(), sessionId, -1);
}
/**
@@ -109,7 +153,7 @@
*/
public PlainChangesLogImpl()
{
- this(new ArrayList<ItemState>(), null);
+ this(new ArrayList<ItemState>(), (String)null, -1);
}
/*
@@ -152,6 +196,14 @@
return sessionId;
}
+ /**
+ * {@inheritDoc}
+ */
+ public Session getSession()
+ {
+ return session;
+ }
+
/*
* (non-Javadoc)
*
@@ -200,11 +252,13 @@
{
String str = "ChangesLog: \n";
for (int i = 0; i < items.size(); i++)
+ {
str +=
" " + ItemState.nameFromValue(items.get(i).getState()) + "\t" + items.get(i).getData().getIdentifier()
+ "\t" + "isPersisted=" + items.get(i).isPersisted() + "\t" + "isEventFire="
+ items.get(i).isEventFire() + "\t" + "isInternallyCreated=" + items.get(i).isInternallyCreated() + "\t"
+ items.get(i).getData().getQPath().getAsString() + "\n";
+ }
return str;
}
@@ -227,7 +281,7 @@
out.writeObject(items.get(i));
}
- if (pairId != null)
+ if (pairId != null)
{
out.writeInt(NOT_NULL_VALUE);
buff = pairId.getBytes(Constants.DEFAULT_ENCODING);
@@ -253,7 +307,7 @@
{
add((ItemState)in.readObject());
}
-
+
if (in.readInt() == NOT_NULL_VALUE)
{
buf = new byte[in.readInt()];
@@ -261,5 +315,7 @@
pairId = new String(buf, Constants.DEFAULT_ENCODING);
}
}
+
// ------------------ [ END ] ------------------
+
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -171,7 +171,9 @@
while (cli.hasNextLog())
{
if (cli.nextLog().getEventType() == ExtendedEvent.LOCK)
+ {
cli.removeLog();
+ }
}
saveChangesLog(changesLog);
@@ -194,22 +196,30 @@
TransactionChangesLog normalizeChangesLog =
getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
if (normalizeChangesLog != null)
+ {
saveChangesLog(normalizeChangesLog);
+ }
else
+ {
throw new RepositoryException(
"Collisions found during save of restore changes log, but caused item is not found by ID "
+ e.getIdentifier() + ". " + e, e);
+ }
}
catch (JCRItemExistsException e)
{
TransactionChangesLog normalizeChangesLog =
getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
if (normalizeChangesLog != null)
+ {
saveChangesLog(normalizeChangesLog);
+ }
else
+ {
throw new RepositoryException(
"Collisions found during save of restore changes log, but caused item is not found by ID "
+ e.getIdentifier() + ". " + e, e);
+ }
}
}
@@ -239,7 +249,9 @@
// Node... by ID and desc path
if (!item.getIdentifier().equals(collisionID)
&& !item.getQPath().isDescendantOf(citem.getData().getQPath()))
+ {
normalized.add(change);
+ }
}
else if (!item.getIdentifier().equals(collisionID))
{
@@ -248,11 +260,21 @@
}
}
else
+ {
// another state
normalized.add(change);
+ }
}
- PlainChangesLog plog = new PlainChangesLogImpl(normalized, next.getSessionId(), next.getEventType());
+ PlainChangesLog plog;
+ if (next.getSession() != null)
+ {
+ plog = new PlainChangesLogImpl(normalized, next.getSession(), next.getEventType());
+ }
+ else
+ {
+ plog = new PlainChangesLogImpl(normalized, next.getSessionId(), next.getEventType());
+ }
result.addLog(plog);
}
@@ -393,7 +415,9 @@
}
for (int i = 0; i < listFile.size(); i++)
+ {
fileCleaner.addFile(listFile.get(i));
+ }
}
}
@@ -427,9 +451,13 @@
{
boolean b = true;
if (fs.getItemSateId() != this.getItemSateId())
+ {
b = false;
+ }
if (fs.getValueDataId() != this.getValueDataId())
+ {
b = false;
+ }
return b;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -413,7 +413,7 @@
checkValid();
- PlainChangesLog changesLog = new PlainChangesLogImpl(session.getId());
+ PlainChangesLog changesLog = new PlainChangesLogImpl(session);
removeMergeFailed(version, changesLog);
@@ -497,7 +497,7 @@
// the new version identifier
String verIdentifier = IdGenerator.generate();
- SessionChangesLog changesLog = new SessionChangesLog(session.getId());
+ SessionChangesLog changesLog = new SessionChangesLog(session);
VersionHistoryImpl vh = versionHistory(false);
vh.addVersion(this.nodeData(), verIdentifier, changesLog);
@@ -550,7 +550,7 @@
return;
}
- SessionChangesLog changesLog = new SessionChangesLog(session.getId());
+ SessionChangesLog changesLog = new SessionChangesLog(session);
changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_ISCHECKEDOUT,
new TransientValueData(true))));
@@ -711,7 +711,7 @@
+ session.getUserID() + " item owner " + getACL().getOwner());
}
- PlainChangesLog changesLog = new PlainChangesLogImpl(session.getId());
+ PlainChangesLog changesLog = new PlainChangesLogImpl(session);
VersionImpl base = (VersionImpl)getBaseVersion();
base.addPredecessor(version.getUUID(), changesLog);
@@ -1709,8 +1709,7 @@
Lock newLock = session.getLockManager().addLock(this, isDeep, isSessionScoped, -1);
- PlainChangesLog changesLog =
- new PlainChangesLogImpl(new ArrayList<ItemState>(), session.getId(), ExtendedEvent.LOCK);
+ PlainChangesLog changesLog = new PlainChangesLogImpl(new ArrayList<ItemState>(), session, ExtendedEvent.LOCK);
PropertyData propData =
TransientPropertyData.createPropertyData(nodeData(), Constants.JCR_LOCKOWNER, PropertyType.STRING, false,
@@ -1758,8 +1757,7 @@
Lock newLock = session.getLockManager().addLock(this, isDeep, false, timeOut);
- PlainChangesLog changesLog =
- new PlainChangesLogImpl(new ArrayList<ItemState>(), session.getId(), ExtendedEvent.LOCK);
+ PlainChangesLog changesLog = new PlainChangesLogImpl(new ArrayList<ItemState>(), session, ExtendedEvent.LOCK);
PropertyData propData =
TransientPropertyData.createPropertyData(nodeData(), Constants.JCR_LOCKOWNER, PropertyType.STRING, false,
@@ -2520,7 +2518,7 @@
throw new LockException("Node " + getPath() + " is locked ");
}
- SessionChangesLog changes = new SessionChangesLog(session.getId());
+ SessionChangesLog changes = new SessionChangesLog(session);
String srcPath;
try
@@ -2850,8 +2848,7 @@
protected void doUnlock() throws RepositoryException
{
- PlainChangesLog changesLog =
- new PlainChangesLogImpl(new ArrayList<ItemState>(), session.getId(), ExtendedEvent.UNLOCK);
+ PlainChangesLog changesLog = new PlainChangesLogImpl(new ArrayList<ItemState>(), session, ExtendedEvent.UNLOCK);
ItemData lockOwner =
dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_LOCKOWNER, 0), ItemType.PROPERTY);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -107,7 +107,7 @@
public SessionDataManager(SessionImpl session, LocalWorkspaceDataManagerStub dataManager) throws RepositoryException
{
this.session = session;
- this.changesLog = new SessionChangesLog(session.getId());
+ this.changesLog = new SessionChangesLog(session);
this.itemsPool = new ItemReferencePool();
this.itemFactory = new SessionItemFactory();
this.accessManager = session.getAccessManager();
@@ -2034,7 +2034,7 @@
// remove from changes log (Session pending changes)
PlainChangesLog slog = changesLog.pushLog(item.getQPath());
- SessionChangesLog changes = new SessionChangesLog(slog.getAllStates(), session.getId());
+ SessionChangesLog changes = new SessionChangesLog(slog.getAllStates(), session);
String exceptions = "";
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/WorkspaceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/WorkspaceImpl.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/WorkspaceImpl.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -127,7 +127,7 @@
{
session.checkLive();
- SessionChangesLog changes = new SessionChangesLog(session.getId());
+ SessionChangesLog changes = new SessionChangesLog(session);
clone(srcWorkspace, srcAbsPath, destAbsPath, removeExisting, changes);
@@ -214,7 +214,7 @@
srcNode.getData().accept(initializer);
- PlainChangesLogImpl changesLog = new PlainChangesLogImpl(initializer.getItemAddStates(), session.getId());
+ PlainChangesLogImpl changesLog = new PlainChangesLogImpl(initializer.getItemAddStates(), session);
session.getTransientNodesManager().getTransactManager().save(changesLog);
}
@@ -466,7 +466,7 @@
(NodeData)srcParentNode.getData(), nodeTypeManager, session.getTransientNodesManager(), true);
srcNode.getData().accept(initializer);
- PlainChangesLog changes = new PlainChangesLogImpl(session.getId());
+ PlainChangesLog changes = new PlainChangesLogImpl(session);
changes.addAll(initializer.getAllStates());
// reload items pool
@@ -590,7 +590,7 @@
List<VersionImpl> notExistedVersions = new ArrayList<VersionImpl>();
TransactionableDataManager dataManager = session.getTransientNodesManager().getTransactManager();
- SessionChangesLog changesLog = new SessionChangesLog(session.getId());
+ SessionChangesLog changesLog = new SessionChangesLog(session);
for (Version v : versions)
{
String versionableIdentifier = v.getContainingHistory().getVersionableUUID();
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-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -40,6 +40,7 @@
import org.exoplatform.services.jcr.observation.ExtendedEvent;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.exoplatform.services.security.IdentityConstants;
import java.io.File;
import java.io.IOException;
@@ -162,7 +163,9 @@
return;
}
if (!PrivilegedFileHelper.delete(lockFile))
+ {
throw new LockException("Fail to remove lock information");
+ }
}
@@ -186,7 +189,7 @@
for (int i = 0; i < list.length; i++)
{
PlainChangesLog plainChangesLog =
- new PlainChangesLogImpl(new ArrayList<ItemState>(), SystemIdentity.SYSTEM, ExtendedEvent.UNLOCK);
+ new PlainChangesLogImpl(new ArrayList<ItemState>(), IdentityConstants.SYSTEM, ExtendedEvent.UNLOCK);
NodeData lockedNodeData = (NodeData)dataManager.getItemData(list[i]);
// No item no problem
@@ -207,9 +210,11 @@
(PropertyData)dataManager.getItemData(lockedNodeData, new QPathEntry(Constants.JCR_LOCKOWNER, 0),
ItemType.PROPERTY);
if (dataLockOwner != null)
+ {
plainChangesLog.add(ItemState.createDeletedState(new TransientPropertyData(QPath.makeChildPath(
lockedNodeData.getQPath(), Constants.JCR_LOCKOWNER), dataLockOwner.getIdentifier(), 0,
dataLockOwner.getType(), dataLockOwner.getParentIdentifier(), dataLockOwner.isMultiValued())));
+ }
if (plainChangesLog.getSize() > 0)
{
@@ -232,7 +237,9 @@
log.warn("Persistent lock information for node id " + list[i] + " doesn't exists");
}
if (!PrivilegedFileHelper.delete(lockFile))
+ {
throw new LockException("Fail to remove lock information");
+ }
}
}
catch (RepositoryException e)
@@ -290,8 +297,10 @@
String root = config.getParameterValue(PARAM_ROOT_DIR);
if (root == null)
+ {
throw new RepositoryConfigurationException("Repository service configuration." + " Source name ("
+ PARAM_ROOT_DIR + ") is expected");
+ }
rootDir = new File(root);
if (PrivilegedFileHelper.exists(rootDir))
{
@@ -303,7 +312,9 @@
else
{
if (!PrivilegedFileHelper.mkdirs(rootDir))
+ {
throw new RepositoryException("Can't create dir" + root);
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -92,9 +92,19 @@
PlainChangesLog subLog = logIterator.nextLog();
String sessionId = subLog.getSessionId();
- SessionImpl userSession = sessionRegistry.getSession(sessionId);
+ SessionImpl userSession;
+ if (subLog.getSession() instanceof SessionImpl)
+ {
+ userSession = (SessionImpl)subLog.getSession();
+ }
+ else
+ {
+ userSession = sessionRegistry.getSession(sessionId);
+ }
+
if (userSession != null)
+ {
for (ItemState itemState : subLog.getAllStates())
{
if (itemState.isEventFire())
@@ -123,6 +133,7 @@
}
}
}
+ }
}
if (events.getSize() > 0)
{
@@ -141,15 +152,15 @@
private boolean isSessionMatch(ListenerCriteria criteria, String sessionId)
{
- if (criteria.getNoLocal() && criteria.getSessionId().equals(sessionId))
- return false;
- return true;
+ return !(criteria.getNoLocal() && criteria.getSessionId().equals(sessionId));
}
private boolean isPathMatch(ListenerCriteria criteria, ItemData item, SessionImpl userSession)
{
if (criteria.getAbsPath() == null)
+ {
return true;
+ }
try
{
QPath cLoc = userSession.getLocationFactory().parseAbsPath(criteria.getAbsPath()).getInternalPath();
@@ -171,15 +182,21 @@
{
if (criteria.getIdentifier() == null)
+ {
return true;
+ }
// assotiated parent is node itself for node and parent for property ????
for (int i = 0; i < criteria.getIdentifier().length; i++)
{
if (item.isNode() && criteria.getIdentifier()[i].equals(item.getIdentifier()))
+ {
return true;
+ }
else if (!item.isNode() && criteria.getIdentifier()[i].equals(item.getParentIdentifier()))
+ {
return true;
+ }
}
return false;
@@ -189,7 +206,9 @@
PlainChangesLog changesLog) throws RepositoryException
{
if (criteria.getNodeTypeName() == null)
+ {
return true;
+ }
NodeData node = (NodeData)workspaceDataManager.getItemData(item.getParentIdentifier());
if (node == null)
@@ -231,7 +250,9 @@
testQNames[0] = node.getPrimaryTypeName();
}
if (ntManager.isNodeType(criteriaNT.getName(), testQNames))
+ {
return true;
+ }
}
return false;
}
@@ -242,24 +263,40 @@
if (state.getData().isNode())
{
if (state.isAdded() || state.isRenamed() || state.isUpdated())
+ {
return Event.NODE_ADDED;
+ }
else if (state.isDeleted())
+ {
return Event.NODE_REMOVED;
+ }
else if (state.isUpdated())
+ {
return SKIP_EVENT;
+ }
else if (state.isUnchanged())
+ {
return SKIP_EVENT;
+ }
}
else
{ // property
if (state.isAdded())
+ {
return Event.PROPERTY_ADDED;
+ }
else if (state.isDeleted())
+ {
return Event.PROPERTY_REMOVED;
+ }
else if (state.isUpdated())
+ {
return Event.PROPERTY_CHANGED;
+ }
else if (state.isUnchanged())
+ {
return SKIP_EVENT;
+ }
}
throw new RepositoryException("Unexpected ItemState for Node " + ItemState.nameFromValue(state.getState()) + " "
+ state.getData().getQPath().getAsString());
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -174,7 +174,7 @@
this.bestEffort = bestEffort;
this.failed = failed;
- this.changes = new SessionChangesLog(mergeSession.getId());
+ this.changes = new SessionChangesLog(mergeSession);
}
@Override
@@ -530,6 +530,7 @@
ItemType.PROPERTY);
if (predecessorsProperty != null)
+ {
for (ValueData pv : predecessorsProperty.getValues())
{
try
@@ -537,7 +538,9 @@
String pidentifier = new String(pv.getAsByteArray());
if (pidentifier.equals(corrVersion.getIdentifier()))
+ {
return true; // got it
+ }
// search in predecessors of the predecessor
NodeData predecessor = (NodeData)mergeDataManager.getItemData(pidentifier);
@@ -560,6 +563,7 @@
}
}
// else it's a root version
+ }
return false;
}
@@ -576,6 +580,7 @@
ItemType.PROPERTY);
if (successorsProperty != null)
+ {
for (ValueData sv : successorsProperty.getValues())
{
try
@@ -583,7 +588,9 @@
String sidentifier = new String(sv.getAsByteArray());
if (sidentifier.equals(corrVersion.getIdentifier()))
+ {
return true; // got it
+ }
// search in successors of the successor
NodeData successor = (NodeData)mergeDataManager.getItemData(sidentifier);
@@ -606,6 +613,7 @@
}
}
// else it's a end of version graph node
+ }
return false;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -282,7 +282,7 @@
super(userSession.getTransientNodesManager().getTransactManager());
this.userSession = userSession;
- this.changes = new SessionChangesLog(userSession.getId());
+ this.changes = new SessionChangesLog(userSession);
this.context = context;
this.destName = destName;
this.history = history;
@@ -309,7 +309,9 @@
for (ItemState state : delegatedChanges.getAllStates())
{
if (state.getData().getIdentifier().equals(identifier))
+ {
return state.getData();
+ }
}
}
@@ -323,7 +325,9 @@
for (ItemState state : delegatedChanges.getAllStates())
{
if (state.getData().getQPath().equals(path))
+ {
return state.getData();
+ }
}
}
@@ -338,7 +342,9 @@
for (ItemState state : delegatedChanges.getAllStates())
{
if (state.getData().getQPath().equals(path) || state.getData().getQPath().isDescendantOf(path))
+ {
removed.add(state);
+ }
}
for (ItemState state : removed)
@@ -355,7 +361,9 @@
QPath nodePath = QPath.makeChildPath(parentData.getQPath(), name);
if (log.isDebugEnabled())
+ {
log.debug("Restore: " + nodePath.getAsString() + ", removeExisting=" + removeExisting);
+ }
PropertyData frozenIdentifier =
(PropertyData)dataManager.getItemData(frozen, new QPathEntry(Constants.JCR_FROZENUUID, 1), ItemType.PROPERTY);
@@ -386,8 +394,10 @@
// name
if (sameIdentifierPath.getIndex() != nodePath.getIndex())
+ {
// but different index, see below... fix it
nodePath = QPath.makeChildPath(parentData.getQPath(), name, sameIdentifierPath.getIndex());
+ }
// if it's a target node
existing = sameIdentifierNode;
@@ -606,7 +616,9 @@
NodeData cHistory = null;
if ((cHistory = (NodeData)dataManager.getItemData(vhIdentifier)) == null)
+ {
throw new RepositoryException("Version history is not found with uuid " + vhIdentifier);
+ }
childHistory = new VersionHistoryDataHelper(cHistory, dataManager, nodeTypeDataManager);
}
@@ -839,6 +851,7 @@
InternalQName qname = property.getQPath().getName();
if (nodeTypeDataManager.isNodeType(Constants.NT_FROZENNODE, frozenParent.getPrimaryTypeName()))
+ {
if (qname.equals(Constants.JCR_FROZENPRIMARYTYPE))
{
qname = Constants.JCR_PRIMARYTYPE;
@@ -857,6 +870,7 @@
// skip these props, as they are a nt:frozenNode special props
return;
}
+ }
int action =
nodeTypeDataManager
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -347,7 +347,7 @@
+ refs.get(0).getQPath().getAsString());
}
- PlainChangesLog changes = new PlainChangesLogImpl(session.getId());
+ PlainChangesLog changes = new PlainChangesLogImpl(session);
// remove labels first
try
@@ -527,7 +527,7 @@
NodeData versionData = getVersionData(versionName);
- SessionChangesLog changesLog = new SessionChangesLog(session.getId());
+ SessionChangesLog changesLog = new SessionChangesLog(session);
PropertyData labelData =
TransientPropertyData.createPropertyData(labels, labelQName, PropertyType.REFERENCE, false,
@@ -553,7 +553,7 @@
if (vldata != null)
{
- PlainChangesLog changes = new PlainChangesLogImpl(session.getId());
+ PlainChangesLog changes = new PlainChangesLogImpl(session);
changes.add(ItemState.createDeletedState(vldata));
dataManager.getTransactManager().save(changes);
}
@@ -570,15 +570,17 @@
throws RepositoryException
{
checkValid();
-
+
NodeTypeDataManager ntManager = session.getWorkspace().getNodeTypesHolder();
-
- boolean isPrivilegeable = ntManager.isNodeType(Constants.EXO_PRIVILEGEABLE, versionableNodeData.getPrimaryTypeName(),
- versionableNodeData.getMixinTypeNames());
-
- boolean isOwneable = ntManager.isNodeType(Constants.EXO_OWNEABLE, versionableNodeData.getPrimaryTypeName(),
- versionableNodeData.getMixinTypeNames());
-
+
+ boolean isPrivilegeable =
+ ntManager.isNodeType(Constants.EXO_PRIVILEGEABLE, versionableNodeData.getPrimaryTypeName(),
+ versionableNodeData.getMixinTypeNames());
+
+ boolean isOwneable =
+ ntManager.isNodeType(Constants.EXO_OWNEABLE, versionableNodeData.getPrimaryTypeName(), versionableNodeData
+ .getMixinTypeNames());
+
List<InternalQName> mixinsList = new ArrayList<InternalQName>();
mixinsList.add(Constants.MIX_REFERENCEABLE);
@@ -601,7 +603,7 @@
AccessControlList acl = new AccessControlList(owner, new ArrayList<AccessControlEntry>(accessList));
InternalQName[] mixins = mixinsList.toArray(new InternalQName[mixinsList.size()]);
-
+
// nt:version
NodeData versionData =
TransientNodeData.createNodeData(nodeData(), new InternalQName(null, nextVersionName()), Constants.NT_VERSION,
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -145,8 +145,8 @@
* {@inheritDoc}
*/
@Override
- public List<PropertyData> getChildPropertiesData(final NodeData nodeData, final List<QPathEntryFilter> itemDataFilters)
- throws RepositoryException
+ public List<PropertyData> getChildPropertiesData(final NodeData nodeData,
+ final List<QPathEntryFilter> itemDataFilters) throws RepositoryException
{
if (isSystemDescendant(nodeData.getQPath()) && !this.equals(versionDataManager))
{
@@ -285,19 +285,43 @@
// we have pair of logs for system and non-system (this) workspaces
final String pairId = IdGenerator.generate();
- versionLogs.addLog(new PlainChangesLogImpl(vstates, changes.getSessionId(), changes.getEventType(),
- pairId));
- nonVersionLogs.addLog(new PlainChangesLogImpl(nvstates, changes.getSessionId(), changes.getEventType(),
- pairId));
+ if (changes.getSession() != null)
+ {
+ versionLogs.addLog(new PlainChangesLogImpl(vstates, changes.getSession(), changes.getEventType(),
+ pairId));
+ nonVersionLogs.addLog(new PlainChangesLogImpl(nvstates, changes.getSession(), changes.getEventType(),
+ pairId));
+ }
+ else
+ {
+ versionLogs.addLog(new PlainChangesLogImpl(vstates, changes.getSessionId(), changes.getEventType(),
+ pairId));
+ nonVersionLogs.addLog(new PlainChangesLogImpl(nvstates, changes.getSessionId(), changes
+ .getEventType(), pairId));
+ }
}
else
{
- versionLogs.addLog(new PlainChangesLogImpl(vstates, changes.getSessionId(), changes.getEventType()));
+ if (changes.getSession() != null)
+ {
+ versionLogs.addLog(new PlainChangesLogImpl(vstates, changes.getSession(), changes.getEventType()));
+ }
+ else
+ {
+ versionLogs.addLog(new PlainChangesLogImpl(vstates, changes.getSessionId(), changes.getEventType()));
+ }
}
}
else if (nvstates.size() > 0)
{
- nonVersionLogs.addLog(new PlainChangesLogImpl(nvstates, changes.getSessionId(), changes.getEventType()));
+ if (changes.getSession() != null)
+ {
+ nonVersionLogs.addLog(new PlainChangesLogImpl(nvstates, changes.getSession(), changes.getEventType()));
+ }
+ else
+ {
+ nonVersionLogs.addLog(new PlainChangesLogImpl(nvstates, changes.getSessionId(), changes.getEventType()));
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -418,9 +418,19 @@
RepositoryException, IOException
{
// copy state
- PlainChangesLogImpl newLog =
- new PlainChangesLogImpl(new ArrayList<ItemState>(), changesLog.getSessionId(), changesLog.getEventType(),
- changesLog.getPairId());
+ PlainChangesLogImpl newLog;
+ if (changesLog.getSession() != null)
+ {
+ newLog =
+ new PlainChangesLogImpl(new ArrayList<ItemState>(), changesLog.getSession(), changesLog.getEventType(),
+ changesLog.getPairId());
+ }
+ else
+ {
+ newLog =
+ new PlainChangesLogImpl(new ArrayList<ItemState>(), changesLog.getSessionId(),
+ changesLog.getEventType(), changesLog.getPairId());
+ }
for (Iterator<ItemState> iter = changesLog.getAllStates().iterator(); iter.hasNext();)
{
@@ -631,8 +641,8 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(final NodeData nodeData, int fromOrderNum, int limit, List<NodeData> childNodes)
- throws RepositoryException
+ public boolean getChildNodesDataByPage(final NodeData nodeData, int fromOrderNum, int limit,
+ List<NodeData> childNodes) throws RepositoryException
{
final WorkspaceStorageConnection con = dataContainer.openConnection();
try
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -94,8 +94,14 @@
states.add(new ItemState(copyItemData(change.getData()), change.getState(), change.isEventFire(), change
.getAncestorToSave(), change.isInternallyCreated(), change.isPersisted(), change.getOldPath()));
}
-
- newLog.addLog(new PlainChangesLogImpl(states, changes.getSessionId(), changes.getEventType()));
+ if (changes.getSession() != null)
+ {
+ newLog.addLog(new PlainChangesLogImpl(states, changes.getSession(), changes.getEventType()));
+ }
+ else
+ {
+ newLog.addLog(new PlainChangesLogImpl(states, changes.getSessionId(), changes.getEventType()));
+ }
}
storageDataManager.save(newLog);
@@ -145,7 +151,8 @@
/**
* {@inheritDoc}
*/
- public List<NodeData> getChildNodesData(NodeData parent, List<QPathEntryFilter> patternFilters) throws RepositoryException
+ public List<NodeData> getChildNodesData(NodeData parent, List<QPathEntryFilter> patternFilters)
+ throws RepositoryException
{
return copyNodes(storageDataManager.getChildNodesData(parent, patternFilters));
}
@@ -166,7 +173,7 @@
{
return storageDataManager.getLastOrderNumber(parent);
}
-
+
/**
* {@inheritDoc}
*/
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -35,6 +35,8 @@
import java.util.List;
import java.util.Map;
+import javax.jcr.Session;
+
/**
* Created by The eXo Platform SAS.<br/> Responsible for managing session changes log. Relying on
* fact that ItemData inside ItemState SHOULD be TransientItemData
@@ -84,9 +86,9 @@
*
* @param sessionId
*/
- public SessionChangesLog(String sessionId)
+ public SessionChangesLog(Session session)
{
- super(sessionId);
+ super(session);
}
/**
@@ -95,14 +97,14 @@
* @param items
* @param sessionId
*/
- public SessionChangesLog(List<ItemState> items, String sessionId)
+ public SessionChangesLog(List<ItemState> items, Session session)
{
- super(items, sessionId);
+ super(items, session);
for (int i = 0, length = items.size(); i < length; i++)
{
ItemState change = items.get(i);
addItem(change);
- }
+ }
}
/**
@@ -176,9 +178,13 @@
if (childInfo != null)
{
if (item.isDeleted())
+ {
++childInfo[CHILD_NODES_COUNT_INDEX];
+ }
else if (item.isAdded())
+ {
--childInfo[CHILD_NODES_COUNT_INDEX];
+ }
childNodesInfo.put(item.getData().getParentIdentifier(), childInfo);
}
@@ -188,13 +194,17 @@
{
Map<String, ItemState> children = lastChildNodeStates.get(item.getData().getParentIdentifier());
if (children != null)
+ {
children.remove(item.getData().getIdentifier());
+ }
}
else
{
Map<String, ItemState> children = lastChildPropertyStates.get(item.getData().getParentIdentifier());
if (children != null)
+ {
children.remove(item.getData().getIdentifier());
+ }
}
}
}
@@ -321,7 +331,8 @@
*/
public PlainChangesLog pushLog(QPath rootPath)
{
- PlainChangesLog cLog = new PlainChangesLogImpl(sessionId);
+ // session instance is always present in SessionChangesLog
+ PlainChangesLog cLog = new PlainChangesLogImpl(session);
if (rootPath.equals(Constants.ROOT_PATH))
{
@@ -419,7 +430,9 @@
{
ItemData item = items.get(i).getData();
if (item.getParentIdentifier().equals(rootIdentifier) || item.getIdentifier().equals(rootIdentifier))
+ {
list.add(items.get(i));
+ }
}
return list;
}
@@ -475,11 +488,15 @@
{
// the node
if (items.get(i).isAdded())
+ {
// if a new item - no modify changes can be
return new ArrayList<ItemState>();
+ }
if (!items.get(i).isDeleted())
+ {
changes.put(item.getIdentifier(), items.get(i));
+ }
}
else if (item.getParentIdentifier().equals(rootData.getIdentifier()))
{
@@ -536,7 +553,9 @@
rename = state;
delete = allStates.get(i - 1); // try the fresh delete state
if (delete.getData().getIdentifier().equals(rename.getData().getIdentifier()))
+ {
return new ItemState[]{delete, rename}; // 3. ok, got it
+ }
}
}
@@ -592,7 +611,9 @@
}
}
else
+ {
byState = true;
+ }
if (byState
&& (isPersisted != null ? istate.isPersisted() == isPersisted : true)
&& ((orAncestor != null && orAncestor ? rootPath.isDescendantOf(istate.getData().getQPath()) : true) || rootPath
@@ -639,7 +660,9 @@
}
}
else
+ {
byState = true;
+ }
if (byState && (isPersisted != null ? istate.isPersisted() == isPersisted : true)
&& istate.getData().getIdentifier().equals(id))
{
@@ -687,7 +710,9 @@
{
int[] childInfo = childNodesInfo.get(item.getData().getParentIdentifier());
if (childInfo == null)
+ {
childInfo = new int[2];
+ }
if (item.isDeleted())
{
@@ -753,22 +778,34 @@
public boolean equals(Object obj)
{
if (this == obj)
+ {
return true;
+ }
if (obj == null)
+ {
return false;
+ }
if (getClass() != obj.getClass())
+ {
return false;
+ }
IDStateBasedKey other = (IDStateBasedKey)obj;
if (identifier == null)
{
if (other.identifier != null)
+ {
return false;
+ }
}
else if (!identifier.equals(other.identifier))
+ {
return false;
+ }
if (state != other.state)
+ {
return false;
+ }
return true;
}
}
@@ -842,37 +879,55 @@
public boolean equals(Object obj)
{
if (this == obj)
+ {
return true;
+ }
if (obj == null)
+ {
return false;
+ }
if (getClass() != obj.getClass())
+ {
return false;
+ }
ParentIDQPathBasedKey other = (ParentIDQPathBasedKey)obj;
if (name == null)
{
if (other.name != null)
+ {
return false;
+ }
}
else if (!name.getName().equals(other.name.getName())
|| !name.getNamespace().equals(other.name.getNamespace()) || name.getIndex() != other.name.getIndex())
+ {
return false;
+ }
if (parentIdentifier == null)
{
if (other.parentIdentifier != null)
+ {
return false;
+ }
}
else if (!parentIdentifier.equals(other.parentIdentifier))
+ {
return false;
+ }
if (itemType == null)
{
if (other.itemType != null)
+ {
return false;
+ }
}
else if (!itemType.equals(other.itemType))
+ {
return false;
+ }
return true;
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/observation/TestSessionsObservation.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/observation/TestSessionsObservation.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/observation/TestSessionsObservation.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -23,6 +23,7 @@
import javax.jcr.Node;
import javax.jcr.RepositoryException;
+import javax.jcr.Session;
import javax.jcr.observation.Event;
public class TestSessionsObservation extends JcrAPIBaseTest
@@ -261,4 +262,26 @@
sessionWs1.getWorkspace().getObservationManager().removeEventListener(listener2);
}
}
+
+ public void testMoveOnClosedSession() throws Exception
+ {
+
+ testRootWs1.addNode("newNode");
+ sessionWs1.save();
+
+ int counter = 0;
+
+ SimpleListener listener = new SimpleListener("testSessionOpen", log, counter);
+
+ Session sessionWs1ForListener = repository.login(credentials, "ws1");
+
+ sessionWs1ForListener.getWorkspace().getObservationManager().addEventListener(listener,
+ Event.NODE_ADDED | Event.NODE_REMOVED, testRootWs1.getPath() + "/", false, null, null, false);
+
+ sessionWs1ForListener.logout();
+
+ sessionWs1.logout();
+ sessionWs1.getWorkspace().move(testRootWs1.getPath() + "/newNode", testRootWs1.getPath() + "/newNode2");
+ assertEquals(2, listener.getCounter());
+ }
}
Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/DummySession.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/DummySession.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/DummySession.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -0,0 +1,268 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.core;
+
+import org.exoplatform.services.jcr.core.ExtendedSession;
+import org.exoplatform.services.jcr.core.SessionLifecycleListener;
+import org.exoplatform.services.jcr.impl.core.LocationFactory;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.AccessControlException;
+import java.util.Map;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.Credentials;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.InvalidSerializedDataException;
+import javax.jcr.Item;
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.LoginException;
+import javax.jcr.NamespaceException;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.ValueFactory;
+import javax.jcr.Workspace;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.version.VersionException;
+import javax.transaction.xa.XAResource;
+
+/**
+* @author Nikolay Zamosenchuk
+* @version $Id: DummySession.xml 34360 2009-07-22 23:58:59Z nzamosenchuk $
+*
+*/
+public class DummySession implements ExtendedSession
+{
+ private String sessionId;
+
+ public DummySession(String sessionId)
+ {
+ this.sessionId = sessionId;
+ }
+
+ public String getId()
+ {
+ return sessionId;
+ }
+
+ // do nothing
+ public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse,
+ boolean exportChildVersionHisotry) throws IOException, PathNotFoundException, RepositoryException
+ {
+ }
+
+ public LocationFactory getLocationFactory()
+ {
+ return null;
+ }
+
+ public Node getNodeByIdentifier(String identifier) throws ItemNotFoundException, RepositoryException
+ {
+ return null;
+ }
+
+ public long getTimeout()
+ {
+ return 0;
+ }
+
+ public XAResource getXAResource()
+ {
+ return null;
+ }
+
+ public boolean hasExpired()
+ {
+ return false;
+ }
+
+ public void importXML(String parentAbsPath, InputStream in, int uuidBehavior, Map<String, Object> context)
+ throws IOException, PathNotFoundException, ItemExistsException, ConstraintViolationException,
+ InvalidSerializedDataException, RepositoryException
+ {
+ }
+
+ public void registerLifecycleListener(SessionLifecycleListener listener)
+ {
+ }
+
+ public void setTimeout(long timeout)
+ {
+ }
+
+ public void addLockToken(String lt)
+ {
+ }
+
+ public void checkPermission(String absPath, String actions) throws AccessControlException, RepositoryException
+ {
+ }
+
+ public void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse)
+ throws PathNotFoundException, SAXException, RepositoryException
+ {
+ }
+
+ public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse)
+ throws IOException, PathNotFoundException, RepositoryException
+ {
+ }
+
+ public void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse)
+ throws PathNotFoundException, SAXException, RepositoryException
+ {
+ }
+
+ public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse)
+ throws IOException, PathNotFoundException, RepositoryException
+ {
+ }
+
+ public Object getAttribute(String name)
+ {
+ return null;
+ }
+
+ public String[] getAttributeNames()
+ {
+ return null;
+ }
+
+ public ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior) throws PathNotFoundException,
+ ConstraintViolationException, VersionException, LockException, RepositoryException
+ {
+ return null;
+ }
+
+ public Item getItem(String absPath) throws PathNotFoundException, RepositoryException
+ {
+ return null;
+ }
+
+ public String[] getLockTokens()
+ {
+ return null;
+ }
+
+ public String getNamespacePrefix(String uri) throws NamespaceException, RepositoryException
+ {
+ return null;
+ }
+
+ public String[] getNamespacePrefixes() throws RepositoryException
+ {
+ return null;
+ }
+
+ public String getNamespaceURI(String prefix) throws NamespaceException, RepositoryException
+ {
+ return null;
+ }
+
+ public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException
+ {
+ return null;
+ }
+
+ public Repository getRepository()
+ {
+ return null;
+ }
+
+ public Node getRootNode() throws RepositoryException
+ {
+ return null;
+ }
+
+ public String getUserID()
+ {
+ return null;
+ }
+
+ public ValueFactory getValueFactory() throws UnsupportedRepositoryOperationException, RepositoryException
+ {
+ return null;
+ }
+
+ public Workspace getWorkspace()
+ {
+ return null;
+ }
+
+ public boolean hasPendingChanges() throws RepositoryException
+ {
+ return false;
+ }
+
+ public Session impersonate(Credentials credentials) throws LoginException, RepositoryException
+ {
+ return null;
+ }
+
+ public void importXML(String parentAbsPath, InputStream in, int uuidBehavior) throws IOException,
+ PathNotFoundException, ItemExistsException, ConstraintViolationException, VersionException,
+ InvalidSerializedDataException, LockException, RepositoryException
+ {
+ }
+
+ public boolean isLive()
+ {
+ return false;
+ }
+
+ public boolean itemExists(String absPath) throws RepositoryException
+ {
+ return false;
+ }
+
+ public void logout()
+ {
+ }
+
+ public void move(String srcAbsPath, String destAbsPath) throws ItemExistsException, PathNotFoundException,
+ VersionException, ConstraintViolationException, LockException, RepositoryException
+ {
+ }
+
+ public void refresh(boolean keepChanges) throws RepositoryException
+ {
+ }
+
+ public void removeLockToken(String lt)
+ {
+ }
+
+ public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException,
+ InvalidItemStateException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException
+ {
+ }
+
+ public void setNamespacePrefix(String prefix, String uri) throws NamespaceException, RepositoryException
+ {
+ }
+}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestItemDataChangesLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestItemDataChangesLog.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestItemDataChangesLog.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -70,7 +70,7 @@
public void testBasicOperations() throws Exception
{
- SessionChangesLog cLog = new SessionChangesLog("s1");
+ SessionChangesLog cLog = new SessionChangesLog(new DummySession("s1"));
cLog.add(ItemState.createAddedState(data1));
cLog.add(ItemState.createAddedState(data2));
cLog.add(ItemState.createDeletedState(data2));
@@ -92,7 +92,7 @@
public void testSessionOperations() throws Exception
{
- SessionChangesLog cLog = new SessionChangesLog("s1");
+ SessionChangesLog cLog = new SessionChangesLog(new DummySession("s1"));
TransientNodeData d1 =
TransientNodeData.createNodeData(data1, new InternalQName(null, "testSessionOperations"), new InternalQName(
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLogTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLogTest.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLogTest.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -20,10 +20,10 @@
import org.exoplatform.services.jcr.JcrImplBaseTest;
import org.exoplatform.services.jcr.dataflow.ItemState;
-import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
import org.exoplatform.services.jcr.datamodel.InternalQName;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.core.DummySession;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
@@ -120,7 +120,7 @@
try
{
userSession = (SessionImpl)frepository.login(fcredentials, "ws");
- chlog[0] = new SessionChangesLogInfo(new SessionChangesLog(userSession.getId()), userSession.getId());
+ chlog[0] = new SessionChangesLogInfo(new SessionChangesLog(userSession), userSession.getId());
}
catch (RepositoryException e)
{
@@ -148,7 +148,7 @@
public void testSameSession()
{
- SessionChangesLog chlog = new SessionChangesLog(session.getId());
+ SessionChangesLog chlog = new SessionChangesLog(session);
assertEquals("Session must be same as given id owns", session, getRegisteredSession(chlog.getSessionId()));
}
@@ -156,7 +156,7 @@
{
String id = IdGenerator.generate();
- SessionChangesLog chlog = new SessionChangesLog(id);
+ SessionChangesLog chlog = new SessionChangesLog(new DummySession(id));
assertNull("No session should be linked to the log", getRegisteredSession(chlog.getSessionId()));
}
@@ -248,7 +248,7 @@
public void testAddRootChanges() throws Exception
{
- SessionChangesLog changesLog = new SessionChangesLog(session.getId());
+ SessionChangesLog changesLog = new SessionChangesLog(session);
try
{
changesLog.add(new ItemState(new TransientPropertyData(Constants.ROOT_PATH, Constants.ROOT_UUID, 0,
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/fs/TestJCRVSReadWrite.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/fs/TestJCRVSReadWrite.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/fs/TestJCRVSReadWrite.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -147,7 +147,9 @@
path = resource.setProperty("jcr:data", vals).getPath();
}
else
+ {
path = resource.setProperty("jcr:data", fBLOB1).getPath();
+ }
resource.setProperty("jcr:mimeType", "application/x-octet-stream");
resource.setProperty("jcr:lastModified", Calendar.getInstance());
testRoot.save();
@@ -191,7 +193,7 @@
{
try
{
- SessionChangesLog changes = new SessionChangesLog(((NodeImpl)testRoot).getSession().getId());
+ SessionChangesLog changes = new SessionChangesLog(((NodeImpl)testRoot).getSession());
TransientNodeData ntfile =
TransientNodeData.createNodeData(rootData, InternalQName.parse("[]blob" + i), Constants.NT_FILE);
@@ -218,7 +220,9 @@
data.add(new TransientValueData(fBLOB2));
}
else
+ {
data.add(new TransientValueData(fBLOB1));
+ }
TransientPropertyData resData =
TransientPropertyData.createPropertyData(res, Constants.JCR_DATA, PropertyType.BINARY, data.size() > 1,
@@ -259,7 +263,7 @@
{
final DataManager dm =
((NodeImpl)testRoot).getSession().getTransientNodesManager().getTransactManager().getStorageDataManager();
- final SessionChangesLog changes = new SessionChangesLog(((NodeImpl)testRoot).getSession().getId());
+ final SessionChangesLog changes = new SessionChangesLog(((NodeImpl)testRoot).getSession());
class Remover
{
@@ -301,12 +305,18 @@
}
if (item == null)
+ {
break;
+ }
if (item.isNode())
+ {
parent = (NodeData)item;
+ }
else if (i < relPathEntries.length - 1)
+ {
throw new IllegalPathException("Path can not contains a property as the intermediate element");
+ }
}
return item;
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/version/BaseVersionImplTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/version/BaseVersionImplTest.java 2011-09-28 07:02:50 UTC (rev 4990)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/version/BaseVersionImplTest.java 2011-09-28 08:31:57 UTC (rev 4991)
@@ -223,11 +223,11 @@
versionedVersionHistoryData = new ArrayList<ValueData>();
versionedVersionHistoryData.add(new TestTransientValueData(versionedVersionHistoryUuid.getBytes(), 0));
- changesLog = new SessionChangesLog(session.getId());
+ changesLog = new SessionChangesLog(session);
ntManager = (NodeTypeManagerImpl)session.getWorkspace().getNodeTypeManager();
- SessionChangesLog initChanges = new SessionChangesLog(session.getId());
+ SessionChangesLog initChanges = new SessionChangesLog(session);
NodeData wsRoot = (NodeData)((NodeImpl)session.getRootNode()).getData();
testRoot =
@@ -267,7 +267,7 @@
public void createVersionable(int testCase) throws Exception
{
- versionableLog = new SessionChangesLog(session.getId());
+ versionableLog = new SessionChangesLog(session);
// target node
versionable =
12 years, 8 months
exo-jcr SVN: r4990 - in jcr/trunk/exo.jcr.component.ext/src: main/java/org/exoplatform/services/jcr/ext/distribution/impl and 3 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-09-28 03:02:50 -0400 (Wed, 28 Sep 2011)
New Revision: 4990
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/DataDistributionType.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/DataDistributionByName.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/distribution/TestDataDistributionManager.java
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
Log:
EXOJCR-1498: Migration tool and guideline for migration from 1.12.10-GA to 1.14.0.CR4-CP01
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/DataDistributionType.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/DataDistributionType.java 2011-09-28 06:59:57 UTC (rev 4989)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/DataDistributionType.java 2011-09-28 07:02:50 UTC (rev 4990)
@@ -100,4 +100,12 @@
* @throws RepositoryException if an error occurred while trying to remove the expected data
*/
void removeDataNode(Node rootNode, String dataId) throws RepositoryException;
+
+ /**
+ * Migrate from old structure to new one.
+ *
+ * @param rootNode the root node under which the data to migrate is stored
+ * @throws RepositoryException if an error occurred during migration
+ */
+ void migrate(Node rootNode) throws RepositoryException;
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java 2011-09-28 06:59:57 UTC (rev 4989)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java 2011-09-28 07:02:50 UTC (rev 4990)
@@ -43,7 +43,7 @@
/**
* The default node type to use when we create a new node
*/
- private static final String DEFAULT_NODE_TYPE = "nt:unstructured".intern();
+ protected static final String DEFAULT_NODE_TYPE = "nt:unstructured".intern();
/**
* The map defining all the locks available
@@ -141,8 +141,16 @@
lock.unlock();
}
}
-
+
/**
+ * {@inheritDoc}
+ */
+ public void migrate(Node rootNode) throws RepositoryException
+ {
+ throw new UnsupportedOperationException("The method is not supported");
+ }
+
+ /**
* Creates the node of the given node type with the given node name directly under
* the given parent node, using the given mixin types and permissions
* @param parentNode the parent node
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/DataDistributionByName.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/DataDistributionByName.java 2011-09-28 06:59:57 UTC (rev 4989)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/DataDistributionByName.java 2011-09-28 07:02:50 UTC (rev 4990)
@@ -18,9 +18,15 @@
*/
package org.exoplatform.services.jcr.ext.distribution.impl;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+
import java.util.ArrayList;
import java.util.List;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
/**
* This data distribution will distribute the data in a understandable way for a human being.
@@ -76,4 +82,44 @@
{
return true;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public void migrate(Node rootNode) throws RepositoryException
+ {
+ NodeIterator iter = ((NodeImpl)rootNode).getNodesLazily(1);
+ if (iter.hasNext() && !iter.nextNode().getPath().endsWith(suffix))
+ {
+ iter = ((NodeImpl)rootNode).getNodesLazily();
+ while (iter.hasNext())
+ {
+ Node userNode = iter.nextNode();
+ List<String> ancestors = getAncestors(userNode.getName());
+
+ Node node = rootNode;
+
+ for (int i = 0, length = ancestors.size() - 1; i < length; i++)
+ {
+ String nodeName = ancestors.get(i);
+ try
+ {
+ node = node.getNode(nodeName);
+ continue;
+ }
+ catch (PathNotFoundException e)
+ {
+ // ignore me
+ }
+
+ // The node doesn't exist we need to create it
+ node = node.addNode(nodeName, DEFAULT_NODE_TYPE);
+ }
+
+ userNode.getSession().move(userNode.getPath(), node.getPath() + "/" + ancestors.get(ancestors.size() - 1));
+ }
+ }
+
+ rootNode.getSession().save();
+ }
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java 2011-09-28 06:59:57 UTC (rev 4989)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java 2011-09-28 07:02:50 UTC (rev 4990)
@@ -75,6 +75,8 @@
private final boolean oldDistribution;
+ private final boolean autoMigrate;
+
public NodeHierarchyCreatorImpl(RepositoryService jcrService, InitParams params)
{
this(jcrService, null, params);
@@ -91,9 +93,9 @@
}
jcrService_ = jcrService;
dataDistributionManager_ = dataDistributionManager;
- oldDistribution =
- params != null && params.getValueParam("old-user-distribution") != null
- && Boolean.valueOf(params.getValueParam("old-user-distribution").getValue());
+ oldDistribution = params != null && Boolean.valueOf(params.getValueParam("old-user-distribution").getValue());
+ autoMigrate = params != null && Boolean.valueOf(params.getValueParam("auto-migrate").getValue());
+
if (PropertyManager.isDevelopping() && !oldDistribution)
{
log.info("The NodeHierarchyCreator is configured to use the new distribution mechanism for the"
@@ -115,6 +117,15 @@
{
log.error("An error occurs while processing the plugins", e);
}
+
+ try
+ {
+ checkForUpgrade();
+ }
+ catch (RepositoryException e)
+ {
+ log.error("An error occurs while upgrading JCR structure", e);
+ }
}
/**
@@ -359,4 +370,29 @@
}
}
}
+
+ private void checkForUpgrade() throws RepositoryException
+ {
+ if (!oldDistribution && autoMigrate)
+ {
+
+ ManageableRepository repo = jcrService_.getCurrentRepository();
+ Session session = repo.login();
+
+ try
+ {
+ String userPath = getJcrPath(USERS_PATH);
+ Node usersNode = (Node)session.getItem(userPath);
+
+ dataDistributionManager_.getDataDistributionType(DataDistributionMode.READABLE).migrate(usersNode);
+ }
+ finally
+ {
+ if (session != null)
+ {
+ session.logout();
+ }
+ }
+ }
+ }
}
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/distribution/TestDataDistributionManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/distribution/TestDataDistributionManager.java 2011-09-28 06:59:57 UTC (rev 4989)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/distribution/TestDataDistributionManager.java 2011-09-28 07:02:50 UTC (rev 4990)
@@ -21,7 +21,6 @@
import org.exoplatform.services.jcr.access.PermissionType;
import org.exoplatform.services.jcr.core.ExtendedNode;
import org.exoplatform.services.jcr.ext.BaseStandaloneTest;
-import org.exoplatform.services.jcr.impl.core.SessionImpl;
import java.util.ArrayList;
import java.util.Collections;
@@ -487,7 +486,7 @@
startSignalWriter.await();
for (int j = 0; j < totalTimes; j++)
{
- session = (SessionImpl)repository.login(credentials, WS_NAME);
+ session = repository.login(credentials, WS_NAME);
Node node = (Node)session.getItem(parentNode.getPath());
for (int i = 0; i < totalElement; i++)
{
@@ -533,7 +532,7 @@
startSignalOthers.await();
for (int j = 0; j < totalTimes; j++)
{
- session = (SessionImpl)repository.login(credentials, WS_NAME);
+ session = repository.login(credentials, WS_NAME);
Node node = (Node)session.getItem(parentNode.getPath());
for (int i = 0; i < totalElement; i++)
{
@@ -579,7 +578,7 @@
startSignalOthers.await();
for (int j = 0; j < totalTimes; j++)
{
- session = (SessionImpl)repository.login(credentials, WS_NAME);
+ session = repository.login(credentials, WS_NAME);
Node node = (Node)session.getItem(parentNode.getPath());
for (int i = 0; i < totalElement; i++)
{
@@ -621,4 +620,56 @@
}
System.out.println("Total Time for '" + type.getClass().getSimpleName() + "' = " + (System.currentTimeMillis() - time));
}
+
+ public void testMigration() throws Exception
+ {
+ Node rootNode = session.getRootNode().addNode("testRoot");
+ rootNode.addNode("bob").setProperty("bob", "bob");
+ rootNode.addNode("john.smith").setProperty("john.smith", "john.smith");
+ rootNode.addNode("joiv").setProperty("joiv", "joiv");
+ rootNode.addNode("bonjov").setProperty("bonjov", "bonjov");
+ rootNode.addNode("anatoliy.bazko").setProperty("anatoliy.bazko", "anatoliy.bazko");
+ rootNode.getSession().save();
+
+ manager.getDataDistributionType(DataDistributionMode.READABLE).migrate(rootNode);
+
+ assertFalse(rootNode.hasNode("bob"));
+ assertFalse(rootNode.hasNode("john.smith"));
+ assertFalse(rootNode.hasNode("joiv"));
+ assertFalse(rootNode.hasNode("bonjov"));
+ assertFalse(rootNode.hasNode("anatoliy.bazko"));
+
+ assertTrue(rootNode.hasNode("b___/bo___/bob"));
+ assertTrue(rootNode.hasNode("j___/jo___/joh___/john.smith"));
+ assertTrue(rootNode.hasNode("j___/jo___/joi___/joiv"));
+ assertTrue(rootNode.hasNode("b___/bo___/bon___/bonjov"));
+ assertTrue(rootNode.hasNode("a___/an___/ana___/anatoliy.bazko"));
+
+ assertTrue(rootNode.getNode("b___/bo___/bob").hasProperty("bob"));
+ assertTrue(rootNode.getNode("j___/jo___/joh___/john.smith").hasProperty("john.smith"));
+ assertTrue(rootNode.getNode("j___/jo___/joi___/joiv").hasProperty("joiv"));
+ assertTrue(rootNode.getNode("b___/bo___/bon___/bonjov").hasProperty("bonjov"));
+ assertTrue(rootNode.getNode("a___/an___/ana___/anatoliy.bazko").hasProperty("anatoliy.bazko"));
+
+ // shoud not be any changes
+ manager.getDataDistributionType(DataDistributionMode.READABLE).migrate(rootNode);
+
+ assertFalse(rootNode.hasNode("bob"));
+ assertFalse(rootNode.hasNode("john.smith"));
+ assertFalse(rootNode.hasNode("joiv"));
+ assertFalse(rootNode.hasNode("bonjov"));
+ assertFalse(rootNode.hasNode("anatoliy.bazko"));
+
+ assertTrue(rootNode.hasNode("b___/bo___/bob"));
+ assertTrue(rootNode.hasNode("j___/jo___/joh___/john.smith"));
+ assertTrue(rootNode.hasNode("j___/jo___/joi___/joiv"));
+ assertTrue(rootNode.hasNode("b___/bo___/bon___/bonjov"));
+ assertTrue(rootNode.hasNode("a___/an___/ana___/anatoliy.bazko"));
+
+ assertTrue(rootNode.getNode("b___/bo___/bob").hasProperty("bob"));
+ assertTrue(rootNode.getNode("j___/jo___/joh___/john.smith").hasProperty("john.smith"));
+ assertTrue(rootNode.getNode("j___/jo___/joi___/joiv").hasProperty("joiv"));
+ assertTrue(rootNode.getNode("b___/bo___/bon___/bonjov").hasProperty("bonjov"));
+ assertTrue(rootNode.getNode("a___/an___/ana___/anatoliy.bazko").hasProperty("anatoliy.bazko"));
+ }
}
Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2011-09-28 06:59:57 UTC (rev 4989)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2011-09-28 07:02:50 UTC (rev 4990)
@@ -467,11 +467,19 @@
</init-params>
</component-plugin>
</component-plugins>
- </component>
+ </component>
+
<component>
<key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
- <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
- </component>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ <init-params>
+ <value-param>
+ <name>auto-migrate</name>
+ <value>false</value>
+ </value-param>
+ </init-params>
+ </component>
+
<component>
<type>org.exoplatform.services.jcr.ext.hierarchy.impl.NewUserListener</type>
<init-params>
12 years, 8 months
exo-jcr SVN: r4989 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-09-28 02:59:57 -0400 (Wed, 28 Sep 2011)
New Revision: 4989
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ExtendedNode.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
Log:
EXOJCR-1498: Migration tool and guideline for migration from 1.12.10-GA to 1.14.0.CR4-CP01
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ExtendedNode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ExtendedNode.java 2011-09-28 06:34:03 UTC (rev 4988)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ExtendedNode.java 2011-09-28 06:59:57 UTC (rev 4989)
@@ -130,4 +130,17 @@
* @throws RepositoryException If an error occurs.
*/
public NodeIterator getNodesLazily() throws RepositoryException;
+
+ /**
+ * Returns a <code>NodeIterator</code> over all child <code>Node</code>s of
+ * this <code>Node</code>. Does <i>not</i> include properties of this
+ * <code>Node</code>. If this node has no child nodes, then an empty iterator is returned.
+ *
+ * @param pageSize
+ * the amount of the nodes which can be retrieved from the storage per request
+ * @return A <code>NodeIterator</code> over all child <code>Node</code>s of
+ * this <code>Node</code>.
+ * @throws RepositoryException If an error occurs.
+ */
+ public NodeIterator getNodesLazily(int pageSize) throws RepositoryException;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2011-09-28 06:34:03 UTC (rev 4988)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2011-09-28 06:59:57 UTC (rev 4989)
@@ -1113,6 +1113,15 @@
/**
* {@inheritDoc}
*/
+ public NodeIterator getNodesLazily(int pageSize) throws RepositoryException
+ {
+ checkValid();
+ return new LazyNodeIteratorByPage(dataManager, pageSize);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public NodeIterator getNodes(String namePattern) throws RepositoryException
{
@@ -3495,7 +3504,7 @@
{
private final SessionDataManager dataManager;
- private int limit = session.getLazyNodeIteratorPageSize();
+ private final int limit;
private int fromOrderNum = 0;
@@ -3509,7 +3518,13 @@
LazyNodeIteratorByPage(SessionDataManager dataManager) throws RepositoryException
{
+ this(dataManager, session.getLazyNodeIteratorPageSize());
+ }
+
+ LazyNodeIteratorByPage(SessionDataManager dataManager, int limit) throws RepositoryException
+ {
this.dataManager = dataManager;
+ this.limit = limit;
}
/**
12 years, 8 months
exo-jcr SVN: r4988 - in jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main: resources/images and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-09-28 02:34:03 -0400 (Wed, 28 Sep 2011)
New Revision: 4988
Added:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/jmx-jconsole.png
Removed:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/JConsole.png
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
Log:
EXOJCR-1493 : fix image names
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2011-09-27 16:17:02 UTC (rev 4987)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2011-09-28 06:34:03 UTC (rev 4988)
@@ -486,7 +486,7 @@
blocking whole application by using any JMX-compatible console (see
screenshot below, "JConsole in action").<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/JConsole.png" />
+ <imagedata align="center" fileref="images/jmx-jconsole.png" />
</imageobject>
</mediaobject>Server can continue working as expected while index is
recreated. This depends on the flag "allow queries", passed via JMX
Deleted: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/JConsole.png
===================================================================
(Binary files differ)
Added: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/jmx-jconsole.png
===================================================================
(Binary files differ)
Property changes on: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/jmx-jconsole.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
12 years, 8 months
exo-jcr SVN: r4987 - in jcr/trunk: applications/exo.jcr.applications.jetty and 3 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-09-27 12:17:02 -0400 (Tue, 27 Sep 2011)
New Revision: 4987
Modified:
jcr/trunk/applications/exo.jcr.applications.jboss/pom.xml
jcr/trunk/applications/exo.jcr.applications.jetty/pom.xml
jcr/trunk/applications/exo.jcr.applications.jonas/pom.xml
jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml
jcr/trunk/packaging/module/pom.xml
Log:
EXOJCR-1569: Set properly the relativePath in the pom files [jcr]
Modified: jcr/trunk/applications/exo.jcr.applications.jboss/pom.xml
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.jboss/pom.xml 2011-09-27 16:16:07 UTC (rev 4986)
+++ jcr/trunk/applications/exo.jcr.applications.jboss/pom.xml 2011-09-27 16:17:02 UTC (rev 4987)
@@ -23,6 +23,7 @@
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
<version>1.14.2-GA-SNAPSHOT</version>
+ <relativePath>../exo.jcr.applications.config/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/trunk/applications/exo.jcr.applications.jetty/pom.xml
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.jetty/pom.xml 2011-09-27 16:16:07 UTC (rev 4986)
+++ jcr/trunk/applications/exo.jcr.applications.jetty/pom.xml 2011-09-27 16:17:02 UTC (rev 4987)
@@ -23,7 +23,7 @@
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
<version>1.14.2-GA-SNAPSHOT</version>
- <relativePath>exo.jcr.applications.config</relativePath>
+ <relativePath>../exo.jcr.applications.config/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/trunk/applications/exo.jcr.applications.jonas/pom.xml
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.jonas/pom.xml 2011-09-27 16:16:07 UTC (rev 4986)
+++ jcr/trunk/applications/exo.jcr.applications.jonas/pom.xml 2011-09-27 16:17:02 UTC (rev 4987)
@@ -23,6 +23,7 @@
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
<version>1.14.2-GA-SNAPSHOT</version>
+ <relativePath>../exo.jcr.applications.config/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml 2011-09-27 16:16:07 UTC (rev 4986)
+++ jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml 2011-09-27 16:17:02 UTC (rev 4987)
@@ -23,7 +23,7 @@
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
<version>1.14.2-GA-SNAPSHOT</version>
- <relativePath>exo.jcr.applications.config</relativePath>
+ <relativePath>../exo.jcr.applications.config/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/trunk/packaging/module/pom.xml
===================================================================
--- jcr/trunk/packaging/module/pom.xml 2011-09-27 16:16:07 UTC (rev 4986)
+++ jcr/trunk/packaging/module/pom.xml 2011-09-27 16:17:02 UTC (rev 4987)
@@ -5,6 +5,7 @@
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
<version>1.14.2-GA-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>jcr.packaging.module</artifactId>
<packaging>pom</packaging>
12 years, 8 months
exo-jcr SVN: r4986 - ws/trunk/packaging/module.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-09-27 12:16:07 -0400 (Tue, 27 Sep 2011)
New Revision: 4986
Modified:
ws/trunk/packaging/module/pom.xml
Log:
EXOJCR-1569: Set properly the relativePath in the pom files [ws]
Modified: ws/trunk/packaging/module/pom.xml
===================================================================
--- ws/trunk/packaging/module/pom.xml 2011-09-27 16:15:51 UTC (rev 4985)
+++ ws/trunk/packaging/module/pom.xml 2011-09-27 16:16:07 UTC (rev 4986)
@@ -3,6 +3,7 @@
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
<version>2.2.2-GA-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
12 years, 8 months
exo-jcr SVN: r4985 - core/trunk/packaging/module.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-09-27 12:15:51 -0400 (Tue, 27 Sep 2011)
New Revision: 4985
Modified:
core/trunk/packaging/module/pom.xml
Log:
EXOJCR-1569: Set properly the relativePath in the pom files [core]
Modified: core/trunk/packaging/module/pom.xml
===================================================================
--- core/trunk/packaging/module/pom.xml 2011-09-27 16:15:35 UTC (rev 4984)
+++ core/trunk/packaging/module/pom.xml 2011-09-27 16:15:51 UTC (rev 4985)
@@ -3,6 +3,7 @@
<groupId>org.exoplatform.core</groupId>
<artifactId>core-parent</artifactId>
<version>2.4.2-GA-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
12 years, 8 months
exo-jcr SVN: r4984 - kernel/trunk/packaging/module.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-09-27 12:15:35 -0400 (Tue, 27 Sep 2011)
New Revision: 4984
Modified:
kernel/trunk/packaging/module/pom.xml
Log:
EXOJCR-1569: Set properly the relativePath in the pom files [kernel]
Modified: kernel/trunk/packaging/module/pom.xml
===================================================================
--- kernel/trunk/packaging/module/pom.xml 2011-09-27 10:20:01 UTC (rev 4983)
+++ kernel/trunk/packaging/module/pom.xml 2011-09-27 16:15:35 UTC (rev 4984)
@@ -3,6 +3,7 @@
<groupId>org.exoplatform.kernel</groupId>
<artifactId>kernel-parent</artifactId>
<version>2.3.2-GA-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
12 years, 8 months
exo-jcr SVN: r4983 - in core/trunk: exo.core.component.organization.ldap and 4 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-09-27 06:20:01 -0400 (Tue, 27 Sep 2011)
New Revision: 4983
Added:
core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/DummyLDAPServiceImpl.java
core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/DummyLdapContext.java
core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/TestOrganizationServiceWithApacheDS.java
core/trunk/exo.core.component.organization.ldap/src/test/resources/conf/standalone/
core/trunk/exo.core.component.organization.ldap/src/test/resources/conf/standalone/test-configuration.xml
Removed:
core/trunk/exo.core.component.organization.ldap/src/test/resources/conf/portal/
Modified:
core/trunk/exo.core.component.organization.ldap/pom.xml
core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/ADMembershipDAOImpl.java
core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/MembershipDAOImpl.java
core/trunk/pom.xml
Log:
EXOJCR-1381: Ensured running LDAPOrganizationService unit tests. Added several dummy classes to wrap Apache DS implementation of embedded LDAP server to make it usable with org-service unit tests
Modified: core/trunk/exo.core.component.organization.ldap/pom.xml
===================================================================
--- core/trunk/exo.core.component.organization.ldap/pom.xml 2011-09-26 13:25:30 UTC (rev 4982)
+++ core/trunk/exo.core.component.organization.ldap/pom.xml 2011-09-27 10:20:01 UTC (rev 4983)
@@ -1,4 +1,4 @@
-<!--
+ <!--
Copyright (C) 2009 eXo Platform SAS.
@@ -33,7 +33,7 @@
<name>eXo Core :: Component :: Organization Service LDAP</name>
<description>eXo Organization Service LDAP</description>
- <dependencies>
+ <dependencies>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.cache</artifactId>
@@ -66,7 +66,19 @@
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-server-unit</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </dependency>
+ <dependency>
+ <artifactId>hsqldb</artifactId>
+ <groupId>org.hsqldb</groupId>
+ </dependency>
</dependencies>
<build>
@@ -121,4 +133,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/ADMembershipDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/ADMembershipDAOImpl.java 2011-09-26 13:25:30 UTC (rev 4982)
+++ core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/ADMembershipDAOImpl.java 2011-09-27 10:20:01 UTC (rev 4983)
@@ -20,10 +20,10 @@
import org.exoplatform.services.ldap.LDAPService;
import org.exoplatform.services.organization.CacheHandler;
+import org.exoplatform.services.organization.CacheHandler.CacheType;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.Membership;
import org.exoplatform.services.organization.OrganizationService;
-import org.exoplatform.services.organization.CacheHandler.CacheType;
import org.exoplatform.services.organization.impl.MembershipImpl;
import java.util.ArrayList;
@@ -228,11 +228,6 @@
Group group = getGroupFromMembershipDN(ctx, dn);
if (type == null)
type = explodeDN(dn, true)[0];
- MembershipImpl membership = new MembershipImpl();
- membership.setId(user + "," + type + "," + group.getId());
- membership.setUserName(user);
- membership.setMembershipType(type);
- membership.setGroupId(group.getId());
- return membership;
+ return createMembershipObject(user, group.getId(), type);
}
}
Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/MembershipDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/MembershipDAOImpl.java 2011-09-26 13:25:30 UTC (rev 4982)
+++ core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/MembershipDAOImpl.java 2011-09-27 10:20:01 UTC (rev 4983)
@@ -222,11 +222,7 @@
+ " because membership type is null");
}
- MembershipImpl membership = new MembershipImpl();
- membership.setMembershipType(mt.getName());
- membership.setUserName(user.getUserName());
- membership.setGroupId(group.getId());
- createMembership(membership, broadcast);
+ createMembership(createMembershipObject(user.getUserName(), group.getId(), mt.getName()), broadcast);
}
/**
Added: core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/DummyLDAPServiceImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/DummyLDAPServiceImpl.java (rev 0)
+++ core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/DummyLDAPServiceImpl.java 2011-09-27 10:20:01 UTC (rev 4983)
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization;
+
+import org.exoplatform.services.ldap.LDAPService;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.ldap.LdapContext;
+
+/**
+ * @author <a href="mailto:dmi3.kuleshov@gmail.com">Dmitry Kuleshov</a>
+ */
+public class DummyLDAPServiceImpl implements LDAPService
+{
+ private static final Log LOG = ExoLogger.getLogger("exo.core.component.ldap.LDAPServiceImpl");
+
+ private Map<String, String> env = new HashMap<String, String>();
+
+ private int serverType = DEFAULT_SERVER;
+
+ public DummyLDAPServiceImpl()
+ {
+ env.put(Context.PROVIDER_URL, "dc=exoplatform,dc=org");
+ env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
+ env.put(Context.SECURITY_CREDENTIALS, "secret");
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.jndi.ServerContextFactory");
+ }
+ @Override
+ public LdapContext getLdapContext() throws NamingException
+ {
+ return new DummyLdapContext(new InitialContext(new Hashtable<String, String>(env)));
+ }
+
+ @Override
+ public LdapContext getLdapContext(boolean renew) throws NamingException
+ {
+ return getLdapContext();
+ }
+
+ @Override
+ public void release(LdapContext ctx) throws NamingException
+ {
+ try
+ {
+ if (ctx != null)
+ {
+ ctx.close();
+ }
+ }
+ catch (NamingException e)
+ {
+ LOG.warn("Exception occurred when tried to close context", e);
+ }
+
+ }
+
+ @Override
+ public InitialContext getInitialContext() throws NamingException
+ {
+ Hashtable<String, String> props = new Hashtable<String, String>(env);
+ props.put(Context.OBJECT_FACTORIES, "com.sun.jndi.ldap.obj.LdapGroupFactory");
+ props.put(Context.STATE_FACTORIES, "com.sun.jndi.ldap.obj.LdapGroupFactory");
+ return new DummyLdapContext(new InitialContext(props));
+ }
+
+ @Override
+ public boolean authenticate(String userDN, String password) throws NamingException
+ {
+ Hashtable<String, String> props = new Hashtable<String, String>(env);
+ props.put(Context.SECURITY_AUTHENTICATION, "simple");
+ props.put(Context.SECURITY_PRINCIPAL, userDN);
+ props.put(Context.SECURITY_CREDENTIALS, password);
+ props.put("com.sun.jndi.ldap.connect.pool", "false");
+
+ InitialContext ctx = null;
+ try
+ {
+ ctx = new DummyLdapContext(new InitialContext(new Hashtable<String, String>(env)));
+ return true;
+ }
+ catch (NamingException e)
+ {
+ LOG.debug("Error during initialization LDAP Context", e);
+ return false;
+ }
+ finally
+ {
+ closeContext(ctx);
+ }
+ }
+
+ @Override
+ public int getServerType()
+ {
+ return 0;
+ }
+
+ private int toServerType(String name)
+ {
+ name = name.trim();
+ if (name == null || name.length() < 1)
+ return DEFAULT_SERVER;
+ if (name.equalsIgnoreCase("ACTIVE.DIRECTORY"))
+ return ACTIVE_DIRECTORY_SERVER;
+ return DEFAULT_SERVER;
+ }
+
+ private void closeContext(Context ctx)
+ {
+ try
+ {
+ if (ctx != null)
+ {
+ ctx.close();
+ }
+ }
+ catch (NamingException e)
+ {
+ LOG.warn("Exception occurred when tried to close context", e);
+ }
+ }
+
+}
Added: core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/DummyLdapContext.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/DummyLdapContext.java (rev 0)
+++ core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/DummyLdapContext.java 2011-09-27 10:20:01 UTC (rev 4983)
@@ -0,0 +1,489 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization;
+
+import org.apache.directory.shared.ldap.message.ArrayNamingEnumeration;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.Name;
+import javax.naming.NameClassPair;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.Control;
+import javax.naming.ldap.ExtendedRequest;
+import javax.naming.ldap.ExtendedResponse;
+import javax.naming.ldap.LdapContext;
+
+/**
+ * @author <a href="mailto:dmi3.kuleshov@gmail.com">Dmitry Kuleshov</a>
+ */
+public class DummyLdapContext extends InitialDirContext implements LdapContext
+{
+ InitialContext initialContext;
+
+ DirContext appRoot;
+
+ public DummyLdapContext(InitialContext initialContext) throws NamingException
+ {
+ this.initialContext = initialContext;
+ appRoot = (DirContext)initialContext.lookup("");
+ }
+
+ @Override
+ public Attributes getAttributes(Name name) throws NamingException
+ {
+ return appRoot.getAttributes(name);
+ }
+
+ @Override
+ public Attributes getAttributes(String name) throws NamingException
+ {
+ return appRoot.getAttributes(removeExoplatformOrg(name));
+ }
+
+ @Override
+ public Attributes getAttributes(Name name, String[] attrIds) throws NamingException
+ {
+ return appRoot.getAttributes(name, attrIds);
+ }
+
+ @Override
+ public Attributes getAttributes(String name, String[] attrIds) throws NamingException
+ {
+ return appRoot.getAttributes(name, attrIds);
+ }
+
+ @Override
+ public void modifyAttributes(Name name, int mod_op, Attributes attrs) throws NamingException
+ {
+ appRoot.modifyAttributes(name, mod_op, attrs);
+ }
+
+ @Override
+ public void modifyAttributes(String name, int mod_op, Attributes attrs) throws NamingException
+ {
+ appRoot.modifyAttributes(name, mod_op, attrs);
+ }
+
+ @Override
+ public void modifyAttributes(Name name, ModificationItem[] mods) throws NamingException
+ {
+ appRoot.modifyAttributes(name, mods);
+ }
+
+ @Override
+ public void modifyAttributes(String name, ModificationItem[] mods) throws NamingException
+ {
+ appRoot.modifyAttributes(removeExoplatformOrg(name), mods);
+ }
+
+ @Override
+ public void bind(Name name, Object obj, Attributes attrs) throws NamingException
+ {
+ appRoot.bind(name, obj, attrs);
+ }
+
+ @Override
+ public void bind(String name, Object obj, Attributes attrs) throws NamingException
+ {
+ appRoot.bind(name, obj, attrs);
+ }
+
+ @Override
+ public void rebind(Name name, Object obj, Attributes attrs) throws NamingException
+ {
+ appRoot.rebind(name, obj, attrs);
+ }
+
+ @Override
+ public void rebind(String name, Object obj, Attributes attrs) throws NamingException
+ {
+ appRoot.rebind(name, obj, attrs);
+ }
+
+ @Override
+ public DirContext createSubcontext(Name name, Attributes attrs) throws NamingException
+ {
+ return appRoot.createSubcontext(name, attrs);
+ }
+
+ @Override
+ public DirContext createSubcontext(String name, Attributes attrs) throws NamingException
+ {
+ Attribute attr = new BasicAttribute("objectclass");
+ attr.add("top");
+ attr.add("organization");
+ attrs.put(attr);
+
+ return appRoot.createSubcontext(removeExoplatformOrg(name), attrs);
+ }
+
+ @Override
+ public DirContext getSchema(Name name) throws NamingException
+ {
+ return appRoot.getSchema(name);
+ }
+
+ @Override
+ public DirContext getSchema(String name) throws NamingException
+ {
+ return appRoot.getSchema(name);
+ }
+
+ @Override
+ public DirContext getSchemaClassDefinition(Name name) throws NamingException
+ {
+ return appRoot.getSchemaClassDefinition(name);
+ }
+
+ @Override
+ public DirContext getSchemaClassDefinition(String name) throws NamingException
+ {
+ return appRoot.getSchemaClassDefinition(name);
+ }
+
+ @Override
+ public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes, String[] attributesToReturn)
+ throws NamingException
+ {
+ return appRoot.search(name, matchingAttributes, attributesToReturn);
+ }
+
+ @Override
+ public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes, String[] attributesToReturn)
+ throws NamingException
+ {
+ return appRoot.search(name, matchingAttributes, attributesToReturn);
+ }
+
+ @Override
+ public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes) throws NamingException
+ {
+ return appRoot.search(name, matchingAttributes);
+ }
+
+ @Override
+ public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes) throws NamingException
+ {
+ return appRoot.search(name, matchingAttributes);
+ }
+
+ @Override
+ public NamingEnumeration<SearchResult> search(Name name, String filter, SearchControls cons) throws NamingException
+ {
+ return appRoot.search(name, filter, cons);
+ }
+
+ @Override
+ public NamingEnumeration<SearchResult> search(String name, String filter, SearchControls cons)
+ throws NamingException
+ {
+ if (!filter.startsWith("("))
+ {
+ filter = "(" + filter + ")";
+ }
+
+ return swapNameWithNameInNamespace(appRoot.search(removeExoplatformOrg(name), filter, cons));
+ }
+
+ @Override
+ public NamingEnumeration<SearchResult> search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons)
+ throws NamingException
+ {
+ return appRoot.search(name, filterExpr, filterArgs, cons);
+ }
+
+ @Override
+ public NamingEnumeration<SearchResult> search(String name, String filterExpr, Object[] filterArgs,
+ SearchControls cons) throws NamingException
+ {
+ return appRoot.search(name, filterExpr, filterArgs, cons);
+ }
+
+ @Override
+ public Object lookup(Name name) throws NamingException
+ {
+ return initialContext.lookup(name);
+ }
+
+ @Override
+ public Object lookup(String name) throws NamingException
+ {
+ return initialContext.lookup(name);
+ }
+
+ @Override
+ public void bind(Name name, Object obj) throws NamingException
+ {
+ appRoot.bind(name, obj);
+ }
+
+ @Override
+ public void bind(String name, Object obj) throws NamingException
+ {
+ appRoot.bind(name, obj);
+ }
+
+ @Override
+ public void rebind(Name name, Object obj) throws NamingException
+ {
+ appRoot.rebind(name, obj);
+ }
+
+ @Override
+ public void rebind(String name, Object obj) throws NamingException
+ {
+ appRoot.rebind(name, obj);
+ }
+
+ @Override
+ public void unbind(Name name) throws NamingException
+ {
+ appRoot.unbind(name);
+ }
+
+ @Override
+ public void unbind(String name) throws NamingException
+ {
+ appRoot.unbind(name);
+ }
+
+ @Override
+ public void rename(Name oldName, Name newName) throws NamingException
+ {
+ appRoot.rename(oldName, newName);
+ }
+
+ @Override
+ public void rename(String oldName, String newName) throws NamingException
+ {
+ appRoot.rename(oldName, newName);
+ }
+
+ @Override
+ public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
+ {
+ return appRoot.list(name);
+ }
+
+ @Override
+ public NamingEnumeration<NameClassPair> list(String name) throws NamingException
+ {
+ return appRoot.list(name);
+ }
+
+ @Override
+ public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
+ {
+ return appRoot.listBindings(name);
+ }
+
+ @Override
+ public NamingEnumeration<Binding> listBindings(String name) throws NamingException
+ {
+ return appRoot.listBindings(name);
+ }
+
+ @Override
+ public void destroySubcontext(Name name) throws NamingException
+ {
+ appRoot.destroySubcontext(name);
+ }
+
+ @Override
+ public void destroySubcontext(String name) throws NamingException
+ {
+ appRoot.destroySubcontext(removeExoplatformOrg(name));
+ }
+
+ @Override
+ public Context createSubcontext(Name name) throws NamingException
+ {
+ return appRoot.createSubcontext(name);
+ }
+
+ @Override
+ public Context createSubcontext(String name) throws NamingException
+ {
+ return appRoot.createSubcontext(name);
+ }
+
+ @Override
+ public Object lookupLink(Name name) throws NamingException
+ {
+ return initialContext.lookupLink(name);
+ }
+
+ @Override
+ public Object lookupLink(String name) throws NamingException
+ {
+ return initialContext.lookupLink(name);
+ }
+
+ @Override
+ public NameParser getNameParser(Name name) throws NamingException
+ {
+ return initialContext.getNameParser(name);
+ }
+
+ @Override
+ public NameParser getNameParser(String name) throws NamingException
+ {
+ return initialContext.getNameParser(name);
+ }
+
+ @Override
+ public Name composeName(Name name, Name prefix) throws NamingException
+ {
+
+ return appRoot.composeName(name, prefix);
+ }
+
+ @Override
+ public String composeName(String name, String prefix) throws NamingException
+ {
+ return appRoot.composeName(name, prefix);
+ }
+
+ @Override
+ public Object addToEnvironment(String propName, Object propVal) throws NamingException
+ {
+ return appRoot.addToEnvironment(propName, propVal);
+ }
+
+ @Override
+ public Object removeFromEnvironment(String propName) throws NamingException
+ {
+ return appRoot.removeFromEnvironment(propName);
+ }
+
+ @Override
+ public Hashtable<?, ?> getEnvironment() throws NamingException
+ {
+ return appRoot.getEnvironment();
+ }
+
+ @Override
+ public void close() throws NamingException
+ {
+ initialContext.close();
+ }
+
+ @Override
+ public String getNameInNamespace() throws NamingException
+ {
+ return appRoot.getNameInNamespace();
+ }
+
+ @Override
+ public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException
+ {
+ return null;
+ }
+
+ @Override
+ public LdapContext newInstance(Control[] requestControls) throws NamingException
+ {
+ return null;
+ }
+
+ @Override
+ public void reconnect(Control[] connCtls) throws NamingException
+ {
+ }
+
+ @Override
+ public Control[] getConnectControls() throws NamingException
+ {
+ return null;
+ }
+
+ @Override
+ public void setRequestControls(Control[] requestControls) throws NamingException
+ {
+ }
+
+ @Override
+ public Control[] getRequestControls() throws NamingException
+ {
+ return null;
+ }
+
+ @Override
+ public Control[] getResponseControls() throws NamingException
+ {
+ return null;
+ }
+
+ private String removeExoplatformOrg(String name)
+ {
+ int i = name.toLowerCase().indexOf("dc=exoplatform,dc=org");
+ if (i > -1)
+ {
+ return name.substring(0, i);
+ }
+ return name;
+ }
+
+ private String removeGroupProtal(String name)
+ {
+ name = removeExoplatformOrg(name);
+ int i = name.toLowerCase().indexOf("ou=groups,ou=portal");
+ if (i > -1)
+ {
+ return name.substring(0, i);
+ }
+ return name;
+ }
+
+ @SuppressWarnings("unchecked")
+ private NamingEnumeration<SearchResult> swapNameWithNameInNamespace(NamingEnumeration<SearchResult> nesr) throws NamingException
+ {
+ List<SearchResult> resultList = new ArrayList<SearchResult>();
+ SearchResult sr;
+
+ while (nesr.hasMore())
+ {
+ sr = nesr.next();
+ sr.setNameInNamespace(sr.getName());
+ sr.setName(removeGroupProtal(sr.getName()));
+
+ resultList.add(sr);
+ }
+
+ return new ArrayNamingEnumeration(resultList.toArray());
+ }
+
+}
Added: core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/TestOrganizationServiceWithApacheDS.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/TestOrganizationServiceWithApacheDS.java (rev 0)
+++ core/trunk/exo.core.component.organization.ldap/src/test/java/org/exoplatform/services/organization/TestOrganizationServiceWithApacheDS.java 2011-09-27 10:20:01 UTC (rev 4983)
@@ -0,0 +1,482 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.organization;
+
+import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
+import org.apache.directory.server.unit.AbstractServerTest;
+import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.container.StandaloneContainer;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+
+/**
+ * Created by The eXo Platform SAS Author : Hoa Pham
+ * hoapham@exoplatform.com,phamvuxuanhoa(a)yahoo.com Oct 27, 2005
+ */
+
+@SuppressWarnings("unchecked")
+public class TestOrganizationServiceWithApacheDS extends AbstractServerTest
+{
+
+ static String GroupParent = "GroupParent";
+
+ static String Group1 = "Group1";
+
+ static String Group2 = "Group2";
+
+ static String Benj = "Benj";
+
+ static String Tuan = "Tuan";
+
+ static String TestMembershipType1 = "TestMembership1";
+
+ static String TestMembershipType2 = "TestMembership2";
+
+ static String TestMembershipType3 = "TestMembership3";
+
+ OrganizationService service_;
+
+ UserHandler userHandler_;
+
+ UserProfileHandler profileHandler_;
+
+ GroupHandler groupHandler_;
+
+ MembershipTypeHandler mtHandler_;
+
+ MembershipHandler membershipHandler_;
+
+ boolean runtest = true;
+
+ public void setUp() throws Exception
+ {
+ if (!runtest)
+ {
+ return;
+ }
+
+ MutablePartitionConfiguration pcfg = new MutablePartitionConfiguration();
+
+ pcfg.setName("eXoTestPartition");
+ pcfg.setSuffix("dc=exoplatform,dc=org");
+
+ Set<String> indexedAttrs = new HashSet<String>();
+ indexedAttrs.add("objectClass");
+ indexedAttrs.add("o");
+ pcfg.setIndexedAttributes(indexedAttrs);
+
+ Attributes attrs = new BasicAttributes(true);
+ Attribute attr = new BasicAttribute("objectClass");
+ attr.add("top");
+ attr.add("organization");
+ attrs.put(attr);
+ attr = new BasicAttribute("o");
+ attr.add("eXoTestPartition");
+ attrs.put(attr);
+ pcfg.setContextEntry(attrs);
+ Set<MutablePartitionConfiguration> pcfgs = new HashSet<MutablePartitionConfiguration>();
+ pcfgs.add(pcfg);
+ configuration.setContextPartitionConfigurations(pcfgs);
+ File workingDirectory = new File("server-work");
+ configuration.setWorkingDirectory(workingDirectory);
+ super.setUp();
+
+ String containerConf =
+ TestOrganizationServiceWithApacheDS.class.getResource("/conf/standalone/test-configuration.xml").toString();
+ StandaloneContainer.addConfigurationURL(containerConf);
+ StandaloneContainer container = StandaloneContainer.getInstance();
+
+ service_ = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
+ userHandler_ = service_.getUserHandler();
+ profileHandler_ = service_.getUserProfileHandler();
+ groupHandler_ = service_.getGroupHandler();
+ mtHandler_ = service_.getMembershipTypeHandler();
+ membershipHandler_ = service_.getMembershipHandler();
+ }
+
+ public void tearDown() throws Exception
+ {
+ if (!runtest)
+ {
+ return;
+ }
+ mtHandler_.removeMembershipType(TestMembershipType1, true);
+ mtHandler_.removeMembershipType(TestMembershipType2, true);
+ mtHandler_.removeMembershipType(TestMembershipType3, true);
+
+ Group gr = groupHandler_.findGroupById("/" + Group1);
+ if (gr != null)
+ {
+ groupHandler_.removeGroup(gr, true);
+ }
+
+ gr = groupHandler_.findGroupById("/" + Group2);
+ if (gr != null)
+ {
+ groupHandler_.removeGroup(gr, true);
+ }
+
+ gr = groupHandler_.findGroupById("/" + GroupParent);
+ if (gr != null)
+ {
+ groupHandler_.removeGroup(gr, true);
+ }
+
+ userHandler_.removeUser(Benj, true);
+ userHandler_.removeUser(Tuan, true);
+ }
+
+ protected String getDescription()
+ {
+ if (!runtest)
+ {
+ return "";
+ }
+
+ return "Test hibernate organization service.";
+ }
+
+ public void testUserPageSize() throws Exception
+ {
+ if (!runtest)
+ {
+ return;
+ }
+
+ /* Create an user with UserName: test */
+ String USER = "test";
+ int s = 15;
+
+ for (int i = 0; i < s; i++)
+ {
+ createUser(USER + "_" + String.valueOf(i));
+ }
+
+ Query query = new Query();
+ PageList users = userHandler_.findUsers(query);
+ System.out.println("size: " + users.getAvailablePage());
+
+ System.out.println("\npage 1:");
+ List list = users.getPage(1);
+ System.out.println("size : " + list.size());
+ for (Object ele : list)
+ {
+ User u = (User)ele;
+ System.out.println(u.getUserName() + " and " + u.getEmail());
+ }
+ System.out.println("\n\n");
+ //
+ try
+ {
+ for (int i = 0; i < s; i++)
+ userHandler_.removeUser(USER + "_" + String.valueOf(i), true);
+ }
+ catch (Exception exp)
+ {
+ exp.printStackTrace();
+ }
+ }
+
+ public void testUser() throws Exception
+ {
+ /* Create an user with UserName: test */
+ String USER = "test";
+ User user = createUser(USER);
+
+ // authentication
+ user.setPassword("test");
+ userHandler_.saveUser(user, true);
+ assertTrue("Authentication failed ", userHandler_.authenticate(USER, "test"));
+
+ User u = userHandler_.findUserByName(USER);
+ assertTrue("Found user instance", u != null);
+ assertEquals("Expect user name is: ", USER, u.getUserName());
+
+ UserProfile up = profileHandler_.createUserProfileInstance(USER);
+ profileHandler_.saveUserProfile(up, true);
+
+ up = profileHandler_.findUserProfileByName(USER);
+ assertTrue("Expect user profile is found: ", profileHandler_.findUserProfileByName(USER) != null);
+
+ // Update user's information
+ u.setFirstName("Exo(Update)");
+ userHandler_.saveUser(u, false);
+ up.getUserInfoMap().put("user.gender", "male");
+ profileHandler_.saveUserProfile(up, true);
+ up = profileHandler_.findUserProfileByName(USER);
+ assertEquals("expect first name is", "Exo(Update)", u.getFirstName());
+ assertEquals("Expect profile is updated: user.gender is ", "male", up.getUserInfoMap().get("user.gender"));
+
+ // Remove a user: Expect result: user and it's profile will be removed
+ // NOTE >>>> FIX without listeners remove profile manually
+ userHandler_.removeUser(USER, true);
+ profileHandler_.removeUserProfile(USER, true);
+ assertEquals(null, userHandler_.findUserByName(USER));
+ assertTrue(profileHandler_.findUserProfileByName(USER) == null);
+ }
+
+ public void testGroup() throws Exception
+ {
+ if (!runtest)
+ {
+ return;
+ }
+
+ Group groupParent = groupHandler_.createGroupInstance();
+ groupParent.setGroupName(GroupParent);
+ groupParent.setDescription("This is description");
+ groupHandler_.addChild(null, groupParent, true);
+ assertTrue(((Group)groupParent).getId() != null);
+
+ groupParent = groupHandler_.findGroupById(groupParent.getId());
+ assertEquals(groupParent.getGroupName(), "GroupParent");
+
+ /* Create a child group with name: Group1 */
+ Group groupChild = groupHandler_.createGroupInstance();
+ groupChild.setGroupName(Group1);
+ groupHandler_.addChild(groupParent, groupChild, true);
+ groupChild = groupHandler_.findGroupById(groupChild.getId());
+ assertEquals(groupChild.getParentId(), groupParent.getId());
+ assertEquals("Expect group child's name is: ", Group1, groupChild.getGroupName());
+
+ /* Update groupChild's information */
+ groupChild.setLabel("GroupRenamed");
+ groupChild.setDescription("new description ");
+ groupHandler_.saveGroup(groupChild, true);
+ assertEquals(groupHandler_.findGroupById(groupChild.getId()).getLabel(), "GroupRenamed");
+
+ /* Create a group child with name is: Group2 */
+ groupChild = groupHandler_.createGroupInstance();
+ groupChild.setGroupName(Group2);
+ groupHandler_.addChild(groupParent, groupChild, true);
+ groupChild = groupHandler_.findGroupById(groupChild.getId());
+ assertEquals(groupChild.getParentId(), groupParent.getId());
+ assertEquals("Expect group child's name is: ", Group2, groupChild.getGroupName());
+
+ Collection groups = groupHandler_.findGroups(groupParent);
+ assertEquals("Expect number of child group in parent group is: ", 2, groups.size());
+ Object arraygroups[] = groups.toArray();
+ assertEquals("Expect child group's name is: ", Group1, ((Group)arraygroups[0]).getGroupName());
+ assertEquals("Expect child group's name is: ", Group2, ((Group)arraygroups[1]).getGroupName());
+
+ groupHandler_.removeGroup(groupHandler_.findGroupById("/" + GroupParent + "/" + Group1), true);
+ assertEquals("Expect child group has been removed: ", null, groupHandler_.findGroupById("/" + Group1));
+ assertEquals("Expect only 1 child group in parent group", 1, groupHandler_.findGroups(groupParent).size());
+
+ groupHandler_.removeGroup(groupParent, true);
+ assertEquals("Expect ParentGroup is removed:", null, groupHandler_.findGroupById(groupParent.getId()));
+ assertEquals("Expect all child group is removed: ", 0, groupHandler_.findGroups(groupParent).size());
+ }
+
+ public void testMembershipType() throws Exception
+ {
+ if (!runtest)
+ {
+ return;
+ }
+
+ int bmn = mtHandler_.findMembershipTypes().size();
+
+ MembershipType mt = mtHandler_.createMembershipTypeInstance();
+ mt.setName(TestMembershipType1);
+ mt.setDescription("This is a test");
+ mt.setOwner("exo");
+ mtHandler_.createMembershipType(mt, true);
+ assertEquals("Expect mebershiptype is:", TestMembershipType1, mtHandler_.findMembershipType(TestMembershipType1)
+ .getName());
+
+ String desc = "This is a test (update)";
+ mt.setDescription(desc);
+ mtHandler_.saveMembershipType(mt, true);
+ assertEquals("Expect membershiptype's description", desc, mtHandler_.findMembershipType(TestMembershipType1)
+ .getDescription());
+
+ mt = mtHandler_.createMembershipTypeInstance();
+ mt.setName(TestMembershipType2);
+ mt.setOwner("exo");
+ mtHandler_.createMembershipType(mt, true);
+
+ Collection ms = mtHandler_.findMembershipTypes();
+ assertEquals("Expect " + (bmn + 2) + " membership in collection: ", bmn + 2, ms.size());
+
+ mtHandler_.removeMembershipType(TestMembershipType1, true);
+ assertEquals("Membership type has been removed:", null, mtHandler_.findMembershipType(TestMembershipType1));
+ assertEquals("Expect " + (bmn + 1) + " membership in collection(1 is default): ", bmn + 1, mtHandler_
+ .findMembershipTypes().size());
+
+ mtHandler_.removeMembershipType(TestMembershipType2, true);
+ assertEquals("Membership type has been removed:", null, mtHandler_.findMembershipType(TestMembershipType2));
+ assertEquals("Expect " + bmn + " membership in collection(default type): ", bmn, mtHandler_
+ .findMembershipTypes().size());
+
+ }
+
+ public void testMembership() throws Exception
+ {
+ if (!runtest)
+ {
+ return;
+ }
+
+ User user = createUser(Benj);
+ User user2 = createUser(Tuan);
+
+ Group group1 = groupHandler_.createGroupInstance();
+ group1.setGroupName(Group1);
+ groupHandler_.addChild(null, group1, true);
+
+ Group group2 = groupHandler_.createGroupInstance();
+ group2.setGroupName(Group2);
+ groupHandler_.addChild(null, group2, true);
+
+ MembershipType mt1 = mtHandler_.createMembershipTypeInstance();
+ mt1.setName(TestMembershipType1);
+ mtHandler_.createMembershipType(mt1, true);
+
+ membershipHandler_.linkMembership(user, groupHandler_.findGroupById("/" + Group1), mt1, true);
+ membershipHandler_.linkMembership(user, groupHandler_.findGroupById("/" + Group2), mt1, true);
+ membershipHandler_.linkMembership(user2, groupHandler_.findGroupById("/" + Group2), mt1, true);
+
+ MembershipType mt2 = mtHandler_.createMembershipTypeInstance();
+ mt2.setName(TestMembershipType2);
+ mtHandler_.createMembershipType(mt2, true);
+ membershipHandler_.linkMembership(user, groupHandler_.findGroupById("/" + Group2), mt2, true);
+
+ MembershipType mt3 = mtHandler_.createMembershipTypeInstance();
+ mt3.setName(TestMembershipType3);
+ mtHandler_.createMembershipType(mt3, true);
+ membershipHandler_.linkMembership(user, groupHandler_.findGroupById("/" + Group2), mt3, true);
+
+ System.out.println(" --------- find memberships by group -------------");
+ Collection<Membership> mems =
+ membershipHandler_.findMembershipsByGroup(groupHandler_.findGroupById("/" + Group2));
+ assertEquals("Expect number of membership in group 2 is: ", 4, mems.size());
+ for (Membership m : mems)
+ {
+ System.out.println(m);
+ }
+
+ System.out.println(" --------- find memberships by user and group--------------");
+ mems = membershipHandler_.findMembershipsByUserAndGroup(Benj, "/" + Group2);
+ assertEquals("Expect number of membership in " + Group2 + " relate with benj is: ", 3, mems.size());
+ for (Membership m : mems)
+ {
+ System.out.println(m);
+ }
+
+ System.out.println(" --------- find memberships by user-------------");
+ mems = membershipHandler_.findMembershipsByUser(Benj);
+ assertEquals("expect membership is: ", 4, mems.size());
+ for (Membership m : mems)
+ {
+ System.out.println(m);
+ }
+
+ System.out.println("---------- find membership by User, Group and Type-----------");
+ Membership membership =
+ membershipHandler_.findMembershipByUserGroupAndType(Benj, "/" + Group2, TestMembershipType1);
+ assertTrue("Expect membership is found:", membership != null);
+ assertEquals("Expect membership type is: ", TestMembershipType1, membership.getMembershipType());
+ assertEquals("Expect groupId of this membership is: ", "/" + Group2, membership.getGroupId());
+ assertEquals("Expect user of this membership is: ", Benj, membership.getUserName());
+
+ System.out.println(" --------- find groups by user -------------");
+ Collection<Group> groups = groupHandler_.findGroupsOfUser(Benj);
+ assertEquals("expect group is: ", 2, groups.size());
+ for (Group g : groups)
+ {
+ System.out.println(g);
+ }
+
+ System.out.println("---------- find group of a user by membership-----------");
+ groups = groupHandler_.findGroupByMembership(Benj, TestMembershipType1);
+ assertEquals("expect group is: ", 2, groups.size());
+ for (Group g : groups)
+ {
+ System.out.println(g);
+ }
+
+ System.out.println("----------------- removed a membership ---------------------");
+ String memId =
+ membershipHandler_.findMembershipByUserGroupAndType(Benj, "/" + Group2, TestMembershipType3).getId();
+ for (Group g : groups)
+ {
+ System.out.println(g);
+ }
+ membershipHandler_.removeMembership(memId, true);
+ assertTrue("Membership was removed: ",
+ membershipHandler_.findMembershipByUserGroupAndType(Benj, "/" + Group2, TestMembershipType3) == null);
+ for (Group g : groups)
+ {
+ System.out.println(g);
+ }
+
+ System.out.println("----------------- removed a user----------------------");
+ userHandler_.removeUser(Tuan, true);
+ assertTrue("This user was removed", userHandler_.findUserByName(Tuan) == null);
+ mems = membershipHandler_.findMembershipsByUser(Tuan);
+ assertTrue("All membership related with this user was removed:", mems.isEmpty());
+
+ System.out.println("----------------- removed a group------------");
+ groupHandler_.removeGroup(groupHandler_.findGroupById("/" + Group1), true);
+ assertTrue("This group was removed", groupHandler_.findGroupById("/" + Group1) == null);
+
+ System.out.println("----------------- removed a membershipType------------");
+ mtHandler_.removeMembershipType(TestMembershipType1, true);
+ assertTrue("This membershipType was removed: ", mtHandler_.findMembershipType(TestMembershipType1) == null);
+ // Check all memberships associate with all groups
+ // to guarantee that no membership associate with removed membershipType
+ groups = groupHandler_.findGroups(groupHandler_.findGroupById("/"));
+ for (Group g : groups)
+ {
+ mems = membershipHandler_.findMembershipsByGroup(g);
+ for (Membership m : mems)
+ {
+ assertFalse("MembershipType of this membership is not: " + TestMembershipType1, m.getMembershipType()
+ .equalsIgnoreCase(TestMembershipType1));
+ }
+ }
+
+ }
+
+ public User createUser(String userName) throws Exception
+ {
+ User user = userHandler_.findUserByName(userName);
+ if (user != null)
+ {
+ return user;
+ }
+ user = userHandler_.createUserInstance(userName);
+ user.setPassword("default");
+ user.setFirstName("default");
+ user.setLastName("default");
+ user.setEmail("exo(a)exoportal.org");
+ userHandler_.createUser(user, true);
+ return user;
+ }
+}
Added: core/trunk/exo.core.component.organization.ldap/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/test/resources/conf/standalone/test-configuration.xml (rev 0)
+++ core/trunk/exo.core.component.organization.ldap/src/test/resources/conf/standalone/test-configuration.xml 2011-09-27 10:20:01 UTC (rev 4983)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration>
+
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name">
+ <string>default</string>
+ </field>
+ <field name="maxSize">
+ <int>300</int>
+ </field>
+ <field name="liveTime">
+ <long>300</long>
+ </field>
+ <field name="distributed">
+ <boolean>false</boolean>
+ </field>
+ <field name="implementation">
+ <string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>exo-service:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.show_sql" value="false" />
+ <property name="hibernate.cglib.use_reflection_optimizer" value="true" />
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:db/default" />
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" />
+ <property name="hibernate.connection.autocommit" value="true" />
+ <property name="hibernate.connection.username" value="sa" />
+ <property name="hibernate.connection.password" value="" />
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
+ <property name="hibernate.c3p0.min_size" value="5" />
+ <property name="hibernate.c3p0.max_size" value="20" />
+ <property name="hibernate.c3p0.timeout" value="1800" />
+ <property name="hibernate.c3p0.max_statements" value="50" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.ldap.LDAPService</key>
+ <type>org.exoplatform.services.organization.DummyLDAPServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>ldap.config</name>
+ <description>Default ldap config</description>
+ <object type="org.exoplatform.services.ldap.impl.LDAPConnectionConfig">
+ <field name="providerURL"><string>ldap://127.0.0.1:389,10.0.0.1:389</string></field>
+ <field name="rootdn"><string>CN=Manager,DC=exoplatform,DC=org</string></field>
+ <field name="password"><string>secret</string></field>
+ <!-- field name="authenticationType"><string>simple</string></field-->
+ <field name="version"><string>3</string></field>
+ <field name="referralMode"><string>follow</string></field>
+ <!-- field name="serverName"><string>active.directory</string></field-->
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.ldap.OrganizationServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.ldap.OrganizationLdapInitializer</type>
+ <description>this listener populate organization ldap service create default dn</description>
+ </component-plugin>
+ </component-plugins>
+ <init-params>
+ <value-param>
+ <name>ldap.userDN.key</name>
+ <description>The key used to compose user DN</description>
+ <value>cn</value>
+ </value-param>
+ <value-param>
+ <name>ldap.groupDN.key</name>
+ <description>The key used to compose group DN</description>
+ <value>ou</value>
+ </value-param>
+ <object-param>
+ <name>ldap.attribute.mapping</name>
+ <description>ldap attribute mapping</description>
+ <object type="org.exoplatform.services.organization.ldap.LDAPAttributeMapping">
+ <field name="userLDAPClasses">
+ <string>top,person,organizationalPerson,inetOrgPerson</string>
+ </field>
+ <field name="profileLDAPClasses">
+ <string>top,organizationalPerson</string>
+ </field>
+ <field name="groupLDAPClasses">
+ <string>top,organizationalUnit</string>
+ </field>
+ <field name="membershipTypeLDAPClasses">
+ <string>top,organizationalRole</string>
+ </field>
+ <field name="membershipLDAPClasses">
+ <string>top,groupOfNames</string>
+ </field>
+
+ <field name="baseURL">
+ <string>DC=exoplatform,DC=org</string>
+ </field>
+
+ <field name="groupsURL">
+ <string>OU=groups,OU=portal,DC=exoplatform,DC=org</string>
+ </field>
+ <field name="membershipTypeURL">
+ <string>OU=memberships,OU=portal,DC=exoplatform,DC=org</string>
+ </field>
+ <field name="userURL">
+ <string>OU=users,OU=portal,DC=exoplatform,DC=org</string>
+ </field>
+ <field name="profileURL">
+ <string>OU=profiles,OU=portal,DC=exoplatform,DC=org</string>
+ </field>
+
+ <field name="userUsernameAttr">
+ <string>uid</string>
+ </field>
+ <field name="userPassword">
+ <string>userPassword</string>
+ </field>
+ <field name="userFirstNameAttr">
+ <string>givenName</string>
+ </field>
+ <field name="userLastNameAttr">
+ <string>sn</string>
+ </field>
+ <field name="userDisplayNameAttr">
+ <string>displayName</string>
+ </field>
+ <field name="userMailAttr">
+ <string>mail</string>
+ </field>
+ <field name="userObjectClassFilter">
+ <string>objectClass=person</string>
+ </field>
+
+ <field name="membershipTypeMemberValue">
+ <string>member</string>
+ </field>
+ <field name="membershipTypeRoleNameAttr">
+ <string>cn</string>
+ </field>
+ <field name="membershipTypeNameAttr">
+ <string>cn</string>
+ </field>
+ <field name="membershipTypeObjectClassFilter">
+ <string>objectClass=organizationalRole</string>
+ </field>
+ <field name="membershiptypeObjectClass">
+ <string>organizationalRole</string>
+ </field>
+
+ <field name="groupNameAttr">
+ <string>ou</string>
+ </field>
+ <field name="groupLabelAttr">
+ <string>l</string>
+ </field>
+ <field name="groupObjectClass">
+ <string>organizationalUnit</string>
+ </field>
+ <field name="groupObjectClassFilter">
+ <string>objectClass=organizationalUnit</string>
+ </field>
+
+ <field name="membershipObjectClass">
+ <string>groupOfNames</string>
+ </field>
+ <field name="membershipObjectClassFilter">
+ <string>objectClass=groupOfNames</string>
+ </field>
+
+ <field name="ldapCreatedTimeStampAttr">
+ <string>createdTimeStamp</string>
+ </field>
+ <field name="ldapModifiedTimeStampAttr">
+ <string>modifiedTimeStamp</string>
+ </field>
+ <field name="ldapDescriptionAttr">
+ <string>description</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>org/exoplatform/services/organization/impl/UserProfileData.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+
+</configuration>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2011-09-26 13:25:30 UTC (rev 4982)
+++ core/trunk/pom.xml 2011-09-27 10:20:01 UTC (rev 4983)
@@ -178,6 +178,26 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-server-unit</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.14.0-GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <artifactId>hsqldb</artifactId>
+ <groupId>org.hsqldb</groupId>
+ <version>2.0.0</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>commons-lang</groupId>
12 years, 8 months
exo-jcr SVN: r4982 - jcr/trunk.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-09-26 09:25:30 -0400 (Mon, 26 Sep 2011)
New Revision: 4982
Modified:
jcr/trunk/pom.xml
Log:
EXOJCR-1513: change deps to trunk
Modified: jcr/trunk/pom.xml
===================================================================
--- jcr/trunk/pom.xml 2011-09-26 12:04:03 UTC (rev 4981)
+++ jcr/trunk/pom.xml 2011-09-26 13:25:30 UTC (rev 4982)
@@ -42,9 +42,9 @@
<properties>
<exo.product.name>exo-jcr</exo.product.name>
<exo.product.specification>1.14</exo.product.specification>
- <org.exoplatform.kernel.version>2.3.1-GA</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.4.1-GA</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.2.1-GA</org.exoplatform.ws.version>
+ <org.exoplatform.kernel.version>2.3.2-GA-SNAPSHOT</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.4.2-GA-SNAPSHOT</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.2.2-GA-SNAPSHOT</org.exoplatform.ws.version>
<org.exoplatform.doc-style.version>1</org.exoplatform.doc-style.version>
</properties>
12 years, 8 months