Author: nfilotto
Date: 2010-08-25 04:34:21 -0400 (Wed, 25 Aug 2010)
New Revision: 2987
Removed:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/access/TestRemoveNodeTypeNode.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceDataPersister.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ScratchWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/JCRNodeTypeDataPersister.java
Log:
EXOJCR-898: Changes reverted since it creates regressions
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceDataPersister.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceDataPersister.java 2010-08-25
08:21:19 UTC (rev 2986)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceDataPersister.java 2010-08-25
08:34:21 UTC (rev 2987)
@@ -347,13 +347,12 @@
if (addACL)
{
+ AccessControlList acl = new AccessControlList();
InternalQName[] mixins = new InternalQName[]{Constants.EXO_OWNEABLE,
Constants.EXO_PRIVILEGEABLE};
exoNamespaces =
TransientNodeData.createNodeData(nsSystem, Constants.EXO_NAMESPACES,
Constants.NT_UNSTRUCTURED, mixins);
- AccessControlList acl = exoNamespaces.getACL();
-
TransientPropertyData primaryType =
TransientPropertyData.createPropertyData(exoNamespaces,
Constants.JCR_PRIMARYTYPE, PropertyType.NAME,
false, new TransientValueData(exoNamespaces.getPrimaryTypeName()));
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ScratchWorkspaceInitializer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ScratchWorkspaceInitializer.java 2010-08-25
08:21:19 UTC (rev 2986)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ScratchWorkspaceInitializer.java 2010-08-25
08:34:21 UTC (rev 2987)
@@ -139,6 +139,9 @@
: Constants.NT_UNSTRUCTURED;
this.dataManager = dataManager;
+ // this.nsPersister = nsPersister;
+ // this.ntRegistry = ntRegistry;
+
}
public NodeData initWorkspace() throws RepositoryException
@@ -270,14 +273,13 @@
if (addACL)
{
+ AccessControlList acl = new AccessControlList();
InternalQName[] mixins = new InternalQName[]{Constants.EXO_OWNEABLE,
Constants.EXO_PRIVILEGEABLE};
jcrSystem =
TransientNodeData.createNodeData(root, Constants.JCR_SYSTEM,
Constants.NT_UNSTRUCTURED, mixins,
Constants.SYSTEM_UUID);
- AccessControlList acl = jcrSystem.getACL();
-
TransientPropertyData primaryType =
TransientPropertyData.createPropertyData(jcrSystem,
Constants.JCR_PRIMARYTYPE, PropertyType.NAME, false,
new TransientValueData(jcrSystem.getPrimaryTypeName()));
@@ -338,6 +340,15 @@
dataManager.save(new TransactionChangesLog(changesLog));
+ //nsPersister.initStorage(jcrSystem, addACL,
NamespaceRegistryImpl.DEF_NAMESPACES);
+ // nodeTypes save
+ // changesLog = new PlainChangesLogImpl();
+ // changesLog.addAll(ntPersister.initNodetypesRoot(jcrSystem,
+ // addACL).getAllStates());
+ //
changesLog.addAll(ntPersister.initStorage(nodeTypeDataManager.getAllNodeTypes()).getAllStates());
+ // ntPersister.saveChanges(changesLog);
+
+ // nodeTypeDataManager.initDefaultNodeTypes(addACL);
return jcrSystem;
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/JCRNodeTypeDataPersister.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/JCRNodeTypeDataPersister.java 2010-08-25
08:21:19 UTC (rev 2986)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/JCRNodeTypeDataPersister.java 2010-08-25
08:34:21 UTC (rev 2987)
@@ -153,14 +153,13 @@
if (addACL)
{
+ AccessControlList acl = new AccessControlList();
InternalQName[] mixins = new InternalQName[]{Constants.EXO_OWNEABLE,
Constants.EXO_PRIVILEGEABLE};
jcrNodetypes =
TransientNodeData.createNodeData(nsSystem, Constants.JCR_NODETYPES,
Constants.NT_UNSTRUCTURED, mixins,
Constants.NODETYPESROOT_UUID);
- AccessControlList acl = jcrNodetypes.getACL();
-
TransientPropertyData primaryType =
TransientPropertyData.createPropertyData(jcrNodetypes,
Constants.JCR_PRIMARYTYPE, PropertyType.NAME, false,
new TransientValueData(jcrNodetypes.getPrimaryTypeName()));
Deleted:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/access/TestRemoveNodeTypeNode.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/access/TestRemoveNodeTypeNode.java 2010-08-25
08:21:19 UTC (rev 2986)
+++
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/access/TestRemoveNodeTypeNode.java 2010-08-25
08:34:21 UTC (rev 2987)
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 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.access;
-
-import org.exoplatform.services.jcr.BaseStandaloneTest;
-import org.exoplatform.services.jcr.core.CredentialsImpl;
-
-import javax.jcr.AccessDeniedException;
-import javax.jcr.Credentials;
-import javax.jcr.Node;
-import javax.jcr.Repository;
-import javax.jcr.Session;
-
-/**
- * @author <a href="anatoliy.bazko(a)exoplatform.org">Anatoliy
Bazko</a>
- * @version $Id: TestRemoveSysteNode.java 111 2010-11-11 11:11:11Z tolusha $
- *
- */
-public class TestRemoveNodeTypeNode extends BaseStandaloneTest {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getRepositoryName() {
- return null;
- }
-
- public void testRemove() throws Exception {
- Repository repository = repositoryService.getRepository("db1tck");
- Credentials credentials = new CredentialsImpl("demo",
"exo".toCharArray());
- Session session = repository.login(credentials, "ws");
-
- Node node = session.getRootNode()
- .getNode("jcr:system")
- .getNode("jcr:nodetypes")
- .getNode("nt:base");
- try {
- node.remove();
- session.save();
-
- fail("Exception should be thrown.");
- } catch (AccessDeniedException e) {
- }
- }
-}