juergen 01/09/14 01:57:18
Modified: src/share/org/apache/slide/structure StructureImpl.java
Log:
The UriTokeniser does not use a SlideToken, therefor all access is read only. If
objects read by this Uri wants to be modified, they have to be re-read again.
Revision Changes Path
1.24 +12 -8
jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java
Index: StructureImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- StructureImpl.java 2001/09/02 09:37:58 1.23
+++ StructureImpl.java 2001/09/14 08:57:18 1.24
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.23
2001/09/02 09:37:58 cmlenz Exp $
- * $Revision: 1.23 $
- * $Date: 2001/09/02 09:37:58 $
+ * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.24
2001/09/14 08:57:18 juergen Exp $
+ * $Revision: 1.24 $
+ * $Date: 2001/09/14 08:57:18 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* Default implementation of the Structure interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
- * @version $Revision: 1.23 $
+ * @version $Revision: 1.24 $
*/
public final class StructureImpl implements Structure {
@@ -286,7 +286,7 @@
Enumeration roles = securityHelper.getRoles(object);
while (roles.hasMoreElements()) {
if (!securityHelper.hasRole(token, (String)roles.nextElement())) {
- // Allow only the namespace admin to create roles
+ // Allow only the namespace admin to create roles
// he doesn't have
Uri rootUri = namespace.getUri(token, "/");
ObjectNode rootObject =
@@ -413,9 +413,13 @@
// Now creating the new object
newObject.setUri(courUri.toString());
- courUri.getStore().createObject
- (courUri, newObject);
+ courUri.getStore().createObject(courUri, newObject);
+
+
+ // re-read the parent takink the forceEnlistment flag into
account
+ Uri parentUri = namespace.getUri(token, parentObject.getUri());
+ parentObject = parentUri.getStore().retrieveObject(parentUri);
// Add the newly created object to its parent's
// children list
parentObject.addChild(newObject);
@@ -497,7 +501,7 @@
Enumeration roles = securityHelper.getRoles(object);
while (roles.hasMoreElements()) {
if (!securityHelper.hasRole(token, (String)roles.nextElement())) {
- // Allow only the namespace admin to create roles
+ // Allow only the namespace admin to create roles
// he doesn't have
Uri rootUri = namespace.getUri(token, "/");
ObjectNode rootObject =