You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Ritu Kedia <RK...@saba.com> on 2004/06/18 17:06:43 UTC

RE: Auto Create Users is not working with BindingStore

Hello Slide	Dev Team,

I debugged this issue and fixed it locally. It was an API level bug and not
specific to any store. I am not familiar with the fix submission process.
Could someone familiar with BindingStore please review the fix?
The fix required modification to SecurityImpl:
SecurityImpl: public ObjectNode getPrincipal(SlideToken token)
I am attaching the modified method. My changes are surrounded by
comments://Added by Ritu -- starts & //Added by Ritu -- ends

Brief explanation of what the bug was:
The Bindings of the "/users" node were not getting added to the BINDING
table because the URI_STRING of URI was being compared to
"/users/<user_name>" instead of the uuri, in the storeObject(Connection
connection, Uri uri, ObjectNode object, boolean create) method of
StandardRDBMSAdapter.
*Snippet of the code which adds the binding:*
// update binding...
statement =
connection.prepareStatement(
"insert into BINDING (URI_ID, NAME, CHILD_UURI_ID) select ?, ?, URI_ID from
URI where URI_STRING = ?");
statement.setLong(1, uriid);
statement.setString(2, binding.getName());
statement.setString(3, binding.getUuri());
The binding.getUuri() was returning the resource name instead of the uuri.
The attached fix to getPrincipal method should explain the reason for above
error.

However this still leaves one issue unresolved... The Parent_Binding table
was not being updated with the new user. This too required a fix in the
getPrincipal method. Though that fix does not resolve the issue completely.
There is still a bug in the update Parent_Bindings code of the storeObject
method of StandardRDBMSAdapter.
*Snippet of the code which adds the Parent Bindings:*
statement =
connection.prepareStatement(
"insert into PARENT_BINDING (URI_ID, NAME, PARENT_UURI_ID) select ?, ?,
URI_ID from URI where URI_STRING = ?");
statement.setLong(1, uriid);
statement.setString(2, parentBinding.getName());
statement.setString(3, parentBinding.getUuri());
Here the "NAME" column of the Parent_Binding table should contain the name
of the Child and not the parent. However ResourceId has no method for
getting the Child resource name. Someone would need to look into this.

Regards,
Ritu





-----Original Message-----
From: Ritu Kedia [mailto:RKedia@saba.com]
Sent: Friday, June 18, 2004 2:30 PM
To: 'Slide Users Mailing List'
Subject: Auto Create Users is not working with BindingStore


On further investigation of the problem described below I observed that the
default users(root, guest) are being created. Sorry.. I was confused on the
first look at the URI table which had some nos (i.e. /1087541713531.0) in
the URI_STRING column instead of "/users" as in case of ExtendedStore. 

But this still leaves me with the problem of auto-create-users. This
functionality is not working with BindingStore. I observed that the new
users are being created in the URI table but the BINDING and PARENT_BINDING
tables are not being updated. Has anyone faced similar problem? I am using
Slide 2.1M1 with Oracle Store.

If it would be helpful: I debugged the code path on making an OPTIONS method
call to the Slide server with a new user. Here are my findings: The first
time the getPrincipal(SlideToken token) method is invoked on SecurityImpl,
the code path for creating a new user is entered since auto-create-users is
true. The *children* vector contains the newly added user and the
parentUri.getStore().storeObject(parentUri, object) call returns fine. When
the Slide server method returns, the URI table contains the new user entry
but the Parent_Binding and Binding tables do not have new entries for the
new user.   
Also via the code path(StandardRDBMSAdapter.storeObject(Connection, URI,
ObjectNode, boolean)) the bindings including the new user are being inserted
for "/users"... However the DB does not show those inserts on server call
return. Any idea of what could be going wrong?

Thanks for help,
Regards,
Ritu



-----Original Message-----
From: Ritu Kedia [mailto:RKedia@saba.com]
Sent: Thursday, June 17, 2004 5:56 PM
To: Slide Users Mailing List (E-mail)
Subject: Default Users not being created on first deployment when using
Bi ndingStore


Has anyone faced a problem with default user creation when using
BindingStore?

I switched from ExtendedStore to BindingStore... I deleted the Slide DB
Schema (Oracle) and recreated it. Modified my store classname to use
BindingStore. On Server deployment, the Initialization went through fine and
default roles and actions were created but the default users were not
created. I am getting a "Conflict 409" error on performing any action (e.g.
MKCOL). Could anyone please point what am I doing wrong. Note that
everything works fine with ExtendedStore. I am using Slide 2.1 M1.

Thanks for any help,
Regards,
Ritu





---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org